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

Commit 6e81a40d authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 26286 into eclair

* changes:
  Resolve race conditions with disconnect of CDMA data and airplane mode
parents a7719af3 e4e8e4d4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -538,12 +538,15 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
                if (!mPendingRadioPowerOffAfterDataOff) {
                    DataConnectionTracker.State currentState = dcTracker.getState();
                    if (currentState != DataConnectionTracker.State.CONNECTED
                            && currentState != DataConnectionTracker.State.DISCONNECTING) {
                            && currentState != DataConnectionTracker.State.DISCONNECTING
                            && currentState != DataConnectionTracker.State.INITING) {
                        if (DBG) log("Data disconnected, turn off radio right away.");
                        cm.setRadioPower(false, null);
                    }
                    else if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 5000)) {
                        if (DBG) log("Wait 5 sec for data to be disconnected, then turn off radio.");
                    else if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) {
                        if (DBG) {
                            log("Wait up to 30 sec for data to disconnect, then turn off radio.");
                        }
                        mPendingRadioPowerOffAfterDataOff = true;
                    } else {
                        Log.w(LOG_TAG, "Cannot send delayed Msg, turn off radio right away.");