Commit Graph

7009 Commits

Author SHA1 Message Date
Felipe Leme
640f30a776 Replaced auto-fill by autofill to keep it consistent with API style.
This change will affects 2 types of apps: autofill service implementations
and apps that use autofill APIs.

Since just the former is known to be used at the moment, we're not trying
to keep backward compatibility with the latter.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass
Test: android.provider.SettingsBackupTest pass

Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
2017-03-09 08:14:49 -08:00
Felipe Leme
d04a697ede Optimize ViewStructure for autofill by removing irrelevant nodes.
Test: CtsAutoFillServiceTestCases (with new tests) pass
Fixes: 35840787

Change-Id: Iaa2c1907c8383b4a820fd7204e67fa2d276ad2b8
2017-03-08 13:31:38 -08:00
TreeHugger Robot
7e547fbe88 Merge "Replace AutoFillType by view constants." 2017-03-08 21:08:56 +00:00
Felipe Leme
8931e30370 Replace AutoFillType by view constants.
Now that AutoFillType does have any logic (since the "subType" logic was moved
to AutoFillHint), it makes more sense to get rid of the type and use constants
directly.

This change creates the contants and "pseudo-deprecate" the old stuff: it's
still available because some clients are using it, but it will be removed once
they migrate.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass

Change-Id: I0efe7f0cc101c86164a18c85903bb871e1f13ba2
2017-03-07 10:43:17 -08:00
Abodunrinwa Toki
4cfda0beef TextClassifier: Introduce LocaleList in the API.
Test: API change. Ensured that tests (see topic) compiles
Bug: 35257733
Change-Id: I036af7948fcd691b8a7de586a9cc1b3165946f8a
2017-03-07 14:25:21 +00:00
Abodunrinwa Toki
0f502cb1b6 Merge "Prevent crashes when in insertion mode." 2017-03-07 12:54:52 +00:00
Abodunrinwa Toki
792d820cc9 Prevent crashes when in insertion mode.
Test: Manually tested. Automated core tests will be written in another
CL.

Change-Id: If07fa6a81e60de43d8be2cbcf37b355403779fb8
2017-03-06 23:51:11 +00:00
Clara Bayarri
e1be1dfbc3 Merge "Ignore non-font resource references in TextView constructor" 2017-03-06 10:40:24 +00:00
Felipe Leme
5591044864 Don't set auto-fill options when Spinner has no adapter.
Change-Id: Ib42fe5ba57d5ef31a00b39945ac3bcacbb217cc8
Fixes: 35965642
Bug: 33550221
Test: compilation only
2017-03-04 00:23:23 -08:00
Clara Bayarri
d134b89276 Ignore non-font resource references in TextView constructor
TextView was blowing up in its constructor when fontFamily was
set in xml to a reference that was not a font, e.g. @style/mystyle.

These values should be ignored as they are not valid, but we don't
want to crash the app for it either.

Bug: 35863153
Test: See topic
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources_setInXmlStyle

Change-Id: I5d9443e70a36122d312c3a9f2c0dcffb530dbca8
2017-03-03 18:13:28 +00:00
Philip P. Moltmann
ba6f462602 Add autoFillHint property to view
Bug: 35364993
Test: Ran amended ViewAttributesTest
Change-Id: Ib7d2c3dfd5b4a6b638b56c4583af4c9bdf37e346
2017-03-02 12:46:44 -08:00
TreeHugger Robot
1bef83f613 Merge "Added inputType to Assist API." 2017-03-02 03:01:50 +00:00
TreeHugger Robot
de06d67d16 Merge "Added auto-fill support for DatePicker and TimePicker." 2017-03-01 23:15:35 +00:00
Felipe Leme
305b72c925 Added auto-fill support for DatePicker and TimePicker.
Also fixed some getAutoFillType() implementations to return null
when the view is disabled.

Bug: 33550221
Bug: 35840787
Test: CtsAutoFillServiceTestCases (with new tests) pass
Test: m update-api

