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

Commit 8cc7f5b3 authored by Mengjun Leng's avatar Mengjun Leng Committed by android-build-merger
Browse files

Merge "Add support for send Message with messaging options." am: 5bb6bdb5 am: 2b95be21

am: 184be992

Change-Id: I614306193caa948f2e497463c63117004b5a862c
parents 75e8e325 184be992
Loading
Loading
Loading
Loading
+167 −14
Original line number Original line Diff line number Diff line
@@ -78,6 +78,8 @@ public class IccSmsInterfaceManager {
    protected static final int EVENT_SET_BROADCAST_CONFIG_DONE = 4;
    protected static final int EVENT_SET_BROADCAST_CONFIG_DONE = 4;
    private static final int SMS_CB_CODE_SCHEME_MIN = 0;
    private static final int SMS_CB_CODE_SCHEME_MIN = 0;
    private static final int SMS_CB_CODE_SCHEME_MAX = 255;
    private static final int SMS_CB_CODE_SCHEME_MAX = 255;
    public static final int SMS_MESSAGE_PRIORITY_NOT_SPECIFIED = -1;
    public static final int SMS_MESSAGE_PERIOD_NOT_SPECIFIED = -1;


    protected Phone mPhone;
    protected Phone mPhone;
    final protected Context mContext;
    final protected Context mContext;
@@ -393,7 +395,8 @@ public class IccSmsInterfaceManager {
                Manifest.permission.SEND_SMS,
                Manifest.permission.SEND_SMS,
                "Sending SMS message");
                "Sending SMS message");
        sendTextInternal(callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
        sendTextInternal(callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
            persistMessageForNonDefaultSmsApp);
            persistMessageForNonDefaultSmsApp, SMS_MESSAGE_PRIORITY_NOT_SPECIFIED,
            false /* expectMore */, SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
    }
    }


    /**
    /**
@@ -407,7 +410,8 @@ public class IccSmsInterfaceManager {
                Manifest.permission.SEND_SMS,
                Manifest.permission.SEND_SMS,
                "Sending SMS message");
                "Sending SMS message");
        sendTextInternal(callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
        sendTextInternal(callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
            persistMessage);
            persistMessage, SMS_MESSAGE_PRIORITY_NOT_SPECIFIED, false /* expectMore */,
            SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
    }
    }


    /**
    /**
@@ -433,15 +437,39 @@ public class IccSmsInterfaceManager {
     * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
     * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
     *  broadcast when the message is delivered to the recipient.  The
     *  broadcast when the message is delivered to the recipient.  The
     *  raw pdu of the status report is in the extended data ("pdu").
     *  raw pdu of the status report is in the extended data ("pdu").
     * @param persistMessageForNonDefaultSmsApp whether the sent message should
     *  be automatically persisted in the SMS db. It only affects messages sent
     *  by a non-default SMS app. Currently only the carrier app can set this
     *  parameter to false to skip auto message persistence.
     * @param priority Priority level of the message
     *  Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1
     *  ---------------------------------
     *  PRIORITY      | Level of Priority
     *  ---------------------------------
     *      '00'      |     Normal
     *      '01'      |     Interactive
     *      '10'      |     Urgent
     *      '11'      |     Emergency
     *  ----------------------------------
     *  Any Other values including negative considered as Invalid Priority Indicator of the message.
     * @param expectMore is a boolean to indicate the sending messages through same link or not.
     * @param validityPeriod Validity Period of the message in mins.
     *  Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1.
     *  Validity Period(Minimum) -> 5 mins
     *  Validity Period(Maximum) -> 635040 mins(i.e.63 weeks).
     *  Any Other values including negative considered as Invalid Validity Period of the message.
     */
     */


    private void sendTextInternal(String callingPackage, String destAddr, String scAddr,
    private void sendTextInternal(String callingPackage, String destAddr, String scAddr,
            String text, PendingIntent sentIntent, PendingIntent deliveryIntent,
            String text, PendingIntent sentIntent, PendingIntent deliveryIntent,
            boolean persistMessageForNonDefaultSmsApp) {
            boolean persistMessageForNonDefaultSmsApp, int priority, boolean expectMore,
            int validityPeriod) {
        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
            log("sendText: destAddr=" + destAddr + " scAddr=" + scAddr +
            log("sendText: destAddr=" + destAddr + " scAddr=" + scAddr +
                " text='"+ text + "' sentIntent=" +
                " text='"+ text + "' sentIntent=" +
                sentIntent + " deliveryIntent=" + deliveryIntent);
                sentIntent + " deliveryIntent=" + deliveryIntent
                + " priority=" + priority + " expectMore=" + expectMore
                + " validityPeriod=" + validityPeriod);
        }
        }
        if (mAppOps.noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
        if (mAppOps.noteOp(AppOpsManager.OP_SEND_SMS, Binder.getCallingUid(),
                callingPackage) != AppOpsManager.MODE_ALLOWED) {
                callingPackage) != AppOpsManager.MODE_ALLOWED) {
@@ -452,7 +480,65 @@ public class IccSmsInterfaceManager {
        }
        }
        destAddr = filterDestAddress(destAddr);
        destAddr = filterDestAddress(destAddr);
        mDispatcher.sendText(destAddr, scAddr, text, sentIntent, deliveryIntent,
        mDispatcher.sendText(destAddr, scAddr, text, sentIntent, deliveryIntent,
                null/*messageUri*/, callingPackage, persistMessageForNonDefaultSmsApp);
                null/*messageUri*/, callingPackage, persistMessageForNonDefaultSmsApp,
                priority, expectMore, validityPeriod);
    }

    /**
     * Send a text based SMS with Messaging Options.
     *
     * @param destAddr the address to send the message to
     * @param scAddr is the service center address or null to use
     *  the current default SMSC
     * @param text the body of the message to send
     * @param sentIntent if not NULL this <code>PendingIntent</code> is
     *  broadcast when the message is successfully sent, or failed.
     *  The result code will be <code>Activity.RESULT_OK<code> for success,
     *  or one of these errors:<br>
     *  <code>RESULT_ERROR_GENERIC_FAILURE</code><br>
     *  <code>RESULT_ERROR_RADIO_OFF</code><br>
     *  <code>RESULT_ERROR_NULL_PDU</code><br>
     *  For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include
     *  the extra "errorCode" containing a radio technology specific value,
     *  generally only useful for troubleshooting.<br>
     *  The per-application based SMS control checks sentIntent. If sentIntent
     *  is NULL the caller will be checked against all unknown applications,
     *  which cause smaller number of SMS to be sent in checking period.
     * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
     *  broadcast when the message is delivered to the recipient.  The
     *  raw pdu of the status report is in the extended data ("pdu").
     * @param persistMessageForNonDefaultSmsApp whether the sent message should
     *  be automatically persisted in the SMS db. It only affects messages sent
     *  by a non-default SMS app. Currently only the carrier app can set this
     *  parameter to false to skip auto message persistence.
     * @param priority Priority level of the message
     *  Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1
     *  ---------------------------------
     *  PRIORITY      | Level of Priority
     *  ---------------------------------
     *      '00'      |     Normal
     *      '01'      |     Interactive
     *      '10'      |     Urgent
     *      '11'      |     Emergency
     *  ----------------------------------
     *  Any Other values including negative considered as Invalid Priority Indicator of the message.
     * @param expectMore is a boolean to indicate the sending messages through same link or not.
     * @param validityPeriod Validity Period of the message in mins.
     *  Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1.
     *  Validity Period(Minimum) -> 5 mins
     *  Validity Period(Maximum) -> 635040 mins(i.e.63 weeks).
     *  Any Other values including negative considered as Invalid Validity Period of the message.
     */

    public void sendTextWithOptions(String callingPackage, String destAddr, String scAddr,
            String text, PendingIntent sentIntent, PendingIntent deliveryIntent,
            boolean persistMessageForNonDefaultSmsApp, int priority, boolean expectMore,
            int validityPeriod) {
        mPhone.getContext().enforceCallingOrSelfPermission(
                Manifest.permission.SEND_SMS,
                "Sending SMS message");
        sendTextInternal(callingPackage, destAddr, scAddr, text, sentIntent, deliveryIntent,
                persistMessageForNonDefaultSmsApp, priority, expectMore, validityPeriod);
    }
    }


    /**
    /**
@@ -504,6 +590,63 @@ public class IccSmsInterfaceManager {
    public void sendMultipartText(String callingPackage, String destAddr, String scAddr,
    public void sendMultipartText(String callingPackage, String destAddr, String scAddr,
            List<String> parts, List<PendingIntent> sentIntents,
            List<String> parts, List<PendingIntent> sentIntents,
            List<PendingIntent> deliveryIntents, boolean persistMessageForNonDefaultSmsApp) {
            List<PendingIntent> deliveryIntents, boolean persistMessageForNonDefaultSmsApp) {
        sendMultipartTextWithOptions(callingPackage, destAddr, destAddr, parts, sentIntents,
                deliveryIntents, persistMessageForNonDefaultSmsApp,
                SMS_MESSAGE_PRIORITY_NOT_SPECIFIED, false /* expectMore */,
                SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
    }

    /**
     * Send a multi-part text based SMS with Messaging Options.
     *
     * @param destAddr the address to send the message to
     * @param scAddr is the service center address or null to use
     *   the current default SMSC
     * @param parts an <code>ArrayList</code> of strings that, in order,
     *   comprise the original message
     * @param sentIntents if not null, an <code>ArrayList</code> of
     *   <code>PendingIntent</code>s (one for each message part) that is
     *   broadcast when the corresponding message part has been sent.
     *   The result code will be <code>Activity.RESULT_OK<code> for success,
     *   or one of these errors:
     *   <code>RESULT_ERROR_GENERIC_FAILURE</code>
     *   <code>RESULT_ERROR_RADIO_OFF</code>
     *   <code>RESULT_ERROR_NULL_PDU</code>.
     *  The per-application based SMS control checks sentIntent. If sentIntent
     *  is NULL the caller will be checked against all unknown applications,
     *  which cause smaller number of SMS to be sent in checking period.
     * @param deliveryIntents if not null, an <code>ArrayList</code> of
     *   <code>PendingIntent</code>s (one for each message part) that is
     *   broadcast when the corresponding message part has been delivered
     *   to the recipient.  The raw pdu of the status report is in the
     *   extended data ("pdu").
     * @param persistMessageForNonDefaultSmsApp whether the sent message should
     *   be automatically persisted in the SMS db. It only affects messages sent
     *   by a non-default SMS app. Currently only the carrier app can set this
     *   parameter to false to skip auto message persistence.
     * @param priority Priority level of the message
     *  Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1
     *  ---------------------------------
     *  PRIORITY      | Level of Priority
     *  ---------------------------------
     *      '00'      |     Normal
     *      '01'      |     Interactive
     *      '10'      |     Urgent
     *      '11'      |     Emergency
     *  ----------------------------------
     *  Any Other values including negative considered as Invalid Priority Indicator of the message.
     * @param expectMore is a boolean to indicate the sending messages through same link or not.
     * @param validityPeriod Validity Period of the message in mins.
     *  Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1.
     *  Validity Period(Minimum) -> 5 mins
     *  Validity Period(Maximum) -> 635040 mins(i.e.63 weeks).
     *  Any Other values including negative considered as Invalid Validity Period of the message.
     */

    public void sendMultipartTextWithOptions(String callingPackage, String destAddr,
            String scAddr, List<String> parts, List<PendingIntent> sentIntents,
            List<PendingIntent> deliveryIntents, boolean persistMessageForNonDefaultSmsApp,
            int priority, boolean expectMore, int validityPeriod) {
        mPhone.getContext().enforceCallingPermission(
        mPhone.getContext().enforceCallingPermission(
                Manifest.permission.SEND_SMS,
                Manifest.permission.SEND_SMS,
                "Sending SMS message");
                "Sending SMS message");
@@ -514,7 +657,7 @@ public class IccSmsInterfaceManager {
        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
            int i = 0;
            int i = 0;
            for (String part : parts) {
            for (String part : parts) {
                log("sendMultipartText: destAddr=" + destAddr + ", srAddr=" + scAddr +
                log("sendMultipartTextWithOptions: destAddr=" + destAddr + ", srAddr=" + scAddr +
                        ", part[" + (i++) + "]=" + part);
                        ", part[" + (i++) + "]=" + part);
            }
            }
        }
        }
