Commit Graph

105168 Commits

Author SHA1 Message Date
Charles Chen
e201638cdb Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev am: 8deb612a14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004931

Change-Id: Idb3a5a9ab657006f82cacc977b0eed33395a7432
2020-07-01 23:42:44 +00:00
Charles Chen
8deb612a14 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev 2020-07-01 23:21:51 +00:00
Eugene Susla
5754630afd Merge "Clarify type of EXTRA_DEVICE in javadoc" into rvc-dev am: 436719f1b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12037667

Change-Id: Ide367657425871b9b328d75e39bfb30c6daa3b16
2020-06-30 00:57:01 +00:00
Eugene Susla
436719f1b7 Merge "Clarify type of EXTRA_DEVICE in javadoc" into rvc-dev 2020-06-30 00:36:44 +00:00
Eugene Susla
421eabcd37 Clarify type of EXTRA_DEVICE in javadoc
We have this in guide but not in javadoc, but it would make
sense to have it in javadoc as well.

Test: presubmit
Change-Id: I585248cc40c44bfa90828f04e4b5bd34694c36fd
Bug: 139376317
2020-06-30 00:36:26 +00:00
Ahaan Ugale
5085f4bbf1 Merge "Do not replace the authenticated dataset for pinned inline suggestion" into rvc-dev am: 913b610e53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12001033

Change-Id: Ia62ed8b1f9a1d3af9973588005192bd642a69c99
2020-06-29 23:59:02 +00:00
Ahaan Ugale
913b610e53 Merge "Do not replace the authenticated dataset for pinned inline suggestion" into rvc-dev 2020-06-29 23:44:24 +00:00
Rob Carr
7f46d57c67 Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev am: 9464091e72
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12010092

Change-Id: I86b46bdbd1a485d286d49dbcf86abbd0141f9c44
2020-06-29 21:47:09 +00:00
Rob Carr
9464091e72 Merge "SurfaceView: Clean up deferred-destroy-surface from UI thread" into rvc-dev 2020-06-29 21:42:03 +00:00
Charles Chen
ba4ffa4a6d Revert "Revert "Enable IMS and its config context to obtain UI component""
Test: atest StrictModeTest
Bug: 157027563
Bug: 159795597
Change-Id: I2a1b3fefa0bd82eeaa507c08fc4a79fc9f4391c5
2020-06-29 14:27:08 +00:00
Jorim Jaggi
3f8fc80e42 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: I25309fc3f8ad0429134d437a26a1d60572ed3e53
2020-06-27 00:14:19 +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
Curtis Belmonte
9512587f44 Merge "Update biometric constant docs from tier to class" into rvc-dev am: 29d2bf129a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11840347

Change-Id: I047abea00739993b837f076ce53488f3ce9c77ff
2020-06-26 20:28:30 +00:00
Curtis Belmonte
29d2bf129a Merge "Update biometric constant docs from tier to class" into rvc-dev 2020-06-26 20:10:50 +00:00
Robert Carr
9a808a2ee2 SurfaceView: Clean up deferred-destroy-surface from UI thread
We utilize mTmpTransaction without locking from the main thread. The
callback info inside the transaction stores an sp to the SurfaceControl.
If we apply the Transaction from two threads independently we may
implicitly call reset() on the same sp instance twice in an overlapping
fashion. While the reference count is itself atomic, that wont stop us
from decrementing it twice here, when we only had one reference.
This leads to an early free and a crash later.

Bug: 159333209
Test: Existing tests pass
Change-Id: I898bef0b6b8c1cf34891410bbadf63fe2f840697
2020-06-26 18:47:28 +00:00
TreeHugger Robot
419a4fc1c0 Merge "Clear inline suggestions before onStartInput instead of before onFinishInput" into rvc-dev am: 4619e6e1d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11994808

Change-Id: I3f262100471b1ebce67a48b891342ba659116c11
2020-06-26 14:42:27 +00:00
TreeHugger Robot
4619e6e1d7 Merge "Clear inline suggestions before onStartInput instead of before onFinishInput" into rvc-dev 2020-06-26 14:21:21 +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
0cfb45900e Merge changes I74d8f555,I7521a5a1 into rvc-dev am: b5d9c88ddd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959351

Change-Id: I676d92d832c7b59f41b55928fdc44739244680fa
2020-06-26 10:51:09 +00:00
TreeHugger Robot
b5d9c88ddd Merge changes I74d8f555,I7521a5a1 into rvc-dev
* changes:
  Prevent ANR if window is stopped
  Isolate batched input scheduling logic.
2020-06-26 10:40:27 +00:00
Stanislav Zholnin
daf1861655 Merge "Add testAppOps test to TEST_MAPPING." into rvc-dev am: ebe2773f3d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12000934

Change-Id: I1ebcf3c0f970f954d3b0743c28ca47b4dc17ddcc
2020-06-26 09:59:24 +00:00
Stanislav Zholnin
ebe2773f3d Merge "Add testAppOps test to TEST_MAPPING." into rvc-dev 2020-06-26 09:47:32 +00:00
Stanislav Zholnin
2a4f925537 Add testAppOps test to TEST_MAPPING.
Approval are here: ag/11091388.

