summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-09-06 16:00:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-09-06 16:00:48 +0000
commiteff156093c9658efb9eebfaca72989e7be44773f (patch)
tree4e03b99439886abced987066a7da4bc48e3bddec /core/java
parent00386d79f53af2a06004e74cff7421a57679f75e (diff)
parent5d9031dbee2fad9b29e6477f5d7af8b622f2b456 (diff)
Merge "Fix bootloop issue with UsageStatsService." into qt-qpr1-dev
Diffstat (limited to 'core/java')
-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