Change-Id: I46acc1fb106cf2153515cc1c9567b34cfabd1c62
2017-03-01 10:43:48 -08:00
Aurimas Liutikas
1ca63ec5fb Merge "Do not send onTimeChanged updates if nothing actually changed." 2017-02-28 22:35:58 +00:00
Aurimas Liutikas
2f16bc8a3a Do not send onTimeChanged updates if nothing actually changed.
Bug: 29314380
Test: android.widget.cts.TimePickerTest#testSetOnTimeChangedListener now passes.
Change-Id: I4df96cd306967027ea76e2c256b50ca687eae9ba
2017-02-28 12:19:30 -08:00
Abodunrinwa Toki
90ebaa8d2d Merge "Don't trigger textclassifier in a11y action." 2017-02-28 20:02:08 +00:00
Abodunrinwa Toki
117240cc0e Don't trigger textclassifier in a11y action.
Support for smart text share in a11y mode needs to be done differently.
See: b/34779222

Test: Manually tested
Bug: 35252502
Change-Id: Ia268065c21fc5ac716ca06a0ec9d3866fbd13aa4
2017-02-28 18:02:53 +00:00
Felipe Leme
16aafc36de Added inputType to Assist API.
It will be used mostly for auto-fill purposes..

Bug: 35364993
Test: CtsAutoFillServiceTestCase (with new tests) pass
Test: manual verification

Change-Id: Ia5b6ff94e66a7da385cfb6f42ad994fe5e1e976b
2017-02-27 14:09:44 -08:00
Andrei Stingaceanu
81926e39f0 Merge "AutoSize TextView (part 11) - fix final APIs" 2017-02-27 17:42:19 +00:00
Alan Viverette
8e1a729645 Implicitly cast views obtained via View.findView methods
Removes all explicit casts from android.widget classes. Also @removes
methods on ListView that were overriding @hidden methods and should
never have been exposed as public API.

Bug: 24137209
Test: make
Change-Id: I89f0e51258560987b3942251fd249210f825ac2a
2017-02-27 11:06:20 -05:00
Andrei Stingaceanu
ab18567419 AutoSize TextView (part 11) - fix final APIs
* public attr "autoSizeText" becomes "autoSizeTextType"
  (inlined with all other methods and naming)
* documentation for autoSizetextType "uniform" re-worked:
  "The TextView scales text size both horizontally and
  vertically to fit  within the container"
* converted comments into Javadoc for
  TextView#AUTO_SIZE_TEXT_TYPE_NONE and
  TextView#AUTO_SIZE_TEXT_TYPE_UNIFORM
* better documented attr "autoSizePresetSizes" to specify
  it is a resource array of dimensions
* various small fixes in comments

Bug: 35755149
Bug: 35763485
Bug: 35764658
Bug: 32221168
Test: run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.TextViewTest

Change-Id: I36afd399e005521b6e85922aa9e1e4418bb960e1
2017-02-27 15:17:46 +00:00
TreeHugger Robot
d77ae2b0ac Merge "Implement reset to original selection." 2017-02-25 02:57:55 +00:00
Abodunrinwa Toki
89ba5fbde0 Implement reset to original selection.
The UX for smart selection specifies that the user is able to reset
the original selection by tapping once on the word after smart
selection. Tap once, and the selection resets to the word that was
initially selected (before smart selection happened), tap one more
time and the insertion cursor appears as usual. If the user taps
a different word other than the original selection, the insertion
cursor appears as before.

Test: I7456eb4773d40366a3f4aa7bf051a1c7ddda6e9d
Bug: 34777048
Change-Id: If73259ddb67379d5a5deaa01b840b5185cedf4c8
2017-02-24 19:36:30 +00:00
Siyamed Sinir
a2ba2a3923 Merge "Revert "Request re-layout after setText if layout width is 0"" 2017-02-24 07:45:54 +00:00
Siyamed Sinir
6f29b7aa9e Revert "Request re-layout after setText if layout width is 0"
This reverts commit b4b8740aed.
Reverts fix for bug 27995311.

