From 3ff47ff70406e6973226ac966d157a97fa8e9279 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Mon, 8 Oct 2012 12:31:28 -0700 Subject: Act on no-prefered-apn-on-connect config option. bug:7306353 Change-Id: Icf1c21cc8997821a7d50d114c8985728d9bdb02e --- .../internal/telephony/gsm/GsmDataConnectionTracker.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index ebb41fc..ec4bfff 100644 --- a/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -23,6 +23,7 @@ import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.res.Resources; import android.database.ContentObserver; import android.database.Cursor; import android.net.ConnectivityManager; @@ -2127,7 +2128,20 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { String operator = (r != null) ? r.getOperatorNumeric() : ""; int radioTech = mPhone.getServiceState().getRilRadioTechnology(); - if (canSetPreferApn && mPreferredApn != null && + // This is a workaround for a bug (7305641) where we don't failover to other + // suitable APNs if our preferred APN fails. On prepaid ATT sims we need to + // failover to a provisioning APN, but once we've used their default data + // connection we are locked to it for life. This change allows ATT devices + // to say they don't want to use preferred at all. + boolean usePreferred = true; + try { + usePreferred = ! mPhone.getContext().getResources().getBoolean(com.android. + internal.R.bool.config_dontPreferApn); + } catch (Resources.NotFoundException e) { + usePreferred = true; + } + + if (usePreferred && canSetPreferApn && mPreferredApn != null && mPreferredApn.canHandleType(requestedApnType)) { if (DBG) { log("buildWaitingApns: Preferred APN:" + operator + ":" -- cgit v1.1