Merge "Support DVB-T Cell Ids."
This commit is contained in:
committed by
Android (Google) Code Review
commit
2534fb70db
@@ -7607,6 +7607,7 @@ package android.media.tv.tuner.frontend {
|
||||
method public int getBer();
|
||||
method @NonNull public int[] getBers();
|
||||
method @NonNull public int[] getCodeRates();
|
||||
method @NonNull public int[] getDvbtCellIds();
|
||||
method @NonNull public int[] getExtendedModulations();
|
||||
method @Deprecated public int getFreqOffset();
|
||||
method public long getFreqOffsetLong();
|
||||
@@ -7649,6 +7650,7 @@ package android.media.tv.tuner.frontend {
|
||||
field public static final int FRONTEND_STATUS_TYPE_BERS = 23; // 0x17
|
||||
field public static final int FRONTEND_STATUS_TYPE_CODERATES = 24; // 0x18
|
||||
field public static final int FRONTEND_STATUS_TYPE_DEMOD_LOCK = 0; // 0x0
|
||||
field public static final int FRONTEND_STATUS_TYPE_DVBT_CELL_IDS = 40; // 0x28
|
||||
field public static final int FRONTEND_STATUS_TYPE_EWBS = 13; // 0xd
|
||||
field public static final int FRONTEND_STATUS_TYPE_FEC = 8; // 0x8
|
||||
field public static final int FRONTEND_STATUS_TYPE_FREQ_OFFSET = 18; // 0x12
|
||||
@@ -7883,6 +7885,7 @@ package android.media.tv.tuner.frontend {
|
||||
method public void onAtsc3PlpInfosReported(@NonNull android.media.tv.tuner.frontend.Atsc3PlpInfo[]);
|
||||
method public default void onDvbcAnnexReported(int);
|
||||
method public void onDvbsStandardReported(int);
|
||||
method public default void onDvbtCellIdsReported(@NonNull int[]);
|
||||
method public void onDvbtStandardReported(int);
|
||||
method public default void onFrequenciesLongReported(@NonNull long[]);
|
||||
method @Deprecated public void onFrequenciesReported(@NonNull int[]);
|
||||
|
||||
@@ -1577,6 +1577,20 @@ public class Tuner implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
private void onDvbtCellIdsReported(int[] dvbtCellIds) {
|
||||
synchronized (mScanCallbackLock) {
|
||||
if (mScanCallbackExecutor != null && mScanCallback != null) {
|
||||
mScanCallbackExecutor.execute(() -> {
|
||||
synchronized (mScanCallbackLock) {
|
||||
if (mScanCallback != null) {
|
||||
mScanCallback.onDvbtCellIdsReported(dvbtCellIds);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a filter object based on the given types and buffer size.
|
||||
*
|
||||
|
||||
@@ -53,7 +53,8 @@ public class FrontendStatus {
|
||||
FRONTEND_STATUS_TYPE_MODULATIONS_EXT, FRONTEND_STATUS_TYPE_ROLL_OFF,
|
||||
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_ISDBT_PARTIAL_RECEPTION_FLAG, FRONTEND_STATUS_TYPE_STREAM_IDS,
|
||||
FRONTEND_STATUS_TYPE_DVBT_CELL_IDS})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FrontendStatusType {}
|
||||
|
||||
@@ -260,6 +261,12 @@ public class FrontendStatus {
|
||||
public static final int FRONTEND_STATUS_TYPE_STREAM_IDS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.STREAM_ID_LIST;
|
||||
|
||||
/**
|
||||
* DVB-T Cell IDs.
|
||||
*/
|
||||
public static final int FRONTEND_STATUS_TYPE_DVBT_CELL_IDS =
|
||||
android.hardware.tv.tuner.FrontendStatusType.DVBT_CELL_IDS;
|
||||
|
||||
/** @hide */
|
||||
@IntDef(value = {
|
||||
AtscFrontendSettings.MODULATION_UNDEFINED,
|
||||
@@ -500,6 +507,7 @@ public class FrontendStatus {
|
||||
private Integer mIsdbtMode;
|
||||
private Integer mIsdbtPartialReceptionFlag;
|
||||
private int[] mStreamIds;
|
||||
private int[] mDvbtCellIds;
|
||||
|
||||
// Constructed and fields set by JNI code.
|
||||
private FrontendStatus() {
|
||||
@@ -1051,6 +1059,24 @@ public class FrontendStatus {
|
||||
return mStreamIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets DVB-T cell ids.
|
||||
*
|
||||
* <p>This query is only supported by Tuner HAL 2.0 or higher. Unsupported version or if HAL
|
||||
* doesn't return cell ids will throw IllegalStateException. Use
|
||||
* {@link TunerVersionChecker#getTunerVersion()} to check the version.
|
||||
*/
|
||||
@SuppressLint("ArrayReturn")
|
||||
@NonNull
|
||||
public int[] getDvbtCellIds() {
|
||||
TunerVersionChecker.checkHigherOrEqualVersionTo(
|
||||
TunerVersionChecker.TUNER_VERSION_2_0, "dvbt cell ids status");
|
||||
if (mDvbtCellIds == null) {
|
||||
throw new IllegalStateException("dvbt cell ids are empty");
|
||||
}
|
||||
return mDvbtCellIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information of each tuning Physical Layer Pipes.
|
||||
*/
|
||||
|
||||
@@ -94,4 +94,7 @@ public interface ScanCallback {
|
||||
|
||||
/** DVBC Frontend Annex reported. */
|
||||
default void onDvbcAnnexReported(@DvbcFrontendSettings.Annex int dvbcAnnex) {}
|
||||
|
||||
/** DVBT Frontend Cell Ids reported. */
|
||||
default void onDvbtCellIdsReported(@NonNull int[] dvbtCellIds) {}
|
||||
}
|
||||
|
||||
@@ -1191,6 +1191,14 @@ void FrontendClientCallbackImpl::executeOnScanMessage(
|
||||
dvbcAnnex);
|
||||
break;
|
||||
}
|
||||
case FrontendScanMessageType::DVBT_CELL_IDS: {
|
||||
std::vector<int32_t> jintV = message.get<FrontendScanMessage::dvbtCellIds>();
|
||||
jintArray cellIds = env->NewIntArray(jintV.size());
|
||||
env->SetIntArrayRegion(cellIds, 0, jintV.size(), reinterpret_cast<jint *>(&jintV[0]));
|
||||
env->CallVoidMethod(frontend, env->GetMethodID(clazz, "onDvbtCellIdsReported", "([I)V"),
|
||||
cellIds);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2516,6 +2524,16 @@ 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::dvbtCellIds: {
|
||||
jfieldID field = env->GetFieldID(clazz, "mDvbtCellIds", "[I");
|
||||
std::vector<int32_t> ids = s.get<FrontendStatus::Tag::dvbtCellIds>();
|
||||
|
||||
jintArray valObj = env->NewIntArray(v.size());
|
||||
env->SetIntArrayRegion(valObj, 0, v.size(), reinterpret_cast<jint *>(&ids[0]));
|
||||
|
||||
env->SetObjectField(statusObj, field, valObj);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user