CompanionDeviceManager.HasNotificationAccess(ComponentName) メソッド

定義

指定されたコンポーネントが を介して通知にアクセスできるかどうかを確認します。 NotificationListenerService

        Your app must have an association with a device before calling this API
[Android.Runtime.Register("hasNotificationAccess", "(Landroid/content/ComponentName;)Z", "", ApiSince=26)]
public bool HasNotificationAccess (Android.Content.ComponentName? component);
[<Android.Runtime.Register("hasNotificationAccess", "(Landroid/content/ComponentName;)Z", "", ApiSince=26)>]
member this.HasNotificationAccess : Android.Content.ComponentName -> bool

パラメーター

component
ComponentName

コンポーネントの名前

戻り値

指定されたコンポーネントに通知リスナーのアクセス許可があるかどうか

属性

注釈

指定されたコンポーネントが を介して通知にアクセスできるかどうかを確認します。 NotificationListenerService

この API を呼び出す前に、アプリがデバイスと関連付けられている必要があります

この API を呼び出すには、マニフェストで uses-feature PackageManager#FEATURE_COMPANION_DEVICE_SETUP 宣言が必要です

このメンバーは非推奨とされます。 代わりに、NotificationManager#isNotificationListenerAccessGranted(ComponentName) を使用してください。

の Java ドキュメント android.companion.CompanionDeviceManager.hasNotificationAccess(android.content.ComponentName)

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

適用対象