AutomaticZenRule
class AutomaticZenRule : Parcelable
kotlin.Any | |
↳ | android.app.AutomaticZenRule |
Rule instance information for a zen (aka DND or Attention Management) mode.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
AutomaticZenRule(name: String!, owner: ComponentName!, conditionId: Uri!, interruptionFilter: Int, enabled: Boolean) Creates an automatic zen rule. |
|
AutomaticZenRule(name: String, owner: ComponentName?, configurationActivity: ComponentName?, conditionId: Uri, policy: ZenPolicy?, interruptionFilter: Int, enabled: Boolean) Creates an automatic zen rule. |
|
AutomaticZenRule(source: Parcel!) |
Public methods | |
---|---|
Int | |
Boolean |
Indicates whether some other object is "equal to" this one. |
Uri! |
Returns the representation of the state that causes this rule to become active. |
ComponentName? |
Returns the |
Long |
Returns the time this rule was created, represented as milliseconds since the epoch. |
Int |
Returns the interruption filter that is applied when this rule is active. |
String! |
getName() Returns the name of this rule. |
ComponentName! |
getOwner() Returns the |
ZenPolicy? |
Gets the zen policy. |
Int |
hashCode() |
Boolean |
Returns whether this rule is enabled. |
Unit |
setConditionId(conditionId: Uri!) Sets the representation of the state that causes this rule to become active. |
Unit |
setConfigurationActivity(componentName: ComponentName?) Sets the configuration activity - an activity that handles |
Unit |
setEnabled(enabled: Boolean) Enables this rule. |
Unit |
setInterruptionFilter(interruptionFilter: Int) Sets the interruption filter that is applied when this rule is active. |
Unit |
Sets the name of this rule. |
Unit |
setZenPolicy(zenPolicy: ZenPolicy?) Sets the zen policy. |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<AutomaticZenRule!> |
Public constructors
AutomaticZenRule
AutomaticZenRule(
name: String!,
owner: ComponentName!,
conditionId: Uri!,
interruptionFilter: Int,
enabled: Boolean)
Creates an automatic zen rule.
Parameters | |
---|---|
name |
String!: The name of the rule. |
owner |
ComponentName!: The Condition Provider service that owns this rule. |
interruptionFilter |
Int: The interruption filter defines which notifications are allowed to interrupt the user (e.g. via sound & vibration) while this rule is active. |
enabled |
Boolean: Whether the rule is enabled. |
AutomaticZenRule
AutomaticZenRule(
name: String,
owner: ComponentName?,
configurationActivity: ComponentName?,
conditionId: Uri,
policy: ZenPolicy?,
interruptionFilter: Int,
enabled: Boolean)
Creates an automatic zen rule.
Parameters | |
---|---|
name |
String: The name of the rule. This value cannot be null . |
owner |
ComponentName?: The Condition Provider service that owns this rule. This can be null if you're using NotificationManager#setAutomaticZenRuleState(String, Condition) instead of android.service.notification.ConditionProviderService . |
configurationActivity |
ComponentName?: An activity that handles NotificationManager#ACTION_AUTOMATIC_ZEN_RULE that shows the user more information about this rule and/or allows them to configure it. This is required if you are not using a android.service.notification.ConditionProviderService . If you are, it overrides the information specified in your manifest. This value may be null . |
conditionId |
Uri: A representation of the state that should cause your app to apply the given interruption filter. This value cannot be null . |
interruptionFilter |
Int: The interruption filter defines which notifications are allowed to interrupt the user (e.g. via sound & vibration) while this rule is active. |
policy |
ZenPolicy?: The policy defines which notifications are allowed to interrupt the user while this rule is active. This overrides the global policy while this rule is action (Condition#STATE_TRUE ). This value may be null . |
enabled |
Boolean: Whether the rule is enabled. |
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
the reference object with which to compare. |
o |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getConditionId
fun getConditionId(): Uri!
Returns the representation of the state that causes this rule to become active.
getConfigurationActivity
fun getConfigurationActivity(): ComponentName?
Returns the ComponentName
of the activity that shows configuration options for this rule.
Return | |
---|---|
ComponentName? |
This value may be null . |
getCreationTime
fun getCreationTime(): Long
Returns the time this rule was created, represented as milliseconds since the epoch.
getInterruptionFilter
fun getInterruptionFilter(): Int
Returns the interruption filter that is applied when this rule is active.
getOwner
fun getOwner(): ComponentName!
Returns the ComponentName
of the condition provider service that owns this rule.
getZenPolicy
fun getZenPolicy(): ZenPolicy?
Gets the zen policy.
Return | |
---|---|
ZenPolicy? |
This value may be null . |
setConditionId
fun setConditionId(conditionId: Uri!): Unit
Sets the representation of the state that causes this rule to become active.
setConfigurationActivity
fun setConfigurationActivity(componentName: ComponentName?): Unit
Sets the configuration activity - an activity that handles NotificationManager#ACTION_AUTOMATIC_ZEN_RULE
that shows the user more information about this rule and/or allows them to configure it. This is required to be non-null for rules that are not backed by android.service.notification.ConditionProviderService
.
Parameters | |
---|---|
componentName |
ComponentName?: This value may be null . |
setInterruptionFilter
fun setInterruptionFilter(interruptionFilter: Int): Unit
Sets the interruption filter that is applied when this rule is active.
Parameters | |
---|---|
interruptionFilter |
Int: The do not disturb mode to enter when this rule is active. Value is android.app.NotificationManager#INTERRUPTION_FILTER_NONE , android.app.NotificationManager#INTERRUPTION_FILTER_PRIORITY , android.app.NotificationManager#INTERRUPTION_FILTER_ALARMS , android.app.NotificationManager#INTERRUPTION_FILTER_ALL , or android.app.NotificationManager#INTERRUPTION_FILTER_UNKNOWN |
setZenPolicy
fun setZenPolicy(zenPolicy: ZenPolicy?): Unit
Sets the zen policy.
Parameters | |
---|---|
zenPolicy |
ZenPolicy?: This value may be null . |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |