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

Commit c250178a authored by Nazish Tabassum's avatar Nazish Tabassum Committed by Sarah Chin
Browse files

CDMA MO SMS follow on DC feature

Add new API to send MO CDMA SMS with expectMore option.

Test: atest FrameworksTelephonyTests
Change-Id: I7c7601fb42995f8a5cb27870bb5d131e217d8d4a
Bug: 72613248
parent 3e0a3e2a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1186,6 +1186,8 @@ public interface CommandsInterface {
     */
    void sendCdmaSms(byte[] pdu, Message response);

    void sendCdmaSMSExpectMore(byte[] pdu, Message response);

    /**
     * send SMS over IMS with 3GPP/GSM SMS format
     * @param smscPDU is smsc address in PDU form GSM BCD format prefixed
+32 −0
Original line number Diff line number Diff line
@@ -3273,6 +3273,36 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    @Override
    public void sendCdmaSMSExpectMore(byte[] pdu, Message result) {
        if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
            IRadio radioProxy = getRadioProxy(result);
            // IRadio V1.5
            android.hardware.radio.V1_5.IRadio radioProxy15 =
                    (android.hardware.radio.V1_5.IRadio) radioProxy;
            if (radioProxy15 != null) {
                RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE, result,
                    mRILDefaultWorkSource);

                // Do not log function arg for privacy
                if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));

                CdmaSmsMessage msg = new CdmaSmsMessage();
                constructCdmaSendSmsRilRequest(msg, pdu);

                try {
                    radioProxy15.sendCdmaSmsExpectMore(rr.mSerial, msg);
                    mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_CDMA,
                        SmsSession.Event.Format.SMS_FORMAT_3GPP2);
                } catch (RemoteException | RuntimeException e) {
                    handleRadioProxyExceptionForRR(rr, "sendCdmaSMSExpectMore", e);
                }
            }
        } else {
            sendCdmaSms(pdu, result);
        }
    }

    @Override
    public void sendCdmaSms(byte[] pdu, Message result) {
        IRadio radioProxy = getRadioProxy(result);
@@ -5977,6 +6007,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
                return "RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT";
            case RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS:
                return "RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS";
            case RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE:
                return "RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE";
            default: return "<unknown request>";
        }
    }
+9 −0
Original line number Diff line number Diff line
@@ -918,6 +918,15 @@ public class RadioResponse extends IRadioResponse.Stub {
        responseSms(responseInfo, sms);
    }

    /**
     *
     * @param responseInfo Response info struct containing response type, serial no. and error
     * @param sms Sms result struct as defined by SendSmsResult in types.hal
     */
    public void sendCdmaSMSExpectMoreResponse(RadioResponseInfo responseInfo, SendSmsResult sms) {
        responseSms(responseInfo, sms);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
+5 −1
Original line number Diff line number Diff line
@@ -164,7 +164,11 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
        //   SMS over IMS is being handled by the ImsSmsDispatcher implementation and has indicated
        //   that the message should fall back to sending over CS.
        if (0 == tracker.mImsRetry && !isIms() || imsSmsDisabled || tracker.mUsesImsServiceForIms) {
            if (tracker.mRetryCount == 0 && tracker.mExpectMore) {
                mCi.sendCdmaSMSExpectMore(pdu,reply);
            } else {
                mCi.sendCdmaSms(pdu, reply);
            }
        } else {
            mCi.sendImsCdmaSms(pdu, tracker.mImsRetry, tracker.mMessageRef, reply);
            // increment it here, so in case of SMS_FAIL_RETRY over IMS
+4 −0
Original line number Diff line number Diff line
@@ -240,6 +240,10 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    public void sendCdmaSms(byte[] pdu, Message result) {
    }

    @Override
    public void sendCdmaSMSExpectMore(byte[] pdu, Message result) {
    }

    @Override
    public void sendImsGsmSms (String smscPDU, String pdu,
            int retry, int messageRef, Message response) {
Loading