Commit Graph

928 Commits

Author SHA1 Message Date
Felipe Leme
2ef19c1d73 Improved documentation for AutofillService package:
- Moved (and expanded) overall documentation from FillResponse to
  AutofillService.
- Improved SaveInfo documentation.
- Improved FillRequest documentation.
- Improved Dataset documentation.

Bug: 37567048
Test: ran 'm -j doc-comment-check-docs' and checked resulting HTML

Change-Id: I157893deac06a5ed5e1cb7fd082da485f227b9ee
2017-06-22 15:25:31 -07:00
TreeHugger Robot
4f7fd183eb Merge changes from topics 'bug_62802026_take_2', 'bug_62802026' into oc-dev
* changes:
  Don't add FillEventHistory events to the wrong session.
  Fixed how FillEventHistory is reset and clarified javadoc.
2017-06-21 03:45:50 +00:00
Felipe Leme
d013bcea97 Don't add FillEventHistory events to the wrong session.
The AutofillSession.getFillEventHistory() method returns only the event history
for the last onFillRequest(). In the scenario where the user switches
activities and the server has multiple sessions open, only the events for the
last session should be recorded.

Test: existing CtsAutoFillServiceTestCases pass
Test: LoginActivityTest.checkFillSelectionFromPreviousSessionIsDiscarded

Fixes: 62802026

Change-Id: I447ed77c2167095867b35d616b5cf2ae43aa28db
2017-06-20 17:31:20 -07:00
Felipe Leme
2e30c6f371 Fixed how FillEventHistory is reset and clarified javadoc.
Test: existing CtsAutoFillServiceTestCases pass
Test: checkFillSelectionIsResetAfterReturningNull()
Test: checkFillSelectionIsResetAfterReturningError()
Test: checkFillSelectionIsResetAfterTimeout()

Bug: 62802026

Change-Id: I389d95fc13c08f1056960e5f67e131c8dc306401
2017-06-20 14:54:05 -07:00
Felipe Leme
bce4b7f127 Removed deprecated, hidden method.
Test: existing CtsAutoFillServiceTestCases pass
Bug: 37563972

Change-Id: I10c5a2b16b422694d72b3ccaf6629d50247c7f49
2017-06-20 10:21:41 -07:00
Felipe Leme
266752317b Fixed updateAutofillValue() when mText is not set.
updateAutofillValue() was crashing some apps when the mText was not set at the
time it was called. One solution would be to not set mText at all - since the
Autofill Service should rely only on getAutofillValue() - but that could break
existing services.

Hence, a safer solution is to set that field if it's null.

Test: existing CtsAutoFillServiceTestCases tests pass
Test: manual verification using Fly Delta app

Fixes: 62751039

Change-Id: I91a8e0ed5db4148f5eb5729b8e254aa3531f15e4
2017-06-19 11:43:33 -07:00
TreeHugger Robot
a89414962d Merge "Use an optimized findViewNodeByAutofillId(id) to get just one node." into oc-dev 2017-06-16 21:45:46 +00:00
Felipe Leme
94b56207a4 Use an optimized findViewNodeByAutofillId(id) to get just one node.
Session was using findViewNodesByAutofillIds(ids) before, which not only was
not optimal, but error prone (for example, it could return a non-empty array
with an empty value).

Test: CtsAutoFillServiceTestCases pass
Fixes: 62532979

