From 19c85406cc993076dc93570dddee7e9d116a7f16 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 3 Apr 2017 15:04:20 -0700 Subject: Fixing issue with activity incorrectly auto-entering PiP. - When the PiP menu activity was brought forward, we were inadvertently setting the auto-enter supported flag for the PiP base activity as well, which would trigger auto-enter PiP once the activity is moved back to fullscreen and then subsequently finished. Bug: 36352343 Bug: 36364010 Test: android.server.cts.ActivityManagerPinnedStackTests Change-Id: Id1b800bf392d03b55562fb13374e33a5ff0ebda6 --- services/core/java/com/android/server/am/ActivityStack.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 498de63d11d8..aeae65d47df0 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2795,7 +2795,8 @@ class ActivityStack extends ConfigurationContai } else { // If a new task is being launched, then mark the existing top activity as // supporting picture-in-picture while pausing - if (focusedTopActivity != null) { + if (focusedTopActivity != null && + focusedTopActivity.getStack().getStackId() != PINNED_STACK_ID) { focusedTopActivity.supportsPictureInPictureWhilePausing = true; } transit = TRANSIT_TASK_OPEN; @@ -4403,7 +4404,7 @@ class ActivityStack extends ConfigurationContai } // If a new task is moved to the front, then mark the existing top activity as supporting // picture-in-picture while paused - if (topActivity != null) { + if (topActivity != null && topActivity.getStack().getStackId() != PINNED_STACK_ID) { topActivity.supportsPictureInPictureWhilePausing = true; } -- cgit v1.2.3-59-g8ed1b