Support not tuned PLP info query.
Bug: 209762260 Fix: 209762260 Test: atest android.media.tv.tuner.cts Change-Id: I1eac5936ba180b34e2cf061d0e2557503ce0ca96
This commit is contained in:
@@ -7688,6 +7688,7 @@ package android.media.tv.tuner.frontend {
|
||||
|
||||
public class FrontendStatus {
|
||||
method public int getAgc();
|
||||
method @NonNull public android.media.tv.tuner.frontend.Atsc3PlpInfo[] getAllAtsc3PlpInfo();
|
||||
method @NonNull public android.media.tv.tuner.frontend.FrontendStatus.Atsc3PlpTuningInfo[] getAtsc3PlpTuningInfo();
|
||||
method public int getBandwidth();
|
||||
method public int getBer();
|
||||
@@ -7730,6 +7731,7 @@ package android.media.tv.tuner.frontend {
|
||||
method public boolean isRfLocked();
|
||||
method public boolean isShortFramesEnabled();
|
||||
field public static final int FRONTEND_STATUS_TYPE_AGC = 14; // 0xe
|
||||
field public static final int FRONTEND_STATUS_TYPE_ATSC3_ALL_PLP_INFO = 41; // 0x29
|
||||
field public static final int FRONTEND_STATUS_TYPE_ATSC3_PLP_INFO = 21; // 0x15
|
||||
field public static final int FRONTEND_STATUS_TYPE_BANDWIDTH = 25; // 0x19
|
||||
field public static final int FRONTEND_STATUS_TYPE_BER = 2; // 0x2
|
||||
|
||||
@@ -54,7 +54,7 @@ public class FrontendStatus {
|
||||
FRONTEND_STATUS_TYPE_IS_MISO_ENABLED, FRONTEND_STATUS_TYPE_IS_LINEAR,
|
||||
FRONTEND_STATUS_TYPE_IS_SHORT_FRAMES_ENABLED, FRONTEND_STATUS_TYPE_ISDBT_MODE,
|
||||
FRONTEND_STATUS_TYPE_ISDBT_PARTIAL_RECEPTION_FLAG, FRONTEND_STATUS_TYPE_STREAM_IDS,
|
||||
FRONTEND_STATUS_TYPE_DVBT_CELL_IDS})
|
||||
FRONTEND_STATUS_TYPE_DVBT_CELL_IDS, FRONTEND_STATUS_TYPE_ATSC3_ALL_PLP_INFO})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FrontendStatusType {}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class FrontendStatus {
|
||||
public static final int FRONTEND_STATUS_TYPE_RF_LOCK =
|
||||
android.hardware.tv.tuner.FrontendStatusType.RF_LOCK;
|
||||
/**
|
||||
* PLP information in a frequency band for ATSC-3.0 frontend.
|
||||
* Current tuned PLP information in a frequency band for ATSC-3.0 frontend.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_ATSC3_PLP_INFO =
|
||||
android.hardware.tv.tuner.FrontendStatusType.ATSC3_PLP_INFO;
|
||||
@@ -267,6 +267,13 @@ public class FrontendStatus {
|
||||
public static final int FRONTEND_STATUS_TYPE_DVBT_CELL_IDS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.DVBT_CELL_IDS;
|
||||
|
||||
/**
|
||||
* All PLP information in a frequency band for ATSC-3.0 frontend, which includes both tuned and
|
||||
* not tuned PLPs for currently watching service.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_ATSC3_ALL_PLP_INFO =
|
||||
android.hardware.tv.tuner.FrontendStatusType.ATSC3_ALL_PLP_INFO;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(value = {
|
||||
AtscFrontendSettings.MODULATION_UNDEFINED,
|
||||
@@ -508,6 +515,7 @@ public class FrontendStatus {
|
||||
private Integer mIsdbtPartialReceptionFlag;
|
||||
private int[] mStreamIds;
|
||||
private int[] mDvbtCellIds;
|
||||
private Atsc3PlpInfo[] mAllPlpInfo;
|
||||
|
||||
// Constructed and fields set by JNI code.
|
||||
private FrontendStatus() {
|
||||
@@ -1077,6 +1085,25 @@ public class FrontendStatus {
|
||||
return mDvbtCellIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of all PLPs information of ATSC3 frontend, which includes both tuned and not
|
||||
* tuned PLPs for currently watching service.
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version or if HAL
|
||||
* doesn't return all PLPs information will throw IllegalStateException. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@SuppressLint("ArrayReturn")
|
||||
@NonNull
|
||||
public Atsc3PlpInfo[] getAllAtsc3PlpInfo() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_2_0, "Atsc3PlpInfo all status");
|
||||
if (mAllPlpInfo == null) {
|
||||
throw new IllegalStateException("Atsc3PlpInfo all status is empty");
|
||||
}
|
||||
return mAllPlpInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information of each tuning Physical Layer Pipes.
|
||||
*/
|
||||
|
||||
@@ -2607,6 +2607,24 @@ jobject JTuner::getFrontendStatus(jintArray types) {
|
||||
jintArray valObj = env->NewIntArray(v.size());
|
||||
env->SetIntArrayRegion(valObj, 0, v.size(), reinterpret_cast<jint *>(&ids[0]));
|
||||
|
||||
env->SetObjectField(statusObj, field, valObj);
|
||||
break;
|
||||
}
|
||||
case FrontendStatus::Tag::allPlpInfo: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mAllPlpInfo",
|
||||
"[Landroid/media/tv/tuner/frontend/Atsc3PlpInfo;");
|
||||
jclass plpClazz = env->FindClass("android/media/tv/tuner/frontend/Atsc3PlpInfo");
|
||||
jmethodID initPlp = env->GetMethodID(plpClazz, "<init>", "(IZ)V");
|
||||
|
||||
vector<FrontendScanAtsc3PlpInfo> plpInfos =
|
||||
s.get<FrontendStatus::Tag::allPlpInfo>();
|
||||
jobjectArray valObj = env->NewObjectArray(plpInfos.size(), plpClazz, nullptr);
|
||||
for (int i = 0; i < plpInfos.size(); i++) {
|
||||
jobject plpObj = env->NewObject(plpClazz, initPlp, plpInfos[i].plpId,
|
||||
plpInfos[i].bLlsFlag);
|
||||
env->SetObjectArrayElement(valObj, i, plpObj);
|
||||
}
|
||||
|
||||
env->SetObjectField(statusObj, field, valObj);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user