diff options
author | Irfan Sheriff <isheriff@android.com> | 2012-03-01 22:48:42 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-03-01 22:48:42 -0800 |
commit | c4bf8cd955e7a317c6d9c0eb023d5994be0f1e9d (patch) | |
tree | ad1aa69744dbe8a5d1322f3ea8240745efdebf8a | |
parent | 79ec613a66b71a16591bcd3bde5cb815f1a3d352 (diff) | |
parent | 2f76aaaf0105add942334ef3574e7378ee8a6097 (diff) | |
download | packages_apps_Settings-c4bf8cd955e7a317c6d9c0eb023d5994be0f1e9d.tar.gz packages_apps_Settings-c4bf8cd955e7a317c6d9c0eb023d5994be0f1e9d.tar.bz2 packages_apps_Settings-c4bf8cd955e7a317c6d9c0eb023d5994be0f1e9d.zip |
am 2f76aaaf: Merge "Enable EAP-pwd configuration in WiFi Settings."
* commit '2f76aaaf0105add942334ef3574e7378ee8a6097':
Enable EAP-pwd configuration in WiFi Settings.
-rw-r--r-- | res/layout/wifi_dialog.xml | 18 | ||||
-rw-r--r-- | res/values/arrays.xml | 3 | ||||
-rw-r--r-- | src/com/android/settings/wifi/WifiConfigController.java | 24 |
3 files changed, 39 insertions, 6 deletions
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml index 1b4d06298..f06c33207 100644 --- a/res/layout/wifi_dialog.xml +++ b/res/layout/wifi_dialog.xml @@ -63,7 +63,8 @@ style="@style/wifi_section" android:visibility="gone"> - <LinearLayout + <LinearLayout android:id="@+id/l_method" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" @@ -75,7 +76,8 @@ android:entries="@array/wifi_eap_method" /> </LinearLayout> - <LinearLayout + <LinearLayout android:id="@+id/l_phase2" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" @@ -87,7 +89,8 @@ android:entries="@array/wifi_phase2_entries" /> </LinearLayout> - <LinearLayout + <LinearLayout android:id="@+id/l_ca_cert" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" @@ -98,7 +101,8 @@ android:prompt="@string/wifi_eap_ca_cert" /> </LinearLayout> - <LinearLayout + <LinearLayout android:id="@+id/l_user_cert" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" @@ -109,7 +113,8 @@ android:prompt="@string/wifi_eap_user_cert" /> </LinearLayout> - <LinearLayout + <LinearLayout android:id="@+id/l_identity" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" @@ -121,7 +126,8 @@ android:inputType="textNoSuggestions" /> </LinearLayout> - <LinearLayout + <LinearLayout android:id="@+id/l_anonymous" + android:visibility="gone" style="@style/wifi_item" > <TextView style="@style/wifi_item_label" diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 97c6d990e..80cb2cf62 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -307,6 +307,8 @@ <item>TLS</item> <!-- Do not translate. --> <item>TTLS</item> + <!-- Do not translate. --> + <item>PWD</item> </string-array> <!-- Wi-Fi WPS setup for p2p connections. --> @@ -416,6 +418,7 @@ <item>PEAP</item> <item>TLS</item> <item>TTLS</item> + <item>PWD</item> </string-array> <!-- Phase 2 options --> diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java index 2f8ae5491..c64a225da 100644 --- a/src/com/android/settings/wifi/WifiConfigController.java +++ b/src/com/android/settings/wifi/WifiConfigController.java @@ -97,6 +97,12 @@ public class WifiConfigController implements TextWatcher, public static final int PROXY_NONE = 0; public static final int PROXY_STATIC = 1; + /* These values from from "wifi_eap_method" resource array */ + public static final int WIFI_EAP_METHOD_PEAP = 0; + public static final int WIFI_EAP_METHOD_TLS = 1; + public static final int WIFI_EAP_METHOD_TTLS = 2; + public static final int WIFI_EAP_METHOD_PWD = 3; + private static final String TAG = "WifiConfigController"; private Spinner mNetworkSetupSpinner; @@ -541,6 +547,7 @@ public class WifiConfigController implements TextWatcher, if (mEapMethodSpinner == null) { mEapMethodSpinner = (Spinner) mView.findViewById(R.id.method); + mEapMethodSpinner.setOnItemSelectedListener(this); mPhase2Spinner = (Spinner) mView.findViewById(R.id.phase2); mEapCaCertSpinner = (Spinner) mView.findViewById(R.id.ca_cert); mEapUserCertSpinner = (Spinner) mView.findViewById(R.id.user_cert); @@ -562,6 +569,21 @@ public class WifiConfigController implements TextWatcher, mEapAnonymousView.setText(config.anonymous_identity.value()); } } + + mView.findViewById(R.id.l_method).setVisibility(View.VISIBLE); + mView.findViewById(R.id.l_identity).setVisibility(View.VISIBLE); + + if (mEapMethodSpinner.getSelectedItemPosition() == WIFI_EAP_METHOD_PWD){ + mView.findViewById(R.id.l_phase2).setVisibility(View.GONE); + mView.findViewById(R.id.l_ca_cert).setVisibility(View.GONE); + mView.findViewById(R.id.l_user_cert).setVisibility(View.GONE); + mView.findViewById(R.id.l_anonymous).setVisibility(View.GONE); + } else { + mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE); + mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE); + mView.findViewById(R.id.l_user_cert).setVisibility(View.VISIBLE); + mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE); + } } private void showNetworkSetupFields() { @@ -761,6 +783,8 @@ public class WifiConfigController implements TextWatcher, if (parent == mSecuritySpinner) { mAccessPointSecurity = position; showSecurityFields(); + } else if (parent == mEapMethodSpinner) { + showSecurityFields(); } else if (parent == mNetworkSetupSpinner) { showNetworkSetupFields(); } else if (parent == mProxySettingsSpinner) { |