Merge "Make DvrSettings @SystemApi"
This commit is contained in:
committed by
Android (Google) Code Review
commit
fd6439e3cd
@@ -4721,6 +4721,37 @@ package android.media.tv.tuner {
|
||||
|
||||
}
|
||||
|
||||
package android.media.tv.tuner.dvr {
|
||||
|
||||
public class DvrSettings {
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER) public static android.media.tv.tuner.dvr.DvrSettings.Builder builder(@NonNull android.content.Context);
|
||||
method public int getDataFormat();
|
||||
method public long getHighThreshold();
|
||||
method public long getLowThreshold();
|
||||
method public long getPacketSize();
|
||||
method public int getStatusMask();
|
||||
method public int getType();
|
||||
field public static final int DATA_FORMAT_ES = 2; // 0x2
|
||||
field public static final int DATA_FORMAT_PES = 1; // 0x1
|
||||
field public static final int DATA_FORMAT_SHV_TLV = 3; // 0x3
|
||||
field public static final int DATA_FORMAT_TS = 0; // 0x0
|
||||
field public static final int TYPE_PLAYBACK = 1; // 0x1
|
||||
field public static final int TYPE_RECORD = 0; // 0x0
|
||||
}
|
||||
|
||||
public static final class DvrSettings.Builder {
|
||||
ctor public DvrSettings.Builder();
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings build();
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setDataFormat(int);
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setHighThreshold(long);
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setLowThreshold(long);
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setPacketSize(long);
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setStatusMask(int);
|
||||
method @NonNull public android.media.tv.tuner.dvr.DvrSettings.Builder setType(int);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.media.tv.tuner.filter {
|
||||
|
||||
public class Filter implements java.lang.AutoCloseable {
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.annotation.BytesLong;
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SystemApi;
|
||||
import android.content.Context;
|
||||
import android.hardware.tv.tuner.V1_0.Constants;
|
||||
import android.media.tv.tuner.TunerUtils;
|
||||
@@ -33,6 +34,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public class DvrSettings {
|
||||
|
||||
/** @hide */
|
||||
@@ -74,19 +76,22 @@ public class DvrSettings {
|
||||
public static final int TYPE_PLAYBACK = Constants.DvrType.PLAYBACK;
|
||||
|
||||
|
||||
|
||||
@FilterStatus
|
||||
private final int mStatusMask;
|
||||
@BytesLong
|
||||
private final long mLowThreshold;
|
||||
@BytesLong
|
||||
private final long mHighThreshold;
|
||||
@BytesLong
|
||||
private final long mPacketSize;
|
||||
|
||||
@DataFormat
|
||||
private final int mDataFormat;
|
||||
@Type
|
||||
private final int mType;
|
||||
|
||||
private DvrSettings(int statusMask, long lowThreshold, long highThreshold, long packetSize,
|
||||
@DataFormat int dataFormat, @Type int type) {
|
||||
private DvrSettings(@FilterStatus int statusMask, @BytesLong long lowThreshold,
|
||||
@BytesLong long highThreshold, @BytesLong long packetSize, @DataFormat int dataFormat,
|
||||
@Type int type) {
|
||||
mStatusMask = statusMask;
|
||||
mLowThreshold = lowThreshold;
|
||||
mHighThreshold = highThreshold;
|
||||
@@ -95,6 +100,54 @@ public class DvrSettings {
|
||||
mType = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets status mask.
|
||||
*/
|
||||
@FilterStatus
|
||||
public int getStatusMask() {
|
||||
return mStatusMask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets low threshold in bytes.
|
||||
*/
|
||||
@BytesLong
|
||||
public long getLowThreshold() {
|
||||
return mLowThreshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets high threshold in bytes.
|
||||
*/
|
||||
@BytesLong
|
||||
public long getHighThreshold() {
|
||||
return mHighThreshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets packet size in bytes.
|
||||
*/
|
||||
@BytesLong
|
||||
public long getPacketSize() {
|
||||
return mPacketSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets data format.
|
||||
*/
|
||||
@DataFormat
|
||||
public int getDataFormat() {
|
||||
return mDataFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets settings type.
|
||||
*/
|
||||
@Type
|
||||
public int getType() {
|
||||
return mType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builder for {@link DvrSettings}.
|
||||
*
|
||||
@@ -102,7 +155,7 @@ public class DvrSettings {
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.ACCESS_TV_TUNER)
|
||||
@NonNull
|
||||
public static Builder builder(Context context) {
|
||||
public static Builder builder(@NonNull Context context) {
|
||||
TunerUtils.checkTunerPermission(context);
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user