Freigeben über


NotificationManager.UpdateAutomaticZenRule(String, AutomaticZenRule) Method

Definition

Updates the given zen rule.

[Android.Runtime.Register("updateAutomaticZenRule", "(Ljava/lang/String;Landroid/app/AutomaticZenRule;)Z", "GetUpdateAutomaticZenRule_Ljava_lang_String_Landroid_app_AutomaticZenRule_Handler", ApiSince=24)]
public virtual bool UpdateAutomaticZenRule (string? id, Android.App.AutomaticZenRule? automaticZenRule);
[<Android.Runtime.Register("updateAutomaticZenRule", "(Ljava/lang/String;Landroid/app/AutomaticZenRule;)Z", "GetUpdateAutomaticZenRule_Ljava_lang_String_Landroid_app_AutomaticZenRule_Handler", ApiSince=24)>]
abstract member UpdateAutomaticZenRule : string * Android.App.AutomaticZenRule -> bool
override this.UpdateAutomaticZenRule : string * Android.App.AutomaticZenRule -> bool

Parameters

id
String

The id of the rule to update

automaticZenRule
AutomaticZenRule

the rule to update.

Returns

Whether the rule was successfully updated.

Attributes

Remarks

Updates the given zen rule.

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

Callers can only update rules that they own. See AutomaticZenRule#getOwner.

Java documentation for android.app.NotificationManager.updateAutomaticZenRule(java.lang.String, android.app.AutomaticZenRule).

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