aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2016-02-09 19:49:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-02-09 19:49:13 +0000
commit436b68dd7383214d90153df5a71d630242a64478 (patch)
tree5ee40347053e4cad6543bea897a8733070130e44 /java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java
parent6740e310e900061c77d26911ef60ca13e69518e5 (diff)
parent706fce9bb0e044f281bf12742c406964b18e9190 (diff)
downloadlatinime-436b68dd7383214d90153df5a71d630242a64478.tar.gz
latinime-436b68dd7383214d90153df5a71d630242a64478.tar.xz
latinime-436b68dd7383214d90153df5a71d630242a64478.zip
Follow API removal of LocaleList#getPrimary().
am: 706fce9bb0 * commit '706fce9bb0e044f281bf12742c406964b18e9190': Follow API removal of LocaleList#getPrimary().
Diffstat (limited to 'java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java')
-rw-r--r--java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java b/java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java
index 01030aedd..1c49cd4d2 100644
--- a/java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java
+++ b/java/src/com/android/inputmethod/compat/LocaleListCompatUtils.java
@@ -21,14 +21,20 @@ import java.util.Locale;
public final class LocaleListCompatUtils {
private static final Class CLASS_LocaleList = CompatUtils.getClass("android.util.LocaleList");
- private static final Method METHOD_getPrimary =
- CompatUtils.getMethod(CLASS_LocaleList, "getPrimary");
+ private static final Method METHOD_get =
+ CompatUtils.getMethod(CLASS_LocaleList, "get", int.class);
+ private static final Method METHOD_isEmpty =
+ CompatUtils.getMethod(CLASS_LocaleList, "isEmpty");
private LocaleListCompatUtils() {
// This utility class is not publicly instantiable.
}
- public static Locale getPrimary(final Object localeList) {
- return (Locale) CompatUtils.invoke(localeList, null, METHOD_getPrimary);
+ public static boolean isEmpty(final Object localeList) {
+ return (Boolean) CompatUtils.invoke(localeList, Boolean.FALSE, METHOD_isEmpty);
+ }
+
+ public static Locale get(final Object localeList, final int index) {
+ return (Locale) CompatUtils.invoke(localeList, null, METHOD_get, index);
}
}