300 Commits

Author SHA1 Message Date
Felipe Leme
83bf740a1e Merge "Re-add callback to onCancel() when screen is touched outside Save UI." into oc-mr1-dev am: 87794e95a2
am: 478a98a3d3

Change-Id: If5f3bd13aa86d21770cf50549bc880d2d7cce596
2017-09-26 19:56:49 +00:00
Felipe Leme
6a26e93c75 Re-add callback to onCancel() when screen is touched outside Save UI.
That callback was accidentally removed because it should not trigger the
negative listener, but the right approach was to pass a null listener.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 66235266
Fixes: 66944844

Change-Id: I5b71d3d03335d952e3b47078d1373f9783366437
2017-09-26 09:09:49 -07:00
Felipe Leme
021b878a23 Logs how long it took to show the Autofill UI after a field was focused.
Test: adb shell logcat -b events | grep sysui_
Test: adb dumpsys autofill
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65376559
Bug: 66508098

Merged-In: Ia17f8b30d6eef0141b020085985b9ebacff7a455
Change-Id: Ia17f8b30d6eef0141b020085985b9ebacff7a455
2017-09-22 17:44:16 -07:00
Felipe Leme
c660c4c994 Logs how long it took to show the Autofill UI after a field was focused.
Test: adb shell logcat -b events | grep sysui_
Test: adb dumpsys autofill
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65376559
Bug: 66508098

Change-Id: Ia17f8b30d6eef0141b020085985b9ebacff7a455
2017-09-22 17:43:13 -07:00
Felipe Leme
15b9eb5dac Merge "Add metrics (and moar logging) for when a service disables itself." into oc-mr1-dev am: 6f50d16338
am: cbbc364ec0

Change-Id: Iba0a0e66168a5716aa7cfc2f068fa922d19b02e9
2017-09-22 21:26:36 +00:00
TreeHugger Robot
6f50d16338 Merge "Add metrics (and moar logging) for when a service disables itself." into oc-mr1-dev 2017-09-22 21:04:02 +00:00
Felipe Leme
9d41449ff4 Add metrics (and moar logging) for when a service disables itself.
Test: adb shell logcat -b events | grep sysui_
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65376559
Bug: 65856399

Change-Id: Ieb54bb0a58ecd51da663170a12817d33188ac9f0
2017-09-22 09:23:04 -07:00
Felipe Leme
1123fac2d1 Merge "Only call negative listener when SaveUI is dismissed by tapping button." into oc-mr1-dev am: e8041834b1
am: 855495d733

Change-Id: I7a9987a3dbdad402b128f808876ff7f7ae59b5e2
2017-09-21 22:01:56 +00:00
TreeHugger Robot
e8041834b1 Merge "Only call negative listener when SaveUI is dismissed by tapping button." into oc-mr1-dev 2017-09-21 20:44:50 +00:00
Felipe Leme
f04ea961a0 Merge "Remove finished sessions on ACTION_CLOSE_SYSTEM_DIALOGS." into oc-mr1-dev am: 56e5c3944b
am: 64a6188032

Change-Id: I568c3a67d43b0a1eb1af4350f523ba291c5ea9f2
2017-09-21 17:14:41 +00:00
Felipe Leme
650f7abc3f Remove finished sessions on ACTION_CLOSE_SYSTEM_DIALOGS.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testTapHomeWhileSaveUiIsShowing
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testTapHomeWhileDatasetPickerUiIsShowing
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 65414762

Change-Id: I7dc9fd8f40341164e0ca320ff49b99cf8614fdbf
2017-09-20 17:19:29 -07:00
Felipe Leme
620a6cedde Only call negative listener when SaveUI is dismissed by tapping button.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 66235266

Change-Id: Ieb3085b64e96ccbd3dd97fca58fcb9d4930c82fa
2017-09-20 16:14:05 -07:00
Felipe Leme
4b02111aba Merge "Handle autofill auth scenarios where the FillContext cannot be retrieved:" into oc-mr1-dev am: 5488a38465
am: 3ac60cbbe0

