Always use en_US for string ops

Some languages, such as Turkish, do not handle casing well. So,
when this is set as the default language, any code that uses
toLowerCase() or toUpperCase() will get potentially incorrect

In this case, we only do these operations on internal names
so we can safely use the en_US locale for all case operations.

Bug: 132320580
Test: Manual. Change locale to tr_TR and device reboots
Change-Id: Idb28452cb035e27d04a3fe52adbf93d88043334c
(cherry picked from commit 93d233e1ef436842d30bbca0515f0610f32baa9c)
diff --git a/JavaGen.cpp b/JavaGen.cpp
index 773c124..99c8978 100644
--- a/JavaGen.cpp
+++ b/JavaGen.cpp
@@ -41,6 +41,7 @@
 import java.util.ArrayList;
 import java.util.function.Function;
 import java.util.List;
+import java.util.Locale;
 import java.util.Optional;
 import java.util.StringJoiner;
@@ -49,7 +50,7 @@
 constexpr const char* kJavaParsersAndFormatters =
     R"(private static Boolean tryParseBoolean(String str) {
-    switch (str.toLowerCase()) {
+    switch (str.toLowerCase(Locale.US)) {
         case "1":
         case "true":
             return Boolean.TRUE;
@@ -91,7 +92,7 @@
 private static <T extends Enum<T>> T tryParseEnum(Class<T> enumType, String str) {
     try {
-        return Enum.valueOf(enumType, str.toUpperCase());
+        return Enum.valueOf(enumType, str.toUpperCase(Locale.US));
     } catch (IllegalArgumentException e) {
         return null;