diff options
author | jianzhou <jianzhou@codeaurora.org> | 2014-06-15 07:11:29 -0400 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:21:14 -0600 |
commit | 6b7afc7053da9e1b451eecd3ff7aca37d697d96f (patch) | |
tree | fbdf4c82cf4bda80b1df58daf3614eb0330efd32 /src/com/android | |
parent | e0d320fbc18e45d05796db670a12e84d35ab8185 (diff) | |
download | packages_apps_Settings-6b7afc7053da9e1b451eecd3ff7aca37d697d96f.zip packages_apps_Settings-6b7afc7053da9e1b451eecd3ff7aca37d697d96f.tar.gz packages_apps_Settings-6b7afc7053da9e1b451eecd3ff7aca37d697d96f.tar.bz2 |
Settings: Fix no preferred APN
Add preferred APN if found no match.
CRs-Fixed: 748830
Change-Id: Ibecf88a3e6236de13a0a4291438a6e62159a05e0
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/ApnSettings.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java index cd4ec22..b00ba56 100644 --- a/src/com/android/settings/ApnSettings.java +++ b/src/com/android/settings/ApnSettings.java @@ -223,6 +223,7 @@ public class ApnSettings extends SettingsPreferenceFragment implements } private void fillList() { + boolean isSelectedKeyMatch = false; final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); final String mccmnc = mSubscriptionInfo == null ? "" : tm.getSimOperator(mSubscriptionInfo.getSubscriptionId()); @@ -274,6 +275,8 @@ public class ApnSettings extends SettingsPreferenceFragment implements if (selectable) { if ((mSelectedKey != null) && mSelectedKey.equals(key)) { pref.setChecked(); + isSelectedKeyMatch = true; + Log.d(TAG, "find select key = " + mSelectedKey); } addApnToList(pref, mnoApnList, mvnoApnList, r, mvnoType, mvnoMatchData); } else { @@ -293,6 +296,15 @@ public class ApnSettings extends SettingsPreferenceFragment implements for (Preference preference : mnoApnList) { apnList.addPreference(preference); } + + //if find no selectedKey, set the first one as selected key + if (!isSelectedKeyMatch && apnList.getPreferenceCount() > 0) { + ApnPreference pref = (ApnPreference) apnList.getPreference(0); + pref.setChecked(); + setSelectedApnKey(pref.getKey()); + Log.d(TAG, "set key to " +pref.getKey()); + } + for (Preference preference : mnoMmsApnList) { apnList.addPreference(preference); } |