Share via


NotificationListenerService.GetNotificationChannelGroups Method

Definition

Returns all notification channel groups belonging to the given package for a given user.

[Android.Runtime.Register("getNotificationChannelGroups", "(Ljava/lang/String;Landroid/os/UserHandle;)Ljava/util/List;", "", ApiSince=26)]
public System.Collections.Generic.IList<Android.App.NotificationChannelGroup>? GetNotificationChannelGroups (string pkg, Android.OS.UserHandle user);
[<Android.Runtime.Register("getNotificationChannelGroups", "(Ljava/lang/String;Landroid/os/UserHandle;)Ljava/util/List;", "", ApiSince=26)>]
member this.GetNotificationChannelGroups : string * Android.OS.UserHandle -> System.Collections.Generic.IList<Android.App.NotificationChannelGroup>

Parameters

pkg
String

The package to retrieve channel groups for.

user
UserHandle

Returns

Attributes

Remarks

Returns all notification channel groups belonging to the given package for a given user.

This method will throw a security exception if you don't have access to notifications for the given user.

The caller must have CompanionDeviceManager#getAssociations() an associated device or be the NotificationAssistantService notification assistant in order to use this method.

Java documentation for android.service.notification.NotificationListenerService.getNotificationChannelGroups(java.lang.String, android.os.UserHandle).

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