Commit Graph

9747 Commits

Author SHA1 Message Date
TreeHugger Robot
69a0f3f020 Merge "Clarify documentation for notification a11y events" into oc-dev 2017-05-11 01:57:08 +00:00
Svet Ganov
374cae1e61 Properly position dataset picker UI
Test: all autofill CTS tests pass

bug:37958210
bug:37986800

Change-Id: Ic2cb3b8c6762a922bdb7c632e451772b7a006739
2017-05-10 23:38:51 +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
Phil Weaver
33c7136dde Clarify documentation for notification a11y events
This javadoc was confusing the TalkBack team, so I've
clarified that these events can come from either a
notification or a toast. I also removed a note that I
found confusing and, as far as I could tell, was not
correct anyway.

Bug: 34851364
Test: Docs changes only. Relying on TreeHugger.
Change-Id: Ie5c6efd6e32ce1e33f8cc45c795cda7d7b2e6583
2017-05-09 16:17:02 -07:00
Rob Carr
3630fd4e11 Merge "SurfaceView: Release Surface with SurfaceControl." into oc-dev 2017-05-09 15:49:29 +00:00
Phil Weaver
8d25b77e4c Merge "NumberPicker a11y (and a11y-inspired) fixes" into oc-dev 2017-05-09 15:36:00 +00:00
Phil Weaver
64d6e3e11d Merge "Fix crash in a11y cache" into oc-dev 2017-05-09 15:30:30 +00:00
TreeHugger Robot
9f028643c2 Merge "Fix left/top in ViewNode for suppressed parents" into oc-dev 2017-05-09 02:15:43 +00:00
TreeHugger Robot
f512575c68 Merge changes I7c2c9411,Ibc72c84d,Ib3968644 into oc-dev
* changes:
  No need to deal with windowTokens
  Persistable accessibility ID from ContextWrappers
  Check callbacks when operting on UI
2017-05-09 01:49:58 +00:00
Philip P. Moltmann
f51b5f991c Merge "Read the autofill highlight from rootView context" into oc-dev 2017-05-08 23:06:31 +00:00
TreeHugger Robot
f0de5cdd9a Merge "Also check if view visible to user before engaging fill" into oc-dev 2017-05-08 21:10:53 +00:00
Philip P. Moltmann
134cee27b8 No need to deal with windowTokens
we have a link to the client which is enough to find the views.

Also there was some cases where the windowToken was not updated
properly. This is moot now.

Also: Read a array of views from the client to speed up the
client<->AutofillManager communication.

Fixes: 38070352
Test: CtsAutoFillServiceTestCases
      1 Started autofill, saw fill UI
      2 Home button
      3 Kill activity in background
      4 Recents -> back to activity
      5 Saw fill UI restored
Change-Id: I7c2c9411204fa5d65867efae9b7296399121c3a2
2017-05-08 14:02:58 -07:00
Philip P. Moltmann
ff6d6d9492 Persistable accessibility ID from ContextWrappers
Only IDs beyond LAST_APP_ACCESSIBILITY_ID can be reliably used for
autofilling. Other ids might change occasionally.

All Views attached to activities get usable IDs. Hence if a
ContextWrapper wraps an activity forward the goodness.

Also make sure that we don't accidentially autofill an unsafe view.

Test: Before the messaging handed out unusable Ids because it uses a
      Contextwrapper. Now it hands out good ideas (accoring to dumpsys)
      CtsAutoFillServiceTestCases
Bug: 38070352
Change-Id: Ibc72c84d77197019939abd231e8960988af7a592
2017-05-08 13:29:17 -07:00
Robert Carr
de84443489 SurfaceView: Release Surface with SurfaceControl.
Not so drastic as we were releasing the Server side resources
anyway but the close guard is producing a strict mode warning.

Bug: 35955183
Test: cts-tradefed run cts -m CtsViewTestCases -t android.view.cts.SurfaceViewTest#surfaceInvalidatedWhileDetaching
Change-Id: Id250fff8d001d5d82458af1a732c0e123f925dad
2017-05-08 12:12:30 -07:00
Svet Ganov
01e1a62997 Also check if view visible to user before engaging fill
Test: autofill CTS tests pass 

bug:37753348

Change-Id: Ia16bff13f2cfdf1d315e3f45cc114ee13b145eb5
2017-05-08 19:11:05 +00:00
Philip P. Moltmann
e926aad53d Fix left/top in ViewNode for suppressed parents
If parents of a view got suppressed in the autofill structure the left
and top value are not relative to their direct parents anymore. They
need to be relative to the next non-suppressed parent.

This does not change any values for assist structures.

Fixes: 36060132, 37444334
Test: CtsAutoFillServiceTestCases + new ones that check for the left and
      top parameters of view nodes.
