Use android.provider.Settings.EXTRA_INPUT_METHOD_ID

This change also fixes the action name of
android.settings.INPUT_METHOD_SUBTYPE_SETTINGS.

Change-Id: Ie08e7f9144f8ff8faa8e7d8edf63fbd59421b18c
This commit is contained in:
Tadashi G. Takaoka
2011-01-20 23:54:21 +09:00
parent 4c0100f48f
commit 9f7320132b
3 changed files with 4 additions and 6 deletions

View File

@@ -359,7 +359,7 @@
android:clearTaskOnLaunch="true"> android:clearTaskOnLaunch="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER" /> <action android:name="android.settings.INPUT_METHOD_SUBTYPE_SETTINGS" />
<category android:name="android.intent.category.VOICE_LAUNCH" /> <category android:name="android.intent.category.VOICE_LAUNCH" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="com.android.settings.SHORTCUT" /> <category android:name="com.android.settings.SHORTCUT" />

View File

@@ -39,9 +39,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment { public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
private AlertDialog mDialog = null; private AlertDialog mDialog = null;
private boolean mHaveHardKeyboard; private boolean mHaveHardKeyboard;
final private HashMap<String, List<Preference>> mInputMethodAndSubtypePrefsMap = final private HashMap<String, List<Preference>> mInputMethodAndSubtypePrefsMap =
@@ -58,7 +55,8 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
mImm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mImm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
Configuration config = getResources().getConfiguration(); Configuration config = getResources().getConfiguration();
mHaveHardKeyboard = (config.keyboard == Configuration.KEYBOARD_QWERTY); mHaveHardKeyboard = (config.keyboard == Configuration.KEYBOARD_QWERTY);
mInputMethodId = getActivity().getIntent().getStringExtra(EXTRA_INPUT_METHOD_ID); mInputMethodId = getActivity().getIntent().getStringExtra(
android.provider.Settings.EXTRA_INPUT_METHOD_ID);
onCreateIMM(); onCreateIMM();
setPreferenceScreen(createPreferenceHierarchy()); setPreferenceScreen(createPreferenceHierarchy());
} }

View File

@@ -223,7 +223,7 @@ public class InputMethodConfig extends SettingsPreferenceFragment {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
| Intent.FLAG_ACTIVITY_CLEAR_TOP); | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(InputMethodAndSubtypeEnabler.EXTRA_INPUT_METHOD_ID, imiId); intent.putExtra(Settings.EXTRA_INPUT_METHOD_ID, imiId);
prefScreen.setIntent(intent); prefScreen.setIntent(intent);
keyboardSettingsCategory.addPreference(prefScreen); keyboardSettingsCategory.addPreference(prefScreen);
mActiveInputMethodsPrefMap.put(imi, prefScreen); mActiveInputMethodsPrefMap.put(imi, prefScreen);