This change enables the joystick input mapper to handle any axes
that are not claimed by the touch input mapper, which makes
auxiliary controls such as wheels / knobs accessible.
Change-Id: I01ee7f342ac91acfcb4ccb6676fd52b3d5bf31a0
Bug: 5205674
Only wake the device on positive interactions from the user
such as button presses, movement, initial touch down events.
In particular, do not wake the device on up events since the
driver might synthesize them on power off, causing the device
to wake up again for no good reason.
Change-Id: I767f553ea36d110e6f3a10611b324487ba7d880d
Bug: 5205301
Some drivers report one finger as BTN_TOOL_FINGER, two as
BTN_TOOL_DOUBLETAP, three as BTN_TOOL_TRIPLETAP and four
as BTN_TOOL_QUADTAP. Since we care about the tool type,
we need to handle _DOUBLE/_TRIPLE/_QUAD tap in the same way
we handle _FINGER.
Change-Id: I8eb83d2a2bada9ac32d07619c7eea84e924316b8
Bug: 5049148
Finished stylus support, including support for indirect stylus
and mouse tools.
Added TILT axis. When stylus tilt X/Y is available, it is transformed
into an orientation and tilt inclination which is a more convenient
representation and a simpler extension to the exiting API.
Touch devices now only report touch data using a single input
source. Previously touch devices in pointer mode would report
both absolute touch pad data and cooked pointer gestures.
Now we just pick one. The touch device switches modes as needed
when the focused application enables/disables pointer gestures.
This change greatly simplifies the code and reduces the load
on the input dispatcher.
Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE
would be zero whenever the stylus was in direct contact. It appears
that the correct way to determine whether the stylus is in direct
contact (rather than hovering) is by checking for a non-zero
reported pressure.
Added code to read the initial state of tool buttons and axis values
when the input devices are initialized or reset. This fixes
problems where the input mapper state might have the wrong initial
state.
Moved responsibility for cancelling pending inputs (keys down,
touches, etc.) to the InputDispatcher by sending it a device reset
notification. This frees the InputReader from having to synthesize
events during reset, which was cumbersome and somewhat brittle
to begin with.
Consolidated more of the common accumulator logic from
SingleTouchInputMapper and MultiTouchInputMapper into
TouchInputMapper.
Improved the PointerLocation output.
Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
Bug: 5105599
Don't clear slot data when slot is no longer in use.
The kernel will not resend absolute slot values if they are
unchanged, even if the slot was previously marked unused.
Because the protocol is stateful, this could cause problems if
evdev drops events (marked by SYN_DROPPED) since we cannot
query the initial values of the slots, but there's nothing
we can do.
Change-Id: Ie13e68097fb8ed2542c2f60338b499082cf9e77f
Bug: 5064702
This change improves compatibility with standard touch device
drivers. All existing touch device IDC files will need to
be updated because the input system now assumes that the
touch device drivers implement the multitouch input
protocol correctly and use the appropriate axes.
Change-Id: I93aad0e011efea74fbc7fa3da31f7967aff8136c
Bug: 5064702
Introduced the concept of an InputListener to further decouple
the InputReader from the InputDispatcher. The InputListener
exposes just the minimum interface that the InputReader needs
to communicate with the outside world. The InputReader
passes arguments to the InputListener by reference, which makes
it easy to queue them up.
Consolidated all of the InputReader locks into one simple global
Mutex. The reason this wasn't done before was due to potential
re-entrance in outbound calls to the InputDispatcher. To fix this,
the InputReader now queues up all of the events it wants to send
using a QueuedInputListener, then flushes them outside of the
critical section after all of the event processing is finished.
Removing all of the InputMapper locks greatly simplifies the
implementation.
Added tests for new stylus features such as buttons, tool types,
and hovering.
Added some helpers to BitSet32 to handle common code patterns
like finding the first marked bit and clearing it.
Fixed a bug in VelocityTracker where the wrong pointer trace
could get cleared when handling ACTION_POINTER_DOWN. Oops.
Changed PointerCoords so it no longer stores useless zero
axis values. Removed editAxisValue because it is not very
useful when all zero value axes are absent and therefore
cannot be edited in place.
Added dispatch of stylus hover events.
Added support for distance and tool types.
Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
The input reader needs this information so that it knows how to
interpolate touches on an external touch screen.
Changed Display so that it asks the WindowManager what the real
display size is (as opposed to the raw display size). This means
it now takes into the forced display size set by
adb shell am display-size.
Replaced all calls to getRealWidth() / getRealHeight() /
getRealMetrics() in the WindowManager and replaced them with direct
usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM
doesn't end up making a reentrant Binder call into itself.
Fixed the table status bar HeightReceiver so that it updates the
height on all configuration changes since it is possible that the
display size changed independently of an external HDMI display
being plugged / unplugged.
Improved the Display class documentation to make the distinctions
betweeen the various sizes clearer.
Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
Added TOOL_TYPE_ERASER.
Refactored the InputReader to share more code between the
various input mappers that handle button states and to
simplify the accumulator implementations by having each
one only handle a single type of input.
Removed the concept of direct/indirect tool types from the API.
If we add it back, it should be done in a manner that is orthogonal
to the tool type itself, perhaps as a flags field on the pointer.
The device source may well provide sufficient information anyhow.
Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
Bug: 5064702
When using Linux MT Protocol A, drivers are supposed to omit
fingers that go up and to send an empty sync with no fingers
(can be just an SYN_MT_REPORT / SYN_REPORT) when no fingers
remain.
This makes Android more compliant with the protocol standard.
Change-Id: I5775feb14ab7db015824a32b1e2c015da239385d
The edge slop feature was added a long time ago for a specific
device that had severe non-linear touch response issues near
the edges of its touch screen. The feature is not useful on
modern hardware that is property calibrated.
Change-Id: I26716cbc7411c31883ddb4bb4ddd981027790d0f
Modified the touch input mapper to assign pointer ids sequentially
starting from 0 instead of using the tracking id or slot index
supplied by the driver. Applications should not depend on this
ordering but some do. (sigh)
Bug: 4980884
Change-Id: I0dfeb3ac27c57a7102a13c960c760e2a02eb7669
This fixes a problem where touches can get stuck because the
driver and the framework have different ideas of what the
initial slot index is. The framework assumed it was slot 0
but it could in principle be any slot, such as slot 1. When
that happened, the framework would start tracking the first
touch as slot 0, but it might never receive an "up" for that slot.
Change-Id: Idaffc4534b275d66b9d4360987b28dc2d0f63218
Fixed some issues where inconsistent streams of events could
be generated by the dispatcher, particularly when switching from
hovering with one device to hovering with another.
Fixed a bug where the touch pad would fail to generate a new
HOVER_MOVE following a tap event. As a result, the hover event
stream would not resume until the user touched the touch pad
again.
Change-Id: I444dce84641fb12e56a0af84c931520771d6c493
Made it possible for individual windows to disable pointer gestures
while the window has focus using a private API.
Cleaned up the InputReader configuration code to enable in-place
reconfiguration of input devices without having to reopen them all.
This change makes changing the pointer speed somewhat nicer since the
pointer doesn't jump back to the origin after each change.
Change-Id: I9727419c2f4cb39e16acb4b15fd7fd84526b1239
Use epoll_wait() instead of poll().
Dropped all support for non-Linux platforms.
Added a wake-up protocol so that the InputReader can wake up
the event loop immediately as needed.
Change-Id: Ibf84337bcceb3c2df068c5c637de42a319786d66
Bug: 4124987
Recent changes introduced a multiplication factor into the
distance calculation which ended up being absent from the
dot product calculation.
Change-Id: Ia367912b9ac09b6285d5a498a0c271563c9e9e39
Bug: 4124987
Since spots are now one-to-one with the touch gesture points,
we can eliminate a lot of redundant logic that assumed they weren't.
Change-Id: Ic60d8d0898c285317f480bc8fb17fb9797770e69
Bug: 4124987
Only show one spot per touch point instead of one spot per
finger for multitouch gestures.
Tweaked the pointer acceleration curves.
Dissociated the hover/tap timeouts from the "tap" timeout
since they mean very different things.
Change-Id: I7c2cbd30feeb65ebc12f6c7e33a67dc9a9f59d4c
The spot-based presentation relies on being able to accurately
locate and distinguish two or more fingers on the touch pad.
We can still do gesture recognition without distinct multitouch
but it doesn't make sense to show spots because we can't be sure
that the spots will appear in the right places.
Change-Id: Ia282d77000bf3b50d395273a1f0ac0bbe55b3c6f
Fix bug where the pointer presentation would be updated on
any input reader timeout rather than only when a pointer gesture
is in progress.
Bug: 4124987
Change-Id: Ie9bba4a0b3228d55e45e65fa2ede5cd6ba887a08
Fade the pointer spot when swiping or performing a freeform
gesture.
Support configuring the gesture mode in the device IDC file.
Added workaround for devices that report individual finger
movements one at a time instead of all at once.
Bug: 4124987
Change-Id: I44628b00382ad59306e4ec5c4717d69cc6fbebb8
The mapper sends a DOWN when the finger is released then starts
a short timer. If the finger is not pressed again before the timer
elapses, then the mapper sends an UP to complete the tap. If the
finger is pressed again then the mapper starts sending MOVEs
as part of a drag.
Double/triple taps work as intended because we also start watching
for a new tap when the finger is pressed again. If a new tap
occurs the old tap is also finished. So each individual finger
short press/release cycle constitutes a distinct tap.
Change-Id: Id0a6ee10dd27e723f6cb04e56b43939abe9e940c
Added a new PointerIcon API (hidden for now) for loading
pointer icons.
Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.
Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements. The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.
Removed the SpotController stub and folded its responsibilities
into PointerController.
Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e