Commit Graph

104611 Commits

Author SHA1 Message Date
Vishnu Nair
019e08fdbb ViewRootImpl: Call surface destroy callback after layout pass
If a requestLayout happens on a child view after the measure
pass, before the layout pass then the child view will not layout.
This can happen if a view calls requestLayout during measure
or during SurfaceView surface destroyed callback.

This fix addresses the second scenario by moving the callback
to after the layout pass.

Bug: 159183008
Test: Repro steps in bug
Test: go/wm-smoke
Change-Id: Ie2794a3751c99cabf6e07445c91159e35eeb1729
2020-07-08 12:44:47 -07:00
Curtis Belmonte
29d2bf129a Merge "Update biometric constant docs from tier to class" into rvc-dev 2020-06-26 20:10:50 +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
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
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
Fabian Kozynski
e134edc497 Add information about requestAddControl
Add possible conditions under which SystemUI may not prompt the user to
add a control.

Test: no test
Fixes: 159728016
Change-Id: I143e50cc15397d85b4212d9fb29d64df7c2de80c
2020-06-23 15:48:10 -04:00
Nikita Dubrovsky
2d4921d1f5 Merge "Fix double-tap detection in TextView's SelectionModifierCursorController" into rvc-dev 2020-06-23 18:59:38 +00:00
TreeHugger Robot
e11fa9a741 Merge "Clear inline suggestions before onFinishInput" into rvc-dev 2020-06-23 17:49:19 +00:00
Jeff Sharkey
38a6333ff6 Merge "Override MIME type to match MediaStore behavior." into rvc-dev 2020-06-23 15:56:44 +00:00
Jeff Sharkey
83aaf908a6 Override MIME type to match MediaStore behavior.
Internally, DownloadManager synchronizes its contents with MediaStore,
which relies heavily on using file extensions to determine MIME types.

To prevent these two databases from getting confused, this change
adjusts DownloadManager to force the MIME type of already-completed
downloads based on the file extension, matching what MediaStore does.

Bug: 159594536
Test: atest PublicApiAccessTest#testAddCompletedWithoutExtension
Change-Id: I60c613eafcfe55007dffcac2d7d1fe375b753c19
2020-06-23 07:13:13 -06:00
Issei Suzuki
16868fbef0 Merge "Update virtual display size before turning it on." into rvc-dev 2020-06-23 11:46:16 +00:00
Adrian Roos
e658c76b5c Merge "IME animation: hide IME-related navbar icons until perceptible" into rvc-dev 2020-06-23 07:06:48 +00:00
Joanne Chung
24abde551e Made AutofillId.withoutSession is testable.
We add new test in stage-aosp-rvc-ts-dev for R2, we need make this API
testable.

Bug: 156408900
Test: atest android.autofillservice.cts.inline.\
InlineAugmentedWebViewActivityTest

Change-Id: I27d1227f858aac83b3de1cb8ef719edf177524dc
Merged-In: I27d1227f858aac83b3de1cb8ef719edf177524dc
2020-06-23 00:38:40 +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
Kweku Adams
6cca001863 Merge "Disable restricted bucket." into rvc-dev 2020-06-23 00:13:41 +00:00
Jing Ji
471ef84e33 Merge "Fix memory leak in StrictMode violation throttling" into rvc-dev 2020-06-23 00:04:49 +00:00
Feng Cao
908126d4a7 Clear inline suggestions before onFinishInput
* The problem with sending empty response to IME is that the IME
  may want to handle the following two cases differently:
  a) all suggestions are filtered out due to user typing: ime may
     want to immediately delete the existing suggestions to make
     place for other types of things, such as IME's own word
     completion or next word prediction.
  b) the current input connection is finished and a new connection
     will be created with the same field or a different field:
     ime may want to delay removing the suggestions so that if there
     is new inline suggestions coming soon after for the next
     connection, the UI transition can be smoothed out by skipping
     the gap of deleting the old suggestions and showing the new
     suggestions.
* We used to rely on the IME impl to clear the suggestions when input
  is finished. That was done to give the IME the flexibility to
  smooth out the UI updates. Otherwise in case the input connection
  is finished and immediately started again on the same field,
  and there is another non-empty suggestion coming after short after,
  it would cause UI flicker. Because the suggsetion chips would
  disappear for a short moment and then appear again.
* The previously implemented solution was to have the IME impl post a
  delayed deletion of the suggestions when onFinishInput is called.
* In this patch, we get around this issue by synchronously clearing
  the inline suggestions right before the onFinishInput. Then the
  IME impl can post a callback to the main thread to do the actual
  delection. And in the callback it can check whether onFinishInput
  and onStartInput was called right before to determine whether
  it needs to delay the delection or delete immediately.
* Also done in this patch is to clear existing inline suggestions,
  if any, before IME creating a new callback connection to the
  framework.

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

Change-Id: I6fd5d294cf8676a24b8576ea554824608672ce49
2020-06-22 16:52:39 -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
Jing Ji
6985fb39f0 Fix memory leak in StrictMode violation throttling
* Add hashCode() to the base Violation class for dup detections
* Discard obsoleted violation fingerprints if possible

Bug: 159128771
Bug: 159626227
Test: run cts -m CtsOsTestCases -t android.os.cts.StrictModeTest
Test: Manual - Loop generation of StrictMode violations
Test: Manual - Check heap dump
Change-Id: I19a0922fe010fad97b6b819e73acb7db08f84930
2020-06-22 14:22:32 -07:00
TreeHugger Robot
960e49335a Merge "Revert non-API changes to not throw UserOperationException any more" into rvc-dev 2020-06-22 21:05:23 +00:00
Ameer Armaly
9e83d07824 [DO NOT MERGE] Bring back touch events for double tap and double tap and hold.
Bug: 159168795
Test: atest TouchExplorerTest
Change-Id: I427b98c71ce8a2ac5b9285b2f34c1864f48c4a32
2020-06-22 13:58:51 -07:00
Charles Chen
d2fd037ab3 Enable IMS and its config context to obtain UI component
Test: atest StrictModeTest
Bug: 157027563

Change-Id: I172ceb2e17722a7cba917a6e3a808d7559cad3e0
2020-06-23 03:45:17 +08:00
Michael Groover
2bcb70322c Merge "Update docs for methods that require subscriberId" into rvc-dev 2020-06-22 19:30:10 +00:00
Taran Singh
296855fe76 Merge "Fix InsetsConsumer leak" into rvc-dev 2020-06-22 18:53:20 +00:00