summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2020-02-14 12:05:31 +0900
committerYuichiro Hanada <yhanada@google.com>2020-03-09 00:55:38 +0000
commit718c4da0cd1e43f04fb70f8aedaf482f645d0ea1 (patch)
tree89d09fa7984d8a477bf0dd7fb1b36c5a371e9f27 /core/java/android/view/ViewRootImpl.java
parenta23a8bf84c2f7c8a54a8c24cf0903e2a58176ad7 (diff)
Enter to touch mode by down or scroll event from any type of a device.
This CL reverts the touch mode behavior to that in N and prior. Bug: 135752906 Bug: 147710276 Test: Mouse click causes entering to touch mode. Test: ViewTest#testTouchMode Change-Id: I9d6a8ad95fba524701df7d318732d553fce958f8 Merged-In: Id5fbb500eed279c66ed6817c2b7d001a5a68737a (cherry picked from commit 391c123e9e7fc8df7907ac00fe308b967a069fa7)
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 8d3cffc512c3..d5b5fbcc78a4 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -5699,9 +5699,9 @@ public final class ViewRootImpl implements ViewParent,
mTranslator.translateEventInScreenToAppWindow(event);
}
- // Enter touch mode if event is coming from a touch screen device.
+ // Enter touch mode on down or scroll from any type of a device.
final int action = event.getAction();
- if (event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)) {
+ if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_SCROLL) {
ensureTouchMode(true);
}