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

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

Merge change 1831 into donut

* changes:
  Tear down data, if a disconnect request is pending.
parents 935fd37d caed8208
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -95,9 +95,7 @@ public class PdpConnection extends DataConnection {
                apn.password, obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE));
    }

    protected void disconnect(Message msg) {
        onDisconnect = msg;
        if (state == State.ACTIVE) {
    private void tearDownData(Message msg) {
        if (dataLink != null) {
            dataLink.disconnect();
        }
@@ -105,6 +103,12 @@ public class PdpConnection extends DataConnection {
        if (phone.mCM.getRadioState().isOn()) {
            phone.mCM.deactivateDataCall(cid, obtainMessage(EVENT_DEACTIVATE_DONE, msg));
        }
    }

    protected void disconnect(Message msg) {
        onDisconnect = msg;
        if (state == State.ACTIVE) {
            tearDownData(msg);
        } else if (state == State.ACTIVATING) {
            receivedDisconnectReq = true;
        } else {
@@ -243,7 +247,7 @@ public class PdpConnection extends DataConnection {
                // Don't bother reporting success if there's already a
                // pending disconnect request, since DataConnectionTracker
                // has already updated its state.
                disconnect(onDisconnect);
                tearDownData(onDisconnect);
            } else {
                String[] response = ((String[]) ar.result);
                cid = Integer.parseInt(response[0]);