diff options
| author | 2022-05-10 16:07:49 -0700 | |
|---|---|---|
| committer | 2022-05-10 16:10:30 -0700 | |
| commit | ac9edf2f9310cd21d16f066444ab61f79bd29a00 (patch) | |
| tree | a212e2fb51242b9a9756fc35fb92be25601157cd | |
| parent | 03ffb3babed398dd67cface64f2a43fd742b469b (diff) | |
Use the pre-reset userLeaving for canPipOnFinish
mUserLeaving is reset at the beginning of the function which was
making many activity-start scenarios not actually enter pip when
they should-have.
Bug: 231150295
Test: open auto-pip app. swipe to home.
Change-Id: I8f02cd190565f5b105de31d663acc1258e0fa035
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 85305cc6403f..0d447e34502e 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -1674,6 +1674,7 @@ class ActivityStarter { private @Nullable Task handleStartResult(@NonNull ActivityRecord started, ActivityOptions options, int result, Transition newTransition, RemoteTransition remoteTransition) { + final boolean userLeaving = mSupervisor.mUserLeaving; mSupervisor.mUserLeaving = false; final Task currentRootTask = started.getRootTask(); final Task startedActivityRootTask = @@ -1747,7 +1748,7 @@ class ActivityStarter { // until after we launched to identify the relevant activity. transitionController.setTransientLaunch(mLastStartActivityRecord, mPriorAboveTask); } - if (!mSupervisor.mUserLeaving) { + if (!userLeaving) { // no-user-leaving implies not entering PiP. transitionController.setCanPipOnFinish(false /* canPipOnFinish */); } |