From 44dea867b6271f43be04c9a90db15f66ceaef32e Mon Sep 17 00:00:00 2001 From: Ashwini Oruganti Date: Tue, 27 Oct 2020 10:52:39 -0700 Subject: [PATCH] Add a PendingIntent flag to mark unaudited PI mutability This change adds a FLAG_MUTABLE_UNAUDITED that is equal in value to FLAG_MUTABLE but is intended to be used with PendingIntents that have not yet been audited to be intentionally mutable/immutable. This will help us update the tree to work with the enforced explicit mutability flag requirement (go/immutable-pendingintents has more context). This flag is marked as deprecated and we hope to remove it once all PIs have been audited and use either FLAG_MUTABLE or FLAG_IMMUTABLE. FLAG_MUTABLE_UNAUDITED should not be relied on long term, and any usage is intended to be short term. Bug: 160794467 Test: TH Change-Id: I6a4f65d5364a611620b88e92c208aba7faaa13b8 --- core/java/android/app/PendingIntent.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 1f81c44e54cb3..37c4c92d06350 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -130,6 +130,7 @@ public final class PendingIntent implements Parcelable { FLAG_UPDATE_CURRENT, FLAG_IMMUTABLE, FLAG_MUTABLE, + FLAG_MUTABLE_UNAUDITED, Intent.FILL_IN_ACTION, Intent.FILL_IN_DATA, @@ -204,6 +205,13 @@ public final class PendingIntent implements Parcelable { */ public static final int FLAG_MUTABLE = 1<<25; + /** + * @deprecated Use {@link #FLAG_IMMUTABLE} or {@link #FLAG_MUTABLE} instead. + * @hide + */ + @Deprecated + public static final int FLAG_MUTABLE_UNAUDITED = FLAG_MUTABLE; + /** * Exception thrown when trying to send through a PendingIntent that * has been canceled or is otherwise no longer able to execute the request.