Adds support for restoring the PiP size along with its snap fraction.
Modifies PipBoundsHandler logic to use both the previous size and
position (snap fraction) when calculaing the bounds for re-entry.
Additionally, some phone-specific logic is added to ensure that the
re-entry size that is restored is the non-expanded size (i.e. the
size before the bounds are animated to expand when pip is clicked).
Bug: 143641277
Test: enter pip, move it, touch to expand, restore. Then re-enter
pip. Pip should retain its size and position.
Test: atest PinnedStackTests
Change-Id: I21b7e4bf9360cd7da9faf2015c04d12d37c0241f
The TaskStackChangeListener will take the task description chagne event
and notify the listeners. It will be able to let system UI handle the
theme change of the task correctly.
Bug: 113253712
Bug: 122726344
Test: go/wm-smoke
Test: Test with an app with theme, the listener will receive the
background color.
Test: Manually registered a listener from system UI and the event is
correctly received.
Change-Id: I087cc112be73cf421fa124cd0d6b238f91970a0c
Currently, when recents animation is cancelled from fail safe mechanism,
we put the previous app back to the top. It no longer makes sense when
live tile is in the picture since we don't want the user to see the
previous app being brought up when they turn off and on the phone.
Fixes: 142088072
Test: Turn off and screen and back on. Make sure the user goes back to
home instead of previous app in live tile mode.
Change-Id: I5f16c4c8c77b918dc706c45acadf143edc454de9
TaskStackListener can now know when
RecentTasks recents list has been
frozen and unfrozen.
Launcher needs this to know when to listen
for multiple swipe regions in quickstep
for apps with different orientations.
Fixes: 140116135
Test: Had Launcher be a consumer of new
listener and verified via logs and
debugger that it was sending the correct
callback when quickswitching apps.
Change-Id: I65fb92d2490c91837523b99563d4fef422dabb76
With this change, the shelf offset will be set directly by Launcher to
SysUI without WM being involved.
PinnedStackControllerTest is removed in this change since the only test
function is against WM.setShelfHeight. However, new tests regard
PinnedStackController should be added per b/141200935.
See also: go/pip-sysui-migration
Bug: 139016518
Test: atest PinnedStackTests
Change-Id: I606de3d8106ac12d7bf2b367877bc5bb345af3fe
Major changes in this CL
- Added PipBoundsHandler in SysUI package handles the bounds calculation
and save/restore the snap fraction
- Added IPinnedStackListener.onSaveReentrySnapFraction and
IPinnedStackListener.onResetReentrySnapFration, both called from
PinnedStackController (WM) to SysUI
- Added IPinnedStackListener.onPrepareAnimation, called from WM to
SysUI to notify that an animation for pinned stack is about to happen
- Added IPinnedStackController.startAnimation, called from SysUI to WM
to actually start the pinned stack animation
- Updated tv/PipManager to use PipBoundsHandler as well
Known issues and what's next
- Shelf height is set after the animation is started, therefore one may
notice the PiP window is hovering over the shelf. This is tracked
separatedly by b/139016518
- Bounds calculations still exist in PinnedStackController since
onTaskStackChanged callback requires so. Once we addressed b/139016833
(move rotation bounds calculation to SysUI), they should be all gone.
- Move the pinned stack animation from WM to SysUI and we can furthre
remove IPinnedStackListener.onPrepareAnimation and
IPinnedStackController.startAnimation
More details: go/pip-sysui-migration
Bug: 139015463
Bug: 139015142
Test: atest PinnedStackTests
Test: atest PinnedStackControllerTest
Change-Id: Ib62d8152ecc7b18a671ec403af44cc517612169e
Set min_sdk_version so that the manifest cant be merged into
Launcher3 when it is converted to Android.bp.
Test: mmma packages/apps/Launcher3
Change-Id: I28543d4be54aa789fbb452be005373239e1e0a6e
Major changes in this CL
- Added PipBoundsHandler in SysUI package handles the bounds calculation
and save/restore the snap fraction
- Added IPinnedStackListener.onSaveReentrySnapFraction and
IPinnedStackListener.onResetReentrySnapFration, both called from
PinnedStackController (WM) to SysUI
- Added IPinnedStackListener.onPrepareAnimation, called from WM to
SysUI to notify that an animation for pinned stack is about to happen
- Added IPinnedStackController.startAnimation, called from SysUI to WM
to actually start the pinned stack animation
- Updated tv/PipManager to use PipBoundsHandler as well
Known issues and what's next
- Shelf height is set after the animation is started, therefore one may
notice the PiP window is hovering over the shelf. This is tracked
separatedly by b/139016518
- Bounds calculations still exist in PinnedStackController since
onTaskStackChanged callback requires so. Once we addressed b/139016833
(move rotation bounds calculation to SysUI), they should be all gone.
- Move the pinned stack animation from WM to SysUI and we can furthre
remove IPinnedStackListener.onPrepareAnimation and
IPinnedStackController.startAnimation
More details: go/pip-sysui-migration
Bug: 139015463
Bug: 139015142
Test: atest PinnedStackTests
Test: atest PinnedStackControllerTest
Change-Id: I76c2b40ea0fe95e3a8019b434d39ba5540e2039f
cancelled.
In the current implementation, when recents animation is cancelled due
to stack order change, window manager replaces the surface with a
snapshot before cancellation. Launcher needs to acquire the snapshot in
order to switch the live tile into snapshot mode, and yet because the
recents animation is cancelled, that snapshot can no longer be acquired
anymore. This change takes care of this "relay" process.
Fixes: 138683199
Test: N/A
Change-Id: I1c11af38c2bdc442e3b45d0b5f0c7e7e37c2b0f0
In TaskKeyLruCache, we currently call the EvictionCallback
without checking if the entry was actually evicted or not.
fixes: 138952364
Test: Unit tests, manually inspected via debugger
Change-Id: Ic8e871f8e5a0324e4d00011d5bcd7036302b5c68
Instead of passing a boolean value signaling whether to defer with
screenshot, we want to pass the actual screenshot to Launcher if that's
the case. Another change will follow to implement passing the screenshot
from the window manager.
Bug: 138683199
Test: N/A
Change-Id: If5956436641aa35ffac3122fb53d13366552e0f1
- We were previously ignoring the QS state for notifications expanded since
we were only using that flag for gating whether to allow back. But since
we also use the state for gating swipe up, we should be explicit and
check that both notifications are hidden and we are not in QS.
Bug: 135969043
Test: Swipe into QS, ensure the state is set
Change-Id: Ia284938e32f54998bf7aba3a051de2b30cdc0e26
New callback called whenever a user visible task
is added or removed to the recents list. This results
in less work by updating only when recent task list
changes instead of listening for active task list
changes.
Test: atest RecentTasksTest
fixes: 111077107
Change-Id: I9acf13762d0c79bfde90b64fa5e0edaf882068cc