Commit Graph

104630 Commits

Author SHA1 Message Date
Charles Chen
5c25605da0 Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev 2020-07-08 17:46:09 +00:00
Charles Chen
3b8e8d7631 Fix NPE when invoking Context#isUiContext
Add null checks in both ContextWrapper and before obtaining
ContextImpl#getOuterContext.

Test: atest ContextTest#testIsUiContext_ContextWrapper
fixes: 160037462
Change-Id: Ic6a71dd9ac4b195d219d6e5431f2f2b199a400fa
2020-07-08 23:58:58 +08:00
Nikita Dubrovsky
f44a60bd69 Merge "Change cursor drag threshold from 30 to 45 degrees from vertical" into rvc-dev 2020-07-08 15:40:16 +00:00
TreeHugger Robot
d99b74a975 Merge "Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc" into rvc-dev 2020-07-08 03:09:16 +00:00
Eugene Susla
aad46b8980 Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc
Fixes: 160119966
Test: presubmit
Change-Id: If7db38ae7d96441cabab1141e93abf357daf8164
2020-07-06 10:23:25 -07:00
TreeHugger Robot
d70c7dda50 Merge "Fix Bundle#getParcelableArray call" into rvc-dev 2020-07-03 02:22:57 +00:00
TreeHugger Robot
0ef33bcb35 Merge "Revert new logic around FLAG_ALT_FOCUSABLE_IM" into rvc-dev 2020-07-02 13:28:33 +00:00
Adrian Roos
69947c0671 Revert new logic around FLAG_ALT_FOCUSABLE_IM
This broke several apps because it means certain NON_FOCUSABLE windows
are now layered wrong w.r.t the IME, and also no longer get IME insets.

Originally, this was introduced because the IME target was used to
compute which window gets control, but this is now computed based on
the window actually connecting to the IME as reported per IMMS.

Reverts I941571c97145d77b0a59d030cf2a8c8318f3b59f.

Bug: 143898978
Bug: 140641950
Bug: 145812508
Bug: 141738570
Bug: 144619551
Fixes: 159438771
Test: atest WindowStateTests
      atest FocusHandlingTest
      atest WindowManager_LayoutParamsTest
      Also manually using steps:
      1. Launch gmail compose activity
      2. start typing in receipient field
      3. verify that even thoug the suggestions popup
         window w/ FLAG_NOT_FOCUSABLE becomes the
         IME target, control and insets still work.
Change-Id: If451276b1a8c485ec88965d8d30ec8fd3836620f
2020-07-02 11:14:10 +02: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
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
Tadashi G. Takaoka
c4a13e9b0b Fix Bundle#getParcelableArray call
Because Bundle.getParcelableArray() returns Parcelable[] object,
simply casting a return value to a typed array will cause
ClassCastException.

Bug: 158584842
Bug: 160120833
Test: manually install ArcNotificationTest2 and try inline reply
Change-Id: Idd8eaa412925ac826590d44a0db297aacef806d8
2020-06-30 14:18:49 +09: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
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
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
37cf2279c9 Merge "Pass in callsite of SurfaceControl constructor explicitly (1/3)" into rvc-dev 2020-06-26 23:58:17 +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
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
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
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
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
dab5588e84 Merge "Address missed comments from previous CL" into rvc-dev 2020-06-24 16:58:15 +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
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
6e3a4d7625 Merge "Release remove inline suggestion views when session destroyed" into rvc-dev 2020-06-24 05:31:34 +00:00
Tiger Huang
77190b77f6 Merge "Disable user animations on insets whose visible frame is empty (refined)" into rvc-dev 2020-06-24 04:00:09 +00:00
Charles Chen
8655743001 Merge "Enable IMS and its config context to obtain UI component" into rvc-dev 2020-06-24 03:33:53 +00:00
Michael Groover
e0de018109 Add additional info to device ID docs in TelephonyManager and Build
Android 10 introduced additional restrictions to access persistent
device identifiers. This commit updates the javadocs for
TelephonyManager and Build to provide additional details regarding
the requirements and how to check if these requirements are met.

Fixes: 158471988
Test: m docs -j
Change-Id: I02932a22ecc5b761aa1a92d59d09d31863c34235
2020-06-23 19:52:51 -07:00
Feng Cao
17ca1ee84e Release remove inline suggestion views when session destroyed
* Attach to each inline suggestion remote view the user id
  and session id, which together identify a session. Then when
  the session is destroyed, we release all the remote views
  associated with the it.
* Worst scenario is that the IME is still showing the UI when
  the remote view is released due to session destroy, in which
  case the suggestion will disappear from the IME window. But
  we also make sure we send an empty response to IME before
  releasing the views, so it should be bad. Plus when a session
  is destroyed, interacting with the suggestion UI doesn't do
  anything, so it's not very helpful to show them.
* Also add a dump method to the InlineSuggestionRenderService
  to help with debugging

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

Change-Id: I488fd9d9af08d0df3ffd3c851f96c567d07eed5a
2020-06-23 19:17:42 -07:00
Jayant Chowdhary
d7feae01a5 camera2: Add mandatory stream combinations for depth only cameras.
Bug: 159247271

Test: atest ConcurrentCameraTest.java

Change-Id: I89d6209d36f76aa8ec19aaafd81abf1cfd025463
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-06-23 17:45:23 -07:00
Joanne Chung
234a31e2f5 Merge "Made AutofillId.withoutSession is testable." into rvc-dev 2020-06-23 22:56:59 +00:00
Svetoslav Ganov
449851f8e2 Merge "Support clipping in InlineContentView" into rvc-dev 2020-06-23 22:43:14 +00:00
TreeHugger Robot
c139a0071a Merge "Add information about requestAddControl" into rvc-dev 2020-06-23 22:33:09 +00:00
TreeHugger Robot
e16a6a02a7 Merge "[DO NOT MERGE] Bring back touch events for double tap and double tap and hold." into rvc-dev 2020-06-23 22:24:13 +00:00