Commit Graph

7068 Commits

Author SHA1 Message Date
TreeHugger Robot
92f76ba958 Merge "Moar pre-partitioning refactoring." into oc-dev 2017-03-31 23:52:02 +00:00
Felipe Leme
78696bfeb7 Moar pre-partitioning refactoring.
On ViewState: split value into mCurrentValue and mAutofilledValue.
On Session: replacing mAutofilledDataset by mDatasetWaitingAuth and
            ViewState.getAutofilledValue() (mAutofilledDataset is still needed,
	    but will be removed in the first partitioning CL).

Also fixed a missed 'return' on TimePicker.autofill()

Bug: 35707731
Test: CtsAutoFillServiceTestCases pass

Change-Id: Icc32701ae3e499a77d99e6ae1daa7d070a3df631
2017-03-31 10:24:39 -07:00
Evan Rosky
27b0a55fab Merge "Prevent arrow keys from leaving editable TextViews" into oc-dev 2017-03-31 16:27:57 +00:00
TreeHugger Robot
774b1f1f37 Merge "Split scroll factor into a 2d float." into oc-dev 2017-03-31 14:54:45 +00:00
Evan Rosky
d4cef42ba1 Prevent arrow keys from leaving editable TextViews
Bug: 24342334
Bug: 31662248
Test: Tested in a test-app and verified that arrow presses/holding
      do not send focus out of an EditText. Relevant TextViewTest
      and EditTextTest s still pass

Change-Id: I288d9397d61844b8b650ed54cfbb6769226074b8
(cherry picked from commit I6abfe75352f09a49ea473fb0e2dec84c6c5270c4)
2017-03-30 16:37:16 -07:00
TreeHugger Robot
dada7c0e71 Merge "TextClassificationManager API updates." into oc-dev 2017-03-30 19:17:24 +00:00
Abodunrinwa Toki
df61b0328e TextClassificationManager API updates.
- Changes getDefaultTextClassifier to getTextClassifier
- Adds a setTextClassifier API

Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -t
android.widget.cts.TextViewTest
Bug: 35763797

Change-Id: I24e86272cf58bf6864505bee3b06978c1c0d46e5
2017-03-30 14:15:44 +01:00
Felipe Leme
955e252a95 Simplified autofill() methods by returning void instead of boolean.
Test: CtsAutoFillServiceTestCases pass

Change-Id: Ic94e6686e291fed60ef6715bd160f9b568bf0ea6
2017-03-29 18:16:40 -07:00
Aaron Whyte
f830652e97 Split scroll factor into a 2d float.
Test: Existing unit tests, manual sanity check.
BUG=35764483

Change-Id: If6ac121452698747e1f8bc9d4ec0111bb881d4d4
(cherry picked from commit e9956c5c65)
2017-03-29 23:34:56 +00:00
Evan Rosky
18b886e8b2 Allow cluster navigation to jump into touchscreenBlocksFocus
Adds an exception to touchscreenBlocksFocus ViewGroups which
are also keyboardNavigationClusters. The behavior we want is
that cluster navigation can jump into touchscreenBlocksFocus
clusters but normal keyboard navigation can't. Once focus is
in a touchscreenBlocksFocus cluster; however, we allow focus
navigation to move freely within that cluster. It remains in
that cluster until a subsequent cluster navigation brings it
back out.

Adds back the touchscreenBlocksFocus attributes to Toolbar
and actionbar so that they behave like they did before.

Bug: 34363323
Test: Added CTS test. Verified desired behavior in a test app

Change-Id: I555bf5570b16a57f0d4c8a020ae509a1e1b33910
(cherry picked from commit aee802f3bc)
2017-03-29 22:18:56 +00:00
Phil Weaver
ec66fb8f99 Fix problem with ListView accessibility focus
A scrap view was retaining accessibility focus, leading to
a confusing experience for screen reader users.

Part of the problem is that views can change even when the
adapter has stable ids. This change tightens the condition
for restoring a11y focus to the same view.

AbsListView also allowed scrap views to maintain a11y focus.
While this may make sense if the views will be reused, it is
wrong if the views are not reused.

Bug: 29403113
Test: Verified that a11y focus stays put when toggling the
preference: Settings -> System -> Language & input ->
Virtual keyboards -> Advanced -> Symbol for physical keyboard

Change-Id: Ie4a15027088f158d9ed4bb3f3eeff5a288c25832
(cherry picked from commit ab4717aa2a)
2017-03-29 15:34:30 +00:00
Shunta Sato
ec2952bc4a Don't allow the negative height of ListPopupWindow
Symptom:
If an application set a negative height to the popup list,
surfaceflinger is crashed with SIGABRT.

