diff options
Diffstat (limited to 'sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java')
-rw-r--r-- | sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java b/sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java index cb37402a1..a90796773 100644 --- a/sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java +++ b/sdksandbox/framework/java/android/app/sdksandbox/SdkSandboxManager.java @@ -24,9 +24,9 @@ import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; +import android.app.sdksandbox.sdkprovider.SdkSandboxController; import android.content.Context; import android.content.SharedPreferences; -import android.content.pm.SharedLibraryInfo; import android.os.Bundle; import android.os.IBinder; import android.os.OutcomeReceiver; @@ -141,12 +141,24 @@ public final class SdkSandboxManager { */ public static final int REQUEST_SURFACE_PACKAGE_INTERNAL_ERROR = 700; + /** + * SDK is not loaded while requesting a {@link SurfacePackage}. + * + * <p>This indicates that the SDK for which the {@link SurfacePackage} is being requested is not + * loaded, either because the sandbox died or because it was not loaded in the first place. + */ + public static final int REQUEST_SURFACE_PACKAGE_SDK_NOT_LOADED = 701; + /** @hide */ - @IntDef(value = {REQUEST_SURFACE_PACKAGE_INTERNAL_ERROR, SDK_SANDBOX_PROCESS_NOT_AVAILABLE}) + @IntDef( + prefix = "REQUEST_SURFACE_PACKAGE_", + value = { + REQUEST_SURFACE_PACKAGE_INTERNAL_ERROR, + REQUEST_SURFACE_PACKAGE_SDK_NOT_LOADED + }) @Retention(RetentionPolicy.SOURCE) public @interface RequestSurfacePackageErrorCode {} - /** * SDK Sandbox is disabled. * @@ -360,12 +372,11 @@ public final class SdkSandboxManager { /** * Fetches information about Sdks that are loaded in the sandbox. * - * @return List of {@link SharedLibraryInfo} containing all currently loaded sdks - * @hide + * @return List of {@link SandboxedSdk} containing all currently loaded sdks */ - public @NonNull List<SharedLibraryInfo> getLoadedSdkLibrariesInfo() { + public @NonNull List<SandboxedSdk> getSandboxedSdks() { try { - return mService.getLoadedSdkLibrariesInfo( + return mService.getSandboxedSdks( mContext.getPackageName(), /*timeAppCalledSystemServer=*/ System.currentTimeMillis()); } catch (RemoteException e) { @@ -530,13 +541,12 @@ public final class SdkSandboxManager { } } - // TODO(b/237410689): Update links to getClientSharedPreferences when cl is merged. /** * Adds keys to set of keys being synced from app's default {@link SharedPreferences} to * SdkSandbox. * - * <p>Synced data will be available for sdks to read using the {@code - * getClientSharedPreferences} API. + * <p>Synced data will be available for sdks to read using the {@link + * SdkSandboxController#getClientSharedPreferences()} API. * * <p>To stop syncing any key that has been added using this API, use {@link * #removeSyncedSharedPreferencesKeys(Set)}. |