summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ashwini Oruganti <ashfall@google.com> 2020-11-19 14:28:52 -0800
committer Ashwini Oruganti <ashfall@google.com> 2020-11-19 15:42:10 -0800
commit11a9f15e5f8dbfe4ef579e4cef52ad116a0dfa4d (patch)
tree23d879ad92d07e469ccc5e26c21e30783c998ade
parent24e5b93cc21b69e41f79625874d5a7868175eca5 (diff)
Update the docs for FLAG_UPDATE_CURRENT and FLAG_IMMUTABLE
to add how they interact with each other. This seems to be a common confusion for users. This change adds more context around what the two flags mean in terms of allowing changes to a PendingIntent and that it should be fine to use both together. Bug: 160794467 Test: Green builds Change-Id: I66f3744ca95252bdfebf8c9711eec7e8bfd059c8
-rw-r--r--core/java/android/app/PendingIntent.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index f76a75749480..9dbf1ff6f7c9 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -179,6 +179,12 @@ public final class PendingIntent implements Parcelable {
* extras change, and don't care that any entities that received your
* previous PendingIntent will be able to launch it with your new
* extras even if they are not explicitly given to it.
+ *
+ * <p>{@link #FLAG_UPDATE_CURRENT} still works even if {@link
+ * #FLAG_IMMUTABLE} is set - the creator of the PendingIntent can always
+ * update the PendingIntent itself. The IMMUTABLE flag only limits the
+ * ability to alter the semantics of the intent that is sent by {@link
+ * #send} by the invoker of {@link #send}.
*/
public static final int FLAG_UPDATE_CURRENT = 1<<27;
@@ -187,6 +193,11 @@ public final class PendingIntent implements Parcelable {
* This means that the additional intent argument passed to the send
* methods to fill in unpopulated properties of this intent will be
* ignored.
+ *
+ * <p>{@link #FLAG_IMMUTABLE} only limits the ability to alter the
+ * semantics of the intent that is sent by {@link #send} by the invoker of
+ * {@link #send}. The creator of the PendingIntent can always update the
+ * PendingIntent itself via {@link #FLAG_UPDATE_CURRENT}.
*/
public static final int FLAG_IMMUTABLE = 1<<26;