Freigeben über


NotificationListenerService.RequestInterruptionFilter Method

Definition

Sets the desired #getCurrentInterruptionFilter() interruption filter.

[Android.Runtime.Register("requestInterruptionFilter", "(I)V", "")]
public void RequestInterruptionFilter(Android.Service.Notification.InterruptionFilterType interruptionFilter);
[<Android.Runtime.Register("requestInterruptionFilter", "(I)V", "")>]
member this.RequestInterruptionFilter : Android.Service.Notification.InterruptionFilterType -> unit

Parameters

interruptionFilter
InterruptionFilterType

One of the INTERRUPTION_FILTER_ constants.

Attributes

Remarks

Sets the desired #getCurrentInterruptionFilter() interruption filter.

This is merely a request, the host may or may not choose to apply the requested interruption filter depending on other listener requests or other global state.

Listen for updates using #onInterruptionFilterChanged(int).

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 android.app.AutomaticZenRule associated to the app.

The service should wait for the #onListenerConnected() event before performing this operation.

Java documentation for android.service.notification.NotificationListenerService.requestInterruptionFilter(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