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
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
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
* 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
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
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
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
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
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
* 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
Add possible conditions under which SystemUI may not prompt the user to
add a control.
Test: no test
Fixes: 159728016
Change-Id: I143e50cc15397d85b4212d9fb29d64df7c2de80c
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
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
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
* 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
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
* 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