Change-Id: Ia59feec4ad1a442f6ade75eab8f3e49946d9f11b
2017-09-20 00:59:11 +00:00
TreeHugger Robot
5488a38465 Merge "Handle autofill auth scenarios where the FillContext cannot be retrieved:" into oc-mr1-dev 2017-09-20 00:19:03 +00:00
Felipe Leme
204605d891 Merge "Autofill optimization: don't contact server when session is finished." into oc-mr1-dev am: 2748ffcef7
am: 667fb12d37

Change-Id: Ib4d8b85be3d38131d606569913939d10199c63f7
2017-09-19 23:12:44 +00:00
TreeHugger Robot
2748ffcef7 Merge "Autofill optimization: don't contact server when session is finished." into oc-mr1-dev 2017-09-19 22:47:16 +00:00
Felipe Leme
c7b4529aa9 Autofill optimization: don't contact server when session is finished.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Bug: 65414762

Change-Id: I214a7835727c3ff71de9dc65c8d6fe54507265fb
2017-09-19 11:49:29 -07:00
Felipe Leme
86ac64aba8 Merge "Fixed padding of autofill service icon on Save affordance." into oc-mr1-dev am: e15b1c953f
am: 764df64d3c

Change-Id: Ibb385e4d78e09a193976644854e8da2adc442659
2017-09-18 22:39:36 +00:00
TreeHugger Robot
e15b1c953f Merge "Fixed padding of autofill service icon on Save affordance." into oc-mr1-dev 2017-09-18 22:13:31 +00:00
Felipe Leme
f73795f926 Handle autofill auth scenarios where the FillContext cannot be retrieved:
Test: manually modified code to force a null FillContext and verified the
      session is properly cleared (even in the client side)
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 65374274

Change-Id: Ica482a48b0be34b89e36f9a34078fdcd48134537
2017-09-18 14:35:15 -07:00
Felipe Leme
f60da8690f Merge "Added more metrics for Autofill:" into oc-mr1-dev am: d4f72ac3c4
am: b093daa296

Change-Id: Iae09ba2c6a082b87b74bd05320222955bde30dda
2017-09-18 21:26:55 +00:00
Felipe Leme
fed6c6fa96 Fixed padding of autofill service icon on Save affordance.
Test: manual verification
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 65739885

Change-Id: Ia2b63750665eefd36143074c4cf0e1310de056b2
2017-09-18 12:15:32 -07:00
Felipe Leme
b22d635dad Added more metrics for Autofill:
- AUTOFILL_VALUE_RESET
- FIELD_AUTOFILL_PREVIOUS_LENGTH
- AUTOFILL_DATASET_AUTHENTICATED
- AUTOFILL_INVALID_DATASET_AUTHENTICATION
- AUTOFILL_INVALID_AUTHENTICATION
- FIELD_AUTOFILL_SAVE_TYPE
- AUTOFILL_SAVE_CUSTOM_DESCRIPTION
- AUTOFILL_SAVE_CUSTOM_SUBTITLE
- AUTOFILL_SAVE_LINK_TAPPED
- AUTOFILL_SAVE_VALIDATION
- AUTOFILL_PENDING_SAVE_UI_OPERATION

Also tagged all metrics with FIELD_AUTOFILL_SERVICE, and added missing
package name on AUTOFILL_DATASET_APPLIED.

Test: CtsAutoFillServiceTestCases pass

Bug: 65118073
Bug: 65376559
Bug: 65697068

Change-Id: I678193c99d9d1b2dac56a62a88dcf20043d1b401
2017-09-15 13:08:24 -07:00
Felipe Leme
c5ef68120c Merge "Show Autofill Service icon on Save UI." into oc-mr1-dev am: 0f6599887c
am: db16fb2bbb

