summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorRoozbeh Pournader <roozbeh@google.com>2015-11-18 17:41:24 -0800
committerRoozbeh Pournader <roozbeh@google.com>2015-11-19 14:30:05 -0800
commit8bca69858aefd2326b1bb7ead75796778ed54e93 (patch)
treeedfe133a11d1193ed99970cb41de74cbeff7d25e /core/java/android
parent4d859fdbd3cded63b9a5784ad0ef3beff0cf7bf6 (diff)
Support LocaleLists in ActivityManagerService.
Also add a placeholder method for locale negotiation to LocaleList, to be filled later. There is no change in behavior expected by this CL yet. But once we support setting the first locale to something the system doesn't support, and implement the locale negotiation, this will cause the system locale to be set to the first supported locale, instead of just the default from Settings. Change-Id: Iec983a5707daffb5bf54eac79ff0856a96631960
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/util/LocaleList.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/util/LocaleList.java b/core/java/android/util/LocaleList.java
index 0d5c135044dd..c1d23bb9d7e7 100644
--- a/core/java/android/util/LocaleList.java
+++ b/core/java/android/util/LocaleList.java
@@ -49,6 +49,7 @@ public final class LocaleList {
return location < mList.length ? mList[location] : null;
}
+ @Nullable
public Locale getPrimary() {
return mList.length == 0 ? null : get(0);
}
@@ -179,6 +180,12 @@ public final class LocaleList {
}
}
+ @Nullable
+ public Locale getBestMatch(String[] locales) {
+ // TODO: Fix this to actually do locale negotiation and choose the best match
+ return getPrimary();
+ }
+
private final static Object sLock = new Object();
@GuardedBy("sLock")