diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-06-03 18:47:52 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-06-04 10:09:13 -0700 |
commit | 860755faa6bdd3c2aeae49c05b87b5bc080ae60c (patch) | |
tree | 49cb794a0de5b8f505048533ac5daf02e95c94b1 /core/java/android/content/IntentSender.java | |
parent | f8acea6ccbdd7e7283b1dc439f49c72a937f746d (diff) | |
download | frameworks_base-860755faa6bdd3c2aeae49c05b87b5bc080ae60c.zip frameworks_base-860755faa6bdd3c2aeae49c05b87b5bc080ae60c.tar.gz frameworks_base-860755faa6bdd3c2aeae49c05b87b5bc080ae60c.tar.bz2 |
Add support for heavy-weight applications.
Only one can be running at a time, their process can not be killed,
and a notification is posted while it is running.
Change-Id: I843015723947e0c934ae63a1aeee139327c0bc01
Diffstat (limited to 'core/java/android/content/IntentSender.java')
-rw-r--r-- | core/java/android/content/IntentSender.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/content/IntentSender.java b/core/java/android/content/IntentSender.java index e182021..007a715 100644 --- a/core/java/android/content/IntentSender.java +++ b/core/java/android/content/IntentSender.java @@ -16,6 +16,7 @@ package android.content; +import android.app.ActivityManagerNative; import android.content.Context; import android.content.Intent; import android.content.IIntentSender; @@ -170,6 +171,25 @@ public class IntentSender implements Parcelable { } /** + * Return the package name of the application that created this + * IntentSender, that is the identity under which you will actually be + * sending the Intent. The returned string is supplied by the system, so + * that an application can not spoof its package. + * + * @return The package name of the PendingIntent, or null if there is + * none associated with it. + */ + public String getTargetPackage() { + try { + return ActivityManagerNative.getDefault() + .getPackageForIntentSender(mTarget); + } catch (RemoteException e) { + // Should never happen. + return null; + } + } + + /** * Comparison operator on two IntentSender objects, such that true * is returned then they both represent the same operation from the * same package. |