SleepSessionRecord
class SleepSessionRecord : IntervalRecord
| kotlin.Any | |||
| ↳ | android.health.connect.datatypes.Record | ||
| ↳ | android.health.connect.datatypes.IntervalRecord | ||
| ↳ | android.health.connect.datatypes.SleepSessionRecord | ||
Captures the user's sleep length and its stages. Each record represents a time interval for a full sleep session.
All Stage time intervals should fall within the sleep session interval. Time intervals for stages don't need to be continuous but shouldn't overlap.
Summary
| Nested classes | |
|---|---|
|
Builder class for |
|
|
Captures the user's length and type of sleep. |
|
|
Identifier for sleeping stage, as returned by |
|
| Public methods | |
|---|---|
| Boolean |
Indicates whether some other object is "equal to" this one. |
| CharSequence? |
getNotes()Returns notes for the sleep session. |
| MutableList<SleepSessionRecord.Stage!> |
Returns stages of the sleep session. |
| CharSequence? |
getTitle()Returns title of the sleep session. |
| Int |
hashCode() |
| Inherited functions | |
|---|---|
| Properties | |
|---|---|
| static AggregationType<Long!> |
Metric identifier to retrieve total sleep session duration using aggregate APIs in . |
Public methods
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
object |
the reference object with which to compare. This value may be null. |
o |
This value may be null. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj |
getNotes
fun getNotes(): CharSequence?
Returns notes for the sleep session. Returns null if no notes was specified.
getStages
fun getStages(): MutableList<SleepSessionRecord.Stage!>
Returns stages of the sleep session.
| Return | |
|---|---|
MutableList<SleepSessionRecord.Stage!> |
This value cannot be null. |
getTitle
fun getTitle(): CharSequence?
Returns title of the sleep session. Returns null if no notes was specified.
Properties
SLEEP_DURATION_TOTAL
static val SLEEP_DURATION_TOTAL: AggregationType<Long!>
Metric identifier to retrieve total sleep session duration using aggregate APIs in . Calculated in milliseconds.