This interface defines the detailed sleep stage for the specified sleep data.
Stages of sleep
During sleep, the user's body alternates between two types of sleep:
NREM (non-rapid eye movement) and REM (rapid eye movement) sleep.
NREM sleep consists of the following stages:
- Light: In light sleep, the user transits from wakefulness to sleep.
The user's breading and heart rate become regular and the user's body temperature drops.
- Deep: In deep sleep, the user becomes less responsive to the user's surroundings.
The user's breathing slows and his/her muscles are more relaxed.
This is the stage when the user's body restores and recharges itself.
In REM sleep, the user's body is relaxed and immobile
while the user's brain becomes more active and re-energizes itself for the next day.
This is the stage when the majority of the user's dreams occur.
Awake includes the times you wake up briefly and
the periods the user is restless during a sleep.
Sleep and Sleep Stage
HealthConstants.Sleep
includes only the start and end time of the user's sleep.
SleepStage
gives detailed sleep stage information with several sections for the specified Sleep
data.
The sleep stage can be presented as the following figure.
Sleep #1
Sleep data is saved as "Sleep #1" if HealthConstants.Sleep
is used only.
Sleep #2
Otherwise, "Sleep #2" data that is composed of HealthConstants.Sleep
and HealthConstants.SleepStage
.
It shows:
- The user goes to bed at 23:30.
- The his/her sleep stage is
SLEEP_LIGHT
for 23:30 ~ 00:40 of the next day.
- The his/her sleep stage is
SLEEP_DEEP
for 00:40 ~ 02:00.
- The his/her sleep stage is
SLEEP_REM
for 02:00 ~ 05:10.
- The his/her sleep stage is
SLEEP_AWAKE
for 05:10 ~ 06:30.
- He/she awakes at 06:30.
Properties
Properties of the following extending interfaces are available for this data type.
Sleep stage data has the following properties.
See more common properties by spreading this section out.
Property name |
Description |
HealthConstants.SleepStage.UUID |
[Mandatory]
Data's unique ID,
assigned by the system when a new data is inserted |
HealthConstants.SleepStage.CREATE_TIME |
[Mandatory]
UTC milliseconds when a data is created in the health data store,
assigned by the system when a new data is inserted |
HealthConstants.SleepStage.UPDATE_TIME |
[Mandatory]
UTC milliseconds when a data is updated in the health data store,
assigned by the system when a new data is inserted or the existing data is updated |
HealthConstants.SleepStage.PACKAGE_NAME |
[Mandatory]
Package name which provides data,
assigned by the system when a new data is inserted |
HealthConstants.SleepStage.DEVICE_UUID |
[Mandatory]
Device identifier which provides the health data |
HealthConstants.SleepStage.START_TIME |
[Mandatory]
UTC milliseconds when the measurement is started |
HealthConstants.SleepStage.END_TIME |
[Mandatory]
UTC milliseconds after the measurement has ended |
HealthConstants.SleepStage.TIME_OFFSET |
[Mandatory]
Time offset in milliseconds which considers the time zone and daylight saving time |
HealthConstants.SleepStage.SLEEP_ID |
[Mandatory]
The specified sleep data's ID |
HealthConstants.SleepStage.STAGE |
[Mandatory]
Sleep stage |
HealthConstants.SleepStage.CUSTOM |
Custom info which is formatted with JSON and compressed data |
Data Permission
The user's consent is required to read or write this data type.
HealthPermissionManager.requestPermissions() displays a data permission UI to the user.
See
Permission Manager and request data permission.