Commit e5ec9055 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

android: Skipping requestUnbufferedDispatch with stylus

Calling requestUnbufferedDispatch causes ANRs for some LG phones
when using a stylus on the first touch.

There's no evidence that other OEMs have this issue. If LG can fix this
bug, we don't need to make this change.

Bug: 1064161
Change-Id: I9ebfcfe4bc0e19dfa03d9b6e28cbc011ccd80561
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2243593Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Reviewed-by: default avatarJinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779595}
parent d74dd871
......@@ -437,7 +437,16 @@ public class ViewAndroidDelegate {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void requestUnbufferedDispatch(MotionEvent event) {
ViewGroup container = getContainerViewGroup();
if (container != null) container.requestUnbufferedDispatch(event);
if (container != null) {
for (int i = 0; i < event.getPointerCount(); i++) {
// This is a workaround for crbug.com/1064161.
// TODO(smaier) remove this if LG fixes the stylus bug.
if (event.getToolType(i) == MotionEvent.TOOL_TYPE_STYLUS) {
return;
}
}
container.requestUnbufferedDispatch(event);
}
}
@CalledByNative
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment