diff options
| author | Ashwini Oruganti <ashfall@google.com> | 2020-10-05 11:50:03 -0700 |
|---|---|---|
| committer | Ashwini Oruganti <ashfall@google.com> | 2021-01-06 03:03:40 +0000 |
| commit | dd12e9c10457665160bf01b12791568942a12dc7 (patch) | |
| tree | 24936f3568e0ada86e0b3b7d9d69cd4d82549690 /core/java | |
| parent | 6f0fe217c2c6df0676b3bad827962b1d86e25947 (diff) | |
Enforce that a PendingIntent has an explicit mutability
flag on creation.
This was previously a log.e, this change enforces this requirement.
See go/immutable-pendingintents for more context.
Bug: 160794467
Test: atest PendingIntentTest
Change-Id: If49be614125d7ac7eb556559ff32016f41beaef8
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/PendingIntent.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 9dbf1ff6f7c9..b8b9d9fc4026 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -352,7 +352,9 @@ public final class PendingIntent implements Parcelable { if (Compatibility.isChangeEnabled(PENDING_INTENT_EXPLICIT_MUTABILITY_REQUIRED) && !flagImmutableSet && !flagMutableSet) { - Log.e(TAG, msg); + Log.wtf(TAG, msg); + throw new IllegalArgumentException( + "Please specify an explicit mutability flag (FLAG_IMMUTABLE or FLAG_MUTABLE)"); } } |