Change-Id: I914ad028c7ed2f93ce44210cbe1a2a710673cbbb
2017-05-06 12:29:10 -07:00
Phil Weaver
2a86bad94c Merge "Properly translate text locations to screen coords" into oc-dev 2017-05-06 15:29:24 +00:00
Philip P. Moltmann
c368a240c9 Report less data in structure to autofill provider
Fixes: 35899963
Test: CtsAutoFillServiceTestCases, CtsAccessibilityTestCases,
      CtsAccessibilityServiceTestCases
Change-Id: Ia7dba3e252e7678c033d67bcf653e592f3134304
2017-05-05 14:20:11 -07:00
Phil Weaver
6c617f0a93 Properly translate text locations to screen coords
Using the same method as getBoundsInScreen.

Bug: 35095925
Test: Manually verified location with test app, ran a11y cts
Change-Id: I1eee2a4eb23912698be61c9030d92bbade1d743a
2017-05-05 14:19:58 -07:00
TreeHugger Robot
6dcae2b91f Merge "Reject smart selection if outside original selection." into oc-dev 2017-05-05 20:29:33 +00:00
TreeHugger Robot
dc4fc1ebc2 Merge "TextClassifier: Remove debug logs." into oc-dev 2017-05-05 17:49:43 +00:00
Abodunrinwa Toki
b416297433 Reject smart selection if outside original selection.
- The aim is to be defensive and prefer to reject a selection if
  it is likely to be wrong.

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 38019270
Change-Id: I35ebc84fb102373949366296434a31d899edfef3
2017-05-05 18:07:17 +01:00
Philip P. Moltmann
de97af1b6c Read the autofill highlight from rootView context
Fixes: 37792810
Test: CtsAutoFillServiceTestCases
      CtsUiRenderingTestCases:.testclasses.AutofillHighlightTests
Change-Id: Idb843d90f8abb591ba6845ab713745b0eafc4a92
2017-05-04 15:57:44 -07:00
Phil Weaver
61a1fabab6 Fix crash in a11y cache
Caused by bad data from an app where a node was its own ancestor.
When the node changed, the copy in the cache was recycled while
flushing the descendants. Now recovering more gracefully.

Bug: 37674439
Test: Adding a unit test for this case, ran a11y cts and unit tests,
verified that the app reporting bad data no longer crashes TalkBack.
Change-Id: I10bc9df2b4821529334a19aa27719c1510187690
2017-05-03 17:33:43 -07:00
Siyamed Sinir
5073b91236 Merge "Don't copy NoCopySpans for assist and autofill" into oc-dev 2017-05-04 00:27:31 +00:00
TreeHugger Robot
246cc5bf51 Merge "Removed deprecated ViewStructure.setUrl() method." into oc-dev 2017-05-03 23:16:15 +00:00
Abodunrinwa Toki
15644eff8d TextClassifier: Remove debug logs.
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 34778895
Change-Id: I1478fe1a2849b1d4661a71ecbf9a27f38430ee28
2017-05-03 21:10:20 +01:00
TreeHugger Robot
3baad0234b Merge "TextClassifier: Append http:// to url intents that need one." into oc-dev 2017-05-03 18:49:19 +00:00
Abodunrinwa Toki
70d41cd792 TextClassifier: Append http:// to url intents that need one.
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 36504599
Change-Id: I5008225a6a3df2d8e07e4a9ae0e340a6582f9e7b
2017-05-02 22:12:33 +01:00
Evan Rosky
3b213ed438 Merge "Don't focus search user-specified views which are invisible" into oc-dev 2017-05-02 20:54:12 +00:00
Felipe Leme
a8fce3b29e Don't copy NoCopySpans for assist and autofill
For AssistStructure, and AutofillValue, create a copy of the text in 
setText and forText methods if it is a Spanned.

Fixes: 36838999
Test: cts-tradefed run cts -m CtsAutoFillServiceTestCases
Test: cts-tradefed run cts -m CtsAssistTestCases
Test: cts-tradefed run cts --test android.widget.cts.TextViewTest -m \
      CtsWidgetTestCases

Change-Id: I52e780fa9baa17c375d3945dc714171f41fd7db5
2017-05-02 13:33:07 -07:00
Felipe Leme
61b7f12172 Removed deprecated ViewStructure.setUrl() method.
Fixes: 37623568
Test: CtsAutoFillServiceTestCases pass
Test: CtsAssistTestCases pass

Change-Id: I13cdf08f40ba3db31ddb3f104f99b7ab8839bd01
2017-05-02 10:58:42 -07:00
Phil Weaver
1d359a6d31 NumberPicker a11y (and a11y-inspired) fixes
- Sending scroll events for accessibility.
- Sending text update events when state changes.
- Blocking text updates during fling to reduce number of events.
- Making widget focusable by default, which keeps focus from
  moving to the rest of the UI when the text box becomes invisible.
- Managing visibility of the text box alongside IME state, so the
  IME won't decide to display the password keyboard during a fling.

Bug: 21494380
Bug: 37016501
Test: Ran NumberPicker CTS
Change-Id: I459d37d4a54c91e1cb5c7ec68fe0f012b25fb740
2017-05-02 10:43:34 -07:00
Abodunrinwa Toki
6ace893026 Close file descriptor after SmartSelection is initialized.
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 37446398
Change-Id: I6f6d927f447d3cc1dffaee2406ff240d0600eb19
2017-05-02 17:17:26 +00:00
Casey Burkhardt
337e2aae53 Merge "Refactor accessibility button support detection" into oc-dev 2017-05-02 04:05:30 +00:00
Evan Rosky
ca6b876575 Don't focus search user-specified views which are invisible
While searching for next user-specified focus, skip over any
views which are not visible. This will continue searching down
the chain until it either finds a visible view or until the
chain ends (at which point the normal findNextFocus search is
used).

This was causing problems in apps like the wallpaper selector
where focus would get stuck because calling requestFocus on an
invisible view is a no-op.

Bug: 37789849
Test: Added CTS. Checked that focus no-longer gets stuck in
      wallpaper app.

Change-Id: I1a52143bd6c63364418fe6250e6c3f83e2e1c726
2017-05-01 16:36:24 -07:00
Casey Burkhardt
ad217d1f86 Refactor accessibility button support detection
- Moves logic to detect devices capable of supporting the
  accessibility button into AccessibilityManager from
  SettingsLib to avoid issues with resource shifting in the
  SUW binary

Bug: 37650567
Test: Existing Robolectric / Manual
Merged-In: Ibb2aaa3c2f79570df768cfa796fa890988ef82cc
Change-Id: I83bbecdf7836ae0de32ce7d39155ac0c111a8f15
2017-05-01 15:53:17 -07:00
Jeff Sharkey
3ba7117164 Merge "Updates based on API council guidance." into oc-dev 2017-05-01 18:36:25 +00:00
TreeHugger Robot
093eb12994 Merge "TextClassifier: API rename" into oc-dev 2017-04-30 17:15:55 +00:00
TreeHugger Robot
4c60abc9ae Merge "Address API council comments" into oc-dev 2017-04-30 06:43:15 +00:00
Abodunrinwa Toki
e0b57893c6 TextClassifier: API rename
getTextClassificationResult() -> classifyText()
 TextClassificationResult -> TextClassification

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Bug: 37769880
Change-Id: I2d926e89058babf06bcff390bee3a45e965984e8
2017-04-30 01:06:03 +01: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
TreeHugger Robot
060f0f0341 Merge "A11y changes for API council" into oc-dev 2017-04-29 15:54:27 +00:00
Svet Ganov
f965b87a78 Address API council comments
bug:37769694
bug:37322491

Change-Id: I931cfb5ea5fef1505a97b169125ed2cdaaa3d6ff
2017-04-28 23:45:17 +00:00
Philip P. Moltmann
f5e4bfd856 Make autofilled highlight an attribute
Fixes: 37738299
Test: - CtsAutoFillServiceTestCases
      - CtsUiRenderingTestCases:.testclasses.AutofillHighlightTests

Change-Id: I6106f7b2e44d18cd8c80c084f25737e43cbc44de
2017-04-28 16:13:46 -07:00
Phil Weaver
be2922ff34 A11y changes for API council
Bug: 37749679
Bug: 37747749
Bug: 37737948
Bug: 37718183
Bug: 37720667
Bug: 37724600
Bug: 37708057

Test: Updating unit and cts tests, which still pass.
Change-Id: If28bdf985c4314e8e84dcd6510f406dd4e80dd38
2017-04-28 14:58:35 -07:00
Felipe Leme
c21f723ca2 Merge "Changed EXTRA_DATA_EXTRAS to EXTRA_CLIENT_STATE." into oc-dev 2017-04-28 20:29:49 +00:00
Felipe Leme
37a440fd8b Changed EXTRA_DATA_EXTRAS to EXTRA_CLIENT_STATE.
Test: CtsAutoFillServiceTestCases pass

Fixes: 37775662

Change-Id: I85c016c3eb84a439371ac707f78b01d9882b75e9
2017-04-28 11:03:57 -07:00
Evan Rosky
7666d6f967 Merge "removeAllViews should also clean-up focusedInCluster" into oc-dev 2017-04-28 17:05:46 +00: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