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

Commit f7f5c03e authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Fixes few corner issues of multi-window windowing mode split-screen"...

Merge "Fixes few corner issues of multi-window windowing mode split-screen" into sc-dev am: 57990479

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13877246

Change-Id: Iece16c6cc3c26fba5c8b3afff8b2ca9520d3f7e2
parents 92de4636 57990479
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -6060,12 +6060,10 @@ class Task extends WindowContainer<WindowContainer> {
                int idx = mChildren.size() - 1;
                int idx = mChildren.size() - 1;
                while (idx >= 0) {
                while (idx >= 0) {
                    final Task child = (Task) getChildAt(idx--);
                    final Task child = (Task) getChildAt(idx--);
                    if (!child.isFocusableAndVisible()) {
                    if (!child.isTopActivityFocusable()) {
                        break;
                        continue;
                    }
                    }

                    if (child.getVisibility(null /* starting */) != TASK_VISIBILITY_VISIBLE) {
                    // Only allow one activity to be resumed among sibling tasks in split-screen.
                    if (inSplitScreenWindowingMode() && someActivityResumed) {
                        break;
                        break;
                    }
                    }


+11 −0
Original line number Original line Diff line number Diff line
@@ -346,6 +346,12 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
        position = findPositionForRootTask(position, task, true /* adding */);
        position = findPositionForRootTask(position, task, true /* adding */);


        super.addChild(task, position);
        super.addChild(task, position);
        if (mPreferredTopFocusableRootTask != null
                && task.isFocusable()
                && mPreferredTopFocusableRootTask.compareTo(task) < 0) {
            // Clear preferred top because the adding focusable task has a higher z-order.
            mPreferredTopFocusableRootTask = null;
        }
        mAtmService.updateSleepIfNeededLocked();
        mAtmService.updateSleepIfNeededLocked();
        onRootTaskOrderChanged(task);
        onRootTaskOrderChanged(task);
    }
    }
@@ -439,6 +445,11 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
        // Update the top resumed activity because the preferred top focusable task may be changed.
        // Update the top resumed activity because the preferred top focusable task may be changed.
        mAtmService.mTaskSupervisor.updateTopResumedActivityIfNeeded();
        mAtmService.mTaskSupervisor.updateTopResumedActivityIfNeeded();


        final ActivityRecord r = child.getResumedActivity();
        if (r != null && r == mRootWindowContainer.getTopResumedActivity()) {
            mAtmService.setResumedActivityUncheckLocked(r, "positionChildAt");
        }

        if (mChildren.indexOf(child) != oldPosition) {
        if (mChildren.indexOf(child) != oldPosition) {
            onRootTaskOrderChanged(child);
            onRootTaskOrderChanged(child);
        }
        }
+4 −0
Original line number Original line Diff line number Diff line
@@ -2157,6 +2157,8 @@ public class ActivityRecordTests extends WindowTestsBase {
        attrs.setTitle("AppWindow");
        attrs.setTitle("AppWindow");
        final TestWindowState appWindow = createWindowState(attrs, activity);
        final TestWindowState appWindow = createWindowState(attrs, activity);
        activity.addWindow(appWindow);
        activity.addWindow(appWindow);
        spyOn(appWindow);
        doNothing().when(appWindow).onStartFreezingScreen();


        // Set initial orientation and update.
        // Set initial orientation and update.
        activity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
        activity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
@@ -2193,6 +2195,8 @@ public class ActivityRecordTests extends WindowTestsBase {
        attrs.setTitle("RotationByPolicy");
        attrs.setTitle("RotationByPolicy");
        final TestWindowState appWindow = createWindowState(attrs, activity);
        final TestWindowState appWindow = createWindowState(attrs, activity);
        activity.addWindow(appWindow);
        activity.addWindow(appWindow);
        spyOn(appWindow);
        doNothing().when(appWindow).onStartFreezingScreen();


        // Set initial orientation and update.
        // Set initial orientation and update.
        performRotation(displayRotation, Surface.ROTATION_90);
        performRotation(displayRotation, Surface.ROTATION_90);