Change-Id: If984f1263cc3f2aac1d1e098687fe02d73c55211
2017-06-16 11:51:49 -07:00
Felipe Leme
18d0ef70b0 Throw IAE when service add null AutofillIds on SaveInfo methods.
Test: existing CtsAutoFillServiceTestCases pass
Test: manual verification using Contacts app
Test: manual verification adding a CTS test case that crashes the app, but such
      test cannot be commit because once the issue is fixed, it crashes the
      service (the right way to test this fix is through unit tests against
      exceptional conditions, but we don't support those on Autofill yet).

Fixes: 62649290

Change-Id: I8fc01fa929270219cd40035ff02eaf0dda5ecbfa
2017-06-15 16:33:52 -07:00
Felipe Leme
d52611258e Removed deprecated setExtras() method.
Bug: 37563972
Test: CtsAutoFillServiceTestCases pass

Change-Id: I7fef7c81267dad9097c711dbba849adf9d6b1cc5
2017-06-09 16:19:58 -07:00
Felipe Leme
2e723982d5 Merge "Use initial value on save when value didn't change." into oc-dev 2017-06-07 00:25:11 +00:00
Felipe Leme
e8f6808079 Use initial value on save when value didn't change.
Otherwise, it will fail to call onSaveRequest() in scenarios where the service
required a field that was pre-populated for the app. For example, when the
service requires both a username and password, the app pre-populates the
username, and the user fills the password.

Test: new LoginActivityTest.testSaveOnlyTwoRequiredFieldsOnePrefilled() pass
Test: existing CtsAutoFillServiceTestCases pass

Bug: 62270740

Change-Id: Idbb11a8c2dab6741c18549c55dfdb71b483c2447
2017-06-06 13:49:42 -07:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Chris Wren
b39217972e add channel and group tags to the notificaiton logs
Change-Id: Icf029e42fca46262c9d9f8ff63f26de098f888bf
Fixes: 37714086
Test: runtest systemui-notification
2017-06-02 16:19:13 -04:00
Winson Chung
fc3ec4c5e6 Prevent showing voice session when it is already queued to be hidden.
- It is possible for the session to be requested to be hidden before it
  gets the message to be shown and completes showing. This leads to an
  inconsistency where the voice interaction service implementation will be
  in a different state than the system for the session. Instead, we can
  cancel any pending show messages, and also clean up the pending show
  callback list immediately when the session is hidden.
- Also fixing up some error message codes when starting the assistant
  activity.

Bug: 38379130
Test: android.server.cts.ActivityManagerAssistantStackTests
Test: CtsVoiceInteractionTestCases
Test: CtsAlarmClockTestCases
Change-Id: I0d0e9c024367a47bda82d6a29ca89e18b7d69527
2017-06-01 22:58:01 +00:00
Felipe Leme
73fedacfeb Removed deprecated APIs.
Test: CtsAutoFillServiceTestCases pass
Test: manual verification with existing service

Bug: 37563972

Change-Id: Ibea2810f9230f06e59d2d81e4ba853de54987956
2017-05-12 10:32:45 -07:00
TreeHugger Robot
6ab00addb1 Merge "Speed up structure update before OnFillRequest" into oc-dev 2017-05-11 03:22:22 +00:00
Philip P. Moltmann
22567d3415 Speed up structure update before OnFillRequest
We now
- cache AutofillId -> ViewNode
- look for all AutofillIds at the same time (instead of one by one)

Bug: 37997043
Test: CtsAutoFillServiceTestCases
Change-Id: I094468ad885eed0cc506b4b62ff09c4af48570ff
2017-05-10 17:29:04 -07:00
Ruben Brunk
4d73fd5765 Merge "Fix VR component enforcement for "2D in 3D" apps." into oc-dev 2017-05-10 18:19:06 +00:00
Svetoslav Ganov
a9379d0b44 Allow null fill values to support authentication case
If a dataset needs to be authenticated the fill service
may not have the values but needs to tell the system for
which fields to show the fill UI. We now allow passing
a null value to mean the view is a part of the dataset
semantically but its value should remain unchanged.

If a dataset has no values, i.e. the related autofill ids
are mapped to null, we cannot properly filter. In this case
we always match such items regardless what the user typed.

While at this improved accessibility support for filtering
to announce when the number of items being filtered changes.

Also while at this allowed a dataset authentication to return
a response which replaces the current response and refreshes
the UI. Matching datasets with null values to any text plus
allowing a response to be returned from a dataset auth enables
the use case where there is always "Import" item at the
end of the list which when clicked can show arbitrarily more
data entries associated to other apps.

Another change is that we now provide the client state
bundle on both request and dataset auth.

Finally, this change gets rid of dataset waiting auth and
response waiting auth concepts since the reference to the
response and the dataset is piped with the auth request.

Fixed a bug where the width of the autofill UI was not
properly measured by going over all items in the adapter.
Now we measure enough height to fit the first three and the
width id the width of the widest item in the adapter.

Test: Added LoginActivityTest#testDatasetAuthTwoFieldsReplaceResponse
      Added LoginActivityTest#testDatasetAuthTwoFieldsNoValues
      Added LiginActivityTest#filterTextNullValuesAlwaysMatched
      All autofill CTS tests pass

bug:37724701
bug:37424539

Change-Id: Ic19e5d7cbdbb7d110c9e7da0ad60b540cbf1aecf
2017-05-09 17:40:28 -07:00
Jeff Sharkey
bbc764e83a Merge "Fix broken SystemApi docs." into oc-dev 2017-05-09 22:56:23 +00:00
Jeff Sharkey
412aa37fea Fix broken SystemApi docs.
These broken docs were causing the docs build to completely fail.

Test: make -j32 online-system-api-sdk-docs
Bug: 38164929
Change-Id: I7f5fd4922e20e1a42af953f86f3c652655bc9192
2017-05-09 11:57:10 -06:00
TreeHugger Robot
1c38d29482 Merge "Fixed scenario where an authentication response has no dataset." into oc-dev 2017-05-08 19:20:16 +00:00
TreeHugger Robot
daefe1dcc7 Merge "Remove controller connection API" into oc-dev 2017-05-08 16:30:37 +00:00
Svet Ganov
ecfa58a113 Add call super
Test: manual

bug:37775067

Change-Id: I50a50f1fbdb7e9c087c72ad0be3b767aeab9572a
2017-05-06 14:06:49 -07:00
Felipe Leme
8fd0575327 Fixed scenario where an authentication response has no dataset.
Also use getUiForShowing() on all relevant places, and added missing
SaveDataType value.

Test: LoginActivityTest.testFillResponseAuthServiceHasNoData()
Test: manual verification

Fixes: 37711385
Fixes: 38009452

Change-Id: Id69c831f96fb9ac35d1f2d86cfd41e76428c776e
2017-05-05 17:17:07 -07:00
Ruben Brunk
666505ec35 Fix VR component enforcement for "2D in 3D" apps.
Bug: 38004624

Test: Launch 2D in 3D application, check that null is delivered
VrListenerService#onCurrentVrActivityChanged.

Change-Id: I8ecb3d2fd4fa686ec43509852f4bc5f7d11d665c
2017-05-04 16:54:46 -07:00
Daniel Nicoara
1336a806f9 Remove controller connection API
No longer need the proxy since VR Window Manager is in VrCore.

Bug: 36506799, 37542947
Test: Compiled and ran in VR on device.
Change-Id: Id5b5f34a1ad2b6da263527463d63777d40f18085
2017-05-04 16:42:34 -04:00
Karthik Ravi Shankar
2b9aaedf63 Rename CompatibilityDisplay to Vr2dDisplay
CompatibilityDisplay used for displaying 2D activities in Vr world. This
is confusing in more than one way. To clarify what it really means,
rename it to Vr2dDisplay.

Changes in this CL -

- /s/CompatibilityDisplay/Vr2dDisplay
- /s/Compatibility/Vr2d - in CompatibilityDisplay context.

Bug: 37851944
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
passes on Marlin.

Change-Id: I0a442302fa9d0f48bbd0c01a7766b94369e04386
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
2017-05-03 22:16:02 -07:00
TreeHugger Robot
136a48e36a Merge "Removed deprecated setAuthentication() method that didn't take ids." into oc-dev 2017-05-02 00:53:34 +00:00
Felipe Leme
c2430f3c4d Removed deprecated setAuthentication() method that didn't take ids.
Such method would cause the AutofillUi to show on all fields, now it only
shows in the fields the service is interested on.

This doesn't solve FillResponse auth on multiple partition, but that will
come soon...

Bug: 37424539
Test: removed hack from testFillResponseAuthJustOneField()
Test: CtsAutoFillServiceTestCases pass

Change-Id: Id97dddfb9fc1630cd6bac96b9bae9d4a2986dd6d
2017-05-01 11:21:54 -07:00
Jeff Sharkey
000ce80505 Updates based on API council guidance.
Test: builds, boots
Change-Id: I223faf55c1e1b4d81d11b4c8b2d93ccd131c969b
Fixes: 37775662
Fixes: 37748635
Fixes: 37673408
Fixes: 37672564
Fixes: 37672218
Fixes: 37638323
Fixes: 37637423
2017-04-29 13:14:17 -06:00
Jeff Sharkey
1a74942fbf Respond to API council feedback.
Test: builds
Bug: 37752002
Change-Id: I7ae1699c4c5e1a098d16465c41fb41510478b678
2017-04-28 14:24:03 -06:00
Felipe Leme
9f9ee25515 Improved Autofill logging.
- Removed ui.Helper.
- Replaced DEBUG and VERBOSE constants by sDebug and sVerbose.
- Added a shell command to dynamically set the constants.
- Removed obsoleted log statements.
- Changed log-level of some log entries.
- Removed unused methods.

Fixes: 36141126

Test: CtsAutoFillServiceTestCases pass
Test: manual verification

Change-Id: Ic08ee9a2adc10e63f49bbcc7ed126455462dc9c1
2017-04-28 06:56:23 -07:00
Julia Reynolds
b8d4a94867 Merge "Documentation updates" into oc-dev 2017-04-28 13:44:10 +00:00
Felipe Leme
0aa4c5065d Refactored Autofill to move starting flag out of Session.
Otherwise, all onFillRequest() calls in the same partition would use
the same flags.

Fixes: 37675138
Test: existing CtsAutoFillServiceTestCases pass
Test: CtsAssistTestCases pass
Test: PartitionedActivityTest.testAutofill4ParitionsMixManualAndAuto() pass

Change-Id: I03c8a036637bae534904d4f41265e451088cf940
2017-04-27 23:38:14 -07:00
TreeHugger Robot
a851b5ae76 Merge "DO NOT MERGE Revert "Wallpaper color extraction API stub"" into oc-dev 2017-04-27 21:44:56 +00:00
Julia Reynolds
0ffc13b9f2 Documentation updates
Test: make
Change-Id: I9c02b3bd40ff19615747d238b1156d5d21e492e6
Fixes: 37736867
Bug: 37743680
2017-04-27 20:53:34 +00:00
TreeHugger Robot
d915c42150 Merge "Autofill binding permission fixes." into oc-dev 2017-04-27 04:56:44 +00:00
TreeHugger Robot
f84467e19f Merge "Api updates" into oc-dev 2017-04-27 04:51:46 +00:00
Felipe Leme
decd887f01 Autofill binding permission fixes.
- Removed deprecated BIND_AUTO_FILL
- Renamed BIND_AUTOFILL to BIND_AUTOFILL_SERVICE
- Kept BIND_AUTOFILL as @hide
- Fixed the permission code

The permission check was actually ignored; it was probably broken when we
introduced support to settings.

Fixes: 37723410
Bug: 37563972
Test: manual verification with existing client
Test: CtsAutoFillServiceTestCases pass

Change-Id: If3abdcb0ae850f0a327bfdbb9ca6c44a24823047
2017-04-26 17:57:53 -07:00
Lucas Dupin
3fd72ff2e7 DO NOT MERGE Revert "Wallpaper color extraction API stub"
This reverts commit c40608c041.

Change-Id: Ia202f4b48b8ba22497db8aa97ba53d412f7b7bd5
2017-04-26 19:28:10 +00:00
Svetoslav Ganov
dc6cccb905 Get rid of custom negaitve save button label
Removed the ability for an autofill provider to set
a custom string for the negative button. Also make
the old hidden APIs non-abstract to avoid runime
crashes for unimplemented methods.

Test: CtsAutoFillServiceTestCases pass

bug:37649790

Change-Id: If776d26de48382eeb064bdead5d4d5fdb0ff2e7e
2017-04-26 16:48:20 +00:00
Philip P. Moltmann
121e526476 Return all previous FillContexts onFill
Test: CtsAutoFillServiceTestCases
Fixes: 37673341
Change-Id: I80feb5bd8d6027fb4ec2dd32f5c486dae7c6bc4c
2017-04-25 16:48:31 -07:00
Philip P. Moltmann
c761963214 Report multiple FillContext-s onSave
To make life easier the reponseId is not part of the FillResponse.

Test: CtsAutofillServiceTestCases (added test for multiple Contexts)
Change-Id: If09e00b7267d293e4234a7a9837ad88d73af1b24
Fixes: 36481649
2017-04-25 15:22:08 -07:00
Julia Reynolds
bad4297600 Api updates
- Better documentation on DEFAULT_CHANNEL_ID
- Renaming getChannel/setChannel/getTimeout/setTimeout
- Add documentation to getShortcutId
- @hide parcel constructors

Test: make, make cts
Bug: 37672218

Change-Id: I695b2620c51638a84930e9d1c5fbfd6d85699b55
2017-04-25 17:00:05 -04:00
Felipe Leme
6a77849cca Make new onFill/onSave methods abstract.
Test: CtsAutoFillServiceTestCases pass
Test: manual verification

Bug: 37563972

Change-Id: I1447bcc3ac03b3cbf71362f370abedb9f00152b9
2017-04-25 09:27:28 -07:00
TreeHugger Robot
f40d1cb773 Merge "Take new autofill structure for each partition" into oc-dev 2017-04-25 07:31:30 +00:00
TreeHugger Robot
59fe3108fa Merge "Hide deprecated APIs." into oc-dev 2017-04-25 05:09:27 +00:00
Philip P. Moltmann
2f517c26d2 Take new autofill structure for each partition
Bug: 36481649
Test: CtsAutofillServiceTestCases (now with a test that has an autofill
      session over two full screen fragments)
Change-Id: I55f2f6203f3bd5a7082b4ce90500d2c16a260c7d
2017-04-24 16:50:14 -07:00