Condition
class Condition : Parcelable
kotlin.Any | |
↳ | android.service.notification.Condition |
The current condition of an android.app.AutomaticZenRule
, provided by the app that owns the rule. Used to tell the system to enter Do Not Disturb mode and request that the system exit Do Not Disturb mode.
Summary
Constants | |
---|---|
static Int | |
static Int | |
static String | |
static Int | |
static Int |
Indicates that Do Not Disturb should be turned off. |
static Int |
Indicates that Do Not Disturb should be turned on. |
static Int |
Inherited constants | |
---|---|
Public constructors | |
---|---|
An object representing the current state of a |
|
Public methods | |
---|---|
Condition! |
copy() |
Int | |
Boolean |
Indicates whether some other object is "equal to" this one. |
Int |
hashCode() |
static Boolean | |
static Uri.Builder! | |
static String! |
relevanceToString(flags: Int) |
static String! |
stateToString(state: Int) |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<Condition!> | |
Int | |
Int | |
Uri! |
The URI representing the rule being updated. |
String! | |
String! | |
Int |
The state of this condition. |
String! |
A summary of what the rule encoded in |
Constants
STATE_FALSE
static val STATE_FALSE: Int
Indicates that Do Not Disturb should be turned off. Note that all Conditions from all android.app.AutomaticZenRule
providers must be off for Do Not Disturb to be turned off on the device.
Value: 0
STATE_TRUE
static val STATE_TRUE: Int
Indicates that Do Not Disturb should be turned on.
Value: 1
Public constructors
Condition
Condition(
id: Uri!,
summary: String!,
state: Int)
An object representing the current state of a android.app.AutomaticZenRule
.
Parameters | |
---|---|
id |
Uri!: the android.app.AutomaticZenRule#getConditionId() of the zen rule |
summary |
String!: a user visible description of the rule state |
state |
Int: whether the mode should be activated or deactivated |
Condition
Condition(
id: Uri!,
summary: String!,
line1: String!,
line2: String!,
icon: Int,
state: Int,
flags: Int)
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. |
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 |
Properties
id
val id: Uri!
The URI representing the rule being updated. See android.app.AutomaticZenRule#getConditionId()
.
state
val state: Int
The state of this condition. STATE_TRUE
will enable Do Not Disturb mode. STATE_FALSE
will turn Do Not Disturb off for this rule. Note that Do Not Disturb might still be enabled globally if other conditions are in a STATE_TRUE
state.
Value is android.service.notification.Condition#STATE_FALSE
, android.service.notification.Condition#STATE_TRUE
, android.service.notification.Condition#STATE_UNKNOWN
, or android.service.notification.Condition#STATE_ERROR
summary
val summary: String!
A summary of what the rule encoded in id
means when it is enabled. User visible if the state of the condition is STATE_TRUE
.