Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efecbc33 authored by Jack Yu's avatar Jack Yu
Browse files

Removed SMS header from CDMA binary SMS.

bug: 21656132
Change-Id: I23a93ada079db891c0264f15bdc1b1ab9ff745c0
parent 6e6dff5d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ public class SmsNumberUtils {
        if (DBG) Rlog.d(TAG, "enter filterDestAddr. destAddr=\"" + destAddr + "\"" );

        if (destAddr == null || !PhoneNumberUtils.isGlobalPhoneNumber(destAddr)) {
            Rlog.w(TAG, "destAddr" + destAddr + " is not a global phone number!");
            Rlog.w(TAG, "destAddr" + destAddr + " is not a global phone number! Nothing changed.");
            return destAddr;
        }

@@ -551,7 +551,10 @@ public class SmsNumberUtils {
            }
        }

        if (DBG) Rlog.d(TAG, "leave filterDestAddr, new destAddr=\"" + result + "\"" );
        if (DBG) {
            Rlog.d(TAG, "destAddr is " + ((result != null)?"formatted.":"not formatted."));
            Rlog.d(TAG, "leave filterDestAddr, new destAddr=\"" + (result != null ? result : destAddr) + "\"" );
        }
        return result != null ? result : destAddr;
    }

+29 −11
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
            byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) {
        SmsMessage.SubmitPdu pdu = SmsMessage.getSubmitPdu(
                scAddr, destAddr, destPort, data, (deliveryIntent != null));
        if (pdu != null) {
            HashMap map = getSmsTrackerMap(destAddr, scAddr, destPort, data, pdu);
            SmsTracker tracker = getSmsTracker(map, sentIntent, deliveryIntent, getFormat(),
                    null /*messageUri*/, false /*isExpectMore*/, null /*fullMessageText*/,
@@ -123,6 +124,16 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
                Rlog.v(TAG, "No carrier package.");
                sendSubmitPdu(tracker);
            }
        } else {
            Rlog.e(TAG, "CdmaSMSDispatcher.sendData(): getSubmitPdu() returned null");
            if (sentIntent != null) {
                try {
                    sentIntent.send(SmsManager.RESULT_ERROR_GENERIC_FAILURE);
                } catch (CanceledException ex) {
                    Rlog.e(TAG, "Intent has been canceled!");
                }
            }
        }
    }

    /** {@inheritDoc} */
@@ -147,6 +158,13 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
            }
        } else {
            Rlog.e(TAG, "CdmaSMSDispatcher.sendText(): getSubmitPdu() returned null");
            if (sentIntent != null) {
                try {
                    sentIntent.send(SmsManager.RESULT_ERROR_GENERIC_FAILURE);
                } catch (CanceledException ex) {
                    Rlog.e(TAG, "Intent has been canceled!");
                }
            }
        }
    }