@Document(name = "builtin:AlarmInstance")
public class AlarmInstance extends Thing


AppSearch document representing an AlarmInstance entity.

An AlarmInstance must be associated with an Alarm. It represents a particular point in time for that Alarm. For example, if an Alarm is set to repeat every Monday, then each AlarmInstance for it will be the exact Mondays that the Alarm did trigger.

The scheduled time should be timezone independent so that it remains unchanged across timezones. E.g.: An AlarmInstance set to fire at 7am GMT should also fire at 7am when the timezone is changed to PST.

Summary

Nested types

Builder for AlarmInstance.

Constants

static final int

The AlarmInstance has been dismissed.

static final int

The AlarmInstance is firing.

static final int

The AlarmInstance has been missed.

static final int

The AlarmInstance is scheduled to fire at some point in the future.

static final int

The AlarmInstance has been snoozed.

static final int

The AlarmInstance is in an unknown error state.

Public methods

@NonNull String

Returns the time that this is expected to fire in ISO 8601 format.

long

Returns the length of time in milliseconds the AlarmInstance will remain snoozed before it fires again, or -1 if it does not support snoozing.

int

Returns the current status.

Inherited methods

From androidx.appsearch.builtintypes.Thing
@NonNull 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.

@Nullable 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.

@NonNull String

Returns the unique identifier for this item.

@Nullable String

Returns the URL for an image of this item.

@Nullable String

Returns the name of this item.

@NonNull String

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

@NonNull List<PotentialAction>

Returns the actions that can be taken on this object.

@Nullable String

Returns the deeplink URL of this item.

Constants

STATUS_DISMISSED

Added in 1.1.0-alpha06
public static final int STATUS_DISMISSED = 3

The AlarmInstance has been dismissed.

STATUS_FIRING

Added in 1.1.0-alpha06
public static final int STATUS_FIRING = 2

The AlarmInstance is firing.

STATUS_MISSED

Added in 1.1.0-alpha06
public static final int STATUS_MISSED = 5

The AlarmInstance has been missed.

STATUS_SCHEDULED

Added in 1.1.0-alpha06
public static final int STATUS_SCHEDULED = 1

The AlarmInstance is scheduled to fire at some point in the future.

STATUS_SNOOZED

Added in 1.1.0-alpha06
public static final int STATUS_SNOOZED = 4

The AlarmInstance has been snoozed.

STATUS_UNKNOWN

Added in 1.1.0-alpha06
public static final int STATUS_UNKNOWN = 0

The AlarmInstance is in an unknown error state.

Public methods

getScheduledTime

Added in 1.1.0-alpha06
public @NonNull String getScheduledTime()

Returns the time that this is expected to fire in ISO 8601 format. E.g.: 2022-01-14T00:00:00

The scheduledTime is a timezone independent date time. When used, it should be converted into a date time in the local timezone.

getSnoozeDurationMillis

Added in 1.1.0-alpha06
public long getSnoozeDurationMillis()

Returns the length of time in milliseconds the AlarmInstance will remain snoozed before it fires again, or -1 if it does not support snoozing.

getStatus

Added in 1.1.0-alpha06
public int getStatus()

Returns the current status.

Status can be either STATUS_UNKNOWN, STATUS_SCHEDULED, STATUS_FIRING, STATUS_DISMISSED, STATUS_SNOOZED, or STATUS_MISSED.