# SdkSandboxManagerCompat

Artifact: [androidx.privacysandbox.sdkruntime:sdkruntime-client](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat.kt+class:androidx.privacysandbox.sdkruntime.client.SdkSandboxManagerCompat) Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

*** ** * ** ***

<br />

```
public final class SdkSandboxManagerCompat
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> This library is no longer supported.

Compat version of `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html`.

Provides APIs to load `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkProviderCompat` into SDK sandbox process or locally, and then interact with them.

SdkSandbox process is a java process running in a separate uid range. Each app has its own SDK sandbox process.

First app needs to declare SDKs it depends on in its AndroidManifest.xml using tag. App can only load SDKs it depends on into the SDK sandbox process.

For loading SDKs locally App need to bundle and declare local SDKs in assets/RuntimeEnabledSdkTable.xml with following format:
com.sdk1 assets/RuntimeEnabledSdk-com.sdk1/CompatSdkConfig.xml com.sdk2 assets/RuntimeEnabledSdk-com.sdk2/CompatSdkConfig.xml

Each local SDK should have config with following format:
RuntimeEnabledSdk-sdk.package.name/dex/classes.dex RuntimeEnabledSdk-sdk.package.name/dex/classes2.dex RuntimeEnabledSdk-sdk.package.name/res com.sdk.EntryPointClass com.test.sdk.RPackage 123

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html` |   |

## Summary

