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

Commit 1ba4fcf0 authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Resume appSwitchesAllowed after exit PiP" into sc-v2-dev

parents 9a33c9de 1b599135
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -4581,14 +4581,15 @@ class Task extends TaskFragment {
            }
            super.setWindowingMode(windowingMode);

            // Try reparent pinned activity back to its original task after onConfigurationChanged
            // cascade finishes. This is done on Task level instead of
            // {@link ActivityRecord#onConfigurationChanged(Configuration)} since when we exit PiP,
            // we set final windowing mode on the ActivityRecord first and then on its Task when
            // the exit PiP transition finishes. Meanwhile, the exit transition is always
            // performed on its original task, reparent immediately in ActivityRecord breaks it.
            if (currentMode == WINDOWING_MODE_PINNED) {
                if (topActivity != null && topActivity.getLastParentBeforePip() != null) {
            if (currentMode == WINDOWING_MODE_PINNED && topActivity != null) {
                // Try reparent pinned activity back to its original task after
                // onConfigurationChanged cascade finishes. This is done on Task level instead of
                // {@link ActivityRecord#onConfigurationChanged(Configuration)} since when we exit
                // PiP, we set final windowing mode on the ActivityRecord first and then on its
                // Task when the exit PiP transition finishes. Meanwhile, the exit transition is
                // always performed on its original task, reparent immediately in ActivityRecord
                // breaks it.
                if (topActivity.getLastParentBeforePip() != null) {
                    // Do not reparent if the pinned task is in removal, indicated by the
                    // force hidden flag.
                    if (!isForceHidden()) {
@@ -4601,6 +4602,11 @@ class Task extends TaskFragment {
                        }
                    }
                }
                // Resume app-switches-allowed flag when exiting from pinned mode since
                // it does not follow the ActivityStarter path.
                if (topActivity.shouldBeVisible()) {
                    mAtmService.resumeAppSwitches();
                }
            }

            if (creating) {