Test: atest UidAtomTests#testAppOps
Change-Id: I571e549f57968a83b32f5871994ea7b1b74be3d0
2020-06-26 09:44:11 +00:00
Feng Cao
32cfac9ed7 Do not replace the authenticated dataset for pinned inline suggestion
* For the case where the pinned inline suggestion triggers an
  pending intent through the auth flow, and it returns a dataset
  to be autofilled, previously we would replace the existing
  dataset with the returned dataset. However, this is causing
  several potential issues:
  1. if the returned dataset doesn't contain inline presentation
     the the pinned icon will not show again
  2. if the returned dataset contains inline presentation but not
     the pending intent, then the pinned icon will show up again
     but tapping on it will not launch the pending intent
  3. if the returned dataset contains the inline presentaion and
     the pending intent, then when we "autofill" it, it'll fire
     the pending intent directly as opposed to filling in the
     value
* We fix the issue by not replacing the old dataset if the dataset
  is a pinned inline suggestion.
* One caveat of the approach is that: a dataset can potentially
  have multiple fields, and it's possible that some of the fields'
  has inline presentation and some don't. It's also possible that
  some of the fields' inline presentation is pinned and some isn't.
  So the concept of whether a Dataset is pinned or not is
  ill-defined. Here we say a dataset is pinned if any of the field
  has a pinned inline presentation in the dataset. It's not ideal
  but hopefully it is sufficient for most of the cases.
* An alternative approach is to have the autofill provider telling
  whether they want to replace the old dataset or not, through
  a new field in the returned Bundle. But that requres an API change
  so is infeasible at this time.

Test: atest android.autofillservice.cts.inline
Test: atest android.autofillservice.cts.augmented
Test: atest android.autofillservice.cts.LoginActivityTest
Test: atest android.autofillservice.cts.AuthenticationTest
Bug: 159367101

Change-Id: I6d162aeb88a4655989c1aa315df8304c0980ac60
2020-06-25 17:39:13 -07:00
TreeHugger Robot
83eae8840c Merge "Fix issue in InsetsState.set" into rvc-dev am: 2a60031116
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11987763

Change-Id: Iab65d955f9fa3859e70b33532636c88345588ea1
2020-06-25 21:33:35 +00:00
TreeHugger Robot
d1931208d5 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: I171118ad3bac8af60d436c493879b591149cc294
2020-06-25 21:28:57 +00:00
TreeHugger Robot
245aa49c6a Merge "Revert "Enable IMS and its config context to obtain UI component"" into rvc-dev am: 9e7c46190a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11988595

Change-Id: Icbe99f16eeb1f74e9947bd1ad4857d4bc38e7c4a
2020-06-25 21:25:31 +00:00
Evan Severson
09332328bb Merge "Implement permission revoke with reason" into rvc-dev am: cee666eba9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11959996

Change-Id: I0d90cae1892975070d4e9b38f11d1bd60eaf4172
2020-06-25 21:19:22 +00:00
TreeHugger Robot
509d70e6ff Merge "camera2: Add mandatory stream combinations for depth only cameras." into rvc-dev am: a0637ae24b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11967540

Change-Id: Ic5270e7a58eab5dd9b797532df858a2007272ce5
2020-06-25 21:16:49 +00:00
Siarhei Vishniakou
48f110ec7b Prevent ANR if window is stopped
When an activity is stopped, there could still be some pending events in
the inputconsumer due to batching. Those events are supposed to be
handled when choreographer's 'CALLBACK_INPUT' occurs, but this will
never happen if the window is stopped.

There are two possible ways these events can occur:

1. The last input event happens before onStop, but at that point,
choreographer will already stop sending callbacks. The solution to this
is to add a call to "consumeImmediately" inside setWindowStopped.

