AppOwnedSdkSandboxInterface

public final class AppOwnedSdkSandboxInterface
extends Object implements Parcelable

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


代表沙箱程序中 SDK 的管道,以便與應用程式互動。

SDK 和應用程式可以同意繫結器介面,以供應用程式實作,並透過 AppOwnedSdkSandboxInterface 物件分享。

應用程式使用 SdkSandboxManager.registerAppOwnedSdkSandboxInterface(AppOwnedSdkSandboxInterface) 註冊 AppOwnedSdkSandboxInterfaces。

沙箱程序中的 SDK 可以使用 ERROR(/SdkSandboxController#getAppOwnedSdkSandboxInterfaces) 查詢已註冊的 AppOwnedSdkSandboxInterfaces 清單。

SDK 擁有想進行通訊的 AppOwnedSdkSandboxInterface 後,必須先將繫結器物件從 getInterface() 投放到預先建立的介面,才能開始通訊。

摘要

繼承常數

欄位

public static final Creator<AppOwnedSdkSandboxInterface> CREATOR

公用建構函式

AppOwnedSdkSandboxInterface(String name, long version, IBinder binder)

公用方法

int describeContents()

描述此 Parcelable 例項封送處理表示法中包含的特殊物件種類。

IBinder getInterface()

傳回與 AppOwnedSdkSandboxInterface 相關聯的繫結器物件。

String getName()

傳回用來註冊 AppOwnedSdkSandboxInterface 的名稱。

long getVersion()

傳回用來註冊 AppOwnedSdkSandboxInterface 的版本。

void writeToParcel(Parcel dest, int flags)

壓平合併此物件並加入至 Parcel。

繼承方法

欄位

公用建構函式

AppOwnedSdkSandboxInterface

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

參數
name String:此值不能為 null

version long

binder IBinder:此值不能為 null

公用方法

describeContents

public int describeContents ()

描述此 Parcelable 執行個體管理表示法中包含的特別物件種類。舉例來說,如果物件在 writeToParcel(android.os.Parcel, int) 的輸出內容中會包含檔案描述元,此方法的傳回值就必須包含 CONTENTS_FILE_DESCRIPTOR 位元。

傳回
int 位元遮罩,表示由此 Parcelable 物件執行個體管理的特殊物件類型組合。值為 0CONTENTS_FILE_DESCRIPTOR

取得介面

public IBinder getInterface ()

傳回與 AppOwnedSdkSandboxInterface 相關聯的繫結器物件。

SDK 和應用程式可以同意繫結器介面,以供應用程式實作,並透過此物件分享。請參閱 AppOwnedSdkSandboxInterface

沙箱中的 SDK 必須先將從這個方法收到的繫結器物件投放到同意的介面,才能使用該介面。

傳回
IBinder 此值不能為 null

getName

public String getName ()

傳回用來註冊 AppOwnedSdkSandboxInterface 的名稱。

應用程式只能註冊一個指定名稱的介面。

傳回
String 此值不能為 null

取得版本

public long getVersion ()

傳回用來註冊 AppOwnedSdkSandboxInterface 的版本。

應用程式可能會選擇的版本,並用來傳達應用程式為此實作項目所做的更新。

傳回
long

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

壓平合併此物件並加入至 Parcel。

參數
dest Parcel:此值不能為 null

flags int:應如何編寫物件的相關其他標記。可以是 0 或 Parcelable.PARCELABLE_WRITE_RETURN_VALUE。值可以是 0Parcelable.PARCELABLE_WRITE_RETURN_VALUE 的組合,以及 android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES