a.添加一個全局變量
private int retryNum = 5;
b. SmsReadyBroadcastReceiver的 onReceive方法裡,多加一條trace,將simId打印出來,如下:
int extra = intent.getIntExtra("simId",0);
Log.e("kpp","extra="+extra);
c.handleSetStateResponse方法
如果發生exception則重試,在if (ar.exception != null)語句裡添加實現體,如下:
if (ar.exception != null) {
if(retryNum > 0){
Message msg;
retryNum --;
Log.e("kpp","retryNum="+retryNum);
Log.e("kpp","simId="+simId);
msg = mHandler.obtainMessage(MESSAGE_SET_STATE, simId, MESSAGE_SET_STATE,null);
if (FeatureOption.MTK_GEMINI_SUPPORT == true)
{
((GeminiPhone)phone).activateCellBroadcastSmsGemini(0,msg, simId);
}
else
{
phone.activateCellBroadcastSms(0,msg);
}
return;
}
else{
if(DBG)
Log.d(LOG_TAG, "handleSetStateResponse: ar.exception="+ ar.exception);
}
}
…….