diff options
-rw-r--r-- | api/current.xml | 2 | ||||
-rw-r--r-- | core/java/android/content/Intent.java | 4 | ||||
-rw-r--r-- | core/java/android/view/IWindowManager.aidl | 4 | ||||
-rw-r--r-- | services/java/com/android/server/KeyInputQueue.java | 68 | ||||
-rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 32 |
5 files changed, 107 insertions, 3 deletions
diff --git a/api/current.xml b/api/current.xml index f5b1ddc..82b5476 100644 --- a/api/current.xml +++ b/api/current.xml @@ -36154,7 +36154,7 @@ value=""android.intent.extra.changed_component_name"" static="true" final="true" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > </field> diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 0085f26..6ba79b4 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2105,10 +2105,10 @@ public class Intent implements Parcelable { "android.intent.extra.remote_intent_token"; /** - * @Deprecated See {@link #EXTRA_CHANGED_COMPONENT_NAME_LIST}; this field + * @deprecated See {@link #EXTRA_CHANGED_COMPONENT_NAME_LIST}; this field * will contain only the first name in the list. */ - public static final String EXTRA_CHANGED_COMPONENT_NAME = + @Deprecated public static final String EXTRA_CHANGED_COMPONENT_NAME = "android.intent.extra.changed_component_name"; /** diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 23e7fb7..0ebe360 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -104,8 +104,12 @@ interface IWindowManager int getSwitchStateForDevice(int devid, int sw); int getScancodeState(int sw); int getScancodeStateForDevice(int devid, int sw); + int getTrackballScancodeState(int sw); + int getDPadScancodeState(int sw); int getKeycodeState(int sw); int getKeycodeStateForDevice(int devid, int sw); + int getTrackballKeycodeState(int sw); + int getDPadKeycodeState(int sw); // Report whether the hardware supports the given keys; returns true if successful boolean hasKeys(in int[] keycodes, inout boolean[] keyExists); 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 833c46a..4bac178 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); } |