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

Commit 8bfa071f authored by Muhammed Siju's avatar Muhammed Siju Committed by Steve Kondik
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.

CRs-Fixed:  564063, 641116
Change-Id: I57c445ee28be4e1c0f2934cb136a70d39447511c
parent 678bc879
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -341,6 +341,8 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
            ((mNewSS.getRilDataRadioTechnology() >= ServiceState.RIL_RADIO_TECHNOLOGY_IS95A) &&
             (mNewSS.getRilDataRadioTechnology() <= ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_A));

        boolean needNotifyData = (mSS.getCssIndicator() != mNewSS.getCssIndicator());

        if (DBG) {
            log("pollStateDone:"
                + " hasRegistered=" + hasRegistered
@@ -493,6 +495,10 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {

        if ((hasCdmaDataConnectionChanged || hasDataRadioTechnologyChanged)) {
            notifyDataRegStateRilRadioTechnologyChanged();
            needNotifyData = true;
        }

        if (needNotifyData) {
            mPhone.notifyDataConnection(null);
        }

+18 −2
Original line number Diff line number Diff line
@@ -697,6 +697,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]);
@@ -713,6 +714,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                                    type = Integer.parseInt(states[3]);
                                }
                            }
                            if (states.length >= 7 && (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);
@@ -726,6 +730,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                    mGsmRoaming = regCodeIsRoaming(regState);
                    mNewSS.setState(regCodeToServiceState(regState));
                    mNewSS.setRilVoiceRadioTechnology(type);
                    mNewSS.setCssIndicator(cssIndicator);

                    boolean isVoiceCapable = mPhoneBase.getContext().getResources()
                            .getBoolean(com.android.internal.R.bool.config_voice_capable);
@@ -952,6 +957,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker {

        boolean hasLocationChanged = !mNewCellLoc.equals(mCellLoc);

        boolean needNotifyData = (mSS.getCssIndicator() != mNewSS.getCssIndicator());

        // Add an event log when connection state changes
        if (hasVoiceRegStateChanged || hasDataRegStateChanged) {
            EventLog.writeEvent(EventLogTags.GSM_SERVICE_STATE_CHANGE,
@@ -1163,6 +1170,10 @@ final class GsmServiceStateTracker extends ServiceStateTracker {

        if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) {
            notifyDataRegStateRilRadioTechnologyChanged();
            needNotifyData = true;
        }

        if (needNotifyData) {
            mPhone.notifyDataConnection(null);
        }

@@ -1483,11 +1494,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.getRilDataRadioTechnology() >= ServiceState.RIL_RADIO_TECHNOLOGY_UMTS);
        if (mSS.getRilDataRadioTechnology() >= ServiceState.RIL_RADIO_TECHNOLOGY_UMTS) {
            return true;
        } else {
            return mSS.getCssIndicator() == 1;
        }
    }

    /**