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
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
The following attributes are added for grammar suggestions.
- SuggestionSpan#FLAG_GRAMMAR_ERROR
- SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR
Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I0e5da3125d28bb881e513d0d69e0a2d336a9f286
The feature is disabled by default and can be in one of 3 modes:
disabled, permissive and block. In permissive we only log but
don't block the touch. This knob is implemented in a global setting
block_untrusted_touches. It can also be disabled per occluding app using
app-compat infrastructure, so if you disable for a certain app, overlays
of that app won't have the chance of blocking touches. More details
on these on go/try-cross-uid-touches.
Each window has 3 modes related to touch occlusion: ALLOW, USE_OPACITY
or BLOCK_UNTRUSTRED. Check code comments for the meaning of each. If the
feature is turned off for the app, then the mode is ALLOW. Else if it's
a SAW, then it's USE_OPACITY. Else it's BLOCK_UNTRUSTED. These states
are passed to InputDispatcher, who then perform the proper checks and
blocks or not the touch.
If input dispatcher deems the touch unsafe, depending on the feature
mode, we filter out such touches and log a message to logcat.
I also introduce a global (secure) setting
MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH which represents the maximum
opacity allowed per UID that's obscuring the touch-consuming window
according to some rules, which are discussed in topic CL for
InputDispatcher code. This maximum is initially set to 0.8, but we'll
be conducting local experiments to determine the final value.
Test: atest WindowUntrustedTouchTest
Test: atest inputflinger_tests inputflinger_benchmarks libinput_tests
Test: go/try-cross-uid-touches for manual testing
Bug: 158002302
Change-Id: I462858ad5f0d11b1261748489385e6409e38e4b1
This functionality is no longer used, so we can remove it to make it possible to dump all LayerState data exclusively on the client side without requiring access to Surface Flinger to get the layerId
Test: N/A
Change-Id: Ie8939a74e1c29ef767b8df2515fba308b2c7fa15
Add PictureInPictureParams to RemoteAnimationTarget, which would allow
Launcher to determine whether the current app can auto enter PiP.
Bug: 143965596
Test: N/A
Change-Id: I5bc8dd29e9e4e7f3acfe9b841e64344211f57758
1. When calling reparentChildren, we want to move children from old view
root surface to new view root surface. If blast was enabled, the current
code would mvoe children from old view root surface to the layer above
the new view root surface. This would cause the SurfaceView to be
parented to the wrong layer
2. When the view root surface is changed, VRI is supposed to notify the
SurfaceViews so they can call setRelativeLayer to the new view root
surface. This wasn't getting called when blast was enabled because the
logic to check if it was a new surface is different when using a blast
layer. In addition the checking the sequence id that we do now, also
check the relayout flag RELAYOUT_RES_SURFACE_CHANGED since that should
indicate that the surface was changed.
Test: Split screen with Youtube.
Change-Id: I1012678b60cec87a702e4d0ffe3e197eda66cff6
This change is the first in a series of changes to add vsyncIds to
transactions so that SurfaceFlinger could identity jank related
to transactions. In this change we are sending the vsyncIds for
transactions originated by WindowAnimator.
Bug: 166302754
Test: manually see transactions in frame timeline
Change-Id: Ib0e9f4dcc873ab671c2bfded87868bfea2bf9366
This CL implements a mechanism to dump IME related client states into
a proto file which can later be imported to winscope to allow easy
debugging. A new abstract class ImeTracing.java declares the methods
related to scheduling, collecting and dumping logs. Two child class
implement these methods for server and client separately.
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: Ia89f11d5ef8a220ea7746191b18769cea5a8359d
For the BLASTSyncEngine we will need all WSA GlobalTransaction
usage to be redirected to the pending transaction instead.
To prepare for this we first slimmed down WSA as much as possible
to make the remaining job easier. As a next step we start refactoring
code to use a passed in Transaction, but without chasing the global
Transaction all the way to the top. To do this we expose the global
transaction from SurfaceControl.java but with a special wrapper
that makes sure we don't accidentally call apply directly.
As we start cleaning up global transaction usage we can remove some
variants in WindowSurfaceController. In this CL we get setMatrix
and setPosition global variants removed.
Bug: 161937501
Test: Existing tests pass
Change-Id: Ibd8f710c8ca01e57f6f994f23dd7bf2dca3902fd
The bounds on the client surface are controlled by higher levels of
the hierarchy and so the client can use whatever Surface size it wants
on its node. We move the SurfaceControl setSize call to the client,
following 3 sort of ideas:
1. Project to make relayout window async, but currently it is used as a
sync point for resizing, resizing on client, one problem solved!
2. WM Shouldn't do what it doesnt have to for clients
3. Totally move management of lowest level Surface to client
clean up lots of WM code (see WindowStateAnimator slimming project)
In the future maybe we don't need to set the SurfaceControl size at all
and the client can just set its buffer size, but it may produce some
differences in geometry handling on the server so I want to maintain
the old semantics for this CL.
Bug: 161937501
Test: Existing tests pass
Change-Id: Icebd94f8443fdbe9f0e6968bc35bbb0504a1520c