summaryrefslogtreecommitdiff
path: root/include/input
diff options
context:
space:
mode:
Diffstat (limited to 'include/input')
-rw-r--r--include/input/InputEventLabels.h1
-rw-r--r--include/input/InputTransport.h9
-rw-r--r--include/input/KeyCharacterMap.h3
-rw-r--r--include/input/VelocityTracker.h34
4 files changed, 42 insertions, 5 deletions
diff --git a/include/input/InputEventLabels.h b/include/input/InputEventLabels.h
index c282cf0b22..4b33a96adf 100644
--- a/include/input/InputEventLabels.h
+++ b/include/input/InputEventLabels.h
@@ -324,6 +324,7 @@ static const InputEventLabel KEYCODES[] = {
DEFINE_KEYCODE(SYSTEM_NAVIGATION_LEFT),
DEFINE_KEYCODE(SYSTEM_NAVIGATION_RIGHT),
DEFINE_KEYCODE(ALL_APPS),
+ DEFINE_KEYCODE(REFRESH),
{ NULL, 0 }
};
diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h
index ea1d2aa41f..1ea2c2cc07 100644
--- a/include/input/InputTransport.h
+++ b/include/input/InputTransport.h
@@ -31,7 +31,6 @@
#include <utils/Errors.h>
#include <utils/Timers.h>
#include <utils/RefBase.h>
-#include <utils/String8.h>
#include <utils/Vector.h>
#include <utils/BitSet.h>
@@ -142,16 +141,16 @@ protected:
virtual ~InputChannel();
public:
- InputChannel(const String8& name, int fd);
+ InputChannel(const std::string& name, int fd);
/* Creates a pair of input channels.
*
* Returns OK on success.
*/
- static status_t openInputChannelPair(const String8& name,
+ static status_t openInputChannelPair(const std::string& name,
sp<InputChannel>& outServerChannel, sp<InputChannel>& outClientChannel);
- inline String8 getName() const { return mName; }
+ inline std::string getName() const { return mName; }
inline int getFd() const { return mFd; }
/* Sends a message to the other endpoint.
@@ -183,7 +182,7 @@ public:
sp<InputChannel> dup() const;
private:
- String8 mName;
+ std::string mName;
int mFd;
};
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h
index 79359277c7..33d2757ec8 100644
--- a/include/input/KeyCharacterMap.h
+++ b/include/input/KeyCharacterMap.h
@@ -51,6 +51,9 @@ public:
KEYBOARD_TYPE_PREDICTIVE = 2,
KEYBOARD_TYPE_ALPHA = 3,
KEYBOARD_TYPE_FULL = 4,
+ /**
+ * Deprecated. Set 'keyboard.specialFunction' to '1' in the device's IDC file instead.
+ */
KEYBOARD_TYPE_SPECIAL_FUNCTION = 5,
KEYBOARD_TYPE_OVERLAY = 6,
};
diff --git a/include/input/VelocityTracker.h b/include/input/VelocityTracker.h
index 795f575a2e..ffa1614b55 100644
--- a/include/input/VelocityTracker.h
+++ b/include/input/VelocityTracker.h
@@ -264,6 +264,40 @@ private:
Movement mMovements[HISTORY_SIZE];
};
+class ImpulseVelocityTrackerStrategy : public VelocityTrackerStrategy {
+public:
+ ImpulseVelocityTrackerStrategy();
+ virtual ~ImpulseVelocityTrackerStrategy();
+
+ virtual void clear();
+ virtual void clearPointers(BitSet32 idBits);
+ virtual void addMovement(nsecs_t eventTime, BitSet32 idBits,
+ const VelocityTracker::Position* positions);
+ virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
+
+private:
+ // Sample horizon.
+ // We don't use too much history by default since we want to react to quick
+ // changes in direction.
+ static constexpr nsecs_t HORIZON = 100 * 1000000; // 100 ms
+
+ // Number of samples to keep.
+ static constexpr size_t HISTORY_SIZE = 20;
+
+ struct Movement {
+ nsecs_t eventTime;
+ BitSet32 idBits;
+ VelocityTracker::Position positions[MAX_POINTERS];
+
+ inline const VelocityTracker::Position& getPosition(uint32_t id) const {
+ return positions[idBits.getIndexOfBit(id)];
+ }
+ };
+
+ size_t mIndex;
+ Movement mMovements[HISTORY_SIZE];
+};
+
} // namespace android
#endif // _LIBINPUT_VELOCITY_TRACKER_H