OSDN Git Service

autofill: touch on IME should not close autofill
authorDake Gu <dake@google.com>
Mon, 26 Feb 2018 20:25:14 +0000 (12:25 -0800)
committerDake Gu <dake@google.com>
Thu, 1 Mar 2018 00:10:07 +0000 (16:10 -0800)
commitb0fa378f9d390d27ab2a2f83eb6fa16f2b5cbb97
tree43413817e97fb7f86dfdc4bc6b3515e0cb2a84ed
parentbf6edacac900e4f889dde292474e0e3fecb8d689
autofill: touch on IME should not close autofill

ag/3434666 causes a regression:
Before ag/3434666, autofill gets touch event after IME, autofill
close itself if it gets ACTION_OUTSIDE touch event.
But after ag/3434666, autofill intercepts touch events before IME, if
user touches within IME, autofill still gets ACTION_OUTSIDE event,
and close itself unexpectedly.

The fix moves the closing code to ViewRootImpl.EarlyPostImeStage
around the same place closing tooltip.

If user taps outside autofill window, we will force to close window,
even last autofillid that requestShowUi does not match.

Bug: 73796497
Test: atest CtsAutoFillServiceTestCases
Test: Added LoginActivityTest.testAutofillTapOutside
Test: manually tested using IME and sample app
TODO: need a fake IME service to dispatch given key upon touch.

Change-Id: I10fc0d29dc30d29a48b2118264ec1c4375062deb
core/java/android/view/ViewRootImpl.java
core/java/android/view/autofill/AutofillManager.java
services/autofill/java/com/android/server/autofill/ui/FillUi.java