@@ -549,17 +692,21 @@ public class IccSmsInterfaceManager {
                mDispatcher.sendText(destAddr, scAddr, singlePart,
                mDispatcher.sendText(destAddr, scAddr, singlePart,
                        singleSentIntent, singleDeliveryIntent,
                        singleSentIntent, singleDeliveryIntent,
                        null/*messageUri*/, callingPackage,
                        null/*messageUri*/, callingPackage,
                        persistMessageForNonDefaultSmsApp);
                        persistMessageForNonDefaultSmsApp,
                        priority, expectMore, validityPeriod);
            }
            }
            return;
            return;
        }
        }


        mDispatcher.sendMultipartText(destAddr, scAddr, (ArrayList<String>) parts,
        mDispatcher.sendMultipartText(destAddr,
                (ArrayList<PendingIntent>) sentIntents, (ArrayList<PendingIntent>) deliveryIntents,
                                      scAddr,
                null/*messageUri*/, callingPackage, persistMessageForNonDefaultSmsApp);
                                      (ArrayList<String>) parts,
                                      (ArrayList<PendingIntent>) sentIntents,
                                      (ArrayList<PendingIntent>) deliveryIntents,
                                      null, callingPackage, persistMessageForNonDefaultSmsApp,
                                      priority, expectMore, validityPeriod);
    }
    }



    public int getPremiumSmsPermission(String packageName) {
    public int getPremiumSmsPermission(String packageName) {
        return mDispatcher.getPremiumSmsPermission(packageName);
        return mDispatcher.getPremiumSmsPermission(packageName);
    }
    }
