Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c2cf31f authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Ensure that only SysUI can override pending intent launch flags" into...

Merge "Ensure that only SysUI can override pending intent launch flags" into qt-dev am: c741c621 am: 41bf4e7c am: 7adf19f3 am: 99f48340 am: 2dc64f37 am: e8f89077 am: 87b44f8b am: e288ef9d am: 0207409f am: 1874df51 am: d2c6d0c5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20219552



Change-Id: I9b58d4e87fad233135cce8e1555dff9c486474db
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6328e472 d2c6d0c5
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -396,12 +396,17 @@ 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) {
                // TODO(b/254490217): Move this check into SafeActivityOptions
                if (controller.mAtmInternal.isCallerRecents(Binder.getCallingUid())) {
                    finalIntent.addFlags(opts.getPendingIntentLaunchFlags());
                }
            }

            // Extract options before clearing calling identity
            mergedOptions = key.options;