AppOwnedSdkSandboxInterface

public final class AppOwnedSdkSandboxInterface
extends Object implements Parcelable

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


Represents a channel for an SDK in the sandbox process to interact with the app.

The SDK and the app can agree on a binder interface to be implemented by the app and shared via an object of AppOwnedSdkSandboxInterface.

The app registers the AppOwnedSdkSandboxInterfaces using SdkSandboxManager.registerAppOwnedSdkSandboxInterface(AppOwnedSdkSandboxInterface).

The SDK in sandbox process can then query the list of registered AppOwnedSdkSandboxInterfaces using ERROR(/SdkSandboxController#getAppOwnedSdkSandboxInterfaces).

Once SDK has the AppOwnedSdkSandboxInterface it wants to communicate with, it will have to cast the binder object from getInterface() to the prearranged interface before initiating the communication.

Summary

Inherited constants

Fields

public static final Creator<AppOwnedSdkSandboxInterface> CREATOR

Public constructors

AppOwnedSdkSandboxInterface(String name, long version, IBinder binder)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

IBinder getInterface()

Returns binder object associated with AppOwnedSdkSandboxInterface.

String getName()

Returns the name used to register the AppOwnedSdkSandboxInterface.

long getVersion()

Returns the version used to register the AppOwnedSdkSandboxInterface.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

Public constructors

AppOwnedSdkSandboxInterface

public AppOwnedSdkSandboxInterface (String name, 
                long version, 
                IBinder binder)

Parameters
name String: This value cannot be null.

version long

binder IBinder: This value cannot be null.

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getInterface

public IBinder getInterface ()

Returns binder object associated with AppOwnedSdkSandboxInterface.

The SDK and the app can agree on a binder interface to be implemented by the app and shared via this object, see AppOwnedSdkSandboxInterface.

The SDK in the sandbox will have to cast the binder object received from this method to the agreed upon interface before using it.

Returns
IBinder This value cannot be null.

getName

public String getName ()

Returns the name used to register the AppOwnedSdkSandboxInterface.

App can register only one interface of given name.

Returns
String This value cannot be null.

getVersion

public long getVersion ()

Returns the version used to register the AppOwnedSdkSandboxInterface.

A version may be chosen by an app, and used to communicate any updates the app makes to this implementation.

Returns
long

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES