Input improvements and bug fixes.
Associate each motion axis with the source from which it comes.
It is possible for multiple sources of the same device to define
the same axis. This fixes new API that was introduced in MR1.
(Bug: 4066146)
Fixed a bug that might cause a segfault when using a trackball.
Only fade out the mouse pointer when touching the touch screen,
ignore other touch pads.
Changed the plural "sources" to "source" in several places in
the InputReader where we intend to refer to a particular source
rather than to a combination of sources.
Improved the batching code to support batching events from different
sources of the same device in parallel. (Bug: 3391564)
Change-Id: I0189e18e464338f126f7bf94370b928e1b1695f2
diff --git a/services/input/InputReader.h b/services/input/InputReader.h
index b9e3494..68002ca 100644
--- a/services/input/InputReader.h
+++ b/services/input/InputReader.h
@@ -389,7 +389,7 @@
class KeyboardInputMapper : public InputMapper {
public:
- KeyboardInputMapper(InputDevice* device, uint32_t sources, int32_t keyboardType);
+ KeyboardInputMapper(InputDevice* device, uint32_t source, int32_t keyboardType);
virtual ~KeyboardInputMapper();
virtual uint32_t getSources();
@@ -414,7 +414,7 @@
int32_t scanCode;
};
- uint32_t mSources;
+ uint32_t mSource;
int32_t mKeyboardType;
// Immutable configuration parameters.
@@ -493,7 +493,7 @@
struct Accumulator {
enum {
- FIELD_BTN_MOUSE = 1,
+ FIELD_BUTTONS = 1,
FIELD_REL_X = 2,
FIELD_REL_Y = 4,
FIELD_REL_WHEEL = 8,
@@ -502,7 +502,9 @@
uint32_t fields;
- bool btnMouse;
+ uint32_t buttonDown;
+ uint32_t buttonUp;
+
int32_t relX;
int32_t relY;
int32_t relWheel;
@@ -513,7 +515,7 @@
}
} mAccumulator;
- int32_t mSources;
+ int32_t mSource;
float mXScale;
float mYScale;
float mXPrecision;
@@ -527,7 +529,7 @@
sp<PointerControllerInterface> mPointerController;
struct LockedState {
- bool down;
+ uint32_t buttonState;
nsecs_t downTime;
} mLocked;
@@ -629,7 +631,7 @@
};
// Input sources supported by the device.
- int32_t mSources;
+ uint32_t mTouchSource; // sources when reporting touch data
// Immutable configuration parameters.
struct Parameters {
@@ -745,6 +747,10 @@
int32_t surfaceOrientation;
int32_t surfaceWidth, surfaceHeight;
+ // The associated display orientation and width and height set by configureSurfaceLocked().
+ int32_t associatedDisplayOrientation;
+ int32_t associatedDisplayWidth, associatedDisplayHeight;
+
// Translation and scaling factors, orientation-independent.
float xScale;
float xPrecision;
@@ -870,7 +876,7 @@
void dispatchTouch(nsecs_t when, uint32_t policyFlags, TouchData* touch,
BitSet32 idBits, uint32_t changedId, uint32_t pointerCount,
int32_t motionEventAction);
- void detectGestures(nsecs_t when);
+ void suppressSwipeOntoVirtualKeys(nsecs_t when);
bool isPointInsideSurfaceLocked(int32_t x, int32_t y);
const VirtualKey* findVirtualKeyHitLocked(int32_t x, int32_t y);
@@ -900,7 +906,7 @@
FIELD_ABS_X = 2,
FIELD_ABS_Y = 4,
FIELD_ABS_PRESSURE = 8,
- FIELD_ABS_TOOL_WIDTH = 16
+ FIELD_ABS_TOOL_WIDTH = 16,
};
uint32_t fields;