am 60ae2617: Merge "If frameworks wants ASCII casing, it should explicity ask for it."
* commit '60ae2617b4b304fc3e45a441f87d1765714477ba': If frameworks wants ASCII casing, it should explicity ask for it.
This commit is contained in:
@@ -6979,7 +6979,7 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = type.trim().toLowerCase(Locale.US);
|
type = type.trim().toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
final int semicolonIndex = type.indexOf(';');
|
final int semicolonIndex = type.indexOf(';');
|
||||||
if (semicolonIndex != -1) {
|
if (semicolonIndex != -1) {
|
||||||
|
|||||||
@@ -1376,7 +1376,7 @@ public class DatabaseUtils {
|
|||||||
if (sql.length() < 3) {
|
if (sql.length() < 3) {
|
||||||
return STATEMENT_OTHER;
|
return STATEMENT_OTHER;
|
||||||
}
|
}
|
||||||
String prefixSql = sql.substring(0, 3).toUpperCase(Locale.US);
|
String prefixSql = sql.substring(0, 3).toUpperCase(Locale.ROOT);
|
||||||
if (prefixSql.equals("SEL")) {
|
if (prefixSql.equals("SEL")) {
|
||||||
return STATEMENT_SELECT;
|
return STATEMENT_SELECT;
|
||||||
} else if (prefixSql.equals("INS") ||
|
} else if (prefixSql.equals("INS") ||
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ public class MailTo {
|
|||||||
}
|
}
|
||||||
// insert the headers with the name in lowercase so that
|
// insert the headers with the name in lowercase so that
|
||||||
// we can easily find common headers
|
// we can easily find common headers
|
||||||
m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(),
|
m.mHeaders.put(Uri.decode(nameval[0]).toLowerCase(Locale.ROOT),
|
||||||
nameval.length > 1 ? Uri.decode(nameval[1]) : null);
|
nameval.length > 1 ? Uri.decode(nameval[1]) : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the buildtime configuration of a network.
|
* Describes the buildtime configuration of a network.
|
||||||
@@ -63,7 +64,7 @@ public class NetworkConfig {
|
|||||||
*/
|
*/
|
||||||
public NetworkConfig(String init) {
|
public NetworkConfig(String init) {
|
||||||
String fragments[] = init.split(",");
|
String fragments[] = init.split(",");
|
||||||
name = fragments[0].trim().toLowerCase();
|
name = fragments[0].trim().toLowerCase(Locale.ROOT);
|
||||||
type = Integer.parseInt(fragments[1]);
|
type = Integer.parseInt(fragments[1]);
|
||||||
radio = Integer.parseInt(fragments[2]);
|
radio = Integer.parseInt(fragments[2]);
|
||||||
priority = Integer.parseInt(fragments[3]);
|
priority = Integer.parseInt(fragments[3]);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.util.Log;
|
|||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A container class for the http proxy info
|
* A container class for the http proxy info
|
||||||
@@ -87,7 +88,7 @@ public class ProxyProperties implements Parcelable {
|
|||||||
if (mExclusionList == null) {
|
if (mExclusionList == null) {
|
||||||
mParsedExclusionList = new String[0];
|
mParsedExclusionList = new String[0];
|
||||||
} else {
|
} else {
|
||||||
String splitExclusionList[] = exclusionList.toLowerCase().split(",");
|
String splitExclusionList[] = exclusionList.toLowerCase(Locale.ROOT).split(",");
|
||||||
mParsedExclusionList = new String[splitExclusionList.length * 2];
|
mParsedExclusionList = new String[splitExclusionList.length * 2];
|
||||||
for (int i = 0; i < splitExclusionList.length; i++) {
|
for (int i = 0; i < splitExclusionList.length; i++) {
|
||||||
String s = splitExclusionList[i].trim();
|
String s = splitExclusionList[i].trim();
|
||||||
|
|||||||
@@ -1717,7 +1717,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
if (flag == null) {
|
if (flag == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
flag = flag.toLowerCase();
|
flag = flag.toLowerCase(Locale.ROOT);
|
||||||
return (!"false".equals(flag) && !"0".equals(flag));
|
return (!"false".equals(flag) && !"0".equals(flag));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1745,7 +1745,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
public Uri normalizeScheme() {
|
public Uri normalizeScheme() {
|
||||||
String scheme = getScheme();
|
String scheme = getScheme();
|
||||||
if (scheme == null) return this; // give up
|
if (scheme == null) return this; // give up
|
||||||
String lowerScheme = scheme.toLowerCase(Locale.US);
|
String lowerScheme = scheme.toLowerCase(Locale.ROOT);
|
||||||
if (scheme.equals(lowerScheme)) return this; // no change
|
if (scheme.equals(lowerScheme)) return this; // no change
|
||||||
|
|
||||||
return buildUpon().scheme(lowerScheme).build();
|
return buildUpon().scheme(lowerScheme).build();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package android.net;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
@@ -305,7 +306,7 @@ public class UrlQuerySanitizer {
|
|||||||
int length = value.length();
|
int length = value.length();
|
||||||
if ((mFlags & SCRIPT_URL_OK) != 0) {
|
if ((mFlags & SCRIPT_URL_OK) != 0) {
|
||||||
if (length >= MIN_SCRIPT_PREFIX_LENGTH) {
|
if (length >= MIN_SCRIPT_PREFIX_LENGTH) {
|
||||||
String asLower = value.toLowerCase();
|
String asLower = value.toLowerCase(Locale.ROOT);
|
||||||
if (asLower.startsWith(JAVASCRIPT_PREFIX) ||
|
if (asLower.startsWith(JAVASCRIPT_PREFIX) ||
|
||||||
asLower.startsWith(VBSCRIPT_PREFIX)) {
|
asLower.startsWith(VBSCRIPT_PREFIX)) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.net;
|
|||||||
|
|
||||||
import static android.util.Patterns.GOOD_IRI_CHAR;
|
import static android.util.Patterns.GOOD_IRI_CHAR;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ public class WebAddress {
|
|||||||
String t;
|
String t;
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
t = m.group(MATCH_GROUP_SCHEME);
|
t = m.group(MATCH_GROUP_SCHEME);
|
||||||
if (t != null) mScheme = t.toLowerCase();
|
if (t != null) mScheme = t.toLowerCase(Locale.ROOT);
|
||||||
t = m.group(MATCH_GROUP_AUTHORITY);
|
t = m.group(MATCH_GROUP_AUTHORITY);
|
||||||
if (t != null) mAuthInfo = t;
|
if (t != null) mAuthInfo = t;
|
||||||
t = m.group(MATCH_GROUP_HOST);
|
t = m.group(MATCH_GROUP_HOST);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package android.net.http;
|
package android.net.http;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HttpAuthHeader: a class to store HTTP authentication-header parameters.
|
* HttpAuthHeader: a class to store HTTP authentication-header parameters.
|
||||||
* For more information, see: RFC 2617: HTTP Authentication.
|
* For more information, see: RFC 2617: HTTP Authentication.
|
||||||
@@ -380,12 +382,12 @@ public class HttpAuthHeader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (token.equalsIgnoreCase(QOP_TOKEN)) {
|
if (token.equalsIgnoreCase(QOP_TOKEN)) {
|
||||||
mQop = value.toLowerCase();
|
mQop = value.toLowerCase(Locale.ROOT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token.equalsIgnoreCase(ALGORITHM_TOKEN)) {
|
if (token.equalsIgnoreCase(ALGORITHM_TOKEN)) {
|
||||||
mAlgorithm = value.toLowerCase();
|
mAlgorithm = value.toLowerCase(Locale.ROOT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import java.net.InetSocketAddress;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.security.KeyManagementException;
|
import java.security.KeyManagementException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Connection connecting to a secure http server or tunneling through
|
* A Connection connecting to a secure http server or tunneling through
|
||||||
@@ -209,7 +210,7 @@ public class HttpsConnection extends Connection {
|
|||||||
// to add 'host' header unless we want proxy to answer us with a
|
// to add 'host' header unless we want proxy to answer us with a
|
||||||
// 400 Bad Request
|
// 400 Bad Request
|
||||||
for (Header h : req.mHttpRequest.getAllHeaders()) {
|
for (Header h : req.mHttpRequest.getAllHeaders()) {
|
||||||
String headerName = h.getName().toLowerCase();
|
String headerName = h.getName().toLowerCase(Locale.ROOT);
|
||||||
if (headerName.startsWith("proxy") || headerName.equals("keep-alive")
|
if (headerName.startsWith("proxy") || headerName.equals("keep-alive")
|
||||||
|| headerName.equals("host")) {
|
|| headerName.equals("host")) {
|
||||||
proxyReq.addHeader(h);
|
proxyReq.addHeader(h);
|
||||||
|
|||||||
@@ -456,8 +456,8 @@ public final class NdefRecord implements Parcelable {
|
|||||||
if (domain == null) throw new NullPointerException("domain is null");
|
if (domain == null) throw new NullPointerException("domain is null");
|
||||||
if (type == null) throw new NullPointerException("type is null");
|
if (type == null) throw new NullPointerException("type is null");
|
||||||
|
|
||||||
domain = domain.trim().toLowerCase(Locale.US);
|
domain = domain.trim().toLowerCase(Locale.ROOT);
|
||||||
type = type.trim().toLowerCase(Locale.US);
|
type = type.trim().toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
if (domain.length() == 0) throw new IllegalArgumentException("domain is empty");
|
if (domain.length() == 0) throw new IllegalArgumentException("domain is empty");
|
||||||
if (type.length() == 0) throw new IllegalArgumentException("type is empty");
|
if (type.length() == 0) throw new IllegalArgumentException("type is empty");
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.android.internal.widget.ILockSettings;
|
|||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Settings provider contains global system-level device preferences.
|
* The Settings provider contains global system-level device preferences.
|
||||||
@@ -5248,7 +5249,7 @@ public final class Settings {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String getBluetoothHeadsetPriorityKey(String address) {
|
public static final String getBluetoothHeadsetPriorityKey(String address) {
|
||||||
return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase();
|
return BLUETOOTH_HEADSET_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5256,7 +5257,7 @@ public final class Settings {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String getBluetoothA2dpSinkPriorityKey(String address) {
|
public static final String getBluetoothA2dpSinkPriorityKey(String address) {
|
||||||
return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase();
|
return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5264,7 +5265,7 @@ public final class Settings {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String getBluetoothInputDevicePriorityKey(String address) {
|
public static final String getBluetoothInputDevicePriorityKey(String address) {
|
||||||
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
|
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public final class Recognizer {
|
|||||||
public static String getConfigDir(Locale locale) {
|
public static String getConfigDir(Locale locale) {
|
||||||
if (locale == null) locale = Locale.US;
|
if (locale == null) locale = Locale.US;
|
||||||
String dir = "/system/usr/srec/config/" +
|
String dir = "/system/usr/srec/config/" +
|
||||||
locale.toString().replace('_', '.').toLowerCase();
|
locale.toString().replace('_', '.').toLowerCase(Locale.ROOT);
|
||||||
if ((new File(dir)).isDirectory()) return dir;
|
if ((new File(dir)).isDirectory()) return dir;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ public class Linkify {
|
|||||||
String scheme, MatchFilter matchFilter,
|
String scheme, MatchFilter matchFilter,
|
||||||
TransformFilter transformFilter) {
|
TransformFilter transformFilter) {
|
||||||
boolean hasMatches = false;
|
boolean hasMatches = false;
|
||||||
String prefix = (scheme == null) ? "" : scheme.toLowerCase();
|
String prefix = (scheme == null) ? "" : scheme.toLowerCase(Locale.ROOT);
|
||||||
Matcher m = p.matcher(s);
|
Matcher m = p.matcher(s);
|
||||||
|
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.util;
|
|||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Various utilities for debugging and logging.</p>
|
* <p>Various utilities for debugging and logging.</p>
|
||||||
@@ -78,7 +79,7 @@ public class DebugUtils {
|
|||||||
Class<?> parent = klass;
|
Class<?> parent = klass;
|
||||||
do {
|
do {
|
||||||
declaredMethod = parent.getDeclaredMethod("get" +
|
declaredMethod = parent.getDeclaredMethod("get" +
|
||||||
pair[0].substring(0, 1).toUpperCase() +
|
pair[0].substring(0, 1).toUpperCase(Locale.ROOT) +
|
||||||
pair[0].substring(1),
|
pair[0].substring(1),
|
||||||
(Class[]) null);
|
(Class[]) null);
|
||||||
} while ((parent = klass.getSuperclass()) != null &&
|
} while ((parent = klass.getSuperclass()) != null &&
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.webkit;
|
package android.webkit;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -348,7 +349,7 @@ public final class URLUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extension == null) {
|
if (extension == null) {
|
||||||
if (mimeType != null && mimeType.toLowerCase().startsWith("text/")) {
|
if (mimeType != null && mimeType.toLowerCase(Locale.ROOT).startsWith("text/")) {
|
||||||
if (mimeType.equalsIgnoreCase("text/html")) {
|
if (mimeType.equalsIgnoreCase("text/html")) {
|
||||||
extension = ".html";
|
extension = ".html";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user