Merge "Fix some Tuner JNI/Client issues found with CTS" into sc-dev
This commit is contained in:
@@ -226,7 +226,6 @@ void LnbClientCallbackImpl::onEvent(const LnbEventType lnbEventType) {
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("LnbClientCallbackImpl::onEvent:"
|
ALOGE("LnbClientCallbackImpl::onEvent:"
|
||||||
"Lnb object has been freed. Ignoring callback.");
|
"Lnb object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mLnbObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,7 +244,6 @@ void LnbClientCallbackImpl::onDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessa
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("LnbClientCallbackImpl::onDiseqcMessage:"
|
ALOGE("LnbClientCallbackImpl::onDiseqcMessage:"
|
||||||
"Lnb object has been freed. Ignoring callback.");
|
"Lnb object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mLnbObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +274,6 @@ void DvrClientCallbackImpl::onRecordStatus(RecordStatus status) {
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("DvrClientCallbackImpl::onRecordStatus:"
|
ALOGE("DvrClientCallbackImpl::onRecordStatus:"
|
||||||
"Dvr object has been freed. Ignoring callback.");
|
"Dvr object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mDvrObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +289,6 @@ void DvrClientCallbackImpl::onPlaybackStatus(PlaybackStatus status) {
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("DvrClientCallbackImpl::onPlaybackStatus:"
|
ALOGE("DvrClientCallbackImpl::onPlaybackStatus:"
|
||||||
"Dvr object has been freed. Ignoring callback.");
|
"Dvr object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mDvrObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -846,7 +842,6 @@ void FilterClientCallbackImpl::onFilterEvent_1_1(const DemuxFilterEvent& filterE
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("FilterClientCallbackImpl::onFilterEvent_1_1:"
|
ALOGE("FilterClientCallbackImpl::onFilterEvent_1_1:"
|
||||||
"Filter object has been freed. Ignoring callback.");
|
"Filter object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mFilterObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,7 +866,6 @@ void FilterClientCallbackImpl::onFilterStatus(const DemuxFilterStatus status) {
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("FilterClientCallbackImpl::onFilterStatus:"
|
ALOGE("FilterClientCallbackImpl::onFilterStatus:"
|
||||||
"Filter object has been freed. Ignoring callback.");
|
"Filter object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mFilterObj);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -907,7 +901,6 @@ void FrontendClientCallbackImpl::onEvent(FrontendEventType frontendEventType) {
|
|||||||
} else {
|
} else {
|
||||||
ALOGE("FrontendClientCallbackImpl::onEvent:"
|
ALOGE("FrontendClientCallbackImpl::onEvent:"
|
||||||
"Frontend object has been freed. Ignoring callback.");
|
"Frontend object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mObject);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,7 +913,6 @@ void FrontendClientCallbackImpl::onScanMessage(
|
|||||||
if (env->IsSameObject(frontend, nullptr)) {
|
if (env->IsSameObject(frontend, nullptr)) {
|
||||||
ALOGE("FrontendClientCallbackImpl::onScanMessage:"
|
ALOGE("FrontendClientCallbackImpl::onScanMessage:"
|
||||||
"Frontend object has been freed. Ignoring callback.");
|
"Frontend object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mObject);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
@@ -1078,7 +1070,6 @@ void FrontendClientCallbackImpl::onScanMessageExt1_1(FrontendScanMessageTypeExt1
|
|||||||
if (env->IsSameObject(frontend, nullptr)) {
|
if (env->IsSameObject(frontend, nullptr)) {
|
||||||
ALOGE("FrontendClientCallbackImpl::onScanMessageExt1_1:"
|
ALOGE("FrontendClientCallbackImpl::onScanMessageExt1_1:"
|
||||||
"Frontend object has been freed. Ignoring callback.");
|
"Frontend object has been freed. Ignoring callback.");
|
||||||
env->DeleteWeakGlobalRef(mObject);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
@@ -1243,7 +1234,6 @@ jobject JTuner::openFrontendByHandle(int feHandle) {
|
|||||||
if (env->IsSameObject(tuner, nullptr)) {
|
if (env->IsSameObject(tuner, nullptr)) {
|
||||||
ALOGE("openFrontendByHandle"
|
ALOGE("openFrontendByHandle"
|
||||||
"Tuner object has been freed. Failed to open frontend.");
|
"Tuner object has been freed. Failed to open frontend.");
|
||||||
env->DeleteWeakGlobalRef(mObject);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2211,6 +2201,10 @@ jobject JTuner::getFrontendStatus(jintArray types) {
|
|||||||
intBandwidth = static_cast<jint>(bandwidth.dvbt());
|
intBandwidth = static_cast<jint>(bandwidth.dvbt());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case FrontendBandwidth::hidl_discriminator::dvbc: {
|
||||||
|
intBandwidth = static_cast<jint>(bandwidth.dvbc());
|
||||||
|
break;
|
||||||
|
}
|
||||||
case FrontendBandwidth::hidl_discriminator::isdbt: {
|
case FrontendBandwidth::hidl_discriminator::isdbt: {
|
||||||
intBandwidth = static_cast<jint>(bandwidth.isdbt());
|
intBandwidth = static_cast<jint>(bandwidth.isdbt());
|
||||||
break;
|
break;
|
||||||
@@ -2731,12 +2725,10 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett
|
|||||||
FrontendDvbsVcmMode vcmMode =
|
FrontendDvbsVcmMode vcmMode =
|
||||||
static_cast<FrontendDvbsVcmMode>(
|
static_cast<FrontendDvbsVcmMode>(
|
||||||
env->GetIntField(settings, env->GetFieldID(clazz, "mVcmMode", "I")));
|
env->GetIntField(settings, env->GetFieldID(clazz, "mVcmMode", "I")));
|
||||||
FrontendDvbsCodeRate coderate = getDvbsCodeRate(env, settings);
|
|
||||||
|
|
||||||
FrontendDvbsSettings frontendDvbsSettings {
|
FrontendDvbsSettings frontendDvbsSettings {
|
||||||
.frequency = freq,
|
.frequency = freq,
|
||||||
.modulation = modulation,
|
.modulation = modulation,
|
||||||
.coderate = coderate,
|
|
||||||
.symbolRate = symbolRate,
|
.symbolRate = symbolRate,
|
||||||
.rolloff = rolloff,
|
.rolloff = rolloff,
|
||||||
.pilot = pilot,
|
.pilot = pilot,
|
||||||
@@ -2744,6 +2736,13 @@ static FrontendSettings getDvbsFrontendSettings(JNIEnv *env, const jobject& sett
|
|||||||
.standard = standard,
|
.standard = standard,
|
||||||
.vcmMode = vcmMode,
|
.vcmMode = vcmMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jobject jcodeRate = env->GetObjectField(settings, env->GetFieldID(clazz, "mCodeRate",
|
||||||
|
"Landroid/media/tv/tuner/frontend/DvbsCodeRate;"));
|
||||||
|
if (jcodeRate != NULL) {
|
||||||
|
frontendDvbsSettings.coderate = getDvbsCodeRate(env, settings);
|
||||||
|
}
|
||||||
|
|
||||||
frontendSettings.dvbs(frontendDvbsSettings);
|
frontendSettings.dvbs(frontendDvbsSettings);
|
||||||
return frontendSettings;
|
return frontendSettings;
|
||||||
}
|
}
|
||||||
@@ -2755,7 +2754,7 @@ static void getDvbsFrontendSettingsExt1_1(JNIEnv *env, const jobject& settings,
|
|||||||
static_cast<FrontendDvbsScanType>(
|
static_cast<FrontendDvbsScanType>(
|
||||||
env->GetIntField(settings, env->GetFieldID(clazz, "mScanType", "I")));
|
env->GetIntField(settings, env->GetFieldID(clazz, "mScanType", "I")));
|
||||||
bool isDiseqcRxMessage = static_cast<bool>(env->GetBooleanField(
|
bool isDiseqcRxMessage = static_cast<bool>(env->GetBooleanField(
|
||||||
settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "B")));
|
settings, env->GetFieldID(clazz, "mIsDiseqcRxMessage", "Z")));
|
||||||
|
|
||||||
FrontendDvbsSettingsExt1_1 dvbsExt1_1 {
|
FrontendDvbsSettingsExt1_1 dvbsExt1_1 {
|
||||||
.scanType = scanType,
|
.scanType = scanType,
|
||||||
@@ -2995,6 +2994,10 @@ static void getDtmbFrontendSettings(JNIEnv *env, const jobject& settings,
|
|||||||
static FrontendSettings getFrontendSettings(JNIEnv *env, int type, jobject settings) {
|
static FrontendSettings getFrontendSettings(JNIEnv *env, int type, jobject settings) {
|
||||||
ALOGD("getFrontendSettings %d", type);
|
ALOGD("getFrontendSettings %d", type);
|
||||||
|
|
||||||
|
if (type == static_cast<int>(::android::hardware::tv::tuner::V1_1::FrontendType::DTMB)) {
|
||||||
|
return FrontendSettings();
|
||||||
|
}
|
||||||
|
|
||||||
FrontendType feType = static_cast<FrontendType>(type);
|
FrontendType feType = static_cast<FrontendType>(type);
|
||||||
switch(feType) {
|
switch(feType) {
|
||||||
case FrontendType::ANALOG:
|
case FrontendType::ANALOG:
|
||||||
|
|||||||
@@ -588,14 +588,15 @@ vector<FrontendStatusExt1_1> FrontendClient::getHidlStatusExt(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TunerFrontendStatus::codeRates: {
|
case TunerFrontendStatus::codeRates: {
|
||||||
int size = s.get<TunerFrontendStatus::codeRates>().size();
|
vector<hardware::tv::tuner::V1_1::FrontendInnerFec> codeRates;
|
||||||
status.codeRates().resize(size);
|
for (auto aidlCodeRate : s.get<TunerFrontendStatus::codeRates>()) {
|
||||||
for (int i = 0; i < size; i++) {
|
codeRates.push_back(
|
||||||
auto aidlCodeRate = s.get<TunerFrontendStatus::codeRates>()[i];
|
static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate));
|
||||||
status.codeRates()[i] =
|
}
|
||||||
static_cast<hardware::tv::tuner::V1_1::FrontendInnerFec>(aidlCodeRate);
|
if (codeRates.size() > 0) {
|
||||||
|
status.codeRates(codeRates);
|
||||||
|
hidlStatus.push_back(status);
|
||||||
}
|
}
|
||||||
hidlStatus.push_back(status);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TunerFrontendStatus::bandwidth: {
|
case TunerFrontendStatus::bandwidth: {
|
||||||
|
|||||||
Reference in New Issue
Block a user