From 9ac95783fc5aab204077d7c81e17e1b4f8afb3c1 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Tue, 9 Jun 2009 21:09:06 -0700 Subject: Fix cleanupConnection when switching from wifi. Post a message for tearDown data connection when switching from wifi. --- .../android/internal/telephony/cdma/CdmaDataConnectionTracker.java | 5 ++++- .../com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java index 900480f..42f8fac 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java @@ -304,7 +304,10 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { sendMessage(obtainMessage(EVENT_TRY_SETUP_DATA)); } else if (!enable) { setEnabled(EXTERNAL_NETWORK_DEFAULT_ID, false); - cleanUpConnection(true, Phone.REASON_DATA_DISABLED); + Message msg = obtainMessage(EVENT_CLEAN_UP_CONNECTION); + msg.arg1 = 1; // tearDown is true + msg.obj = Phone.REASON_DATA_DISABLED; + sendMessage(msg); } return true; } diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index 3f43502..270f78b 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -487,7 +487,10 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { (isApnTypeActive(Phone.APN_TYPE_SUPL) && isEnabled(Phone.APN_TYPE_SUPL))) { return false; } - cleanUpConnection(true, Phone.REASON_DATA_DISABLED); + Message msg = obtainMessage(EVENT_CLEAN_UP_CONNECTION); + msg.arg1 = 1; // tearDown is true + msg.obj = Phone.REASON_DATA_DISABLED; + sendMessage(msg); return true; } else { // isEnabled && enable -- cgit v1.1