TvRecordingInfo
public
final
class
TvRecordingInfo
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.media.tv.TvRecordingInfo |
This class is used to describe the meta information for a TV recording. It can be retrieved by
the TvInteractiveAppService
by using getTvRecordingInfo
or getTvRecordingInfoList. It can then be updated to the TV app using setTvRecordingInfo.
Summary
Constants | |
---|---|
int |
FRIDAY
|
int |
MONDAY
|
int |
RECORDING_ALL
|
int |
RECORDING_IN_PROGRESS
|
int |
RECORDING_SCHEDULED
|
int |
SATURDAY
|
int |
SUNDAY
|
int |
THURSDAY
|
int |
TUESDAY
|
int |
WEDNESDAY
|
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<TvRecordingInfo> |
CREATOR
|
Public constructors | |
---|---|
TvRecordingInfo(String recordingId, long startPadding, long endPadding, int repeatDays, String name, String description, long scheduledStartTime, long scheduledDuration, Uri channelUri, Uri programUri, List<TvContentRating> contentRatings, Uri recordingUri, long recordingStartTime, long recordingDuration)
|
Public methods | |
---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
Uri
|
getChannelUri()
Returns the uri of the broadcast channel where the recording will take place. |
List<TvContentRating>
|
getContentRatings()
Returns a list of content ratings for the program(s) in this recording. |
String
|
getDescription()
Returns the description of the scheduled recording. |
long
|
getEndPaddingMillis()
Returns the ending padding duration of this recording in milliseconds since the epoch. |
String
|
getName()
Returns the name of the scheduled recording. |
Uri
|
getProgramUri()
Returns the uri of the scheduled program or series. |
long
|
getRecordingDurationMillis()
The real duration of the recording, including any padding, in milliseconds since the epoch. |
String
|
getRecordingId()
Returns the ID of this recording. |
long
|
getRecordingStartTimeMillis()
The real start time of the recording, including any padding, in milliseconds since the epoch. |
Uri
|
getRecordingUri()
The uri of the recording in local storage. |
int
|
getRepeatDays()
Returns the days of the week for which this recording should be repeated for. |
long
|
getScheduledDurationMillis()
Returns the scheduled duration of the recording in milliseconds since the epoch. |
long
|
getScheduledStartTimeMillis()
Returns the scheduled start time of the recording in milliseconds since the epoch. |
long
|
getStartPaddingMillis()
Returns the start padding duration of this recording in milliseconds since the epoch. |
void
|
setDescription(String description)
Sets the description of the scheduled recording. |
void
|
setName(String name)
Sets the name of the scheduled recording. |
void
|
writeToParcel(Parcel dest, int flags)
Used to package this object into a |
Inherited methods | |
---|---|
Constants
RECORDING_ALL
public static final int RECORDING_ALL
Constant Value: 3 (0x00000003)
RECORDING_IN_PROGRESS
public static final int RECORDING_IN_PROGRESS
Constant Value: 2 (0x00000002)
RECORDING_SCHEDULED
public static final int RECORDING_SCHEDULED
Constant Value: 1 (0x00000001)
Fields
Public constructors
TvRecordingInfo
public TvRecordingInfo (String recordingId, long startPadding, long endPadding, int repeatDays, String name, String description, long scheduledStartTime, long scheduledDuration, Uri channelUri, Uri programUri, List<TvContentRating> contentRatings, Uri recordingUri, long recordingStartTime, long recordingDuration)
Parameters | |
---|---|
recordingId |
String : This value cannot be null . |
startPadding |
long |
endPadding |
long |
repeatDays |
int |
name |
String : This value cannot be null . |
description |
String : This value cannot be null . |
scheduledStartTime |
long |
scheduledDuration |
long |
channelUri |
Uri : This value cannot be null . |
programUri |
Uri : This value may be null . |
contentRatings |
List : This value cannot be null . |
recordingUri |
Uri : This value may be null . |
recordingStartTime |
long |
recordingDuration |
long |
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
getChannelUri
public Uri getChannelUri ()
Returns the uri of the broadcast channel where the recording will take place.
Returns | |
---|---|
Uri |
This value cannot be null . |
getContentRatings
public List<TvContentRating> getContentRatings ()
Returns a list of content ratings for the program(s) in this recording.
Returns an empty list if no content rating information is available.
Returns | |
---|---|
List<TvContentRating> |
This value cannot be null . |
getDescription
public String getDescription ()
Returns the description of the scheduled recording.
This is set with TvRecordingInfo#setDescription(String)
and sent to tv app with
TvInteractiveAppService.Session.setTvRecordingInfo(String, TvRecordingInfo)
Returns | |
---|---|
String |
This value cannot be null . |
getEndPaddingMillis
public long getEndPaddingMillis ()
Returns the ending padding duration of this recording in milliseconds since the epoch.
A positive value should cause the recording to end later than the specified time. This should cause the actual duration of the recording to increase. A negative value should cause the recording to end earlier than the specified time. This should cause the actual duration of the recording to decrease.
Returns | |
---|---|
long |
getName
public String getName ()
Returns the name of the scheduled recording.
This is set with TvRecordingInfo#setName(String)
and sent to tv app with
TvInteractiveAppService.Session.setTvRecordingInfo(String, TvRecordingInfo)
Returns | |
---|---|
String |
This value cannot be null . |
getProgramUri
public Uri getProgramUri ()
Returns the uri of the scheduled program or series.
For recordings scheduled using scheduleRecording, this value may be null. A non-null programUri implies the started recording should be of that specific program, whereas a null programUri does not impose such a requirement and the recording can span across multiple TV programs.
Returns | |
---|---|
Uri |
getRecordingDurationMillis
public long getRecordingDurationMillis ()
The real duration of the recording, including any padding, in milliseconds since the epoch.
This may not be the same as the value of getScheduledDurationMillis()
due to a
recording starting late, or due to start/end padding.
Returns -1 for recordings that have not yet started.
Returns | |
---|---|
long |
Value is -1 or greater |
getRecordingId
public String getRecordingId ()
Returns the ID of this recording. This ID is created and maintained by the TV app.
Returns | |
---|---|
String |
This value cannot be null . |
getRecordingStartTimeMillis
public long getRecordingStartTimeMillis ()
The real start time of the recording, including any padding, in milliseconds since the epoch.
This may not be the same as the value of getScheduledStartTimeMillis()
due to a
recording starting late, or due to start/end padding.
Returns -1 for recordings that have not yet started.
Returns | |
---|---|
long |
Value is -1 or greater |
getRecordingUri
public Uri getRecordingUri ()
The uri of the recording in local storage.
Could be null in the event that the recording has not been completed.
Returns | |
---|---|
Uri |
getRepeatDays
public int getRepeatDays ()
Returns the days of the week for which this recording should be repeated for.
This information is represented in the form of a bitfield, with each bit representing the day which the recording should be repeated.
The bitfield corresponds to each day of the week with the following format:
SUNDAY
- 0x01 (00000001)MONDAY
- 0x02 (00000010)TUESDAY
- 0x04 (00000100)WEDNESDAY
- 0x08 (00001000)THURSDAY
- 0x10 (00010000)FRIDAY
- 0x20 (00100000)SATURDAY
- 0x40 (01000000)
You can specify multiple days to repeat the recording by performing a bitwise 'OR' on the bitfield. For example, for a recording to repeat on Sunday and Mondays, this function should return 0x03 (00000011).
A value of 0x00 indicates that the recording will not be repeated.
This format comes from the Open IPTV Forum Release 2 Specification. It is described in Volume 5, section 7.10.1.1.
Returns | |
---|---|
int |
Value is either 0 or a combination of SUNDAY , MONDAY , TUESDAY , WEDNESDAY , THURSDAY , FRIDAY , and SATURDAY |
getScheduledDurationMillis
public long getScheduledDurationMillis ()
Returns the scheduled duration of the recording in milliseconds since the epoch.
Returns | |
---|---|
long |
Value is 0 or greater |
getScheduledStartTimeMillis
public long getScheduledStartTimeMillis ()
Returns the scheduled start time of the recording in milliseconds since the epoch.
Returns | |
---|---|
long |
Value is 0 or greater |
getStartPaddingMillis
public long getStartPaddingMillis ()
Returns the start padding duration of this recording in milliseconds since the epoch.
A positive value should cause the recording to start earlier than the specified time. This should cause the actual duration of the recording to increase. A negative value should cause the recording to start later than the specified time. This should cause the actual duration of the recording to decrease.
Returns | |
---|---|
long |
setDescription
public void setDescription (String description)
Sets the description of the scheduled recording.
Updates to the TvRecordingInfo
can be sent to the TV app with
TvInteractiveAppService.Session.setTvRecordingInfo(String, TvRecordingInfo)
Parameters | |
---|---|
description |
String : This value cannot be null . |
setName
public void setName (String name)
Sets the name of the scheduled recording.
Updates to the TvRecordingInfo
can be sent to the TV app with
TvInteractiveAppService.Session.setTvRecordingInfo(String, TvRecordingInfo)
Parameters | |
---|---|
name |
String : This value cannot be null . |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Used to package this object into a Parcel
.
Parameters | |
---|---|
dest |
Parcel : The Parcel to be written.
This value cannot be null . |
flags |
int : The flags used for parceling. |