OSDN Git Service

Improved AutoFill Save workflow.
authorFelipe Leme <felipeal@google.com>
Tue, 24 Jan 2017 23:10:26 +0000 (15:10 -0800)
committerFelipe Leme <felipeal@google.com>
Wed, 1 Feb 2017 19:00:15 +0000 (11:00 -0800)
commit0200d9ea1509089c0c03b7071aa271e3a9b35c11
treee18c3b3584dc6f4eb04291beed52c254037236a1
parent4dfc39cc36b6c61d953bfaddf8668b04876a732e
Improved AutoFill Save workflow.

Currently, the onProvideAutoFillStructure() methods can be called
twice: to auto-fill an activity and to save the activity's data
in the service.

The problem with this approach is that when the save workflow is
called, the activity might have been gone. Hence, a proper approach
is to keep the initial AssistStructure data in the system_service
memory, watch for view changes, and then passed the new structure
back to the AutoFillService.

A side effect of this change is that we need another way to determine
if the view is sanitized or not. For "standard" views, that will be
defined based on whether the view content come from a resource or not,
but that logic is not implemented yet (for now, all views will be
considered sanitized, except for TextView passwords). For "custom"
views (such as WebView), this logic is responsibility of the view
implementation, through the newChild() method, which now takes a
flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized
views).

The SaveCallback.onSuccess() method was simplified: it does
not need a list of saved ids anymore the auto-fill UI will not use it
anymore.

Another side effect is that the Save notification is gone - until
it's attached again, it can be test by using:

    adb shell cmd autofill save

Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events.

BUG: 33269702
BUG: 31001899
Test: manual verification
Test: CtsAutoFillServiceTestCases passes
Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
31 files changed:
api/current.txt
api/system-current.txt
api/test-current.txt
core/java/android/app/ActivityManager.java
core/java/android/app/ActivityThread.java
core/java/android/app/IActivityManager.aidl
core/java/android/app/IApplicationThread.aidl
core/java/android/app/assist/AssistStructure.java
core/java/android/service/autofill/AutoFillService.java
core/java/android/service/autofill/IAutoFillManagerService.aidl
core/java/android/service/autofill/IAutoFillServerCallback.aidl
core/java/android/service/autofill/IAutoFillService.aidl
core/java/android/service/autofill/SaveCallback.java
core/java/android/service/voice/VoiceInteractionSession.java
core/java/android/view/View.java
core/java/android/view/ViewGroup.java
core/java/android/view/ViewStructure.java
core/java/android/view/autofill/AutoFillId.java
core/java/android/view/autofill/AutoFillManager.java
core/java/android/view/autofill/AutoFillValue.java
core/java/android/view/autofill/VirtualViewDelegate.java
core/java/android/widget/CompoundButton.java
core/java/android/widget/RadioGroup.java
core/java/android/widget/TextView.java
services/autofill/java/com/android/server/autofill/AnchoredWindow.java
services/autofill/java/com/android/server/autofill/AutoFillManagerService.java
services/autofill/java/com/android/server/autofill/AutoFillManagerServiceImpl.java
services/autofill/java/com/android/server/autofill/AutoFillManagerServiceShellCommand.java
services/autofill/java/com/android/server/autofill/AutoFillUI.java
services/autofill/java/com/android/server/autofill/Helper.java
services/core/java/com/android/server/am/ActivityManagerService.java