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

Commit 0c5b8e27 authored by Surajit Chandra's avatar Surajit Chandra Committed by Android (Google) Code Review
Browse files

Revert "Check Bundle when creating/sending a PendingIntent"

Revert submission 25930905-b320664730

Reason for revert: Reason for revert: Potential culprit for b/321623319 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:25930905-b320664730

Change-Id: I8a1a8cf753e2568499cb95fe8770185b019c0e30
parent 07c634ab
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -179,14 +179,6 @@ public final class PendingIntent implements Parcelable {
    @Overridable
    public static final long BLOCK_MUTABLE_IMPLICIT_PENDING_INTENT = 236704164L;

    /**
     * Validate options passed in as bundle.
     * @hide
     */
    @ChangeId
    @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
    public static final long PENDING_INTENT_OPTIONS_CHECK = 320664730L;

    /** @hide */
    @IntDef(flag = true,
            value = {
+0 −6
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.app.ActivityOptions;
import android.app.AppGlobals;
import android.app.PendingIntent;
import android.app.PendingIntentStats;
import android.app.compat.CompatChanges;
import android.content.IIntentSender;
import android.content.Intent;
import android.os.Binder;
@@ -137,11 +136,6 @@ public class PendingIntentController {
                        + "intent creator ("
                        + packageName
                        + ") because this option is meant for the pending intent sender");
                if (CompatChanges.isChangeEnabled(PendingIntent.PENDING_INTENT_OPTIONS_CHECK,
                        callingUid)) {
                    throw new IllegalArgumentException("pendingIntentBackgroundActivityStartMode "
                            + "must not be set when creating a PendingIntent");
                }
                opts.setPendingIntentBackgroundActivityStartMode(
                        ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED);
            }
+3 −9
Original line number Diff line number Diff line
@@ -406,9 +406,6 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
            String resolvedType, IBinder allowlistToken, IIntentReceiver finishedReceiver,
            String requiredPermission, IBinder resultTo, String resultWho, int requestCode,
            int flagsMask, int flagsValues, Bundle options) {
        final int callingUid = Binder.getCallingUid();
        final int callingPid = Binder.getCallingPid();

        if (intent != null) intent.setDefusable(true);
        if (options != null) options.setDefusable(true);

@@ -461,12 +458,6 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
                                    + key.packageName
                                    + ") because this option is meant for the pending intent "
                                    + "creator");
                    if (CompatChanges.isChangeEnabled(PendingIntent.PENDING_INTENT_OPTIONS_CHECK,
                            callingUid)) {
                        throw new IllegalArgumentException(
                                "pendingIntentCreatorBackgroundActivityStartMode "
                                + "must not be set when sending a PendingIntent");
                    }
                    opts.setPendingIntentCreatorBackgroundActivityStartMode(
                            ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED);
                }
@@ -503,6 +494,9 @@ public final class PendingIntentRecord extends IIntentSender.Stub {
        }
        // We don't hold the controller lock beyond this point as we will be calling into AM and WM.

        final int callingUid = Binder.getCallingUid();
        final int callingPid = Binder.getCallingPid();

        // Only system senders can declare a broadcast to be alarm-originated.  We check
        // this here rather than in the general case handling below to fail before the other
        // invocation side effects such as allowlisting.