diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-11-18 11:49:59 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-18 11:49:59 -0800 |
commit | abcb849d098eb7d3b7669247209f4715e75ab585 (patch) | |
tree | 21a128777e249522f05949d2b235bfa899676c66 /services | |
parent | 3b2982fad311ae3303471b9919a0724850d11f11 (diff) | |
parent | 1d62ea9d8c2646d198b6967e2c6ae3dad5c18f9e (diff) | |
download | frameworks_base-abcb849d098eb7d3b7669247209f4715e75ab585.zip frameworks_base-abcb849d098eb7d3b7669247209f4715e75ab585.tar.gz frameworks_base-abcb849d098eb7d3b7669247209f4715e75ab585.tar.bz2 |
am 1d62ea9d: Fix issue #2249821: Unable to start passion in safe mode
Merge commit '1d62ea9d8c2646d198b6967e2c6ae3dad5c18f9e' into eclair-plus-aosp
* commit '1d62ea9d8c2646d198b6967e2c6ae3dad5c18f9e':
Fix issue #2249821: Unable to start passion in safe mode
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/KeyInputQueue.java | 68 | ||||
-rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 32 |
2 files changed, 100 insertions, 0 deletions
diff --git a/services/java/com/android/server/KeyInputQueue.java b/services/java/com/android/server/KeyInputQueue.java index a885df8..1bb897b 100644 --- a/services/java/com/android/server/KeyInputQueue.java +++ b/services/java/com/android/server/KeyInputQueue.java @@ -371,6 +371,40 @@ public abstract class KeyInputQueue { } } + public int getTrackballScancodeState(int code) { + synchronized (mFirst) { + final int N = mDevices.size(); + for (int i=0; i<N; i++) { + InputDevice dev = mDevices.valueAt(i); + if ((dev.classes&RawInputEvent.CLASS_TRACKBALL) != 0) { + int res = nativeGetScancodeState(dev.id, code); + if (res > 0) { + return res; + } + } + } + } + + return 0; + } + + public int getDPadScancodeState(int code) { + synchronized (mFirst) { + final int N = mDevices.size(); + for (int i=0; i<N; i++) { + InputDevice dev = mDevices.valueAt(i); + if ((dev.classes&RawInputEvent.CLASS_DPAD) != 0) { + int res = nativeGetScancodeState(dev.id, code); + if (res > 0) { + return res; + } + } + } + } + + return 0; + } + public int getKeycodeState(int code) { synchronized (mFirst) { VirtualKey vk = mPressedVirtualKey; @@ -395,6 +429,40 @@ public abstract class KeyInputQueue { } } + public int getTrackballKeycodeState(int code) { + synchronized (mFirst) { + final int N = mDevices.size(); + for (int i=0; i<N; i++) { + InputDevice dev = mDevices.valueAt(i); + if ((dev.classes&RawInputEvent.CLASS_TRACKBALL) != 0) { + int res = nativeGetKeycodeState(dev.id, code); + if (res > 0) { + return res; + } + } + } + } + + return 0; + } + + public int getDPadKeycodeState(int code) { + synchronized (mFirst) { + final int N = mDevices.size(); + for (int i=0; i<N; i++) { + InputDevice dev = mDevices.valueAt(i); + if ((dev.classes&RawInputEvent.CLASS_DPAD) != 0) { + int res = nativeGetKeycodeState(dev.id, code); + if (res > 0) { + return res; + } + } + } + } + + return 0; + } + public static native String getDeviceName(int deviceId); public static native int getDeviceClasses(int deviceId); public static native void addExcludedDevice(String deviceName); diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 327cd72..887c46d 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -4192,6 +4192,22 @@ public class WindowManagerService extends IWindowManager.Stub return mQueue.getScancodeState(devid, sw); } + public int getTrackballScancodeState(int sw) { + if (!checkCallingPermission(android.Manifest.permission.READ_INPUT_STATE, + "getTrackballScancodeState()")) { + throw new SecurityException("Requires READ_INPUT_STATE permission"); + } + return mQueue.getTrackballScancodeState(sw); + } + + public int getDPadScancodeState(int sw) { + if (!checkCallingPermission(android.Manifest.permission.READ_INPUT_STATE, + "getDPadScancodeState()")) { + throw new SecurityException("Requires READ_INPUT_STATE permission"); + } + return mQueue.getDPadScancodeState(sw); + } + public int getKeycodeState(int sw) { if (!checkCallingPermission(android.Manifest.permission.READ_INPUT_STATE, "getKeycodeState()")) { @@ -4208,6 +4224,22 @@ public class WindowManagerService extends IWindowManager.Stub return mQueue.getKeycodeState(devid, sw); } + public int getTrackballKeycodeState(int sw) { + if (!checkCallingPermission(android.Manifest.permission.READ_INPUT_STATE, + "getTrackballKeycodeState()")) { + throw new SecurityException("Requires READ_INPUT_STATE permission"); + } + return mQueue.getTrackballKeycodeState(sw); + } + + public int getDPadKeycodeState(int sw) { + if (!checkCallingPermission(android.Manifest.permission.READ_INPUT_STATE, + "getDPadKeycodeState()")) { + throw new SecurityException("Requires READ_INPUT_STATE permission"); + } + return mQueue.getDPadKeycodeState(sw); + } + public boolean hasKeys(int[] keycodes, boolean[] keyExists) { return KeyInputQueue.hasKeys(keycodes, keyExists); } |