Add Syncer class that allows callers to add desired syncs into a set and
wait for them to all complete before getting a callback. The purpose of
the Syncer is to be an accounting mechanism so each sync implementation
doesn't need to handle it themselves. The Syncer class is used the
following way.
1. SurfaceSyncer#setupSync is called
2. addToSync is called for every SyncTarget object that wants to be
included in the sync. If the addSync is called for a View or
SurfaceView it needs to be called on the UI thread. When addToSync is
called, it's guaranteed that any UI updates that were requested before
addToSync but after the last frame drew, will be included in the sync.
3. SurfaceSyncer#markSyncReady should be called when all the SyncTargets
have been added to the SyncSet. Now the SyncSet is closed and no more
SyncTargets can be added to it.
4. When all SyncTargets are complete, the final merged Transaction will
either be applied or sent back to the caller.
The following is what happens within the SyncSet
1. Each SyncableTarget will get an onReadyToSync callback that contains
a SyncBufferCallback.
2. Each SyncableTarget needs to invoke SyncBufferCallback#onBufferReady.
This makes sure the SyncSet knows when the SyncTarget is complete,
allowing the SyncSet to get the Transaction that contains the buffer.
3. When the final FrameCallback finishes for the SyncSet, the
syncRequestComplete Consumer will be invoked with the transaction
that contains all information requested in the sync. This could include
buffers and geometry changes. The buffer update will include the UI
changes that were requested for the View.
Test: SurfaceSyncerTest
Test: SurfaceSyncerContinuousTest
Bug: 200284684
Change-Id: Iab87bff8a0483581e57803724eae88f0a3d96c8e
- The callback was not removed on the server in the clear() method since mWindow and
mWindowSession fields were cleared before
- The wrapper class was not static, risking to leak it's outer class
and its field.
Test: com.android.launcher3.ui.widget.RequestPinItemTest#testPinWidgetWithConfig
Fixes: 220385755
Change-Id: I3e5a81bf48c2272b1cb2b5a9f2ba940d0f794a6f
For Android S, we use the API windowSplashScreenAnimationDuration to
know the duration of the animatable icon would be, however, developers
can be confused to thought that this API is used to declare the
duration of splash screen.
To get the real duration of the animatable icon, if it is an AVD or
AnimationDrawable, try to get the animation duration from it.
Test: atest StartingSurfaceDrawerTests SplashscreenTests
Bug: 211707095
Change-Id: Ia3f8c5cd50bab164360e07d9ced87ff7f4321e96
Like legacy recents, we need to be able to restore the home task
back to where it was in the task-ordering when recents doesn't
actually switch to home.
This CL records the "restore-below" task during activity-start
and stores in the associated transition. There is a new WCT op
that will "restore" a container back to where it was.
Bug: 210014802
Test: launch a task chain (task followed by task), then go to
recents, then restore the top task. observe task order
remains as it was before recents.
Change-Id: I9f9da7d35ffe69099e6431b7a0d5a527e33c5a74
Change the mAttachedToDisplayArea from boolean to
int which should help us to know the reason when
there is a issue happened due to this flag.
Add more logs to clarify the exception reason when
WindowContextController calling attachToWindowToken
but the WindowTokenClient haven't been associated
with a display area.
Bug: 211062619
Bug: 220049234
Test: atest WindowContextControllerTest
Change-Id: I5e3832a466d47de5aafb32cf5fbf9c375a65160a
Entering PIP rotation with orientation is changed to use fixed rotation,
so we need to update the animation as well.
Will update exiting PIP and swipe to enter in next cl
Bug: 219411429
Test: manual test enter PIP from different orientation
Change-Id: Id30f15c72b7d59ae63012d9f62e829d73ec4f335
Avoid using nested callback classes, move the Executor to register
function and update the Javadoc to emphasize unregister call is always
expected even when a task is already destoryed.
Bug: b/216628683
Test: atest TaskFpsCallbackTest
Change-Id: I801898d082a6eeb6a6f991e3765795a270943d42
Add a manifest flag for applications to opt-out of the new back
navigation system.
Test: atest
CtsWindowManagerDeviceTestCases: android.server.wm.BackNavigationLegacyTest
Bug: 217709328
Change-Id: I43d09a37b126e59bdb8f20bb83cf6d99e53a1e91
Test: m -j.
Test: Open and swipe back on pre-T and T apps.
Test: atest .../BackNavigationControllerTests.java
Test: atest .../BackAnimationControllerTest.java
Bug: b/195946584
Change-Id: I00cf7ab5b57760d57d30ac74dc5b3443a4203f38
- Remove mTopCallback field
- Cleanup compat and default callbacks
- Remove the callback held by WindowState when the window is removed.
Bug: 218328707
Test: atest packages/apps/Launcher3/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java
Test: atest frameworks/base/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java
Change-Id: I38fd760a617500c874aef10bc8de165880837008
Apply the SurfacePackage reparent transactions with the next
ViewRootImpl draw so the caller can optionally synchronize attaching
SurfacePackages with contents on the main window.
Test: atest CtsWindowManagerDeviceTestCases:SurfaceControlViewHostTests
Bug: 217973491
Change-Id: I87f77cb6a5a2505592f6e9431d2964517fe497cd
systemui also defines several remote animations. Given the number
and complexity of animation entry-points in sysui, insert a
cheeky hack to swap remotetransitions in for remoteanimations
when shell transitions are enabled.
Bug: 217810915
Test: Open quick-settings, poke Settings icon. Observe animation
and no paus.
Change-Id: I462034210f28051a03812eb6ae650fa1f0446ef5
For pre-T apps, the default back callback dispatches KEYCODE_BACK to the
application's root view.
For T+ apps, the default KEYCODE_BACK listener invokes the registered
OnBackInvokedCallback.
Test: m -j
Bug: 195946584
Change-Id: I62342b249e6cd6f8b036f7e950cc3f9754418ee4
This CL enable OnBackInvokedCallback to be saved in a WindowState and
queried by the BackNavigationController to be returned when
ATM.startBackNavigation() is called.
The DecorView provides a PendingOnBackInvokedDispatcher that can receive
callback registration before being added to a ViewRootImpl.
Test: atest FrameworksCoreTests:BackNavigationTest
Bug: 131727607
Change-Id: I01528a22ea4a6583a56ade4eab69136d727855d0
Augment the "apparent" display information in configuration
from just the display bounds (maxBounds) to also include the
display rotation and cutout. Like maxBounds, these will be
expected to always be set as basically "the display that this
configuration was built against".
This heavily simplifies fixed-rotation since now we don't
need to deal with the "are we overriding?" question and also
don't need extra activity servertransactions. The configuration
is also in sync (since it is the source of truth used by
resources). Additionally, this means that even the current
legacy fixed-rotation model should work with in any
mixed-rotation situtaion, not just fullscreen.
Bug: 202201326
Test: atest DisplayTest
Change-Id: I6232f74c74324b70b1b0c9f46448c509c2694310
In S, we don't dispatch #onConfigurationChanged callback if the screen
size changes doesn't corss size buckets. However,user may still want
to know the change even if it's very small.
This CL changes to dispatch the callback if the Activity handles
the config changes.
Also clean-up the unused code.
Bug: 202468254
Test: atest AppConfigurationTests
Change-Id: Ief68922ed80a0fcfc05c7ccb5e3692334352a2c3
Allow developers to customize the exit animation for empty style splash
screen, there is a target sdk version check to prevents apps from
crash if the app didn't do null pointer check for #getIconView.
Bug: 205907456
Test: atest SplashscreenTests
Change-Id: I235f25fdf42b7177a6e195d3ffc07b92690e6f79
Previously the SurfaceControlFpsListener is a hidden API which only
allows platform code access. This patch renames it to follow the
callback convention and raises it to be a system API in order to allow
system applications to access the FPS count of a task and its children.
The FPS count access is guarded by a permission ACCESS_FPS_COUNTER.
To follow the API convention and properly check the permission, the
register/unregister callback APIs are moved to WindowManager and
permission check is done in the System Server.
Minor: Rename to SurfaceControlFpsCallback to TaskFpsCallback in order
to follow the API naming convention.
Bug: b/199920468
CTS-Coverage-Bug: b/199920468
Test: atest TaskFpsCallbackTest
Change-Id: I6b0a0ad6500278b3da09059e9c2ede28d9a743aa
This CL introduces the BackNavigationController that gathers the
required data to be passed to WMShell to create the back animation
These data are passed via the BackNavigationInfo Parcelable.
The CL also containes a basic screenshoting mechanism as a temporary
solution until a proper screenshoting infrastructure is created
(b/207481538).
Test: atest BackNavigationControllerTests
Bug: 131727607
Change-Id: Ibd7fc78e590794daf35f7718ddfa53e7f439813b
This is required for the go/t-activity-transitions where we want to allow apps to fade to a clear background color and fade back in from the background to another activity
Test: atest FlickerTests
Bug: 202844659
Change-Id: Iea18a8e7d32a63da55ab3430c47f903da5cff807