284 Commits

Author SHA1 Message Date
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
Colin Cross
eb652a47a1 Convert services to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Change-Id: I417409281c928ea667d937090d2a0d9d72a449a2
Merged-In: I417409281c928ea667d937090d2a0d9d72a449a2
Exempt-From-Owner-Approval: trivial conversion
(cherry-picked from commit e0b2ee52d2f274a2d46b2e6695e42d2764c39fa7)
2017-12-12 23:22:25 +00:00
Koji Fukui
8d36beec24 Merge "Remove AutofillManagerClient after AutofillManager is finalized"
am: dd5384a4fe

Change-Id: If0b092c5e18005fb4b8c1fd8405f4d666c98de5a
2017-11-15 02:35:18 +00:00
Koji Fukui
ccec6a6ae8 Remove AutofillManagerClient after AutofillManager is finalized
Symptom:
Global reference table overflow happens on system_server.

Root cause:
If a process repeatedly create a context and get AutofillManager
from the context, each BinderProxy of AutofillManagerClient are
registered to AutofillManagerServiceImpl. They aren't removed until
the process is died. BinderProxy consumes global reference and finally
causes crash on system_server.

Solution:
Remove AutofillManagerClient from AutofillManagerServiceImpl after
AutofillManager is finalized.

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

Bug: 68747744
Change-Id: I8b76c5368b54317b8696cac470cc390b36e910e7
2017-11-09 15:44:12 -08: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
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
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
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
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
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
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
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
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
30d6df4514 Merge "Add pseudo-filtering on authenticated views." into oc-mr1-dev 2017-09-08 21:13:02 +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
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
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
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
TreeHugger Robot
7876b630be Merge changes I768830f5,I665bde3a into oc-mr1-dev
* changes:
  Removed redundant [X] icon used to close Autofill Save UI.
  Re-added outer layout on Autofill Save UI that was accidentally removed.
2017-08-16 22:11:12 +00:00
Felipe Leme
05e435cfd1 Removed redundant [X] icon used to close Autofill Save UI.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Test: manual verification

Fixes: 64694706

Change-Id: I768830f56db1814aecb82b94cebb9100dd47dd50
2017-08-16 10:00:28 -07:00
TreeHugger Robot
6ba128762f Merge "Calls CancellationSignal when onFillRequest() times out." into oc-mr1-dev 2017-08-15 22:23:57 +00:00
Felipe Leme
05ea98a3f9 Dismiss Autofill Save UI when a new Activity is launched.
Test: manual verification using Settings
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -tandroid.autofillservice.cts.SimpleSaveActivityTest#testDismissSave_byLaunchingNewActivity
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -tandroid.autofillservice.cts.LoginActivityTest#testSaveGoesAwayWhenLaunchingNewActivity
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 64693551

Change-Id: I323031c7285a4b49f9f0ca06618425a0ab7833da
2017-08-14 17:56:30 -07:00
Felipe Leme
052562c40f Calls CancellationSignal when onFillRequest() times out.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testCancellationSignalCalledAfterTimeout
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 64034169

Change-Id: I501653405e8244543a4c27f736bacfa23d22e6f7
2017-08-10 11:17:27 -07:00
Felipe Leme
cb96f39155 Uses ParceledListSlice to allow larger number of datasets.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testAutofillLargeNumberOfDatasets
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 63669555

Change-Id: If0847da3bafa1bfd80ee8925e17aace82010aec9
2017-07-27 09:44:11 -07:00
Felipe Leme
e802d18f49 Merge "Don't show Save UI when values filled by user belong to a dataset." into oc-mr1-dev 2017-07-27 15:11:22 +00:00
TreeHugger Robot
2790352cd4 Merge "Added sliding motion / animation to Autofill Save UI." into oc-mr1-dev 2017-07-27 04:07:03 +00:00
TreeHugger Robot
db3c4ee787 Merge "Checks if mResponses is null before using it." into oc-mr1-dev 2017-07-27 01:00:58 +00:00
Felipe Leme
7641443f4b Added sliding motion / animation to Autofill Save UI.
Test: manual observation
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Fixes: 63680769

Change-Id: I62122733bb0e4b09de3347b091e27e60fbc51333
2017-07-26 17:09:05 -07:00
Felipe Leme
d0b18d665f Don't show Save UI when values filled by user belong to a dataset.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 63068654

Change-Id: Ia9c42d57b0e7c316bfd3c0ee29816db18ac478c1
2017-07-26 15:59:38 -07:00
Felipe Leme
afdfe7665c Checks if mResponses is null before using it.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testFillResponseAuthWhenAppCallsCancel
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 63806922
Bug: 63985284

Change-Id: I8d7cfa34ba88a1d351967e17717b387c805dd00d
2017-07-24 12:38:47 -07:00
Felipe Leme
325a0b04b5 DO NOT MERGE - Wraps custom save subtitle on ScrollView.
(cherrypick from Ided12e8dbce2c3d80c7db8f167109ed9108c904b)

Test: CtsAutoFillServiceTestCases pass
Test: manual verification

Change-Id: Ida44970d68755423cb080f4c562ddcdec90efa6f
Fixes: 62534917
2017-07-24 12:33:24 -07:00
Felipe Leme
7f9ca12b9a Support list type on CustomDescription.
Test: CtsAutoFillServiceTestCases pass
Test: CheckoutActivityTest.testCustomizedSaveUi

Bug: 62534917

Change-Id: I43dbd92a0db9d76b59328f74519147c952c6ab37
2017-07-18 17:40:45 -07:00
Felipe Leme
7fc29dd931 Changed SaveInfo so it supports just optional ids.
Test: existing CtsAutoFillServiceTestCases pass
Test: new tests on LoginActivityTest pass
Test: new SaveInfoTest pass

Fixes: 38044993

Change-Id: Iefcf9610b27361585444157616325e9e9a89158f
2017-07-18 17:40:44 -07:00
Felipe Leme
b078212a1e Don't log content of Autofill filter, since it could contain PII.
Test: manual verification
Fixes: 63680114

Change-Id: I92dcb88df6b577ee2f7a4065e8f9b14ba01ba3fb
2017-07-14 10:35:41 -07:00