Commit Graph

8590 Commits

Author SHA1 Message Date
Aurimas Liutikas
d23189b998 Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Merged-In: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-13 02:56:20 +00:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Seigo Nonaka
f47561320f Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: atest TextViewTest
Change-Id: I83f253f6edfb2724972793b3495835540b7b52e4
2020-07-22 22:54:14 -07:00
Victor Chang
55a6efbfd9 Remove @CorePlatformApi LocaleData usage in frameworks
They can be replaced by the public API provided by ICU4J instead.
No extra layer of caching equivalent to the LocaleData cache is
added because ICU4J has caches instances, e.g. DateFormatSymbols,
etc.

Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: I07048e0e1a4835d2744b7fce6a5ed79a112e456b
2020-07-20 21:09:40 +01:00
Victor Chang
c744bd5f64 Use DateFormatSymbols directly instead of using LocaleData
Bug: 160606356
Test: atest FrameworksCoreTests:android.text.format
Change-Id: Id5d70328ab146d439ed45135e0fa9d1b9cc95257
2020-07-20 21:09:40 +01:00
TreeHugger Robot
b2f5bfcfc2 Merge "Fixes the issue multi-touch causing launcher icons to be not clickable." into rvc-dev am: 94df031718
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12163209

Change-Id: Icae3589b44c4a98f67afc659f62346db8a6ddd65
2020-07-17 17:24:24 +00:00
Pinyao Ting
b4444ff0a1 Fixes the issue multi-touch causing launcher icons to be not clickable.
The issue occurs because TextView#isFromPrimePointer assumes multi-touch
events are happening on the same TextView and relies on
ACTION_UP/ACTION_CANCEL to reset the Prime pointer id.

consider following scenario:
1. ACTION_DOWN (pointer 0) landed on ViewA,
   ACTION_DOWN (pointer 1) landed on ViewB.
2. ACTION_MOVE landed on both ViewA and ViewB, triggering a drag.
3. When all fingers are released, ACTION_CANCEL (pointer 0) will be
   landed on both ViewA and ViewB, so the prime pointer in ViewB is not
   reset due to pointer index mismatch.

This CL always reset prime pointer id whenever ACTION_UP/ACTION_CANCEL
is triggered.

Bug: 157399040
Test: manual
Change-Id: Id35d9eac939378482fa50e85bb5cda58469240ad
2020-07-16 20:59:10 -07:00
vichang
8a202538bc Merge "Remove libcore.icu.ICU usage in android.text.format.DateFormat" am: ec71624f22 am: 3b25f55042
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355737

Change-Id: Ibc2b1561f316afe2371d9549190a0c328a180141
2020-07-13 02:31:18 +00:00
vichang
ec71624f22 Merge "Remove libcore.icu.ICU usage in android.text.format.DateFormat" 2020-07-10 10:47:38 +00:00
Nikita Dubrovsky
cf4e0dc46b Merge "Change cursor drag threshold from 30 to 45 degrees from vertical" into rvc-dev am: f44a60bd69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12052997

Change-Id: Ie8a3eee8e2030bb429531d0f13df4302d4908072
2020-07-08 16:46:34 +00:00
Treehugger Robot
1376456548 Merge "Fix typos related to sortSelectionIndices" am: 5247f04147 am: 7a42f1c980
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355842

Change-Id: Iec31622cc351a635b8d590b2509523167141d32c
2020-07-08 02:16:23 +00:00
Victor Chang
a0d05f4fdc Remove libcore.icu.ICU usage in android.text.format.DateFormat
The methods can be implemented with ICU4J directly.

Bug: 160606356
Test: atest android.text.format.DateFormatTest
Test: atest CtsTextTestCases:android.text.format.cts.DateFormatTest
Change-Id: I3d5f639a94026c599b487563c95bf9d165adfeec
2020-07-06 21:30:24 +01:00
Wang Han
11bd793f2c Fix typos related to sortSelectionIndices
Bug: 160555160

Change-Id: I2710e10776a4f6f633abc14d6898c186b5a01124
2020-07-06 13:21:57 +00:00
Joanne Chung
6dfbe8316c Fix app crash if the selection is from reverse direction.
When user types some text and then long presses on end of empty area
to open context menu, if user opens Gboard and selects text from the
reverse direction, SelectionEnd will be less than SelectionStart. The
IllegalArgumentException occurred because TextClassification does not
allow SelectionEnd is less than SelectionStart. We swap the start and
end index if end index is less than start index.

Bug: 150916165
Bug: 157452302
Test: Manual. No crash occurs.
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
(cherry picked from commit cb3c97db0c)

