It's currently possible to reference deviceModeChanged in InputReader
while it's in an unknown state. Change the style of initialization
here and a few other places to better prevent this type of error.
(cherry-pick of f583d0dcc6e5c1968c472c844f6c8fbbe036ad78.)
Bug: 11433748
Change-Id: Ic450ca4afe50987b022db9d20bb1cb18ccf060cc
It's currently possible to reference deviceModeChanged in InputReader
while it's in an unknown state. Change the style of initialization
here and a few other places to better prevent this type of error.
Bug: 11433748
Change-Id: Ib332406aefb7cdb16b6a21e00dceaeca34679853
When the app spends more than half a second responding to a touch
event, the input dispatch eventually decides to stop sending it
events until it catches up. (This is when the ANR clock starts.)
However, due to a bug in the timing logic, if the app eventually
does respond again we would resume delivery but only send one
event at a time until the queue was completely drained again.
This meant it could take a long time to catch up and process all
events.
The problem is that we were comparing the current time with the
waiting event time. So when events became older than half a second,
we would simply stop streaming and end up serialized.
This change fixes the timing logic such that the streaming timeout
is based on the delivery time of the waiting event rather than
the event time itself. Now we only stop streaming when it has
been over half a second since the waiting event was delivered
so we resume streaming immediately as soon as some waiting
events are handled.
Bug: 11278743
Change-Id: Ic8c68ee372a07f7caa4168eefcabf9b8a8ad5d87
Newly added private flags were being masked in the public flag variable
as opposed to the correct privateFlags variable.
bug:11033280
bug:11043194
Change-Id: Idda3a70a083457f3f1b7d4b46d231f4a7e704cf0
Make it a little easier to diagnose input dispatch timeouts by
providing the detailed reason as the ANR annotation in the log.
Bug: 10689184
Change-Id: Ie18fd9ad066b0673d1f57c030e027ad0085f4650
Prevent spurious ANRs in the case where an input event is simply
undeliverable because there is no window at the touched location.
Previously, we would assume that we were just waiting for an
application to start and become available to handle the event but
this assumption is no longer valid.
Monkeys in particular have a tendency to inject events outside
of the boundaries of the display which results in spurious ANRs.
So we should just reject them.
Bug: 9774124
Change-Id: I5c40ce4c942f0557593a229dc5253a0e0bdb8466
To help track down ANRs, include more information about recent
events in the input dispatcher dumps.
Bug: 9774124
Change-Id: I94732f173d3518c2f4780668d2eb3ee9ae9fcb10
No longer compile libandroidfw as a static library on the device
since it already exists as a shared library. Keeping the static
library would force us to provide a static library version of
libinput for the device as well which doesn't make sense.
Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
The new implementation more accurately tracks the velocity
of flings and takes care to avoid obvious discontinuities.
The main goal is for a fling to appear to be a linear
extension of the movement already in progress. The minimum
fling velocity is set to ensure that flings appear to be
fairly smooth despite being discretized.
Use sequences of repeated key events instead of individual
down/up events to represent continuous motions in one
direction which can be helpful for stopping flings at boundaries
such as when flinging the cursor position within a text view.
Compute the movement thresholds based on the physical
size of the touch pad, if known. If not known, we assume a
nominal size.
Support stopping flings with a tap just like we do for
normal touch events elsewhere in the framework.
Moved the detection of ASSIST swipes into the InputReader
where it belongs. These swipes must be detected globally
to ensure consistent behavior across the all applications.
Added a custom protocol in EventHub to enable input device
drivers to override the timestamp of the following events
in a packet. This change enables input device drivers
that have a better idea of when an input event was actually
generated to pass this information to the input system.
Particularly useful with uinput.
Bug: 8583760
Change-Id: I8ef4e827804786d549cfaa00793a2b9dd0fda465
The code currently in place assumes that orientation has a range
of [-pi/2, +pi/2] as may be found with a touch digitizer. However,
when used with a digitzer that can report the full [-pi, +pi] range
of orientations (e.g. a stylus) the calculations here are incorrect.
This patch checks if the post-rotation value is out of range for
the axis, and wraps it back around.
Change-Id: I03a22f7bf9526a5d995df1a18430d6dd24c6d6ee
This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing
changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f.
Conflicts:
packages/SystemUI/res/values-sv/strings.xml
Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
Ensure that all callbacks into the window manager policy occur
on the input dispatcher thread in the right place. This fixes
a potential deadlock that may occur if the window manager
unregisters an input channel while holding its own lock.
The change is simply to defer running asynchronous commands
(usually callbacks into the policy) until the next iteration
of the dispatch looper thread.
Bug: 7382388
Change-Id: I90095580d717fcddb2209ef332df56400f837a34
This can happen due to a race when the input device is
opened or if the kernel happens to be missing the required
Android patches to set the timestamp correctly.
Bug: 7291243
Change-Id: If4319440eaff2889147c86296abd39efc5664346
Added a new WindowManager.LayoutParams inputFeatures flag
to disable automatic user activity behavior when an input
event is sent to a window.
Added a new WindowManager.LayoutParams field userActivityTimeout.
Bug: 7165399
Change-Id: I204eafa37ef26aacc2c52a1ba1ecce1eebb0e0d9
The input system needs to know about the window that has
focus, even if it is on a secondary display. So now we
send it the list of all windows and indicate which display
they are on. We filter the list of windows as necessary
when delivering touch events.
To keep things simple, monitor input channels and input
filters are not supported except on the main display.
We also do not pass the display id to applications; it is
only used inside the input system for now.
Properly scale touch coordinates based on the viewport.
This will be needed to ensure that touch works on external
display as well as when the internal display is being used
to simulate a different resolution.
Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
The window manager is no longer responsible for telling the
input system about the display viewport.
Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1