SleepSegmentRequest Stay organized with collections Save and categorize content based on your preferences.
Page Summary
SleepSegmentRequest is a request object used to specify data to receive from the Sleep API, defaulting to requesting both sleep segment and classify events.
You can specify whether to request only sleep classify events, only sleep segment events, or both using the provided constants.
A default request for both types of sleep data can be created using
getDefaultSleepSegmentRequest().The requested data type can be retrieved using the
getRequestedDataType()method.
A request object that specifies what data to receive from the Sleep API. Defaults toSEGMENT_AND_CLASSIFY_EVENTS.
Constant Summary
| int | CLASSIFY_EVENTS_ONLY | RequestsSleepClassifyEvent only. |
| int | SEGMENT_AND_CLASSIFY_EVENTS | Requests both theSleepSegmentEvent and theSleepClassifyEvent. |
| int | SEGMENT_EVENTS_ONLY | RequestsSleepSegmentEvent only. |
Inherited Constant Summary
| int | CONTENTS_FILE_DESCRIPTOR | |
| int | PARCELABLE_WRITE_RETURN_VALUE |
Field Summary
| public static finalCreator<SleepSegmentRequest> | CREATOR |
Public Constructor Summary
SleepSegmentRequest(int requestedDataType) Constructs a SleepSegmentRequest indicating what type of data is being requested. |
Public Method Summary
| boolean | |
| staticSleepSegmentRequest | getDefaultSleepSegmentRequest() Creates a default request that registers for both SleepSegmentEvent andSleepClassifyEvent data. |
| int | getRequestedDataType() Returns the requested data type, which is one of SEGMENT_AND_CLASSIFY_EVENTS, SEGMENT_EVENTS_ONLY, or CLASSIFY_EVENTS_ONLY. |
| int | hashCode() |
| void | writeToParcel(Parcel parcel, int flags) |
Inherited Method Summary
| abstract int | describeContents() |
| abstract void | writeToParcel(Parcel arg0, int arg1) |
Constants
public static final intCLASSIFY_EVENTS_ONLY
RequestsSleepClassifyEvent only.
public static final intSEGMENT_AND_CLASSIFY_EVENTS
Requests both theSleepSegmentEvent and theSleepClassifyEvent.
public static final intSEGMENT_EVENTS_ONLY
RequestsSleepSegmentEvent only.
Fields
public static finalCreator<SleepSegmentRequest>CREATOR
Public Constructors
publicSleepSegmentRequest(int requestedDataType)
Constructs aSleepSegmentRequest indicating what type of data is being requested.
Parameters
| requestedDataType | The type of data to receive pending intents for; valid values are SEGMENT_AND_CLASSIFY_EVENTS, SEGMENT_EVENTS_ONLY, and CLASSIFY_EVENTS_ONLY. |
|---|
Public Methods
public booleanequals(Object o)
public staticSleepSegmentRequestgetDefaultSleepSegmentRequest()
Creates a default request that registers for bothSleepSegmentEvent andSleepClassifyEvent data.
public intgetRequestedDataType()
Returns the requested data type, which is one of SEGMENT_AND_CLASSIFY_EVENTS, SEGMENT_EVENTS_ONLY, or CLASSIFY_EVENTS_ONLY.
public inthashCode()
public voidwriteToParcel(Parcel parcel, int flags)
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.