diff options
| author | 2022-11-05 00:28:42 +0000 | |
|---|---|---|
| committer | 2022-11-05 00:28:42 +0000 | |
| commit | 7adf19f3fa66deb8f0ae088becedfe8e975abb66 (patch) | |
| tree | b9898779957e8e81ca9d985889d9095ba357252c | |
| parent | ec86264fcb4f00f97522ba911a39ad864468c976 (diff) | |
| parent | 41bf4e7cba7a15136192b23dbac6c53107531185 (diff) | |
Merge "Ensure that only SysUI can override pending intent launch flags" into qt-dev am: c741c6211c am: 41bf4e7cba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20219552
Change-Id: Iba23d44134c5a1b885a7a9a8b89918d7523624c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/am/PendingIntentRecord.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/PendingIntentRecord.java b/services/core/java/com/android/server/am/PendingIntentRecord.java index 1997dbd6fc37..818b70d61d89 100644 --- a/services/core/java/com/android/server/am/PendingIntentRecord.java +++ b/services/core/java/com/android/server/am/PendingIntentRecord.java @@ -326,11 +326,16 @@ public final class PendingIntentRecord extends IIntentSender.Stub { resolvedType = key.requestResolvedType; } - // Apply any launch flags from the ActivityOptions. This is to ensure that the caller - // can specify a consistent launch mode even if the PendingIntent is immutable + // Apply any launch flags from the ActivityOptions. This is used only by SystemUI + // to ensure that we can launch the pending intent with a consistent launch mode even + // if the provided PendingIntent is immutable (ie. to force an activity to launch into + // a new task, or to launch multiple instances if supported by the app) final ActivityOptions opts = ActivityOptions.fromBundle(options); if (opts != null) { - finalIntent.addFlags(opts.getPendingIntentLaunchFlags()); + // TODO(b/254490217): Move this check into SafeActivityOptions + if (controller.mAtmInternal.isCallerRecents(Binder.getCallingUid())) { + finalIntent.addFlags(opts.getPendingIntentLaunchFlags()); + } } // Extract options before clearing calling identity |