From 437fcbaa9f9e7de6ccdb6c9ac5f977c0aa6e6bc6 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 9 Oct 2014 14:11:23 +0900 Subject: [PATCH] [ML20.1] Move getRichInputMethodSubtype to additional features Bug: 11230254 Change-Id: I9bc19db5f101eeb6841394fe3637f271c93cbfa7 --- .../settings/AdditionalFeaturesSettingUtils.java | 12 ++++++++++++ .../inputmethod/latin/RichInputMethodManager.java | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java index 1c02d7d63..204d5f357 100644 --- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java @@ -19,6 +19,12 @@ package com.android.inputmethod.latin.settings; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceFragment; +import android.view.inputmethod.InputMethodSubtype; + +import com.android.inputmethod.latin.RichInputMethodSubtype; +import com.android.inputmethod.latin.RichInputMethodManager; + +import javax.annotation.Nonnull; /** * Utility class for managing additional features settings. @@ -39,4 +45,10 @@ public class AdditionalFeaturesSettingUtils { final SharedPreferences prefs, final int[] additionalFeaturesPreferences) { // do nothing. } + + public static RichInputMethodSubtype getRichInputMethodSubtype( + @Nonnull final RichInputMethodManager imm, + @Nonnull final InputMethodSubtype subtype) { + return new RichInputMethodSubtype(subtype); + } } diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 0d5ce7d6d..b4ec8d674 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -29,6 +29,7 @@ import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; +import com.android.inputmethod.latin.settings.AdditionalFeaturesSettingUtils; import com.android.inputmethod.latin.settings.Settings; import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils; import com.android.inputmethod.latin.utils.SubtypeLocaleUtils; @@ -304,8 +305,7 @@ public class RichInputMethodManager { if (currentSubtype == null) { return defaultSubtype; } - // TODO: Determine locales to use for multi-lingual use. - return new RichInputMethodSubtype(currentSubtype); + return AdditionalFeaturesSettingUtils.getRichInputMethodSubtype(this, currentSubtype); } public boolean hasMultipleEnabledIMEsOrSubtypes(final boolean shouldIncludeAuxiliarySubtypes) {