NotificationListenerService.GetNotificationChannels 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回属于给定用户给定包的所有通知通道。
[Android.Runtime.Register("getNotificationChannels", "(Ljava/lang/String;Landroid/os/UserHandle;)Ljava/util/List;", "", ApiSince=26)]
public System.Collections.Generic.IList<Android.App.NotificationChannel>? GetNotificationChannels (string pkg, Android.OS.UserHandle user);
[<Android.Runtime.Register("getNotificationChannels", "(Ljava/lang/String;Landroid/os/UserHandle;)Ljava/util/List;", "", ApiSince=26)>]
member this.GetNotificationChannels : string * Android.OS.UserHandle -> System.Collections.Generic.IList<Android.App.NotificationChannel>
参数
- pkg
- String
要为其检索通道的包。
- user
- UserHandle
返回
- 属性
注解
返回属于给定用户给定包的所有通知通道。
如果无权访问给定用户的通知,此方法将引发安全异常。
调用方必须具有 CompanionDeviceManager#getAssociations() an associated device
或必须是 NotificationAssistantService notification assistant
使用此方法的方法。
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。