Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import static android.view.Display.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD; import static android.view.Display.FLAG_PRIVATE; import static android.view.Display.FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS; import static android.view.Display.INVALID_DISPLAY; import static android.view.Display.REMOVE_MODE_DESTROY_CONTENT; import static android.view.Display.STATE_UNKNOWN; import static android.view.Display.isSuspendedState; import static android.view.InsetsSource.ID_IME; Loading Loading @@ -80,6 +79,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static android.view.WindowManager.REMOVE_CONTENT_MODE_DESTROY; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_NONE; import static android.view.WindowManager.TRANSIT_OPEN; Loading Loading @@ -6556,7 +6556,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp @VisibleForTesting boolean shouldDestroyContentOnRemove() { return mDisplay.getRemoveMode() == REMOVE_MODE_DESTROY_CONTENT; return getRemoveContentMode() == REMOVE_CONTENT_MODE_DESTROY; } @WindowManager.RemoveContentMode int getRemoveContentMode() { return mWmService.mDisplayWindowSettings.getRemoveContentModeLocked(this); } boolean shouldSleep() { Loading services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -7656,7 +7656,7 @@ public class WindowManagerService extends IWindowManager.Stub displayId); return REMOVE_CONTENT_MODE_UNDEFINED; } return mDisplayWindowSettings.getRemoveContentModeLocked(displayContent); return displayContent.getRemoveContentMode(); } } Loading services/tests/wmtests/src/com/android/server/wm/DisplayWindowSettingsTests.java +10 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,16 @@ public class DisplayWindowSettingsTests extends WindowTestsBase { public void testPublicDisplayDefaultToMoveToPrimary() { assertEquals(REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY, mDisplayWindowSettings.getRemoveContentModeLocked(mSecondaryDisplay)); // Sets the remove-content-mode and make sure the mode is updated. mDisplayWindowSettings.setRemoveContentModeLocked(mSecondaryDisplay, REMOVE_CONTENT_MODE_DESTROY); final int removeContentMode = mDisplayWindowSettings.getRemoveContentModeLocked( mSecondaryDisplay); assertEquals(REMOVE_CONTENT_MODE_DESTROY, removeContentMode); doReturn(removeContentMode).when(mSecondaryDisplay).getRemoveContentMode(); assertTrue(mSecondaryDisplay.shouldDestroyContentOnRemove()); } @Test Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import static android.view.Display.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD; import static android.view.Display.FLAG_PRIVATE; import static android.view.Display.FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS; import static android.view.Display.INVALID_DISPLAY; import static android.view.Display.REMOVE_MODE_DESTROY_CONTENT; import static android.view.Display.STATE_UNKNOWN; import static android.view.Display.isSuspendedState; import static android.view.InsetsSource.ID_IME; Loading Loading @@ -80,6 +79,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static android.view.WindowManager.REMOVE_CONTENT_MODE_DESTROY; import static android.view.WindowManager.TRANSIT_CHANGE; import static android.view.WindowManager.TRANSIT_NONE; import static android.view.WindowManager.TRANSIT_OPEN; Loading Loading @@ -6556,7 +6556,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp @VisibleForTesting boolean shouldDestroyContentOnRemove() { return mDisplay.getRemoveMode() == REMOVE_MODE_DESTROY_CONTENT; return getRemoveContentMode() == REMOVE_CONTENT_MODE_DESTROY; } @WindowManager.RemoveContentMode int getRemoveContentMode() { return mWmService.mDisplayWindowSettings.getRemoveContentModeLocked(this); } boolean shouldSleep() { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -7656,7 +7656,7 @@ public class WindowManagerService extends IWindowManager.Stub displayId); return REMOVE_CONTENT_MODE_UNDEFINED; } return mDisplayWindowSettings.getRemoveContentModeLocked(displayContent); return displayContent.getRemoveContentMode(); } } Loading
services/tests/wmtests/src/com/android/server/wm/DisplayWindowSettingsTests.java +10 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,16 @@ public class DisplayWindowSettingsTests extends WindowTestsBase { public void testPublicDisplayDefaultToMoveToPrimary() { assertEquals(REMOVE_CONTENT_MODE_MOVE_TO_PRIMARY, mDisplayWindowSettings.getRemoveContentModeLocked(mSecondaryDisplay)); // Sets the remove-content-mode and make sure the mode is updated. mDisplayWindowSettings.setRemoveContentModeLocked(mSecondaryDisplay, REMOVE_CONTENT_MODE_DESTROY); final int removeContentMode = mDisplayWindowSettings.getRemoveContentModeLocked( mSecondaryDisplay); assertEquals(REMOVE_CONTENT_MODE_DESTROY, removeContentMode); doReturn(removeContentMode).when(mSecondaryDisplay).getRemoveContentMode(); assertTrue(mSecondaryDisplay.shouldDestroyContentOnRemove()); } @Test Loading