diff options
| -rw-r--r-- | core/java/android/content/Intent.java | 11 | ||||
| -rw-r--r-- | core/proto/android/content/intent.proto | 3 |
2 files changed, 12 insertions, 2 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)); } diff --git a/core/proto/android/content/intent.proto b/core/proto/android/content/intent.proto index 2de538d358c4..014d71c6fcf8 100644 --- a/core/proto/android/content/intent.proto +++ b/core/proto/android/content/intent.proto @@ -23,7 +23,7 @@ import "frameworks/base/core/proto/android/content/component_name.proto"; import "frameworks/base/core/proto/android/os/patternmatcher.proto"; import "frameworks/base/core/proto/android/privacy.proto"; -// Next Tag: 13 +// Next Tag: 14 message IntentProto { option (.android.msg_privacy).dest = DEST_AUTOMATIC; @@ -62,6 +62,7 @@ message IntentProto { // UserHandle value (similar to user_id in other protos). optional int32 content_user_hint = 11; optional string selector = 12; + optional string identifier = 13 [ (.android.privacy).dest = DEST_EXPLICIT ]; } // Next Tag: 11 |