summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Rosky <erosky@google.com> 2023-06-20 16:54:25 -0700
committer Evan Rosky <erosky@google.com> 2023-06-21 09:39:17 -0700
commit34cf703bdb6721ae35bd3472200a12a1a4910705 (patch)
tree29ef0a6660c74e19123240652fa2a45955e98fa7
parent88bcdd1ed976cf5625426ed0e8f979eb02e39b49 (diff)
Also check PiP activity visibility to determine if enter-pip
Originally assumed that we could detect "commit to transient-launch" by the transient-launch task being visible at transition end; however, because we can't defer activity launches, if an activity launches after recents finishes, but before its finishTransition runs, the launcher may actually be visREquested=false and we'd then skip entering pip. Resolve this by also checking if the pip app became invisible during the transient-launch. This way, if either is true, we'll enter pip. Bug: 286729035 Test: swipe maps navigation to pip and, before anim finishes, launch an app. Change-Id: Ib4a1a199093f3266148ace0443eb800f69606cef
-rw-r--r--services/core/java/com/android/server/wm/Transition.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 3d9edcac8eb1..5f2d3ca8175b 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -979,7 +979,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
if (ar.pictureInPictureArgs != null && ar.pictureInPictureArgs.isAutoEnterEnabled()) {
- if (didCommitTransientLaunch()) {
+ if (!ar.getTask().isVisibleRequested() || didCommitTransientLaunch()) {
// force enable pip-on-task-switch now that we've committed to actually launching
// to the transient activity.
ar.supportsEnterPipOnTaskSwitch = true;
@@ -1008,7 +1008,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
// Legacy pip-entry (not via isAutoEnterEnabled).
- if (didCommitTransientLaunch() && ar.supportsPictureInPicture()) {
+ if ((!ar.getTask().isVisibleRequested() || didCommitTransientLaunch())
+ && ar.supportsPictureInPicture()) {
// force enable pip-on-task-switch now that we've committed to actually launching to the
// transient activity, and then recalculate whether we can attempt pip.
ar.supportsEnterPipOnTaskSwitch = true;