Fix locale bug for string conversions
Use Locale.ROOT to be consistent with the constants.
Test: manual test with Turkish locale
Bug: 248068481
Change-Id: Ieb5678016e00e3b6d60b9d07bb08ccc5c0623f3d
diff --git a/telephony/java/android/telephony/AccessNetworkConstants.java b/telephony/java/android/telephony/AccessNetworkConstants.java
index 7eec86a..0fdf40d 100644
--- a/telephony/java/android/telephony/AccessNetworkConstants.java
+++ b/telephony/java/android/telephony/AccessNetworkConstants.java
@@ -23,6 +23,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.Locale;
/**
* Contains access network related constants.
@@ -114,7 +115,7 @@
/** @hide */
public static @RadioAccessNetworkType int fromString(@NonNull String str) {
- switch (str.toUpperCase()) {
+ switch (str.toUpperCase(Locale.ROOT)) {
case "UNKNOWN": return UNKNOWN;
case "GERAN": return GERAN;
case "UTRAN": return UTRAN;