From 38a7fabd96566a229a276e7066ac1caf5157e127 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 30 Aug 2010 03:02:23 -0700 Subject: Input device calibration and capabilities. Finished the input device capability API. Added a mechanism for calibrating touch devices to obtain more accurate information about the touch contact area. Improved pointer location to show new coordinates and capabilities. Optimized pointer location display and formatting to avoid allocating large numbers of temporary objects. The GC churn was causing the application to stutter very badly when more than a couple of fingers were down). Added more diagnostics. Change-Id: Ie25380278ed6f16c5b04cd9df848015850383498 --- libs/ui/EventHub.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'libs/ui/EventHub.cpp') diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp index 891661d690..1d38b4ba8f 100644 --- a/libs/ui/EventHub.cpp +++ b/libs/ui/EventHub.cpp @@ -139,11 +139,7 @@ uint32_t EventHub::getDeviceClasses(int32_t deviceId) const status_t EventHub::getAbsoluteAxisInfo(int32_t deviceId, int axis, RawAbsoluteAxisInfo* outAxisInfo) const { - outAxisInfo->valid = false; - outAxisInfo->minValue = 0; - outAxisInfo->maxValue = 0; - outAxisInfo->flat = 0; - outAxisInfo->fuzz = 0; + outAxisInfo->clear(); AutoMutex _l(mLock); device_t* device = getDevice(deviceId); @@ -709,8 +705,7 @@ int EventHub::open_device(const char *deviceName) LOGV("Getting absolute controllers..."); if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bitmask)), abs_bitmask) >= 0) { // Is this a new modern multi-touch driver? - if (test_bit(ABS_MT_TOUCH_MAJOR, abs_bitmask) - && test_bit(ABS_MT_POSITION_X, abs_bitmask) + if (test_bit(ABS_MT_POSITION_X, abs_bitmask) && test_bit(ABS_MT_POSITION_Y, abs_bitmask)) { device->classes |= INPUT_DEVICE_CLASS_TOUCHSCREEN | INPUT_DEVICE_CLASS_TOUCHSCREEN_MT; -- cgit v1.2.3-59-g8ed1b