summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 5c096ecbba04..5500229af7be 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -3292,6 +3292,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return false;
}
+ // Check if this activity is the top activity of its task - this prevents any trampolines
+ // followed by enterPictureInPictureMode() calls by an activity from below in its stack.
+ if (getTask().getTopMostActivity() != this) {
+ return false;
+ }
+
// Check to see if PiP is supported for the display this container is on.
if (mDisplayContent != null && !mDisplayContent.mDwpcHelper.isEnteringPipAllowed(
getUid())) {