Added in API level 34

TvRecordingInfo


class TvRecordingInfo : Parcelable
kotlin.Any
   ↳ android.media.tv.TvRecordingInfo

This class is used to describe the meta information for a TV recording. It can be retrieved by the android.media.tv.interactive.TvInteractiveAppService by using getTvRecordingInfo or getTvRecordingInfoList. It can then be updated to the TV app using setTvRecordingInfo.

Summary

Constants
static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

Inherited constants
Public constructors
TvRecordingInfo(recordingId: String, startPadding: Long, endPadding: Long, repeatDays: Int, name: String, description: String, scheduledStartTime: Long, scheduledDuration: Long, channelUri: Uri, programUri: Uri?, contentRatings: MutableList<TvContentRating!>, recordingUri: Uri?, recordingStartTime: Long, recordingDuration: Long)

Public methods
Int

Uri

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

MutableList<TvContentRating!>

Returns a list of content ratings for the program(s) in this recording.

String

Returns the description of the scheduled recording.

Long

Returns the ending padding duration of this recording in milliseconds since the epoch.

String

Returns the name of the scheduled recording.

Uri?

Returns the uri of the scheduled program or series.

Long

The real duration of the recording, including any padding, in milliseconds since the epoch.

String

Returns the ID of this recording.

Long

The real start time of the recording, including any padding, in milliseconds since the epoch.

Uri?

The uri of the recording in local storage.

Int

Returns the days of the week for which this recording should be repeated for.

Long

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

Long

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

Long

Returns the start padding duration of this recording in milliseconds since the epoch.

Unit
setDescription(description: String)

Sets the description of the scheduled recording.

Unit
setName(name: String)

Sets the name of the scheduled recording.

Unit
writeToParcel(dest: Parcel, flags: Int)

Used to package this object into a Parcel.

Properties
static Parcelable.Creator<TvRecordingInfo!>

Constants

FRIDAY

Added in API level 34
static val FRIDAY: Int
Value: 32

MONDAY

Added in API level 34
static val MONDAY: Int
Value: 2

RECORDING_ALL

Added in API level 34
static val RECORDING_ALL: Int
Value: 3

RECORDING_IN_PROGRESS

Added in API level 34
static val RECORDING_IN_PROGRESS: Int
Value: 2

RECORDING_SCHEDULED

Added in API level 34
static val RECORDING_SCHEDULED: Int
Value: 1

SATURDAY

Added in API level 34
static val SATURDAY: Int
Value: 64

SUNDAY

Added in API level 34
static val SUNDAY: Int
Value: 1

THURSDAY

Added in API level 34
static val THURSDAY: Int
Value: 16

TUESDAY

Added in API level 34
static val TUESDAY: Int
Value: 4

WEDNESDAY

Added in API level 34
static val WEDNESDAY: Int
Value: 8

Public constructors

TvRecordingInfo

Added in API level 34
TvRecordingInfo(
    recordingId: String,
    startPadding: Long,
    endPadding: Long,
    repeatDays: Int,
    name: String,
    description: String,
    scheduledStartTime: Long,
    scheduledDuration: Long,
    channelUri: Uri,
    programUri: Uri?,
    contentRatings: MutableList<TvContentRating!>,
    recordingUri: Uri?,
    recordingStartTime: Long,
    recordingDuration: Long)
Parameters
recordingId String: This value cannot be null.
name String: This value cannot be null.
description String: This value cannot be null.
channelUri Uri: This value cannot be null.
programUri Uri?: This value may be null.
contentRatings MutableList<TvContentRating!>: This value cannot be null.
recordingUri Uri?: This value may be null.

Public methods

describeContents

Added in API level 34
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getChannelUri

Added in API level 34
fun getChannelUri(): Uri

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

Return
Uri This value cannot be null.

getContentRatings

Added in API level 34
fun getContentRatings(): MutableList<TvContentRating!>

Returns a list of content ratings for the program(s) in this recording.

Returns an empty list if no content rating information is available.

Return
MutableList<TvContentRating!> This value cannot be null.

getDescription

Added in API level 34
fun getDescription(): String

Returns the description of the scheduled recording.

This is set with TvRecordingInfo#setDescription(String) and sent to tv app with android.media.tv.interactive.TvInteractiveAppService.Session#setTvRecordingInfo(String, TvRecordingInfo)

Return
String This value cannot be null.

getEndPaddingMillis

Added in API level 34
fun getEndPaddingMillis(): Long

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.

getName

Added in API level 34
fun getName(): String

Returns the name of the scheduled recording.

This is set with TvRecordingInfo#setName(String) and sent to tv app with android.media.tv.interactive.TvInteractiveAppService.Session#setTvRecordingInfo(String, TvRecordingInfo)

Return
String This value cannot be null.

getProgramUri

Added in API level 34
fun getProgramUri(): Uri?

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.

getRecordingDurationMillis

Added in API level 34
fun getRecordingDurationMillis(): Long

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.

Return
Long Value is -1 or greater

getRecordingId

Added in API level 34
fun getRecordingId(): String

Returns the ID of this recording. This ID is created and maintained by the TV app.

Return
String This value cannot be null.

getRecordingStartTimeMillis

Added in API level 34
fun getRecordingStartTimeMillis(): Long

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.

Return
Long Value is -1 or greater

getRecordingUri

Added in API level 34
fun getRecordingUri(): Uri?

The uri of the recording in local storage.

Could be null in the event that the recording has not been completed.

getRepeatDays

Added in API level 34
fun getRepeatDays(): Int

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.

Return
Int Value is either 0 or a combination of android.media.tv.TvRecordingInfo#SUNDAY, android.media.tv.TvRecordingInfo#MONDAY, android.media.tv.TvRecordingInfo#TUESDAY, android.media.tv.TvRecordingInfo#WEDNESDAY, android.media.tv.TvRecordingInfo#THURSDAY, android.media.tv.TvRecordingInfo#FRIDAY, and android.media.tv.TvRecordingInfo#SATURDAY

getScheduledDurationMillis

Added in API level 34
fun getScheduledDurationMillis(): Long

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

Return
Long Value is 0 or greater

getScheduledStartTimeMillis

Added in API level 34
fun getScheduledStartTimeMillis(): Long

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

Return
Long Value is 0 or greater

getStartPaddingMillis

Added in API level 34
fun getStartPaddingMillis(): Long

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.

setDescription

Added in API level 34
fun setDescription(description: String): Unit

Sets the description of the scheduled recording.

Updates to the TvRecordingInfo can be sent to the TV app with android.media.tv.interactive.TvInteractiveAppService.Session#setTvRecordingInfo(String, TvRecordingInfo)

Parameters
description String: This value cannot be null.

setName

Added in API level 34
fun setName(name: String): Unit

Sets the name of the scheduled recording.

Updates to the TvRecordingInfo can be sent to the TV app with android.media.tv.interactive.TvInteractiveAppService.Session#setTvRecordingInfo(String, TvRecordingInfo)

Parameters
name String: This value cannot be null.

writeToParcel

Added in API level 34
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

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.

Properties

CREATOR

Added in API level 34
static val CREATOR: Parcelable.Creator<TvRecordingInfo!>