summaryrefslogtreecommitdiff
path: root/include/input/Input.h
diff options
context:
space:
mode:
author Garfield Tan <xutan@google.com> 2019-07-10 18:58:28 -0700
committer Garfield Tan <xutan@google.com> 2019-07-11 17:59:49 -0700
commitab0ab9c57c8fa9d8c9648734fea74ee010e28e8c (patch)
tree33cfd0b5f0f90fbd5f1e0781200cc89fc46445ee /include/input/Input.h
parent6681987d81635abea27e4997dbb6c7ace735ba9d (diff)
Address comments from a previous change.
The original change is 00f511d329924824b1961e9472c3a06683fc2216. Bug: 134788085 Test: atest libinput_tests Change-Id: I1f3326067f94fe6a09850f4389483e60fa57a8d4
Diffstat (limited to 'include/input/Input.h')
-rw-r--r--include/input/Input.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/input/Input.h b/include/input/Input.h
index a97624658c..ad8c233577 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -24,6 +24,7 @@
*/
#include <android/input.h>
+#include <math.h>
#include <stdint.h>
#include <utils/BitSet.h>
#include <utils/KeyedVector.h>
@@ -476,6 +477,8 @@ public:
float getYCursorPosition() const;
+ static inline bool isValidCursorPosition(float x, float y) { return !isnan(x) && !isnan(y); }
+
inline nsecs_t getDownTime() const { return mDownTime; }
inline void setDownTime(nsecs_t downTime) { mDownTime = downTime; }