Since the new split-screen doesn't need the fullscreen backdrop frame.
The backdrop frame will always be the window frame. The server doesn't
need to send the backdrop frame to the client. The client just needs to
offset the backdrop frame to (0, 0).
This CL also moves the logic of calling onWindowSizeIsChanging to the
handler thread because it reads some fields which should only be
accessed on the handler thread. Otherwise, there might be race
conditions.
Bug: 161810301
Test: 1. Perform drag-resize and drag-move on a freeform app, and see if
the layout is expected.
2. Move the divider in the split-screen mode, and see if there is
any abnormal.
Change-Id: Ie0058db0447260dd0561634179fc7721d965a9e2
In previous CL(5e0c72a2c5) we provide a
way to read the animation duration from AVD and AnimationDrawable,
which should be enough to deprecate this attribute since the naming
could confusing developers.
The attribute was used to cut off the animation if the icon is
animatable, but since the animation can be stop when removing the
splash screen view from window, the attribute is useless so framework
won't read it anymore.
The attribute was also be the return value from
SplashScreenView#getIconAnimationDuration, however, since this API was
designed to let developer decide when to cut off the animation if the
app want to handle OnExitAnimationListener#onSplashScreenExit,
developer can pre-decide the duration in the app without set this
attribute.
Bug: 211707095
Test: atest SplashscreenTests StartingSurfaceDrawerTests
Change-Id: Ib3a0b4314bd15158c392e56c0e125a33c753e716
Move the callback as the last paramter to registerOnBackInvokedCallback
Test: Existing
Bug: 224562951
Change-Id: I8608a03b53baa04bedee81d2e86b2339abd6c594
This reverts commit ad89a82145.
Reason for revert: b/222170518 was unrelated to gesture back, and is now fixed.
Test: m -j. Test back behavior throughout system.
Change-Id: Ia27c7ea97416831355e1949ec6874de570b52108
This is a step to move the window layout to the client side.
ClientWindowFrames is used to carry window frames dispatched from the
server to the client for now. Later, the window frames will be computed
at the client side, and the frames will be sent to the server side via
ClientWindowFrames.
Bug: 161810301
Test: presubmit (no behavior change but only code refactors)
Change-Id: I83d8cfff2432e09759ef5b3d5f3b21731fc71bff
Store the last data received from WindowInfoListener on the client so it
can easily be retrieved when a new caller registers to listen for
updates. This will help with accessibility since they won't need to
register their listener all the time and instead just get the last data
that was sent, immediately.
From the system server process, the data is constantly being updated
because WindowInfo is sent to InputDispatcher when any geometry in SF
changes. If a different process registers for the WindowInfoListener,
it's possible the initial data will be empty since we won't explicitly
request the latest data immediately.
Bug: 222767081
Test: Accessibility register only when enabled
Change-Id: Ib87edde7a14be8584504d5d8d6c41f20bde5c698
1. Add new API in DWPC to get windowing features of the virtual display.
2. In ActivityRecord, consume the value of the allowed windowing modes
of virtual display.
Bug: 180435098
Test: atest WmTests:ActivityRecordTests#testSupportsPictureInPicture && atest WmTests:DisplayWindowPolicyControllerHelperTests
Change-Id: I39a6cd9417f266f7fdef72cc054263c3ca4c5650
OnBackInvokedCallbackWrapper instances are sent to the WindowState over
AIDL. This leads to Activity leak issues even if the reference is
cleared in the remote side. This change makes the held reference weak
So it is not retained.
Test: verified leak no longer present through hprof
Bug: 221285764
Change-Id: I1c529d27769e2426898776e47f37bdb7abe1f681
Modified SurfaceView and ViewRootImpl to provide callbacks when syncing
a transaction instead of sending transactions. This will ensure a clear
ownership of the transaction object since it will be provided in the
callback when BBQ adds a buffer into the transaction. Modified JNI to
add compatibility for native functions.
Test: Manual testing from go/wm-smoke.
Test: BLASTBufferQueueTest
Bug: 210714235.
Change-Id: I1f872d6b2846b0d64d5b33b8866d0b2ec7126c8c
Originally, View was implementing onBackInvokedDisptacherOwner, but now
only Activity and Dialog and since back event are related to the
window, it makes sense to move them into the android.window package
This follow up comment at:
ag/c/platform/frameworks/base/+/16764116/comments/e131f3ef_e3e1d2e0
Test: atest BackNavigationTests
Bug: 221401221
Change-Id: Ia2f26162beb6a41b6e162b31e599e882f8bf7320
To distinguish which side of the split that IME panel is attached to
after having a single-top root task for split screen, update
getImeTarget API to return the exact task that IME panel is attached to.
Bug: 207185041
Test: WMShellUnitTests
Test: enter split in portrait, toggle IME panel on the bottom split and
verified split layout will be push up as expectedly.
Change-Id: Ib6ba74ecb1b844bb408475d5b6c28dd5816a8e29
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