Test: cts-tradefed run cts --test android.widget.cts.TextViewTest -m
CtsWidgetTestCases --skip-device-info --skip-preconditions
--skip-connectivity-check

Fixes: 34843459
Change-Id: I2cea04cd12953b110c59a5a84e9eea5060fc038d
2017-02-23 20:20:26 -08:00
TreeHugger Robot
f30b879c73 Merge "Added sanitization for CompoundButton and RadioGroup." 2017-02-23 15:24:07 +00:00
Felipe Leme
62fb65fd3c Merge "Added auto-fill support for Spinner." 2017-02-23 06:45:16 +00:00
Aurimas Liutikas
4f911e1c5a Merge "Fix toggling of AM/PM of TimePicker using hardware keyboard." 2017-02-23 04:52:07 +00:00
TreeHugger Robot
4bc511cb66 Merge "VideoView: option for audio focus, support for AudioAttributes" 2017-02-23 04:37:54 +00:00
Felipe Leme
c01a873c4f Added sanitization for CompoundButton and RadioGroup.
Bug: 33269702
Bug: 33550221
Test: CtsAutoFillServiceTestCases (with new tests) pass

Change-Id: Ie2c8d2784227371588aa02973b8ef3ac1a6950aa
2017-02-22 19:15:38 -08:00
Aurimas Liutikas
c51c5f29fb Fix toggling of AM/PM of TimePicker using hardware keyboard.
Set AM/PM mode before setting hour in TextInputTimePickerView. This is
needed so we know exactly which it is when we are using 12 hour clock.
Not setting it early was causing TextInputTimePickerView to update TimePicker
with the hour that was not offset correctly based on AM/PM state.

Test: existing tests caught this - TimePickerTest#testKeyboardInputModeClockAmPm
      verified locally that this test now passes.
Bug: 35262830

Change-Id: I7e912320cb5a72c5d9d4e80dc0b42deb651f2636
2017-02-22 17:00:30 -08:00
Felipe Leme
d09ccb8db6 Added auto-fill support for Spinner.
Spinner is a special kind of list-value field because its auto-fillable
values are not currently present in the assist structure: this change
adds a getAutoFillOptions() to fill that void, and implements the
auto-fill APIs on Spinner.

It also fixes RadioGroup.getAutoFillValue() - it should return the index
of the child, not its resource id.

Bug: 33550221
Test: CtsAutoFillServiceTestCases (with new tests) pass
Change-Id: I625e7dd705fade56fda490fcd3c4446c0c245ee1
2017-02-22 16:09:50 -08:00
Felipe Leme
7be469ad9d Merge "Fixed missing auto-fill save callbacks on TextView." 2017-02-22 23:56:47 +00:00
Jean-Michel Trivi
0f49f82e97 VideoView: option for audio focus, support for AudioAttributes
Add API for VideoView to select whether it uses audio focus during
  playback, and how.
Add support for AudioAttributes

Test: cts-tradefed run cts -m CtsWidgetTestCases -t android.widget.cts.VideoViewTest
Bug 30955183
Bug 30258418

Change-Id: I581d32c79c78b8197ded2319e0d5bfdc35b93c5e
2017-02-22 12:04:24 -08:00
Felipe Leme
0257c8a5d2 Fixed missing auto-fill save callbacks on TextView.
It was accidentally broken during a previous commit where the CTS test
failure was ignored by a known issue being fixed in another change -
this change fixes both problems.

Bug: 33550221
Bug: 3380254
Test: CtsAutoFillServiceTestCases pass (for real now :-)
Change-Id: I5b2aa6060995ca255e51d85aa6ec93a886fa522f
2017-02-22 11:57:53 -08:00
TreeHugger Robot
7843f0a799 Merge "Added auto-fill listeners for RadioGroup and CompoundButton." 2017-02-22 18:58:54 +00:00
Andrei Stingaceanu
f6e3654b61 Merge "CalendarView Material - fix exception if date is out of range" 2017-02-22 10:45:52 +00:00
Felipe Leme
5882c4f5d2 Added auto-fill listeners for RadioGroup and CompoundButton.
Bug: 33550221
Bug: 3380254
Test: CtsAutoFillServiceTestCases pass

