Loading core/java/android/app/ActivityClient.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Intent; import android.content.res.Configuration; Loading Loading @@ -205,6 +206,18 @@ public class ActivityClient { } } /** * Returns the activity token below in the same task if it belongs to the same process. */ @Nullable public IBinder getActivityTokenBelow(IBinder activityToken) { try { return getActivityClientController().getActivityTokenBelow(activityToken); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } ComponentName getCallingActivity(IBinder token) { try { return getActivityClientController().getCallingActivity(token); Loading core/java/android/app/IActivityClientController.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ interface IActivityClientController { boolean willActivityBeVisible(in IBinder token); int getDisplayId(in IBinder activityToken); int getTaskForActivity(in IBinder token, in boolean onlyRoot); IBinder getActivityTokenBelow(IBinder token); ComponentName getCallingActivity(in IBinder token); String getCallingPackage(in IBinder token); int getLaunchedFromUid(in IBinder token); Loading services/core/java/com/android/server/wm/ActivityClientController.java +22 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import static com.android.server.wm.ActivityTaskManagerService.TAG_SWITCH; import static com.android.server.wm.ActivityTaskManagerService.enforceNotIsolatedCaller; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityTaskManager; Loading Loading @@ -538,6 +539,27 @@ class ActivityClientController extends IActivityClientController.Stub { } } @Override @Nullable public IBinder getActivityTokenBelow(IBinder activityToken) { final long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { final ActivityRecord ar = ActivityRecord.isInAnyTask(activityToken); if (ar == null) { return null; } final ActivityRecord below = ar.getTask().getActivityBelow(ar); if (below != null && below.getUid() == ar.getUid()) { return below.appToken.asBinder(); } } } finally { Binder.restoreCallingIdentity(ident); } return null; } @Override public ComponentName getCallingActivity(IBinder token) { synchronized (mGlobalLock) { Loading services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -6274,6 +6274,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return null; } @Nullable static ActivityRecord isInAnyTask(IBinder token) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); return (r != null && r.isAttached()) ? r : null; } /** * @return display id to which this record is attached, * {@link android.view.Display#INVALID_DISPLAY} if not attached. Loading services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -872,7 +872,7 @@ class ActivityStarter { ActivityRecord sourceRecord = null; ActivityRecord resultRecord = null; if (resultTo != null) { sourceRecord = mRootWindowContainer.isInAnyTask(resultTo); sourceRecord = ActivityRecord.isInAnyTask(resultTo); if (DEBUG_RESULTS) { Slog.v(TAG_RESULTS, "Will send result to " + resultTo + " " + sourceRecord); } Loading Loading
core/java/android/app/ActivityClient.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Intent; import android.content.res.Configuration; Loading Loading @@ -205,6 +206,18 @@ public class ActivityClient { } } /** * Returns the activity token below in the same task if it belongs to the same process. */ @Nullable public IBinder getActivityTokenBelow(IBinder activityToken) { try { return getActivityClientController().getActivityTokenBelow(activityToken); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } ComponentName getCallingActivity(IBinder token) { try { return getActivityClientController().getCallingActivity(token); Loading
core/java/android/app/IActivityClientController.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ interface IActivityClientController { boolean willActivityBeVisible(in IBinder token); int getDisplayId(in IBinder activityToken); int getTaskForActivity(in IBinder token, in boolean onlyRoot); IBinder getActivityTokenBelow(IBinder token); ComponentName getCallingActivity(in IBinder token); String getCallingPackage(in IBinder token); int getLaunchedFromUid(in IBinder token); Loading
services/core/java/com/android/server/wm/ActivityClientController.java +22 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import static com.android.server.wm.ActivityTaskManagerService.TAG_SWITCH; import static com.android.server.wm.ActivityTaskManagerService.enforceNotIsolatedCaller; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.Activity; import android.app.ActivityManager; import android.app.ActivityTaskManager; Loading Loading @@ -538,6 +539,27 @@ class ActivityClientController extends IActivityClientController.Stub { } } @Override @Nullable public IBinder getActivityTokenBelow(IBinder activityToken) { final long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { final ActivityRecord ar = ActivityRecord.isInAnyTask(activityToken); if (ar == null) { return null; } final ActivityRecord below = ar.getTask().getActivityBelow(ar); if (below != null && below.getUid() == ar.getUid()) { return below.appToken.asBinder(); } } } finally { Binder.restoreCallingIdentity(ident); } return null; } @Override public ComponentName getCallingActivity(IBinder token) { synchronized (mGlobalLock) { Loading
services/core/java/com/android/server/wm/ActivityRecord.java +6 −0 Original line number Diff line number Diff line Loading @@ -6274,6 +6274,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return null; } @Nullable static ActivityRecord isInAnyTask(IBinder token) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); return (r != null && r.isAttached()) ? r : null; } /** * @return display id to which this record is attached, * {@link android.view.Display#INVALID_DISPLAY} if not attached. Loading
services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -872,7 +872,7 @@ class ActivityStarter { ActivityRecord sourceRecord = null; ActivityRecord resultRecord = null; if (resultTo != null) { sourceRecord = mRootWindowContainer.isInAnyTask(resultTo); sourceRecord = ActivityRecord.isInAnyTask(resultTo); if (DEBUG_RESULTS) { Slog.v(TAG_RESULTS, "Will send result to " + resultTo + " " + sourceRecord); } Loading