Merged-In: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
Change-Id: Ie0e2b5840e147f98174cae4521eb777e1a080706
2020-07-06 17:41:55 +08:00
Nikita Dubrovsky
b1ad3b6800 Change cursor drag threshold from 30 to 45 degrees from vertical
Bug: 158948887
Test: Manual and unit tests
  atest FrameworksCoreTests:EditorTouchStateTest
  atest FrameworksCoreTests:EditorCursorDragTest
Change-Id: I6b30c0d6ef9c93fd4fd6aae3004cd6965e9d7be4
2020-07-01 13:14:19 -07:00
Jorim Jaggi
41bd44e606 Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev am: 37cf2279c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11920862

Change-Id: I19b6f83b3777bfeccbe90f1c531efcc59e41f54e
2020-06-27 00:14:24 +00:00
Jorim Jaggi
37cf2279c9 Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev 2020-06-26 23:58:17 +00:00
Jorim Jaggi
d42ab1b938 Pass in callsite of SurfaceControl constructor explicitly (1/3)
Creating a new Throwable (and filling in the stack trace) can take
up to 150us. Since we do this on the critical path when sending
over SurfaceControl via binder multiple times, this is too much.
Instead, add an option to pass in callsite manually.

Bug: 159056748
Change-Id: I46c339c15a07192d61c4c546e46f260684a47120
Merged-In: I46c339c15a07192d61c4c546e46f260684a47120
Exempt-From-Owner-Approval: Large scale refactor
2020-06-26 15:35:23 +02:00
TreeHugger Robot
ebcad32029 Merge "Fix the visibility of SurfaceView in InlineContentView." into rvc-dev am: 9c71148852
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11988456

Change-Id: Ibd355dd33759f9a6d930fffaae7fa2d2a26140df
2020-06-25 05:29:59 +00:00
Qi (wangqi) Wang
db0dbea190 Fix the visibility of SurfaceView in InlineContentView.
SurfaceView doesn't respect the visibility of its ancestor so we need to
update it accordingly inside InlineContentView.

Test: manually
Bug: 158714351

Change-Id: If482747d6ae5d7628b46de837c11b6232406120c
2020-06-24 19:45:46 -07:00
Svetoslav Ganov
9529f00aa7 Merge "Address missed comments from previous CL" into rvc-dev am: dab5588e84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11978216

Change-Id: I2637826dde356b7604dffa907f4385c7b83a3780
2020-06-24 17:01:41 +00:00
Svetoslav Ganov
0de1884aef Merge "Handle reperenting of InlineContentView" into rvc-dev am: f8b9ddea71
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907687

Change-Id: I9b0919075bc6e29cf4beb6d2e92097d74ac4d99b
2020-06-24 06:44:18 +00:00
Svet Ganov
4846803547 Address missed comments from previous CL
bug:153826463

Test: atest android.widget.cts.inline.InlineContentViewTest#testReparenting

Change-Id: Iddb1f4d2e0b7043517616d0ec3678a55f9eda34c
2020-06-24 06:39:28 +00:00
Svet Ganov
a5b4990d96 Handle reperenting of InlineContentView
When an inline content view is reparented its surface is
getting offset and not being under the view itelf. This is
because the surface views manage the postion of their
surface and are assuming a location based off the window's
surface position. However after a reparenting the inline
content view's surface position becomes relative to that
of the new parent surface view. For example, two surface
views at position (10, 10) being reparented would reslut
in the surface of the parent being at (10, 10) while the
surface of the child being at (20, 20) while both views
would still be at (10, 10).

To address this we are intecepting when an inline content
view's surface is reparented and get a weak reference to
the view that owns the new parent surface. We then position
the inline content view's surface relative to the view that
owns the new parent surface, i.e. we position the surface
such that its location would not change because of the
fact it is being reparented.

While at this make sure the inline content view is marked
as not important for a11y to ernsure the a11y plugins don't
try to click on the view tree in the app's process but
insted on the views in the remote proccess, i.e. on the
embedded view tree.

bug:153826463

Test: atest android.widget.cts.inline.InlineContentViewTest#testReparenting

Change-Id: I2cff4b88d404a740bc447668e948eabccad084d2
2020-06-24 06:27:17 +00:00
Svetoslav Ganov
ff0750a888 Merge "Support clipping in InlineContentView" into rvc-dev am: 449851f8e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11962498

Change-Id: I6b8937c51477953edb3e122dec89fd5f7b4d5e75
2020-06-23 22:55:46 +00:00
Svetoslav Ganov
449851f8e2 Merge "Support clipping in InlineContentView" into rvc-dev 2020-06-23 22:43:14 +00:00
Nikita Dubrovsky
470f2a61e2 Merge "Fix double-tap detection in TextView's SelectionModifierCursorController" into rvc-dev am: 2d4921d1f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959987

