* changes:
Use WindowContext in GlobalScreenshot
scrollCapture: Avoid crash if host window doesn't exist
Refactor names of internal scrollcapture interfaces
Renames to better align with use and existing naming patterns.
Using 'connection' to avoid confusion as to control flow or
roles. (A connection is direct from SystemUI --> App process)
IScrollCaptureClient -> IScrollCaptureConnection
IScrollCaptureController -> IScrollCaptureCallbacks
Test: atest FrameworksCoreTests:ScrollCaptureConnectionTest \
FrameworksCoreTests:ScrollCaptureTargetResolverTest \
ScrollCaptureTest
Change-Id: I9afd33109f6718b61d172ce3e4b3bb5d71a2897e
ImporantForAccessibility can be called from the View constructor
in which case we may not have initialized RemoteAccessibilityController
yet.
Bug: 171015133
Test: Existing tests pass. Repro from bug.
Change-Id: Iedc29a9d4270ebe600648d6ce5e17c864a662396
The new logic sends the requested visibility to server even when the
client doesn't have a control. This makes the requested visibility
reliable at the server side.
This CL also changes getRequestedState to getRequestedVisibility in
WindowState, because the frames in getRequestedState are not reliable.
Fix: 161247175
Fix: 166819574
Test: atest DisplayPolicyLayoutTests DisplayPolicyTests InsetsPolicyTest
InsetsSourceProviderTest InsetsStateControllerTest
WindowStateTests InsetsAnimationControlImplTest
InsetsControllerTest WindowAddRemovePerfTest
ActivityRecordTests
Change-Id: I7d32dacaa1302bab61386f5bd69aaa7dde953ebe
If blast sync is not enabled abut we need to report draw finished
for the next frame, call setNextTransaction. Blast buffer queue
will process any queued up buffers and ensure the buffer is
submitted before reporting draw finished.
Test: Test no flickers with blast enabled in splitscreen
Change-Id: If7a36eb0a9a2914dd37adfd20abcbe2b5074b16a
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.
The change was generated by running
find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'
in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.
Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
For products that don't want the app orientation request to change the
display's rotation, but still want the rotation to change based on
sensor readings. Apps requesting a different orientation will be
letterboxed.
Bug: 170725334
Test: adb shell cmd window set-ignore-orienation-request 1
Change-Id: I53bea137ff37b70417ed8f68ade97d9de1f284ae
There were a few places that were not thread safe.
1. finishBLASTSync is called from the Render Thread. It
was updating mSurfaceChangedTransaction, which send to WMS on the
UI Thread. Instead, create a new local Transaction object to allow the
Render Thread to merge the mRtBLASTSyncTransaction into it. Then on the
UI thread, merge the temporary transaction into mSurfaceChangedTransaction
2. finishBLASTSync was getting called if the draw was unable to run
asynchronously. This would mean it would get executed on the UI Thread,
possibly causing a race. Instead, remove since there should be nothing
on the blast sync transaction, mRtNextFrameReportedConsumeWithBlast
would never have been set, and mSendNextFrameToWm is set to false
beforehand.
Test: YT with and without Blast
Change-Id: I72e70fea258a933f51aaaf78c7056a0d3fbac8b3
SurfaceView checks if VRI hasn't changed its surface when deciding
whether to call updateRelativeZ in updateSurface. This is to give
surfaceReplaced a chance to send the updateRelativeZ in the same
transaction as swapping the surfaces.
However, SV was only checking generation id, which may not have changed
when using a blast layer. Instead, VRI will increment the sequence id
when the surface has been replaced. SV can check that value and only
do an immediate updateRelativeZ when the sequence id has not changed.
Test: Blast + Split + SV with no flicker
Change-Id: Icdf9f1fbe12fe77052030aa37d808517c5a6cd38
We extract the SurfaceControlViewHost accessibility logic from
SurfaceView. This is serving both cleaning up the code in SurfaceView
a little, while also serving the goal of one day using this
accessibility code from other components.
Test: Existing tests pass
Change-Id: I0333ab339e54e3766fffab25df92f00bdb9723dc
Since visible=mVisible we don't really need this visible variable
we clean it up to avoid confusion.
Test: Existing tests pass
Change-Id: I7ae7b27f71744c90004f77467f6fd5e79d2f557c
This has become a mega function, the number of variables
and levels of indentation is increasingly difficult to read.
This is a simple abstraction of one large chunk.
Test: Existing tests pass
Change-Id: If20185ce640802173ccd53c84b1947b011f379ad
We are the last user of SurfaceControl#setOverrideScalingMode
in ScreenRotationAnimation we have no need to call it since we
are the BufferProducer and we can just use Surface#setScalingMode
Bug: 161937501
Test: Existing tests pass
Change-Id: I049145a91fedbbca5f009648f1537b0380c5e771
If Blast was enabled, WindowStateAnimator would create a container layer
and then a blast layer as a child. This caused some issues with
reparentChildren and relative Z, so instead of trying to continously fix
those issues, just use one layer. If blast is enabled, it will create a
single SurfaceControl with type blast. Otherwise, it will create a
BufferQueueLayer.
This means that we have to be careful with setting any properties on
the layer since the blast adapter could also be modifying the layer.
This is in the right direction since we will move all transactions for
the layer to the client, eventually.
Test: YT and Chrome with and without Blast
Change-Id: I43efc37663696ba8e54d341a03531f0048ee6a14
Bug: 170191676
Bug: 152068298
Test: Will update CTS tests in a separate CL once all API council
feedback is addressed
Change-Id: I6e6f160020042ad19c4a7a8ae6fd0f090b301837
The fields are documented on the public getters and on the Builder, so
removed the duplicate javadocs from the private fields.
Bug: 152068298
Test: m -j
Change-Id: Id45cee9003a4b754f09c52d1afcd1d8572e464df
MediaSessionManager accepts KeyEvent in some system APIs,
which can be used from non-mainline modules.
Bug: 169046322
Test: build successful
Change-Id: Ibfa67c154af7ca189ea8cefa8c9cbb746365fb30
Added hidden callback methods on View to notify editors when the
system has initialized an InputConnection successfully and when
the InputConnection is closed.
This allows editable views (e.g. EditText) to have access to the
final EditorInfo and InputConnection that were created via
onCreateInputConnection(). This enables the editor platform code
to do things such as
* know what type of content can be inserted into the view (ie, the
MIME types in EditorInfo.contentMimeTypes)
* call APIs on InputConnection, e.g. commitContent() to pass
non-text content to the application
Bug: 163400105
Test: Manual and unit test
atest FrameworksCoreTests:ViewInputConnectionTest
Change-Id: Iaafb0a03126c9292c24415f866dbdd72cadfa239
Pass the frame deadline calculated by SF to Choreographer so
hwui would be able to improve its stats by knowing if a frame is
likely to be late.
Bug: 169858174
Test: manual
Change-Id: Ib9fd93638b54f08d8dc72fa6b023e2dd7c276dc7
* changes:
Upgrade AndroidFrameworkBinderIdentity to fatal.
Tighten up Binder.clearCallingIdentity() usage.
Tighten up Binder.clearCallingIdentity() usage.
Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.
Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities. In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.
Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
This CL implements a mechanism to dump InputMethodService and IME
related server states into a proto file which can later be imported
to Winscope to allow easy debugging.
The Design Doc for the IME tracing project is: go/ime-tracing
Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
end trace by calling "adb shell ime tracing stop"
pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: Icbfb8c11e882f29eb45dea9d4c23315c48e9d619
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.
This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared. Here's the exact command
used to generate this CL:
$ find . -name "*.java" -exec sed -Ei \
's/ (long \w+ = .+?clearCallingIdentity)/ final \1/' \
{} \;
Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a