Loading core/api/module-lib-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,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.UserHandle getUser(); field public static final String PAC_PROXY_SERVICE = "pac_proxy"; Loading core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -2640,7 +2640,7 @@ public final class ActivityThread extends ClientTransactionHandler ClassLoader baseLoader, boolean securityViolation, boolean includeCode, boolean registerPackage) { return getPackageInfo(aInfo, compatInfo, baseLoader, securityViolation, includeCode, registerPackage, /*isSdkSandbox=*/false); registerPackage, Process.isSdkSandbox()); } private LoadedApk getPackageInfo(ApplicationInfo aInfo, CompatibilityInfo compatInfo, Loading core/java/android/app/ContextImpl.java +16 −0 Original line number Diff line number Diff line Loading @@ -2581,6 +2581,22 @@ class ContextImpl extends Context { "Application package " + application.packageName + " not found"); } @Override public Context createContextForSdkInSandbox(ApplicationInfo sdkInfo, int flags) throws NameNotFoundException { if (!Process.isSdkSandbox()) { throw new SecurityException("API can only be called from SdkSandbox process"); } ContextImpl ctx = (ContextImpl) createApplicationContext(sdkInfo, flags); // Set sandbox app's context as the application context for sdk context ctx.mPackageInfo.makeApplicationInner(/*forceDefaultAppClass=*/false, /*instrumentation=*/null); return ctx; } @Override public Context createPackageContext(String packageName, int flags) throws NameNotFoundException { Loading core/java/android/content/Context.java +20 −0 Original line number Diff line number Diff line Loading @@ -6858,6 +6858,26 @@ public abstract class Context { public abstract Context createApplicationContext(ApplicationInfo application, @CreatePackageOptions int flags) throws PackageManager.NameNotFoundException; /** * Creates a context given an {@link android.content.pm.ApplicationInfo}. * * Context created is for an sdk library that is being loaded in sdk sandbox. * * @param sdkInfo information regarding the sdk library being loaded. * * @throws PackageManager.NameNotFoundException if there is no application with * the given package name. * @throws SecurityException if caller is not a SdkSandbox process. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @NonNull public Context createContextForSdkInSandbox(@NonNull ApplicationInfo sdkInfo, @CreatePackageOptions int flags) throws PackageManager.NameNotFoundException { throw new RuntimeException("Not implemented. Must override in a subclass."); } /** * Return a new Context object for the given split name. The new Context has a ClassLoader and * Resources object that can access the split's and all of its dependencies' code/resources. Loading core/java/android/content/ContextWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -1071,6 +1071,15 @@ public class ContextWrapper extends Context { return mBase.createApplicationContext(application, flags); } /** @hide */ @Override @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @NonNull public Context createContextForSdkInSandbox(@NonNull ApplicationInfo sdkInfo, int flags) throws PackageManager.NameNotFoundException { return mBase.createContextForSdkInSandbox(sdkInfo, flags); } /** @hide */ @Override public Context createContextForSplit(String splitName) Loading Loading
core/api/module-lib-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,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.UserHandle getUser(); field public static final String PAC_PROXY_SERVICE = "pac_proxy"; Loading
core/java/android/app/ActivityThread.java +1 −1 Original line number Diff line number Diff line Loading @@ -2640,7 +2640,7 @@ public final class ActivityThread extends ClientTransactionHandler ClassLoader baseLoader, boolean securityViolation, boolean includeCode, boolean registerPackage) { return getPackageInfo(aInfo, compatInfo, baseLoader, securityViolation, includeCode, registerPackage, /*isSdkSandbox=*/false); registerPackage, Process.isSdkSandbox()); } private LoadedApk getPackageInfo(ApplicationInfo aInfo, CompatibilityInfo compatInfo, Loading
core/java/android/app/ContextImpl.java +16 −0 Original line number Diff line number Diff line Loading @@ -2581,6 +2581,22 @@ class ContextImpl extends Context { "Application package " + application.packageName + " not found"); } @Override public Context createContextForSdkInSandbox(ApplicationInfo sdkInfo, int flags) throws NameNotFoundException { if (!Process.isSdkSandbox()) { throw new SecurityException("API can only be called from SdkSandbox process"); } ContextImpl ctx = (ContextImpl) createApplicationContext(sdkInfo, flags); // Set sandbox app's context as the application context for sdk context ctx.mPackageInfo.makeApplicationInner(/*forceDefaultAppClass=*/false, /*instrumentation=*/null); return ctx; } @Override public Context createPackageContext(String packageName, int flags) throws NameNotFoundException { Loading
core/java/android/content/Context.java +20 −0 Original line number Diff line number Diff line Loading @@ -6858,6 +6858,26 @@ public abstract class Context { public abstract Context createApplicationContext(ApplicationInfo application, @CreatePackageOptions int flags) throws PackageManager.NameNotFoundException; /** * Creates a context given an {@link android.content.pm.ApplicationInfo}. * * Context created is for an sdk library that is being loaded in sdk sandbox. * * @param sdkInfo information regarding the sdk library being loaded. * * @throws PackageManager.NameNotFoundException if there is no application with * the given package name. * @throws SecurityException if caller is not a SdkSandbox process. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @NonNull public Context createContextForSdkInSandbox(@NonNull ApplicationInfo sdkInfo, @CreatePackageOptions int flags) throws PackageManager.NameNotFoundException { throw new RuntimeException("Not implemented. Must override in a subclass."); } /** * Return a new Context object for the given split name. The new Context has a ClassLoader and * Resources object that can access the split's and all of its dependencies' code/resources. Loading
core/java/android/content/ContextWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -1071,6 +1071,15 @@ public class ContextWrapper extends Context { return mBase.createApplicationContext(application, flags); } /** @hide */ @Override @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @NonNull public Context createContextForSdkInSandbox(@NonNull ApplicationInfo sdkInfo, int flags) throws PackageManager.NameNotFoundException { return mBase.createContextForSdkInSandbox(sdkInfo, flags); } /** @hide */ @Override public Context createContextForSplit(String splitName) Loading