NotificationListenerService.GetNotificationChannels 方法

定义

返回属于给定用户给定包的所有通知通道。

[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.service.notification.NotificationListenerService.getNotificationChannels(java.lang.String, android.os.UserHandle)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于