@Document(name = "builtin:Alarm")
class Alarm : Thing


AppSearch document representing an Alarm entity.

Summary

Nested types

Builder for Alarm.

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

Returns the hour the Alarm will fire.

@IntRange(from = 0, to = 59) Int

Returns the minute the Alarm will fire.

AlarmInstance?

Returns the next AlarmInstance.

AlarmInstance?

Returns the previous AlarmInstance.

String?

Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

Boolean

Returns whether or not the Alarm is active.

Boolean

Returns whether or not to activate the device vibrator when the Alarm fires.

Inherited functions

From androidx.appsearch.builtintypes.Thing
(Mutable)List<String!>

Returns an unmodifiable list of aliases, if any, for this item.

Long

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.

String?

Returns a description of this item.

Int

Returns the intrinsic score (or importance) of this item.

Long

Returns the time-to-live timestamp, in milliseconds since getCreationTimestampMillis, for this item.

String

Returns the unique identifier for this item.

String?

Returns the URL for an image of this item.

String?

Returns the name of this item.

String

Returns the namespace (or logical grouping) for this item.

(Mutable)List<PotentialAction!>

Returns the actions that can be taken on this object.

String?

Returns the deeplink URL of this item.

Public functions

getBlackoutPeriodEndDate

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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.

getPreviousInstance

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
fun getRingtone(): String?

Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

isEnabled

Added in 1.1.0-alpha04
fun isEnabled(): Boolean

Returns whether or not the Alarm is active.

shouldVibrate

Added in 1.1.0-alpha04
fun shouldVibrate(): Boolean

Returns whether or not to activate the device vibrator when the Alarm fires.