Fix bootloop issue with UsageStatsService. am: 669d886cdc

am: ee3d800165

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

View File

@@ -1222,7 +1222,15 @@ public final class Configuration implements Parcelable, Comparable<Configuration
.setVariant(variant) .setVariant(variant)
.setScript(script) .setScript(script)
.build(); .build();
// 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); list.add(locale);
}
} catch (IllformedLocaleException e) { } catch (IllformedLocaleException e) {
Slog.e(TAG, "readFromProto error building locale with: " Slog.e(TAG, "readFromProto error building locale with: "
+ "language-" + language + ";country-" + country + "language-" + language + ";country-" + country