AutomaticZenRule.Builder.SetZenPolicy(ZenPolicy) Method

Definition

Sets the zen policy.

[Android.Runtime.Register("setZenPolicy", "(Landroid/service/notification/ZenPolicy;)Landroid/app/AutomaticZenRule$Builder;", "", ApiSince=35)]
public Android.App.AutomaticZenRule.Builder SetZenPolicy(Android.Service.Notification.ZenPolicy? policy);
[<Android.Runtime.Register("setZenPolicy", "(Landroid/service/notification/ZenPolicy;)Landroid/app/AutomaticZenRule$Builder;", "", ApiSince=35)>]
member this.SetZenPolicy : Android.Service.Notification.ZenPolicy -> Android.App.AutomaticZenRule.Builder

Parameters

policy
ZenPolicy

ZenPolicy: This value may be null.

Returns

This Android.App.AutomaticZenRule.Builder instance, allowing calls to be chained.

Attributes

Remarks

Sets the zen policy. When updating an existing rule via NotificationManager.updateAutomaticZenRule, a null value here means the previous policy is retained.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

Android reference for android.app.AutomaticZenRule.Builder.setZenPolicy.

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