diff options
| author | Yohei Yukawa <yukawa@google.com> | 2015-06-03 17:40:05 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-03 17:41:18 +0000 |
| commit | 168d38aa3c200ea8a823e3faa64345e776e0da31 (patch) | |
| tree | b5ca66b65af4876442e8a5072275fe97fe9b4420 /core/java/android/view/inputmethod | |
| parent | 85f4b7b38cedddfb0ed9f57555fb81aceca786ac (diff) | |
| parent | 92280cd309b0f5967dd253280962d8581844db89 (diff) | |
| download | frameworks_base-168d38aa3c200ea8a823e3faa64345e776e0da31.zip frameworks_base-168d38aa3c200ea8a823e3faa64345e776e0da31.tar.gz frameworks_base-168d38aa3c200ea8a823e3faa64345e776e0da31.tar.bz2 | |
Merge "Convert subtypes whose locale is "tl" to "fil"." into mnc-dev
Diffstat (limited to 'core/java/android/view/inputmethod')
| -rw-r--r-- | core/java/android/view/inputmethod/InputMethodSubtype.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java index c2f3777..4ee155c 100644 --- a/core/java/android/view/inputmethod/InputMethodSubtype.java +++ b/core/java/android/view/inputmethod/InputMethodSubtype.java @@ -16,6 +16,7 @@ package android.view.inputmethod; +import android.annotation.Nullable; import android.content.Context; import android.content.pm.ApplicationInfo; import android.os.Parcel; @@ -323,6 +324,19 @@ public final class InputMethodSubtype implements Parcelable { } /** + * @return The normalized {@link Locale} object of the subtype. The returned locale may or may + * not equal to "locale" string parameter passed to the constructor. + * + * <p>TODO: Consider to make this a public API.</p> + * @hide + */ + @Nullable + public Locale getLocaleObject() { + // TODO: Move the following method from InputMethodUtils to InputMethodSubtype. + return InputMethodUtils.constructLocaleFromString(mSubtypeLocale); + } + + /** * @return The mode of the subtype. */ public String getMode() { @@ -381,7 +395,7 @@ public final class InputMethodSubtype implements Parcelable { */ public CharSequence getDisplayName( Context context, String packageName, ApplicationInfo appInfo) { - final Locale locale = InputMethodUtils.constructLocaleFromString(mSubtypeLocale); + final Locale locale = getLocaleObject(); final String localeStr = locale != null ? locale.getDisplayName() : mSubtypeLocale; if (mSubtypeNameResId == 0) { return localeStr; |
