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

Commit 0a311cbc authored by Mengjun Leng's avatar Mengjun Leng Committed by Youming Ye
Browse files

Check data connection status on non-DDS SUB clearly

Ensure making power off in time when data is disconnected.

Change-Id: I7c620245bfae53bbbffcc089d9c5506440b21f41
Bug: 117711320
parent 32fc8a91
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -4021,15 +4021,10 @@ public class ServiceStateTracker extends Handler {
    public void powerOffRadioSafely(DcTracker dcTracker) {
        synchronized (this) {
            if (!mPendingRadioPowerOffAfterDataOff) {
                int dds = SubscriptionManager.getDefaultDataSubscriptionId();
                // To minimize race conditions we call cleanUpAllConnections on
                // both if else paths instead of before this isDisconnected test.
                if (dcTracker.isDisconnected()
                        && (dds == mPhone.getSubId()
                        || (dds != mPhone.getSubId()
                        && ProxyController.getInstance().isDataDisconnected(dds)))) {
                if (dcTracker.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.");
                    hangupAndPowerOff();
                } else {
@@ -4039,14 +4034,12 @@ public class ServiceStateTracker extends Handler {
                        mPhone.mCT.mBackgroundCall.hangupIfAlive();
                        mPhone.mCT.mForegroundCall.hangupIfAlive();
                    }
                    if (!ProxyController.getInstance().isDataDisconnected(mPhone.getSubId())) {
                    if (DBG) log("Wait for all data disconnect");
                    // Data is not disconnected. Wait for the data disconnect complete
                    // before sending the RADIO_POWER off.
                    ProxyController.getInstance().registerForAllDataDisconnected(
                            mPhone.getSubId(), this, EVENT_ALL_DATA_DISCONNECTED, null);
                    mPendingRadioPowerOffAfterDataOff = true;
                    }
                    dcTracker.cleanUpAllConnections(Phone.REASON_RADIO_TURNED_OFF);

                    Message msg = Message.obtain(this);