Commit Graph

7077 Commits

Author SHA1 Message Date
Roozbeh Pournader
380154724b Force direction of phone number fields to (practically) LTR
Previously, phone number fields defaulted to locale direction, which
created problems for apps that were not aware of LTR requirements for
phone numbers.

Now, we look at the direction of the digits for the locale, and use
that to determine the direction of the edit field. (For practically
all major RTL locales, that direction is LTR.)

Test: Manual
Bug: 33643035
Change-Id: I17c70d8462bd403ea6866057971105f1f5772ba3
2017-04-06 19:42:57 +00:00
TreeHugger Robot
0c5dfd90b8 Merge "Fix anchor overlap handling in ListPopupWindow" into oc-dev 2017-04-06 05:20:18 +00:00
TreeHugger Robot
94b6b532c0 Merge "Use text input for various internationalized listeners" into oc-dev 2017-04-05 23:32:55 +00:00
Vladislav Kaznacheev
adf08d4eb9 Fix anchor overlap handling in ListPopupWindow
Do not change anchor overlap on the underlying
PopupWindow unless ListPopupWindow.setOverlapAnchor
has been called explicitly.

Bug: 36714649
Test: ApiDemos > Views > Spinner
Change-Id: I5e66d4409a1f04cdc0fbe64e255609836c2b0e95
2017-04-05 22:24:13 +00:00
Roozbeh Pournader
889c6503a1 Use text input for various internationalized listeners
Since the characters that need to be entered for an internationalized
input type may not be available on the old non-internationalized
layouts, switch to the full text layout if there are any such
characters.

TextView is also modified to call the locale-aware listeners if
the target SDK is set to O or later.

Test: Manual
Bug: https://code.google.com/p/android/issues/detail?id=2626
Bug: https://code.google.com/p/android/issues/detail?id=82993
Bug: 8319249
Bug: 33276673
Bug: 34394455
Change-Id: I544bf0cc893a475ab5bf88cbad01cb981c6fef91
2017-04-05 14:07:22 -07:00
Adam Powell
9b24e5c53a Don't crash when passing null to requestChildFocus
Add null checks to ScrollView and HorizontalScrollView for checking
the revealOnFocusHint. This should never happen in code called by
the framework, but some apps were hitting it.

Bug: 36379645
Test: none
Change-Id: I220eb88d82126ff08f47a7c2a7fbdddebf07de81
2017-04-04 22:44:41 +00:00
TreeHugger Robot
04fc05cd66 Merge "Change justification parameter from boolean to int." into oc-dev 2017-04-04 18:29:58 +00:00
Seigo Nonaka
4b4730d90e Change justification parameter from boolean to int.
Bug: 35766005
Bug: 35764323
Test: Manually done
Change-Id: Ic6d78bb9a3213160cd013f1ca8294307872bf0d0
2017-04-03 14:52:04 -07:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
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