Allow only NT_MODE_GSM_ONLY or NT_MODE_WCDMA_PREF

Bug: 5771503
Change-Id: Ic69440d6dd32358182a5658039c702649ae60315
diff --git a/src/com/android/phone/Use2GOnlyCheckBoxPreference.java b/src/com/android/phone/Use2GOnlyCheckBoxPreference.java
index 1fa83a7..f3a3a95 100644
--- a/src/com/android/phone/Use2GOnlyCheckBoxPreference.java
+++ b/src/com/android/phone/Use2GOnlyCheckBoxPreference.java
@@ -84,6 +84,10 @@
 
             if (ar.exception == null) {
                 int type = ((int[])ar.result)[0];
+                if (type != Phone.NT_MODE_GSM_ONLY) {
+                    // Allow only NT_MODE_GSM_ONLY or NT_MODE_WCDMA_PREF
+                    type = Phone.NT_MODE_WCDMA_PREF;
+                }
                 Log.i(LOG_TAG, "get preferred network type="+type);
                 setChecked(type == Phone.NT_MODE_GSM_ONLY);
                 android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),