Loading services/core/java/com/android/server/am/ActivityStack.java +13 −1 Original line number Diff line number Diff line Loading @@ -1769,9 +1769,11 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } final ActivityDisplay display = getDisplay(); boolean gotSplitScreenStack = false; boolean gotOpaqueSplitScreenPrimary = false; boolean gotOpaqueSplitScreenSecondary = false; final int windowingMode = getWindowingMode(); final boolean isAssistantType = isActivityTypeAssistant(); for (int i = display.getChildCount() - 1; i >= 0; --i) { final ActivityStack other = display.getChildAt(i); if (other == this) { Loading @@ -1789,6 +1791,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return false; } else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY && !gotOpaqueSplitScreenPrimary) { gotSplitScreenStack = true; gotOpaqueSplitScreenPrimary = !other.isStackTranslucent(starting); if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY Loading @@ -1798,6 +1801,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY && !gotOpaqueSplitScreenSecondary) { gotSplitScreenStack = true; gotOpaqueSplitScreenSecondary = !other.isStackTranslucent(starting); if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY Loading @@ -1811,6 +1815,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // the screen are opaque. return false; } if (isAssistantType && gotSplitScreenStack) { // Assistant stack can't be visible behind split-screen. In addition to this not // making sense, it also works around an issue here we boost the z-order of the // assistant window surfaces in window manager whenever it is visible. return false; } } // Well, nothing is stopping you from being visible... Loading Loading @@ -5259,7 +5269,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return "ActivityStack{" + Integer.toHexString(System.identityHashCode(this)) + " stackId=" + mStackId + " type=" + activityTypeToString(getActivityType()) + " mode=" + windowingModeToString(getWindowingMode()) + " visible=" + shouldBeVisible(null /* starting */) + ", " + " visible=" + shouldBeVisible(null /* starting */) + " translucent=" + isStackTranslucent(null /* starting */) + ", " + mTaskHistory.size() + " tasks}"; } Loading services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java +11 −1 Original line number Diff line number Diff line Loading @@ -222,7 +222,7 @@ public class ActivityStackTests extends ActivityTestsBase { assertFalse(splitScreenSecondary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); // First split-screen secondary should be visible behind another translucent split-split // First split-screen secondary should be visible behind another translucent split-screen // secondary. splitScreenSecondary2.setIsTranslucent(true); assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */)); Loading @@ -244,6 +244,16 @@ public class ActivityStackTests extends ActivityTestsBase { assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); // Assistant stack shouldn't be visible behind translucent split-screen stack assistantStack.setIsTranslucent(false); splitScreenPrimary.setIsTranslucent(true); splitScreenSecondary2.setIsTranslucent(true); splitScreenSecondary2.moveToFront("testShouldBeVisible_SplitScreen"); splitScreenPrimary.moveToFront("testShouldBeVisible_SplitScreen"); assertFalse(assistantStack.shouldBeVisible(null /* starting */)); assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); } @Test Loading Loading
services/core/java/com/android/server/am/ActivityStack.java +13 −1 Original line number Diff line number Diff line Loading @@ -1769,9 +1769,11 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } final ActivityDisplay display = getDisplay(); boolean gotSplitScreenStack = false; boolean gotOpaqueSplitScreenPrimary = false; boolean gotOpaqueSplitScreenSecondary = false; final int windowingMode = getWindowingMode(); final boolean isAssistantType = isActivityTypeAssistant(); for (int i = display.getChildCount() - 1; i >= 0; --i) { final ActivityStack other = display.getChildAt(i); if (other == this) { Loading @@ -1789,6 +1791,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return false; } else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY && !gotOpaqueSplitScreenPrimary) { gotSplitScreenStack = true; gotOpaqueSplitScreenPrimary = !other.isStackTranslucent(starting); if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY Loading @@ -1798,6 +1801,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai } } else if (otherWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY && !gotOpaqueSplitScreenSecondary) { gotSplitScreenStack = true; gotOpaqueSplitScreenSecondary = !other.isStackTranslucent(starting); if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY Loading @@ -1811,6 +1815,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // the screen are opaque. return false; } if (isAssistantType && gotSplitScreenStack) { // Assistant stack can't be visible behind split-screen. In addition to this not // making sense, it also works around an issue here we boost the z-order of the // assistant window surfaces in window manager whenever it is visible. return false; } } // Well, nothing is stopping you from being visible... Loading Loading @@ -5259,7 +5269,9 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai return "ActivityStack{" + Integer.toHexString(System.identityHashCode(this)) + " stackId=" + mStackId + " type=" + activityTypeToString(getActivityType()) + " mode=" + windowingModeToString(getWindowingMode()) + " visible=" + shouldBeVisible(null /* starting */) + ", " + " visible=" + shouldBeVisible(null /* starting */) + " translucent=" + isStackTranslucent(null /* starting */) + ", " + mTaskHistory.size() + " tasks}"; } Loading
services/tests/servicestests/src/com/android/server/am/ActivityStackTests.java +11 −1 Original line number Diff line number Diff line Loading @@ -222,7 +222,7 @@ public class ActivityStackTests extends ActivityTestsBase { assertFalse(splitScreenSecondary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); // First split-screen secondary should be visible behind another translucent split-split // First split-screen secondary should be visible behind another translucent split-screen // secondary. splitScreenSecondary2.setIsTranslucent(true); assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */)); Loading @@ -244,6 +244,16 @@ public class ActivityStackTests extends ActivityTestsBase { assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); // Assistant stack shouldn't be visible behind translucent split-screen stack assistantStack.setIsTranslucent(false); splitScreenPrimary.setIsTranslucent(true); splitScreenSecondary2.setIsTranslucent(true); splitScreenSecondary2.moveToFront("testShouldBeVisible_SplitScreen"); splitScreenPrimary.moveToFront("testShouldBeVisible_SplitScreen"); assertFalse(assistantStack.shouldBeVisible(null /* starting */)); assertTrue(splitScreenPrimary.shouldBeVisible(null /* starting */)); assertTrue(splitScreenSecondary2.shouldBeVisible(null /* starting */)); } @Test Loading