Add more dumps and logs to better help debug IME insets better
Logging can be enabled by setting InsetsController.DEBUG to true.
Bug: 154348613
Test: manually build and flash.
Verify showing and hiding IME shows logs.
verify adb shell dumpsys window windows has new dumps
Change-Id: Iad0a21d81a22d6acfaaf5c5ca8b5131eec411e79
By previous memory patch, the divider will always call update when
enter split when means it always add divider view when showing. So
we can reduce some update call to avoid any unnecessary surface
memory allocate.
Fix: 150190730
Test: Check split mode rotate normally and dump SF to check divider
memory status
Change-Id: Ibccd0b998d299968ee6d68127c801fae656d2127
This can be used to support a 3rd kind of system bar to inset the
applicaiton space.
Bug: 152763889
Test: manual
Change-Id: I3ba75886e94a9fe80a0d1a920749d152dda64031
When the IME restarts input, it re-requests to show itself. If the app is
already animating, we should maintain that animation instead of cancelling
it.
Fixes: 155962435
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I57618e43b2cddc55e5dfc32111abbbd82cc6ed48
Fixes a few issues around cancelling insets animations:
- dispatch the onEnd callback when the animation gets cancelled
- When using the CancellationSignal, we need to properly cancel the
animation, and not just the controller - otherwise we never actually
remove it from mRunningAnimations.
- Now that cancellation dispatches to apps, make sure they do not
restart a different animation of the same type we just cancelled
Bug: 156740834
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I4c36470a816ff8e3b92cd03090b8e947a2234f13
When we set the buffer size from relayout window, there is a race
condition where the client may then submit its first buffer but the
transaction hasnt applied yet on the SF side and so the buffer is
rejected. Setting a defualt size when creating fixes this. Luckily
SurfaceControlViewHost size is known at add time, since we force the
window size based on the values passed in to the SurfaceControlViewHost API.
Bug: 157153874
Test: Existing tests pass
Change-Id: I2566844aea81df92f1694f43254a480fc3b3c019
- Added onFixedRotationStarted/onFixedRotationFinished callback in
DisplayWindowListener
- onFixedRotationStarted shall be called before onTaskAppeared for PiP
- When onTaskAppeared is received in PipTaskOrganizer, we defer the
entering PiP transition if fixed rotation is ongoing
- When onFixedRotationFinished is received in PipTaskOrganizer and the
entering PiP transition is deferred, schedule an immediate
transition to PiP to make sure all the expected callbacks from
PipTaskOrganizer are still being sent
Video: http://go/recall/-/aaaaaabFQoRHlzixHdtY/bb8HjJvMZKtpN8YTPKZXmj
Bug: 153861223
Test: manually enter PiP from Play Movies / YT fullscreen
Test: atest ActivityRecordTests \
RecentsAnimationControllerTest \
ActivityTaskManagerServiceTests \
PinnedStackTests
Change-Id: I0dea905d610e2387af56b611be5f93518cc9a153
Typically this data would have been flushed at the end of the
first draw and there would otherwise be an extended delay
before the data would be sent to the service.
Test: make -j
Test: Manually start WhatsApp - check for lost events
Test: atest CtsContentCaptureServiceTestCases
Bug: 154777879
Change-Id: Ia0a97e24ffcc1c189d5d0cd6b8888678fa48968e
Otherwise, we would think its visibility needs to be cleared.
This CL:
- reverts parts of eb5a5920b7,
- prevents sending redundant MSG_DISPATCH_SYSTEM_UI_VISIBILITY, and
- cancels clearing visibility if a new reversed visibility is set.
Fix: 156994866
Test: atest --iterations 100 LayoutTests#testAddingImmersiveWindow
atest WindowInsetsControllerTests InsetsAnimationControlImplTest
Change-Id: I8b8b7541523c0a94daf336f3be415aa5fa3f33da
A windowless SurfaceControl could grant input via
IWindowSession.grantInputChannel, but other window may receive the
obscured events because of the type value of input window is always 0.
The obscured or partially obscured flag indicates that the window
received this motion event is wholly or partially obscured by another
visible window above it.
We have to filter out the trusted overlap so the motion event could
properly dispatch to the view if it is a security sensitive application.
Bug: 156063505
Test: enter split window mode and check the motion event
Change-Id: I10f63ea131a70ee8cc7d5c4b3e5ca4e5f06fdbad
This reverts commit 0df8812486.
The original CL is trying to reduce the dependency of PownerManager to
finish input when screen off by using display state.
However, it doesn't fully fix the original Bug 26851566 since we only
finish input connection but didn't callback onFinishInput callback for
IME client.
Also, for some scenarios, the window / view focus may not change
during screen turns off / on:
- Focusing timing when disable keyguard, then quickly screen off / on.
- Using P-sensor to turning screen off / on.
When the above scenario happens, makes input connection cannot re-start
and soft-keyboard can't be shown.
(The recovery is manually focus on next window or activity.)
As the above reason, we need to re-consider the lifecycle of
input connection, window / view focus when not only screen state but also
device inactive state when always-on-display.
Fix: 156045961
Fix: 154605805
Bug: 26851566
Bug: 156215187
Test: atest CtsInputMethodTestCases
Change-Id: If06daf71160aa44a4254ac125561974ecbdef4f2
* Imagine this event sequence:
1) the IME tries to re-attach an inline suggestion view to the
window (e.g. because IME layout changes), it calls into the system
server which causes recreating the backing view because it was
destroyed earlier due to 0 ref-count (this happens under the hood
without IME knowing it happens, so the view is still attached to
the window).
2) the IME receives a new inline suggestion pointing to the same
backing view (perhaps due to filtering kicks in).
3) the recreation from step 1 finishes, but now it will callback
to the new inline suggestion, therefore the old view doesn't receive
the new SurfacePackage. See RemoteInlineSuggestionUi for why.
4) the view in step 1 is detached from window, since it never
receives a SurfacePackage from the remote view, its detach shouldn't
cause a reference count down on the remote view.
Test: atest android.autofillservice.cts.inline (sanity test)
Bug: 154683107
Change-Id: I2e6814ef3889de603f6e170efcb795b69ec9febe
positionLost can be called from CanvasContext::destroyHardwareResources
which runs asynchronously to the UI thread. This means we could be
simultaneously executing releaseSurfaces on the UI thread. We need
to expand the scope of mSurfaceControl lock in positionLost. While
we are here we add a block comment explaining the previously
undocumented locking strategy.
Bug: 156264048
Test: Existing tests pass
Change-Id: I9cdb6a0f7aeffd878f1755f240e8896f0fb8bf01
Pre-R, the screenshot window was used just for screenshot animation. In
R, the window is also hosting tappable screenshot actions, which require
focus.
This change modifies TYPE_SCREENSHOT to no longer force it to be
unfocusable.
Test: Verify that screenshot window UI elements can work with talkback
and accessibility scanner.
Bug: 153517161
Bug: 152583784
Change-Id: If81d9f94dff801c3483a2d834e692b4c77d80d7b
Anecdotally this should cover typical messaging first screens
whereas 100 events seems to be small.
Test: make -j
Test: Manually start WhatsApp - check for lost events
Bug: 154777879
Change-Id: I3090584ec03714656948045189e0e0c068740c82
In the test we trigger the manual autofill request programmatically,
because the focus isn't on the field, we will not get the callback
from IME.
It would be better not to ask IME for inline request if the request
is manual and the view is not focused because it's a simpler/safer
approach and manual request without focus should be rare.
Bug: 154661868
Test: atest CtsAutoFillServiceTestCases
Change-Id: I783b2542094cdea547ebd58ce89f30d9cd421708
* changes:
Send fixed rotation adjustments to the associated client
Add support to override display adjustments by token
Add fixed rotation display adjustments
The transform hint is used to prevent allocating a buffer of a
different size when a layer is rotated. The producer can choose to
consume the hint and allocate the buffer with the same size.
Provide the graphic producer a transform hint if the layer and its
children are in an orientation different from the display's
orientation. The caller is responsible for clearing this transform
hint if the layer is no longer in a fixed orientation.
Bug: 152919661
Test: atest VulkanPreTransformTest
Test: confirm with winscope trace, buffers are allocated taking into
account the transform hint in fixed orientation scenarios
Test: go/wm-smoke
Change-Id: I2ccc21ed8af015716e6cdfde1e3cec67c99f3339
So the real information of display can be adjusted according
to the adjustments for the application started with fixed
rotation transform.
The enabling adjustments may be sent in different ways:
- Launch activity
The information is bundled with LaunchActivityItem.
- Resume activity or update non-activity window
Send a standalone FixedRotationAdjustmentsItem.
The disabling adjustments (null) are always sent by
FixedRotationAdjustmentsItem.
Bug: 147213487
Test: AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
TransactionParcelTests#testFixedRotationAdjustments
Change-Id: I5238888a5c8352db83fc12749f4de2bfabf46026