From 4aede8abc6d4a3a6252138c607e14c465cb196ab Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 5 Jul 2017 12:23:25 -0700 Subject: [PATCH] Disable auto-enter PIP when launching an assistant activity Bug: 36785193 Test: Open auto-enter PiP app, and launch the assistant Test: go/wm-smoke Change-Id: I1e43e8738e6a5b92585d2cd5fbb889ee236cf090 --- .../core/java/com/android/server/am/ActivityStack.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 9cde985989874..0295f18c28785 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2882,8 +2882,9 @@ 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 && - focusedTopActivity.getStack().getStackId() != PINNED_STACK_ID) { + if (focusedTopActivity != null + && focusedTopActivity.getStackId() != PINNED_STACK_ID + && r.getStackId() != ASSISTANT_STACK_ID) { focusedTopActivity.supportsPictureInPictureWhilePausing = true; } transit = TRANSIT_TASK_OPEN; @@ -4549,7 +4550,8 @@ 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 && topActivity.getStack().getStackId() != PINNED_STACK_ID) { + if (topActivity != null && topActivity.getStackId() != PINNED_STACK_ID + && tr.getStackId() != ASSISTANT_STACK_ID) { topActivity.supportsPictureInPictureWhilePausing = true; }