NotificationListenerService.UpdateNotificationChannel 方法

定义

为给定用户更新给定包的通知通道。

[Android.Runtime.Register("updateNotificationChannel", "(Ljava/lang/String;Landroid/os/UserHandle;Landroid/app/NotificationChannel;)V", "", ApiSince=26)]
public void UpdateNotificationChannel (string pkg, Android.OS.UserHandle user, Android.App.NotificationChannel channel);
[<Android.Runtime.Register("updateNotificationChannel", "(Ljava/lang/String;Landroid/os/UserHandle;Landroid/app/NotificationChannel;)V", "", ApiSince=26)>]
member this.UpdateNotificationChannel : string * Android.OS.UserHandle * Android.App.NotificationChannel -> unit

参数

pkg
String

通道所属的包。

user
UserHandle

通道所属的用户。

channel
NotificationChannel

要更新的通道。

属性

注解

为给定用户更新给定包的通知通道。 这只能用于反映用户通过侦听器的用户界面对通道所做的更改。

如果无权访问给定用户的通知,此方法将引发安全异常。

调用方必须具有 CompanionDeviceManager#getAssociations() an associated device 才能使用此方法。

适用于 . 的 android.service.notification.NotificationListenerService.updateNotificationChannel(java.lang.String, android.os.UserHandle, android.app.NotificationChannel)Java 文档

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

适用于