SleepSegmentRequest

public class SleepSegmentRequest extends Object
implements Parcelable

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 Requests SleepClassifyEvent only.
int SEGMENT_AND_CLASSIFY_EVENTS Requests both the SleepSegmentEvent and the SleepClassifyEvent.
int SEGMENT_EVENTS_ONLY Requests SleepSegmentEvent only.

Inherited Constant Summary

Field Summary

public static final Creator<SleepSegmentRequest> CREATOR

Public Constructor Summary

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

Public Method Summary

boolean
static SleepSegmentRequest
getDefaultSleepSegmentRequest()
Creates a default request that registers for both SleepSegmentEvent and SleepClassifyEvent data.
int
int
void
writeToParcel(Parcel parcel, int flags)

Inherited Method Summary

Constants

public static final int CLASSIFY_EVENTS_ONLY

Requests SleepClassifyEvent only.

Constant Value: 2

public static final int SEGMENT_AND_CLASSIFY_EVENTS

Requests both the SleepSegmentEvent and the SleepClassifyEvent.

Constant Value: 0

public static final int SEGMENT_EVENTS_ONLY

Requests SleepSegmentEvent only.

Constant Value: 1

Fields

public static final Creator<SleepSegmentRequest> CREATOR

Public Constructors

public SleepSegmentRequest (int requestedDataType)

Constructs a SleepSegmentRequest 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 boolean equals (Object o)

public static SleepSegmentRequest getDefaultSleepSegmentRequest ()

Creates a default request that registers for both SleepSegmentEvent and SleepClassifyEvent data.

public int getRequestedDataType ()

Returns the requested data type, which is one of SEGMENT_AND_CLASSIFY_EVENTS, SEGMENT_EVENTS_ONLY, or CLASSIFY_EVENTS_ONLY.

public int hashCode ()

public void writeToParcel (Parcel parcel, int flags)