commit | 291d124257f6e46862a813305892b02b9a8f851c | [log] [tgz] |
---|---|---|
author | Hani Kazmi <hanikazmi@google.com> | Mon May 22 15:19:10 2023 +0000 |
committer | Hani Kazmi <hanikazmi@google.com> | Wed May 24 15:26:37 2023 +0000 |
tree | 51b66d8193c22bd0d1a8e65992ec39aee24e2a0e | |
parent | 6c3482b1b93099c6d0dc65a938645346d7d6fac5 [diff] |
Update Pip launches to not enter pinned task if in background. Addresses a BAL bypass where Pip could be started without the launcher being visible. Bug: 271576718 Test: atest CtsWindowManagerDeviceTestCases:PinnedStackTests Test: atest android.server.wm.BackgroundActivityLaunchTest#testPipCannotStartFromBackground (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b263d3beed7a412ac342c63956f213b70d6e2679) Merged-In: Icfe0a17d7f6f127acaae8400a97e8bdc53fcc9ad Change-Id: Icfe0a17d7f6f127acaae8400a97e8bdc53fcc9ad
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index d1a5ead..4d5238a 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -1709,7 +1709,8 @@ // If Activity's launching into PiP, move the mStartActivity immediately to pinned mode. // Note that mStartActivity and source should be in the same Task at this point. if (mOptions != null && mOptions.isLaunchIntoPip() - && sourceRecord != null && sourceRecord.getTask() == mStartActivity.getTask()) { + && sourceRecord != null && sourceRecord.getTask() == mStartActivity.getTask() + && balCode != BAL_BLOCK) { mRootWindowContainer.moveActivityToPinnedRootTask(mStartActivity, sourceRecord, "launch-into-pip"); }