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

Commit 725ca8df authored by Sukanya Rajkhowa's avatar Sukanya Rajkhowa Committed by Linux Build Service Account
Browse files

Add Dual Transfer Mode support.

- In GsmServiceStateTracker, decode the "concurrent services support
indicator" field from RIL_REQUEST_VOICE_REGISTRATION_STATE
request and based on the value of this CSSI field allow concurrent
CS and PS services to applications.

- Notify data connection changed on CSS indicator update.

- When the phone moves from a DTM cell to a non DTM cell while in
active voice call, data connection is not suspended.
To fix this, consider CSS indicator change also for notifying
data connection.

- To determine concurrent voice and data support
we need to query Data Radio Tech

CRs-Fixed:  564063, 641116

Change-Id: I57c445ee28be4e1c0f2934cb136a70d39447511c
parent 2bc3175d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ public interface Phone {
    static final String REASON_SIM_NOT_READY = "simNotReady";
    static final String REASON_IWLAN_AVAILABLE = "iwlanAvailable";
    static final String REASON_CARRIER_CHANGE = "carrierChange";
    static final String REASON_CSS_INDICATOR_CHANGED = "cssIndicatorChanged";

    // Used for band mode selection methods
    static final int BM_UNSPECIFIED = 0; // selected by baseband automatically
+5 −0
Original line number Diff line number Diff line
@@ -354,6 +354,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {

        boolean hasLocationChanged = !mNewCellLoc.equals(mCellLoc);

        boolean hasCssIndicatorChanged = (mSS.getCssIndicator() != mNewSS.getCssIndicator());
        boolean has4gHandoff =
                mNewSS.getDataRegState() == ServiceState.STATE_IN_SERVICE &&
                (((mSS.getRilDataRadioTechnology() == ServiceState.RIL_RADIO_TECHNOLOGY_LTE) &&
@@ -571,6 +572,10 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
            mPhone.notifyLocationChanged();
        }

        if (hasCssIndicatorChanged) {
            mPhone.notifyDataConnection(Phone.REASON_CSS_INDICATOR_CHANGED);
        }

        ArrayList<CellInfo> arrayCi = new ArrayList<CellInfo>();
        synchronized(mCellInfo) {
            CellInfoLte cil = (CellInfoLte)mCellInfo;
+18 −2
Original line number Diff line number Diff line
@@ -730,6 +730,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                    int regState = ServiceState.RIL_REG_STATE_UNKNOWN;
                    int reasonRegStateDenied = -1;
                    int psc = -1;
                    int cssIndicator = 0;
                    if (states.length > 0) {
                        try {
                            regState = Integer.parseInt(states[0]);
@@ -746,6 +747,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                                    type = Integer.parseInt(states[3]);
                                }
                            }
                            if (states.length >= 8 && (states[7] != null)) {
                                cssIndicator = Integer.parseInt(states[7]);
                            }
                            if (states.length > 14) {
                                if (states[14] != null && states[14].length() > 0) {
                                    psc = Integer.parseInt(states[14], 16);
@@ -759,6 +763,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                    mGsmRoaming = regCodeIsRoaming(regState);
                    mNewSS.setState(regCodeToServiceState(regState));
                    mNewSS.setRilVoiceRadioTechnology(type);
                    mNewSS.setCssIndicator(cssIndicator);

                    if ((regState == ServiceState.RIL_REG_STATE_DENIED
                            || regState == ServiceState.RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED)
@@ -1103,6 +1108,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
        boolean hasDataRoamingOff = mSS.getDataRoaming() && !mNewSS.getDataRoaming();

        boolean hasLocationChanged = !mNewCellLoc.equals(mCellLoc);

        boolean hasCssIndicatorChanged = (mSS.getCssIndicator() != mNewSS.getCssIndicator());
        TelephonyManager tm =
                (TelephonyManager) mPhone.getContext().getSystemService(Context.TELEPHONY_SERVICE);

@@ -1355,6 +1362,10 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
            mPhone.notifyLocationChanged();
        }

        if (hasCssIndicatorChanged) {
            mPhone.notifyDataConnection(Phone.REASON_CSS_INDICATOR_CHANGED);
        }

        if (! isGprsConsistent(mSS.getDataRegState(), mSS.getVoiceRegState())) {
            if (!mStartedGprsRegCheck && !mReportedGprsNoReg) {
                mStartedGprsRegCheck = true;
@@ -1663,11 +1674,16 @@ final class GsmServiceStateTracker extends ServiceStateTracker {

    /**
     * @return true if phone is camping on a technology (eg UMTS)
     * that could support voice and data simultaneously.
     * that could support voice and data simultaneously or
     * concurrent services support indicator is set to '1'.
     */
    @Override
    public boolean isConcurrentVoiceAndDataAllowed() {
        return (mSS.getRilVoiceRadioTechnology() >= ServiceState.RIL_RADIO_TECHNOLOGY_UMTS);
        if (mSS.getRilDataRadioTechnology() >= ServiceState.RIL_RADIO_TECHNOLOGY_UMTS) {
            return true;
        } else {
            return mSS.getCssIndicator() == 1;
        }
    }

    /**