Language

Context.BindServiceAsUser メソッド

定義

オーバーロード

名前 説明
BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)

BindServiceFlags オブジェクトを取得するには、bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) を参照してください。

BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

userと同じ方法で、指定された#bindService内のサービスにバインドします。

BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)

BindServiceFlags オブジェクトを取得するには、bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) を参照してください。

[Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;Landroid/content/Context$BindServiceFlags;Landroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_Landroid_content_Context_BindServiceFlags_Landroid_os_UserHandle_Handler", ApiSince=34)]
public virtual bool BindServiceAsUser(Android.Content.Intent service, Android.Content.IServiceConnection conn, Android.Content.Context.BindServiceFlags flags, Android.OS.UserHandle user);
[<Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;Landroid/content/Context$BindServiceFlags;Landroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_Landroid_content_Context_BindServiceFlags_Landroid_os_UserHandle_Handler", ApiSince=34)>]
abstract member BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * Android.Content.Context.BindServiceFlags * Android.OS.UserHandle -> bool
override this.BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * Android.Content.Context.BindServiceFlags * Android.OS.UserHandle -> bool

パラメーター

service
Intent

この値を null にすることはできません。

conn
IServiceConnection

この値を null にすることはできません。

flags
Context.BindServiceFlags

この値を null にすることはできません。

user
UserHandle

この値を null にすることはできません。

返品

BindServiceFlags オブジェクトを取得するには、bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) を参照してください。

属性

注釈

BindServiceFlags オブジェクトを取得するには、bindServiceAsUser(Intent,ServiceConnection,int,UserHandle) Call BindServiceFlags.of(long) を参照してください。

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象

BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

userと同じ方法で、指定された#bindService内のサービスにバインドします。

[Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_ILandroid_os_UserHandle_Handler", ApiSince=30)]
public virtual bool BindServiceAsUser(Android.Content.Intent service, Android.Content.IServiceConnection conn, int flags, Android.OS.UserHandle user);
[<Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_ILandroid_os_UserHandle_Handler", ApiSince=30)>]
abstract member BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * int * Android.OS.UserHandle -> bool
override this.BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * int * Android.OS.UserHandle -> bool

パラメーター

service
Intent

接続するサービスを識別します。 意図では、明示的なコンポーネント名を指定する必要があります。

conn
IServiceConnection

サービスの開始と停止時に情報を受信します。 これは有効な ServiceConnection オブジェクトである必要があります。null にすることはできません。

flags
Int32

バインドの操作オプション。 0、 #BIND_AUTO_CREATE、 #BIND_DEBUG_UNBIND、 #BIND_NOT_FOREGROUND、 #BIND_ABOVE_CLIENT、 #BIND_ALLOW_OOM_MANAGEMENT、 #BIND_WAIVE_PRIORITY。 #BIND_IMPORTANT または #BIND_ADJUST_WITH_ACTIVITY。

user
UserHandle

この値を null にすることはできません。

返品

true クライアントがバインドするアクセス許可を持つサービスをシステムが起動中の場合。システムでサービスが見つからなかった場合に false します。 このメソッドが#unbindService返された場合でも、falseを呼び出して接続を解放する必要があります。

属性

注釈

userと同じ方法で、指定された#bindService内のサービスにバインドします。

次のいずれかの条件が満たされている必要があります。 <ul><li>caller は android.Manifest.permission.INTERACT_ACROSS_USERS_FULL</li><li>caller が android.Manifest.permission.INTERACT_ACROSS_USERS を持ち、 service と同じパッケージであり (コンポーネントのパッケージによって決定されます)、Android のバージョンが少なくとも android.os.Build.VERSION_CODES#TIRAMISU</ li><li>caller には android.Manifest.permission.INTERACT_ACROSS_USERS があり、指定された user</li><li>caller と同じプロファイル グループに android.Manifest.permission.INTERACT_ACROSS_PROFILES があり、指定された user と同じプロファイル グループにあり、 service</li と同じパッケージです></ul>

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象