Loading services/core/java/com/android/server/wm/AppWindowToken.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -207,6 +207,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean removed; boolean removed; // Information about an application starting window if displayed. // Information about an application starting window if displayed. // Note: these are de-referenced before the starting window animates away. StartingData mStartingData; StartingData mStartingData; WindowState startingWindow; WindowState startingWindow; StartingSurface startingSurface; StartingSurface startingSurface; Loading Loading @@ -1249,6 +1250,21 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return true; return true; } } /** * @return {@code true} if starting window is in app's hierarchy. */ boolean hasStartingWindow() { if (startingDisplayed || mStartingData != null) { return true; } for (int i = mChildren.size() - 1; i >= 0; i--) { if (getChildAt(i).mAttrs.type == TYPE_APPLICATION_STARTING) { return true; } } return false; } @Override @Override void addWindow(WindowState w) { void addWindow(WindowState w) { super.addWindow(w); super.addWindow(w); Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -4871,9 +4871,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // // // In the case where we have no IME target we assign it where it's base layer would // In the case where we have no IME target we assign it where it's base layer would // place it in the AboveAppWindowContainers. // place it in the AboveAppWindowContainers. if (imeTarget != null && !(imeTarget.inSplitScreenWindowingMode() // || imeTarget.mToken.isAppAnimating()) // Keep IME window in mAboveAppWindowsContainers as long as app's starting window exists && (imeTarget.getSurfaceControl() != null)) { // so it get's layered above the starting window. if (imeTarget != null && !(imeTarget.mAppToken != null && imeTarget.mAppToken.hasStartingWindow()) && (!(imeTarget.inSplitScreenWindowingMode() || imeTarget.mToken.isAppAnimating()) && (imeTarget.getSurfaceControl() != null))) { mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure // TODO: We need to use an extra level on the app surface to ensure // this is always above SurfaceView but always below attached window. // this is always above SurfaceView but always below attached window. Loading services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -504,6 +504,21 @@ public class AppWindowTokenTests extends WindowTestsBase { assertEquals(stackBounds, mToken.getAnimationBounds(STACK_CLIP_BEFORE_ANIM)); assertEquals(stackBounds, mToken.getAnimationBounds(STACK_CLIP_BEFORE_ANIM)); } } @Test public void testHasStartingWindow() { final WindowManager.LayoutParams attrs = new WindowManager.LayoutParams(TYPE_APPLICATION_STARTING); final WindowTestUtils.TestWindowState startingWindow = createWindowState(attrs, mToken); mToken.startingDisplayed = true; mToken.addWindow(startingWindow); assertTrue("Starting window should be present", mToken.hasStartingWindow()); mToken.startingDisplayed = false; assertTrue("Starting window should be present", mToken.hasStartingWindow()); mToken.removeChild(startingWindow); assertFalse("Starting window should not be present", mToken.hasStartingWindow()); } private void assertHasStartingWindow(AppWindowToken atoken) { private void assertHasStartingWindow(AppWindowToken atoken) { assertNotNull(atoken.startingSurface); assertNotNull(atoken.startingSurface); assertNotNull(atoken.mStartingData); assertNotNull(atoken.mStartingData); Loading Loading
services/core/java/com/android/server/wm/AppWindowToken.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -207,6 +207,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean removed; boolean removed; // Information about an application starting window if displayed. // Information about an application starting window if displayed. // Note: these are de-referenced before the starting window animates away. StartingData mStartingData; StartingData mStartingData; WindowState startingWindow; WindowState startingWindow; StartingSurface startingSurface; StartingSurface startingSurface; Loading Loading @@ -1249,6 +1250,21 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return true; return true; } } /** * @return {@code true} if starting window is in app's hierarchy. */ boolean hasStartingWindow() { if (startingDisplayed || mStartingData != null) { return true; } for (int i = mChildren.size() - 1; i >= 0; i--) { if (getChildAt(i).mAttrs.type == TYPE_APPLICATION_STARTING) { return true; } } return false; } @Override @Override void addWindow(WindowState w) { void addWindow(WindowState w) { super.addWindow(w); super.addWindow(w); Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -4871,9 +4871,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // // // In the case where we have no IME target we assign it where it's base layer would // In the case where we have no IME target we assign it where it's base layer would // place it in the AboveAppWindowContainers. // place it in the AboveAppWindowContainers. if (imeTarget != null && !(imeTarget.inSplitScreenWindowingMode() // || imeTarget.mToken.isAppAnimating()) // Keep IME window in mAboveAppWindowsContainers as long as app's starting window exists && (imeTarget.getSurfaceControl() != null)) { // so it get's layered above the starting window. if (imeTarget != null && !(imeTarget.mAppToken != null && imeTarget.mAppToken.hasStartingWindow()) && (!(imeTarget.inSplitScreenWindowingMode() || imeTarget.mToken.isAppAnimating()) && (imeTarget.getSurfaceControl() != null))) { mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure // TODO: We need to use an extra level on the app surface to ensure // this is always above SurfaceView but always below attached window. // this is always above SurfaceView but always below attached window. Loading
services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java +15 −0 Original line number Original line Diff line number Diff line Loading @@ -504,6 +504,21 @@ public class AppWindowTokenTests extends WindowTestsBase { assertEquals(stackBounds, mToken.getAnimationBounds(STACK_CLIP_BEFORE_ANIM)); assertEquals(stackBounds, mToken.getAnimationBounds(STACK_CLIP_BEFORE_ANIM)); } } @Test public void testHasStartingWindow() { final WindowManager.LayoutParams attrs = new WindowManager.LayoutParams(TYPE_APPLICATION_STARTING); final WindowTestUtils.TestWindowState startingWindow = createWindowState(attrs, mToken); mToken.startingDisplayed = true; mToken.addWindow(startingWindow); assertTrue("Starting window should be present", mToken.hasStartingWindow()); mToken.startingDisplayed = false; assertTrue("Starting window should be present", mToken.hasStartingWindow()); mToken.removeChild(startingWindow); assertFalse("Starting window should not be present", mToken.hasStartingWindow()); } private void assertHasStartingWindow(AppWindowToken atoken) { private void assertHasStartingWindow(AppWindowToken atoken) { assertNotNull(atoken.startingSurface); assertNotNull(atoken.startingSurface); assertNotNull(atoken.mStartingData); assertNotNull(atoken.mStartingData); Loading