am 26233cdd: Merge "Add debug setting to force hardware special key"

* commit '26233cddeea6d45064c7b7f62af1ea2543759d2a':
  Add debug setting to force hardware special key
main
Tadashi G. Takaoka 2014-08-13 09:02:23 +00:00 committed by Android Git Automerger
commit 123d3f5988
6 changed files with 22 additions and 4 deletions

View File

@ -22,10 +22,11 @@
See {@link SettingsValues#needsToShowVoiceInputKey(SharedPreferences,Resources)} --> See {@link SettingsValues#needsToShowVoiceInputKey(SharedPreferences,Resources)} -->
<string name="voice_mode_main">0</string> <string name="voice_mode_main">0</string>
<!-- Title for Latin keyboard debug settings activity / dialog --> <!-- Title for Android keyboard debug settings activity / dialog -->
<string name="english_ime_debug_settings">Android keyboard Debug settings</string> <string name="english_ime_debug_settings">Android Keyboard Debug settings</string>
<string name="prefs_debug_mode">Debug Mode</string> <string name="prefs_debug_mode">Debug Mode</string>
<string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string> <string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string>
<string name="prefs_force_physical_keyboard_special_key">Force physical keyboard special key</string>
<!-- Subtype locale display name exceptions. <!-- Subtype locale display name exceptions.
For each exception, there should be related string resources for display name that may have For each exception, there should be related string resources for display name that may have

View File

@ -30,6 +30,11 @@
android:title="@string/prefs_force_non_distinct_multitouch" android:title="@string/prefs_force_non_distinct_multitouch"
android:defaultValue="false" android:defaultValue="false"
android:persistent="true" /> android:persistent="true" />
<CheckBoxPreference
android:key="force_physical_keyboard_special_key"
android:title="@string/prefs_force_physical_keyboard_special_key"
android:defaultValue="false"
android:persistent="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="pref_sliding_key_input_preview" android:key="pref_sliding_key_input_preview"
android:title="@string/sliding_key_input_preview" android:title="@string/sliding_key_input_preview"

View File

@ -155,7 +155,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@UsedForTesting final KeyboardSwitcher mKeyboardSwitcher; @UsedForTesting final KeyboardSwitcher mKeyboardSwitcher;
private final SubtypeSwitcher mSubtypeSwitcher; private final SubtypeSwitcher mSubtypeSwitcher;
private final SubtypeState mSubtypeState = new SubtypeState(); private final SubtypeState mSubtypeState = new SubtypeState();
private final SpecialKeyDetector mSpecialKeyDetector = new SpecialKeyDetector(); private final SpecialKeyDetector mSpecialKeyDetector;
// Object for reacting to adding/removing a dictionary pack. // Object for reacting to adding/removing a dictionary pack.
private final BroadcastReceiver mDictionaryPackInstallReceiver = private final BroadcastReceiver mDictionaryPackInstallReceiver =
@ -517,6 +517,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSettings = Settings.getInstance(); mSettings = Settings.getInstance();
mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mKeyboardSwitcher = KeyboardSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance();
mSpecialKeyDetector = new SpecialKeyDetector(this);
mIsHardwareAcceleratedDrawingEnabled = mIsHardwareAcceleratedDrawingEnabled =
InputMethodServiceCompatUtils.enableHardwareAcceleration(this); InputMethodServiceCompatUtils.enableHardwareAcceleration(this);
Log.i(TAG, "Hardware accelerated drawing: " + mIsHardwareAcceleratedDrawingEnabled); Log.i(TAG, "Hardware accelerated drawing: " + mIsHardwareAcceleratedDrawingEnabled);

View File

@ -16,9 +16,17 @@
package com.android.inputmethod.latin; package com.android.inputmethod.latin;
import android.content.Context;
import android.view.KeyEvent; import android.view.KeyEvent;
final class SpecialKeyDetector { final class SpecialKeyDetector {
/**
* Special physical key detector
* @param context a context of this detector.
*/
public SpecialKeyDetector(final Context context) {
}
/** /**
* Record a down key event. * Record a down key event.
* @param keyEvent a down key event. * @param keyEvent a down key event.

View File

@ -19,6 +19,8 @@ package com.android.inputmethod.latin.settings;
public final class DebugSettings { public final class DebugSettings {
public static final String PREF_DEBUG_MODE = "debug_mode"; public static final String PREF_DEBUG_MODE = "debug_mode";
public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch"; public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch";
public static final String PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY =
"force_physical_keyboard_special_key";
public static final String PREF_KEY_PREVIEW_SHOW_UP_START_SCALE = public static final String PREF_KEY_PREVIEW_SHOW_UP_START_SCALE =
"pref_key_preview_show_up_start_scale"; "pref_key_preview_show_up_start_scale";
public static final String PREF_KEY_PREVIEW_DISMISS_END_SCALE = public static final String PREF_KEY_PREVIEW_DISMISS_END_SCALE =

View File

@ -133,7 +133,8 @@ public final class DebugSettingsFragment extends SubScreenFragment
mServiceNeedsRestart = true; mServiceNeedsRestart = true;
return; return;
} }
if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH)) { if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH)
|| key.equals(DebugSettings.PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY)) {
mServiceNeedsRestart = true; mServiceNeedsRestart = true;
return; return;
} }