CompanionDeviceManager.HasNotificationAccess(ComponentName) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检查给定组件是否可以通过 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
参数
- component
- ComponentName
组件的名称
返回
给定组件是否具有通知侦听器权限
- 属性
注解
检查给定组件是否可以通过 a 访问通知 NotificationListenerService
在调用此 API 之前,你的应用必须与设备关联
调用此 API 需要在清单中使用功能 PackageManager#FEATURE_COMPANION_DEVICE_SETUP 声明
此成员已弃用。 请改用 NotificationManager#isNotificationListenerAccessGranted(ComponentName)。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。