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

Commit edb37773 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Telephony: Fix DcSwitchStateMachine hung issue."

parents ad01a690 6450d47d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.internal.telephony.SubscriptionController;
import android.os.AsyncResult;
import android.os.Message;
import android.telephony.Rlog;
import android.telephony.ServiceState;

public class DcSwitchStateMachine extends StateMachine {
    private static final boolean DBG = true;
@@ -298,6 +299,16 @@ public class DcSwitchStateMachine extends StateMachine {
                        } else {
                            logd("EVENT_DATA_ALLOWED success");
                            mResponseMsg = null;

                            /* If the data service state is IN_SERVICE then move to
                             * ATTACHED state.
                             */
                            int dataState = mPhone.getServiceState().getDataRegState();
                            if (dataState == ServiceState.STATE_IN_SERVICE) {
                                logd("AttachingState: Already attached, move to ATTACHED state");
                                transitionTo(mAttachedState);
                            }

                        }
                    }
                    retVal = HANDLED;
+0 −34
Original line number Diff line number Diff line
@@ -388,44 +388,10 @@ public class DctController extends Handler {
                RequestInfo requestInfo = mRequestInfos.get(iterator.next());
                if (getRequestPhoneId(requestInfo.request) == phoneId && !requestInfo.executed) {
                    mDcSwitchAsyncChannel[phoneId].connect(requestInfo);
                    Phone phone = mPhones[phoneId].getActivePhone();
                    if ((phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
                            && (activePhoneId == -1)) {
                        /* Traditionally modem reports data registered on CDMA sub even when it is
                         * non-dds because CDMA network does not have PS ATTACH/DETACH concept.
                         *
                         * So when CDMA sub becomes DDS from non-dds the state-machine is expacting
                         * onDataConnectionAttach() call from serviceStateTracker. It would never
                         * happen since cdma SST did not notice change in registration during DDS
                         * switch.
                         *
                         * Hence we need to fake the ATTACH to move/progress DcSwitchStateMachine.
                         */
                        logd("Active phone is CDMA, fake ATTACH");
                        mDcSwitchAsyncChannel[phoneId].notifyDataAttached();
                    }

                }
            }
        } else {
            Phone phone = mPhones[activePhoneId].getActivePhone();
            mDcSwitchAsyncChannel[activePhoneId].disconnectAll();
            if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
                /* Traditionally modem reports data registered on CDMA sub even when it is
                 * non-dds because CDMA network does not have PS ATTACH/DETACH concept.
                 *
                 * So when CDMA sub becomes non-dds from dds the state-machine is expacting
                 * onDataConnectionDetached() call from serviceStateTracker. It would never
                 * happen since cdma SST did not notice change in registration during DDS
                 * switch.
                 *
                 * Hence we need to fake the DETACH to move/progress DcSwitchStateMachine.
                 */

                logd("Active phone is CDMA, fake DETACH");
                mDcSwitchAsyncChannel[activePhoneId].notifyDataDetached();

            }
        }
    }