Share via


NotificationManager.GetAutomaticZenRule(String) Method

Definition

Returns the AutomaticZenRule with the given id, if it exists and the caller has access.

[Android.Runtime.Register("getAutomaticZenRule", "(Ljava/lang/String;)Landroid/app/AutomaticZenRule;", "GetGetAutomaticZenRule_Ljava_lang_String_Handler", ApiSince=24)]
public virtual Android.App.AutomaticZenRule? GetAutomaticZenRule (string? id);
[<Android.Runtime.Register("getAutomaticZenRule", "(Ljava/lang/String;)Landroid/app/AutomaticZenRule;", "GetGetAutomaticZenRule_Ljava_lang_String_Handler", ApiSince=24)>]
abstract member GetAutomaticZenRule : string -> Android.App.AutomaticZenRule
override this.GetAutomaticZenRule : string -> Android.App.AutomaticZenRule

Parameters

id
String

Returns

Attributes

Remarks

Returns the AutomaticZenRule with the given id, if it exists and the caller has access.

Throws a SecurityException if policy access is not granted to this package. See #isNotificationPolicyAccessGranted.

Returns null if there are no zen rules that match the given id, or if the calling package doesn't own the matching rule. See AutomaticZenRule#getOwner.

Java documentation for android.app.NotificationManager.getAutomaticZenRule(java.lang.String).

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