Compartilhar via


NotificationManager.SetInterruptionFilter(InterruptionFilter) Method

Definition

Sets the current notification interruption filter.

[Android.Runtime.Register("setInterruptionFilter", "(I)V", "", ApiSince=23)]
public void SetInterruptionFilter (Android.App.InterruptionFilter interruptionFilter);
[<Android.Runtime.Register("setInterruptionFilter", "(I)V", "", ApiSince=23)>]
member this.SetInterruptionFilter : Android.App.InterruptionFilter -> unit

Parameters

interruptionFilter
InterruptionFilter
Attributes

Remarks

Sets the current notification interruption filter.

The interruption filter defines which notifications are allowed to interrupt the user (e.g. via sound &amp; vibration) and is applied globally.

Apps targeting Build.VERSION_CODES#VANILLA_ICE_CREAM and above (with some exceptions, such as companion device managers) cannot modify the global interruption filter. Calling this method will instead activate or deactivate an AutomaticZenRule associated to the app, using a ZenPolicy that corresponds to the Policy supplied to #setNotificationPolicy(Policy) (or the global policy when one wasn't provided).

Only available if policy access is granted to this package. See #isNotificationPolicyAccessGranted.

Java documentation for android.app.NotificationManager.setInterruptionFilter(int).

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