| ### Public methods |
|---|---|
| `final void` | `[addSdkSandboxProcessDeathCallback](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#addSdkSandboxProcessDeathCallback(java.util.concurrent.Executor,androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html callbackExecutor, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat callback )` **This method is deprecated.** This library is no longer supported. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat` | `[from](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#from(android.content.Context))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context)` **This method is deprecated.** This library is no longer supported. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat>` | `[getAppOwnedSdkSandboxInterfaces](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#getAppOwnedSdkSandboxInterfaces())()` **This method is deprecated.** This library is no longer supported. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat>` | `[getSandboxedSdks](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#getSandboxedSdks())()` **This method is deprecated.** This library is no longer supported. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat` | `[loadSdk](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#loadSdk(kotlin.String,android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html params)` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[registerAppOwnedSdkSandboxInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#registerAppOwnedSdkSandboxInterface(androidx.privacysandbox.sdkruntime.core.AppOwnedSdkSandboxInterfaceCompat))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat appOwnedSdk )` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[removeSdkSandboxProcessDeathCallback](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#removeSdkSandboxProcessDeathCallback(androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat callback )` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[startSdkSandboxActivity](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#startSdkSandboxActivity(android.app.Activity,android.os.IBinder))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html fromActivity, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/IBinder.html sdkActivityToken )` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[unloadSdk](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#unloadSdk(kotlin.String))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName)` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[unregisterAppOwnedSdkSandboxInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#unregisterAppOwnedSdkSandboxInterface(kotlin.String))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName)` **This method is deprecated.** This library is no longer supported. |

## Public methods

### addSdkSandboxProcessDeathCallback

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [addSdkSandboxProcessDeathCallback](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#addSdkSandboxProcessDeathCallback(java.util.concurrent.Executor,androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat))(
    @NonNull Executor callbackExecutor,
    @NonNull SdkSandboxProcessDeathCallbackCompat callback
)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Adds a callback which gets registered for SDK sandbox lifecycle events, such as SDK sandbox death. If the sandbox has not yet been created when this is called, the request will be stored until a sandbox is created, at which point it is activated for that sandbox. Multiple callbacks can be added to detect death.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html callbackExecutor` | the `https://developer.android.com/reference/java/util/concurrent/Executor.html` on which to invoke the callback |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat callback` | the `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat` which will receive SDK sandbox lifecycle events. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#addSdkSandboxProcessDeathCallback(java.util.concurrent.Executor, android.app.sdksandbox.SdkSandboxManager.SdkSandboxProcessDeathCallback)` |   |

### from

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public static final @NonNull SdkSandboxManagerCompat [from](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#from(android.content.Context))(@NonNull Context context)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Creates `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | Application context |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat` | SdkSandboxManagerCompat object. |

### getAppOwnedSdkSandboxInterfaces

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final @NonNull List<@NonNull AppOwnedSdkSandboxInterfaceCompat> [getAppOwnedSdkSandboxInterfaces](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#getAppOwnedSdkSandboxInterfaces())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Fetches all `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` that are registered by the app.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat>` | List of all currently registered `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` |

### getSandboxedSdks

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final @NonNull List<@NonNull SandboxedSdkCompat> [getSandboxedSdks](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#getSandboxedSdks())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Fetches information about Sdks that are loaded in the sandbox or locally.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat>` | List of `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat` containing all currently loaded sdks |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#getSandboxedSdks()` |   |

### loadSdk

```
public final @NonNull SandboxedSdkCompat [loadSdk](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#loadSdk(kotlin.String,android.os.Bundle))(@NonNull String sdkName, @NonNull Bundle params)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Load SDK in a SDK sandbox java process or locally.

App should already declare SDKs it depends on in its AndroidManifest using tag. App can only load SDKs it depends on into the SDK Sandbox process.

When client application loads the first SDK, a new SdkSandbox process will be created, otherwise other SDKs will be loaded into the same sandbox which already created for the client application.

Alternatively App could bundle and declare local SDKs dependencies in assets/RuntimeEnabledSdkTable.xml to load SDKs locally.

This API may only be called while the caller is running in the foreground. Calls from the background will result in a `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/LoadSdkCompatException` being thrown.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName` | name of the SDK to be loaded. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html params` | additional parameters to be passed to the SDK in the form of a `https://developer.android.com/reference/android/os/Bundle.html` as agreed between the client and the SDK. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat` | `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat` from SDK on a successful run. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/LoadSdkCompatException` | on fail. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#loadSdk(java.lang.String, android.os.Bundle, java.util.concurrent.Executor, android.os.OutcomeReceiver&lt;android.app.sdksandbox.SandboxedSdk,android.app.sdksandbox.LoadSdkException&gt;)` |   |

### registerAppOwnedSdkSandboxInterface

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [registerAppOwnedSdkSandboxInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#registerAppOwnedSdkSandboxInterface(androidx.privacysandbox.sdkruntime.core.AppOwnedSdkSandboxInterfaceCompat))(
    @NonNull AppOwnedSdkSandboxInterfaceCompat appOwnedSdk
)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Registers `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` for an app process.

Registering an `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` that has same name as a previously registered interface will result in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html`.

`https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat#name()` refers to the name of the interface.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat appOwnedSdk` | the `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` to be registered |

### removeSdkSandboxProcessDeathCallback

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [removeSdkSandboxProcessDeathCallback](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#removeSdkSandboxProcessDeathCallback(androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat))(
    @NonNull SdkSandboxProcessDeathCallbackCompat callback
)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Removes an `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat` that was previously added using `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#addSdkSandboxProcessDeathCallback(java.util.concurrent.Executor,androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat)`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat callback` | the `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxProcessDeathCallbackCompat` which was previously added using `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#addSdkSandboxProcessDeathCallback(java.util.concurrent.Executor,androidx.privacysandbox.sdkruntime.client.SdkSandboxProcessDeathCallbackCompat)` |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#removeSdkSandboxProcessDeathCallback(android.app.sdksandbox.SdkSandboxManager.SdkSandboxProcessDeathCallback)` |   |

### startSdkSandboxActivity

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [startSdkSandboxActivity](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#startSdkSandboxActivity(android.app.Activity,android.os.IBinder))(
    @NonNull Activity fromActivity,
    @NonNull IBinder sdkActivityToken
)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Starts an `https://developer.android.com/reference/android/app/Activity.html` in the SDK sandbox.

This function will start a new `https://developer.android.com/reference/android/app/Activity.html` in the same task of the passed `fromActivity` and pass it to the SDK that shared the passed `sdkActivityToken` that identifies a request from that SDK to stat this `https://developer.android.com/reference/android/app/Activity.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html fromActivity` | the `https://developer.android.com/reference/android/app/Activity.html` will be used to start the new sandbox `https://developer.android.com/reference/android/app/Activity.html` by calling Activity#startActivity against it. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/IBinder.html sdkActivityToken` | the identifier that is shared by the SDK which requests the `https://developer.android.com/reference/android/app/Activity.html`. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#startSdkSandboxActivity(android.app.Activity, android.os.IBinder)` |   |

### unloadSdk

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [unloadSdk](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#unloadSdk(kotlin.String))(@NonNull String sdkName)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Unloads an SDK that has been previously loaded by the caller.

It is not guaranteed that the memory allocated for this SDK will be freed immediately.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName` | name of the SDK to be unloaded. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/sdksandbox/SdkSandboxManager.html#unloadSdk(java.lang.String)` |   |

### unregisterAppOwnedSdkSandboxInterface

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
public final void [unregisterAppOwnedSdkSandboxInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/client/SdkSandboxManagerCompat#unregisterAppOwnedSdkSandboxInterface(kotlin.String))(@NonNull String sdkName)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Unregisters `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` for an app process.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html sdkName` | the name under which `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/AppOwnedSdkSandboxInterfaceCompat` was registered. |