Commit 0417e409 authored by satok's avatar satok

Move classes related to input method to com.android.settings.inputmethod

- Updated proguard.flags

Change-Id: I198761b0f0ad5288c8c807a7a3c2e965731fcee5
parent 9cd11a9a
......@@ -248,7 +248,7 @@
</intent-filter>
</activity-alias>
<activity-alias android:name="LanguageSettings"
<activity-alias android:name=".inputmethod.InputMethodAndLanguageSettings"
android:label="@string/language_keyboard_settings_title"
android:clearTaskOnLaunch="true"
android:targetActivity="Settings"
......@@ -262,7 +262,7 @@
</intent-filter>
</activity-alias>
<activity-alias android:name="InputMethodAndSubtypeEnabler"
<activity-alias android:name=".inputmethod.InputMethodAndSubtypeEnabler"
android:label="@string/input_methods_and_subtype_enabler_title"
android:clearTaskOnLaunch="true"
android:targetActivity="Settings">
......
......@@ -6,3 +6,4 @@
-keep class com.android.settings.deviceinfo.*
-keep class com.android.settings.bluetooth.*
-keep class com.android.settings.applications.*
-keep class com.android.settings.inputmethod.*
......@@ -118,7 +118,7 @@
<!-- Language -->
<header
android:fragment="com.android.settings.LanguageSettings"
android:fragment="com.android.settings.inputmethod.InputMethodAndLanguageSettings"
android:icon="@drawable/ic_settings_language"
android:title="@string/language_settings">
</header>
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment