Fix issue #2249821: Unable to start passion in safe mode
Holding down the trackball now works. Also fix a little API check warning from Intent. Change-Id: Icb1f901535cb521917bf7f847a93c4ff7861d20e
This commit is contained in:
@@ -36143,7 +36143,7 @@
|
||||
value=""android.intent.extra.changed_component_name""
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
deprecated="deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
|
||||
@@ -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";
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user