summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2019-04-23 22:43:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-23 22:43:34 +0000
commit3f5447d8ae200bc37ebbef23423d5eb1468c62e7 (patch)
tree63c728e2edd29b771879eb77881c9a515686f9d5 /core/java
parent7f127b9c562523d634076c5813da1d5d46b3e02f (diff)
parent100838dc7fb8606d9384c2ee6323649ab0d71948 (diff)
Merge "Finish up Intent identifier implementation." into qt-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/content/Intent.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index e66cd31a0641..389832815d77 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -39,7 +39,6 @@ import android.content.pm.ShortcutInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Rect;
-import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@@ -8609,6 +8608,13 @@ public class Intent implements Parcelable, Cloneable {
* fields, the identifier is <em>never</em> used for matching against an {@link IntentFilter};
* it is as if the identifier has not been set on the Intent.
*
+ * <p>This can be used, for example, to make this Intent unique from other Intents that
+ * are otherwise the same, for use in creating a {@link android.app.PendingIntent}. (Be aware
+ * however that the receiver of the PendingIntent will see whatever you put in here.) The
+ * structure of this string is completely undefined by the platform, however if you are going
+ * to be exposing identifier strings across different applications you may need to define
+ * your own structure if there is no central party defining the contents of this field.</p>
+ *
* @param identifier The identifier for this Intent. The contents of the string have no
* meaning to the system, except whether they are exactly the same as
* another identifier.
@@ -10181,6 +10187,9 @@ public class Intent implements Parcelable, Cloneable {
if (mType != null) {
proto.write(IntentProto.TYPE, mType);
}
+ if (mIdentifier != null) {
+ proto.write(IntentProto.IDENTIFIER, mIdentifier);
+ }
if (mFlags != 0) {
proto.write(IntentProto.FLAG, "0x" + Integer.toHexString(mFlags));
}