summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Shah <varunshah@google.com>2019-09-10 10:10:20 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-09-10 10:10:20 -0700
commitee3d800165ac3109e93e12bbc85f21e311919639 (patch)
treeb83fbdc04d04c80e1127ab1c5fe47c83ac48af42
parentbeb8996741873f4e7a7f12e2c6247abcc591eb4d (diff)
parent669d886cdc8b577f318152712c6b3b10c8a82599 (diff)
Fix bootloop issue with UsageStatsService.
am: 669d886cdc Change-Id: Iab6f4086aa2bd2b5709f499b85ce79359cd76829
-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