Fixed auto-uncap of Wifi status messages.
Fixes #1852765. Change strings to lowercase and capitalize on demand.
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 492ffe5..2fedceb 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -625,18 +625,18 @@
<!-- Value for the wifi security when it is unknown -->
<string name="wifi_security_unknown">Unknown</string>
- <!-- Verbose security type of a wifi network. Open means no security. -->
- <string name="wifi_security_verbose_open">Open network</string>
- <!-- Verbose security type of a wifi network. -->
- <string name="wifi_security_verbose_wep">Secured with WEP</string>
- <!-- Verbose security type of a wifi network. -->
- <string name="wifi_security_verbose_wpa">Secured with WPA</string>
- <!-- Verbose security type of a wifi network. -->
- <string name="wifi_security_verbose_wpa2">Secured with WPA2</string>
- <!-- Verbose security type of a wifi network. -->
- <string name="wifi_security_verbose_wpa_eap">Secured with WPA-EAP</string>
- <!-- Verbose security type of a wifi network. -->
- <string name="wifi_security_verbose_ieee8021x">Secured with IEEE 802.1x</string>
+ <!-- Verbose security type of a wifi network. Open means no security. Capitalized by app. -->
+ <string name="wifi_security_verbose_open">open network</string>
+ <!-- Verbose security type of a wifi network. Capitalized by app. -->
+ <string name="wifi_security_verbose_wep">secured with WEP</string>
+ <!-- Verbose security type of a wifi network. Capitalized by app. -->
+ <string name="wifi_security_verbose_wpa">secured with WPA</string>
+ <!-- Verbose security type of a wifi network. Capitalized by app. -->
+ <string name="wifi_security_verbose_wpa2">secured with WPA2</string>
+ <!-- Verbose security type of a wifi network. Capitalized by app. -->
+ <string name="wifi_security_verbose_wpa_eap">secured with WPA-EAP</string>
+ <!-- Verbose security type of a wifi network. Capitalized by app. -->
+ <string name="wifi_security_verbose_ieee8021x">secured with IEEE 802.1x</string>
<!-- Wi-Fi IP addrress label -->
<string name="ip_address">IP address</string>
<!-- Label for the signal strength -->
@@ -683,10 +683,10 @@
<string name="wifi_show_password">Show password.</string>
<!--Wi-Fi settings screen menu option -->
<string name="scan_wifi">Scan</string>
- <!-- Wifi network summary when not in nearby -->
+ <!-- Wifi network summary when not in nearby. -->
<string name="summary_not_in_range">Not in range</string>
- <!-- Wifi network summary when the network is configured previously -->
- <string name="summary_remembered">Remembered</string>
+ <!-- Wifi network summary when the network is configured previously, capitalized by app -->
+ <string name="summary_remembered">remembered</string>
<!-- Wifi network summary when there was an error connecting -->
<string name="summary_connection_failed">Connection unsuccessful, select to try again</string>
<!-- Header for the list of wifi networks-->
diff --git a/src/com/android/settings/wifi/AccessPointState.java b/src/com/android/settings/wifi/AccessPointState.java
index d050767..7ea2dc9 100644
--- a/src/com/android/settings/wifi/AccessPointState.java
+++ b/src/com/android/settings/wifi/AccessPointState.java
@@ -815,22 +815,23 @@
return null;
}
}
-
- private void buildSummary(StringBuilder sb, String string, boolean autoLowerCaseFirstLetter) {
+
+ private void buildSummary(StringBuilder sb, String string, boolean autoUpperCaseFirstLetter) {
if (sb.length() == 0) {
- sb.append(string);
- } else {
- sb.append(", ");
- if (autoLowerCaseFirstLetter) {
- // Convert first letter to lowercase
- sb.append(Character.toLowerCase(string.charAt(0))).append(string, 1,
+ if (autoUpperCaseFirstLetter && string.length() > 1
+ && Character.isLowerCase(string.charAt(0))
+ && !Character.isUpperCase(string.charAt(1))) {
+ sb.append(Character.toUpperCase(string.charAt(0))).append(string, 1,
string.length());
} else {
sb.append(string);
}
+ } else {
+ sb.append(", ");
+ sb.append(string);
}
}
-
+
public int compareTo(AccessPointState other) {
// This ranks the states for displaying in the AP list, not for
// connecting to (wpa_supplicant does that using the WifiConfiguration's