NotificationManager.Policy Constructors

Definition

Overloads

Name Description
NotificationManager.Policy(IntPtr, JniHandleOwnership)

Initializes a managed representation of an existing Java Native Interface object.

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders)

Constructs a policy for Do Not Disturb priority mode behavior.

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders, Int32)

Constructs a policy for Do Not Disturb priority mode behavior.

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders, Int32, Int32)

Constructs a policy for Do Not Disturb priority mode behavior.

NotificationManager.Policy(IntPtr, JniHandleOwnership)

Initializes a managed representation of an existing Java Native Interface object.

protected Policy(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.App.NotificationManager.Policy : nativeint * Android.Runtime.JniHandleOwnership -> Android.App.NotificationManager.Policy

Parameters

javaReference
IntPtr

nativeint

The Java Native Interface object reference.

transfer
JniHandleOwnership

The ownership transfer to apply to the Java Native Interface object reference.

Remarks

This constructor is called by the .NET for Android binding runtime when it creates a managed peer for an existing Java object.

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

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders)

Constructs a policy for Do Not Disturb priority mode behavior.

[Android.Runtime.Register(".ctor", "(III)V", "", ApiSince=23)]
public Policy(Android.App.NotificationPriorityCategory priorityCategories, Android.App.NotificationPrioritySenders priorityCallSenders, Android.App.NotificationPrioritySenders priorityMessageSenders);
[<Android.Runtime.Register(".ctor", "(III)V", "", ApiSince=23)>]
new Android.App.NotificationManager.Policy : Android.App.NotificationPriorityCategory * Android.App.NotificationPrioritySenders * Android.App.NotificationPrioritySenders -> Android.App.NotificationManager.Policy

Parameters

priorityCategories
NotificationPriorityCategory

int: bitmask of categories of notifications that can bypass DND.

priorityCallSenders
NotificationPrioritySenders

int: which callers can bypass DND.

priorityMessageSenders
NotificationPrioritySenders

int: which message senders can bypass DND.

Attributes

Remarks

Constructs a policy for Do Not Disturb priority mode behavior. Apps that target API levels below Build.VERSION_CODES.P cannot change user-designated values to allow or disallow Policy.PRIORITY_CATEGORY_ALARMS, Policy.PRIORITY_CATEGORY_SYSTEM, and Policy.PRIORITY_CATEGORY_MEDIA from bypassing dnd.

Android reference for android.app.NotificationManager.Policy.Policy.

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

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders, Int32)

Constructs a policy for Do Not Disturb priority mode behavior.

[Android.Runtime.Register(".ctor", "(IIII)V", "", ApiSince=24)]
public Policy(Android.App.NotificationPriorityCategory priorityCategories, Android.App.NotificationPrioritySenders priorityCallSenders, Android.App.NotificationPrioritySenders priorityMessageSenders, int suppressedVisualEffects);
[<Android.Runtime.Register(".ctor", "(IIII)V", "", ApiSince=24)>]
new Android.App.NotificationManager.Policy : Android.App.NotificationPriorityCategory * Android.App.NotificationPrioritySenders * Android.App.NotificationPrioritySenders * int -> Android.App.NotificationManager.Policy

Parameters

priorityCategories
NotificationPriorityCategory

int: bitmask of categories of notifications that can bypass DND.

priorityCallSenders
NotificationPrioritySenders

int: which callers can bypass DND.

priorityMessageSenders
NotificationPrioritySenders

int: which message senders can bypass DND.

suppressedVisualEffects
Int32

int: which visual interruptions should be suppressed from notifications that are filtered by DND.

Attributes

Remarks

Constructs a policy for Do Not Disturb priority mode behavior. Apps that target API levels below Build.VERSION_CODES.R cannot change user-designated values to allow or disallow Policy.PRIORITY_CATEGORY_CONVERSATIONS, from bypassing dnd. Additionally, apps that target API levels below Build.VERSION_CODES.P can only modify the SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF bits of the suppressed visual effects field. All other suppressed effects will be ignored and reconstituted from the screen on and screen off values. Apps that target Build.VERSION_CODES.P or above can set any suppressed visual effects. However, if any suppressed effects > SUPPRESSED_EFFECT_SCREEN_ON are set, SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF will be ignored and reconstituted from the more specific suppressed visual effect bits. Apps should migrate to targeting specific effects instead of the deprecated SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF effects.

Android reference for android.app.NotificationManager.Policy.Policy.

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

NotificationManager.Policy(NotificationPriorityCategory, NotificationPrioritySenders, NotificationPrioritySenders, Int32, Int32)

Constructs a policy for Do Not Disturb priority mode behavior.

[Android.Runtime.Register(".ctor", "(IIIII)V", "", ApiSince=30)]
public Policy(Android.App.NotificationPriorityCategory priorityCategories, Android.App.NotificationPrioritySenders priorityCallSenders, Android.App.NotificationPrioritySenders priorityMessageSenders, int suppressedVisualEffects, int priorityConversationSenders);
[<Android.Runtime.Register(".ctor", "(IIIII)V", "", ApiSince=30)>]
new Android.App.NotificationManager.Policy : Android.App.NotificationPriorityCategory * Android.App.NotificationPrioritySenders * Android.App.NotificationPrioritySenders * int * int -> Android.App.NotificationManager.Policy

Parameters

priorityCategories
NotificationPriorityCategory

int: bitmask of categories of notifications that can bypass DND.

priorityCallSenders
NotificationPrioritySenders

int: which callers can bypass DND. Value is one of the following: PRIORITY_SENDERS_ANY PRIORITY_SENDERS_CONTACTS PRIORITY_SENDERS_STARRED

priorityMessageSenders
NotificationPrioritySenders

int: which message senders can bypass DND. Value is one of the following: PRIORITY_SENDERS_ANY PRIORITY_SENDERS_CONTACTS PRIORITY_SENDERS_STARRED

suppressedVisualEffects
Int32

int: which visual interruptions should be suppressed from notifications that are filtered by DND.

priorityConversationSenders
Int32

int: Value is one of the following: CONVERSATION_SENDERS_ANYONE CONVERSATION_SENDERS_IMPORTANT CONVERSATION_SENDERS_NONE

Attributes

Remarks

Constructs a policy for Do Not Disturb priority mode behavior. Apps that target API levels below Build.VERSION_CODES.P cannot change user-designated values to allow or disallow Policy.PRIORITY_CATEGORY_CONVERSATIONS from bypassing dnd. If you do need to change them, use a ZenPolicy associated with an AutomaticZenRule instead of changing the global setting. Apps that target API levels below Build.VERSION_CODES.P cannot change user-designated values to allow or disallow Policy.PRIORITY_CATEGORY_ALARMS, Policy.PRIORITY_CATEGORY_SYSTEM, and Policy.PRIORITY_CATEGORY_MEDIA from bypassing dnd. Additionally, apps that target API levels below Build.VERSION_CODES.P can only modify the SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF bits of the suppressed visual effects field. All other suppressed effects will be ignored and reconstituted from the screen on and screen off values. Apps that target Build.VERSION_CODES.P or above can set any suppressed visual effects. However, if any suppressed effects > SUPPRESSED_EFFECT_SCREEN_ON are set, SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF will be ignored and reconstituted from the more specific suppressed visual effect bits. Apps should migrate to targeting specific effects instead of the deprecated SUPPRESSED_EFFECT_SCREEN_ON and SUPPRESSED_EFFECT_SCREEN_OFF effects.

Android reference for android.app.NotificationManager.Policy.Policy.

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