SandboxedSdkProvider

public abstract class SandboxedSdkProvider
extends Object

java.lang.Object
   ↳ android.app.sdksandbox.SandboxedSdkProvider


Encapsulates API which SDK sandbox can use to interact with SDKs loaded into it.

SDK has to implement this abstract class to generate an entry point for SDK sandbox to be able to call it through.

Note: All APIs defined in this class are not stable and subject to change.

Summary

Nested classes

interface SandboxedSdkProvider.InitSdkCallback

Callback for tracking the status of initializing the SDK. 

Public constructors

SandboxedSdkProvider()

Public methods

abstract View getView(Context windowContext, Bundle params)

Requests a view to be remotely rendered to the client app process.

abstract void initSdk(SandboxedSdkContext sandboxedSdkContext, Bundle params, Executor executor, SandboxedSdkProvider.InitSdkCallback callback)

Does the initialization work needed to start calling the SDK.

abstract void onExtraDataReceived(Bundle extraData)

Called when extra data sent from the app is received by an SDK.

Inherited methods

Public constructors

SandboxedSdkProvider

public SandboxedSdkProvider ()

Public methods

getView

public abstract View getView (Context windowContext, 
                Bundle params)

Requests a view to be remotely rendered to the client app process.

Returns View will be wrapped into SurfacePackage. the resulting SurfacePackage will be sent back to the client application.

Parameters
windowContext Context: the Context of the display which meant to show the view This value cannot be null.

params Bundle: list of params passed from the client application requesting the view This value cannot be null.

Returns
View a View which SDK sandbox pass to the client application requesting the view This value cannot be null.

initSdk

public abstract void initSdk (SandboxedSdkContext sandboxedSdkContext, 
                Bundle params, 
                Executor executor, 
                SandboxedSdkProvider.InitSdkCallback callback)

Does the initialization work needed to start calling the SDK.

This function is called by SDK sandbox after it loads SDK

SDK should do any initialization work to be ready to handle upcoming requests. It should not include the initialization logic that depends on other SDKs being loaded into the SDK sandbox.

Parameters
sandboxedSdkContext SandboxedSdkContext: a SandboxedSdkContext which is the context of the SDK loaded in the SDK sandbox process This value cannot be null.

params Bundle: list of params passed from App when it loads the SDK. This value cannot be null.

executor Executor: the Executor on which to invoke the callback This value cannot be null.

callback SandboxedSdkProvider.InitSdkCallback: to notify App if the SDK successfully loaded This value cannot be null.

onExtraDataReceived

public abstract void onExtraDataReceived (Bundle extraData)

Called when extra data sent from the app is received by an SDK.

Parameters
extraData Bundle: This value cannot be null.