Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbb81c98 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Allow caller dismissing split to specify top stack

When starting a non-resizeable activity while in split-mode it is
important the non-resizeable activity causing the dismisal of the split
end up on top. This change allows the callers of dismiss split to
specify which stack will be topmost.

Fixes: 152943129
Test: atest testNonResizeableWhenAlreadyInSplitScreenPrimary testNonResizeableWhenAlreadyInSplitScreenSecondary
Change-Id: Iefba54183273f1d075fbeacdcd87133eb1f2e3ad
parent 2ac0ece4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -757,7 +757,7 @@ class ActivityStack extends Task {
                // warning toast about it.
                mAtmService.getTaskChangeNotificationController()
                        .notifyActivityDismissingDockedStack();
                taskDisplayArea.onSplitScreenModeDismissed();
                taskDisplayArea.onSplitScreenModeDismissed(this);
            }
        }

+1 −1
Original line number Diff line number Diff line
@@ -2198,7 +2198,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
                // split-screen in split-screen.
                mService.getTaskChangeNotificationController()
                        .notifyActivityDismissingDockedStack();
                taskDisplayArea.onSplitScreenModeDismissed();
                taskDisplayArea.onSplitScreenModeDismissed(task.getStack());
                taskDisplayArea.mDisplayContent.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS,
                        true /* notifyClients */);
            }
+9 −3
Original line number Diff line number Diff line
@@ -1165,17 +1165,23 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
    }

    void onSplitScreenModeDismissed() {
        onSplitScreenModeDismissed(null /* toTop */);
    }

    void onSplitScreenModeDismissed(ActivityStack toTop) {
        mAtmService.deferWindowLayout();
        try {
            mLaunchRootTask = null;
            moveSplitScreenTasksToFullScreen();
        } finally {
            final ActivityStack topFullscreenStack =
                    getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN);
            final ActivityStack topFullscreenStack = toTop != null
                    ? toTop : getTopStackInWindowingMode(WINDOWING_MODE_FULLSCREEN);
            final ActivityStack homeStack = getOrCreateRootHomeTask();
            if (topFullscreenStack != null && homeStack != null && !isTopStack(homeStack)) {
            if (homeStack != null && ((topFullscreenStack != null && !isTopStack(homeStack))
                    || toTop != null)) {
                // Whenever split-screen is dismissed we want the home stack directly behind the
                // current top fullscreen stack so it shows up when the top stack is finished.
                // Or, if the caller specified a stack to be on top after split-screen is dismissed.
                // TODO: Would be better to use ActivityDisplay.positionChildAt() for this, however
                // ActivityDisplay doesn't have a direct controller to WM side yet. We can switch
                // once we have that.