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

Commit 7a55a6e1 authored by Muhammed Siju's avatar Muhammed Siju Committed by Gerrit - the friendly Code Review server
Browse files

Fix DDS switch issue from GSM to CDMA.

CDMA data remains in attached state irrespective of ALLOW_DATA
true/false requests. Hence when switching DDS from G to C, there
won't be any attached event on C subscription and
DcSwitchStateMachine remains in Attaching state.
To fix this, directly move from Attaching to Attached state if
data is already registered.

Change DDS switch implementation to set the new DDS setting
only after DctController completes switch operation.

Remove extra setDataAllowed call from DcSwitchStateMachine
Attaching state.

Change-Id: I4ee3ca59e874c6ac2de8d46d3e5f9358d9cf0b0d
CRs-Fixed: 812478
parent a78157b1
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -1428,7 +1428,9 @@ public class SubscriptionController extends ISub.Stub {
            reqStatus = PhoneConstants.SUCCESS;
        }
        mScheduler.updateCurrentDds(null);
        broadcastDefaultDataSubIdChanged(reqStatus);
        broadcastDefaultDataSubIdChanged(subId);

        updateAllDataConnectionTrackers();
    }

    public void setDefaultDataSubId(int subId) {
@@ -1442,13 +1444,6 @@ public class SubscriptionController extends ISub.Stub {
                    EVENT_SET_DEFAULT_DATA_DONE, null);
        }
        mDctController.setDefaultDataSubId(subId);

        Settings.Global.putInt(mContext.getContentResolver(),
                Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION, subId);
        broadcastDefaultDataSubIdChanged(subId);

        // FIXME is this still needed?
        updateAllDataConnectionTrackers();
    }

    public void setDataSubId(int subId) {
+6 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.internal.telephony.SubscriptionController;
import android.os.Message;
import android.os.SystemProperties;
import android.telephony.Rlog;
import android.telephony.ServiceState;

public class DcSwitchStateMachine extends StateMachine {
    private static final boolean DBG = true;
@@ -149,6 +150,11 @@ public class DcSwitchStateMachine extends StateMachine {
        @Override
        public void enter() {
            log("AttachingState: enter");
            if (mPhone.getServiceState() != null &&
                    mPhone.getServiceState().getDataRegState() == ServiceState.STATE_IN_SERVICE) {
                log("AttachingState: Data already registered. Move to Attached");
                transitionTo(mAttachedState);
            }
        }

        @Override
@@ -161,9 +167,6 @@ public class DcSwitchStateMachine extends StateMachine {
                        log("AttachingState: REQ_CONNECT");
                    }

                    PhoneBase pb = (PhoneBase) ((PhoneProxy) mPhone).getActivePhone();
                    pb.mCi.setDataAllowed(true, null);

                    mAc.replyToMessage(msg, DcSwitchAsyncChannel.RSP_CONNECT,
                            PhoneConstants.APN_REQUEST_STARTED);
                    retVal = HANDLED;