Root cause:
WindowManagerService dose not expect negative
height of ListPopupWindow. If it's negative,
WindowManagerService set the negative value to GraphicBufferAlloc,
but GraphicBufferAlloc handle the value as unsigned int,
then surfaceflinger is crashed with SIGABRT.

Solution:
Setting a negative height is a developer error.
We should throw an IAE from setHeigh(int).

Bug: 33441454

Author: Kazuki Nakayama <kazuki.x.nakayama@sonymobile.com>
Change-Id: I5887674d302e567abfe66147de4819cfdf0ef97b
2017-03-28 13:36:36 -07:00
TreeHugger Robot
212310ee71 Merge "Fixed yet another missing check for null anchor..." 2017-03-28 00:50:11 +00:00
Felipe Leme
6f79717014 Fixed yet another missing check for null anchor...
Test: CtsAutoFillServiceTestCases pass
Bug: 36643768

Change-Id: I6f97f3aec88c59a94c593958aca8b4a992d4806e
2017-03-27 15:45:47 -07:00
Alan Viverette
b758b3542a Merge "Avoid NPE when PopupWindow is shown while dismissing" 2017-03-27 21:21:18 +00:00
TreeHugger Robot
b237e442b7 Merge "TextClassifier updates" 2017-03-27 19:21:04 +00:00
Abodunrinwa Toki
d2d1399a62 TextClassifier updates
- Increase the size of the text sent as context to the classifier
- Pass regex match hints to the classifer

Test: Build still works. Regex hints logged correctly. The hints won't
matter until we've actually passed in this values to native code. Native
library test will be written and I've got a tracker bug to write more robust Java tests.

Bug: 35416389
Bug: 36584397

Change-Id: I29e56189b388b36dc0cc7a8bb13ef237ff55be7b
2017-03-27 17:53:24 +01:00
Felipe Leme
dd23777dfb Fixed check for null Anchor.
It was checking if the weak reference pointee was null, but not for a null
weak reference per se.

Fixes: 36643768
Test: manual verification
Test: CtsAutoFillServiceTestCases pass

Change-Id: I106dfd4a91ff1d45f8cb3141a992b06cbe460367
2017-03-27 09:44:07 -07:00
Felipe Leme
63d9831020 Merge "Make auto-fill UI robust" 2017-03-25 00:36:48 +00:00
Felipe Leme
4753bb0c34 Make auto-fill UI robust
Now the autofill UI tracks the movement of the anchor view,
both real and virtual and while still preventing the filled
app from accessing the chooser UI. This was achieved by using
a popup window in the app process to determine the window
location and adding a window presenter interface to popup
window that controls the actual window addition, removal, and
update which is implemented by the system server.

Test: all autofill CTS tests pass

bug: 36392498
bug: 35708258
bug: 34943932
fixes: 36039182
fixes: 36493078

Change-Id: I0321913b2e2e759f4b17003bf85cb873e63a467c
2017-03-24 15:16:28 -07:00
Felipe Leme
119205629e Checks if an adapter item is null before addint it to options.
Change-Id: I60634d0990d1d5bc33703abd41997e560f59ec77
Fixes: 36589254
Test: CheckoutActivityTest.testAutoFillDynamicAdapterWithNullItems()
2017-03-24 10:41:45 -07:00
Clara Bayarri
7c9e897c7d Merge "Fix textStyle being ignored for Font resources in TextView" 2017-03-24 11:11:23 +00:00
TreeHugger Robot
55807c973b Merge "Anchor a cascading submenu to its parent menu item" 2017-03-23 23:25:41 +00:00
TreeHugger Robot
b74767958d Merge "Respect PopupWindow.setOverlapAnchor when above anchor" 2017-03-23 21:03:00 +00:00
Alan Viverette
7e1aeb791e Avoid NPE when PopupWindow is shown while dismissing
Bug: 36468675
Test: PopupWindowTest#testEnterExitInterruption
Change-Id: I03bd297c4e7f7653dfff801ec0adfd7ab869abb5
2017-03-23 15:29:26 -04:00
Seigo Nonaka
3e2936413d Update setJustify API reference.
Bug: 35766005
Bug: 35764323
Test: N/A
Change-Id: I2d4b398479cdb3ac87257de95eb6a02f03c639bf
2017-03-23 10:30:55 -07:00
Alan Viverette
503b5cccd7 Merge "Skip ListPopupWindow position update if detached" am: c45b10a9cb am: 3107a17ba7
am: 300bb66b2f

Change-Id: I5b7590805a1dfaf45eb1a8a9a22f6ab47a7dfdfa
2017-03-23 14:36:42 +00:00
Alan Viverette
3107a17ba7 Merge "Skip ListPopupWindow position update if detached"
am: c45b10a9cb

