CompanionDeviceManager.HasNotificationAccess(ComponentName) Method

Definition

Check whether the given component can access the notifications via a 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

Parameters

component
ComponentName

the name of the component

Returns

whether the given component has the notification listener permission

Attributes

Remarks

Check whether the given component can access the notifications via a NotificationListenerService

Your app must have an association with a device before calling this API

Calling this API requires a uses-feature PackageManager#FEATURE_COMPANION_DEVICE_SETUP declaration in the manifest

This member is deprecated. Use NotificationManager#isNotificationListenerAccessGranted(ComponentName) instead.

Java documentation for android.companion.CompanionDeviceManager.hasNotificationAccess(android.content.ComponentName).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to