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

Commit ee7ebdbe authored by Chilun's avatar Chilun
Browse files

Clean up the legacy split screen (5/n)

Clean up legacy split screen from TaskDisplayArea and related class.

Bug: 199236198
Test: atest TaskDisplayAreaTests
      atest ActivityTaskSupervisorTests DisplayContentTests \
            LaunchParamsControllerTests RootWindowContainerTests \
	    TaskTests WindowStateTests
Change-Id: I5c700aa4a899b698a828c0e55c91a6ef75e73f0a
parent 85b897d6
Loading
Loading
Loading
Loading
+2 −18
Original line number Diff line number Diff line
@@ -2224,26 +2224,10 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
            return;
        }

        if (!task.supportsSplitScreenWindowingMode() || forceNonResizable) {
            if (task.mTransitionController.isShellTransitionsEnabled()) return;
            // Dismiss docked root task. If task appeared to be in docked root task but is not
            // resizable - we need to move it to top of fullscreen root task, otherwise it will
            // be covered.
            final TaskDisplayArea taskDisplayArea = task.getDisplayArea();
            if (taskDisplayArea.isSplitScreenModeActivated()) {
                // Display a warning toast that we tried to put an app that doesn't support
                // split-screen in split-screen.
                mService.getTaskChangeNotificationController()
                        .notifyActivityDismissingDockedRootTask();
                taskDisplayArea.onSplitScreenModeDismissed(task);
                taskDisplayArea.mDisplayContent.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS,
                        true /* notifyClients */);
            }
            return;
        }

        if (!forceNonResizable) {
            handleForcedResizableTaskIfNeeded(task, FORCED_RESIZEABLE_REASON_SPLIT_SCREEN);
        }
    }

    /** Notifies that the top activity of the task is forced to be resizeable. */
    private void handleForcedResizableTaskIfNeeded(Task task, int reason) {
+1 −17
Original line number Diff line number Diff line
@@ -3054,13 +3054,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
        }
        amendWindowTapExcludeRegion(mTouchExcludeRegion);
        // TODO(multi-display): Support docked root tasks on secondary displays & task containers.
        if (mDisplayId == DEFAULT_DISPLAY
                && getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
            mDividerControllerLocked.getTouchRegion(mTmpRect);
            mTmpRegion.set(mTmpRect);
            mTouchExcludeRegion.op(mTmpRegion, Op.UNION);
        }
        mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion);
    }

@@ -3451,12 +3444,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        if (rootPinnedTask != null) {
            pw.println(prefix + "rootPinnedTask=" + rootPinnedTask.getName());
        }
        final Task rootSplitScreenPrimaryTask = getDefaultTaskDisplayArea()
                .getRootSplitScreenPrimaryTask();
        if (rootSplitScreenPrimaryTask != null) {
            pw.println(
                    prefix + "rootSplitScreenPrimaryTask=" + rootSplitScreenPrimaryTask.getName());
        }
        // TODO: Support recents on non-default task containers
        final Task rootRecentsTask = getDefaultTaskDisplayArea().getRootTask(
                WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_RECENTS);
@@ -4860,13 +4847,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        }

        private static boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
            // We skip IME windows so they're processed just above their target, except
            // in split-screen mode where we process the IME containers above the docked divider.
            // We skip IME windows so they're processed just above their target.
            // Note that this method check should align with {@link
            // WindowState#applyImeWindowsIfNeeded} in case of any state mismatch.
            return dc.mImeLayeringTarget != null
                    && (!dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated()
                             || dc.mImeLayeringTarget.getTask() == null)
                    // Make sure that the IME window won't be skipped to report that it has
                    // completed the orientation change.
                    && !dc.mWmService.mDisplayFrozen;
+0 −10
Original line number Diff line number Diff line
@@ -450,16 +450,6 @@ class KeyguardController {
            return;
        }

        // Dismiss split screen
        // The lock screen is currently showing, but is occluded by a window that can
        // show on top of the lock screen. In this can we want to dismiss the docked
        // stack since it will be complicated/risky to try to put the activity on top
        // of the lock screen in the right fullscreen configuration.
        final TaskDisplayArea taskDisplayArea = mRootWindowContainer.getDefaultTaskDisplayArea();
        if (taskDisplayArea.isSplitScreenModeActivated()) {
            taskDisplayArea.onSplitScreenModeDismissed();
        }

        // Dismiss freeform windowing mode
        if (currentTaskControllingOcclusion == null) {
            return;
+1 −3
Original line number Diff line number Diff line
@@ -150,10 +150,8 @@ class LaunchParamsController {

            if (mTmpParams.hasWindowingMode() && task.isRootTask()
                    && mTmpParams.mWindowingMode != task.getWindowingMode()) {
                final int activityType = activity != null
                        ? activity.getActivityType() : task.getActivityType();
                task.setWindowingMode(task.getDisplayArea().validateWindowingMode(
                        mTmpParams.mWindowingMode, activity, task, activityType));
                        mTmpParams.mWindowingMode, activity, task));
            }

            if (mTmpParams.mBounds.isEmpty()) {
+3 −10
Original line number Diff line number Diff line
@@ -1907,10 +1907,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        final Task topFocusedRootTask = getTopDisplayFocusedRootTask();
        final int focusRootTaskId = topFocusedRootTask != null
                ? topFocusedRootTask.getRootTaskId() : INVALID_TASK_ID;
        // We dismiss the docked root task whenever we switch users.
        if (getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
            getDefaultTaskDisplayArea().onSplitScreenModeDismissed();
        }
        // Also dismiss the pinned root task whenever we switch users. Removing the pinned root task
        // will also cause all tasks to be moved to the fullscreen root task at a position that is
        // appropriate.
@@ -2872,8 +2868,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            container = rootTask.getDisplayArea();
            if (container != null && canLaunchOnDisplay(r, container.mDisplayContent.mDisplayId)) {
                if (windowingMode == WindowConfiguration.WINDOWING_MODE_UNDEFINED) {
                    windowingMode = container.resolveWindowingMode(r, options, candidateTask,
                            activityType);
                    windowingMode = container.resolveWindowingMode(r, options, candidateTask);
                }
                // Always allow organized tasks that created by organizer since the activity type
                // of an organized task is decided by the activity type of its top child, which
@@ -2889,8 +2884,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                || !canLaunchOnDisplay(r, container.mDisplayContent.mDisplayId)) {
            container = getDefaultTaskDisplayArea();
            if (windowingMode == WindowConfiguration.WINDOWING_MODE_UNDEFINED) {
                windowingMode = container.resolveWindowingMode(r, options, candidateTask,
                        activityType);
                windowingMode = container.resolveWindowingMode(r, options, candidateTask);
            }
        }

@@ -2952,8 +2946,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            windowingMode = options != null ? options.getLaunchWindowingMode()
                    : r.getWindowingMode();
        }
        windowingMode = taskDisplayArea.validateWindowingMode(windowingMode, r, candidateTask,
                r.getActivityType());
        windowingMode = taskDisplayArea.validateWindowingMode(windowingMode, r, candidateTask);

        // Return the topmost valid root task on the display.
        final int targetWindowingMode = windowingMode;
Loading