Commit Graph

2 Commits

Author SHA1 Message Date
Siarhei Vishniakou
3d34eeb8d0 Remove batched consumption from onStop
This patch reverts the earlier patch, ag/11959351, because the correct
solution is aosp/1459888.

When batched input is available, the Choreographer::CALLBACK_INPUT is
scheduled by ViewRootImpl. The callback always runs, even if onStop has
been called. So the earlier patch was invalid.

In practice, what happened was that the batched input was not getting
consumed after FOCUS event was received in the receiver. This was fixed
in aosp/1459888.

The consumption mechanism is complex, so I added a doc explaining how it
works, for future readers.

The newly added test, IncompleteMotionTest, ensures that this regression
does not happen again.

Test: atest IncompleteMotionTest
Bug: 160561987
Change-Id: Ic0a453ebbce1f847de8e9cb87bdffdaf72c12637
2020-10-27 17:12:17 +00:00
Siarhei Vishniakou
57dff76579 Show ANR dialog for unresponsive gesture monitors
If a gesture monitor is unresponsive, today there will not be an ANR
dialog. Since the input channel token for the gesture monitor is not
provided to WindowManager, there is no way for the proper ANR to occur.

That means, the user will not know that the gesture monitor isn't
working.

To fix the issue, we record the pid of the caller when first registering
a gesture monitor. This will be stored in InputManagerService.
Next, when an ANR for this gesture monitor occurs, we will provide this
pid to the WM.

WM will use this pid to properly blame that process.

Bug: 161904619
Bug: 160903019
Test: atest AnrTest
Test: adb shell input dump
Change-Id: Ie1a16352a116914ba6550958ad41de07cff063be
2020-08-04 09:55:40 -05:00