Commit Graph

4988 Commits

Author SHA1 Message Date
Ats Jenk
dfdce38745 Clean up bubbles home gesture flag
Remove bubbles home gesture flag. It is turned on by default.

Bug: 256873558
Test: mp sysuig
Change-Id: I0e7cf193d1436d241a81b99be502c9c765abfaca
2022-11-03 20:21:15 -07:00
Mady Mellor
33a70394ca Merge changes from topic "mm_remove_floating_tasks" into tm-qpr-dev
* changes:
  Add a flag for the bubble bar
  Remove FloatingTaskController & replace usages with Bubbles
2022-11-03 22:48:32 +00:00
Jerry Chang
dcab87c9c6 Merge "Add sub owner to common/split and tests" into tm-qpr-dev 2022-11-03 07:20:34 +00:00
Mady Mellor
6188843762 Add a flag for the bubble bar
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
2022-11-02 13:30:12 -07:00
Mateusz Cicheński
3aac107972 Merge "Animate PiP away on inset changes." into tm-qpr-dev 2022-11-02 17:37:11 +00:00
Mateusz Cicheński
d04f92f27d Merge "Skip moving PiP for IME/shelf change if user is dragging." into tm-qpr-dev 2022-11-02 17:36:37 +00:00
Mady Mellor
46faccde4a Remove FloatingTaskController & replace usages with Bubbles
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
2022-11-02 10:01:32 -07:00
Jerry Chang
23f1e2836d Add sub owner to common/split and tests
Ignore-AOSP-First: no merge branch from AOSP
Test: n/a
Bug: 207582920
Change-Id: I46cc309b2453296910c8516cffd2b5b352376b01
Merged-In: I46cc309b2453296910c8516cffd2b5b352376b01
2022-11-02 12:35:40 +00:00
Galia Peycheva
71bf4aaf9e Merge "Fix pip update transaction out of order" into tm-qpr-dev 2022-11-02 09:31:31 +00:00
Tony Huang
61b0628896 Merge "Update divider value when config changed" into tm-qpr-dev 2022-11-02 06:14:23 +00:00
Tony Huang
ecbb47cfca Update divider value when config changed
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
2022-11-02 06:13:00 +00:00
Mateusz Cicheński
9621f52c01 Animate PiP away on inset changes.
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
2022-11-02 03:47:57 +00:00
Matt Sziklay
e480be9300 Merge "Add handle menu to bar type window caption." into tm-qpr-dev 2022-11-01 21:43:35 +00:00
TreeHugger Robot
86fa95f3a4 Merge "Reduce switch split flicker on protrait split" into tm-qpr-dev 2022-11-01 12:43:46 +00:00
Galia Peycheva
c3ebae4ca8 Fix pip update transaction out of order
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
2022-11-01 10:00:17 +00:00
TreeHugger Robot
1bbb692393 Merge "Make sure surface crop is up-to-date when moving to front" into tm-qpr-dev 2022-11-01 08:40:38 +00:00
Riddle Hsu
171ade50ca Merge "Exclude unnecessary animations of shell transition" into tm-qpr-dev 2022-11-01 07:30:13 +00:00
TreeHugger Robot
c6e40030ce Merge "Fix NPE when run the splitscreen test" into tm-qpr-dev 2022-11-01 06:36:52 +00:00
TreeHugger Robot
18ef8a8d97 Merge "Move exit PiP leash to the transition root" into tm-qpr-dev 2022-11-01 01:36:53 +00:00
mattsziklay
dde7e758e8 Add handle menu to bar type window caption.
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
2022-10-31 16:24:06 -07:00
Jeff Chang
df3a229ee1 Fix NPE when run the splitscreen test
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
2022-10-31 01:46:49 +00:00
Chris Li
09aaecd548 Move exit PiP leash to the transition root
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
2022-10-28 18:51:12 +08:00
Riddle Hsu
e65d74270d Exclude unnecessary animations of shell transition
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
2022-10-28 17:50:56 +08:00
Chris Li
250472ba67 Make sure surface crop is up-to-date when moving to front
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
2022-10-28 07:52:10 +08:00
Ats Jenk
fac53656ed Merge "Clean up desktop mode logging" into tm-qpr-dev 2022-10-27 16:27:57 +00:00
Tony Huang
d7d381caab Reduce switch split flicker on protrait split
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
2022-10-27 16:51:44 +08:00
Jerry Chang
b8a27eb601 Merge "Add fallback logic to cancel entering split screen" into tm-qpr-dev 2022-10-27 03:55:19 +00:00
Hongwei Wang
571b988b5a Merge "Fix the scale for entering PiP animation" into tm-qpr-dev 2022-10-27 01:53:47 +00:00
Ats Jenk
ed7fd79631 Clean up desktop mode logging
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
2022-10-26 14:12:41 -07:00
Evan Rosky
8275328013 Add a config to disable registering Shell Transitions in dagger
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
2022-10-26 19:04:34 +00:00
Mateusz Cicheński
6af502fdb8 Skip moving PiP for IME/shelf change if user is dragging.
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
2022-10-26 15:55:30 +00:00
Hongwei Wang
8be07d9105 Fix the scale for entering PiP animation
The entering PiP animation used to overscale when entered from large
screen landscape mode.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/hMdoi9O3JEDSMvB9qqFNrc
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/jpZQhYk17hPEnWnWtjeRR
Bug: 201824622
Test: Entering PiP from large screen, landscape and portrait, in both \
      button and gesture navigation mode. See also the video
Change-Id: Ic4a4c2a8e83f794a999d8a91c6ebdb03537011f3
2022-10-26 05:22:55 +00:00
Jerry Chang
abd653a6a0 Add fallback logic to cancel entering split screen
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
2022-10-26 04:54:52 +00:00
Chris Li
96e8a788ef Merge "Show bg color during ActivityEmbedding change anim with Shell transition" into tm-qpr-dev 2022-10-26 01:45:56 +00:00
Chris Li
4659d8a49c Show bg color during ActivityEmbedding change anim with Shell transition
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
2022-10-25 09:55:54 +00:00
Jorge Gil
06502521d4 Prevent animation update callbacks after it has finished
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
2022-10-25 00:49:10 +00:00
Ats Jenk
20d8290797 Merge "Execute WCT when showDesktopApps is called" into tm-qpr-dev 2022-10-24 20:57:25 +00:00
Ats Jenk
da0d26e567 Merge "Limit freeform to front for freeform task launches" into tm-qpr-dev 2022-10-24 16:58:08 +00:00
Ats Jenk
53a1493396 Execute WCT when showDesktopApps is called
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
2022-10-24 09:19:06 -07:00
Mady Mellor
731095e5cf Merge "Track visible tasks in DesktopModeController and add a listener" into tm-qpr-dev 2022-10-24 16:04:59 +00:00
Mateusz Cicheński
00c35a0533 Merge "Make fling-to-dismiss disabled by default for PiP." into tm-qpr-dev 2022-10-23 17:49:59 +00:00
Shan Huang
92d7e3329f Merge "DO NOT MERGE Spring controlled back progress API" into tm-qpr-dev 2022-10-21 23:54:12 +00:00
Shan Huang
188dee2b3b DO NOT MERGE Spring controlled back progress API
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
2022-10-21 22:12:53 +00:00
Sunny Goyal
1cc345ab19 Merge "Updating icon loader method calls as per signature change" into tm-qpr-dev 2022-10-21 18:27:47 +00:00
Mateusz Cicheński
89503520b5 Make fling-to-dismiss disabled by default for PiP.
Bug: 214264312
Change-Id: I3a99324dc595a7c6aff76ae232d23d4c2db1c42c
Test: manually
2022-10-21 17:19:12 +00:00
Garfield Tan
639a4a914a Merge "Fix a few issues in WindowDecor" into tm-qpr-dev 2022-10-21 15:19:23 +00:00
TreeHugger Robot
a40a55db5c Merge "Import translations. DO NOT MERGE ANYWHERE" into tm-qpr-dev 2022-10-21 07:30:45 +00:00
Mady Mellor
457d8317f1 Track visible tasks in DesktopModeController and add a listener
- 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
2022-10-20 17:25:11 -07:00
Bill Yi
9384405e76 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I3e533428db45e2be3db2cfb6ae9b4aceaae12f35
2022-10-20 17:21:42 -07:00
Garfield Tan
2bbcd6ada5 Fix a few issues in WindowDecor
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
2022-10-20 17:11:10 -07:00