Change-Id: I85f5250d4b37b771ff4d39d80082e8355154ed57
2017-03-23 14:25:07 +00:00
Clara Bayarri
576ee7de7d Fix textStyle being ignored for Font resources in TextView
When a font resource is set via fontFamily, the textStyle
attribute was being ignored.

Bug: 36505747
Test: cts attached in topic
Change-Id: I6418297d9a289460a3b36c6883441ac48ea33b22
2017-03-23 13:48:22 +00:00
TreeHugger Robot
8515afe08b Merge "Revert "Move expensive TextClock operations to onAttach"" 2017-03-22 05:42:58 +00:00
Ian Pedowitz
cbba5f3090 Revert "Move expensive TextClock operations to onAttach"
This reverts commit dffe6fdfe1.

Bug: 36472151
Change-Id: I98ba047bd4225d82414425a40e9a2e50c4473bf9
2017-03-22 02:09:13 +00:00
Christine Franks
3910adfb62 Merge "Add color temperature preference for Night Display" 2017-03-20 18:03:49 +00:00
TreeHugger Robot
7d50ff11db Merge "Notify caller if none of settings are effective." 2017-03-20 17:37:15 +00:00
Christine Franks
6418d0b890 Add color temperature preference for Night Display
Bug: 32463283
Test: adb shell settings put secure night_display_color_temperature
XXXX, where XXXX is {0, 2900, 4000, 7000}, and the temperatures
outside the valid range are capped at the min/max, respectively.
Change-Id: I322c0a907b30742fc312a9938fd0c47f679e580b
2017-03-20 09:07:17 -07:00
Andrei Stingaceanu
40c3ab0f89 Merge "AutoSize TextView (part 12) - ellipsize & more fixes" 2017-03-20 10:53:46 +00:00
Yohei Yukawa
2565a526a8 Merge "Deprecate IMM#showSoftInputUnchecked() part 1" 2017-03-17 22:05:21 +00:00
Andrei Stingaceanu
4e9c10afa6 AutoSize TextView (part 12) - ellipsize & more fixes
* ellipsize is being taken into account when auto-
  sizing text; the ellipsis is applied once the
  minimum text size for auto-size has been chosen
  as the best fit
* isolated the preset sizes configuration and used
  it both in the setter and ctor => consistency
* stuffed all possible TextView attributes to the
  StaticLayout we use for measurements for a more
  precise result
* fixed a bug where the default granularity was
  not properly applied resulting in an error in
  ctor
* fixed all auto-size error messages

Bug: 33574040
Bug: 32221168
Test: attached in the same topic
Change-Id: I36fa7c242d588bf597110bb02a26c90ae1f1943a
2017-03-17 11:08:25 +00:00
Philip P. Moltmann
7b77116802 TRON log important auto-fill events
Example log from
android.autofillservice.cts.LoginActivityTest#testAutoFill#testAutoFillOneDatasetAndSave
(translated from numbers of human readable string):

AUTOFILL_SESSION_STARTED
   package=android.autofillservice.cts
AUTOFILL_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
AUTOFILL_FILL_UI
   type=TYPE_ACTION
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
   FIELD_AUTOFILL_FILTERTEXT_LEN=0
AUTOFILL_DATASET_APPLIED
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_VALUES=2
   FIELD_AUTOFILL_NUM_VIEWS_FILLED=2
AUTOFILL_SAVE_UI
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_IDS=2
AUTOFILL_DATA_SAVE_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
AUTOFILL_SESSION_FINISHED
   package=android.autofillservice.cts

Test: Ran auto-fill tests and looked at event log.
Change-Id: I58aaa58e4435e7d04c8cd91878411943d3eb13de
2017-03-16 15:41:33 -07:00
TreeHugger Robot
5bf03b7640 Merge "Allow users to manually request Autofill." 2017-03-16 01:33:46 +00:00
TreeHugger Robot
65d1c294b1 Merge "Move expensive TextClock operations to onAttach" 2017-03-16 01:10:23 +00:00
Seigo Nonaka
0763650a13 Notify caller if none of settings are effective.
Now setFontVariationSettings returns false if the given settings is not
effective.

Bug:35764323
Test: ran TextViewTest and PaintTest in cts
Change-Id: Ic31d9e47ec006c8e7bb2c907ff0ea2936bd71d01
2017-03-15 14:05:37 -07:00
Felipe Leme
2ac463e3f5 Allow users to manually request Autofill.
- Added a requestAutofill(view,flags) method, that when passed with
  FLAG_MANUAL_AUTOFILL triggers a manual request.
