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

Commit e5cdb3ce authored by Taesu Lee's avatar Taesu Lee Committed by android-build-merger
Browse files

Merge "Request report for sendMultipartTextSms() if required for any part" am: 97b3405d

am: 63405826

Change-Id: I5320b6f3bcb9efbab4309306d672c1dced6a1bce
parents ab7e4a5b 63405826
Loading
Loading
Loading
Loading
+31 −15
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import static com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_
import static com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
import static com.android.internal.telephony.SmsResponse.NO_ERROR_CODE;

import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.annotation.UserIdInt;
import android.app.Activity;
@@ -383,13 +382,6 @@ public abstract class SMSDispatcher extends Handler {
        }
    }

    private static int getSendSmsFlag(@Nullable PendingIntent deliveryIntent) {
        if (deliveryIntent == null) {
            return 0;
        }
        return CarrierMessagingService.SEND_FLAG_REQUEST_DELIVERY_STATUS;
    }

    /**
     * Use the carrier messaging service to send a text SMS.
     */
@@ -405,8 +397,13 @@ public abstract class SMSDispatcher extends Handler {

            if (text != null) {
                try {
                    sendTextSms(text, getSubId(),
                            mTracker.mDestAddress, getSendSmsFlag(mTracker.mDeliveryIntent),
                    sendTextSms(
                            text,
                            getSubId(),
                            mTracker.mDestAddress,
                            (mTracker.mDeliveryIntent != null)
                                    ? CarrierMessagingService.SEND_FLAG_REQUEST_DELIVERY_STATUS
                                    : 0,
                            mSenderCallback);
                } catch (RuntimeException e) {
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
@@ -438,9 +435,15 @@ public abstract class SMSDispatcher extends Handler {

            if (data != null) {
                try {
                    sendDataSms(data, getSubId(),
                            mTracker.mDestAddress, destPort,
                            getSendSmsFlag(mTracker.mDeliveryIntent), mSenderCallback);
                    sendDataSms(
                            data,
                            getSubId(),
                            mTracker.mDestAddress,
                            destPort,
                            (mTracker.mDeliveryIntent != null)
                                    ? CarrierMessagingService.SEND_FLAG_REQUEST_DELIVERY_STATUS
                                    : 0,
                            mSenderCallback);
                } catch (RuntimeException e) {
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
                    mSenderCallback.onSendSmsComplete(
@@ -566,10 +569,23 @@ public abstract class SMSDispatcher extends Handler {

        @Override
        public void onServiceReady() {
            boolean statusReportRequested = false;
            for (SmsTracker tracker : mTrackers) {
                if (tracker.mDeliveryIntent != null) {
                    statusReportRequested = true;
                    break;
                }
            }

            try {
                sendMultipartTextSms(
                        mParts, getSubId(), mTrackers[0].mDestAddress,
                        getSendSmsFlag(mTrackers[0].mDeliveryIntent), mSenderCallback);
                        mParts,
                        getSubId(),
                        mTrackers[0].mDestAddress,
                        statusReportRequested
                                ? CarrierMessagingService.SEND_FLAG_REQUEST_DELIVERY_STATUS
                                : 0,
                        mSenderCallback);
            } catch (RuntimeException e) {
                Rlog.e(TAG, "Exception sending the SMS: " + e);
                mSenderCallback.onSendMultipartSmsComplete(