summaryrefslogtreecommitdiff
path: root/libs/ui/EventHub.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2010-10-20 15:33:38 -0700
committer Jeff Brown <jeffbrown@google.com> 2010-10-23 03:52:57 -0700
commit3c3cc62e243a7796f5c1e88773d34e2054cc26c6 (patch)
tree48004ee9a8dcdcbb625d8fcc0ac3d2c45973d806 /libs/ui/EventHub.cpp
parent48a862ef5f1a9fe9f646f0862d676170fd8dc51d (diff)
Add unit tests for native input and fix bugs identified.
Fixed a bug where we would lose the first touch point when swiping out of the virtual key area. Fixed a bug where we would not send an ACTION_MOVE event in cases where individual pointers went down/up and the remaining pointers actually moved. This is important since many applications do not handle pointer movements during ACTION_POINTER_DOWN or ACTION_POINTER_UP. In the case of ACTION_POINTER_UP the movement was completely lost since all pointers were dispatched using their old location rather than the new location. Improved motion event validation to check for duplicate pointer ids. Added an input source constant that was missing from the NDK api but defined in the framework api. Added a timestamp when reporting added/removed devices in EventHub. Bug: 3070082 Change-Id: I3206a030f43b7616e2f48006e5a9d522c4d92e56
Diffstat (limited to 'libs/ui/EventHub.cpp')
-rw-r--r--libs/ui/EventHub.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 5c618fb50f..41daa9ca0d 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -370,6 +370,7 @@ bool EventHub::getEvent(RawEvent* outEvent)
outEvent->deviceId = device->id;
}
outEvent->type = DEVICE_REMOVED;
+ outEvent->when = systemTime(SYSTEM_TIME_MONOTONIC);
delete device;
mNeedToSendFinishedDeviceScan = true;
return true;
@@ -386,6 +387,7 @@ bool EventHub::getEvent(RawEvent* outEvent)
outEvent->deviceId = device->id;
}
outEvent->type = DEVICE_ADDED;
+ outEvent->when = systemTime(SYSTEM_TIME_MONOTONIC);
mNeedToSendFinishedDeviceScan = true;
return true;
}
@@ -393,6 +395,7 @@ bool EventHub::getEvent(RawEvent* outEvent)
if (mNeedToSendFinishedDeviceScan) {
mNeedToSendFinishedDeviceScan = false;
outEvent->type = FINISHED_DEVICE_SCAN;
+ outEvent->when = systemTime(SYSTEM_TIME_MONOTONIC);
return true;
}