- Added same method for virtual views
- Overloaded existing AutofillService request methods to take a flag.
- Added an AUTOFILL context menu option on TextViews.
- Added a canRequestAutofill() that is used to enable the context menu.

BUG: 35708229
Test: manual verification
Test: existing CtsAutoFillServiceTestCases pass
Test: android.autofillservice.cts.LoginActivityTest#testManualAutofill pass

Change-Id: I1a64d40da3373774451d178b1cabf20f11120e9d
2017-03-15 09:37:10 -07:00
Philip P. Moltmann
9b31b4eac8 Merge "Make it clear which type of AutoFillValue is set" 2017-03-14 21:59:39 +00:00
TreeHugger Robot
123a34f193 Merge "Renamed ViewStructure.setSanitized() to setDataIsSensitive()." 2017-03-14 19:27:20 +00:00
Felipe Leme
c9a19b1b27 Renamed ViewStructure.setSanitized() to setDataIsSensitive().
Bug: 36126001
Test: CtsAutoFillServiceTestCases pass
Test: m update-api

Change-Id: I182355b63d8743cd8cd8612f29a9269e258283c2
2017-03-14 17:51:47 +00:00
Vladislav Kaznacheev
b40e61b77c Anchor a cascading submenu to its parent menu item
The current implementation of cascading menus is anchoring
a submenu to the top-level anchor view using a carefully
computed offset. This offset is only correct for the case when
the submenu is being shown normally, but not when it is
flipped due to insufficient space below.

More over, when the window containing the anchor is scrolled,
the pre-computed might become completely irrelevant, as
parent menus might change their above/below state.

This CL allows a PopupWindow to be anchored to a view in
another popup window (previously it was only possible to
anchor to a view in the main app window).

Cascading submenu is now tracking its parent item position
correctly.

Bug: 35768002
Test: android.cts.widget.PopupWindowTest.testAnchorInPopup
Change-Id: Id163d739de05729a9fa7e5fedebc9ec0037ed80e
2017-03-14 10:00:21 -07:00
Philip P. Moltmann
9668903731 Make it clear which type of AutoFillValue is set
throw and handle errors if the wrong value is set for a view

Test: android.autofillservice.cts.AutofillValueTest
Change-Id: Ida80da7913a210bede6c47d6b7a6f215a012a84c
2017-03-14 09:11:47 -07:00
tianran.x.li
a31d4edb74 Skip ListPopupWindow position update if detached
Symptom:
A part of the option is displayed in the wrong location.

Root cause:
When the search item is clicked, the menu item will be
hidden. The PopupWindow will be detached from window and the
mAttachInfo property will be set to null. The anchor coordinates
will return x 0 and y 0.

Solution:
If the anchor view is detached from window, the ListPopupWindow will
not be update.

Bug: 36207919

Change-Id: I2b370c31542fae454592463e12313fdeaef25afe
2017-03-14 19:17:54 +09:00
Svet Ganov
2f8fb1f62f Fix a few auto fill ussues
1. Ensure clicking on a focused view brings up autofill if needed

2. Notify the autofill manager in a couple of cases we missed

3. Renamed the AutofillManager app facing APIs to better reflect what
    they do and added a API for the app to cancel the autofill interaction

4. Fix view structure dispatch where the ordering of children for autofill
    was mixed with ordering of direct view children - the autofill children
    may be indirect as views can be marked not important for autofill

5. Show scrollbars only if there are more fill options than want is shown

6. Show only three fill options and the rest can be accessed with a scroll

7. Remove the list divider to allow fill items to control all fill window content

8. Renamed the autofill manager internal service classes to xxAutofillxx

9. Fixed a comment that was not addressed in a previous CL

10. Showing max three fill options - rest needs a scroll

11. Make sure fill UI shown when filter with no matches is changed
      to filter with some matches

12. Make sure the fill window has a shadow

Test: Autofill CTS tests pass and manual

bug:36038929
bug:36040101
bug:36149166
bug:36034681
bug:36126001
bug:36035654

Change-Id: Ic8726146fc3c0a19d3e536becdd63fb65622136e
2017-03-13 21:57:10 -07:00
Ian Lake
dffe6fdfe1 Move expensive TextClock operations to onAttach
Registering and unregistering are expensive operations
that should not be done when the visibility of the
TextClock changes. However, we want to ensure that a
non-visible TextClock does not consume extra resources
or cause layout/redraw passes. By keeping the TextClock
registered but avoiding the side effects of onTimeChanged,
we can get the best of both worlds.

Test: manual testing

BUG: 33960344
Change-Id: I3e76246d820363766b78130231d665989fdb4265
2017-03-10 13:58:07 -08:00