diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2009-05-15 16:18:01 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2009-05-15 16:52:13 -0700 |
commit | caed8208bbcd3ba7226b49a4a40cf6d7d860746f (patch) | |
tree | e4f8502f61a0bdee3177d3cefcf6da7ecc0b1c59 /telephony | |
parent | b3c6addfc17be2a52133026148f3928ab97c83cb (diff) | |
download | frameworks_base-caed8208bbcd3ba7226b49a4a40cf6d7d860746f.zip frameworks_base-caed8208bbcd3ba7226b49a4a40cf6d7d860746f.tar.gz frameworks_base-caed8208bbcd3ba7226b49a4a40cf6d7d860746f.tar.bz2 |
Tear down data, if a disconnect request is pending.
If there is a pending disconnect, and the previous connection
attempt succeeds, we don't disconnect and hence the state remains
in DISCONNECTING. Ex: user is on Wifi, location app calls
enableApnType(SUPL) and then we set state to INITING. It then
calls disableApnType(SUPL) we register a pending disconnect.
When the data connection attempt is successful, we don't disconnect,
as the PDP Connection State has not been set to ACTIVE and we check
for this state. This fix removes the dependency on ACTIVE state check.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/PdpConnection.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java b/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java index 88acb1b..3f794a8 100644 --- a/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java +++ b/telephony/java/com/android/internal/telephony/gsm/PdpConnection.java @@ -95,16 +95,20 @@ public class PdpConnection extends DataConnection { apn.password, obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE)); } + private void tearDownData(Message msg) { + if (dataLink != null) { + dataLink.disconnect(); + } + + 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) { - if (dataLink != null) { - dataLink.disconnect(); - } - - if (phone.mCM.getRadioState().isOn()) { - phone.mCM.deactivateDataCall(cid, obtainMessage(EVENT_DEACTIVATE_DONE, msg)); - } + 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]); |