Added in API level 34

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 SleepSessionRecord

Captures the user's length and type of sleep.

Identifier for sleeping stage, as returned by Stage#getType().

Public methods
Boolean
equals(other: Any?)

CharSequence?

Returns notes for the sleep session.

MutableList<SleepSessionRecord.Stage!>

Returns stages of the sleep session.

CharSequence?

Returns title of the sleep session.

Int

Inherited functions
Properties
static AggregationType<Long!>

Metric identifier to retrieve total sleep session duration using aggregate APIs in .

Public methods

equals

Added in API level 34
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
object the reference object with which to compare. This value may be null.
Return
Boolean true if this object is the same as the obj

getNotes

Added in API level 34
fun getNotes(): CharSequence?

Returns notes for the sleep session. Returns null if no notes was specified.

getStages

Added in API level 34
fun getStages(): MutableList<SleepSessionRecord.Stage!>

Returns stages of the sleep session.

Return
MutableList<SleepSessionRecord.Stage!> This value cannot be null.

getTitle

Added in API level 34
fun getTitle(): CharSequence?

Returns title of the sleep session. Returns null if no notes was specified.

hashCode

Added in API level 34
fun hashCode(): Int
Return
Int a hash code value for this object.

Properties

SLEEP_DURATION_TOTAL

Added in API level 34
static val SLEEP_DURATION_TOTAL: AggregationType<Long!>

Metric identifier to retrieve total sleep session duration using aggregate APIs in . Calculated in milliseconds.