Commit Graph

8657 Commits

Author SHA1 Message Date
Nikita Dubrovsky
68bdd1abae Merge "Change cursor drag threshold from 30 to 45 degrees from vertical" into rvc-dev am: f44a60bd69 am: cf4e0dc46b am: c84cbdb149 am: 1bf451125b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12052997

Change-Id: Ia7fbe25cc8074d6d33480737b8762522a9958939
2020-07-08 17:28:08 +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
3bf7edf711 Merge "Fix typos related to sortSelectionIndices" am: 5247f04147 am: 7a42f1c980 am: 1376456548 am: 63c26b2080 am: c5e61b5f28
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355842

Change-Id: I966f008fa4c2677bc2ef8d4e2535402cf7d84304
2020-07-08 03:05:56 +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
Wang Han
11bd793f2c Fix typos related to sortSelectionIndices
Bug: 160555160

Change-Id: I2710e10776a4f6f633abc14d6898c186b5a01124
2020-07-06 13:21:57 +00:00
Joanne Chung
611f0c8ab7 Fix AutofillValueTest#autofillEmptyTextValue.
The new added API for rich content(ag/9884022) denies to autofill
empty text. However, Autofill allows us to fill an empty text. We
should not cause a compatibility issue.

Bug: 159035197
Test: atest android.autofillservice.cts.AutofillValueTest#\
autofillEmptyTextValue
Test: atest FrameworksCoreTests:AutofillValueTest

Change-Id: Ieb5b82bfe4bf77abd151c61ea4cf9125b8fe61f5
2020-07-06 20:50:10 +08: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
543db32125 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
Exempt-From-Owner-Approval: Large scale refactor
2020-06-26 13:40:07 +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
5c941c3057 Merge "Fix the visibility of SurfaceView in InlineContentView." into rvc-dev am: 9c71148852 am: ebcad32029 am: 48f87547dc am: a4393d82ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11988456

Change-Id: Ie27a287b15090a09b14d1b7743ef76592cab711a
2020-06-25 05:59:16 +00: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
Automerger Merge Worker
67a228259c Merge "Merge "Address missed comments from previous CL" into rvc-dev am: dab5588e84 am: d00340e1a5 am: 439359869f" into rvc-qpr-dev-plus-aosp am: 23c9cc0cb7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11978216

Change-Id: I6fca331224199adce27ff8b835d4c54c74a112b6
2020-06-24 17:44:39 +00:00
Svetoslav Ganov
842f9e3b31 Merge "Address missed comments from previous CL" into rvc-dev am: dab5588e84 am: d00340e1a5 am: 439359869f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11978216

Change-Id: Ice21ea4808754a69d0c233d2c85669ff2460d2a0
2020-06-24 17:29:30 +00: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
3e38462491 Merge "Handle reperenting of InlineContentView" into rvc-dev am: f8b9ddea71 am: a962563758 am: bf50afcb4e am: e6e30d2948
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907687

Change-Id: Id8c4a07af383ef3f58bad760b28fdb5a69dc3e03
2020-06-24 07:22:38 +00:00
Svetoslav Ganov
bf50afcb4e Merge "Handle reperenting of InlineContentView" into rvc-dev am: f8b9ddea71 am: a962563758
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907687

Change-Id: Ia18fc12a4015296d59985b376b159a1560717d90
2020-06-24 06:56:18 +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
6a332b17ea Merge "Support clipping in InlineContentView" into rvc-dev am: 449851f8e2 am: f5e93decb5 am: d15e6ec73f am: 64ebd3d495
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11962498

Change-Id: I47a21340b137d81aab1cae57f8dc2564fbd4a2cf
2020-06-23 23:40:44 +00:00
Svetoslav Ganov
d15e6ec73f Merge "Support clipping in InlineContentView" into rvc-dev am: 449851f8e2 am: f5e93decb5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11962498

Change-Id: I5fb976b90eb8f6e59f86c08dd2f98467089d9d0c
2020-06-23 23:10:06 +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
ceccd33e9a Merge "Fix double-tap detection in TextView's SelectionModifierCursorController" into rvc-dev am: 2d4921d1f5 am: fc434c9308 am: 23f005c365 am: 7d20f8a8ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959987

Change-Id: I01a97796cceaaedd17be7d04eca17bfe2d075123
2020-06-23 20:05:53 +00:00
Nikita Dubrovsky
7d20f8a8ac Merge "Fix double-tap detection in TextView's SelectionModifierCursorController" into rvc-dev am: 2d4921d1f5 am: fc434c9308 am: 23f005c365
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959987

Change-Id: I66493550b84b8f26e465a08540a36a8ed6f1beff
2020-06-23 19:40:35 +00:00
Nikita Dubrovsky
7ea92aa4b2 Merge "Fix double-tap detection in TextView's SelectionModifierCursorController" into rvc-dev am: 2d4921d1f5 am: fc434c9308
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959987

Change-Id: I183da52fdd9069fb51325e9e4e624cd2556baea9
2020-06-23 19:27:40 +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
TreeHugger Robot
596e2ab468 Merge "Apply max char length when setSingleLine is called." 2020-06-18 19:47:17 +00:00
Yuncheol Heo
a6845a1447 Merge "Gets the userId from Context for AccessibilityManager in ToastPresenter." into rvc-dev am: c53014cbf6 am: b5d47c488c am: 3c73242952 am: 20b4c2c341
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11898404

Change-Id: Ibcf4a0c29bcfb1c7586a5cd44f7e883f6878bfae
2020-06-18 18:12:51 +00:00
Seigo Nonaka
459f35ac86 Apply max char length when setSingleLine is called.
Bug: 145128646
Test: atest android.widget.cts.EditTextTest
Change-Id: I1f2fd6c97c5cdeb7be5017d4c6aeb19fd269e939
2020-06-18 10:55:17 -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
TreeHugger Robot
6e298bdc1a Merge "Make underlying SurfaceView respect visibility of InlineContentView." into rvc-dev am: f2ba813a62 am: a2252bc324 am: 98abb1ca57 am: f5b4f3d54b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11855564

Change-Id: Ic8b9e6fb398c60328d20b5ffb899cce0f5004df0
2020-06-17 23:35:36 +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
Automerger Merge Worker
5730eabbd6 Merge "Merge "Disable language logging in TextClassifier/TranslateEvent" into rvc-dev am: 934df62467 am: 57c56e91d8" into rvc-d1-dev-plus-aosp am: f0a6ee9ad7 am: a78f532c70
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11744901

Change-Id: Iae910dac6f6a0f1da47b47dacef3d5bb082f9b8b
2020-06-11 17:38:38 +00:00
Abodunrinwa Toki
8156fb251a Merge "Disable language logging in TextClassifier/TranslateEvent" into rvc-dev am: 934df62467 am: 57c56e91d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11744901

Change-Id: Ic4a05b570af049f5f821c24d8a357c4b797bdf84
2020-06-11 17:16:38 +00: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
e114dc0ce8 Merge "Fix NPE in InlineContentView" into rvc-dev am: 854b0d1a89 am: cc2d440d90 am: aa9b18aadf am: d57f28de3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11784246

Change-Id: I7cb7bfd398755b78bb1371743356ad0587fc2d1f
2020-06-09 04:35:41 +00:00
TreeHugger Robot
aa9b18aadf Merge "Fix NPE in InlineContentView" into rvc-dev am: 854b0d1a89 am: cc2d440d90
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11784246

Change-Id: I2eacf1d3ef55fc80bcee86331fed062e20adc66c
2020-06-09 04:09:59 +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