diff options
| author | 2011-03-02 19:59:07 -0800 | |
|---|---|---|
| committer | 2011-03-02 19:59:07 -0800 | |
| commit | 18e9f5d241c2389a3dd6a6f1bccbebebf7df937c (patch) | |
| tree | a14464123bebfff64910d7c44b1759a699a6caa8 /libs | |
| parent | e5091dd8df7db262ba2684485e7dfb162b37dca0 (diff) | |
| parent | d5ed285606a9f28d2102e086aaee5c9d1cb819b9 (diff) | |
Merge "Wake screen from external HID peripherals."
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/ui/Input.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/ui/Input.cpp b/libs/ui/Input.cpp index a80320e475..0ed086662c 100644 --- a/libs/ui/Input.cpp +++ b/libs/ui/Input.cpp @@ -616,6 +616,23 @@ status_t MotionEvent::writeToParcel(Parcel* parcel) const { } #endif +bool MotionEvent::isTouchEvent(int32_t source, int32_t action) { + if (source & AINPUT_SOURCE_CLASS_POINTER) { + // Specifically excludes HOVER_MOVE and SCROLL. + switch (action & AMOTION_EVENT_ACTION_MASK) { + case AMOTION_EVENT_ACTION_DOWN: + case AMOTION_EVENT_ACTION_MOVE: + case AMOTION_EVENT_ACTION_UP: + case AMOTION_EVENT_ACTION_POINTER_DOWN: + case AMOTION_EVENT_ACTION_POINTER_UP: + case AMOTION_EVENT_ACTION_CANCEL: + case AMOTION_EVENT_ACTION_OUTSIDE: + return true; + } + } + return false; +} + // --- InputDeviceInfo --- |