Commit Graph

7267 Commits

Author SHA1 Message Date
Phil Weaver
9e90a7236a Merge "NumberPicker a11y (and a11y-inspired) fixes" 2017-07-11 23:12:20 +00:00
TreeHugger Robot
ed8c1eb56a Merge "Respect the locale in vertical location of AM/PM" 2017-07-06 22:08:25 +00:00
Anthony Chen
10fccb0473 Merge "Merge "Fix bug where RemoteViews addView is backwards." into oc-dr1-dev am: 25c84b3321" into oc-dr1-dev-plus-aosp
am: 7730f5ad86

Change-Id: Id53671bbdefa0683c19e84f245cf60ba9460278c
2017-07-06 21:46:50 +00:00
Roozbeh Pournader
6791c7bf67 Respect the locale in vertical location of AM/PM
If the locale puts the AM/PM before the hour and minute in time
formatting, make sure TimePicker respects that by putting the AM/PM
above the hour and minute in landscape mode, where the AM/PM used to
always appear below the hour and minute.

Two sets of locales are affected. All of them put the AM/PM before
the hour and minute, but the first set also defaults to 12-hour, so
the change is most visible in these: Ewe, Chinese (both Simplified
and Traditional, including Cantonese), Korean, and Tamil. The second
set, Hungarian, Japanese, Myanmar, Sinhala, and Turkish, would only
see the difference if the time picker is forced into 12-hour mode.

Test: manual (tested en-US, ar-EG, ta-IN, zh-Hans-CN, ko-KR)
Change-Id: Ic5840d46d81a004294bda4644df02c721152686b
Fixes: 63352170
2017-07-06 13:18:02 -07:00
Roozbeh Pournader
01bcf1ef5c Respect locale direction in TimePicker AM/PM location
Previously, the code that decided where the AM/PM indicator should
end up relative to the hours and minutes assumed that the locale was
LTR. Now it works correctly for RTL locales too.

Bug: 62846484
Test: manual (tested adding an alarm under ar-EG, en-US, and ta-IN, all of which are 12-hour)
Change-Id: I748baff01e2b3398747a2f8c074edbd16322bdf9
2017-07-05 18:32:47 -07:00
TreeHugger Robot
60b108d758 Merge "Fix RTL issue in RelativeLayout" 2017-07-05 23:45:24 +00:00
Chet Haase
bcd3520be6 Fix RTL issue in RelativeLayout
A long-standing bug in RelativeLayout meant that items inside a
RelativeLayout with layout centering (layout_centerHorizontal)
and WRAP_CONTENT would cause the surrounding RelativeLayout to be
sized incorrectly, resulting in bad layouts overall (the RelativeLayout
could end up much too large, pushing other layouts out of view). This
artifact was visible in TimePicker in landscape mode, but worked
around in the O release by forcing LTR on the parent layout of the
RelativeLayout.

The problem was that the case of center/wrap would end up positioning
the view on the left of the layout, instead of the RTL-friendly right
side. The fix is to do the correct thing in RTL mode (position relative
to the right side of the layout instead).

Bug: 63003526  TimePicker RTL issue
Bug: 62846484  TimePicker layout is broken in RTL landscape mode
Test: manual (run Clock app in RTL and non-RTL modes and observe layout behavior in
both portrait and landscape modes).

Change-Id: I9033857a39f422e3d6fb6e4d313d1739ae3f5c63
2017-07-05 21:45:50 +00:00
Anthony Chen
ea202f6646 Fix bug where RemoteViews addView is backwards.
The index on where to add a child view was not being saved when writing
to a Parcel. This causes the index to default to 0 and resulted in views
always being added as the first view.

Now, persist this value to the Parcel and restore it.

Test: booted up on Nexus 6P, created notification with RemoteView, added
two views and verified views added in correct order.
Bug: 63177271

Change-Id: I94384e348b8a5168efe0601f382cdd2db6791fdb
2017-07-05 21:12:41 +00:00
Abodunrinwa Toki
1d263b8a38 Merge "No smart text assist for unprovisioned device." into oc-dr1-dev am: bda6275cf6
am: 925eb60a2c

