summaryrefslogtreecommitdiffstats
path: root/services/input/InputReader.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/input/InputReader.h')
-rw-r--r--services/input/InputReader.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/services/input/InputReader.h b/services/input/InputReader.h
index c596b37..312f19b 100644
--- a/services/input/InputReader.h
+++ b/services/input/InputReader.h
@@ -791,6 +791,10 @@ struct CookedPointerData {
void clear();
void copyFrom(const CookedPointerData& other);
+ inline const PointerCoords& pointerCoordsForId(uint32_t id) const {
+ return pointerCoords[idToIndex[id]];
+ }
+
inline bool isHovering(uint32_t pointerIndex) {
return hoveringIdBits.hasBit(pointerProperties[pointerIndex].id);
}
@@ -1180,6 +1184,7 @@ protected:
DEVICE_MODE_DISABLED, // input is disabled
DEVICE_MODE_DIRECT, // direct mapping (touchscreen)
DEVICE_MODE_UNSCALED, // unscaled mapping (touchpad)
+ DEVICE_MODE_NAVIGATION, // unscaled mapping with assist gesture (touch navigation)
DEVICE_MODE_POINTER, // pointer mapping (pointer)
};
DeviceMode mDeviceMode;
@@ -1432,6 +1437,10 @@ private:
// The maximum swipe width.
float mPointerGestureMaxSwipeWidth;
+ // The start and end Y thresholds for invoking the assist navigation swipe.
+ float mNavigationAssistStartY;
+ float mNavigationAssistEndY;
+
struct PointerDistanceHeapElement {
uint32_t currentPointerIndex : 8;
uint32_t lastPointerIndex : 8;
@@ -1606,6 +1615,15 @@ private:
}
} mPointerSimple;
+ struct Navigation {
+ // The id of a pointer that is tracking a possible assist swipe.
+ int32_t activeAssistId; // -1 if none
+
+ void reset() {
+ activeAssistId = -1;
+ }
+ } mNavigation;
+
// The pointer and scroll velocity controls.
VelocityControl mPointerVelocityControl;
VelocityControl mWheelXVelocityControl;
@@ -1641,6 +1659,8 @@ private:
bool down, bool hovering);
void abortPointerSimple(nsecs_t when, uint32_t policyFlags);
+ void dispatchNavigationAssist(nsecs_t when, uint32_t policyFlags);
+
// Dispatches a motion event.
// If the changedId is >= 0 and the action is POINTER_DOWN or POINTER_UP, the
// method will take care of setting the index and transmuting the action to DOWN or UP
@@ -1730,10 +1750,11 @@ private:
float highScale; // scale factor from raw to normalized values of high split
float highOffset; // offset to add after scaling for normalization of high split
- float min; // normalized inclusive minimum
- float max; // normalized inclusive maximum
- float flat; // normalized flat region size
- float fuzz; // normalized error tolerance
+ float min; // normalized inclusive minimum
+ float max; // normalized inclusive maximum
+ float flat; // normalized flat region size
+ float fuzz; // normalized error tolerance
+ float resolution; // normalized resolution in units/mm
float filter; // filter out small variations of this size
float currentValue; // current value
@@ -1744,7 +1765,7 @@ private:
void initialize(const RawAbsoluteAxisInfo& rawAxisInfo, const AxisInfo& axisInfo,
bool explicitlyMapped, float scale, float offset,
float highScale, float highOffset,
- float min, float max, float flat, float fuzz) {
+ float min, float max, float flat, float fuzz, float resolution) {
this->rawAxisInfo = rawAxisInfo;
this->axisInfo = axisInfo;
this->explicitlyMapped = explicitlyMapped;
@@ -1756,6 +1777,7 @@ private:
this->max = max;
this->flat = flat;
this->fuzz = fuzz;
+ this->resolution = resolution;
this->filter = 0;
resetValue();
}