Change-Id: I91a52520004d9e41d582a4ee66c2f34d8785e383
2020-06-23 19:11:35 +00:00
Nikita Dubrovsky
e97b0ecadc Fix double-tap detection in TextView's SelectionModifierCursorController
This restores the logic removed from SelectionModifierCursorController
in ag/9994946. A quick sequence of "tap", "drag", "tap" events (such
as when quickly scrolling a small input field) should *not* be treated
as a double-tap.

Bug: 158948887
Test: Manual and unit tests
  atest FrameworksCoreTests:EditorTouchStateTest
  atest FrameworksCoreTests:EditorCursorDragTest
Change-Id: I9fb9cb06b1e208946566a0f70697c62ee7684ca0
2020-06-22 17:14:03 -07:00
Svet Ganov
787ec3f050 Support clipping in InlineContentView
Support clipping for InlineContentView's backing surface
to enable suggestions clipping that does not require re-
parenting which has side effects.

bug:153826463

Test: atest android.widget.cts.inline.InlineContentViewTest#testReparenting

Change-Id: Ia2988ebd660323bf65f0141b4b542a9c4320e178
2020-06-22 16:50:49 -07:00
Yuncheol Heo
b5d47c488c Merge "Gets the userId from Context for AccessibilityManager in ToastPresenter." into rvc-dev am: c53014cbf6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11898404

Change-Id: I260b328315eff02019436bcc12f1b718bf9ac407
2020-06-18 17:41:38 +00:00
Yuncheol Heo
c53014cbf6 Merge "Gets the userId from Context for AccessibilityManager in ToastPresenter." into rvc-dev 2020-06-18 17:29:13 +00:00
Yuncheol Heo
a3ad557655 Gets the userId from Context for AccessibilityManager in ToastPresenter.
- In Android Auto, android.widget.cts.ToastTest#testShow_whenTextToast_sendsAccessibilityEvent failed is failed, since AccessibilityManager in ToastPresenter is initialized with the wrong userId.
- ToastUI creates the Context from the uid of the received message, so we can get the correct userId from the Context.

Bug: 154644563
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
      android.server.wm.ToastWindowTest ToastUITest
      NotificationManagerServiceTest LegacyToastTest
Change-Id: I138620a0a52e65429157719f588c4be56b075368
2020-06-17 22:53:43 +00:00
TreeHugger Robot
a2252bc324 Merge "Make underlying SurfaceView respect visibility of InlineContentView." into rvc-dev am: f2ba813a62
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11855564

Change-Id: Iac0b9cda3fd33d60a4d97661c21935beafb88f04
2020-06-17 22:51:55 +00:00
Qi (wangqi) Wang
d0292964f3 Make underlying SurfaceView respect visibility of InlineContentView.
SurfaceView doesn't respect its ancestor's visibility change, so we need
a OnPreDrawListener listener to update it according to visibility change
in the view hierarchy.

Bug: 158714351

Test: verified locally

Change-Id: I7d6a7db48e037ed7d4ec2ecb23a158e8d1c43240
2020-06-12 18:53:34 -07:00
Abodunrinwa Toki
45100c7c7a Merge "Disable language logging in TextClassifier/TranslateEvent" into rvc-dev am: 934df62467
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11744901

Change-Id: I4529c03f482eeb2741f127fdd7b6cc434ba9909e
2020-06-11 17:16:04 +00:00
Abodunrinwa Toki
934df62467 Merge "Disable language logging in TextClassifier/TranslateEvent" into rvc-dev 2020-06-11 16:40:13 +00:00
TreeHugger Robot
a2b71f725c Merge "Fix NPE in InlineContentView" into rvc-dev am: 854b0d1a89
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11784246

Change-Id: I243379817566a7ba433f4fdb5f6840fe6e4039b3
2020-06-09 03:50:01 +00:00
Feng Cao
10e6217a8d Fix NPE in InlineContentView
* The NPE is due to in the InlineContentView we try to reparent the
  surface view which is no longer attached to the window, this can
  happen if the InlineContentView is attached to window and then
  immediately detached from the window, before the surface package
  is returned from the remote view process.
* Release the surface package immediately in this case, so the
  remote view can be released.

Test: atest android.autofillservice.cts.inline
Bug: 158139090