Change-Id: Ib08b1a455c69ec499488d89df6c2419c368ca27c
2017-06-30 22:49:45 +00:00
Abodunrinwa Toki
9796a1bd00 No smart text assist for unprovisioned device.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
bit FrameworksCoreTests:android.widget.TextViewActivityTest
bit FrameworksCoreTests:android.widget.TextViewActivityMoutseTest
Bug: 62745625
Change-Id: I360250a5c2a92d09c8d8f559b51c74f490f70c2c
2017-06-30 00:50:39 +01:00
TreeHugger Robot
c1323664d4 Merge "Make the android.R.string.autofill public." 2017-06-28 01:55:57 +00:00
Phil Weaver
53a8e4370a Merge "Clean up popup window titles" 2017-06-27 00:39:30 +00:00
Phil Weaver
dd6978545f Clean up popup window titles
Removing the recently-added APIs to adjust the title for
the popup window, and moving setting the title to
preparePopup(), which is guaranteed to have a context.
(The bug is a crash because we didn't have a context.)

Apps wishing to specify their own title can still do so
in the LayoutParams without bothering with the get/set.

Bug: 62675086
Test: With TalkBack running, navigate to Settings->
Network & Internet. Select the more options button and
double-tap to select it. It now announces "Popup Window".

Change-Id: I9735ace42c24ef4977d3f4d5150f768d44aff351
2017-06-26 15:32:21 -07:00
Felipe Leme
555bcac6b2 Make the android.R.string.autofill public.
Fixes: 62444792
Test: manual verification with app that uses it the string
Test: CtsAutoFillServiceTestCases pass

Change-Id: Ic859a7a80ab25f6e240a308715b7c50708c497f3
2017-06-26 12:55:17 -07:00
Seigo Nonaka
b7773ce875 Stop loading other package's font by default.
Since CONTEXT_RESTRICTED is not a default flag of createPackageContext,
we can't rely on it for preventing unexpected font injections.
To protect developers and existing apps from a risk of font injection,
stop loading font from other package's resouce unless the developer
explicitly set CONTEXT_IGNORE_SECURITY.

Bug: 62813533
Bug: 62879353
Test: Manually done
Merged-In: I4442ddc48dadb5c968b444be86038b602074d301
Change-Id: I4442ddc48dadb5c968b444be86038b602074d301
(cherry picked from commit 6d6cd68660)
2017-06-23 10:02:59 +00:00
Rob Carr
e8a3b7a162 Merge "ListPopupWindow: Wrap new bounds checking in targetSdk check." into oc-dev am: 82b41e460c am: 874b6402af
am: 9a8971fabb

Change-Id: Ida4fd8f112a7164fb79512d09eadd10da718c269
2017-06-22 22:41:39 +00:00
Rob Carr
9a8971fabb Merge "ListPopupWindow: Wrap new bounds checking in targetSdk check." into oc-dev am: 82b41e460c
am: 874b6402af

Change-Id: I3db14694bc27e9fed16b5efec6aba99570b89675
2017-06-22 22:32:07 +00:00
TreeHugger Robot
abc6fd57de Merge "Stop loading other package's font by default." 2017-06-22 22:28:10 +00:00
Rob Carr
9e391f9f86 Merge "ListPopupWindow: Wrap new bounds checking in targetSdk check." into oc-dev
am: 82b41e460c

Change-Id: I47c8e096ccd513eb65fa9fd2a34fc75fa222a42c
2017-06-22 22:23:19 +00:00
Robert Carr
c1fdd2aa32 ListPopupWindow: Wrap new bounds checking in targetSdk check.
While a negative height is pretty silly, crashing apps on
the new version of android makes them sad.

Test: Existing CTS passes.
Bug: 62434804
Change-Id: I5fc3fc50fb6ccfa9e96f38ded4fb8e338f263f09
2017-06-22 11:54:45 -07:00
Seigo Nonaka
6d6cd68660 Stop loading other package's font by default.
Since CONTEXT_RESTRICTED is not a default flag of createPackageContext,
we can't rely on it for preventing unexpected font injections.
To protect developers and existing apps from a risk of font injection,
stop loading font from other package's resouce unless the developer
explicitly set CONTEXT_IGNORE_SECURITY.

Bug: 62813533
Bug: 62879353
Test: Manually done
Change-Id: I4442ddc48dadb5c968b444be86038b602074d301
2017-06-22 08:36:03 -07:00
Felipe Leme
49a38c6f1c Added BaseAdapter.setAutofillOptions()
Also changed ArrayAdapter to use it, when set.

Fixes: 37518906
Test: cts-tradefed run commandAndExit cts-dev -m CtsWidgetTestCases  -t android.widget.cts.BaseAdapterTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsWidgetTestCases  -t android.widget.cts.ArrayAdapterTest
Test: m update-api

Change-Id: I5e883555b0fb9d084b57b9239595bf0632fc41af
2017-06-21 13:36:56 -06:00
Yohei Yukawa
c9cd9db4bb Use TEXT_HANDLE_MOVE in TextView behind the flag
This CL enables TextView to trigger
HapticFeedbackConstants.TEXT_HANDLE_MOVE on devices that explicitly
enable this feature with resource overlay.  This CL should have no
behavior change and no performance impact by default.

Since the use case of HapticFeedbackConstants.TEXT_HANDLE_MOVE is
when the user is manually moving the text insertion/selection handle
on the touch screen, it is intentional that text handle move
triggered by hardware keyboard, mouse, TextView APIs, IME APIs, and
any other internal API calls do not trigger the haptic feedback
even if the feature is enabled with resource overlay.

Bug: 62454887
Test: Manually done as follows.
  * Not triggered on cursor move by mouse
  * Not triggered on cursor move by hardware keyboard
  * Not triggered on cursor move by IME
  * Triggered on cursor move by touch screen
Change-Id: I5e78aafb065378ca88ba39ec507b121c8baa3631
2017-06-19 18:27:34 -07:00
TreeHugger Robot
1c75b9c99f Merge "Hide IME when switching to Radial Time Picker" 2017-06-19 17:40:05 +00:00
Siyamed Sinir
4558068f63 Merge "Fix crash during TextView.onCreateContextMenu" into oc-dev am: 58df6ab93f am: 92d86d59c0
am: 4c6d3ba183

Change-Id: I06ed6fea1fe414e7a33694047b0e6e903b7816bb
2017-06-19 17:24:27 +00:00
Siyamed Sinir
4c6d3ba183 Merge "Fix crash during TextView.onCreateContextMenu" into oc-dev am: 58df6ab93f
am: 92d86d59c0

Change-Id: I690ebf4df8e22a57c5f7b2b5e0267a550db15945
2017-06-19 17:13:23 +00:00
Siyamed Sinir
04171ecb31 Merge "Fix crash during TextView.onCreateContextMenu" into oc-dev
am: 58df6ab93f

Change-Id: Icd240aa9e5881067acd7521e4235692c5a538b29
2017-06-19 17:03:17 +00:00
Aurimas Liutikas
7334441d69 Hide IME when switching to Radial Time Picker
When switching back to the Radial Time Picker with an
IME visible, make sure to hide it.

Test: Set time from Settings. Switch to TextInputTimePicker.
      Enter text so IME appears.  Switch back to RadialTimePicker
      IME should be hidden again.

Change-Id: Ia0ed149d74333b2f643d50a324172b64aa5e223b
2017-06-17 00:14:11 +00:00
Siyamed Sinir
532f3c989e Fix crash during TextView.onCreateContextMenu
Test: bit CtsWidgetTestCases:TextViewTest

Bug:62450393
Change-Id: I162c28d253ca197eba9c4c148c76179c2880daa5
2017-06-16 19:32:41 +00:00
Alan Viverette
0a14ba56a7 Manually merge 23bb5bf262 to fix APIs
Also updates documentation for RemoteViews clone to reflect the ISE;
however, the implementation is still incorrect and the method should be
deprecated and replaced with a copy constructor.

Bug: 62576297
Test: make -j32
Change-Id: I72dea99fa45a838d22eb54190a0f26a15e8ba766
2017-06-14 17:33:49 -04:00
Daniel Sandler
0e6a5f8d7e Merge "Revert accidental API change to RemoteViews." into oc-dev 2017-06-14 20:12:38 +00:00
Daniel Sandler
23bb5bf262 Revert accidental API change to RemoteViews.
This reverts commit 7f09ce1a23 (but 
retains the bug fix)

Change-Id: Ib4700ada5aa0b5dab7e43f895b48eb7058308869
Fixes: 62543637
Bug: 62181033
2017-06-14 20:10:18 +00:00
Andrei Stingaceanu
02dba53fe7 Merge "DayPickerView - clamp date to min/max" into oc-dev am: 511c95a022 am: 37aa78bfab
am: 852f4b1fa7

Change-Id: I317b1c2891426225863711e4815a470d1902a9a2
2017-06-14 19:35:55 +00:00
Andrei Stingaceanu
37aa78bfab Merge "DayPickerView - clamp date to min/max" into oc-dev
am: 511c95a022

Change-Id: I1ede393b4a5ac44b9961a37e265b7663c88aaa5e
2017-06-14 17:47:03 +00:00
TreeHugger Robot
4cb3ae605c Merge "Add accessibility titles to PopupWindow" 2017-06-13 19:35:56 +00:00
Andrei Stingaceanu
e565e525fa DayPickerView - clamp date to min/max
Besides clamping @ setMinDate() and setMaxDate() also
clamp @ setDate().

Bug: 36636681
Bug: 62485314
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -t
      android.widget.cts.CalendarViewTest#testMinMaxRangeClampingMaterial

Change-Id: I455cd43e7228e10d58b5f886dcab8332bca72de7
2017-06-13 18:23:22 +01:00
Phil Weaver
5476da968f Add accessibility titles to PopupWindow
Adding a default title and a hidden API to customize
the title.

Bug: 30177642
Test: With TalkBack running, navigate to Settings->
Network & Internet. Select the more options button and
double-tap to select it. It now announces "Popup Window".

Change-Id: I38591a25be0fe1d5bf57c9edee29f09c92e258ea
2017-06-12 18:02:09 -07:00
Jeff Sharkey
9039636535 Revert "Hide APIs not intended to ship in DR."
This reverts commit 0c28d43fe1.
2017-06-12 16:26:53 -06:00
Jeff Sharkey
0c28d43fe1 Hide APIs not intended to ship in DR.
This CL will be reverted once it merges into the next release branch
to re-introduce the proposed APIs.

This CL also makes the following code changes to preserve API
compatibility:

-- It keeps the recently added RemoteViews.clone() synchronized logic
intact, but moves it inside the method to avoid changing the API
signature.

-- It reverts the RttCall.read() behavior to the oc-dev logic, since
we can't throw IOException until we get an API level bump.  (The
original logic returned null instead of throwing.)

