Merge "Exit split-screen when primary stack moved behind a fullscreen stack."
This commit is contained in:
committed by
Android (Google) Code Review
commit
499d82fe80
@@ -1013,6 +1013,14 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The intent behind moving a primary split screen stack to the back is usually to hide
|
||||
* behind the home stack. Exit split screen in this case.
|
||||
*/
|
||||
if (getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
|
||||
setWindowingMode(WINDOWING_MODE_FULLSCREEN);
|
||||
}
|
||||
|
||||
getDisplay().positionChildAtBottom(this);
|
||||
mStackSupervisor.setFocusStackUnchecked(reason, getDisplay().getTopStack());
|
||||
if (task != null) {
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.junit.Test;
|
||||
* Tests for the {@link ActivityStack} class.
|
||||
*
|
||||
* Build/Install/Run:
|
||||
* bit FrameworksServicesTests:com.android.server.am.ActivityStackTests
|
||||
* atest ActivityStackTests
|
||||
*/
|
||||
@SmallTest
|
||||
@Presubmit
|
||||
@@ -103,6 +103,29 @@ public class ActivityStackTests extends ActivityTestsBase {
|
||||
assertEquals(mStack.mResumedActivity, r);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrimarySplitScreenToFullscreenWhenMovedToBack() throws Exception {
|
||||
// Create primary splitscreen stack. This will create secondary stacks and places the
|
||||
// existing fullscreen stack on the bottom.
|
||||
final ActivityStack primarySplitScreen = mService.mStackSupervisor.getDefaultDisplay()
|
||||
.createStack(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, ACTIVITY_TYPE_STANDARD,
|
||||
true /* onTop */);
|
||||
|
||||
// Assert windowing mode.
|
||||
assertEquals(primarySplitScreen.getWindowingMode(), WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
|
||||
|
||||
// Move primary to back.
|
||||
primarySplitScreen.moveToBack("testPrimarySplitScreenToFullscreenWhenMovedToBack",
|
||||
null /* task */);
|
||||
|
||||
// Assert that stack is at the bottom.
|
||||
assertEquals(mService.mStackSupervisor.getDefaultDisplay().getIndexOf(primarySplitScreen),
|
||||
0);
|
||||
|
||||
// Ensure no longer in splitscreen.
|
||||
assertEquals(primarySplitScreen.getWindowingMode(), WINDOWING_MODE_FULLSCREEN);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStopActivityWhenActivityDestroyed() throws Exception {
|
||||
final ActivityRecord r = new ActivityBuilder(mService).setTask(mTask).build();
|
||||
|
||||
Reference in New Issue
Block a user