}
};
+extern int android_vt;
+
} // namespace android
if (strcmp(propBuf, "1") == 0) {
// Start the SurfaceFlinger
SurfaceFlinger::instantiate();
+ android_vt = 7;
}
property_get("system_init.startsensorservice", propBuf, "1");
#include <sys/limits.h>
#include <sys/sha1.h>
+#include <linux/vt.h>
+
/* this macro is used to tell if "bit" is set in "array"
* it selects a byte from the array, and does a boolean AND
* operation with a byte that only has the relevant bit set.
namespace android {
+int android_vt = 1;
+
static const char *WAKE_LOCK_ID = "KeyEvents";
static const char *DEVICE_PATH = "/dev/input";
}
}
+#ifdef __i386__
+ struct vt_stat vs;
+ int fd_vt = open("/dev/tty0", O_RDWR | O_SYNC);
+ if (fd_vt >= 0) {
+ ioctl(fd_vt, VT_GETSTATE, &vs);
+ close(fd_vt);
+ }
+#endif
// Grab the next input event.
bool deviceChanged = false;
while (mPendingEventIndex < mPendingEventCount) {
} else if ((readSize % sizeof(struct input_event)) != 0) {
ALOGE("could not get event (wrong size: %d)", readSize);
} else {
+#ifdef __i386__
+ if (vs.v_active != android_vt) {
+ ALOGV("Skip a non Android VT event");
+ continue;
+ }
+#endif
int32_t deviceId = device->id == mBuiltInKeyboardId ? 0 : device->id;
size_t count = size_t(readSize) / sizeof(struct input_event);