首页 > 代码库 > android 微信听筒无声
android 微信听筒无声
Dual talk项目sim卡插在卡2时,微信听筒无声;
第三方APP在听筒接听语音时会固定去设audio_mode为incall,而不会去管下面是sim1还是sim2在位。
而speechdriver这边会根据audio_mode会固定的去设定modem_index,会固定将MD1 call起来。
如果是只插sim2,不插sim1,就会存在报MD 没有ready的问题,MD不会收到CCCI消息,会导致没有语音。
需要去判断MD1和MD2的状态,在根据他们的状态去开启相应的MD。
修改的文件和函数为:SpeechDriverFactory.cpp
status_t SpeechDriverFactory::SetActiveModemIndexByAudioMode(int mode)
{
status_t return_status = NO_ERROR;
status_t FLAG_MD1 ;status_t FLAG_MD2 ;
FLAG_MD1=mSpeechDriver1->CheckModemIsReady();
FLAG_MD2=mSpeechDriver2->CheckModemIsReady();
ALOGD("%s() mode(%d) FLAG_MD1(%d) FLAG_MD2(%d) !!", __FUNCTION__, mode,FLAG_MD1,FLAG_MD2);
switch (mode) {
case AUDIO_MODE_IN_CALL:
if(FLAG_MD1==1)
return_status = SetActiveModemIndex(MODEM_1);
else if((FLAG_MD1==0)&&(FLAG_MD2==1))
return_status = SetActiveModemIndex(MODEM_2);
break;
case AUDIO_MODE_IN_CALL_2:
return_status = SetActiveModemIndex(MODEM_2);
break;
default:
ALOGE("%s() mode(%d) is neither MODE_IN_CALL nor MODE_IN_CALL_2!!", __FUNCTION__, mode);
return_status = INVALID_OPERATION;
break;
}
return return_status;
}
2.在close的时候,之前打电话设计都是incall对应MD1,incall_2对应MD2.
目前第三方APP这边是固定去设mode incall,现在是去打开的MD2,所以在关闭的时候会发生assert的情况,请关闭该assert,或者修改assert条件。.
SpeechPhoneCallController.cpp
status_t SpeechPhoneCallController::CloseModemSpeechControlFlow(const audio_mode_t audio_mode)
{
Mutex::Autolock _l(mLock);
ALOGD("+%s(), audio_mode = %d", __FUNCTION__, audio_mode);
const modem_index_t modem_index = mSpeechDriverFactory->GetActiveModemIndex();
ALOGD("+%s(), audio_mode = %d , modem_index = %d ", __FUNCTION__, audio_mode, modem_index);
//ASSERT((modem_index == MODEM_1 && audio_mode == AUDIO_MODE_IN_CALL) ||
// (modem_index == MODEM_2 && audio_mode == AUDIO_MODE_IN_CALL_2));
第三方APP在听筒接听语音时会固定去设audio_mode为incall,而不会去管下面是sim1还是sim2在位。
而speechdriver这边会根据audio_mode会固定的去设定modem_index,会固定将MD1 call起来。
如果是只插sim2,不插sim1,就会存在报MD 没有ready的问题,MD不会收到CCCI消息,会导致没有语音。
需要去判断MD1和MD2的状态,在根据他们的状态去开启相应的MD。
修改的文件和函数为:SpeechDriverFactory.cpp
status_t SpeechDriverFactory::SetActiveModemIndexByAudioMode(int mode)
{
status_t return_status = NO_ERROR;
status_t FLAG_MD1 ;status_t FLAG_MD2 ;
FLAG_MD1=mSpeechDriver1->CheckModemIsReady();
FLAG_MD2=mSpeechDriver2->CheckModemIsReady();
ALOGD("%s() mode(%d) FLAG_MD1(%d) FLAG_MD2(%d) !!", __FUNCTION__, mode,FLAG_MD1,FLAG_MD2);
switch (mode) {
case AUDIO_MODE_IN_CALL:
if(FLAG_MD1==1)
return_status = SetActiveModemIndex(MODEM_1);
else if((FLAG_MD1==0)&&(FLAG_MD2==1))
return_status = SetActiveModemIndex(MODEM_2);
break;
case AUDIO_MODE_IN_CALL_2:
return_status = SetActiveModemIndex(MODEM_2);
break;
default:
ALOGE("%s() mode(%d) is neither MODE_IN_CALL nor MODE_IN_CALL_2!!", __FUNCTION__, mode);
return_status = INVALID_OPERATION;
break;
}
return return_status;
}
2.在close的时候,之前打电话设计都是incall对应MD1,incall_2对应MD2.
目前第三方APP这边是固定去设mode incall,现在是去打开的MD2,所以在关闭的时候会发生assert的情况,请关闭该assert,或者修改assert条件。.
SpeechPhoneCallController.cpp
status_t SpeechPhoneCallController::CloseModemSpeechControlFlow(const audio_mode_t audio_mode)
{
Mutex::Autolock _l(mLock);
ALOGD("+%s(), audio_mode = %d", __FUNCTION__, audio_mode);
const modem_index_t modem_index = mSpeechDriverFactory->GetActiveModemIndex();
ALOGD("+%s(), audio_mode = %d , modem_index = %d ", __FUNCTION__, audio_mode, modem_index);
//ASSERT((modem_index == MODEM_1 && audio_mode == AUDIO_MODE_IN_CALL) ||
// (modem_index == MODEM_2 && audio_mode == AUDIO_MODE_IN_CALL_2));
android 微信听筒无声
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。