@@ -953,7 +1100,8 @@ public class IccSmsInterfaceManager {
        textAndAddress[1] = filterDestAddress(textAndAddress[1]);
        textAndAddress[1] = filterDestAddress(textAndAddress[1]);
        mDispatcher.sendText(textAndAddress[1], scAddress, textAndAddress[0],
        mDispatcher.sendText(textAndAddress[1], scAddress, textAndAddress[0],
                sentIntent, deliveryIntent, messageUri, callingPkg,
                sentIntent, deliveryIntent, messageUri, callingPkg,
                true /* persistMessageForNonDefaultSmsApp */);
                true /* persistMessageForNonDefaultSmsApp */, SMS_MESSAGE_PRIORITY_NOT_SPECIFIED,
                false /* expectMore */, SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
    }
    }


    public void sendStoredMultipartText(String callingPkg, Uri messageUri, String scAddress,
    public void sendStoredMultipartText(String callingPkg, Uri messageUri, String scAddress,
@@ -1009,7 +1157,9 @@ public class IccSmsInterfaceManager {


                mDispatcher.sendText(textAndAddress[1], scAddress, singlePart,
                mDispatcher.sendText(textAndAddress[1], scAddress, singlePart,
                        singleSentIntent, singleDeliveryIntent, messageUri, callingPkg,
                        singleSentIntent, singleDeliveryIntent, messageUri, callingPkg,
                        true  /* persistMessageForNonDefaultSmsApp */);
                        true  /* persistMessageForNonDefaultSmsApp */,
                        SMS_MESSAGE_PRIORITY_NOT_SPECIFIED,
                        false /* expectMore */, SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
            }
            }
            return;
            return;
        }
        }
