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

Commit 5a176f73 authored by Wink Saville's avatar Wink Saville
Browse files

Merge commit '958e7316' into fix-merge-conflict

* commit '958e7316':
  Telephony: Set TP-RD to 1 in case of retry

Change-Id: I298e588b1076686e2c7c4b3714b46d2637b04079
parents 6c5e8c9e 958e7316
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -428,13 +428,17 @@ public abstract class SMSDispatcher extends Handler {
        SmsTracker tracker = (SmsTracker) ar.userObj;
        PendingIntent sentIntent = tracker.mSentIntent;

        if (ar.result != null) {
            tracker.mMessageRef = ((SmsResponse)ar.result).mMessageRef;
        } else {
            Rlog.d(TAG, "SmsResponse was null");
        }

        if (ar.exception == null) {
            if (DBG) Rlog.d(TAG, "SMS send complete. Broadcasting intent: " + sentIntent);

            if (tracker.mDeliveryIntent != null) {
                // Expecting a status report.  Add it to the list.
                int messageRef = ((SmsResponse)ar.result).mMessageRef;
                tracker.mMessageRef = messageRef;
                deliveryPendingList.add(tracker);
            }

+15 −0
Original line number Diff line number Diff line
@@ -295,6 +295,21 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
        byte pdu[] = (byte[]) map.get("pdu");

        Message reply = obtainMessage(EVENT_SEND_SMS_COMPLETE, tracker);

        if (tracker.mRetryCount > 0) {
            Rlog.d(TAG, "sendSms: "
                    + " mRetryCount=" + tracker.mRetryCount
                    + " mMessageRef=" + tracker.mMessageRef
                    + " SS=" + mPhone.getServiceState().getState());

            // per TS 23.040 Section 9.2.3.6:  If TP-MTI SMS-SUBMIT (0x01) type
            //   TP-RD (bit 2) is 1 for retry
            //   and TP-MR is set to previously failed sms TP-MR
            if (((0x01 & pdu[0]) == 0x01)) {
                pdu[0] |= 0x04; // TP-RD
                pdu[1] = (byte) tracker.mMessageRef; // TP-MR
            }
        }
        mCi.sendSMS(IccUtils.bytesToHexString(smsc), IccUtils.bytesToHexString(pdu), reply);
    }