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

- Updated proguard.flags

Change-Id: I198761b0f0ad5288c8c807a7a3c2e965731fcee5
This commit is contained in:
satok
2010-11-01 19:05:00 +09:00
parent 9cd11a9aa5
commit 0417e40947
6 changed files with 35 additions and 22 deletions

View File

@@ -248,7 +248,7 @@
</intent-filter> </intent-filter>
</activity-alias> </activity-alias>
<activity-alias android:name="LanguageSettings" <activity-alias android:name=".inputmethod.InputMethodAndLanguageSettings"
android:label="@string/language_keyboard_settings_title" android:label="@string/language_keyboard_settings_title"
android:clearTaskOnLaunch="true" android:clearTaskOnLaunch="true"
android:targetActivity="Settings" android:targetActivity="Settings"
@@ -262,7 +262,7 @@
</intent-filter> </intent-filter>
</activity-alias> </activity-alias>
<activity-alias android:name="InputMethodAndSubtypeEnabler" <activity-alias android:name=".inputmethod.InputMethodAndSubtypeEnabler"
android:label="@string/input_methods_and_subtype_enabler_title" android:label="@string/input_methods_and_subtype_enabler_title"
android:clearTaskOnLaunch="true" android:clearTaskOnLaunch="true"
android:targetActivity="Settings"> android:targetActivity="Settings">

View File

@@ -6,3 +6,4 @@
-keep class com.android.settings.deviceinfo.* -keep class com.android.settings.deviceinfo.*
-keep class com.android.settings.bluetooth.* -keep class com.android.settings.bluetooth.*
-keep class com.android.settings.applications.* -keep class com.android.settings.applications.*
-keep class com.android.settings.inputmethod.*

View File

@@ -118,7 +118,7 @@
<!-- Language --> <!-- Language -->
<header <header
android:fragment="com.android.settings.LanguageSettings" android:fragment="com.android.settings.inputmethod.InputMethodAndLanguageSettings"
android:icon="@drawable/ic_settings_language" android:icon="@drawable/ic_settings_language"
android:title="@string/language_settings"> android:title="@string/language_settings">
</header> </header>

View File

@@ -14,7 +14,11 @@
* limitations under the License. * 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.app.AlertDialog;
import android.content.Context; import android.content.Context;
@@ -34,8 +38,7 @@ import android.view.inputmethod.InputMethodManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class LanguageSettings extends SettingsPreferenceFragment { public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment {
private static final String TAG = LanguageSettings.class.getSimpleName();
private static final String KEY_PHONE_LANGUAGE = "phone_language"; private static final String KEY_PHONE_LANGUAGE = "phone_language";
private static final String KEY_INPUT_METHOD = "input_method"; private static final String KEY_INPUT_METHOD = "input_method";
@@ -140,7 +143,8 @@ public class LanguageSettings extends SettingsPreferenceFragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(this, mInputMethodProperties); InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(
this, getContentResolver(), mInputMethodProperties);
mLastTickedInputMethodId = null; mLastTickedInputMethodId = null;
if (mLanguagePref != null) { if (mLanguagePref != null) {
@@ -156,8 +160,8 @@ public class LanguageSettings extends SettingsPreferenceFragment {
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, mInputMethodProperties, InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, getContentResolver(),
mHaveHardKeyboard, mLastTickedInputMethodId); mInputMethodProperties, mHaveHardKeyboard, mLastTickedInputMethodId);
} }
@Override @Override

View File

@@ -14,7 +14,10 @@
* limitations under the License. * 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.app.AlertDialog;
import android.content.Context; import android.content.Context;
@@ -55,15 +58,16 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(this, mInputMethodProperties); InputMethodAndSubtypeUtil.loadInputMethodSubtypeList(
this, getContentResolver(), mInputMethodProperties);
mLastTickedInputMethodId = null; mLastTickedInputMethodId = null;
} }
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, mInputMethodProperties, InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, getContentResolver(),
mHaveHardKeyboard, mLastTickedInputMethodId); mInputMethodProperties, mHaveHardKeyboard, mLastTickedInputMethodId);
} }
@Override @Override

View File

@@ -14,8 +14,11 @@
* limitations under the License. * 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.content.pm.ApplicationInfo;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
@@ -33,9 +36,10 @@ public class InputMethodAndSubtypeUtil {
= new TextUtils.SimpleStringSplitter(':'); = new TextUtils.SimpleStringSplitter(':');
public static void saveInputMethodSubtypeList( public static void saveInputMethodSubtypeList(
SettingsPreferenceFragment context, List<InputMethodInfo> inputMethodProperties, SettingsPreferenceFragment context, ContentResolver resolver,
List<InputMethodInfo> inputMethodProperties,
boolean hasHardKeyboard, String lastTickedInputMethodId) { boolean hasHardKeyboard, String lastTickedInputMethodId) {
String lastInputMethodId = Settings.Secure.getString(context.getContentResolver(), String lastInputMethodId = Settings.Secure.getString(resolver,
Settings.Secure.DEFAULT_INPUT_METHOD); Settings.Secure.DEFAULT_INPUT_METHOD);
StringBuilder builder = new StringBuilder(); 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.ENABLED_INPUT_METHODS, builder.toString());
Settings.Secure.putString(context.getContentResolver(), Settings.Secure.putString(resolver,
Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, disabledSysImes.toString()); Settings.Secure.DISABLED_SYSTEM_INPUT_METHODS, disabledSysImes.toString());
Settings.Secure.putString(context.getContentResolver(), Settings.Secure.putString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD,
Settings.Secure.DEFAULT_INPUT_METHOD,
lastInputMethodId != null ? lastInputMethodId : ""); lastInputMethodId != null ? lastInputMethodId : "");
} }
public static void loadInputMethodSubtypeList(SettingsPreferenceFragment context, public static void loadInputMethodSubtypeList(
SettingsPreferenceFragment context, ContentResolver resolver,
List<InputMethodInfo> inputMethodProperties) { List<InputMethodInfo> inputMethodProperties) {
final HashSet<String> enabled = new HashSet<String>(); 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); Settings.Secure.ENABLED_INPUT_METHODS);
if (enabledStr != null) { if (enabledStr != null) {
final TextUtils.SimpleStringSplitter splitter = sStringColonSplitter; final TextUtils.SimpleStringSplitter splitter = sStringColonSplitter;