@@ -1022,7 +1172,10 @@ public class IccSmsInterfaceManager {
                (ArrayList<PendingIntent>) deliveryIntents,
                (ArrayList<PendingIntent>) deliveryIntents,
                messageUri,
                messageUri,
                callingPkg,
                callingPkg,
                true  /* persistMessageForNonDefaultSmsApp */);
                true  /* persistMessageForNonDefaultSmsApp */,
                SMS_MESSAGE_PRIORITY_NOT_SPECIFIED,
                false /* expectMore */,
                SMS_MESSAGE_PERIOD_NOT_SPECIFIED);
    }
    }


    private boolean isFailedOrDraft(ContentResolver resolver, Uri messageUri) {
    private boolean isFailedOrDraft(ContentResolver resolver, Uri messageUri) {
+11 −7
Original line number Original line Diff line number Diff line
@@ -173,13 +173,15 @@ public class ImsSMSDispatcher extends SMSDispatcher {
    public void sendMultipartText(String destAddr, String scAddr,
    public void sendMultipartText(String destAddr, String scAddr,
            ArrayList<String> parts, ArrayList<PendingIntent> sentIntents,
            ArrayList<String> parts, ArrayList<PendingIntent> sentIntents,
            ArrayList<PendingIntent> deliveryIntents, Uri messageUri, String callingPkg,
            ArrayList<PendingIntent> deliveryIntents, Uri messageUri, String callingPkg,
            boolean persistMessage) {
            boolean persistMessage, int priority, boolean expectMore, int validityPeriod) {
        if (isCdmaMo()) {
        if (isCdmaMo()) {
            mCdmaDispatcher.sendMultipartText(destAddr, scAddr,
            mCdmaDispatcher.sendMultipartText(destAddr, scAddr,
                    parts, sentIntents, deliveryIntents, messageUri, callingPkg, persistMessage);
                    parts, sentIntents, deliveryIntents, messageUri, callingPkg, persistMessage,
                    priority, expectMore, validityPeriod);
        } else {
        } else {
            mGsmDispatcher.sendMultipartText(destAddr, scAddr,
            mGsmDispatcher.sendMultipartText(destAddr, scAddr,
                    parts, sentIntents, deliveryIntents, messageUri, callingPkg, persistMessage);
                    parts, sentIntents, deliveryIntents, messageUri, callingPkg, persistMessage,
                    priority, expectMore, validityPeriod);
        }
        }
    }
    }


@@ -199,14 +201,16 @@ public class ImsSMSDispatcher extends SMSDispatcher {
    @Override
    @Override
    public void sendText(String destAddr, String scAddr, String text, PendingIntent sentIntent,
    public void sendText(String destAddr, String scAddr, String text, PendingIntent sentIntent,
            PendingIntent deliveryIntent, Uri messageUri, String callingPkg,
            PendingIntent deliveryIntent, Uri messageUri, String callingPkg,
            boolean persistMessage) {
            boolean persistMessage, int priority, boolean expectMore, int validityPeriod) {
        Rlog.d(TAG, "sendText");
        Rlog.d(TAG, "sendText");
        if (isCdmaMo()) {
        if (isCdmaMo()) {
            mCdmaDispatcher.sendText(destAddr, scAddr,
            mCdmaDispatcher.sendText(destAddr, scAddr,
                    text, sentIntent, deliveryIntent, messageUri, callingPkg, persistMessage);
                    text, sentIntent, deliveryIntent, messageUri, callingPkg, persistMessage,
                    priority, expectMore, validityPeriod);
        } else {
        } else {
            mGsmDispatcher.sendText(destAddr, scAddr,
            mGsmDispatcher.sendText(destAddr, scAddr,
                    text, sentIntent, deliveryIntent, messageUri, callingPkg, persistMessage);
                    text, sentIntent, deliveryIntent, messageUri, callingPkg, persistMessage,
                    priority, expectMore, validityPeriod);
        }
        }
    }
    }


@@ -365,7 +369,7 @@ public class ImsSMSDispatcher extends SMSDispatcher {
            String message, SmsHeader smsHeader, int format, PendingIntent sentIntent,
            String message, SmsHeader smsHeader, int format, PendingIntent sentIntent,
            PendingIntent deliveryIntent, boolean lastPart,
            PendingIntent deliveryIntent, boolean lastPart,
            AtomicInteger unsentPartCount, AtomicBoolean anyPartFailed, Uri messageUri,
            AtomicInteger unsentPartCount, AtomicBoolean anyPartFailed, Uri messageUri,
            String fullMessageText) {
            String fullMessageText, int priority, boolean expectMore, int validityPeriod) {
        Rlog.e(TAG, "Error! Not implemented for IMS.");
        Rlog.e(TAG, "Error! Not implemented for IMS.");
        return null;
        return null;
    }
    }
+75 −17

File changed.

Preview size limit exceeded, changes collapsed.

+31 −0
Original line number Original line Diff line number Diff line
@@ -159,6 +159,21 @@ public class UiccSmsController extends ISms.Stub {
        }
        }
    }
    }


    @Override
    public void sendTextForSubscriberWithOptions(int subId, String callingPackage,
            String destAddr, String scAddr, String parts, PendingIntent sentIntents,
            PendingIntent deliveryIntents, boolean persistMessage, int priority,
            boolean expectMore, int validityPeriod) {
        IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId);
        if (iccSmsIntMgr != null ) {
            iccSmsIntMgr.sendTextWithOptions(callingPackage, destAddr, scAddr, parts, sentIntents,
                    deliveryIntents, persistMessage,  priority, expectMore, validityPeriod);
        } else {
            Rlog.e(LOG_TAG,"sendTextWithOptions iccSmsIntMgr is null for" +
                          " Subscription: " + subId);
        }
    }

    public void sendMultipartText(String callingPackage, String destAddr, String scAddr,
    public void sendMultipartText(String callingPackage, String destAddr, String scAddr,
            List<String> parts, List<PendingIntent> sentIntents,
            List<String> parts, List<PendingIntent> sentIntents,
            List<PendingIntent> deliveryIntents) throws android.os.RemoteException {
            List<PendingIntent> deliveryIntents) throws android.os.RemoteException {
@@ -183,6 +198,22 @@ public class UiccSmsController extends ISms.Stub {
        }
        }
    }
    }


    @Override
    public void sendMultipartTextForSubscriberWithOptions(int subId, String callingPackage,
            String destAddr, String scAddr, List<String> parts, List<PendingIntent> sentIntents,
            List<PendingIntent> deliveryIntents, boolean persistMessage, int priority,
            boolean expectMore, int validityPeriod) {
        IccSmsInterfaceManager iccSmsIntMgr = getIccSmsInterfaceManager(subId);
        if (iccSmsIntMgr != null ) {
            iccSmsIntMgr.sendMultipartTextWithOptions(callingPackage, destAddr, scAddr, parts,
                    sentIntents, deliveryIntents, persistMessage,  priority, expectMore,
                    validityPeriod);
        } else {
            Rlog.e(LOG_TAG,"sendMultipartTextWithOptions iccSmsIntMgr is null for" +
                          " Subscription: " + subId);
        }
    }

    @Override
    @Override
    public boolean enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)
    public boolean enableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)
                throws android.os.RemoteException {
                throws android.os.RemoteException {
+9 −8
Original line number Original line Diff line number Diff line
@@ -113,7 +113,7 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
        if (pdu != null) {
        if (pdu != null) {
            HashMap map = getSmsTrackerMap(destAddr, scAddr, destPort, data, pdu);
            HashMap map = getSmsTrackerMap(destAddr, scAddr, destPort, data, pdu);
            SmsTracker tracker = getSmsTracker(map, sentIntent, deliveryIntent, getFormat(),
            SmsTracker tracker = getSmsTracker(map, sentIntent, deliveryIntent, getFormat(),
                    null /*messageUri*/, false /*isExpectMore*/, null /*fullMessageText*/,
                    null /*messageUri*/, false /*expectMore*/, null /*fullMessageText*/,
                    false /*isText*/, true /*persistMessage*/);
                    false /*isText*/, true /*persistMessage*/);


            String carrierPackage = getCarrierAppPackageName();
            String carrierPackage = getCarrierAppPackageName();
@@ -141,13 +141,14 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
    @Override
    @Override
    public void sendText(String destAddr, String scAddr, String text, PendingIntent sentIntent,
    public void sendText(String destAddr, String scAddr, String text, PendingIntent sentIntent,
            PendingIntent deliveryIntent, Uri messageUri, String callingPkg,
            PendingIntent deliveryIntent, Uri messageUri, String callingPkg,
            boolean persistMessage) {
            boolean persistMessage, int priority, boolean expectMore, int validityPeriod) {
        SmsMessage.SubmitPdu pdu = SmsMessage.getSubmitPdu(
        SmsMessage.SubmitPdu pdu = SmsMessage.getSubmitPdu(
                scAddr, destAddr, text, (deliveryIntent != null), null);
                scAddr, destAddr, text, (deliveryIntent != null), null, priority);
        if (pdu != null) {
        if (pdu != null) {
            HashMap map = getSmsTrackerMap(destAddr, scAddr, text, pdu);
            HashMap map = getSmsTrackerMap(destAddr, scAddr, text, pdu);
            SmsTracker tracker = getSmsTracker(map, sentIntent, deliveryIntent, getFormat(),
            SmsTracker tracker = getSmsTracker(map, sentIntent, deliveryIntent, getFormat(),
                    messageUri, false /*isExpectMore*/, text, true /*isText*/, persistMessage);
                    messageUri, expectMore, text, true /*isText*/, persistMessage,
                    priority, validityPeriod);


            String carrierPackage = getCarrierAppPackageName();
            String carrierPackage = getCarrierAppPackageName();
            if (carrierPackage != null) {
            if (carrierPackage != null) {
@@ -189,7 +190,7 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
            String message, SmsHeader smsHeader, int encoding,
            String message, SmsHeader smsHeader, int encoding,
            PendingIntent sentIntent, PendingIntent deliveryIntent, boolean lastPart,
            PendingIntent sentIntent, PendingIntent deliveryIntent, boolean lastPart,
            AtomicInteger unsentPartCount, AtomicBoolean anyPartFailed, Uri messageUri,
            AtomicInteger unsentPartCount, AtomicBoolean anyPartFailed, Uri messageUri,
            String fullMessageText) {
            String fullMessageText, int priority, boolean expectMore, int validityPeriod) {
        UserData uData = new UserData();
        UserData uData = new UserData();
        uData.payloadStr = message;
        uData.payloadStr = message;
        uData.userDataHeader = smsHeader;
        uData.userDataHeader = smsHeader;
@@ -205,14 +206,14 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
         * callback to the sender when that last fragment delivery
         * callback to the sender when that last fragment delivery
         * has been acknowledged. */
         * has been acknowledged. */
        SmsMessage.SubmitPdu submitPdu = SmsMessage.getSubmitPdu(destinationAddress,
        SmsMessage.SubmitPdu submitPdu = SmsMessage.getSubmitPdu(destinationAddress,
                uData, (deliveryIntent != null) && lastPart);
                uData, (deliveryIntent != null) && lastPart, priority);


        HashMap map = getSmsTrackerMap(destinationAddress, scAddress,
        HashMap map = getSmsTrackerMap(destinationAddress, scAddress,
                message, submitPdu);
                message, submitPdu);
        return getSmsTracker(map, sentIntent, deliveryIntent,
        return getSmsTracker(map, sentIntent, deliveryIntent,
                getFormat(), unsentPartCount, anyPartFailed, messageUri, smsHeader,
                getFormat(), unsentPartCount, anyPartFailed, messageUri, smsHeader,
                false /*isExpextMore*/, fullMessageText, true /*isText*/,
                (!lastPart || expectMore), fullMessageText, true /*isText*/,
                true /*persistMessage*/);
                true /*persistMessage*/, priority, validityPeriod);
    }
    }


    @Override
    @Override
Loading