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 Parcel.

Inherited methods

Constants

FRIDAY

Added in API level 34
public static final int FRIDAY

Constant Value: 32 (0x00000020)

MONDAY

Added in API level 34
public static final int MONDAY

Constant Value: 2 (0x00000002)

RECORDING_ALL

Added in API level 34
public static final int RECORDING_ALL

Constant Value: 3 (0x00000003)

RECORDING_IN_PROGRESS

Added in API level 34
public static final int RECORDING_IN_PROGRESS

Constant Value: 2 (0x00000002)

RECORDING_SCHEDULED

Added in API level 34
public static final int RECORDING_SCHEDULED

Constant Value: 1 (0x00000001)

SATURDAY

Added in API level 34
public static final int SATURDAY

Constant Value: 64 (0x00000040)

SUNDAY

Added in API level 34
public static final int SUNDAY

Constant Value: 1 (0x00000001)

THURSDAY

Added in API level 34
public static final int THURSDAY

Constant Value: 16 (0x00000010)

TUESDAY

Added in API level 34
public static final int TUESDAY

Constant Value: 4 (0x00000004)

WEDNESDAY

Added in API level 34
public static final int WEDNESDAY

Constant Value: 8 (0x00000008)

Fields

CREATOR

Added in API level 34
public static final Creator<TvRecordingInfo> CREATOR

Public constructors

TvRecordingInfo

Added in API level 34
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

Added in API level 34
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

Added in API level 34
public Uri getChannelUri ()

Returns the uri of the broadcast channel where the recording will take place.

Returns
Uri This value cannot be null.

getContentRatings

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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:

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

Added in API level 34
public long getScheduledDurationMillis ()

Returns the scheduled duration of the recording in milliseconds since the epoch.

Returns
long Value is 0 or greater

getScheduledStartTimeMillis

Added in API level 34
public long getScheduledStartTimeMillis ()

Returns the scheduled start time of the recording in milliseconds since the epoch.

Returns
long Value is 0 or greater

getStartPaddingMillis

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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

Added in API level 34
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.