462 Commits

Author SHA1 Message Date
Felipe Leme
ed2bba11a2 Fixed name of autofill service on save UI.
Test: atest CtsAutoFillServiceTestCases
Bug: 62537081
Fixes: 79201521

Change-Id: I9ae7137719390b61c38da1e52fcb13fd59333792
2018-05-09 12:51:43 -07:00
Felipe Leme
1116652087 New FIELD_AUTOFILL_COMPAT_MODE field.
This field is used on pretty much all Autofill metrics, except
AUTOFILL_USERDATA_UPDATED, AUTOFILL_SERVICE_DISABLED_SELF, and
AUTOFILL_INVALID_PERMISSION.

Test: atest CtsAutoFillServiceTestCases
Test: adb shell logcat -b events | grep sysui

Bug: 79351659

Change-Id: I2e2f3dcc780a3896162b158926f5ee89c7cb342d
2018-05-07 12:14:00 -07:00
Hongming Jin
3d84813961 Unbind autofill service when the service package is updated.
Test: atest FieldsClassificationTest
adb shell cmd autofill get fc_score half kale
m -j50 ExtServices && adb install -r
${OUT}/system/priv-app/ExtServices/ExtServices.apk
adb shell cmd autofill get fc_score half kale

Bug: 77596771
Change-Id: I29f6f5593dbe0155437d01ef73d07a354abe687d
2018-04-27 15:05:39 -07:00
Dake Gu
36b86c28f8 Autofill: new UX for TV and support themes
1. Define default Themes for autofill window and save dialog.
   (http://go/theme_autofill). Phone uses light themes, TV uses
   dark themes.
2. Apply autofill theme to RemoteViews passed from autofill service.
   So this can make sure the textColor of RemoteViews matches
   the background of autofill theme uses.
   Updated public javadoc that autofill service should not
   hardcode color values.
3. A new TV ux that occupies half screen height (go/autofill-for-tv).
   TV autofill now passes unhandled physical keyevent to app window
   in the same way phone/tablet does.
4. Fixed ATV autofill window to be SYSTEM_DIALOG, so it wont be
   clipped by app activity window (DialogLauncherActivityTest).

Bug: 71720680
Bug: 74072921
Test: CtsAutofillTest

Change-Id: Ib570227b0958b1800e8f0600b8aec36478568d74
2018-04-25 10:49:14 -07:00
Felipe Leme
a7f3e9c7cb Revert "Always set FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE on SaveInfo when on compat mode."
Save has many limitations on compat mode, so we better not change the SaveInfo
behavior but rather document then.

This reverts commit 4f74a018c8ee9801f1d5ce2c7ec726251efc4fbf.

Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityTest \
CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest

Bug: 77655074

Change-Id: I36bd28ca546dcedefe75de7815b76b8b5827aee3
2018-04-19 15:25:49 -07:00
Felipe Leme
43857fad9b Fixed autofill forged package check to only compare the package name.
Otherwise, it will log false negatives when app launches a new activity in the
same autofill session. Example:

04-18 19:34:32.392  5423  7199 W AutofillSession: Activity ComponentInfo{com.netgear.WiFiAnalytics/com.netgear.WiFiAnalytics.WiFiAnalyticsWifiRoomSignal} forged different component on AssistStructure: ComponentInfo{com.netgear.WiFiAnalytics/com.netgear.WiFiAnalytics.WiFiAnalyticsWifiAnalyzerTab}

Fixes: 78235438
Bug: 69981710
Test: manual verification, cannot be CTS tested.
Test: CtsAutoFillServiceTestCases

Change-Id: I0408cd159c2be22841a1f6c36a4a2c17e59a6219
2018-04-19 01:56:03 +00:00
Felipe Leme
156a7ebf17 Autofill should clear the UI filter when a value is updated to null.
Test: VirtualContainerActivityCompatModeTest:testDatasetFiltering
Fixes: 77652152

Change-Id: Ifc7b8f759684fe35d1aa9218dd39b8dcf7ac4e4f
2018-04-06 18:05:24 -07:00
TreeHugger Robot
2b26f83f12 Merge "autofill: fix window location in splitwindow and dialog" into pi-dev 2018-04-04 22:06:49 +00:00
Felipe Leme
c2e68785fb Merge "Log when save UI is not showing because of the service's response." into pi-dev 2018-04-04 20:24:23 +00:00
Felipe Leme
0cfb6e3863 Log when save UI is not showing because of the service's response.
Bug: 74553423
Test: manual verification

Change-Id: I2ed43866b8384de2edea1a12e3da6adae2292c29
2018-04-04 11:57:34 -07:00
Dake Gu
640e9b9bf4 autofill: fix window location in splitwindow and dialog
autofill should use relative location to app window as PopupWindow
is based on relative location.

The fixed reverted changes made in compatibility mode CL that made
autofill window TYPE_SYSTEM_DIALOG.

Changing PopupWindow to use absolute screen location is another fix
choice, but it does not allow autofill window to be automatically
moved when app window changes location (e.g. adjust split window
separator or bring up IME)

The autofill window switches to TYPE_APPLICATION_ABOVE_SUB_PANEL with
IME disabled. So it still appears above IME and most other app
windows, unless app window is TYPE_APPLICATION_ABOVE_SUB_PANEL too.

Fixes: 73555917
Bug: 77587135
Test: manually tested compability mode with chrome amazon login
      manually tested splitted window
      atest CtsAutoFillServiceTestCases

Change-Id: I6b8ecf3fe7a91cebea1f7a868f4b15fbed8b0051
2018-04-04 11:36:40 -07:00
Felipe Leme
d7b9720850 Removed redundant autofill response info from ViewState dump()
Test: adb shell dumpsys autofill
Bug: 76149637

Change-Id: Id6b9ef7b50848a407a64dc62ce5cccafb8de8945
2018-04-02 18:13:46 -07:00
Felipe Leme
cc24ebc843 Fixed mClientState dump.
Test: adb shell dumpsys autofill
Bug: 72986827

Change-Id: I1df10dde0e16c68004cc99b47f84026d3c06c5b8
2018-03-29 11:27:31 -07:00
TreeHugger Robot
dac0fe910a Merge "Don't print contents of user-provided bundles." into pi-dev 2018-03-29 15:36:43 +00:00
Felipe Leme
d85ff98961 Don't print contents of user-provided bundles.
Test: atest CtsAutoFillServiceTestCases:SimpleSaveActivityTest#testSaveWithParcelableOnClientState
Bug: 72986827

Change-Id: I91523a6c6c0297ff36ade3583e9c25cb2287cdf2
2018-03-28 16:10:00 -07:00
Felipe Leme
4c2afcba97 Created framework resource for autofill_max_visible_datasets.
So it can be customized in a per-device basis...

Test: atest CtsAutoFillServiceTestCases
Bug: 69796626

Change-Id: I1dd617b7ae658dbff898ff5c9c0ee3fbf195a929
2018-03-28 12:06:57 -07:00
TreeHugger Robot
b8c00934cb Merge "Fixed autofill dataset picker so header and footer are sticky." into pi-dev 2018-03-28 18:54:38 +00:00
TreeHugger Robot
39531e28ed Merge "Added autofill cmds to get and set full-screen mode." into pi-dev 2018-03-28 18:07:17 +00:00
Felipe Leme
c6c026a637 Added autofill cmds to get and set full-screen mode.
These are useful to emulate the behavior of Autofill on TV.

Test: adb shell cmd autofill get full_screen_mode
Test: adb shell cmd autofill set full_screen_mode true # then ran sample

Bug: 77155952

Change-Id: I0cb7757559e8132e9777eb63b5442de485261a0b
2018-03-27 17:46:06 -07:00
Felipe Leme
9076c1b1ce Fixed autofill dataset picker so header and footer are sticky.
Test: manual verification using sample service
Test: atest CtsAutoFillServiceTestCases

Fixes: 69796626
Bug: 77155952

Change-Id: I8049a531b1e12cf94b8588092bdf28ec45bd1b08
2018-03-27 17:26:03 -07:00
Felipe Leme
49f08edf7d Recover dataset picker when view fail to autofill.
When a dataset is selected, the framework tries to autofill all views belonging
to it. But if one (or more view) failed to autofill, we should let the user
recover by tapping the view again.

This scenario typically happens when views are recycled.

Test: atest MutableAutofillIdTest#testViewGoneDuringAutofillCanStillBeFilled
Test: atest CtsAutoFillServiceTestCases # manually retrying flaky failures

Fixes: 76149637

Change-Id: I7a6352c68b4a7d5e4cb80a7346c66efd831f21c8
2018-03-27 10:50:36 -07:00
Felipe Leme
0c8ce322a3 Integrate autofill session lifecycle with URL bar changes when on compat mode.
The contents of a browser URL bar is typically changed for 2 reasons:

1.User entered a new URL.
2.Form was submitted and the URL changed.

On scenario #1, the current session should be canceled, while on #2 it should be
committed. Scenario #2 is already handled when the service sets a SaveInfo, so
this CL handles the other cases:

1.Focus on URL bar is ignored so it does not trigger a new partition.
2.If URL bar changed and service didn't set a SaveInfo, the session is canceled.

Fixes: 76027553

Test: manual test with Chrome
Test: new tests on VirtualContainerActivityCompatModeTest:
      testFocusOnUrlBarIsIgnored()
      testUrlBarChangeIgnoredWhenServiceCanSave()
      testUrlBarChangeCancelsSessionWhenServiceCannotSave
      testUrlBarChangeCancelsSessionWhenServiceReturnsNullResponse
Test: atest CtsAutoFillServiceTestCases

Change-Id: I19d2aa4c8b25def0d5eca1c59cfdc2ffe33dd388
2018-03-26 11:55:31 -07:00
Felipe Leme
63df4e248a Merge "Improved autofill logging and dumping." into pi-dev 2018-03-23 05:48:26 +00:00
Felipe Leme
0cdac33f8f Merge "Always set FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE on SaveInfo when on compat mode." into pi-dev 2018-03-23 01:05:29 +00:00
Felipe Leme
da9ea34c02 Improved autofill logging and dumping.
Bug: 76027553
Test: adb shell dumpsys autofill

Change-Id: I19ef88c71334c62292ed982e43d7a7e89b35f10e
2018-03-22 16:43:28 -07:00
TreeHugger Robot
3a31f6c5cc Merge "Removed urlBarResourceId." into pi-dev 2018-03-22 22:22:30 +00:00
Felipe Leme
9bea50471f Merge "Enable Autofill Field Classification by default." into pi-dev 2018-03-22 21:20:34 +00:00
Felipe Leme
4f74a018c8 Always set FLAG_SAVE_ON_ALL_VIEWS_INVISIBLE on SaveInfo when on compat mode.
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest

Bug: 76027553

Change-Id: I432b4321801ca90a55a24e5e896578d5b2d63014
2018-03-22 13:30:59 -07:00
Felipe Leme
88b745cce3 Removed urlBarResourceId.
It will be removed before the final P build.

Test: atest FrameworksServicesTests:AutofillManagerServiceTest CtsAutoFillServiceTestCases
Fixes: 74445943

Change-Id: I9bc243a3c1ae78f2c385dbb907d362d8ab16b34c
2018-03-22 11:44:06 -07:00
Felipe Leme
4e561f83cb Merge "Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES." into pi-dev 2018-03-22 16:24:53 +00:00
Felipe Leme
1c6b60581f Enable Autofill Field Classification by default.
Bug: 76028992
Test: locally changed FieldsClassificationTest to not set it

Change-Id: I842124852f76f599a8ac1cb06271ebc3324c36c9
2018-03-22 09:09:27 -07:00
Felipe Leme
fd4003bf09 Renamed AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES.
The syntax of that setting changed from P Developer Preview1 to the final P, so
it's safer to use a new name than risk breaking devices during the update.

Bug: 74458004
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest\
FrameworksCoreTests:SettingsBackupTest

Change-Id: I1c507e8eae20f598dfe259178667ae6c2bc892ff
2018-03-21 16:36:25 -07:00
Felipe Leme
2568de0664 Set FIELD_AUTOFILL_NUM_DATASETS to -1 when service return no response.
Test: adb shell logcat -b events | grep sysui | grep '757,907'
     # while running LoginActivityTest#testAutoFillNoDatasets

Bug: 70241978

Change-Id: I611bd4fa8407b16491f1ae7b859564233fa6ba81
2018-03-21 09:03:08 -07:00
Felipe Leme
a594510bdc Fixed Save logic so it's not triggered when field was not autofilled.
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityTest#testSaveNotShown_initialValues_noUserInput_serviceDatasets\
CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest#testSaveNotShown_initialValues_noUserInput_serviceDatasets
Test: atest CtsAutoFillServiceTestCases
Test: manual verification with Chrome in compat mode

Fixes: 75333153

Change-Id: I344755ce0f5937180b4647fa47269eca5c93c980
2018-03-19 17:42:30 -07:00
Felipe Leme
4cd1ae0cb1 Cosmetic changes on Field Classification TODOs and docs.
Test: in TreeHugger we trust!
Bug: 73648631

Change-Id: I9390fb570e18e9636da2de27e2bc6186d5958e41
2018-03-15 16:00:26 -07:00
Felipe Leme
86e9405b42 Add default URL bar resource id for autofill compat mode.
These ids used to be defined at the manifest but now are defined on settings,
so we need to provide default values until the settings are fixed.

Test: atest FrameworksServicesTests:AutofillManagerServiceTest

Bug: 74445943

Change-Id: I050a96d73cb9e008179865381c6abc3041e82844
2018-03-12 10:32:45 -07:00
Felipe Leme
1c7eb0c8eb Moved urlBarResourceId from autofill service manifest to whitelist settings.
The manifest attribute is still public as it might have been used by autofill
services deployed against P DP1; it will be removed after the next developer
previs is branched out. We also need to assumie a default value for the buttons
if not specified by settings, but that will be done in a separate change so it
can be easily reverted.

Also implemented support for multiple buttons, and added unit tests.

Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest \
CtsAutoFillServiceTestCases:VirtualContainerActivityTest \
FrameworksServicesTests:AutofillManagerServiceTest

Bug: 74445943
Bug: 72811561
Fixes: 73786629

Change-Id: I066ecf40fde2c5318dd8633a659fca8b7af8aecd
2018-03-12 10:11:20 -07:00
TreeHugger Robot
8c55e8c306 Merge "DO NOT MERGE - Disable warning on blocking one-way call from autofill server." into pi-dev 2018-03-07 21:24:46 +00:00
TreeHugger Robot
f99b1d8fd9 Merge "Implemented notifyViewClicked() on compat mode." into pi-dev 2018-03-07 19:40:55 +00:00
Felipe Leme
385ee5393d DO NOT MERGE - Disable warning on blocking one-way call from autofill server.
This behavior existed since autofill was introduced on O and it won't be fixed
on P, so there's no point on warning. In fact, the warning is often a red
herring for other issues, not to mention a big logcat spammer.

Bug: 35708678
Test: manual verification looking at logcat

Change-Id: I40be4ce25abc5b097ea67e5cb34bb9c4237f0826
2018-03-07 19:24:45 +00:00
Felipe Leme
54cc68370c Implemented notifyViewClicked() on compat mode.
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.VirtualContainerActivityCompatModeTest#testSave_submitButtonClicked

Fixes: 73649008

Change-Id: Icf6a8b617e06055c58e38c5b7208c7f3ef3121ee
2018-03-07 09:27:02 -08:00
Felipe Leme
d71f90266d Destroy fill UI when app dies.
This is a regression caused by the autofill compat feature change, as the
Fill UI window was changed from a sub-panel which is auto managed by the window
manager to an overlay, to ensure the fill UI covers all app windows, so compat
mode would work for apps without app changes.

Test: atest CtsAutoFillServiceTestCases:SessionLifecycleTest#testDatasetGoesAwayWhenAutofilledAppIsKilled
Test: atest CtsAutoFillServiceTestCases:SessionLifecycleTest#testSaveRemainsWhenAutofilledAppIsKilled
Test: atest CtsAutoFillServiceTestCases # usual flakiness
Test: manual verification by adb shell kiling an app while UI is shown

Fixes: 73566982

Change-Id: I42f0acbaf3d0b19c081b8cb3613bebb01ceb487a
(cherry picked from commit 57dae0b6f0678d2c43e4556fe7a9efee5214dbd8)
2018-03-05 13:59:09 -08:00
TreeHugger Robot
cd11321e8e Merge "Added cmd to change number of visible datasets on Autofill dataset picker." 2018-03-03 03:14:57 +00:00
Dake Gu
b0fa378f9d 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
2018-02-28 16:10:07 -08:00
Tetsutoki Shiozawa
63ed15bd3e Merge "Fix: Double-free error on RemoteFillService" am: 5b04f89343 am: b23ec4eaa7
am: fddb86a80c

Change-Id: I87de2e6bc8f446dc0cddf41cb3e40d76cdc55d98
2018-02-28 00:24:18 +00:00
Tetsutoki Shiozawa
fddb86a80c Merge "Fix: Double-free error on RemoteFillService" am: 5b04f89343
am: b23ec4eaa7

Change-Id: I3acedf1add384730df6f987b0f20edb77b250228
2018-02-28 00:12:33 +00:00
Felipe Leme
11353c8d9f Added cmd to change number of visible datasets on Autofill dataset picker.
Bug: 73796644

Test: adb shell cmd autofill set max_visible_datasets 5
Test: adb shell cmd autofill get max_visible_datasets

Change-Id: I3d86ada028354a4329c054c773d12bc7913fd61d
2018-02-26 18:36:15 -08:00
Tetsutoki Shiozawa
26c93c94c9 Fix: Double-free error on RemoteFillService
Symptom:
RemoteFillService was crashed due to IllegalArgumentException
"Service not registered:" at onServiceConnected.

Root cause:
RemoteFillService#onServiceConnected tries to unbind the connection
if mDestroyed is flagged or mBinding is not flagged. It always fails
with IllegalArgumentException.
Both mDestroyed and !mBinding mean the connection was unbound.
You can't unbind the unbound connection. It's not allowed.

Fixes: 73864601
Fixes: 69905688

Change-Id: If5481468ddac7be41accad63e9d5382bc6c029fd
2018-02-26 18:16:21 +00:00
TreeHugger Robot
e05cd3ddbe Merge "Reset compat mode settings on settings change." 2018-02-23 06:10:21 +00:00
Dake Gu
09571f8943 Merge "autofill: pass keyevent from fillui to app" 2018-02-23 01:35:55 +00:00