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

Commit bdd10e96 authored by Taesu Lee's avatar Taesu Lee
Browse files

Update message status according to the ERROR_CLASS



Simple matching up CDMA status with GSM TP-Status. And it is expected
another status report in case of ERROR_TEMPORARY.

Test: Manual

Change-Id: If2cfe8853113a24f2e3d55ac127f81fc5ef8e250
Signed-off-by: default avatarTaesu Lee <taesu82.lee@samsung.com>
parent 8c5e2a4d
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.internal.telephony;

import static com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_PERIOD_NOT_SPECIFIED;
import static com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
import static com.android.internal.telephony.cdma.sms.BearerData.ERROR_NONE;
import static com.android.internal.telephony.cdma.sms.BearerData.ERROR_TEMPORARY;

import android.app.Activity;
import android.app.PendingIntent;
@@ -766,9 +768,23 @@ public class SmsDispatchersController extends Handler {

    private Pair<Boolean, Boolean> handleCdmaStatusReport(SMSDispatcher.SmsTracker tracker,
            String format, byte[] pdu) {
        tracker.updateSentMessageStatus(mContext, Sms.STATUS_COMPLETE);
        boolean success = triggerDeliveryIntent(tracker, format, pdu);
        return new Pair(success, true /* complete */);
        com.android.internal.telephony.cdma.SmsMessage sms =
                com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
        boolean complete = false;
        boolean success = false;
        if (sms != null) {
            // The status is composed of an error class (bits 25-24) and a status code (bits 23-16).
            int errorClass = (sms.getStatus() >> 24) & 0x03;
            if (errorClass != ERROR_TEMPORARY) {
                // Update the message status (COMPLETE or FAILED)
                tracker.updateSentMessageStatus(
                        mContext,
                        (errorClass == ERROR_NONE) ? Sms.STATUS_COMPLETE : Sms.STATUS_FAILED);
                complete = true;
            }
            success = triggerDeliveryIntent(tracker, format, pdu);
        }
        return new Pair(success, complete);
    }

    private Pair<Boolean, Boolean> handleGsmStatusReport(SMSDispatcher.SmsTracker tracker,