New API provides all maximum WindowMetrics, for all
possible rotations in each DeviceState. This information
allows launcher apps to determine different device
layouts ahead of time, without having to reload the
grid model on every device state change (fold/unfold).
Done:
* WindowManager calculates bounds for the given display, in
possible rotations
* Defining API surface
Not started:
* WindowManager calculates insets for each rotation
* Display stack builds collection of DisplayInfo, for all
possible display states (folded, unfolded)
* Display stack pushing set of DisplayInfos to WindowManager
Bug: 181127261
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest FrameworksCoreTests:WindowInsetsTest
Change-Id: Ic4580f9c1ee919e5e93cd96b8f11c743fa42f9f1
A11yAction#ACTION_DRAG_START.
This allows the system to run a11y-specific code
and still accept drags via touch events when a11y is
enabled.
Test: builds
Bug: 26871588
Change-Id: I40e8f1adf5b773c8fa02173cbd96aa5e9ed54a4d
Currently, we only allow translation for the resumed Activity. It
works fine for full screen Activity. On foldable devices, we may
have two Activity in the same time. It is possible one Activity is
on the paused state but there is still new incoming message, we
should also allow the message can be translated.
Bug: 199264898
Test: atest CtsTranslationTestCases
Test: manual. Use one Activity targetsdk prior to Q then receiving
broadcast to start Ui translation on paused state in split mode.
Change-Id: I6720b41d9995c9ced2e3b2b87eb95540101d15a0
- If the taskbar is collapsed and isn't providing full insets to the
app, we still want the IME to be inset for the nav button that shows
Fixes: 197727397
Test: Collapse taskbar, open IME
Change-Id: I9f2367344385c9a23e2d6323637a0b2d1713b169
SurfaceView clients may hold on to surface references. In S this means
they would extend the lifetime of the SurfaceControl resulting in
"leaking" buffers until the references are cleared or the app is
terminated.
Fix this by calling a new destroy function on Surface which will
explicitly remove references to the SurfaceControl and BBQ it holds.
This is safe because SurfaceView controls the lifecycle of the Surface
and knows when the Surface will become invalid. Once invalid, the Surface
cannot become valid again.
Test: repro steps in bug
Bug: 198133921
Change-Id: I5c7e43736f025fc0965eae2f19719ba40df3cb70
Merged-In: I5c7e43736f025fc0965eae2f19719ba40df3cb70
It is a public interface which should not have different versions
sharing the same API level. This CL moves the methods to an
@hide interface.
Fix: 198614722
Test: atest android.signature.cts.api.current.SignatureTest
Change-Id: Ib02708aeb1ec960bda20b6b60d4df6f0c9b4d9d6
- This ensures that the caller can synchronously initialize the existing
displays without waiting for the onDisplayAdded() callback, which can
happen asynchronously (since the callback is oneway).
Bug: 196186963
Test: atest WMShellUnitTests
Test: atest ActivityTaskManagerServiceTests
Change-Id: I0a8d5f9b4ede7b487a8de14bdb6eaacae7d03d9f
SurfaceView clients may hold on to surface references. In S this means
they would extend the lifetime of the SurfaceControl resulting in
"leaking" buffers until the references are cleared or the app is
terminated.
Fix this by calling a new destroy function on Surface which will
explicitly remove references to the SurfaceControl and BBQ it holds.
This is safe because SurfaceView controls the lifecycle of the Surface
and knows when the Surface will become invalid. Once invalid, the Surface
cannot become valid again.
Test: repro steps in bug
Bug: 198133921
Change-Id: I5c7e43736f025fc0965eae2f19719ba40df3cb70
Missed some null checks which resulted in crashes during some
tests.
Bug: 183993924
Test: atest WindowInsetsPolicyTest
Change-Id: Iaa84b2d9e824223cead9ba78247129b77b1f217e
- Add WM_DEBUG_WINDOW_INSETS ProtoLogGroup to use for logging
general Insets logs in WM core.
- Refine InsetsSourceProvider#updateVisibility proto log format
to add insets type information.
- Add InsetsSurceControl#toString to print control target info.
Bug: 197189357
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_INSETS
Test: atest ProtoLogImplTest \
ProtoLogViewerConfigReaderTest \
WmTests:ProtoLogIntegrationTest \
LogDataTypeTest \
protologtool-tests
Change-Id: I1f01ce4d9fe5cb17f7bd60a424689260682b1dfc
[1] made context created via #createConfigurationContext
access ViewConfiguration without StrictModeViolation.
However, we may obtain WindowManager in ViewConfiguration and
still breaks the violation.
This CL gets rid of WindowManager usage to prevent the violation.
Test: atest StrictModeTest
Bug: 197282789
Bug: 191683535
Change-Id: Ifed3f318601ad2214db137ed3d75efdf2157799e
Previously AppTransitionController didn't recognize TaskFragment
transitions, so it uses Task opening/closing animation for
TaskFragment transitions.
This CL introduces and uses TaskFragment transition if the animation
target is TaskFragment. The new transition type can be used for registering
RemoteAnimation implemented by TaskFragmentOrganizer as well.
It also provides a fallback mechanism for TaskFragment transitions
if the RemoteAnimation fails or one of opening/closing animation target
is not a pure organized TaskFragment.
Note that previous reverted CL[1] didn't cover the case that the
animation target is promoted to TaskDisplayArea. This CL fixes it by
introducing WindowContainer#canBeAnimationTarget to filter out the case.
Bug: 194649929
Test: manual - the reproducible step in b/194649929#comment1
Test: atest WmTests:AppTransitionTests AppTransitionControllerTest
Test: atest MultiDisplayPolicyTests#testAppTransitionForActivityOnDifferentDisplay
[1]: I0094694fa5cd95d8bbb7da94d2aaf7aac6e1fe09
Change-Id: I5520803f3018d2dd67c96db55daceef740b2cf0b
This reverts commit 3f7830eaf1.
Reason for revert: Broke test android.server.wm.MultiDisplayPolicyTests#testAppTransitionForActivityOnDifferentDisplay on git_master on cf_x86_64_phone-userdebug
Bug: 197639726
Change-Id: I7705b36a3fa8de5ce98774c809a0cc309a08937c
Previously AppTransitionController didn't recognize TaskFragment
transitions, so it uses Task opening/closing animation for
TaskFragment transitions.
This CL introduces and uses TaskFragment transition if the animation
target is TaskFragment. The new transition type can be used for registering
RemoteAnimation implemented by TaskFragmentOrganizer as well.
This CL also provides a fallback mechanism for TaskFragment transitions
if the RemoteAnimation fails or one of opening/closing animation target
is not a pure organized TaskFragment.
Bug: 194649929
Test: manual - the reproducible step in b/194649929#comment1
Test: atest WmTests:AppTransitionTests AppTransitionControllerTest
Change-Id: I0094694fa5cd95d8bbb7da94d2aaf7aac6e1fe09
Converting IBinder to IWindow is inefficient so instead cache IWindow
object directly. When calling native to Java, the IWindow object may not
be populated yet so we lazy cache it when getWindow is called.
Test: atest WindowAddRemovePerfTest
Fixes: 197219430
Change-Id: I15f7d7cd9775592a5545ddaf276c1b1db2777ac9
go/a11yDragAndDrop
Drag & drop in the system has zero accessibility support.
Add actions to dragging, cancelingl, and dropingp
Add WINDOW_CONTENT_CHANGED subtype events for the start of a drag,
the cancellation of a drag, and a drop. Other changes, like
when a11y actions change, will be denoted by
CONTENT_CHANGE_TYPE_UNDEFINED
Test: builds
Bug: 26871588
Change-Id: Ie4eeb54dd612fd92c107a267e884498656c1fac8
In stage split, it always set the divider layer to top and it would
Cover some layer it should not cover such as pip or bubbles.
In legacy split, this ordering is handled by TDA but it cannot apply
on stage split because it directly use WindowlessWindowManager without
shell root.
Fix it by simplify the layer ordering. Make divider layer as a fixed
value. Normal task layer should always lower than it and always on top
tasks layer count start from it so we can ensure always on top tasks
higher than the divider.
Also move some constants layer value to WindowManagerPolicyConstants
for managerment and accessed by both wm-core and wm-shell.
Fix: 194359996
Test: open a pip app and active stage split then drap the pip to
divider.
Test: Pass existing tests.
Change-Id: I6e4002435be350872aec5fa154849ed6e9561ce0
1. Provide more detailed information for UiTranslationManager.
2. Clarify the difference for VTC#onClearTranslation and
VTC#onHideTranslation.
Bug: 178044703
Test: n/a. Change javadoc not change code.
Change-Id: I4b2ef1a6c39c3bbbb85d0dcda519d286f10deb25
This allows listeners to identify which WindowInfo belongs to which
IWindow. Using InputChannel token may not work since not every Window
has an InputChannel, but every window should have an IWindow token.
There may still be WindowInfo data that doesn't contain an IWindow token
if they were created as pure layers, and not windows.
Test: IWindow token sent to listeners
Bug: 188792659
Change-Id: Ie90453d40906c0ee8312a23a6f4c8e85310bbaf7
The issue will occur when the view is removed from the hierarchy by
the time the translation response returns. Do a null check to make
sure the view still exists.
Bug: 196933332
Test: atest CtsTranslationTestCases
Tese: manual. not see the crash when scrolling the apps.
Change-Id: Ifee933a802385750d431800ef50f6f2c306ccc0f
Added the transform matrix from WindowInfo native to the Java side
InputWindowHandle. This is to allow clients that register a
WindowInfoListener to translate the window's screen coordinates to
window space.
Test: Transform is now sent to WindowInfoListener
Bug: 188792659
Change-Id: Ifba8488ff470d3c6c8066e23b871c3d541cff0a1