# SandboxedSdkCompat

Artifact: [androidx.privacysandbox.sdkruntime:sdkruntime-core](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat.kt+class:androidx.privacysandbox.sdkruntime.core.SandboxedSdkCompat) 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 class SandboxedSdkCompat
```

<br />

*** ** * ** ***

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

Compat wrapper for `https://developer.android.com/reference/android/app/sdksandbox/SandboxedSdk.html`. Represents an SDK loaded in the sandbox process or locally. An application should use this object to obtain an interface to the SDK through `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getInterface()`.

The SDK should create it when `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkProviderCompat#onLoadSdk(android.os.Bundle)` is called, and drop all references to it when `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkProviderCompat#beforeUnloadSdk()` is called. Additionally, the SDK should fail calls made to the `https://developer.android.com/reference/android/os/IBinder.html` returned from `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getInterface()` after `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkProviderCompat#beforeUnloadSdk()` has been called.

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

## Summary

| ### Public constructors |
|---|
| `[SandboxedSdkCompat](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#SandboxedSdkCompat(android.os.IBinder))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/IBinder.html sdkInterface)` **This method is deprecated.** This library is no longer supported. |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/android/os/IBinder.html` | `[getInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getInterface())()` **This method is deprecated.** This library is no longer supported. |
| `final https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkInfo` | `[getSdkInfo](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getSdkInfo())()` **This method is deprecated.** This library is no longer supported. |

## Public constructors

### SandboxedSdkCompat

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 [SandboxedSdkCompat](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#SandboxedSdkCompat(android.os.IBinder))(@NonNull IBinder sdkInterface)
```

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

Creates SandboxedSdkCompat from SDK Binder object.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/IBinder.html sdkInterface` | The SDK's interface. This will be the entrypoint into the sandboxed SDK for the application. The SDK should keep this valid until it's loaded in the sandbox, and start failing calls to this interface once it has been unloaded This interface can later be retrieved using `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getInterface()`. |

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

## Public methods

### getInterface

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 IBinder [getInterface](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getInterface())()
```

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

Returns the interface to the loaded SDK. A null interface is returned if the Binder has since become unavailable, in response to the SDK being unloaded.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/os/IBinder.html` | `https://developer.android.com/reference/android/os/IBinder.html` object for loaded SDK. |

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

### getSdkInfo

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 SandboxedSdkInfo [getSdkInfo](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkCompat#getSdkInfo())()
```

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

Returns information about loaded SDK.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkInfo` | `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/SandboxedSdkInfo` object for loaded SDK or null if no information available. |

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