summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-09-11 22:24:40 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-09-11 22:24:40 +0000
commit71139cf27942a068cf14a463d161bff8b3cc15db (patch)
tree4ae289a7864a2985b027c5d8447073e2ef2acfa2
parentc0fbdf45d7c9826533186751a03c27e500cac78e (diff)
parent5c372790094b3cf87d2a7d09571e77ca21f16fdf (diff)
downloadbase-android10-s1-release.tar.gz
Merge cherrypicks of [9374413] into sparse-5856440-L06400000364606715android-10.0.0_r3android10-s1-release
Change-Id: I5e94265d3b5173437092f8a4d4144158339f2dc6
-rw-r--r--core/java/android/content/res/Configuration.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index 861ae7ba122e..9cf54f41a64b 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -1222,7 +1222,15 @@ public final class Configuration implements Parcelable, Comparable<Configuration
.setVariant(variant)
.setScript(script)
.build();
- list.add(locale);
+ // Log a WTF here if a repeated locale is found to avoid throwing an
+ // exception in system server when LocaleList is created below
+ final int inListIndex = list.indexOf(locale);
+ if (inListIndex != -1) {
+ Slog.wtf(TAG, "Repeated locale (" + list.get(inListIndex) + ")"
+ + " found when trying to add: " + locale.toString());
+ } else {
+ list.add(locale);
+ }
} catch (IllformedLocaleException e) {
Slog.e(TAG, "readFromProto error building locale with: "
+ "language-" + language + ";country-" + country