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
This commit is contained in:
@@ -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)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user