diff --git a/res/values/config.xml b/res/values/config.xml
index 6148e5e..311a104 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -7,4 +7,8 @@
         <item>310120</item>
         <item>311480</item>
     </string-array>
+
+    <!-- The preferred APN to use, in the format name,mcc,mnc
+         Leave empty to choose automatically. -->
+    <string name="config_preferred_apn"></string>
 </resources>
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index d2f560f..de1e100 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -383,6 +383,24 @@
             }
         }
 
+        private int getDefaultPreferredApnId(SQLiteDatabase db) {
+            int id = -1;
+            String configPref = mContext.getResources().getString(R.string.config_preferred_apn, "");
+            if (!TextUtils.isEmpty(configPref)) {
+                String[] s = configPref.split(",");
+                if (s.length == 3) {
+                    Cursor c = db.query("carriers", new String[] { "_id" },
+                            "apn='" + s[0] + "' AND mcc='" + s[1] + "' AND mnc='" + s[2] + "'",
+                            null, null, null, null);
+                    if (c.moveToFirst()) {
+                        id = c.getInt(0);
+                    }
+                    c.close();
+                }
+            }
+            return id;
+        }
+
         /**
          *  This function adds APNs from xml file(s) to db. The db may or may not be empty to begin
          *  with.
@@ -1522,8 +1540,8 @@
                 Context.MODE_PRIVATE);
         long apnId = sp.getLong(COLUMN_APN_ID + subId, INVALID_APN_ID);
         if (apnId == INVALID_APN_ID && checkApnSp) {
-            apnId = getPreferredApnIdFromApn(subId);
-            if (apnId != INVALID_APN_ID) {
+            apnId = getDefaultPreferredApnId();
+            if (apnId > INVALID_APN_ID) {
                 setPreferredApnId(apnId, subId);
                 deletePreferredApn(subId);
             }
@@ -1531,6 +1549,25 @@
         return apnId;
     }
 
+    private long getDefaultPreferredApnId() {
+        long id = -1;
+        String configPref = getContext().getResources().getString(R.string.config_preferred_apn, "");
+        if (!TextUtils.isEmpty(configPref)) {
+            String[] s = configPref.split(",");
+            if (s.length == 3) {
+                Cursor c = mOpenHelper.getReadableDatabase().query("carriers", new String[] { "_id" },
+                        "apn='" + s[0] + "' AND mcc='" + s[1] + "' AND mnc='" + s[2] + "'",
+                        null, null, null, null);
+                if (c.moveToFirst()) {
+                    id = c.getLong(0);
+                }
+                c.close();
+            }
+        }
+        Log.d(TAG, "Preferred APN: " + id);
+        return id;
+    }
+
     private void deletePreferredApnId() {
         SharedPreferences sp = getContext().getSharedPreferences(PREF_FILE_APN,
                 Context.MODE_PRIVATE);
@@ -2270,6 +2307,7 @@
         }
         setPreferredApnId((long) INVALID_APN_ID, subId);
         mOpenHelper.initDatabase(db);
+        setPreferredApnId(getDefaultPreferredApnId(), subId);
     }
 
     private synchronized void updateApnDb() {
