Loading api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -28356,6 +28356,7 @@ package android.media.tv { method public int getAudioChannelCount(); method public int getAudioChannelCount(); method public int getAudioSampleRate(); method public int getAudioSampleRate(); method public CharSequence getDescription(); method public CharSequence getDescription(); method @Nullable public String getEncoding(); method public android.os.Bundle getExtra(); method public android.os.Bundle getExtra(); method public String getId(); method public String getId(); method public String getLanguage(); method public String getLanguage(); Loading Loading @@ -28383,6 +28384,7 @@ package android.media.tv { method @NonNull public android.media.tv.TvTrackInfo.Builder setAudioDescription(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setAudioDescription(boolean); method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int); method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int); method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence); method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncoding(@Nullable String); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean); method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle); method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle); method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean); media/java/android/media/tv/TvTrackInfo.java +43 −6 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.media.tv; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Bundle; import android.os.Bundle; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; Loading Loading @@ -58,6 +59,8 @@ public final class TvTrackInfo implements Parcelable { private final String mId; private final String mId; private final String mLanguage; private final String mLanguage; private final CharSequence mDescription; private final CharSequence mDescription; @Nullable private final String mEncoding; private final boolean mEncrypted; private final boolean mEncrypted; private final int mAudioChannelCount; private final int mAudioChannelCount; private final int mAudioSampleRate; private final int mAudioSampleRate; Loading @@ -73,14 +76,15 @@ public final class TvTrackInfo implements Parcelable { private final Bundle mExtra; private final Bundle mExtra; private TvTrackInfo(int type, String id, String language, CharSequence description, private TvTrackInfo(int type, String id, String language, CharSequence description, boolean encrypted, int audioChannelCount, int audioSampleRate, boolean audioDescription, String encoding, boolean encrypted, int audioChannelCount, int audioSampleRate, boolean hardOfHearing, boolean spokenSubtitle, int videoWidth, int videoHeight, boolean audioDescription, boolean hardOfHearing, boolean spokenSubtitle, int videoWidth, float videoFrameRate, float videoPixelAspectRatio, byte videoActiveFormatDescription, int videoHeight, float videoFrameRate, float videoPixelAspectRatio, Bundle extra) { byte videoActiveFormatDescription, Bundle extra) { mType = type; mType = type; mId = id; mId = id; mLanguage = language; mLanguage = language; mDescription = description; mDescription = description; mEncoding = encoding; mEncrypted = encrypted; mEncrypted = encrypted; mAudioChannelCount = audioChannelCount; mAudioChannelCount = audioChannelCount; mAudioSampleRate = audioSampleRate; mAudioSampleRate = audioSampleRate; Loading @@ -100,6 +104,7 @@ public final class TvTrackInfo implements Parcelable { mId = in.readString(); mId = in.readString(); mLanguage = in.readString(); mLanguage = in.readString(); mDescription = in.readString(); mDescription = in.readString(); mEncoding = in.readString(); mEncrypted = in.readInt() != 0; mEncrypted = in.readInt() != 0; mAudioChannelCount = in.readInt(); mAudioChannelCount = in.readInt(); mAudioSampleRate = in.readInt(); mAudioSampleRate = in.readInt(); Loading Loading @@ -145,6 +150,20 @@ public final class TvTrackInfo implements Parcelable { return mDescription; return mDescription; } } /** * Returns the codec in the form of mime type. If the encoding is unknown or could not be * determined, the corresponding value will be {@code null}. * * <p>For example of broadcast, codec information may be referred to broadcast standard (e.g. * Component Descriptor of ETSI EN 300 468). In the case that track type is subtitle, mime type * could be defined in broadcast standard (e.g. "text/dvb.subtitle" or "text/dvb.teletext" in * ETSI TS 102 812 V1.3.1 section 7.6). */ @Nullable public String getEncoding() { return mEncoding; } /** /** * Returns {@code true} if the track is encrypted, {@code false} otherwise. If the encryption * Returns {@code true} if the track is encrypted, {@code false} otherwise. If the encryption * status is unknown or could not be determined, the corresponding value will be {@code false}. * status is unknown or could not be determined, the corresponding value will be {@code false}. Loading @@ -152,7 +171,6 @@ public final class TvTrackInfo implements Parcelable { * <p>For example: ISO/IEC 13818-1 defines a CA descriptor that can be used to determine the * <p>For example: ISO/IEC 13818-1 defines a CA descriptor that can be used to determine the * encryption status of some broadcast streams. * encryption status of some broadcast streams. */ */ public boolean isEncrypted() { public boolean isEncrypted() { return mEncrypted; return mEncrypted; } } Loading Loading @@ -323,6 +341,7 @@ public final class TvTrackInfo implements Parcelable { dest.writeString(mId); dest.writeString(mId); dest.writeString(mLanguage); dest.writeString(mLanguage); dest.writeString(mDescription != null ? mDescription.toString() : null); dest.writeString(mDescription != null ? mDescription.toString() : null); dest.writeString(mEncoding); dest.writeInt(mEncrypted ? 1 : 0); dest.writeInt(mEncrypted ? 1 : 0); dest.writeInt(mAudioChannelCount); dest.writeInt(mAudioChannelCount); dest.writeInt(mAudioSampleRate); dest.writeInt(mAudioSampleRate); Loading Loading @@ -352,6 +371,7 @@ public final class TvTrackInfo implements Parcelable { if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType || !TextUtils.equals(mLanguage, obj.mLanguage) || !TextUtils.equals(mLanguage, obj.mLanguage) || !TextUtils.equals(mDescription, obj.mDescription) || !TextUtils.equals(mDescription, obj.mDescription) || !TextUtils.equals(mEncoding, obj.mEncoding) || mEncrypted != obj.mEncrypted) { || mEncrypted != obj.mEncrypted) { return false; return false; } } Loading Loading @@ -413,6 +433,7 @@ public final class TvTrackInfo implements Parcelable { private final int mType; private final int mType; private String mLanguage; private String mLanguage; private CharSequence mDescription; private CharSequence mDescription; private String mEncoding; private boolean mEncrypted; private boolean mEncrypted; private int mAudioChannelCount; private int mAudioChannelCount; private int mAudioSampleRate; private int mAudioSampleRate; Loading Loading @@ -467,6 +488,22 @@ public final class TvTrackInfo implements Parcelable { return this; return this; } } /** * Sets the encoding of the track. * * <p>For example of broadcast, codec information may be referred to broadcast standard * (e.g. Component Descriptor of ETSI EN 300 468). In the case that track type is subtitle, * mime type could be defined in broadcast standard (e.g. "text/dvb.subtitle" or * "text/dvb.teletext" in ETSI TS 102 812 V1.3.1 section 7.6). * * @param encoding The encoding of the track in the form of mime type. */ @NonNull public Builder setEncoding(@Nullable String encoding) { mEncoding = encoding; return this; } /** /** * Sets the encryption status of the track. * Sets the encryption status of the track. * * Loading Loading @@ -672,7 +709,7 @@ public final class TvTrackInfo implements Parcelable { * @return The new {@link TvTrackInfo} instance * @return The new {@link TvTrackInfo} instance */ */ public TvTrackInfo build() { public TvTrackInfo build() { return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncrypted, return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncoding, mEncrypted, mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing, mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing, mSpokenSubtitle, mVideoWidth, mVideoHeight, mVideoFrameRate, mSpokenSubtitle, mVideoWidth, mVideoHeight, mVideoFrameRate, mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra); mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra); Loading Loading
api/current.txt +2 −0 Original line number Original line Diff line number Diff line Loading @@ -28356,6 +28356,7 @@ package android.media.tv { method public int getAudioChannelCount(); method public int getAudioChannelCount(); method public int getAudioSampleRate(); method public int getAudioSampleRate(); method public CharSequence getDescription(); method public CharSequence getDescription(); method @Nullable public String getEncoding(); method public android.os.Bundle getExtra(); method public android.os.Bundle getExtra(); method public String getId(); method public String getId(); method public String getLanguage(); method public String getLanguage(); Loading Loading @@ -28383,6 +28384,7 @@ package android.media.tv { method @NonNull public android.media.tv.TvTrackInfo.Builder setAudioDescription(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setAudioDescription(boolean); method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int); method public android.media.tv.TvTrackInfo.Builder setAudioSampleRate(int); method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence); method public android.media.tv.TvTrackInfo.Builder setDescription(CharSequence); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncoding(@Nullable String); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setEncrypted(boolean); method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle); method public android.media.tv.TvTrackInfo.Builder setExtra(android.os.Bundle); method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean); method @NonNull public android.media.tv.TvTrackInfo.Builder setHardOfHearing(boolean);
media/java/android/media/tv/TvTrackInfo.java +43 −6 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.media.tv; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Bundle; import android.os.Bundle; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; Loading Loading @@ -58,6 +59,8 @@ public final class TvTrackInfo implements Parcelable { private final String mId; private final String mId; private final String mLanguage; private final String mLanguage; private final CharSequence mDescription; private final CharSequence mDescription; @Nullable private final String mEncoding; private final boolean mEncrypted; private final boolean mEncrypted; private final int mAudioChannelCount; private final int mAudioChannelCount; private final int mAudioSampleRate; private final int mAudioSampleRate; Loading @@ -73,14 +76,15 @@ public final class TvTrackInfo implements Parcelable { private final Bundle mExtra; private final Bundle mExtra; private TvTrackInfo(int type, String id, String language, CharSequence description, private TvTrackInfo(int type, String id, String language, CharSequence description, boolean encrypted, int audioChannelCount, int audioSampleRate, boolean audioDescription, String encoding, boolean encrypted, int audioChannelCount, int audioSampleRate, boolean hardOfHearing, boolean spokenSubtitle, int videoWidth, int videoHeight, boolean audioDescription, boolean hardOfHearing, boolean spokenSubtitle, int videoWidth, float videoFrameRate, float videoPixelAspectRatio, byte videoActiveFormatDescription, int videoHeight, float videoFrameRate, float videoPixelAspectRatio, Bundle extra) { byte videoActiveFormatDescription, Bundle extra) { mType = type; mType = type; mId = id; mId = id; mLanguage = language; mLanguage = language; mDescription = description; mDescription = description; mEncoding = encoding; mEncrypted = encrypted; mEncrypted = encrypted; mAudioChannelCount = audioChannelCount; mAudioChannelCount = audioChannelCount; mAudioSampleRate = audioSampleRate; mAudioSampleRate = audioSampleRate; Loading @@ -100,6 +104,7 @@ public final class TvTrackInfo implements Parcelable { mId = in.readString(); mId = in.readString(); mLanguage = in.readString(); mLanguage = in.readString(); mDescription = in.readString(); mDescription = in.readString(); mEncoding = in.readString(); mEncrypted = in.readInt() != 0; mEncrypted = in.readInt() != 0; mAudioChannelCount = in.readInt(); mAudioChannelCount = in.readInt(); mAudioSampleRate = in.readInt(); mAudioSampleRate = in.readInt(); Loading Loading @@ -145,6 +150,20 @@ public final class TvTrackInfo implements Parcelable { return mDescription; return mDescription; } } /** * Returns the codec in the form of mime type. If the encoding is unknown or could not be * determined, the corresponding value will be {@code null}. * * <p>For example of broadcast, codec information may be referred to broadcast standard (e.g. * Component Descriptor of ETSI EN 300 468). In the case that track type is subtitle, mime type * could be defined in broadcast standard (e.g. "text/dvb.subtitle" or "text/dvb.teletext" in * ETSI TS 102 812 V1.3.1 section 7.6). */ @Nullable public String getEncoding() { return mEncoding; } /** /** * Returns {@code true} if the track is encrypted, {@code false} otherwise. If the encryption * Returns {@code true} if the track is encrypted, {@code false} otherwise. If the encryption * status is unknown or could not be determined, the corresponding value will be {@code false}. * status is unknown or could not be determined, the corresponding value will be {@code false}. Loading @@ -152,7 +171,6 @@ public final class TvTrackInfo implements Parcelable { * <p>For example: ISO/IEC 13818-1 defines a CA descriptor that can be used to determine the * <p>For example: ISO/IEC 13818-1 defines a CA descriptor that can be used to determine the * encryption status of some broadcast streams. * encryption status of some broadcast streams. */ */ public boolean isEncrypted() { public boolean isEncrypted() { return mEncrypted; return mEncrypted; } } Loading Loading @@ -323,6 +341,7 @@ public final class TvTrackInfo implements Parcelable { dest.writeString(mId); dest.writeString(mId); dest.writeString(mLanguage); dest.writeString(mLanguage); dest.writeString(mDescription != null ? mDescription.toString() : null); dest.writeString(mDescription != null ? mDescription.toString() : null); dest.writeString(mEncoding); dest.writeInt(mEncrypted ? 1 : 0); dest.writeInt(mEncrypted ? 1 : 0); dest.writeInt(mAudioChannelCount); dest.writeInt(mAudioChannelCount); dest.writeInt(mAudioSampleRate); dest.writeInt(mAudioSampleRate); Loading Loading @@ -352,6 +371,7 @@ public final class TvTrackInfo implements Parcelable { if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType || !TextUtils.equals(mLanguage, obj.mLanguage) || !TextUtils.equals(mLanguage, obj.mLanguage) || !TextUtils.equals(mDescription, obj.mDescription) || !TextUtils.equals(mDescription, obj.mDescription) || !TextUtils.equals(mEncoding, obj.mEncoding) || mEncrypted != obj.mEncrypted) { || mEncrypted != obj.mEncrypted) { return false; return false; } } Loading Loading @@ -413,6 +433,7 @@ public final class TvTrackInfo implements Parcelable { private final int mType; private final int mType; private String mLanguage; private String mLanguage; private CharSequence mDescription; private CharSequence mDescription; private String mEncoding; private boolean mEncrypted; private boolean mEncrypted; private int mAudioChannelCount; private int mAudioChannelCount; private int mAudioSampleRate; private int mAudioSampleRate; Loading Loading @@ -467,6 +488,22 @@ public final class TvTrackInfo implements Parcelable { return this; return this; } } /** * Sets the encoding of the track. * * <p>For example of broadcast, codec information may be referred to broadcast standard * (e.g. Component Descriptor of ETSI EN 300 468). In the case that track type is subtitle, * mime type could be defined in broadcast standard (e.g. "text/dvb.subtitle" or * "text/dvb.teletext" in ETSI TS 102 812 V1.3.1 section 7.6). * * @param encoding The encoding of the track in the form of mime type. */ @NonNull public Builder setEncoding(@Nullable String encoding) { mEncoding = encoding; return this; } /** /** * Sets the encryption status of the track. * Sets the encryption status of the track. * * Loading Loading @@ -672,7 +709,7 @@ public final class TvTrackInfo implements Parcelable { * @return The new {@link TvTrackInfo} instance * @return The new {@link TvTrackInfo} instance */ */ public TvTrackInfo build() { public TvTrackInfo build() { return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncrypted, return new TvTrackInfo(mType, mId, mLanguage, mDescription, mEncoding, mEncrypted, mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing, mAudioChannelCount, mAudioSampleRate, mAudioDescription, mHardOfHearing, mSpokenSubtitle, mVideoWidth, mVideoHeight, mVideoFrameRate, mSpokenSubtitle, mVideoWidth, mVideoHeight, mVideoFrameRate, mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra); mVideoPixelAspectRatio, mVideoActiveFormatDescription, mExtra); Loading