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

Commit c1f25be1 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

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

Change-Id: Ie4bb5088d03947e16addb9792a35f8c90625c03d
parents 07478ee9 e0c972a2
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);
        }
    }