Change-Id: I9efdf8ba182a1d66334362edcfb6ba58fcdc222a
2020-06-08 18:52:21 -07:00
Tony Mak
a67cba7381 Disable language logging in TextClassifier/TranslateEvent
Bug: 158481016
Test: atest android.widget.cts.TextViewTest
Test: atest tests/tests/textclassifier/src/android/view/textclassifier/cts
Change-Id: I7e9ea69f67858714a7fd3b0d06ad1b88000999e0
2020-06-08 17:54:47 +00:00
Mihai Popa
7bd1fc8b4e Merge "Remove reduntant variable" am: 5241a207fb am: 202dd72169
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318280

Change-Id: Ie8bd86ae505cddb133844c6808b1e9e3cba5e32b
2020-06-05 22:24:14 +00:00
jiajia tang
3dfd84718d Remove reduntant variable
Magnifier#mDestroyLock was introduced by below change:
Idf0373ab0d5033d56da0f6f45d7d953f7e796813

Then related code was removed by below change:
Ia4c75b5b997e0ed94d5a3814dd4507a8fffa124d
With this change, Magnifier#mDestroyLock becomes redundant,
useless lock.

This change intends to remove this redundant lock.

Change-Id: Ifa3f83f8953a3d992e26a952d9ac2f3343b0dc9e
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2020-05-28 16:45:40 +08:00
Tetsutoki Shiozawa
18a6c10e71 [ProgressBar] Fix: Media volume bar indicates a wrong value
Symptom:
Media volume bar shows non-zero value even during the mute state.

Root cause:
A request for updating progress of ProgressBar has 2 kind of updating
ways, animated and non-animated. If a non-animated request is invoked
before completing an animated request, the visual progress can be
overwritten by the old animated request. As a result, the visual
progress value becomes different from the actual value.

Solution:
A running animation on the primary progress should be canceled
before handling a new non-animated request.

Bug: 148759348
Test: atest CtsWidgetTestCases:ProgressBarTest
Merged-In: I569dbea4c6346ecfff8141d8378b4952fb1fa530
Change-Id: I569dbea4c6346ecfff8141d8378b4952fb1fa530
(cherry picked from commit 589552766c)
2020-05-18 20:41:18 +00:00
Tetsutoki Shiozawa
2e2664fa50 [ProgressBar] Fix: Media volume bar indicates a wrong value
Symptom:
Media volume bar shows non-zero value even during the mute state.

Root cause:
A request for updating progress of ProgressBar has 2 kind of updating
ways, animated and non-animated. If a non-animated request is invoked
before completing an animated request, the visual progress can be
overwritten by the old animated request. As a result, the visual
progress value becomes different from the actual value.

Solution:
A running animation on the primary progress should be canceled
before handling a new non-animated request.

Bug: 148759348
Test: atest CtsWidgetTestCases:ProgressBarTest
Change-Id: I569dbea4c6346ecfff8141d8378b4952fb1fa530
Merged-In: I569dbea4c6346ecfff8141d8378b4952fb1fa530
2020-05-18 18:29:40 +00:00
Yuichiro Hanada
93ec9b85e5 Revert tab key behavior on multiline EditTexts.
This CL reverts ag/10267783 effectively.
ag/10267783 makes tab key insert \t character on multiline text fields,
however, it broke the existing apps which depends on the previous
behavior.

Bug: 154290658
Test: manual - Tab key on multiline text fields advance focus
Test: atest TextViewTest#testKeyNavigation
Change-Id: I9836ce29321ca789bce6636514ce9a8dbf923ada
2020-05-13 21:26:36 +09:00
Feng Cao
b46851c964 Support re-attaching the inline suggestion view to window
* Before this change, when the inline suggestion view is detached from
  the IME window (e.g. due to layout change), the remote view content
  will not show again even after the view is reattached to the window
  on the IME side. This patch fixes it by requesting the remote view
  owner (the ext services) for a new SurfacePackage when the view is
  re-attached to the window (see javadoc of SurfaceControlViewHost for
  why this works).
* This patch also fixes the issue where the SurfaceControlViewHost was
  never released in the ext services. This is done by notifying the
  ext services (through system server) when the view is detached from
  the IME window, and then the system server will release the
  SurfaceControlViewHost if after N(=500) ms the view is not re-attached
  to a window.
* After the SurfaceControlViewHost is released, if the view is
  re-attached to the window later, a new SurfaceControlViewHost will be
  created to back the same InlineContentView.
* The current code structure also lays a foundation for a subsequent
  change to allow reusing the same remote view for inline suggestions
  during filtering.

Test: atest CtsAutofillServiceTestCases (sanity test)

Bug: 153615023
Bug: 154683107

Change-Id: Idc587e1e82a96b792c351796464821b7aad7cd89
2020-05-06 19:30:39 -07:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
TreeHugger Robot
d725389a55 Merge "Update the documentation for inline suggestion APIs" into rvc-dev 2020-05-01 01:42:05 +00:00