# Alarm

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/Alarm.java+class:androidx.appsearch.builtintypes.Alarm) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


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

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) ||
|   | ↳ | [androidx.appsearch.builtintypes.Alarm](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm) |

*** ** * ** ***

AppSearch document representing an `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` entity.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.BuilderProducer class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.Builder : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.Builder!>` Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`. |
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi class https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase<T : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase<T!>?> : https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase<T!>` |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#ORIGINATING_DEVICE_SMART_PHONE() = 1` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to a smart phone device. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#ORIGINATING_DEVICE_SMART_WATCH() = 2` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to a smart watch device. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#ORIGINATING_DEVICE_UNKNOWN() = 0` The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to an unknown device. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#Alarm(androidx.appsearch.builtintypes.Alarm.BuilderBase<?>)(builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase<*>)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getBlackoutPeriodEndDate()()` Returns the end time for the blackout period in ISO 8601 format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getBlackoutPeriodStartDate()()` Returns the start date of the blackout period in ISO 8601 format. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getDaysOfWeek()()` Returns the scheduled days for repeating. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 23) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getHour()()` Returns the hour the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 59) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getMinute()()` Returns the minute the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getNextInstance()()` Returns the next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getOriginatingDevice()()` Returns the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.OriginatingDevice` this alarm belongs to. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getPreviousInstance()()` Returns the previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#getRingtone()()` Returns the ringtone as a content URI to be played, or `https://developer.android.com/reference/android/provider/AlarmClock.html#VALUE_RINGTONE_SILENT` if no ringtone will be played. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#isEnabled()()` Returns whether or not the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` is active. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm#shouldVibrate()()` Returns whether or not to activate the device vibrator when the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` fires. |

### Inherited functions

From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing) `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getAlternateNames()()`

Returns an unmodifiable list of aliases, if any, for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction!>` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing#getUrl()()`

Returns the deeplink URL of this item.

## Constants

### ORIGINATING_DEVICE_SMART_PHONE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val ORIGINATING_DEVICE_SMART_PHONE = 1: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to a smart phone device.

### ORIGINATING_DEVICE_SMART_WATCH

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val ORIGINATING_DEVICE_SMART_WATCH = 2: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to a smart watch device.

### ORIGINATING_DEVICE_UNKNOWN

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val ORIGINATING_DEVICE_UNKNOWN = 0: Int
```

The `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` belongs to an unknown device.

## Public constructors

### Alarm

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
@ExperimentalAppSearchApi
Alarm(builder: Alarm.BuilderBase<*>)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`.

| Parameters |
|---|---|
| `builder: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase<*>` | The builder to construct the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` from. |

## Public functions

### getBlackoutPeriodEndDate

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
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 `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/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](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
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 `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/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](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getDaysOfWeek(): Array<Int>?
```

Returns the scheduled days for repeating.

Days of the week can be `https://developer.android.com/reference/java/util/Calendar.html#MONDAY`, `https://developer.android.com/reference/java/util/Calendar.html#TUESDAY`, `https://developer.android.com/reference/java/util/Calendar.html#WEDNESDAY`, `https://developer.android.com/reference/java/util/Calendar.html#THURSDAY`, `https://developer.android.com/reference/java/util/Calendar.html#FRIDAY`, `https://developer.android.com/reference/java/util/Calendar.html#SATURDAY`, or `https://developer.android.com/reference/java/util/Calendar.html#SUNDAY`.

If null, or if the list is empty, then the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` does not repeat.

### getHour

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getHour(): @IntRange(from = 0, to = 23) Int
```

Returns the hour the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire.

Hours are specified by integers from 0 to 23.

### getMinute

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getMinute(): @IntRange(from = 0, to = 59) Int
```

Returns the minute the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire.

Minutes are specified by integers from 0 to 59.

### getNextInstance

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getNextInstance(): AlarmInstance?
```

Returns the next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

The next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is the immediate future instance that is scheduled to fire. If there are no future instances, then null will be returned.

See `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

### getOriginatingDevice

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getOriginatingDevice(): Int
```

Returns the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.OriginatingDevice` this alarm belongs to.

### getPreviousInstance

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getPreviousInstance(): AlarmInstance?
```

Returns the previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

The previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is most recent past instance that was fired. If there are no past instances, then null will be returned.

See `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

### getRingtone

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getRingtone(): String?
```

Returns the ringtone as a content URI to be played, or `https://developer.android.com/reference/android/provider/AlarmClock.html#VALUE_RINGTONE_SILENT` if no ringtone will be played.

### isEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun isEnabled(): Boolean
```

Returns whether or not the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` is active.

### shouldVibrate

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun shouldVibrate(): Boolean
```

Returns whether or not to activate the device vibrator when the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` fires.