Move classes related to input method to com.android.settings.inputmethod
- Updated proguard.flags Change-Id: I198761b0f0ad5288c8c807a7a3c2e965731fcee5
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings;
|
||||
package com.android.settings.inputmethod;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
@@ -34,8 +38,7 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LanguageSettings extends SettingsPreferenceFragment {
|
||||
private static final String TAG = LanguageSettings.class.getSimpleName();
|
||||
public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment {
|
||||
|
||||
private static final String KEY_PHONE_LANGUAGE = "phone_language";
|
||||
private static final String KEY_INPUT_METHOD = "input_method";
|
||||
@@ -140,7 +143,8 @@ public class LanguageSettings extends SettingsPreferenceFragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(this, mInputMethodProperties);
|
||||
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(
|
||||
this, getContentResolver(), mInputMethodProperties);
|
||||
mLastTickedInputMethodId = null;
|
||||
|
||||
if (mLanguagePref != null) {
|
||||
@@ -156,8 +160,8 @@ public class LanguageSettings extends SettingsPreferenceFragment {
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, mInputMethodProperties,
|
||||
mHaveHardKeyboard, mLastTickedInputMethodId);
|
||||
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, getContentResolver(),
|
||||
mInputMethodProperties, mHaveHardKeyboard, mLastTickedInputMethodId);
|
||||
}
|
||||
|
||||
@Override
|
@@ -14,7 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings;
|
||||
package com.android.settings.inputmethod;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
@@ -55,15 +58,16 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(this, mInputMethodProperties);
|
||||
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(
|
||||
this, getContentResolver(), mInputMethodProperties);
|
||||
mLastTickedInputMethodId = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, mInputMethodProperties,
|
||||
mHaveHardKeyboard, mLastTickedInputMethodId);
|
||||
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, getContentResolver(),
|
||||
mInputMethodProperties, mHaveHardKeyboard, mLastTickedInputMethodId);
|
||||
}
|
||||
|
||||
@Override
|
@@ -14,8 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.settings;
|
||||
package com.android.settings.inputmethod;
|
||||
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.PreferenceScreen;
|
||||
@@ -33,9 +36,10 @@ public class InputMethodAndSubtypeUtil {
|
||||
= new TextUtils.SimpleStringSplitter(':');
|
||||
|
||||
public static void saveInputMethodSubtypeList(
|
||||
SettingsPreferenceFragment context, List<InputMethodInfo> inputMethodProperties,
|
||||
SettingsPreferenceFragment context, ContentResolver resolver,
|
||||
List<InputMethodInfo> inputMethodProperties,
|
||||
boolean hasHardKeyboard, String lastTickedInputMethodId) {
|
||||
String lastInputMethodId = Settings.Secure.getString(context.getContentResolver(),
|
||||
String lastInputMethodId = Settings.Secure.getString(resolver,
|
||||
Settings.Secure.DEFAULT_INPUT_METHOD);
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@@ -77,19 +81,19 @@ public class InputMethodAndSubtypeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
Settings.Secure.putString(context.getContentResolver(),
|
||||
Settings.Secure.putString(resolver,
|
||||
Settings.Secure.ENABLED_INPUT_METHODS, builder.toString());
|
||||
Settings.Secure.putString(context.getContentResolver(),
|
||||
Settings.Secure.putString(resolver,
|
||||
Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, disabledSysImes.toString());
|
||||
Settings.Secure.putString(context.getContentResolver(),
|
||||
Settings.Secure.DEFAULT_INPUT_METHOD,
|
||||
Settings.Secure.putString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD,
|
||||
lastInputMethodId != null ? lastInputMethodId : "");
|
||||
}
|
||||
|
||||
public static void loadInputMethodSubtypeList(SettingsPreferenceFragment context,
|
||||
public static void loadInputMethodSubtypeList(
|
||||
SettingsPreferenceFragment context, ContentResolver resolver,
|
||||
List<InputMethodInfo> inputMethodProperties) {
|
||||
final HashSet<String> enabled = new HashSet<String>();
|
||||
String enabledStr = Settings.Secure.getString(context.getContentResolver(),
|
||||
String enabledStr = Settings.Secure.getString(resolver,
|
||||
Settings.Secure.ENABLED_INPUT_METHODS);
|
||||
if (enabledStr != null) {
|
||||
final TextUtils.SimpleStringSplitter splitter = sStringColonSplitter;
|
Reference in New Issue
Block a user