From c0303921d028b4616010e96f66820fb0e9ab9254 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Mon, 29 Jun 2009 13:33:47 -0700 Subject: [PATCH] Fix setting of the APN type. The user is on wifi, then enables SUPL APN. When wifi is switched off, we try to establish DATA connection on the Default APN. If this fails, we were not retrying as the mRequestedApnType variable was not being reset. This was happening because the SUPL APN and the data connection APN were the same. --- .../internal/telephony/gsm/GsmDataConnectionTracker.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index 346944a340a4a..e00ee83c8345b 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -377,10 +377,14 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { removeMessages(EVENT_RESTORE_DEFAULT_APN); setEnabled(type, false); if (isApnTypeActive(Phone.APN_TYPE_DEFAULT)) { + mRequestedApnType = Phone.APN_TYPE_DEFAULT; if (dataEnabled[APN_DEFAULT_ID]) { return Phone.APN_ALREADY_ACTIVE; } else { - 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 Phone.APN_REQUEST_STARTED; } } else { @@ -1235,10 +1239,9 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { protected void onRestoreDefaultApn() { if (DBG) Log.d(LOG_TAG, "Restore default APN"); setEnabled(Phone.APN_TYPE_MMS, false); - + mRequestedApnType = Phone.APN_TYPE_DEFAULT; if (!isApnTypeActive(Phone.APN_TYPE_DEFAULT)) { cleanUpConnection(true, Phone.REASON_RESTORE_DEFAULT_APN); - mRequestedApnType = Phone.APN_TYPE_DEFAULT; } }