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 |
The state is changing due to a change in context (such as detected driving or sleeping). |
static Int |
The state is changing due to an automatic schedule (alarm, set time, etc). |
static Int |
The state is changing due to an unknown reason. |
static Int |
The state is changing due to an explicit user action. |
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 |
|
An object representing the current state of a |
|
Condition(id: Uri?, summary: String?, line1: String?, line2: String?, icon: Int, state: Int, source: Int, flags: Int) 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 source of, or reason for, the state change represented by this Condition. |
Int |
The state of this condition. |
String! |
A summary of what the rule encoded in |
Constants
SOURCE_CONTEXT
static val SOURCE_CONTEXT: Int
The state is changing due to a change in context (such as detected driving or sleeping).
Value: 3
SOURCE_SCHEDULE
static val SOURCE_SCHEDULE: Int
The state is changing due to an automatic schedule (alarm, set time, etc).
Value: 2
SOURCE_UNKNOWN
static val SOURCE_UNKNOWN: Int
The state is changing due to an unknown reason.
Value: 0
SOURCE_USER_ACTION
static val SOURCE_USER_ACTION: Int
The state is changing due to an explicit user action.
Value: 1
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?,
state: Int,
source: Int)
An object representing the current state of a android.app.AutomaticZenRule
.
Parameters | |
---|---|
id |
Uri?: the android.app.AutomaticZenRule#getConditionId() of the zen rule This value may be null . |
summary |
String?: a user visible description of the rule state This value may be null . |
state |
Int: whether the mode should be activated or deactivated 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 |
source |
Int: the source of, or reason for, the state change represented by this Condition Value is android.service.notification.Condition#SOURCE_UNKNOWN , android.service.notification.Condition#SOURCE_USER_ACTION , android.service.notification.Condition#SOURCE_SCHEDULE , or android.service.notification.Condition#SOURCE_CONTEXT |
Condition
Condition(
id: Uri!,
summary: String!,
line1: String!,
line2: String!,
icon: Int,
state: Int,
flags: Int)
Condition
Condition(
id: Uri?,
summary: String?,
line1: String?,
line2: String?,
icon: Int,
state: Int,
source: Int,
flags: Int)
An object representing the current state of a android.app.AutomaticZenRule
.
Parameters | |
---|---|
id |
Uri?: the android.app.AutomaticZenRule#getConditionId() of the zen rule This value may be null . |
summary |
String?: a user visible description of the rule state This value may be null . |
line1 |
String?: a user-visible description of when the rule will end This value may be null . |
line2 |
String?: a continuation of the user-visible description of when the rule will end This value may be null . |
icon |
Int: an icon representing this condition |
state |
Int: whether the mode should be activated or deactivated 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 |
source |
Int: the source of, or reason for, the state change represented by this Condition Value is android.service.notification.Condition#SOURCE_UNKNOWN , android.service.notification.Condition#SOURCE_USER_ACTION , android.service.notification.Condition#SOURCE_SCHEDULE , or android.service.notification.Condition#SOURCE_CONTEXT |
flags |
Int: flags on this condition |
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()
.
source
val source: Int
The source of, or reason for, the state change represented by this Condition. *
Value is android.service.notification.Condition#SOURCE_UNKNOWN
, android.service.notification.Condition#SOURCE_USER_ACTION
, android.service.notification.Condition#SOURCE_SCHEDULE
, or android.service.notification.Condition#SOURCE_CONTEXT
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
.