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

Commit 665fffc9 authored by Cheuksan Wang's avatar Cheuksan Wang Committed by Android Partner Code Review
Browse files

Merge "add a parameter to carrier messaging calls to request delivery status" into m-wireless-dev

parents 5563fb43 ade6a7a4
Loading
Loading
Loading
Loading
+14 −3
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@
 */
 */


package com.android.internal.telephony;
package com.android.internal.telephony;
import android.annotation.Nullable;
import android.app.Activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.PendingIntent;
@@ -354,6 +355,13 @@ 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.
     * Use the carrier messaging service to send a text SMS.
     */
     */
@@ -370,7 +378,8 @@ public abstract class SMSDispatcher extends Handler {
            if (text != null) {
            if (text != null) {
                try {
                try {
                    carrierMessagingService.sendTextSms(text, getSubId(),
                    carrierMessagingService.sendTextSms(text, getSubId(),
                            mTracker.mDestAddress, mSenderCallback);
                            mTracker.mDestAddress, getSendSmsFlag(mTracker.mDeliveryIntent),
                            mSenderCallback);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
                    mSenderCallback.onSendSmsComplete(
                    mSenderCallback.onSendSmsComplete(
@@ -402,7 +411,8 @@ public abstract class SMSDispatcher extends Handler {
            if (data != null) {
            if (data != null) {
                try {
                try {
                    carrierMessagingService.sendDataSms(data, getSubId(),
                    carrierMessagingService.sendDataSms(data, getSubId(),
                            mTracker.mDestAddress, destPort, mSenderCallback);
                            mTracker.mDestAddress, destPort,
                            getSendSmsFlag(mTracker.mDeliveryIntent), mSenderCallback);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
                    Rlog.e(TAG, "Exception sending the SMS: " + e);
                    mSenderCallback.onSendSmsComplete(
                    mSenderCallback.onSendSmsComplete(
@@ -528,7 +538,8 @@ public abstract class SMSDispatcher extends Handler {
        protected void onServiceReady(ICarrierMessagingService carrierMessagingService) {
        protected void onServiceReady(ICarrierMessagingService carrierMessagingService) {
            try {
            try {
                carrierMessagingService.sendMultipartTextSms(
                carrierMessagingService.sendMultipartTextSms(
                        mParts, getSubId(), mTrackers[0].mDestAddress, mSenderCallback);
                        mParts, getSubId(), mTrackers[0].mDestAddress,
                        getSendSmsFlag(mTrackers[0].mDeliveryIntent), mSenderCallback);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                Rlog.e(TAG, "Exception sending the SMS: " + e);
                Rlog.e(TAG, "Exception sending the SMS: " + e);
                mSenderCallback.onSendMultipartSmsComplete(
                mSenderCallback.onSendMultipartSmsComplete(