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

Commit fe1fdf59 authored by Youming Ye's avatar Youming Ye Committed by Gerrit Code Review
Browse files

Merge "Check data connection status on non-DDS SUB clearly"

parents bfa913f2 0a311cbc
Loading
Loading
Loading
Loading
+7 −14
Original line number Original line Diff line number Diff line
@@ -4026,15 +4026,10 @@ public class ServiceStateTracker extends Handler {
    public void powerOffRadioSafely(DcTracker dcTracker) {
    public void powerOffRadioSafely(DcTracker dcTracker) {
        synchronized (this) {
        synchronized (this) {
            if (!mPendingRadioPowerOffAfterDataOff) {
            if (!mPendingRadioPowerOffAfterDataOff) {
                int dds = SubscriptionManager.getDefaultDataSubscriptionId();
                // To minimize race conditions we call cleanUpAllConnections on
                // To minimize race conditions we call cleanUpAllConnections on
                // both if else paths instead of before this isDisconnected test.
                // both if else paths instead of before this isDisconnected test.
                if (dcTracker.isDisconnected()
                if (dcTracker.isDisconnected()) {
                        && (dds == mPhone.getSubId()
                        || (dds != mPhone.getSubId()
                        && ProxyController.getInstance().isDataDisconnected(dds)))) {
                    // To minimize race conditions we do this after isDisconnected
                    // To minimize race conditions we do this after isDisconnected
                    dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);
                    if (DBG) log("Data disconnected, turn off radio right away.");
                    if (DBG) log("Data disconnected, turn off radio right away.");
                    hangupAndPowerOff();
                    hangupAndPowerOff();
                } else {
                } else {
@@ -4044,14 +4039,12 @@ public class ServiceStateTracker extends Handler {
                        mPhone.mCT.mBackgroundCall.hangupIfAlive();
                        mPhone.mCT.mBackgroundCall.hangupIfAlive();
                        mPhone.mCT.mForegroundCall.hangupIfAlive();
                        mPhone.mCT.mForegroundCall.hangupIfAlive();
                    }
                    }
                    if (!ProxyController.getInstance().isDataDisconnected(mPhone.getSubId())) {
                    if (DBG) log("Wait for all data disconnect");
                    if (DBG) log("Wait for all data disconnect");
                    // Data is not disconnected. Wait for the data disconnect complete
                    // Data is not disconnected. Wait for the data disconnect complete
                    // before sending the RADIO_POWER off.
                    // before sending the RADIO_POWER off.
                    ProxyController.getInstance().registerForAllDataDisconnected(
                    ProxyController.getInstance().registerForAllDataDisconnected(
                            mPhone.getSubId(), this, EVENT_ALL_DATA_DISCONNECTED, null);
                            mPhone.getSubId(), this, EVENT_ALL_DATA_DISCONNECTED, null);
                    mPendingRadioPowerOffAfterDataOff = true;
                    mPendingRadioPowerOffAfterDataOff = true;
                    }
                    dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);
                    dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);


                    Message msg = Message.obtain(this);
                    Message msg = Message.obtain(this);