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

Commit 8fba7cf9 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Don't allow PI crashes on unknown sender types

Bug: 193207800
Test: presubmits
Change-Id: I2a674549f4cfe45841dc0094709666c25c2d743b
parent 457feb05
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
@@ -5003,7 +5003,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);
        }
    }