Change-Id: Ia9293d16b6fe092552e19563328697c298451f8a
2017-02-21 16:53:00 -08:00
Phil Weaver
385912ee2d Deprecate "speak passwords" setting.
This will now be controlled by individual accessibility services.
We'll provide the password information to them, and they can
present or hide the information as it makes sense for their users.

Password information was anyway provided when a headset was
connected.

Bug: 28139568
Test: Manually verified that TalkBack now speaks passwords on the
lock screen and in text views. Since I'm removing functionality
that didn't have tests, it's tricky to have specific tests.
Change-Id: Ic3c724ccce5762ee9dcd9e7dcbd4eae6734dd05e
2017-02-21 15:24:54 -08:00
Felipe Leme
33791fd54b Add API to mark sanitized fields and implement it on TextView.
When sending a ViewNode to the auto-fill service, it's necessary to sanitize
it so it does not contain PII (Personally Identifiable Information).

A good rule of thumb is to mark as sanitized nodes whose value were statically
set from resources. Ideally, that logic should belong to View, but View does
not know how its contexts are set, so the decision must be made by the
subclasses, and this CL implements that logic on TextView (which is the main
auto-fill type - others will come soon...)

Bug: 33269702

Test: CtsAutoFillServiceTestCases pass
Test: manual verification

Change-Id: I4dcdd8419a35812bd2f15a63a5be85f8cd97bb4e
2017-02-21 11:47:33 -08:00
Andrei Stingaceanu
fc9ea84680 CalendarView Material - fix exception if date is out of range
Due to not cherry-picking this change into N_MR1 fix the
version check to reflect this.

Bug: 28019187
Test: run cts-dev -m CtsWidgetTestCases -t \
      android.widget.cts.CalendarViewTest
Change-Id: I128d25c3ed949729e2afaeefad381bfb58d89ccd
2017-02-21 11:27:03 +00:00
Andrei Stingaceanu
2c2c3eea8e Merge "AutoSize TextView (part 10) - final APIs" 2017-02-20 10:27:07 +00:00
TreeHugger Robot
a42ba85b0e Merge "Clarify extra data argument nullness." 2017-02-17 19:47:02 +00:00
Phil Weaver
d666953f57 Clarify extra data argument nullness.
Bug: 35098706
Test: Trivial change, so I just verified that it builds.
Change-Id: I234afe4f1e52ef1c4c64e44b486a539f0d46854c
2017-02-17 09:55:46 -08:00
Andrei Stingaceanu
30574766ef AutoSize TextView (part 10) - final APIs
Gets rid of setting auto-size configuration
items one by one and instead provides setter
constructs that take all the params needed
to auto-size. This version is much closer to
how this feature can be set up from XML
attributes and also provides no doubt about
validation failures.

Bug: 32221168
Bug: 34494052
Test: in attached topic CL
Change-Id: Ic70ad43d5c6739ee312ea24984534a35c49c17dc
2017-02-17 12:02:10 +00:00
TreeHugger Robot
ceb250424a Merge "Resolve pointer icon over FastScroller to arrow." 2017-02-16 21:18:42 +00:00
Vladislav Kaznacheev
11372fa466 Resolve pointer icon over FastScroller to arrow.
Currently the icon defined by the host AbsListView is displayed
over the fast scroll area.

Bug: 35424111
Test: manual
Change-Id: Ia9897a44550922f16573b97337841c3f6ae263da
2017-02-16 09:37:56 -08:00
Andrei Stingaceanu
302fe9098b Merge "TextView/LinkMovementMethod/ClickableSpan - touch up revert" 2017-02-15 14:28:55 +00:00
TreeHugger Robot
fb30f7ca28 Merge "Do not move PopupWindow when its anchor is detached" 2017-02-13 19:59:49 +00:00