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

Commit b499e012 authored by Steve Kondik's avatar Steve Kondik
Browse files

telephony: Fixes for SMS middleware

 * Update for API changes with data messages and priority.

Change-Id: Ica950731667bb8d79d966e8c00a4f0bafeb3e8bb
parent 540271f3
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -228,6 +228,55 @@ public class IccSmsInterfaceManagerProxy extends ISms.Stub {
                -1);
    }

    @Override
    public void sendTextWithOptions(String callingPackage, String destAddr, String scAddr,
            String text, PendingIntent sentIntent, PendingIntent deliveryIntent, int priority) {
        mContext.enforceCallingPermission(
                android.Manifest.permission.SEND_SMS,
                "Sending SMS message");
        if (mIccSmsInterfaceManager.isShortSMSCode(destAddr)) {
            mIccSmsInterfaceManager.sendTextWithOptions(callingPackage, destAddr, scAddr, text,
                    sentIntent, deliveryIntent, priority);
            return;
        }
        ArrayList<String> parts = new ArrayList<String>();
        parts.add(text);
        ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>();
        sentIntents.add(sentIntent);
        ArrayList<PendingIntent> deliveryIntents = new ArrayList<PendingIntent>();
        deliveryIntents.add(deliveryIntent);
        broadcastOutgoingSms(callingPackage, destAddr, scAddr, false, parts, sentIntents,
                deliveryIntents, priority);
    }

    @Override
    public void sendMultipartTextWithOptions(String callingPackage, String destAddr, String scAddr,
            List<String> parts, List<PendingIntent> sentIntents,
            List<PendingIntent> deliveryIntents, int priority) {
        mContext.enforceCallingPermission(
                android.Manifest.permission.SEND_SMS,
                "Sending SMS message");
        if (mIccSmsInterfaceManager.isShortSMSCode(destAddr)) {
            mIccSmsInterfaceManager.sendMultipartTextWithOptions(callingPackage, destAddr, scAddr,
                    parts, sentIntents, deliveryIntents, priority);
            return;
        }
        broadcastOutgoingSms(callingPackage, destAddr, scAddr, true,
                parts != null ? new ArrayList<String>(parts) : null,
                sentIntents != null ? new ArrayList<PendingIntent>(sentIntents) : null,
                deliveryIntents != null ?  new ArrayList<PendingIntent>(deliveryIntents) : null,
                priority);
    }


    @Override
    public void sendDataWithOrigPort(String callingPackage, String destAddr, String scAddr,
            int destPort, int origPort, byte[] data, PendingIntent sentIntent,
            PendingIntent deliveryIntent) {
        mIccSmsInterfaceManager.sendDataWithOrigPort(callingPackage, destAddr, scAddr,
                destPort, origPort, data, sentIntent, deliveryIntent);
    }

    @Override
    public boolean enableCellBroadcast(int messageIdentifier) throws android.os.RemoteException {
        return mIccSmsInterfaceManager.enableCellBroadcast(messageIdentifier);
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ class RILRequest {

        if (RIL.RILJ_LOGD) Rlog.d(LOG_TAG, serialString() + "< "
            + RIL.requestToString(mRequest)
            + " error: " + ex + " ret=" + RIL.retToString(mRequest, ret));
            + " error: " + ex + " ret=" + ret);

        if (mResult != null) {
            AsyncResult.forMessage(mResult, ret, ex);
+3 −3
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ public abstract class SMSDispatcher extends Handler {
        if (mSmsPseudoMultipart) {
            // Send as individual messages as the combination of device and
            // carrier behavior may not process concatenated messages correctly.
            sendPseudoMultipartText(destAddr, scAddr, parts, sentIntents, deliveryIntents);
            sendPseudoMultipartText(destAddr, scAddr, parts, sentIntents, deliveryIntents, priority);
            return;
        }

@@ -651,7 +651,7 @@ public abstract class SMSDispatcher extends Handler {
     */
    private void sendPseudoMultipartText(String destAddr, String scAddr,
            ArrayList<String> parts, ArrayList<PendingIntent> sentIntents,
            ArrayList<PendingIntent> deliveryIntents) {
            ArrayList<PendingIntent> deliveryIntents, int priority) {
        int msgCount = parts.size();

        mRemainingMessages = msgCount;
@@ -667,7 +667,7 @@ public abstract class SMSDispatcher extends Handler {
                deliveryIntent = deliveryIntents.get(i);
            }

            sendText(destAddr, scAddr, parts.get(i), sentIntent, deliveryIntent);
            sendText(destAddr, scAddr, parts.get(i), sentIntent, deliveryIntent, priority);
        }
    }