Test: builds, boots
Bug: 62427252, 62431886, 62427329
Bug: 62468911, 62431162, 62428935, 62429096
Bug: 37290820, 37359238, 36886243
Bug: 30143923, 35761231, 62192626, 29829689
Change-Id: I83d723f598cb0ee1fe198e65debd86ef7fd0420c
2017-06-12 10:26:01 -06:00
Siyamed Sinir
f99e84e4dd Merge "Force Autofill in FloatingToolbar overflow menu" into oc-dev
am: bc626c6358

Change-Id: I4d3cff4bf6a0403f311011709c3074bca532de15
2017-06-09 21:56:09 +00:00
Siyamed Sinir
bc626c6358 Merge "Force Autofill in FloatingToolbar overflow menu" into oc-dev 2017-06-09 20:58:36 +00:00
Selim Cinek
f62145a41a Merge "Fixed a bug where systemui could crash while cloning" into oc-dev
am: b9eb205bd7

Change-Id: I6cd3b23a9adcb20a93b112204154f1e42a7a3c21
2017-06-09 04:30:47 +00:00
Selim Cinek
b9eb205bd7 Merge "Fixed a bug where systemui could crash while cloning" into oc-dev 2017-06-09 04:22:06 +00:00
Siyamed Sinir
484c2e2fbe Force Autofill in FloatingToolbar overflow menu
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 62271937
Change-Id: Ib3447281f3bd1abc811a25fc55ad55e34e155bbb
2017-06-08 17:16:26 -07:00
Selim Cinek
7f09ce1a23 Fixed a bug where systemui could crash while cloning
Because cloning wasn't synchronized, the notification
could become a non-root temporarily which in turn could
lead to a crash.
1. We're now properly synchronizing the cloning, such that
this can't happen anymore
2. We're now only cloning the old statusbar notification lightly
instead of heavily to avoid this altogether

