summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/Activity.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-04-11 18:08:42 -0700
committerDianne Hackborn <hackbod@google.com>2013-04-11 18:12:56 -0700
commit7b924671792787d0dd367dd0d0fede56e2d2b940 (patch)
treea1dfbffd7db104301628c56b1cd5ff1c369695b7 /core/java/android/app/Activity.java
parent77216642884d5131290803776b0fce4d68128e97 (diff)
downloadframeworks_base-7b924671792787d0dd367dd0d0fede56e2d2b940.zip
frameworks_base-7b924671792787d0dd367dd0d0fede56e2d2b940.tar.gz
frameworks_base-7b924671792787d0dd367dd0d0fede56e2d2b940.tar.bz2
Fix issue #7643046: Activity.getCallingPackage() bogusly returns null...
...after having to recreate the task stack Change-Id: Ia354240f3650ddb578f2116a2aa4584e9ffe8508
Diffstat (limited to 'core/java/android/app/Activity.java')
-rw-r--r--core/java/android/app/Activity.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 31074e2..a26bdbc 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -4030,10 +4030,16 @@ public class Activity extends ContextThemeWrapper
* use this information to validate that the recipient is allowed to
* receive the data.
*
- * <p>Note: if the calling activity is not expecting a result (that is it
+ * <p class="note">Note: if the calling activity is not expecting a result (that is it
* did not use the {@link #startActivityForResult}
* form that includes a request code), then the calling package will be
- * null.
+ * null.</p>
+ *
+ * <p class="note">Note: prior to {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
+ * the result from this method was unstable. If the process hosting the calling
+ * package was no longer running, it would return null instead of the proper package
+ * name. You can use {@link #getCallingActivity()} and retrieve the package name
+ * from that instead.</p>
*
* @return The package of the activity that will receive your
* reply, or null if none.
@@ -4052,12 +4058,12 @@ public class Activity extends ContextThemeWrapper
* can use this information to validate that the recipient is allowed to
* receive the data.
*
- * <p>Note: if the calling activity is not expecting a result (that is it
+ * <p class="note">Note: if the calling activity is not expecting a result (that is it
* did not use the {@link #startActivityForResult}
* form that includes a request code), then the calling package will be
* null.
*
- * @return String The full name of the activity that will receive your
+ * @return The ComponentName of the activity that will receive your
* reply, or null if none.
*/
public ComponentName getCallingActivity() {