SleepSegmentRequest

public classSleepSegmentRequestextendsObject
implementsParcelable

A request object that specifies what data to receive from the Sleep API. Defaults to SEGMENT_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

Field Summary

public static finalCreator<SleepSegmentRequest> CREATOR

Public Constructor Summary

SleepSegmentRequest(int requestedDataType)
Constructs aSleepSegmentRequest indicating what type of data is being requested.

Public Method Summary

boolean
staticSleepSegmentRequest
getDefaultSleepSegmentRequest()
Creates a default request that registers for both SleepSegmentEventandSleepClassifyEventdata.
int
int
void
writeToParcel(Parcelparcel, int flags)

Inherited Method Summary

Constants

public static final int CLASSIFY_EVENTS_ONLY

RequestsSleepClassifyEventonly.

Constant Value:2

public static final int SEGMENT_AND_CLASSIFY_EVENTS

Requests both theSleepSegmentEventand the SleepClassifyEvent.

Constant Value:0

public static final int SEGMENT_EVENTS_ONLY

RequestsSleepSegmentEventonly.

Constant Value:1

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(Objecto)

public staticSleepSegmentRequest getDefaultSleepSegmentRequest()

Creates a default request that registers for bothSleepSegmentEventand SleepClassifyEventdata.

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(Parcelparcel, int flags)