diff options
| -rw-r--r-- | core/api/module-lib-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 2 | ||||
| -rw-r--r-- | core/java/android/content/Context.java | 6 | ||||
| -rw-r--r-- | core/java/android/content/ContextWrapper.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerLocal.java | 15 |
5 files changed, 14 insertions, 15 deletions
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 55ef6de47aee..af35d96be2d6 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -83,7 +83,7 @@ package android.content { public abstract class Context { method @NonNull public android.content.Context createContextForSdkInSandbox(@NonNull android.content.pm.ApplicationInfo, int) throws android.content.pm.PackageManager.NameNotFoundException; - method @NonNull public android.os.IBinder getIApplicationThreadBinder(); + method @NonNull public android.os.IBinder getProcessToken(); method @NonNull public android.os.UserHandle getUser(); field public static final String PAC_PROXY_SERVICE = "pac_proxy"; field public static final String TEST_NETWORK_SERVICE = "test_network"; diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index b91fa35942bb..89740afd5459 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -2028,7 +2028,7 @@ class ContextImpl extends Context { /** @hide */ @NonNull @Override - public IBinder getIApplicationThreadBinder() { + public IBinder getProcessToken() { return getIApplicationThread().asBinder(); } diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index c8d48c189247..9a998092d41b 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -7517,14 +7517,12 @@ public abstract class Context { } /** - * Get the binder object associated with the IApplicationThread of this Context. - * - * This can be used by a mainline module to uniquely identify a specific app process. + * Used by a mainline module to uniquely identify a specific app process. * @hide */ @NonNull @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) - public IBinder getIApplicationThreadBinder() { + public IBinder getProcessToken() { throw new RuntimeException("Not implemented. Must override in a subclass."); } diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java index e65e91c45396..9027e2e3bfe8 100644 --- a/core/java/android/content/ContextWrapper.java +++ b/core/java/android/content/ContextWrapper.java @@ -1286,8 +1286,8 @@ public class ContextWrapper extends Context { * @hide */ @Override - public IBinder getIApplicationThreadBinder() { - return mBase.getIApplicationThreadBinder(); + public IBinder getProcessToken() { + return mBase.getProcessToken(); } /** diff --git a/services/core/java/com/android/server/am/ActivityManagerLocal.java b/services/core/java/com/android/server/am/ActivityManagerLocal.java index abaa8c75c42d..31ea092e9778 100644 --- a/services/core/java/com/android/server/am/ActivityManagerLocal.java +++ b/services/core/java/com/android/server/am/ActivityManagerLocal.java @@ -75,8 +75,9 @@ public interface ActivityManagerLocal { * @param conn Receives information as the service is started and stopped. * This must be a valid ServiceConnection object; it must not be null. * @param clientAppUid Uid of the app for which the sdk sandbox process needs to be spawned. - * @param clientApplicationThread ApplicationThread object of the app for which the sdk sandboox - * is spawned. + * @param clientAppProcessToken process token used to uniquely identify the client app + * process binding to the SDK sandbox. This is obtained using + * {@link Context#getProcessToken()}. * @param clientAppPackage Package of the app for which the sdk sandbox process needs to * be spawned. This package must belong to the clientAppUid. * @param processName Unique identifier for the service instance. Each unique name here will @@ -92,7 +93,7 @@ public interface ActivityManagerLocal { */ @SuppressLint("RethrowRemoteException") boolean bindSdkSandboxService(@NonNull Intent service, @NonNull ServiceConnection conn, - int clientAppUid, @NonNull IBinder clientApplicationThread, + int clientAppUid, @NonNull IBinder clientAppProcessToken, @NonNull String clientAppPackage, @NonNull String processName, @Context.BindServiceFlags int flags) throws RemoteException; @@ -112,9 +113,9 @@ public interface ActivityManagerLocal { /** * Kill an app process associated with an SDK sandbox. * - * @param clientApplicationThreadBinder binder value of the - * {@link android.app.IApplicationThread} of a client app process associated with a - * sandbox. This is obtained using {@link Context#getIApplicationThreadBinder()}. + * @param clientAppProcessToken process token used to uniquely identify the client app + * process associated with an SDK sandbox. This is obtained using + * {@link Context#getProcessToken()}. */ - void killSdkSandboxClientAppProcess(@NonNull IBinder clientApplicationThreadBinder); + void killSdkSandboxClientAppProcess(@NonNull IBinder clientAppProcessToken); } |