diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-04-10 14:30:49 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-04-10 18:23:58 -0700 |
commit | 9f25b7fdf216c9ef0bd2322cd223eeaf0d60f77f (patch) | |
tree | b0b509a261874435cab3f5f1a727c02b399bd91c /cmds/input/src | |
parent | 54ae14749bc7f9e73cfda35a8b49f9efa80a77fb (diff) | |
download | frameworks_base-9f25b7fdf216c9ef0bd2322cd223eeaf0d60f77f.zip frameworks_base-9f25b7fdf216c9ef0bd2322cd223eeaf0d60f77f.tar.gz frameworks_base-9f25b7fdf216c9ef0bd2322cd223eeaf0d60f77f.tar.bz2 |
Request key maps from input manager service.
Instead of each application loading the KeyCharacterMap from
the file system, get them from the input manager service as
part of the InputDevice object.
Refactored InputManager to be a proper singleton instead of
having a bunch of static methods.
InputManager now maintains a cache of all InputDevice objects
that it has loaded. Currently we never invalidate the cache
which can cause InputDevice to return stale motion ranges if
the device is reconfigured. This will be fixed in a future change.
Added a fake InputDevice with ID -1 to represent the virtual keyboard.
Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
Diffstat (limited to 'cmds/input/src')
-rwxr-xr-x | cmds/input/src/com/android/commands/input/Input.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/input/src/com/android/commands/input/Input.java b/cmds/input/src/com/android/commands/input/Input.java index 3037881..fcf3c7e 100755 --- a/cmds/input/src/com/android/commands/input/Input.java +++ b/cmds/input/src/com/android/commands/input/Input.java @@ -145,13 +145,15 @@ public class Input { private void injectKeyEvent(KeyEvent event) { Log.i(TAG, "InjectKeyEvent: " + event); - InputManager.injectInputEvent(event, InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH); + InputManager.getInstance().injectInputEvent(event, + InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH); } private void injectPointerEvent(MotionEvent event) { event.setSource(InputDevice.SOURCE_TOUCHSCREEN); Log.i("Input", "InjectPointerEvent: " + event); - InputManager.injectInputEvent(event, InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH); + InputManager.getInstance().injectInputEvent(event, + InputManager.INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH); } private static final float lerp(float a, float b, float alpha) { |