Loading core/java/android/view/ViewRootImpl.java +0 −15 Original line number Diff line number Diff line Loading @@ -294,21 +294,6 @@ public final class ViewRootImpl implements ViewParent, */ private static final int SCROLL_CAPTURE_REQUEST_TIMEOUT_MILLIS = 2500; /** * If set to {@code true}, the new logic to layout system bars as normal window and to use * layout result to get insets will be applied. Otherwise, the old hard-coded window logic will * be applied. */ private static final String USE_FLEXIBLE_INSETS = "persist.debug.flexible_insets"; /** * A flag to indicate to use the new generalized insets window logic, or the old hard-coded * insets window layout logic. * {@hide} */ public static final boolean INSETS_LAYOUT_GENERALIZATION = SystemProperties.getBoolean(USE_FLEXIBLE_INSETS, true); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) static final ThreadLocal<HandlerActionQueue> sRunQueues = new ThreadLocal<HandlerActionQueue>(); Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +40 −45 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGAT import static android.view.Display.DEFAULT_DISPLAY; import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.containsType; import static android.view.ViewRootImpl.INSETS_LAYOUT_GENERALIZATION; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; Loading Loading @@ -131,10 +130,10 @@ import com.android.systemui.navigationbar.gestural.QuickswitchOrientedNavHandle; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.recents.Recents; import com.android.systemui.shared.rotation.RotationButton; import com.android.systemui.shared.rotation.RotationButtonController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.recents.utilities.Utilities; import com.android.systemui.shared.rotation.RotationButton; import com.android.systemui.shared.rotation.RotationButtonController; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.AutoHideUiElement; Loading Loading @@ -1606,7 +1605,6 @@ public class NavigationBar implements View.OnAttachStateChangeListener, int height = WindowManager.LayoutParams.MATCH_PARENT; int insetsHeight = -1; int gravity = Gravity.BOTTOM; if (INSETS_LAYOUT_GENERALIZATION) { boolean navBarCanMove = true; if (mWindowManager != null && mWindowManager.getCurrentWindowMetrics() != null) { Rect displaySize = mWindowManager.getCurrentWindowMetrics().getBounds(); Loading Loading @@ -1641,7 +1639,6 @@ public class NavigationBar implements View.OnAttachStateChangeListener, break; } } } WindowManager.LayoutParams lp = new WindowManager.LayoutParams( width, height, Loading @@ -1653,14 +1650,12 @@ public class NavigationBar implements View.OnAttachStateChangeListener, | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH | WindowManager.LayoutParams.FLAG_SLIPPERY, PixelFormat.TRANSLUCENT); if (INSETS_LAYOUT_GENERALIZATION) { lp.gravity = gravity; if (insetsHeight != -1) { lp.providedInternalInsets = Insets.of(0, height - insetsHeight, 0, 0); } else { lp.providedInternalInsets = Insets.NONE; } } lp.token = new Binder(); lp.accessibilityTitle = mContext.getString(R.string.nav_bar); lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java +1 −21 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.view.ViewRootImpl.INSETS_LAYOUT_GENERALIZATION; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR; Loading Loading @@ -136,25 +134,7 @@ public class StatusBarWindowController { } private WindowManager.LayoutParams getBarLayoutParamsForRotation(int rotation) { int height = mBarHeight; if (INSETS_LAYOUT_GENERALIZATION) { switch (rotation) { case ROTATION_UNDEFINED: case Surface.ROTATION_0: case Surface.ROTATION_180: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_0); break; case Surface.ROTATION_90: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_90); break; case Surface.ROTATION_270: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_270); break; } } int height = SystemBarUtils.getStatusBarHeightForRotation(mContext, rotation); WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, height, Loading services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -8972,7 +8972,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final int dh = rotated ? display.mBaseDisplayWidth : display.mBaseDisplayHeight; final DisplayCutout cutout = display.calculateDisplayCutoutForRotation(rotation) .getDisplayCutout(); policy.getNonDecorInsetsLw(rotation, dw, dh, cutout, mNonDecorInsets[rotation]); policy.getNonDecorInsetsLw(rotation, cutout, mNonDecorInsets[rotation]); mStableInsets[rotation].set(mNonDecorInsets[rotation]); policy.convertNonDecorInsetsToStableInsets(mStableInsets[rotation], rotation); Loading services/core/java/com/android/server/wm/DisplayContent.java +5 −5 Original line number Diff line number Diff line Loading @@ -2027,7 +2027,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp final int appWidth = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); mDisplayInfo.rotation = rotation; mDisplayInfo.logicalWidth = dw; Loading Loading @@ -2165,9 +2165,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp int rotation, int uiMode, DisplayCutout displayCutout) { final int appWidth = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); mDisplayPolicy.getNonDecorInsetsLw(rotation, dw, dh, displayCutout, mTmpRect); mDisplayPolicy.getNonDecorInsetsLw(rotation, displayCutout, mTmpRect); final int leftInset = mTmpRect.left; final int topInset = mTmpRect.top; // AppBounds at the root level should mirror the app screen size. Loading Loading @@ -2321,7 +2321,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp rotation).getDisplayCutout(); dm.noncompatWidthPixels = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); dm.noncompatHeightPixels = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, dm.noncompatHeightPixels = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); float scale = CompatibilityInfo.computeCompatibleScaling(dm, null); int size = (int)(((dm.noncompatWidthPixels / scale) / dm.density) + .5f); Loading Loading @@ -2375,7 +2375,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Get the app screen size at this rotation. int w = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); int h = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, displayCutout); int h = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); // Compute the screen layout size class for this rotation. int longSize = w; Loading Loading
core/java/android/view/ViewRootImpl.java +0 −15 Original line number Diff line number Diff line Loading @@ -294,21 +294,6 @@ public final class ViewRootImpl implements ViewParent, */ private static final int SCROLL_CAPTURE_REQUEST_TIMEOUT_MILLIS = 2500; /** * If set to {@code true}, the new logic to layout system bars as normal window and to use * layout result to get insets will be applied. Otherwise, the old hard-coded window logic will * be applied. */ private static final String USE_FLEXIBLE_INSETS = "persist.debug.flexible_insets"; /** * A flag to indicate to use the new generalized insets window logic, or the old hard-coded * insets window layout logic. * {@hide} */ public static final boolean INSETS_LAYOUT_GENERALIZATION = SystemProperties.getBoolean(USE_FLEXIBLE_INSETS, true); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) static final ThreadLocal<HandlerActionQueue> sRunQueues = new ThreadLocal<HandlerActionQueue>(); Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +40 −45 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGAT import static android.view.Display.DEFAULT_DISPLAY; import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.containsType; import static android.view.ViewRootImpl.INSETS_LAYOUT_GENERALIZATION; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; Loading Loading @@ -131,10 +130,10 @@ import com.android.systemui.navigationbar.gestural.QuickswitchOrientedNavHandle; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.recents.Recents; import com.android.systemui.shared.rotation.RotationButton; import com.android.systemui.shared.rotation.RotationButtonController; import com.android.systemui.settings.UserTracker; import com.android.systemui.shared.recents.utilities.Utilities; import com.android.systemui.shared.rotation.RotationButton; import com.android.systemui.shared.rotation.RotationButtonController; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.AutoHideUiElement; Loading Loading @@ -1606,7 +1605,6 @@ public class NavigationBar implements View.OnAttachStateChangeListener, int height = WindowManager.LayoutParams.MATCH_PARENT; int insetsHeight = -1; int gravity = Gravity.BOTTOM; if (INSETS_LAYOUT_GENERALIZATION) { boolean navBarCanMove = true; if (mWindowManager != null && mWindowManager.getCurrentWindowMetrics() != null) { Rect displaySize = mWindowManager.getCurrentWindowMetrics().getBounds(); Loading Loading @@ -1641,7 +1639,6 @@ public class NavigationBar implements View.OnAttachStateChangeListener, break; } } } WindowManager.LayoutParams lp = new WindowManager.LayoutParams( width, height, Loading @@ -1653,14 +1650,12 @@ public class NavigationBar implements View.OnAttachStateChangeListener, | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH | WindowManager.LayoutParams.FLAG_SLIPPERY, PixelFormat.TRANSLUCENT); if (INSETS_LAYOUT_GENERALIZATION) { lp.gravity = gravity; if (insetsHeight != -1) { lp.providedInternalInsets = Insets.of(0, height - insetsHeight, 0, 0); } else { lp.providedInternalInsets = Insets.NONE; } } lp.token = new Binder(); lp.accessibilityTitle = mContext.getString(R.string.nav_bar); lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java +1 −21 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui.statusbar.phone; import static android.app.WindowConfiguration.ROTATION_UNDEFINED; import static android.view.ViewRootImpl.INSETS_LAYOUT_GENERALIZATION; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR; Loading Loading @@ -136,25 +134,7 @@ public class StatusBarWindowController { } private WindowManager.LayoutParams getBarLayoutParamsForRotation(int rotation) { int height = mBarHeight; if (INSETS_LAYOUT_GENERALIZATION) { switch (rotation) { case ROTATION_UNDEFINED: case Surface.ROTATION_0: case Surface.ROTATION_180: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_0); break; case Surface.ROTATION_90: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_90); break; case Surface.ROTATION_270: height = SystemBarUtils.getStatusBarHeightForRotation( mContext, Surface.ROTATION_270); break; } } int height = SystemBarUtils.getStatusBarHeightForRotation(mContext, rotation); WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, height, Loading
services/core/java/com/android/server/wm/ActivityRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -8972,7 +8972,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final int dh = rotated ? display.mBaseDisplayWidth : display.mBaseDisplayHeight; final DisplayCutout cutout = display.calculateDisplayCutoutForRotation(rotation) .getDisplayCutout(); policy.getNonDecorInsetsLw(rotation, dw, dh, cutout, mNonDecorInsets[rotation]); policy.getNonDecorInsetsLw(rotation, cutout, mNonDecorInsets[rotation]); mStableInsets[rotation].set(mNonDecorInsets[rotation]); policy.convertNonDecorInsetsToStableInsets(mStableInsets[rotation], rotation); Loading
services/core/java/com/android/server/wm/DisplayContent.java +5 −5 Original line number Diff line number Diff line Loading @@ -2027,7 +2027,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp final int appWidth = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); mDisplayInfo.rotation = rotation; mDisplayInfo.logicalWidth = dw; Loading Loading @@ -2165,9 +2165,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp int rotation, int uiMode, DisplayCutout displayCutout) { final int appWidth = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, final int appHeight = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); mDisplayPolicy.getNonDecorInsetsLw(rotation, dw, dh, displayCutout, mTmpRect); mDisplayPolicy.getNonDecorInsetsLw(rotation, displayCutout, mTmpRect); final int leftInset = mTmpRect.left; final int topInset = mTmpRect.top; // AppBounds at the root level should mirror the app screen size. Loading Loading @@ -2321,7 +2321,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp rotation).getDisplayCutout(); dm.noncompatWidthPixels = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); dm.noncompatHeightPixels = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, dm.noncompatHeightPixels = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); float scale = CompatibilityInfo.computeCompatibleScaling(dm, null); int size = (int)(((dm.noncompatWidthPixels / scale) / dm.density) + .5f); Loading Loading @@ -2375,7 +2375,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // Get the app screen size at this rotation. int w = mDisplayPolicy.getNonDecorDisplayWidth(dw, dh, rotation, uiMode, displayCutout); int h = mDisplayPolicy.getNonDecorDisplayHeight(dw, dh, rotation, uiMode, displayCutout); int h = mDisplayPolicy.getNonDecorDisplayHeight(dh, rotation, displayCutout); // Compute the screen layout size class for this rotation. int longSize = w; Loading