diff options
| author | Dake Gu <dake@google.com> | 2018-03-01 02:40:03 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-03-01 02:40:03 +0000 |
| commit | 467b444d0a84e0095cd89442dd274f7e2403ef24 (patch) | |
| tree | e1b5d0206a14b3f5aff299f7b0e48fa1e48c676d /core/java/android/view/ViewRootImpl.java | |
| parent | 3ae0efcc095255bcd13635decfbca614d60a11cd (diff) | |
| parent | b0fa378f9d390d27ab2a2f83eb6fa16f2b5cbb97 (diff) | |
Merge "autofill: touch on IME should not close autofill"
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 098583c1e445..95e4abb648b4 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -95,6 +95,7 @@ import android.view.accessibility.IAccessibilityInteractionConnection; import android.view.accessibility.IAccessibilityInteractionConnectionCallback; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; +import android.view.autofill.AutofillManager; import android.view.inputmethod.InputMethodManager; import android.widget.Scroller; @@ -4781,6 +4782,21 @@ public final class ViewRootImpl implements ViewParent, ensureTouchMode(event.isFromSource(InputDevice.SOURCE_TOUCHSCREEN)); } + if (action == MotionEvent.ACTION_DOWN && mView instanceof ViewGroup) { + // Upon motion event within app window, close autofill ui. + ViewGroup decorView = (ViewGroup) mView; + if (decorView.getChildCount() > 0) { + // We cannot use decorView's Context for querying AutofillManager: DecorView's + // context is based on Application Context, it would allocate a different + // AutofillManager instance. + AutofillManager afm = (AutofillManager) decorView.getChildAt(0).getContext() + .getSystemService(Context.AUTOFILL_MANAGER_SERVICE); + if (afm != null) { + afm.requestHideFillUi(); + } + } + } + if (action == MotionEvent.ACTION_DOWN && mAttachInfo.mTooltipHost != null) { mAttachInfo.mTooltipHost.hideTooltip(); } |
