diff options
author | Kenny Root <kroot@google.com> | 2012-05-11 10:02:36 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-05-11 12:18:55 -0700 |
commit | 6a6656641c58fd4396c011639dbc02a58636294f (patch) | |
tree | eb8efa92dfc3d09c2c7029ee7a2108729d5e8ecc | |
parent | e508dc25f2d3168f37fe5963fc99b0a034a3a298 (diff) | |
download | packages_apps_Settings-6a6656641c58fd4396c011639dbc02a58636294f.zip packages_apps_Settings-6a6656641c58fd4396c011639dbc02a58636294f.tar.gz packages_apps_Settings-6a6656641c58fd4396c011639dbc02a58636294f.tar.bz2 |
Strip off phase2 prefix when setting spinner
The writing and reading code for phase2 settings were asymmetric so the
phase2 spinner would always be set as "None". This change strips off the
prefix to set the spinner.
Bug: 6482316
Change-Id: Iaaa1088ec22625f1b8e3974c8a9610cccf0dda90
-rw-r--r-- | src/com/android/settings/wifi/WifiConfigController.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java index 5f2040a..45d070a 100644 --- a/src/com/android/settings/wifi/WifiConfigController.java +++ b/src/com/android/settings/wifi/WifiConfigController.java @@ -65,6 +65,8 @@ public class WifiConfigController implements TextWatcher, View.OnClickListener, AdapterView.OnItemSelectedListener { private static final String KEYSTORE_SPACE = WifiConfiguration.KEYSTORE_URI; + private static final String PHASE2_PREFIX = "auth="; + private final WifiConfigUiBase mConfigUi; private final View mView; private final AccessPoint mAccessPoint; @@ -357,7 +359,7 @@ public class WifiConfigController implements TextWatcher, config.eap.setValue((String) mEapMethodSpinner.getSelectedItem()); config.phase2.setValue((mPhase2Spinner.getSelectedItemPosition() == 0) ? "" : - "auth=" + mPhase2Spinner.getSelectedItem()); + PHASE2_PREFIX + mPhase2Spinner.getSelectedItem()); config.ca_cert.setValue((mEapCaCertSpinner.getSelectedItemPosition() == 0) ? "" : KEYSTORE_SPACE + Credentials.CA_CERTIFICATE + (String) mEapCaCertSpinner.getSelectedItem()); @@ -547,7 +549,14 @@ public class WifiConfigController implements TextWatcher, if (mAccessPoint != null && mAccessPoint.networkId != INVALID_NETWORK_ID) { WifiConfiguration config = mAccessPoint.getConfig(); setSelection(mEapMethodSpinner, config.eap.value()); - setSelection(mPhase2Spinner, config.phase2.value()); + + final String phase2Method = config.phase2.value(); + if (phase2Method != null && phase2Method.startsWith(PHASE2_PREFIX)) { + setSelection(mPhase2Spinner, phase2Method.substring(PHASE2_PREFIX.length())); + } else { + setSelection(mPhase2Spinner, phase2Method); + } + setCertificate(mEapCaCertSpinner, KEYSTORE_SPACE + Credentials.CA_CERTIFICATE, config.ca_cert.value()); setCertificate(mEapUserCertSpinner, Credentials.USER_PRIVATE_KEY, |