From 4e3475964be68a27ef432157fc69e0acab75637f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 2 Aug 2013 10:00:44 -0700 Subject: [PATCH] If frameworks wants ASCII casing, it should explicity ask for it. http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html Bug: https://code.google.com/p/android/issues/detail?id=58359 Change-Id: Iaab02e718a7be7bda22e626dca05d79bfd2a8fc4 --- core/java/android/net/NetworkConfig.java | 3 ++- core/java/android/net/ProxyProperties.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/net/NetworkConfig.java b/core/java/android/net/NetworkConfig.java index 3cc0bc5eae..5d95f41c6c 100644 --- a/core/java/android/net/NetworkConfig.java +++ b/core/java/android/net/NetworkConfig.java @@ -17,6 +17,7 @@ package android.net; import android.util.Log; +import java.util.Locale; /** * Describes the buildtime configuration of a network. @@ -63,7 +64,7 @@ public class NetworkConfig { */ public NetworkConfig(String init) { String fragments[] = init.split(","); - name = fragments[0].trim().toLowerCase(); + name = fragments[0].trim().toLowerCase(Locale.ROOT); type = Integer.parseInt(fragments[1]); radio = Integer.parseInt(fragments[2]); priority = Integer.parseInt(fragments[3]); diff --git a/core/java/android/net/ProxyProperties.java b/core/java/android/net/ProxyProperties.java index cd799da9d7..9c4772b90f 100644 --- a/core/java/android/net/ProxyProperties.java +++ b/core/java/android/net/ProxyProperties.java @@ -25,6 +25,7 @@ import android.util.Log; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; +import java.util.Locale; /** * A container class for the http proxy info @@ -87,7 +88,7 @@ public class ProxyProperties implements Parcelable { if (mExclusionList == null) { mParsedExclusionList = new String[0]; } else { - String splitExclusionList[] = exclusionList.toLowerCase().split(","); + String splitExclusionList[] = exclusionList.toLowerCase(Locale.ROOT).split(","); mParsedExclusionList = new String[splitExclusionList.length * 2]; for (int i = 0; i < splitExclusionList.length; i++) { String s = splitExclusionList[i].trim();