Commit Graph

1818 Commits

Author SHA1 Message Date
Ben Lin
0e40a98bc3 PiP: support direct entering split from PiP.
Add a new "enter split" button that allows user to go directly into
split screen on large screen devices from PiP.

- Add button
- Calculate split-screen location based on current PiP bounds
- Merge all WCT into one after animating

Video: http://recall/-/gu5DjQFZPMFpwgaXdl4cV3/gnNkSpC72tlTGP2mrKR07R

Bug: 202740657
Test: Enter PIP, open another app, tap "enter split"

Change-Id: I0829c910b2873ed4c4b0ea4fe0ca28b7f87736d8
2021-11-04 11:45:59 -07:00
Tom Natan
2d213c397a Merge "Redesign the size compat restart button according to mocks." into sc-v2-dev 2021-11-02 15:22:05 +00:00
tomnatan
825e55ed60 Redesign the size compat restart button according to mocks.
The width of the hint is constant but the height changes with respect to the number of lines the text requires (see screenshots below). The X position of the hint is set programmatically so that the point's center will be aligned with the button's center.

Still need to add UI for different states of the button (pressed, focused, etc.) and maybe also the hint (since it's clickable). Mocks for this are still TBD.

Mocks: https://www.figma.com/file/fLAVOdDkg0lnFWiltSYbGA/Multitasking?node-id=2719%3A54196

Screenshots:
[default - 2 lines]    http://screen/4EtytFiKsY3Q5NE
[LTR language]         http://screen/9BSPipZYUd7UGPV
[short text - 1 line]  http://screen/AN5bds6rh5V55Bw
[large font - 3 lines] http://screen/6utG596y52LBDjX
[long text - 4 lines]  http://screen/7mBL2fXWy43UsTq

Bug: 198347324
Test: atest WMShellUnitTests:SizeCompatRestartButtonTest
Test: atest WMShellUnitTests:SizeCompatHintPopupTest
Test: atest atest WMShellUnitTests:SizeCompatUILayoutTest
Change-Id: Ida4c4171be94b60499cfe8acb6a2278f7e10a1f3
2021-11-02 13:17:19 +00:00
Sergey Serokurov
1837681488 Merge "Hide bubbles when focus mode is enabled" into sc-v2-dev 2021-11-02 00:31:23 +00:00
Hongwei Wang
fdf6eedb10 Merge "Avoid conflict surface reset on auto-enter-pip" into sc-v2-dev 2021-11-01 20:51:41 +00:00
Jerry Chang
7b04c3ba76 Remove redundant operations of split screen
Make moveToSideStage doing reparent oeprations only and leave all the
other active operations to onStageHasChildren. Also make sure it evicts
original children.

Remove setLaunchRoot and setWindowingMode operations in MainStage since
it won't be set as launch root and won't change in between of fullscreen
and multi-window windowing mode anymore.

Fix: 204519739
Bug: 202740040
Test: atest WMShellUnitTests
Change-Id: I6199862502646056966412824a5be840a15e8726
2021-11-01 16:43:26 +08:00
Sergey Serokurov
102451972f Hide bubbles when focus mode is enabled
Bug: 191211593
Test: Manual, verifed that pre-existing bubbles are not visible once focus mode is eanbled and vice versa.
Test: Screen recording: https://drive.google.com/file/d/1oVwgQhv7yyzy5UFnidNYPVyE2pvEE39J/view?usp=sharing
Change-Id: I7c287b9d00ecaa0dba582b49f70a9f8fb7701782
2021-10-31 11:32:49 -07:00
Hongwei Wang
5c80561b44 Avoid conflict surface reset on auto-enter-pip
FullscreenUnfoldController#resetSurface happens in between
RecentsAnimationController cleanup and PipTaskOrganizer#onTaskAppeared
may cause flicker at the end of auto-enter-pip transition.

Fix it by intentionally ignore resetSurface if the task's pinned.

Bug: 203724707
Bug: 204284060
Test: repeatedly swipe to enter PiP from YT on foldables
Change-Id: Ie074e8a506d2526fc081ff4d089a2acb00549286
2021-10-29 14:24:40 -07:00
Tony Huang
2003f5796c Fix side stage cannot be focused
When split active by drag drop, the active point is
onStageHasChildrenChanged callback but we don't reorder side stage
to top then make it cannot be focused.

Add reorder root to top for fixing.

Fix: 204510713
Test: manual
Test: pass existing tests
Change-Id: I553a57250c302ff435a35c9a10599fc375e48248
2021-10-29 22:03:53 +08:00
Tony Huang
70b7b1e2d8 Fix divider rounded corner on specific devices
On large rounded corner devices, Rounded corners around divider
cannot display right corner path because it need more space to
draw corners and divider bounds is fixed.

Fix this by enlarging the divider window bounds. However, if we only
enlarge it, it will cause divider touch region too big to make app
hard to interactive. Therefore, migrate touch region setting logic
in legacy split to here, only set divider handle view size as touch
region.

Fix: 202808282
Test: flash on barbet and active split screen to check
Test: pass existing tests
Change-Id: If292c0d4c598d75672ec821d1fee45a8892b236f
2021-10-28 09:01:37 +08:00
TreeHugger Robot
1679d92eef Merge "Update split resizing transition to match design" into sc-v2-dev 2021-10-27 23:18:07 +00:00
Jerry Chang
222c9d3890 Update split resizing transition to match design
Remove the support of drawing side stage outline and update
OutlineManager to SplitDecorManager to help rendering decor view for
split screen like providing resizing hint.

Fix: 202740435
Fix: 202174975
Bug: 201653912
Bug: 200850654
Test: atest WMShellUnitTests
Test: manual check split resizing behavior

Merged-In: I4033255d8e2a94f69667ca1365b17da956816cde
Change-Id: I4033255d8e2a94f69667ca1365b17da956816cde
2021-10-27 23:22:33 +08:00
Tony Huang
cb7e987bb5 Merge "Fix split black when enable in landscape" into sc-v2-dev 2021-10-27 01:35:52 +00:00
Ben Lin
0aa2fa5b40 Merge "PiP: Fix more Shell Transition potential issues." into sc-v2-dev 2021-10-27 00:11:13 +00:00
Tony Huang
b58a09a59e Fix split black when enable in landscape
We assume dismissing side should be DOCKED_INVALID when split
active, however, if snap algorithm only have one target, it will
get other side due to current algorithm.

Fix this by correct algorithm and ensure dismissing side be
DOCKED_INVALID when split active or layout.

Fix: 203745267
Test: manual
Test: pass existing tests
Change-Id: I077a93472dad89bc620e490dcae5170e9a56279b
2021-10-26 15:53:05 +08:00
Wei Sheng Shih
26f39bdc52 Merge "Prevent receive extra callbacks from AnimatorListener." into sc-v2-dev 2021-10-26 05:12:02 +00:00
Ben Lin
f71a1b2970 PiP: Fix more Shell Transition potential issues.
If an animator is already running, we usually just update its end
bounds - but we also end up over-writing the original callbacks. This
used to work well since pre-shell transition, callbacks are always
pulled from PipTaskOrganizer, but now we can have two places that supply
callbacks (PipTransition). So let's just leave the callback alone.

Another potential issue is that sometimes finish callbacks from one
transition is not called before starting another one, and starting a new
transition overwrites the old finishCallback. We will then finish the
earlier callbacks to ensure the transition system does not hang the
entire device, but throw an Exception to not gloss over the potential
issue.

Bug: 183993924
Test: atest PinnedStackTests
Change-Id: Ib4c5926beec5745d8a0abccec5c67849488e532b
2021-10-25 17:13:25 -07:00
TreeHugger Robot
0826811ad3 Merge "Dump mIsSwipeToNotificationEnabled state" into sc-v2-dev 2021-10-25 13:46:05 +00:00
wilsonshih
aeb283f9f6 Prevent receive extra callbacks from AnimatorListener.
There will receive another onAnimationStart/onAnimationEnd callback
when calling ValueAnimator#end if the animation is not running, which
is not necessary if the animation was finished already.

Bug: 195736656
Test: atest SplashscreenTests
Change-Id: Ifbbf2f799e3e69624626b16e08f40b562fe483a8
2021-10-25 20:40:13 +08:00
Shawn Lin
59f51a9538 Merge "Add APIs to get system bar heights" into sc-v2-dev 2021-10-25 04:07:12 +00:00
Jerry Chang
d0cda70d27 Fix drop to enter split not working
Sometimes when dropping app icon to enter split screen, it'll exit split
screen immediatlly because it evicts newly launched task before the task
considered to be visible. Update to collect child tasks to evict before
launching activity.

Fix: 203610931
Fix: 203636251
Test: atest WMShellUnitTests
Change-Id: If070fb5b3eb0b3fc178122d38b2dce3072621449
2021-10-21 19:02:56 +08:00
Bill Lin
305d699154 Dump mIsSwipeToNotificationEnabled state
Legacy code lack of mIsSwipeToNotificationEnabled when dumpsys

Test: atest WMShellUnitTests
Test: adb shell dumpsys activity service com.android.systemui
Bug: 203742040
Change-Id: I8bad4ff82952ec357131a7606c9ec94441400c07
2021-10-21 15:59:47 +08:00
Jerry Chang
430944cefb Merge "[DO NOT MERGE] Provide IconProvider in sysui dagger" into sc-v2-dev 2021-10-21 01:28:14 +00:00
Evan Rosky
b93d37627d Merge "Fix PiP Shell Transitions" into sc-v2-dev 2021-10-20 16:07:03 +00:00
Jerry Chang
7891acface [DO NOT MERGE] Provide IconProvider in sysui dagger
So that other components can get app icon throught it as well.
Like showing app icon as resizing hint while dragging divider bar in
split screen.

Bug: 202740435
Bug: 201653912
Test: atest WMShellUnitTests
Change-Id: I7cc10be4ebfe7f9aad5db036a595613546ca15c9
2021-10-20 11:26:23 +00:00
TreeHugger Robot
a18b8a827e Merge "Migrate screen rotation latency tracker with shell transition" into sc-v2-dev 2021-10-20 02:12:34 +00:00
Evan Rosky
c6d5abe414 Fix PiP Shell Transitions
PiP Shell Transitions needs to be more robust to pass CTS tests
reliably.

Some changes:

1. DELIVERED_TO_TOP intents don't create a transition since there is
   no change to the WM hierarchy. This way the app-launch transition
   won't conflict with activityRestartAttempt.

2. If PiP started an expand transition while an enter transition is
   ongoing, cancel the enter transition.
   a. Additionally, because PiP doesn't resize task until the enter
      transition finishes, the expand transition will actually be
      a no-op. If we see this pattern, also cancel the enter
      transition.

3. When taskVanished, make sure to call any pending finishCallback
   because it doesn't allow the running animator to properly finish.
   Transition systems require the finish callback to function
   properly.

4. Minimize the uses of finishTransition with a sync callback. We
   probably need to phase this out because it can conflict with
   subsequent startTransition calls (because only 1 sync is supported
   at a time).

Bug: 183993924
Test: atest PinnedStackTests
Change-Id: Ieb573032839a2f31b0bb371410484fc93a1714fa
2021-10-19 15:50:41 -07:00
Michał Brzeziński
d41437abf4 Merge "Revert^2 "Revert "Provide IconProvider in sysui dagger""" into sc-v2-dev 2021-10-19 14:50:22 +00:00
Michał Brzeziński
9a003a67aa Revert^2 "Revert "Provide IconProvider in sysui dagger""
769f04c8f0

Change-Id: I654c4fb5d393e8ac13840625662fa738359df4df
2021-10-19 14:36:35 +00:00
Riddle Hsu
9cb2c66248 Migrate screen rotation latency tracker with shell transition
It was done by WMS#startFreezingDisplay~stopFreezingDisplayLocked.
The duration is measured from rotation change to start animation.

Add a remote callback to know when the rotation animation is started.
So WM core can have the paired begin/end of trace that matches the
latency exactly.

The added ITransitionMetricsReporter is available for any processes.
So in the future it can also report the metrics from remote animator.
This change focuses on the rotation animation handled by shell.

Bug: 199836343
Test: adb shell setprop persist.debug.shell_transit 1; reboot
      Rotate display and check trace "L<ACTION_ROTATE_SCREEN>".
Change-Id: I180d2fe1a77e98b6427ba831a2db2593739376bd
2021-10-19 19:02:38 +08:00
Shawn Lin
16496cb5c1 Add APIs to get system bar heights
In multi-display devices, there might be differnt cutout on each display
which also causes different status bar height.

Now we no longer overlay the status_bar_height dimen and keep it as
default value and add APIs to calculate the status bar size.

- Add APIs for getting status_bar_height & quick_qs_offset_height in
  system.
- Add APIs for getting split_shade_header_height and
  qs_header_system_icons_area_height in SystemUI.
- Remove all resource overlay for status_bar_height &
  quick_qs_offset_height.

Bug: 186604541
Test: atest SmallClockPositionTest DisplayLayoutTest
      HideDisplayCutoutOrganizerTest SizeCompatTests
      NotificationPanelViewControllerTest
Change-Id: I5a6dfcc6ff06da8ea0fe119fc9d4c089f13b0dff
2021-10-19 14:51:20 +08:00
Chloris Kuo
36a15a906c Merge "Notification text change should not be interruptive during post time" into sc-v2-dev 2021-10-19 01:16:13 +00:00
Jerry Chang
299b926bcf Merge "Revert "Revert "Provide IconProvider in sysui dagger""" into sc-v2-dev 2021-10-19 01:05:00 +00:00
Chloris Kuo
fbe9702f6e Notification text change should not be interruptive during post time
Rename NLS#Ranking.visuallyInterruptive and source from isTextChanged

Bug: 201087764

Test: atest NotificationManagerServiceTest, NotificationRecordTest,
NotificationListenerServiceTest, BubblesTest, BubbleDataTest,
NewNotiPipelineBubblesTest

Change-Id: I5949183704c3747084c83af7737a5212ede48fc0
2021-10-18 20:13:00 +00:00
Mady Mellor
a80ecceba9 Merge "Add a sysui state for manage menu being expanded" into sc-v2-dev 2021-10-18 19:35:05 +00:00
TreeHugger Robot
6f26ef6d74 Merge "Separate split layout shifting callback from layout changed callback" into sc-v2-dev 2021-10-18 14:28:30 +00:00
TreeHugger Robot
3d13d0cbad Merge "Replace tasks in the same split with the dropping app" into sc-v2-dev 2021-10-18 14:27:18 +00:00
TreeHugger Robot
6ba778585f Merge "Synchronize screen turning on and unfold overlay" into sc-v2-dev 2021-10-18 12:28:26 +00:00
Jerry Chang
769f04c8f0 Revert "Revert "Provide IconProvider in sysui dagger""
This reverts commit 289347aedf.

Reason for revert: re-land the CL with CarLauncher change

Merged-In: If4ab0590f4b850103411b6a2dccf2092bb06d563
Change-Id: I5a43908f958b45a936d0e7ac09f96d85d08663b7
2021-10-18 11:02:14 +00:00
Miguel Aranda
b169404b77 Merge "Revert "Provide IconProvider in sysui dagger"" into sc-v2-dev 2021-10-18 09:17:45 +00:00
Jerry Chang
289347aedf Revert "Provide IconProvider in sysui dagger"
This reverts commit f59eccd4a6.

Reason for revert: b/203356785, missed to update CarLauncher correspondingly in sc-v2

Change-Id: I0902b496b69e415fa0208948307fdf3883a1be17
2021-10-18 08:55:36 +00:00
Jerry Chang
f426ad9776 Merge "Provide IconProvider in sysui dagger" into sc-v2-dev 2021-10-18 02:03:24 +00:00
Jerry Chang
34c1fb931c Replace tasks in the same split with the dropping app
When launching a new app into a specific split, evicts all child tasks
that were originally in the same split.

Fix: 202739668
Test: atest WMShellUnitTests
Test: manual check dropping an app to a specific split evicts other
      tasks in the same split.
Change-Id: I3f52a3675d6ead742f0b75c83393462e5778a524
2021-10-16 09:39:52 +08:00
Nick Chameyev
c055dbb324 Synchronize screen turning on and unfold overlay
Changes unfold overlay implementation from a window
to surface control view host. To make sure that the
unfold overlay is drawn by the time when we remove
screen blocker we synchronously apply a transaction
with drawn overlay and apply another empty transaction
with vsyncId+1.

Also these changes disable the unfold transition when
using power button by filtering only first screen turning
on events after unfolding the device.

Bug: 197538198
Test: manual fold/unfolds
Test: killing SysUI process, checking rotation animation, magnification
Test: atest com.android.systemui.unfold.updates.DeviceFoldStateProviderTest
Change-Id: I8e0bc635b041595602145b313548b14fcabd157e
2021-10-15 12:55:16 +00:00
Tony Huang
be0c2bdc92 Merge "Make split screen only reparent top task" into sc-v2-dev 2021-10-15 05:46:13 +00:00
Jerry Chang
76fdc5c43c Separate split layout shifting callback from layout changed callback
So that split implementation can have a better idea about whether it
should apply resizing transition or shifting transition.

Bug: 201653912
Bug: 202334667
Test: manul check
Test: atest WMShellUnitTests
Change-Id: Ia39c15536ed3ed5851120ca9a576cc1426736d79
2021-10-15 11:09:06 +08:00
TreeHugger Robot
81f5da9ea3 Merge "Catch exception when parsing faulty AVD" into sc-v2-dev 2021-10-14 19:55:06 +00:00
Tony Huang
62c6c83f57 Make split screen only reparent top task
Follow latest split screen UX model, it should only reparent
the top task to split for app-pair model.

Fix: 201480664
Bug: 202740040
Test: manual
Test: pass existing tests
Change-Id: I4b360a31ce8e7366a77216a94b5f1b19bba848e9
2021-10-14 15:37:00 +08:00
Jerry Chang
f59eccd4a6 Provide IconProvider in sysui dagger
So that other components can get app icon throught it as well.
Like showing app icon as resizing hint while dragging divider bar in
split screen.

Bug: 201653912
Test: atest WMShellUnitTests
Merged-In: If4ab0590f4b850103411b6a2dccf2092bb06d563
Change-Id: Ia99fd2b9ddb05b95205bf923a1ac0f3922e54db7
2021-10-14 13:16:38 +08:00
Tony Huang
7d3fcc6fe2 Copy current split codes to stagesplit package
Backup current split screen implementation

Fix: 202740656
Test: build pass
Test: pass existing tests
Change-Id: I0dcd3ba5b48a43dab902f10c60e840e0ecccddbe
2021-10-12 12:26:58 +08:00