Change-Id: Ie681feebfee2dd23a6002c3a81e82199e42c6e16
2017-09-15 04:52:55 +00:00
Felipe Leme
e11139c73d Show Autofill Service icon on Save UI.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65465974

Change-Id: Ic495be94763dda1de0edced3f9371190d09783ef
2017-09-11 18:39:45 -07:00
TreeHugger Robot
627cc3c7ae Merge "Don't log TYPE_DATASET_SELECTED on dataset authentication." into oc-mr1-dev 2017-09-09 09:04:39 +00:00
TreeHugger Robot
415c7aadd0 Merge "Destroy Save UI when it's hidden without a pending restoration." into oc-mr1-dev 2017-09-09 07:03:01 +00:00
TreeHugger Robot
09545e3fa7 Merge "Added more logging to diagnose a racy runtime restart." into oc-mr1-dev 2017-09-09 04:01:35 +00:00
Felipe Leme
838ba3dbbd Destroy Save UI when it's hidden without a pending restoration.
This scenario typically happens when the BACK button is tapped after
the SaveUI is restored.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testTapLink_launchTrampolineActivityThenTapBackAndStartNewSession
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.PreSimpleSaveActivityTest#testTapLink_launchTrampolineActivityThenTapBackAndStartNewSession
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Fixes: 65459113

Merged-In: I07c6d9b6d219889c50caeaff99b883841b87d9cc
Change-Id: I07c6d9b6d219889c50caeaff99b883841b87d9cc
2017-09-08 20:05:29 -07:00
TreeHugger Robot
4db66b664d Merge "Destroy Save UI when it's hidden without a pending restoration." 2017-09-09 01:09:58 +00:00
Felipe Leme
a07762368a Merge "Add pseudo-filtering on authenticated views." into oc-mr1-dev am: 30d6df4514
am: 760205ea96

Change-Id: I2f55ef450e42a8c9cfb58ab79e74e346af4ea3a8
2017-09-08 21:46:24 +00:00
Felipe Leme
c40f7b4bbf Destroy Save UI when it's hidden without a pending restoration.
This scenario typically happens when the BACK button is tapped after
the SaveUI is restored.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.SimpleSaveActivityTest#testTapLink_launchTrampolineActivityThenTapBackAndStartNewSession
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.PreSimpleSaveActivityTest#testTapLink_launchTrampolineActivityThenTapBackAndStartNewSession
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Fixes: 65459113

Change-Id: I07c6d9b6d219889c50caeaff99b883841b87d9cc
2017-09-08 14:28:19 -07:00
TreeHugger Robot
30d6df4514 Merge "Add pseudo-filtering on authenticated views." into oc-mr1-dev 2017-09-08 21:13:02 +00:00
TreeHugger Robot
c9982ce300 Merge "Don't log TYPE_DATASET_SELECTED on dataset authentication." 2017-09-08 19:15:45 +00:00
Felipe Leme
63f7906c1d Don't log TYPE_DATASET_SELECTED on dataset authentication.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65007529
Fixes: 65403592

Merged-In: I98f1198cbe1836c8154b73a1227be4f6947abc19
Change-Id: I98f1198cbe1836c8154b73a1227be4f6947abc19
2017-09-08 17:10:38 +00:00
Felipe Leme
8f0fad859c Don't log TYPE_DATASET_SELECTED on dataset authentication.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 65007529
Fixes: 65403592

Change-Id: I98f1198cbe1836c8154b73a1227be4f6947abc19
2017-09-08 10:05:31 -07:00
TreeHugger Robot
1a7048f5d8 Merge "Added more logging to diagnose a racy runtime restart." 2017-09-08 05:15:57 +00:00
Felipe Leme
e102579e4c Merge "Finishes the session when the service returns a null response on authentication." into oc-mr1-dev am: a61839458f
am: 1c0d25fc56

Change-Id: Ie332a146dafde80058e6b30d54fffb8d5d4a7dc7
2017-09-07 22:47:07 +00:00
Felipe Leme
8fa5f5e7df Added more logging to diagnose a racy runtime restart.
Also fixed a possible NPE on saveLocked() and improved locking.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Bug: 65374274

