AlarmInstance
@Document(name = "builtin:AlarmInstance")
public class AlarmInstance extends Thing
| java.lang.Object | ||
| ↳ | androidx.appsearch.builtintypes.Thing | |
| ↳ | androidx.appsearch.builtintypes.AlarmInstance |
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 |
|---|
@Document.BuilderProducerBuilder for |
Constants |
|
|---|---|
static final int |
STATUS_DISMISSED = 3The |
static final int |
STATUS_FIRING = 2The |
static final int |
STATUS_MISSED = 5The |
static final int |
STATUS_SCHEDULED = 1The |
static final int |
STATUS_SNOOZED = 4The |
static final int |
STATUS_UNKNOWN = 0The |
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 |
int |
Returns the current status. |
Inherited methods |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
STATUS_DISMISSED
public static final int STATUS_DISMISSED = 3
The AlarmInstance has been dismissed.
STATUS_MISSED
public static final int STATUS_MISSED = 5
The AlarmInstance has been missed.
STATUS_SCHEDULED
public static final int STATUS_SCHEDULED = 1
The AlarmInstance is scheduled to fire at some point in the future.
STATUS_SNOOZED
public static final int STATUS_SNOOZED = 4
The AlarmInstance has been snoozed.
STATUS_UNKNOWN
public static final int STATUS_UNKNOWN = 0
The AlarmInstance is in an unknown error state.
Public methods
getScheduledTime
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
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
public int getStatus()
Returns the current status.
Status can be either STATUS_UNKNOWN, STATUS_SCHEDULED, STATUS_FIRING, STATUS_DISMISSED, STATUS_SNOOZED, or STATUS_MISSED.