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));