2. Input events come in after window has already been stopped. At that
point, the callback we posted in 1. would already have executed (and
found that there's no events). The solution to this is to immediately
consume all input if mStopped=true. We do this by switching to
"unbuffered" mode for simplicity.

This is reproducible via monkey testing, but it's plausible that such
race condition can occur in real world usage.

Test: adb shell monkey --throttle 40 50000
Bug: 159239700
Change-Id: I74d8f55503ef7df2fd01931afb362d68e5026e86
2020-06-25 19:09:53 +01:00
Michael Wright
17761fff2a Isolate batched input scheduling logic.
Having whether something is currently scheduled get modified in the
actual processing logic and away from the scheduling logic makes it
unnecessarily more difficult to reason about.

In this case, we were only checking whether the Choreographer-aligned
runnable was actually scheduled before we'd consume input. When trying
to unbuffer dispatches so that things were no longer
Choreographer-aligned, however, we'd unschedule the that runnable just
before we tried to consume input and hence just before the check . This
meant we never actually consumed the batches until the next one came in
where we would then consume them immediately.  Worse, if another one
never came in then we'd never actually consume the batch.

By removing the scheduling logic from the processing logic we avoid this
situation. Now only the schedule, unschedule, and actual runnable logic
touch their own scheduled state, so that we don't have to consider the
two pieces of logic together except in isolated places.

Bug: 158540186
Bug: 159239700

Test: manual, using app that injects unbuffered dispatch requests either
      at ACTION_DOWN or first ACTION_MOVE
Change-Id: I7521a5a16ed52afc41261f501128b5498ea0602c
2020-06-25 19:08:05 +01:00
Jorim Jaggi
b2410eb4f9 Fix issue in InsetsState.set
Test: InsetsStateTest
Fixes: 159610005
Change-Id: I7e64c4f7d93caae13b43f595a7ec8af901316399
2020-06-25 12:34:03 +00:00
Feng Cao
62cc7dec3f Clear inline suggestions before onStartInput instead of before onFinishInput
* In case where there are multiple input fields in a single WebView,
  switching focuses between input fields doesn't trigger an onFinishInput
  from the previous field. But it always triggers an onStartInput in
  the new field. So it's safer to clear the suggestions onStartInput

Test: atest android.autofillservice.cts.inline
Test: atest CtsInputMethodTestCases
Bug: 159479887
Bug: 157515522

Change-Id: Ie380db855fbc93600635790ef5adc1031d6f0787
2020-06-24 20:07:09 -07: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
TreeHugger Robot
9e7c46190a Merge "Revert "Enable IMS and its config context to obtain UI component"" into rvc-dev 2020-06-25 00:41:07 +00:00
Evan Severson
cee666eba9 Merge "Implement permission revoke with reason" into rvc-dev 2020-06-24 23:02:46 +00:00
Alistair Delva
71b8a0456c Revert "Enable IMS and its config context to obtain UI component"
Revert "Verify IMS to get display and WM"

Revert submission 11823238-ims_ui_context

Reason for revert:
Broke the following tests:
android.os.cts.StrictModeTest#testIncorrectContextUse_GetDisplay
android.os.cts.StrictModeTest#testIncorrectContextUse_GetSystemService
android.os.cts.StrictModeTest#testIncorrectContextUse_GetViewConfiguration
But was submitted with a bypass.

Reverted Changes:
I688b46a92:Verify IMS to get display and WM
I172ceb2e1:Enable IMS and its config context to obtain UI com...

Bug: 157027563
Bug: 159795597
Change-Id: Id309faac0ac8f60ee0d92c26767a89f450ddc455
2020-06-24 22:31:53 +00:00
TreeHugger Robot
a0637ae24b Merge "camera2: Add mandatory stream combinations for depth only cameras." into rvc-dev 2020-06-24 22:18:26 +00:00
Evan Severson
aacd48b0bc Implement permission revoke with reason
The reason is passed to app exit info so a given app can get more
information about why their app was killed in the event of permission
revoke.

Test: atest RevokePermissionTest ActivityManagerAppExitInfoTest#testPermissionChangeWithReason
Fixes: 159659620
Change-Id: Id711667eb2c1579ecb2a1b83a62af3cc7862d5f6
2020-06-24 10:03:54 -07:00
Svetoslav Ganov
d00340e1a5 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: I2be3b6011f74dbe7fdb2d4ada0bf9537fd13c7e7
2020-06-24 17:01:46 +00:00
Svetoslav Ganov
dab5588e84 Merge "Address missed comments from previous CL" into rvc-dev 2020-06-24 16:58:15 +00:00
TreeHugger Robot
11d1ba3fde Merge "Add additional info to device ID docs in TelephonyManager and Build" into rvc-dev am: 3fa2d86fd0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11980365

Change-Id: I464bd5f8ca393f9df0016de5a5cf176ecafeda28
2020-06-24 16:29:06 +00:00
TreeHugger Robot
3fa2d86fd0 Merge "Add additional info to device ID docs in TelephonyManager and Build" into rvc-dev 2020-06-24 16:15:32 +00:00
Svetoslav Ganov
a962563758 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: I722c85801f7e967f33bf41e08c01f6f3561347fc
2020-06-24 06:44:24 +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
Svetoslav Ganov
f8b9ddea71 Merge "Handle reperenting of InlineContentView" into rvc-dev 2020-06-24 06:28:59 +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
TreeHugger Robot
29c7295caf Merge "Release remove inline suggestion views when session destroyed" into rvc-dev am: 6e3a4d7625
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11972118

Change-Id: Iea1d860438282cc334f179f57eb9a8302500080e
2020-06-24 05:37:58 +00:00
TreeHugger Robot
6e3a4d7625 Merge "Release remove inline suggestion views when session destroyed" into rvc-dev 2020-06-24 05:31:34 +00:00
Tiger Huang
4c3dac8019 Merge "Disable user animations on insets whose visible frame is empty (refined)" into rvc-dev am: 77190b77f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11908304

Change-Id: I398826e9bd5398c390ba1063cded55b3809d19b1
2020-06-24 04:02:33 +00:00