Merge "Resume appSwitchesAllowed after exit PiP" into sc-v2-dev am: 1ba4fcf076

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

Change-Id: Iaf34303cb7d368d58a2feb730b2bf64220078e01
This commit is contained in:
Hongwei Wang
2021-12-08 17:02:39 +00:00
committed by Automerger Merge Worker

View File

@@ -4584,14 +4584,15 @@ class Task extends TaskFragment {
} }
super.setWindowingMode(windowingMode); super.setWindowingMode(windowingMode);
// Try reparent pinned activity back to its original task after onConfigurationChanged if (currentMode == WINDOWING_MODE_PINNED && topActivity != null) {
// cascade finishes. This is done on Task level instead of // Try reparent pinned activity back to its original task after
// {@link ActivityRecord#onConfigurationChanged(Configuration)} since when we exit PiP, // onConfigurationChanged cascade finishes. This is done on Task level instead of
// we set final windowing mode on the ActivityRecord first and then on its Task when // {@link ActivityRecord#onConfigurationChanged(Configuration)} since when we exit
// the exit PiP transition finishes. Meanwhile, the exit transition is always // PiP, we set final windowing mode on the ActivityRecord first and then on its
// performed on its original task, reparent immediately in ActivityRecord breaks it. // Task when the exit PiP transition finishes. Meanwhile, the exit transition is
if (currentMode == WINDOWING_MODE_PINNED) { // always performed on its original task, reparent immediately in ActivityRecord
if (topActivity != null && topActivity.getLastParentBeforePip() != null) { // breaks it.
if (topActivity.getLastParentBeforePip() != null) {
// Do not reparent if the pinned task is in removal, indicated by the // Do not reparent if the pinned task is in removal, indicated by the
// force hidden flag. // force hidden flag.
if (!isForceHidden()) { if (!isForceHidden()) {
@@ -4604,6 +4605,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) { if (creating) {