Loading services/core/java/com/android/server/wm/DisplayPolicy.java +19 −1 Original line number Diff line number Diff line Loading @@ -198,6 +198,11 @@ public class DisplayPolicy { private boolean mCanSystemBarsBeShownByUser; /** * Let remote insets controller control system bars regardless of other settings. */ private boolean mRemoteInsetsControllerControlsSystemBars; StatusBarManagerInternal getStatusBarManagerInternal() { synchronized (mServiceAcquireLock) { if (mStatusBarManagerInternal == null) { Loading Loading @@ -781,6 +786,17 @@ public class DisplayPolicy { return mScreenOnListener; } boolean isRemoteInsetsControllerControllingSystemBars() { return mRemoteInsetsControllerControlsSystemBars; } @VisibleForTesting void setRemoteInsetsControllerControlsSystemBars( boolean remoteInsetsControllerControlsSystemBars) { mRemoteInsetsControllerControlsSystemBars = remoteInsetsControllerControlsSystemBars; } public void screenTurnedOn(ScreenOnListener screenOnListener) { synchronized (mLock) { mScreenOnEarly = true; Loading Loading @@ -1664,6 +1680,8 @@ public class DisplayPolicy { mRightGestureInset = mGestureNavigationSettingsObserver.getRightSensitivity(res); mNavigationBarAlwaysShowOnSideGesture = res.getBoolean(R.bool.config_navBarAlwaysShowOnSideEdgeGesture); mRemoteInsetsControllerControlsSystemBars = res.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars); updateConfigurationAndScreenSizeDependentBehaviors(); Loading Loading @@ -2553,7 +2571,7 @@ public class DisplayPolicy { pw.print(mForceShowNavigationBarEnabled); pw.print(" mAllowLockscreenWhenOn="); pw.println(mAllowLockscreenWhenOn); pw.print(prefix); pw.print("mRemoteInsetsControllerControlsSystemBars="); pw.println(mDisplayContent.getInsetsPolicy().getRemoteInsetsControllerControlsSystemBars()); pw.println(mRemoteInsetsControllerControlsSystemBars); pw.print(prefix); pw.println("mDecorInsetsInfo:"); for (int rotation = 0; rotation < mDecorInsets.mInfoForRotation.length; rotation++) { final DecorInsets.Info info = mDecorInsets.mInfoForRotation[rotation]; Loading services/core/java/com/android/server/wm/InsetsPolicy.java +2 −19 Original line number Diff line number Diff line Loading @@ -116,11 +116,6 @@ class InsetsPolicy { private @InsetsType int mShowingTransientTypes; private boolean mAnimatingShown; /** * Let remote insets controller control system bars regardless of other settings. */ private boolean mRemoteInsetsControllerControlsSystemBars; private final boolean mHideNavBarForKeyboard; private final float[] mTmpFloat9 = new float[9]; Loading @@ -129,22 +124,9 @@ class InsetsPolicy { mDisplayContent = displayContent; mPolicy = displayContent.getDisplayPolicy(); final Resources r = mPolicy.getContext().getResources(); mRemoteInsetsControllerControlsSystemBars = r.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars); mHideNavBarForKeyboard = r.getBoolean(R.bool.config_hideNavBarForKeyboard); } boolean getRemoteInsetsControllerControlsSystemBars() { return mRemoteInsetsControllerControlsSystemBars; } /** * Used only for testing. */ @VisibleForTesting void setRemoteInsetsControllerControlsSystemBars(boolean controlsSystemBars) { mRemoteInsetsControllerControlsSystemBars = controlsSystemBars; } /** Updates the target which can control system bars. */ void updateBarControlTarget(@Nullable WindowState focusedWin) { Loading Loading @@ -632,7 +614,8 @@ class InsetsPolicy { if (focusedWin == null) { return false; } if (!mRemoteInsetsControllerControlsSystemBars) { if (!mPolicy.isRemoteInsetsControllerControllingSystemBars()) { return false; } if (mDisplayContent == null || mDisplayContent.mRemoteInsetsControlTarget == null) { Loading services/tests/wmtests/src/com/android/server/wm/InsetsPolicyTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ public class InsetsPolicyTest extends WindowTestsBase { @Test public void testControlsForDispatch_remoteInsetsControllerControlsBars_appHasNoControl() { mDisplayContent.setRemoteInsetsController(createDisplayWindowInsetsController()); mDisplayContent.getInsetsPolicy().setRemoteInsetsControllerControlsSystemBars(true); mDisplayContent.getDisplayPolicy().setRemoteInsetsControllerControlsSystemBars(true); addStatusBar(); addNavigationBar(); Loading services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ class WindowTestsBase extends SystemServiceTestsBase { beforeCreateTestDisplay(); mDisplayContent = createNewDisplayWithImeSupport(DISPLAY_IME_POLICY_LOCAL); addCommonWindows(annotation.addAllCommonWindows(), annotation.addWindows()); mDisplayContent.getInsetsPolicy().setRemoteInsetsControllerControlsSystemBars(false); mDisplayContent.getDisplayPolicy().setRemoteInsetsControllerControlsSystemBars(false); // Adding a display will cause freezing the display. Make sure to wait until it's // unfrozen to not run into race conditions with the tests. Loading Loading
services/core/java/com/android/server/wm/DisplayPolicy.java +19 −1 Original line number Diff line number Diff line Loading @@ -198,6 +198,11 @@ public class DisplayPolicy { private boolean mCanSystemBarsBeShownByUser; /** * Let remote insets controller control system bars regardless of other settings. */ private boolean mRemoteInsetsControllerControlsSystemBars; StatusBarManagerInternal getStatusBarManagerInternal() { synchronized (mServiceAcquireLock) { if (mStatusBarManagerInternal == null) { Loading Loading @@ -781,6 +786,17 @@ public class DisplayPolicy { return mScreenOnListener; } boolean isRemoteInsetsControllerControllingSystemBars() { return mRemoteInsetsControllerControlsSystemBars; } @VisibleForTesting void setRemoteInsetsControllerControlsSystemBars( boolean remoteInsetsControllerControlsSystemBars) { mRemoteInsetsControllerControlsSystemBars = remoteInsetsControllerControlsSystemBars; } public void screenTurnedOn(ScreenOnListener screenOnListener) { synchronized (mLock) { mScreenOnEarly = true; Loading Loading @@ -1664,6 +1680,8 @@ public class DisplayPolicy { mRightGestureInset = mGestureNavigationSettingsObserver.getRightSensitivity(res); mNavigationBarAlwaysShowOnSideGesture = res.getBoolean(R.bool.config_navBarAlwaysShowOnSideEdgeGesture); mRemoteInsetsControllerControlsSystemBars = res.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars); updateConfigurationAndScreenSizeDependentBehaviors(); Loading Loading @@ -2553,7 +2571,7 @@ public class DisplayPolicy { pw.print(mForceShowNavigationBarEnabled); pw.print(" mAllowLockscreenWhenOn="); pw.println(mAllowLockscreenWhenOn); pw.print(prefix); pw.print("mRemoteInsetsControllerControlsSystemBars="); pw.println(mDisplayContent.getInsetsPolicy().getRemoteInsetsControllerControlsSystemBars()); pw.println(mRemoteInsetsControllerControlsSystemBars); pw.print(prefix); pw.println("mDecorInsetsInfo:"); for (int rotation = 0; rotation < mDecorInsets.mInfoForRotation.length; rotation++) { final DecorInsets.Info info = mDecorInsets.mInfoForRotation[rotation]; Loading
services/core/java/com/android/server/wm/InsetsPolicy.java +2 −19 Original line number Diff line number Diff line Loading @@ -116,11 +116,6 @@ class InsetsPolicy { private @InsetsType int mShowingTransientTypes; private boolean mAnimatingShown; /** * Let remote insets controller control system bars regardless of other settings. */ private boolean mRemoteInsetsControllerControlsSystemBars; private final boolean mHideNavBarForKeyboard; private final float[] mTmpFloat9 = new float[9]; Loading @@ -129,22 +124,9 @@ class InsetsPolicy { mDisplayContent = displayContent; mPolicy = displayContent.getDisplayPolicy(); final Resources r = mPolicy.getContext().getResources(); mRemoteInsetsControllerControlsSystemBars = r.getBoolean( R.bool.config_remoteInsetsControllerControlsSystemBars); mHideNavBarForKeyboard = r.getBoolean(R.bool.config_hideNavBarForKeyboard); } boolean getRemoteInsetsControllerControlsSystemBars() { return mRemoteInsetsControllerControlsSystemBars; } /** * Used only for testing. */ @VisibleForTesting void setRemoteInsetsControllerControlsSystemBars(boolean controlsSystemBars) { mRemoteInsetsControllerControlsSystemBars = controlsSystemBars; } /** Updates the target which can control system bars. */ void updateBarControlTarget(@Nullable WindowState focusedWin) { Loading Loading @@ -632,7 +614,8 @@ class InsetsPolicy { if (focusedWin == null) { return false; } if (!mRemoteInsetsControllerControlsSystemBars) { if (!mPolicy.isRemoteInsetsControllerControllingSystemBars()) { return false; } if (mDisplayContent == null || mDisplayContent.mRemoteInsetsControlTarget == null) { Loading
services/tests/wmtests/src/com/android/server/wm/InsetsPolicyTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ public class InsetsPolicyTest extends WindowTestsBase { @Test public void testControlsForDispatch_remoteInsetsControllerControlsBars_appHasNoControl() { mDisplayContent.setRemoteInsetsController(createDisplayWindowInsetsController()); mDisplayContent.getInsetsPolicy().setRemoteInsetsControllerControlsSystemBars(true); mDisplayContent.getDisplayPolicy().setRemoteInsetsControllerControlsSystemBars(true); addStatusBar(); addNavigationBar(); Loading
services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +1 −1 Original line number Diff line number Diff line Loading @@ -312,7 +312,7 @@ class WindowTestsBase extends SystemServiceTestsBase { beforeCreateTestDisplay(); mDisplayContent = createNewDisplayWithImeSupport(DISPLAY_IME_POLICY_LOCAL); addCommonWindows(annotation.addAllCommonWindows(), annotation.addWindows()); mDisplayContent.getInsetsPolicy().setRemoteInsetsControllerControlsSystemBars(false); mDisplayContent.getDisplayPolicy().setRemoteInsetsControllerControlsSystemBars(false); // Adding a display will cause freezing the display. Make sure to wait until it's // unfrozen to not run into race conditions with the tests. Loading