Loading core/java/android/app/Activity.java +10 −4 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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() { Loading services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -4577,7 +4577,7 @@ public final class ActivityManagerService extends ActivityManagerNative public String getCallingPackage(IBinder token) { synchronized (this) { ActivityRecord r = getCallingRecordLocked(token); return r != null && r.app != null ? r.info.packageName : null; return r != null ? r.info.packageName : null; } } Loading Loading
core/java/android/app/Activity.java +10 −4 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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() { Loading
services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -4577,7 +4577,7 @@ public final class ActivityManagerService extends ActivityManagerNative public String getCallingPackage(IBinder token) { synchronized (this) { ActivityRecord r = getCallingRecordLocked(token); return r != null && r.app != null ? r.info.packageName : null; return r != null ? r.info.packageName : null; } } Loading