public final class SandboxedSdkCompat


Compat wrapper for SandboxedSdk. Represents an SDK loaded in the sandbox process or locally. An application should use this object to obtain an interface to the SDK through getInterface.

The SDK should create it when SandboxedSdkProviderCompat.onLoadSdk is called, and drop all references to it when SandboxedSdkProviderCompat.beforeUnloadSdk is called. Additionally, the SDK should fail calls made to the IBinder returned from getInterface after SandboxedSdkProviderCompat.beforeUnloadSdk has been called.

See also
SandboxedSdk

Summary

Public constructors

Creates SandboxedSdkCompat from SDK Binder object.

Public methods

final IBinder

Returns the interface to the loaded SDK.

final SandboxedSdkInfo

Returns information about loaded SDK.

Public constructors

SandboxedSdkCompat

Added in 1.0.0-alpha14
public SandboxedSdkCompat(@NonNull IBinder sdkInterface)

Creates SandboxedSdkCompat from SDK Binder object.

Parameters
@NonNull IBinder 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 getInterface.

See also
SandboxedSdk

Public methods

getInterface

Added in 1.0.0-alpha14
public final IBinder getInterface()

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
IBinder

IBinder object for loaded SDK.

See also
getInterface

getSdkInfo

Added in 1.0.0-alpha14
public final SandboxedSdkInfo getSdkInfo()

Returns information about loaded SDK.

Returns
SandboxedSdkInfo

SandboxedSdkInfo object for loaded SDK or null if no information available.