This is an UnreleasedFlag which is only available in SysUI, so we
set it on Bubbles via BubblesManager which is part of SysUI.
Changes to support bubble bar will happen behind this flag.
Bug: 253318833
Bug: 256873975
Test: manual - enable flag and add a bubble on a large screen device
- observe that the bubbles are pinned to the bottom
Change-Id: I0d86a71b66db683837bf639d9067d92703b4364e
Switch to using newly exposed method Bubbles#showAppBubble as what
FloatingTaskController does is no longer POR.
Calling this allows 1 bubble from a specific app to be added to the
stack. The only user of this method is NoteTaskController which is guarded by the NOTE_TASK.
Bug: 237678727
Test: treehugger
Change-Id: I47c5c010a050796eff848ba3fcabc40cf5fbd902
Divider size and insets value might be changed when config changed,
we should update them too otherwise divider would keep same area
on SplitLayout but actually view area become small or large.
Bug: 256117210
Test: manual
Test: pass existing tests
Change-Id: I6532f41c58848797f14ae17cb26f1ae734c53573
This specifically refers to the taskbar that can be expanded or
minimized, which changes the bottom inset, but PiP remained in it's
original position. This change will move it down if it was already by
the bottom edge, or move it up just enough to be within the movement
bounds.
Bug: 256560961
Test: manually
Test: http://recall/-/ekEuGtt9d9HWqkUtAzpHx8/dSTq2oAg1k85bpIZRBDLIH
Change-Id: I487be6f54b2f9afae8d18df8cf6456858704c703
When an animation is playing, PipAnimationController#onAnimationUpdate
is called with the fraction of the animation progress. This fraction is
used to calculate a scale value (in a matrix), which is applied in a
transaction to the pip surface. This scaling is invisible to WM core, so
the bounds of the pip surface are still the bounds before the animation
began. In SF, those bounds are scaled and drawn. When the animation is
finished, onAnimationEnd is called. onAnimationEnd is special, because
it finishes the resizing and sends the updated pip task bounds to WM
core in a WindowContainerTransaction. The WindowContainerTransaction is
applied separately by WM core.
Additionally, the transactions forged by onAnimationUpdate are
not applied immediately. In each onAnimationUpdate, the pip surface
transaction is applied in a SyncRtSurfaceTransactionApplier (together
with the transaction for the pip menu), which waits until the next draw
is complete and then merges the pip surface transaction into the global
frame transaction. In onAnimationEnd, however, the pip update is not
applied in a SurfaceControl.Transaction, but a
WindowContainerTransaction is sent to WM core, which applies it at some
later point. If the pip surface transaction from the last
onAnimationUpdate is merged+applied after the WindowContainerTransaction
is applied in WM core, then the two transactions are committed out of
order and the pip surface ends up in this weird state, where an extra
scale was applied to it.
To address this, we delay the onAnimationEnd to the next frame, which
adds enough time to let the last onAnimationUpdate transaction be
applied. We do this only when the PiP transaction has to be synced
with the PiP menu drawing, because the synchronization between the
two is what causes the last onAnimationUpdate transaction to be
applied with a delay
Bug: 228317396
Test: manual - change pip aspect ratio several times
Change-Id: Iaf4005b34b63ab7a123e508ace80f966014a0805
Adds a menu on clicking handle that will enable windowing changes. Still
to implement for this prototype: More button, Split Screen button,
Overtop/Float button.
Bug: 239960071
Test: Launch various tasks, confirm handle menu appears, drag
functionality is unaffected.
Change-Id: I0aeeffb44e6bfd580c70270e562d8c04031892de
ccfed74e82, add the toast maker in StageCoordinator. NPE is
thrown when running the splitscreen test. It can't toast on a
thread that has not been called Looper.prepare(). This CL adds the
@UiThreadTest on needed tests to fix the NPE.
Bug: 256087248
Test: atest com.android.wm.shell.splitscreen
Change-Id: I9fef85c58570a9c1ca2741d1a8aa81439850cc88
Before, when exiting PiP to previous Task, the PiP leash can be the
activity leash cropped by its parent leash. Now, we reparent the PiP
leash to the transition root to make sure it is not covered.
Bug: 207070762
Test: manually verify with ActivityEmbedding PiP app
Change-Id: Iab8671d87c4369c6a090b06cfa71736ae9ba5a2b
There may have multiple transitions when launching a task with
embedded activities. In the last transition info, it may contain
activities occluded by starting window and a closing wallpaper.
By default, all of them will be animated with edge extension,
that looks like showing some noise.
Because the animation of embedded activities under a task level
starting window is not visible, it can be skipped. But for
non-embedded activity, the activity level starting window can be
changed or closed with the host activity, so the case should not
be skipped.
Besides by default, wallpaper is no animation, especially it
shouldn't apply any task/activity style animation.
Also make sure the leash of starting window is always on top of
the task with embedded activities. This just makes the surface
hierarchy consistent.
Bug: 255269113
Test: No flickering when cold launch Settings on a large screen
device with support of activity embedded.
Change-Id: I8fd1137e806aeb4060a83a71dc5aa02acdc42429
Before, when a TaskFragment is resized when moving to front, its surface
may still be croped for the old bounds. Now, we make sure the surface
crop is updated when moving to front.
Bug: 207070762
Test: manually verify with resizing display in background
Change-Id: I2103a1d8db855624310bc3becd9ed502fb082a7f
Due to insets for tasks would be changed when switch split on
protrait mode, it lead to some flicker.
Attach screenshots before switch and fading out after switch
animation finished to reduce flicker.
Also update animation algorithm to reduce flicker occured when
top to bottom case.
Fix: 240517067
Test: manual
Test: pass existing tests
Change-Id: I66991b40b2ab8f410abcb800e9ca6e80222faa8c
We were logging "isDesktopModeActive" each time it was called, spamming
logs. Removed it.
Each time visible task info was updated, we logged that an active task
was added, even if the task was already marked as active. Updated
logging to only log when task is first time added to active. Same with
removing from active tasks. Only logging when it is actually removed
from active tasks.
Bug: 244348395
Test: manual, updating logging, verified that the logs are printed
Change-Id: I55075c222763c6cb08f2d0e6770aed831b78a369
This is needed for android-auto where shell is actually in launcher
vs systemui.
Also have TaskViewTransitions use this information instead of checking
the flag so that it doesn't do anything in the process where it isn't
registered.
Bug: 255631687
Test: everything still works as expected
Change-Id: I61ad21575850f15fd821cc5c8239bf7246549936
Tapping on the PiP will already make isUserInteracting equal to true.
However, user might have simply tapped it to open the menu.
Defer the movement only if user is actively dragging PiP (aka changing the position of PiP while using another touch point to e.g. open IME).
This also will make PiP move above IME anyways, when user finishes the
drag.
Bug: 255689034
Test: open PiP, tap it to show PiP menu, open IME, pip moves away
Test: open PiP, while dragging open IME with another finger, pip stays
Change-Id: If5830ed783cf969d4eba8a91f235e008a6e13680
There are cases not having enough task changes to enter split screen.
Update to support canceling the enter-transition by reparenting tasks
back to display.
Fix: 237635859
Bug: 250853925
Test: atest WMShellFlickerTests
Test: enable shell transition and verify the following behaviors
1. drag and drop Phone to enter split while Phone in front
2. select "split right" on Phone icon and Phone thumbnail in
recents to enter split
Change-Id: I0fe8dfc0c46a8b1f5ee70d85359d2078c263ac80
When switching between horizontal split and vertical split, it will
leave part of the screen empty. Show background color to cover that.
Also fix the leash start position.
Bug: 241043533
Bug: 254090083
Test: atest WmTests:TransitionTests#testChangeSetBackgroundColor
Test: verify with horizontal demo app
Change-Id: I125db07a631b19bd33bcff9935fe39f263cbb263
Remove the update listener once the animation has ended or has been
canceled to prevent further updates from trying to animate a surface
that has already been released.
This scenario can happend when mergeAnimation() manually runs end() on
animations that already finished but had not been removed yet. This may
happen because the removal of the animation is posted from the shell
anim thread to the shell main thread, so mergeAnimation() may win a race
and schedule another end() before the first end() removes the
animations.
Bug: 252872225
Test: boot, no shell.anim crash
Change-Id: I442f1152fba97c30ce425b08f1aa65bb94fb3bb4
Merged-In: I442f1152fba97c30ce425b08f1aa65bb94fb3bb4
When shell transitions were enabled, we were not exeucting the WCT that
brings desktop apps to front.
Ensure that this is called when shell transitions are enabled.
Bug: 254738174
Test: atest DesktopModeControllerTest
Change-Id: Ie8391867a1d89ecdab7cbd5afd8cd80ecdc5b78c
This CL introduces BackProgressAnimator which runs in app's main thread.
It receives target progress values from SysUI and drives the actual
progress value passed to the app with a high stiffness, no bounce
spring.
Bug: 238475284
Test: atest WindowOnBackDispatcherTest
Test: atest BackAnimationControllerTest
Test: atest TouchTrackerTest
Change-Id: Ib0d3ebe43929c405b10681000fb4e7ef8bccce34
- Adds DesktopModeTaskRepository to FreeformTaskListener to track
visible freeform tasks
- Adds a listener on DesktopModeController to allow sysui to find
out about freeform tasks becoming visible
- Adds a sysui state flag for freeform tasks being visible
Bug: 245569277
Test: manual - add freeform task => launcher contents are gone
- remove freeform task => launcher contents are visible
Test: WMShellTest DesktopModeTaskRepositoryTest
Change-Id: I2d717052678bc35a4c59b0bc03e0c4d22e6b103d
This CL does the following:
1. Fix misuses of mTaskInfo in CaptionWindowDecoration because it's the
old value at that time.
2. Reset RelayoutParams before using it so we don't pass old values.
3. Restore the test values by using the resources in test package so
that we don't need to change the test every time we change the
resources in prod.
4. Change loadResource() to loadDimension() and loadDimensionPixelSize()
to avoid confusion with other type of resources. Also make them
static just in case we need similar logic on other instances of
Resources.
5. Moved RelayoutParams closer to RelayoutResult.
It also cleans up some commented out code.
Bug: 254658472
Test: atest WindowDecorationTests
Change-Id: I6fa1b06351c388e3ca6985e76c889f4ec5506c38