Merged-Id: I4b8368a9d19b4b4da76533dadb013ff2e2922955
Change-Id: I4b8368a9d19b4b4da76533dadb013ff2e2922955
2017-09-07 09:31:30 -07:00
Felipe Leme
a012d7e62b Added more logging to diagnose a racy runtime restart.
Also fixed a possible NPE on saveLocked() and improved locking.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Bug: 65374274

Change-Id: I4b8368a9d19b4b4da76533dadb013ff2e2922955
2017-09-07 09:05:55 -07:00
Felipe Leme
d56a49785f Add pseudo-filtering on authenticated views.
When the autofill UI is shown for an authenticated FillResponse or Dataset and
the user types something, it should be filtered as if the matched failed.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 65415443

Change-Id: I6a6b5af369e4e5a9cea49ae124dc517dbe5c70be
2017-09-06 18:08:00 -07:00
Felipe Leme
b0a4057d44 Finishes the session when the service returns a null response on authentication.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testFillResponseAuthServiceHasNoData
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 64985246

Change-Id: Id9a4b9f1752dcee6c67ac659b9dbd6dd1dd7b43c
2017-09-05 16:28:23 -07:00
Felipe Leme
9852897bf6 New Autofill API: SaveRequest.getDatasetIds()
Test: modified some existing CTS tests to use it
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 64843801

Change-Id: I95fe7766f19e5a9eea9d7138636a15cc832c704c
2017-09-01 14:01:10 -07:00
Felipe Leme
1c501ebfec Added getClientState() to FillEvent; deprecated it on FillEventHistory.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 62830277

Change-Id: Ib99a342c931f4fd44fc8aced1faef0b75588f63d
2017-08-29 17:48:00 -07:00
Felipe Leme
c24a56ae06 Hides the Save UI while handling a pending intent from CustomDescription.
When the AutofillService sets a PendingIntent to launch an activity when
clicking a chield view (for example, to lauch a web page displayign the terms
and conditions of saving something), the system must hide the Save UI and
restore it after the new activity is dismissed.

That sounds simple in the surface, but it requires a huge refactoring behind
the scenes, such as injecting a token in the activity intent and using that
token to hide / cancel the UI during some activity lifecycle events.

Test: lotta of brand-new shinning tests on CtsAutoFillServiceTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Change-Id: Ie8ec7aeb2c63cab68467046c1a9dcf85dbcc24ec
Fixes: 64309238
2017-08-28 18:04:15 -07:00
Felipe Leme
60b765b707 Fixed synchronization when calling cancellation signal.
Test: none for this particular issue, but CtsAutoFillServiceTestCases pass

Bug: 64759228

Change-Id: Ifaf0082de55ddb5446af134e190c89f7e10bf1fe
2017-08-17 09:12:41 -07:00
TreeHugger Robot
fac2141f4e Merge "Fixed NPE when cancellation signal is null." into oc-mr1-dev 2017-08-17 16:02:54 +00:00
TreeHugger Robot
10d176009d Merge "Revert "Dismiss Autofill Save UI when a new Activity is launched."" into oc-mr1-dev 2017-08-17 03:07:02 +00:00
Felipe Leme
ec63b7d0e1 Fixed NPE when cancellation signal is null.
Test: none for this particular issue, but CtsAutoFillServiceTestCases pass
Fixes: 64759228

Change-Id: I34170440ac388ec6ba7ed5632dc38543a84d0327
2017-08-16 18:06:17 -07:00
Felipe Leme
cf1ff6ca3d Revert "Dismiss Autofill Save UI when a new Activity is launched."
This reverts commit 05ea98a3f95a2f5179c01a5bfd4901835a0c1bd8.

Bug: 64693551

Change-Id: I8e7a7b2c5f575cee28f977ae7f3c10752a15d49c
2017-08-16 23:34:06 +00:00