From 48090d4066fdf3084a4fb31277e785149c1bce37 Mon Sep 17 00:00:00 2001 From: Chia-chi Yeh Date: Mon, 25 Jan 2010 15:41:42 +0800 Subject: WifiSettings: revise and add support for editing EAP networks. Use arrays.xml to store translations for enumerations; avoid race conditions happened when pop up menu or dialog; avoid saving configurations with networks disabled; use the same layout for all the dialogs; support editing EAP networks; only unlock keystore before connecting; and many bug fixes I cannot remember. The number of lines in the new code is about 1/3 of the old one, and it improves the readability a lot! --- res/layout/wifi_dialog.xml | 161 +++++++++++++++++++++++++ res/layout/wifi_dialog_row.xml | 32 +++++ res/values/arrays.xml | 33 ++++++ res/values/strings.xml | 257 ++++++++++++++++++++++++---------------- res/xml/wifi_access_points2.xml | 30 +++++ res/xml/wifi_settings2.xml | 45 +++++++ res/xml/wireless_settings.xml | 2 +- 7 files changed, 455 insertions(+), 105 deletions(-) create mode 100644 res/layout/wifi_dialog.xml create mode 100644 res/layout/wifi_dialog_row.xml create mode 100644 res/xml/wifi_access_points2.xml create mode 100644 res/xml/wifi_settings2.xml (limited to 'res') diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml new file mode 100644 index 0000000..6558453 --- /dev/null +++ b/res/layout/wifi_dialog.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/wifi_dialog_row.xml b/res/layout/wifi_dialog_row.xml new file mode 100644 index 0000000..52819d4 --- /dev/null +++ b/res/layout/wifi_dialog_row.xml @@ -0,0 +1,32 @@ + + + + + + + diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 0e5c920..d7be2ae 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -230,6 +230,39 @@ Unsuccessful + + + + + Open + + WEP + + WPA/WPA2 PSK + + 802.1x EAP + + + + + + + PEAP + + TLS + + TTLS + + + + + + Poor + Fair + Good + Excellent + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 60f4ebd..a27b05b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -660,7 +660,7 @@ Remember settings - + Wi-Fi @@ -671,12 +671,127 @@ Wi-Fi settings Wi-Fi settings - + Set up & manage wireless access points + + Turning on\u2026 + + Turning off\u2026 + + Error + + In airplane mode + + Unable to scan for networks + + Network notification + + Notify me when an open network is available + + Add Wi-Fi network + + Wi-Fi networks + + Scan + + Advanced + + Connect to network + + Forget network + + Modify network + + + + Network SSID + + Security + + Signal strength + + Status + + Link speed + + IP address + + EAP method + + CA certificate + + User certificate + + Identity + + Anonymous identity + + Password + + Show password. + + (unchanged) + + (unspecified) + + Remembered + + Disabled + + Not in range + + Secured with %1$s + + %2$s, secured with %1$s + + Connect + + Forget + + Save + + Cancel + + + + Advanced + + Regulatory domain + + Set the number of channels to use + + There was a problem setting the regulatory domain. + + %1$d channels + + Wi-Fi sleep policy + + Specify when to switch from Wi-Fi to mobile data + + There was a problem setting the sleep policy. + + MAC address + + IP settings + + Save + + Cancel + + Please type a valid IP address. + + Use static IP + + DNS 1 + + DNS 2 + + Gateway + + Netmask + Forget - - Status Speed @@ -709,19 +824,9 @@ secured with WPA/WPA2 PSK secured with 802.1x EAP - - IP address Signal strength - - Turning on\u2026 - - Turning off\u2026 - - Error - - In airplane mode - + Unable to start Wi-Fi Unable to stop Wi-Fi @@ -734,7 +839,7 @@ Connect - Connect to %1$s + %1$s EAP method @@ -751,8 +856,6 @@ Wireless password WEP hex key (0-9, A-F) - - Show password. Scan @@ -761,48 +864,18 @@ remembered Connection unsuccessful, touch to try again - - Wi-Fi networks Network SSID - - Security Save (unchanged) Add Wi-Fi network - - Network notification - - Notify me when an open network is available The network password you typed is not correct. Please try again. There is a problem connecting to the network. Please try again. - - Advanced - - IP settings - - Save - - Cancel - - Please type a valid IP address. - - Use static IP - - IP address - - DNS 1 - - DNS 2 - - Gateway - - Netmask Connect to network @@ -810,31 +883,43 @@ Change password - - Advanced - - Regulatory domain - - Set the number of channels to use - - There was a problem setting the regulatory domain. - - %1$d channels - - - Wi-Fi sleep policy - - Specify when to switch from Wi-Fi to mobile data - - There was a problem setting the sleep policy. + + Scanning\u2026 + + Connecting to %1$s\u2026 + + Authenticating with %1$s\u2026 + + Obtaining IP address from %1$s\u2026 + + Connected to %1$s + + Disconnecting from %1$s\u2026 + + Disconnected + + Unsuccessful - - MAC address + + Scanning\u2026 + + Connecting\u2026 + + Authenticating\u2026 + + Obtaining address\u2026 + + Connected + + Disconnecting\u2026 + + Disconnected + + Unsuccessful Wifi information - disableNetwork @@ -853,7 +938,6 @@ Wifi API - Wifi Status @@ -916,41 +1000,6 @@ Label on Wifi Configuration screen--> Configured Networks - - - Scanning\u2026 - - Connecting to %1$s\u2026 - - Authenticating with %1$s\u2026 - - Obtaining IP address from %1$s\u2026 - - Connected to %1$s - - Disconnecting from %1$s\u2026 - - Disconnected - - Unsuccessful - - - Scanning\u2026 - - Connecting\u2026 - - Authenticating\u2026 - - Obtaining address\u2026 - - Connected - - Disconnecting\u2026 - - Disconnected - - Unsuccessful - Sound diff --git a/res/xml/wifi_access_points2.xml b/res/xml/wifi_access_points2.xml new file mode 100644 index 0000000..48104dd --- /dev/null +++ b/res/xml/wifi_access_points2.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/res/xml/wifi_settings2.xml b/res/xml/wifi_settings2.xml new file mode 100644 index 0000000..35f1173 --- /dev/null +++ b/res/xml/wifi_settings2.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + diff --git a/res/xml/wireless_settings.xml b/res/xml/wireless_settings.xml index 2493021..d3c593f 100644 --- a/res/xml/wireless_settings.xml +++ b/res/xml/wireless_settings.xml @@ -37,7 +37,7 @@ + android:targetClass="com.android.settings.wifi.WifiSettings2" />