Loading src/java/com/android/internal/telephony/SmsDispatchersController.java +62 −63 Original line number Diff line number Diff line Loading @@ -432,31 +432,30 @@ public class SmsDispatchersController extends Handler { */ public void sendRetrySms(SMSDispatcher.SmsTracker tracker) { String oldFormat = tracker.mFormat; boolean retryUsingImsService = false; // newFormat will be based on voice technology String newFormat = (PhoneConstants.PHONE_TYPE_CDMA == mPhone.getPhoneType()) ? mCdmaDispatcher.getFormat() : mGsmDispatcher.getFormat(); // was previously sent sms format match with voice tech? if (oldFormat.equals(newFormat)) { if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format matched new format (cdma)"); mCdmaDispatcher.sendSms(tracker); return; } else { Rlog.d(TAG, "old format matched new format (gsm)"); mGsmDispatcher.sendSms(tracker); return; } if (!tracker.mUsesImsServiceForIms && mImsSmsDispatcher.isAvailable()) { // If this tracker has not been handled by ImsSmsDispatcher yet and IMS Service is // available now, retry this failed tracker using IMS Service. retryUsingImsService = true; } // If retryUsingImsService is true, newFormat will be IMS SMS format. Otherwise, newFormat // will be based on voice technology. String newFormat = retryUsingImsService ? mImsSmsDispatcher.getFormat() : (PhoneConstants.PHONE_TYPE_CDMA == mPhone.getPhoneType()) ? mCdmaDispatcher.getFormat() : mGsmDispatcher.getFormat(); Rlog.d(TAG, "old format(" + oldFormat + ") ==> new format (" + newFormat + ")"); if (!oldFormat.equals(newFormat)) { // format didn't match, need to re-encode. HashMap map = tracker.getData(); // to re-encode, fields needed are: scAddr, destAddr, and // text if originally sent as sendText or // data and destPort if originally sent as sendData. // to re-encode, fields needed are: scAddr, destAddr and text if originally sent as // sendText or data and destPort if originally sent as sendData. if (!(map.containsKey("scAddr") && map.containsKey("destAddr") && (map.containsKey("text") || (map.containsKey("data") && map.containsKey("destPort"))))) { Loading @@ -475,11 +474,9 @@ public class SmsDispatchersController extends Handler { String text = (String) map.get("text"); if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format (gsm) ==> new format (cdma)"); pdu = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu( scAddr, destAddr, text, (tracker.mDeliveryIntent != null), null); } else { Rlog.d(TAG, "old format (cdma) ==> new format (gsm)"); pdu = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu( scAddr, destAddr, text, (tracker.mDeliveryIntent != null), null); } Loading @@ -489,12 +486,10 @@ public class SmsDispatchersController extends Handler { Integer destPort = (Integer) map.get("destPort"); if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format (gsm) ==> new format (cdma)"); pdu = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu( scAddr, destAddr, destPort.intValue(), data, (tracker.mDeliveryIntent != null)); } else { Rlog.d(TAG, "old format (cdma) ==> new format (gsm)"); pdu = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu( scAddr, destAddr, destPort.intValue(), data, (tracker.mDeliveryIntent != null)); Loading @@ -504,10 +499,14 @@ public class SmsDispatchersController extends Handler { // replace old smsc and pdu with newly encoded ones map.put("smsc", pdu.encodedScAddress); map.put("pdu", pdu.encodedMessage); tracker.mFormat = newFormat; } SMSDispatcher dispatcher = (isCdmaFormat(newFormat)) ? mCdmaDispatcher : mGsmDispatcher; SMSDispatcher dispatcher = retryUsingImsService ? mImsSmsDispatcher : (isCdmaFormat(newFormat)) ? mCdmaDispatcher : mGsmDispatcher; tracker.mFormat = dispatcher.getFormat(); dispatcher.sendSms(tracker); } Loading Loading
src/java/com/android/internal/telephony/SmsDispatchersController.java +62 −63 Original line number Diff line number Diff line Loading @@ -432,31 +432,30 @@ public class SmsDispatchersController extends Handler { */ public void sendRetrySms(SMSDispatcher.SmsTracker tracker) { String oldFormat = tracker.mFormat; boolean retryUsingImsService = false; // newFormat will be based on voice technology String newFormat = (PhoneConstants.PHONE_TYPE_CDMA == mPhone.getPhoneType()) ? mCdmaDispatcher.getFormat() : mGsmDispatcher.getFormat(); // was previously sent sms format match with voice tech? if (oldFormat.equals(newFormat)) { if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format matched new format (cdma)"); mCdmaDispatcher.sendSms(tracker); return; } else { Rlog.d(TAG, "old format matched new format (gsm)"); mGsmDispatcher.sendSms(tracker); return; } if (!tracker.mUsesImsServiceForIms && mImsSmsDispatcher.isAvailable()) { // If this tracker has not been handled by ImsSmsDispatcher yet and IMS Service is // available now, retry this failed tracker using IMS Service. retryUsingImsService = true; } // If retryUsingImsService is true, newFormat will be IMS SMS format. Otherwise, newFormat // will be based on voice technology. String newFormat = retryUsingImsService ? mImsSmsDispatcher.getFormat() : (PhoneConstants.PHONE_TYPE_CDMA == mPhone.getPhoneType()) ? mCdmaDispatcher.getFormat() : mGsmDispatcher.getFormat(); Rlog.d(TAG, "old format(" + oldFormat + ") ==> new format (" + newFormat + ")"); if (!oldFormat.equals(newFormat)) { // format didn't match, need to re-encode. HashMap map = tracker.getData(); // to re-encode, fields needed are: scAddr, destAddr, and // text if originally sent as sendText or // data and destPort if originally sent as sendData. // to re-encode, fields needed are: scAddr, destAddr and text if originally sent as // sendText or data and destPort if originally sent as sendData. if (!(map.containsKey("scAddr") && map.containsKey("destAddr") && (map.containsKey("text") || (map.containsKey("data") && map.containsKey("destPort"))))) { Loading @@ -475,11 +474,9 @@ public class SmsDispatchersController extends Handler { String text = (String) map.get("text"); if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format (gsm) ==> new format (cdma)"); pdu = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu( scAddr, destAddr, text, (tracker.mDeliveryIntent != null), null); } else { Rlog.d(TAG, "old format (cdma) ==> new format (gsm)"); pdu = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu( scAddr, destAddr, text, (tracker.mDeliveryIntent != null), null); } Loading @@ -489,12 +486,10 @@ public class SmsDispatchersController extends Handler { Integer destPort = (Integer) map.get("destPort"); if (isCdmaFormat(newFormat)) { Rlog.d(TAG, "old format (gsm) ==> new format (cdma)"); pdu = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu( scAddr, destAddr, destPort.intValue(), data, (tracker.mDeliveryIntent != null)); } else { Rlog.d(TAG, "old format (cdma) ==> new format (gsm)"); pdu = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu( scAddr, destAddr, destPort.intValue(), data, (tracker.mDeliveryIntent != null)); Loading @@ -504,10 +499,14 @@ public class SmsDispatchersController extends Handler { // replace old smsc and pdu with newly encoded ones map.put("smsc", pdu.encodedScAddress); map.put("pdu", pdu.encodedMessage); tracker.mFormat = newFormat; } SMSDispatcher dispatcher = (isCdmaFormat(newFormat)) ? mCdmaDispatcher : mGsmDispatcher; SMSDispatcher dispatcher = retryUsingImsService ? mImsSmsDispatcher : (isCdmaFormat(newFormat)) ? mCdmaDispatcher : mGsmDispatcher; tracker.mFormat = dispatcher.getFormat(); dispatcher.sendSms(tracker); } Loading