Test: manual, update decoratedcustomview notifications really fast
Change-Id: Ia6525eec64ad9a26956ca2198e20198f55b2173c
Fixes: 62181033
2017-06-08 13:31:26 -07:00
Andrei Stingaceanu
9a06d4bc77 Merge "Fix unexpected DatePicker validation" into oc-dev
am: cd603221e1

Change-Id: Iaa491c27aebc60be5fe16668dda7904e2b089f54
2017-06-08 14:44:20 +00:00
TreeHugger Robot
cd603221e1 Merge "Fix unexpected DatePicker validation" into oc-dev 2017-06-08 14:36:13 +00:00
Felipe Leme
c14129043f Merge "Don't show AUTOFILL menu when text is selected." into oc-dev am: 49231f183f
am: fc4604f719

Change-Id: I73c6181f7fdd4b2b4c38338c13d9bf439199617f
2017-06-07 00:48:54 +00:00
Phil Weaver
2b94bbed69 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.

This CL re-merges change I459d37d4a54c91e1cb5c7ec68fe0f012b25fb740
but includes a fix to hide the visibility of the input text field
whenever the keyboard needs to be hidden, even if the keyboard
is not being shown or the text box isn't active. That removes an
undesirable visual side-effect of the previous change. This CL
also has a more correct decision about when to send a text change
accessibility event.

Bug: 21494380
Bug: 37016501
Test: Ran NumberPicker CTS, including a new change.
Change-Id: I04c49ddc2f877cd019ee355c722c81dcd3ba0dda
2017-06-06 10:48:47 -07:00
Andrei Stingaceanu
cf5a420ead Fix unexpected DatePicker validation
Remove throwing an error and instead clamp
the selected date to min/max when changing
ranges.

Bug: 36636681
Test: manually verified that the case in the
      bug does not happen again

Change-Id: If540f58d21375d2320df5215504d4569e5c2be2e
2017-06-06 17:34:42 +01:00