A previous commit reverted the new SurfaceView background implementation
due to a Z-ordering issue (where previously the backgrounds were below
ALL SurfaceView rather than EACH SurfaceView). It's easier to solve this
with relative layering as this CL does, and then we can keep the new implementation.
The new implementation has some other bug fixes in it too (see linked bug
w.r.t to setZOrderOnTop) and so it's a win.
Bug: 132353087
Test: SurfaceViewSurfaceValidator
Change-Id: I07b6e601e57fce3adb8e5ea8e173c7d7904422ca
Each WindowContainer has its own pending transaction. These transactions
may be merged to the global one within WindowContainer.prepareSurfaces()
in a hierarchy-based order, not in a time-based order. It may cause
that a later surface operation overwritten by an earlier surface
operation. For example, atokenA.setLayer(t1, 0) was called earlier, and
then atokenA.setLayer(t2, 1) was called later. However, the layer of
atokenA might eventually be 0 because t1 could be merged into the
global transaction later.
This CL uses a single transaction per display to solve this problem.
Fix: 120282809
Test: atest SurfaceAnimatorTest
Test: Manual test with the steps in the issue.
Change-Id: Idca57d01d8be884369510642c2d9345b6ee4e3b1
We changed the SurfaceView background to be a boundless
child layer. However this was a semantic change. Each SurfaceView now
has its own background behind it instead of the backgrounds being
behind all SurfaceView. This causes an issue with some apps which
have an invisible SurfaceView hanging out for no particular reason.
Revert "SurfaceView: Correct comparison operator.",
"SurfaceView: Only show background when behind ViewRoot.",
"SurfaceView: Check correct OPAQUE flag for background visibility.",
"Correct SurfaceView background visibility.",
"Replace SurfaceView background with boundless color layer."
Bug: 123920952
Test: SurfaceViewTest. SurfaceViewSurfaceValidatorTest
Change-Id: I88ff31542ee0139d15c84ed2d6791c5cd455604b
Settings can't write to persist.* without special
selinux rules. Instead for debug simplicity just
switch back to debug.hwui.force_dark and let it
reset on reboot.
Fixes: 131697927
Test: toggle override-force dark in dev options
Change-Id: Ieac6edb2a7b444fc2f63d5d4f1b657bad6ead409
With my previous CL [1], CursorAnchorInfo API was globally disabled
for cross-display scenario including ActivityView scenario.
This CL slightly relaxes the above condition so that IMEs can rely on
CursorAnchorInfo APIs again to interact with apps running inside
ActivityView.
The basic idea here is keeping reporting relevant information from
ActivityView to InputMethodManagerService (IMMS) so that IMMS can take
the display hierarchy because of ActivityView into account. As long
as IMMS has the up-to-date hierarchical information, IMMS can tell
InputMethodManager (IMM) running in the IME client process about the
missing coordinate transformation information from the virtual display
space to the outer display space where the IME is actually shown.
Note that there was a similar fix for AccessibilityService that keeps
reporting ActivityView location to WindowManagerService (WMS) [2].
Ideally we should be able to share the logic, but to do so we need to
introduce a generalized callback mechanism into WMS so that IMMS can
be notified when a cetain coordinate transform matrix has changed.
For Q, this CL implements IMMS's own mechanism to keep track of
ActivityView hierarchy instead of introducing a direct dependency from
WMS to IMMS.
For R+, most likely we may want to reconsider how ActivityView should
be implemented.
There should be no behavior change in this CL if ActivityView is not
involved.
[1]: Ie2f7a5117cff3a13ad5c5806fd4b3abef7569549
3d2cc0fffd
[2]: I38da5b84a11890bf0f4a57eb9d5b7e71bdcc16a9
d8ec938609
Fix: 115693908
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest#testInputMethod
Change-Id: Id0411a80456182111bb5b681c6d1230b58e7ec2e
This is a preparation to support CursorAnchorInfo API in ActivityView.
In order to enable the system to automatically adjust CursorAnchorInfo
object between the IME client and IME, there needs to be an @hide
method to create a new CursorAnchorInfo instance with applying an
additional coordinate transformation Matrix, which is what this CL
does.
This CL also cleans up CursorAnchorInfoTest.java as most of test there
were already moved to CTS [1].
Anyway, this is a mechanical change. There should be no behavior
change in existing methods in CursorAnchorInfo.
[1]: Ib758bddff34b4722b39c94e7ad4e8f8da2bb8b92
c4ef1d6ec22dc2af2ed339fd4e78075903783be0
Bug: 115693908
Test: atest CtsInputMethodTestCases:CursorAnchorInfoTest
Test: atest FrameworksCoreTests:CursorAnchorInfoTest
Change-Id: Ic7f9057623ffc61ec7a6121735dc39adecf4649d
Re-enables reading settings from device_config.
See: I6b7ab56e4015448ee068deb49e7f6fa133fea53c
Updates tests.
Updates documentation.
Bug: 129934185
Test: atest android.view.textclassifier
Test: (Performance) Test: frameworks/base/apct-tests/perftests/textclassifier/run.sh
Compare performance results with ConfigParser.ENABLE_DEVICE_CONFIG
set to true vs false. Trivial regression recorded i.e. 1.03x.
Test: (Manual) Change flags and see them reflected. e.g.
adb shell cmd device_config put textclassifier system_textclassifier_enabled false
Verify that app no longer uses the OEM TCS but the AOSP TC.
Change-Id: I4c6ff781c97fc2e3d3da55dc49123fa1d759670a
Currently, the translation of the transformation matrix computed by
WindowState.getTransformationMatrix is related to its own display.
However, if the display has been re-parented, the translation might
be misplaced to the visual result. This CL makes it return the global
transformation matrix.
Bug: 129098348
Test: atest WindowStateTests
Change-Id: I38da5b84a11890bf0f4a57eb9d5b7e71bdcc16a9
Android Q introduce the FLAG_DELAY_SAVE, which allows the autofill service to delay the SAVE UI by
keeping the session open. But this approach introduces a new problem, as fields from different
activities could have the same AutofillId.
Test: atest MultiScreenLoginTest#testSaveBothFieldsCustomDescription_sameIds
Test: atest AutofillIdTest
Test: atest CtsAutoFillServiceTestCases # sanity check
Fixes: 113593220
Change-Id: Ibd187f5c58c150f820972fcab6d88217294ffe2d
Sometimes users can have sensitive information in IME window, such as
predictions or custom background.
If app could create a virtual display with system decorations support,
the security leak may happen that app can read the text or image from
the surface.
Add a check if the display is trusted that owned by system
When showSoftInput requested, if the display is not trusted then
show IME on default display.
Note that we also modified ImeDisplayValidator to use dedicated API
IWindowManager#shouldShowIme for checking if IME support on a display.
(And add it as @TestApi for CTS to verify)
Fix: 129443632
Fix: 129881992
Test: atest MultiDisplaySystemDecorationTests
Change-Id: Icfd66689dad4b782c50b56a515194dd138d3b280
Code-paths triggered by convertFromTranslucent end up setting an opaque
state both on the client side and the WindowManager side, without
appropriately checking to see if we were already non-opaque before we
were convertedToTranslucent.
Bug:126897750
Test: Manual
Change-Id: I2d19624be31330100b61615fabae04899d95cda9
To fix the issue that mContext is not updated when moved to another
display, we previously introduce mDisplayContext as a workaround in [1].
Change to use Context#updateDisplay(int) to unify mDisplayContext to
mContext.
[1]: Ifa0ca24e9cf764caf492ee065606680b6a06751a
Bug: 116349163
Change-Id: I3adbb32a584ac3405563904c1fd077e96e0807c1
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest InputMethodManagerTest
Test: atest InsetsControllerTest
Test: atest InsetsSourceConsumerTest
Test: atest ImeInsetsSourceConsumerTest
Test: atest CtsActivityManagerDeviceTestCases:MultiDisplayClientTests
* Make it persist.hwui.force_dark so the dev option
survices reboots.
* Remove the internal super-override behavior it applied
using only the intended ViewRootImpl theme-aware behavior.
Fixes: 127350499
Fixes: 130354206
Test: set dev option, verified nothing went dark. Set dark
theme, verified non-dark apps were force-darked. Rebooted
and verified property still set.
Change-Id: I43adcbc25320669510fb03b162c98cbd14612f55
In legacy multi-display mode with at most two physical displays,
physical display IDs reduce to the port IDs for the internal and
external connections.
This CL instantiates a DisplayAddress.Physical whose getModel method
returns null, such that port-dependent logic (e.g. display settings
and input association) works on legacy systems without EDID support.
Bug: 130672828
Test: dumpsys display
Change-Id: I12a40078c5e3666e59283623ec600e8d76493359
Previously, there was only a way to inject input after syncing inputs.
However, some tests require a direct call to sync inputs since we need
to ensure the info was propagated to InputManager native before
continuing with the test. This exposes a method just to
syncInputTransactions.
Bug: 130695122
Test: ActivityLifecycleTopResumedStateTests
Test: MultiDisplayPolicyTests
Change-Id: Ie3115741a20d04c743fd854ac421dc3705332488