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

Commit 41e18a4c authored by Xia Ying's avatar Xia Ying Committed by Steve Kondik
Browse files

Send SMS over 1x when on eHRPD/LTE and active voice call

When UE is attached to eHRPD network  LTE network which not
allow data and voice concurrent, and IMS is registered:
- If there is an active 1x RTT voice call, send SMS over 1x
- If there no active 1xRTT voice call, send SMS over IMS

Bug: 17331507

Change-Id: I2647c1ccdbf5286445aa34925be0027b21f84a03
parent 991d14aa
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ import com.android.internal.telephony.SmsHeader;
import com.android.internal.telephony.SmsUsageMonitor;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.cdma.sms.UserData;
import com.android.internal.telephony.PhoneConstants;
import android.telephony.TelephonyManager;

import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -247,11 +249,19 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
        Message reply = obtainMessage(EVENT_SEND_SMS_COMPLETE, tracker);
        byte[] pdu = (byte[]) tracker.mData.get("pdu");

        int currentDataNetwork = mPhone.getServiceState().getDataNetworkType();
        boolean imsSmsDisabled = (currentDataNetwork == TelephonyManager.NETWORK_TYPE_EHRPD
                    || (currentDataNetwork == TelephonyManager.NETWORK_TYPE_LTE
                    && !mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()))
                    && mPhone.getServiceState().getVoiceNetworkType()
                    == TelephonyManager.NETWORK_TYPE_1xRTT
                    && mPhone.getState() != PhoneConstants.State.IDLE;

        // sms over cdma is used:
        //   if sms over IMS is not supported AND
        //   this is not a retry case after sms over IMS failed
        //     indicated by mImsRetry > 0
        if (0 == tracker.mImsRetry && !isIms()) {
        if (0 == tracker.mImsRetry && !isIms() || imsSmsDisabled) {
            mCi.sendCdmaSms(pdu, reply);
        }
        // If sending SMS over IMS is not enabled, send SMS over cdma. Simply