Fix bootloop issue with UsageStatsService.

am: 669d886cdc

Change-Id: Iab6f4086aa2bd2b5709f499b85ce79359cd76829
This commit is contained in:
Varun Shah
2019-09-10 10:10:20 -07:00
committed by android-build-merger

View File

@@ -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