From 2db11209c6a4e85091bd06a00b0f75baa49c7913 Mon Sep 17 00:00:00 2001 From: Feng Cao Date: Tue, 2 Jun 2020 19:26:31 -0700 Subject: [PATCH] Fix a bug to handle the touch ACTION_DOWN properly when inline suggestion view is obscured * if the user taps quickly such that there is only ACTION_DOWN and ACTION_UP, without ACTION_MOVE, it'd be possible that the isSecure check is not respected. This patch fixes that case. Test: atest android.autofillservice.cts.inline Bug: 157772682 Bug: 158038231 Change-Id: Icd21bf2f88259673bb9b20e46e63672648495eac --- core/java/android/service/autofill/InlineSuggestionRoot.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/service/autofill/InlineSuggestionRoot.java b/core/java/android/service/autofill/InlineSuggestionRoot.java index c879653859d8f..16c3f1d4e476e 100644 --- a/core/java/android/service/autofill/InlineSuggestionRoot.java +++ b/core/java/android/service/autofill/InlineSuggestionRoot.java @@ -58,7 +58,9 @@ public class InlineSuggestionRoot extends FrameLayout { case MotionEvent.ACTION_DOWN: { mDownX = event.getX(); mDownY = event.getY(); - } break; + } + // Intentionally fall through to the next case so that when the window is obscured + // we transfer the touch to the remote IME window and don't handle it locally. case MotionEvent.ACTION_MOVE: { final float distance = MathUtils.dist(mDownX, mDownY,