Alarm
@Document(name = "builtin:Alarm")
class Alarm : Thing
AppSearch document representing an Alarm entity.
Summary
Nested types |
|---|
|
Builder for |
Constants |
|
|---|---|
const Int |
The |
const Int |
The |
const Int |
The |
Public functions |
|
|---|---|
String? |
Returns the end time for the blackout period in ISO 8601 format. |
String? |
Returns the start date of the blackout period in ISO 8601 format. |
IntArray<Int>? |
Returns the scheduled days for repeating. |
@IntRange(from = 0, to = 23) Int |
getHour()Returns the hour the |
@IntRange(from = 0, to = 59) Int |
Returns the minute the |
AlarmInstance? |
Returns the next |
Int |
Returns the |
AlarmInstance? |
Returns the previous |
String? |
Returns the ringtone as a content URI to be played, or |
Boolean |
Returns whether or not the |
Boolean |
Returns whether or not to activate the device vibrator when the |
Inherited functions |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
ORIGINATING_DEVICE_SMART_PHONE
const val ORIGINATING_DEVICE_SMART_PHONE = 1: Int
The Alarm belongs to a smart phone device.
ORIGINATING_DEVICE_SMART_WATCH
const val ORIGINATING_DEVICE_SMART_WATCH = 2: Int
The Alarm belongs to a smart watch device.
ORIGINATING_DEVICE_UNKNOWN
const val ORIGINATING_DEVICE_UNKNOWN = 0: Int
The Alarm belongs to an unknown device.
Public functions
getBlackoutPeriodEndDate
fun getBlackoutPeriodEndDate(): String?
Returns the end time for the blackout period in ISO 8601 format. E.g.: 2022-01-14
A blackout period means the Alarm will not fire during this period.
If not set, then it indicates that the blackout period has no end time.
If neither blackoutPeriodStartDate and blackoutPeriodEndDate are set, then the blackout period is not defined.
getBlackoutPeriodStartDate
fun getBlackoutPeriodStartDate(): String?
Returns the start date of the blackout period in ISO 8601 format. E.g.: 2022-01-14
A blackout period means the Alarm will not fire during this period.
If not set, then it indicates that the blackout period has no start time.
If neither blackoutPeriodStartDate and blackoutPeriodEndDate are set, then the blackout period is not defined.
getDaysOfWeek
fun getDaysOfWeek(): IntArray<Int>?
Returns the scheduled days for repeating.
Days of the week can be MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, or SUNDAY.
If null, or if the list is empty, then the Alarm does not repeat.
getHour
fun getHour(): @IntRange(from = 0, to = 23) Int
Returns the hour the Alarm will fire.
Hours are specified by integers from 0 to 23.
getMinute
fun getMinute(): @IntRange(from = 0, to = 59) Int
Returns the minute the Alarm will fire.
Minutes are specified by integers from 0 to 59.
getNextInstance
fun getNextInstance(): AlarmInstance?
Returns the next AlarmInstance.
The next AlarmInstance is the immediate future instance that is scheduled to fire. If there are no future instances, then null will be returned.
See AlarmInstance.
getOriginatingDevice
fun getOriginatingDevice(): Int
Returns the OriginatingDevice this alarm belongs to.
getPreviousInstance
fun getPreviousInstance(): AlarmInstance?
Returns the previous AlarmInstance.
The previous AlarmInstance is most recent past instance that was fired. If there are no past instances, then null will be returned.
See AlarmInstance.
getRingtone
fun getRingtone(): String?
Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.
shouldVibrate
fun shouldVibrate(): Boolean
Returns whether or not to activate the device vibrator when the Alarm fires.