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

Commit 745050ad authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't allow PI crashes on unknown sender types" into sc-dev am: e0c972a2 am: c1f25be1

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

Change-Id: Ic000dd83985f4a49013bcab56badacbe429b2395
parents a7bc837e c1f25be1
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -405,6 +405,12 @@ public class ActivityManager {
     */
    public static final int BROADCAST_FAILED_USER_STOPPED = -2;

    /**
     * Type for IActivityManaqer.getIntentSender: this PendingIntent type is unknown.
     * @hide
     */
    public static final int INTENT_SENDER_UNKNOWN = 0;

    /**
     * Type for IActivityManaqer.getIntentSender: this PendingIntent is
     * for a sendBroadcast operation.
@@ -4860,12 +4866,12 @@ public class ActivityManager {
     */
    public static final class PendingIntentInfo implements Parcelable {

        private final String mCreatorPackage;
        @Nullable private final String mCreatorPackage;
        private final int mCreatorUid;
        private final boolean mImmutable;
        private final int mIntentSenderType;

        public PendingIntentInfo(String creatorPackage, int creatorUid, boolean immutable,
        public PendingIntentInfo(@Nullable String creatorPackage, int creatorUid, boolean immutable,
                int intentSenderType) {
            mCreatorPackage = creatorPackage;
            mCreatorUid = creatorUid;
@@ -4873,6 +4879,7 @@ public class ActivityManager {
            mIntentSenderType = intentSenderType;
        }

        @Nullable
        public String getCreatorPackage() {
            return mCreatorPackage;
        }
+1 −1
Original line number Diff line number Diff line
@@ -5018,7 +5018,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    (res.key.flags & PendingIntent.FLAG_IMMUTABLE) != 0,
                    res.key.type);
        } else {
            throw new IllegalArgumentException();
            return new PendingIntentInfo(null, -1, false, ActivityManager.INTENT_SENDER_UNKNOWN);
        }
    }