Commit Graph

947 Commits

Author SHA1 Message Date
Sebastian Franco
76f9cda458 Quick fix for NullPointerException 211713013
Test: Manually tested
Fix: 211713013
Change-Id: Ie701bee61a69d88cc9fce12c9d001a52f30578c4
2022-01-05 19:54:40 +00:00
Vinit Nayak
e4dd959073 Add API to get multiple running tasks for split
Bug: 205675364
Change-Id: Ia350e443b6b80ca8af2d546cb35cad23b212d86e
2021-12-15 13:14:47 -08:00
Tracy Zhou
eab69869a0 Add haptic feedback to rotation button
Fixes: 205503732
Test: tap rotation button in vibration only mode
Change-Id: I8fe29afc03353943b56fea9e80618441f7bca174
(cherry picked from commit 8f30dd7aea)
2021-12-15 03:40:22 +00:00
Hongwei Wang
d4848611d2 Fix the transition from Split to PiP
- Do not bring split to top on entering PiP
  When swiping up to home (or other cases) triggers one of the
  split-screen children enters PiP, do not try to bring the other task
  to top since the pair should be considered invisible.
- When entering PiP from split screen or non-auto PiP case, use the
  alpha information in PictureInPictureSurfaceTransaction to hide the
  task which would later be turned back on to avoid flicker.

Bug: 190855091
Bug: 205894095
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/42RWtayanp2qG0mHSf4Q5
Test: manual, enter PiP from split-screen, see Video
Change-Id: I1559748cd583c20d79ee458822d66e7801733d3a
2021-12-09 21:07:45 -08:00
Nicolo' Mazzucato
5aef2c1fab Improve fold state provider logic handling posture
Now FOLD_UPDATE_START_CLOSING event is emitted when the angle decreases.
After each angle update, a timeout is started to finish the animation.
When the timeout is reached, FOLD_UPDATE_ABORTED is emitted.

The timeout logic has been moved from
PhysicsBasedUnfoldTransitionProgressProvider to DeviceFoldStateProvider.

This change should not create problems to
FixedTimingTransitionProgressProvider, as it doesn't use any
intermediate FOLD_UPDATE event.

Test: Locally on device
Test atest com.android.systemui.unfold.updates.DeviceFoldStateProviderTest
Bug: 208977663
Change-Id: Ibc5df1e089d6543e7cf6ee2e0ce3d48a0b24cc07
2021-12-08 11:09:36 +01:00
Nicolo' Mazzucato
4a0cad571a Disable unfold animation when animations disabled
When AnimatorScale is set to zero (possible from settings),
the fold animation is disabled.

The change to UnfoldLightRevealOverlayAnimation is needed
because the overlay view is added independently from
UnfoldTransitionProgressProvider callbacks every time the
internal screen is turned on.

Test: Tested on device &&
   atest com.android.systemui.unfold.util.ScaleAwareUnfoldProgressProviderTest
Bug: 208791440
Change-Id: Icda9ed6d708873768c4ac533b9c790ae1631b45c
2021-12-03 13:15:23 +00:00
TreeHugger Robot
294c3c12fc Merge "Handle configuration changes in floating rotation button" into sc-v2-dev 2021-11-29 19:41:19 +00:00
Nick Chameyev
c487edc5a9 Handle configuration changes in floating rotation button
Update resources in floating rotation button
when configurations such as screen density, screen size,
current locale have changed.

Bug: 200103245
Test: change display size, locale, fold/unfold
 -> check that floating rotation button resources
    are updated
Change-Id: I140eeaf6df3dcca2fca42d5f9dd44ab59d068e57
2021-11-29 15:42:52 +00:00
Riddle Hsu
49794ebb48 Merge "Do not skip restoring rotation lock when returning to home" into sc-v2-dev 2021-11-25 02:20:20 +00:00
Riddle Hsu
3549a251fc Do not skip restoring rotation lock when returning to home
Since live-tile is enabled, the foreground app is still the original
activity, the display rotation doesn't change by the recents app
activity. So the condition added in commit 95cb52a doesn't need to
be enabled.

Bug: 205979005
Test: 1. Disable auto-rotation and home rotation.
      2. Launch an activity in portrait.
      3. Rotate the device to landscape and press rotation button.
      4. Enter overview (recents).
      5. Return to the application (keep in landscape).
      6. Return to home and launch the app again (restore to portrait).
Change-Id: Iccf87b2d66d57911cd49f2ea9080a71a85801e4c
2021-11-24 17:31:24 +08:00
Jonathan Miranda
1b3f782d94 Merge "Annotate TaskKey#baseIntent as @NonNull to match platform" into sc-v2-dev 2021-11-23 16:29:10 +00:00
Tony Wickham
a20b9203ac Pipe dark intensity through OverviewProxy
Test: in 3 button mode, nav buttons in taskbar are dark on light wallpaper; in both 3 button and fully gestural, IME dismiss button is dark on light IME
Bug: 204256643
Change-Id: Ib6488a393e9cf021c806a5caf5b81654cf5164eb
2021-11-22 09:38:43 -08:00
Jon Miranda
2a0e4634f5 Annotate TaskKey#baseIntent as @NonNull to match platform
Bug: 199027804
Test: manual
Change-Id: I1d9b0e479ac9341b37b3c9fbf7587041e037b35d
2021-11-19 12:05:37 -08:00
Alex Chau
48ac598601 Use only current density to check isTablet
Fix: 203817448
Test: manual
Change-Id: Icc339dd7a87284af31abe70fff9ede2868f5add9
2021-11-19 15:30:03 +00:00
Alex Chau
442ba5476d Merge "Add letterboxInsets to TaskSnapshot" into sc-v2-dev 2021-11-16 18:40:31 +00:00
Dave Mankoff
3f5835d848 Merge "Fix flag manager crash" into sc-v2-dev 2021-11-15 18:32:10 +00:00
Jay Aliomer
f667354d7d Fix flag manager crash
Bug: 196602427
Test: manual
Change-Id: I2690096429bc784b45e4e0c6cc32fb2e06becfb4
2021-11-12 14:09:24 -05:00
Fedor Kudasov
716597f726 Add @Nullable annotations to Task fields
Bug: 205828770
Test: m SystemUI-core
Change-Id: I80194b9959b9be3b87d2f074557f4e79f164ceca
(cherry picked from commit 11ae0987c2)
2021-11-11 21:54:29 +00:00
Dave Mankoff
8d08226fe6 Merge "Move contents of FeatureFlags into FeatureFlagManager." into sc-v2-dev 2021-11-10 17:49:54 +00:00
Winson Chung
35b8e2b997 Merge "Add multi-task support to recents-animation task-appeared" into sc-v2-dev 2021-11-10 17:05:46 +00:00
Vinit Nayak
b63153fa3b Merge "Pass back split bounds and meta info with GroupedTaskInfo" into sc-v2-dev 2021-11-10 16:33:49 +00:00
Dave Mankoff
5346e090f5 Move contents of FeatureFlags into FeatureFlagManager.
The meaningful contents of FeatureFlags only relates to debug
builds and has been moved into the debug version of
FeatureFlagManager.

Bug: 203548872
Test: atest SystemUITests && manual
Change-Id: Ifcef0cfe4e2d07daec34dfc7a6cbe2d305b312b5
2021-11-10 09:46:04 -05:00
Vinit Nayak
d3370c4082 Pass back split bounds and meta info with GroupedTaskInfo
* Compute and save a StagedSplitBounds object for every
pair to determine it's position, size, divider, etc.
* Moved GroupTask to Launcher
* Moved StagedSplitBounds from launcher to wm/shell
because sharing is caring.

Bug: 203006080
Change-Id: I8513e027f8c9606fbed1283013eafea2cf905f3f
2021-11-09 15:14:13 -08:00
Alex Chau
2dcd8f56c1 Add letterboxInsets to TaskSnapshot
Bug: 199743725
Test: manual
Change-Id: I7daa01d7e6d2df2bc1b85d12004e7927d61d0e03
Merged-In: I7daa01d7e6d2df2bc1b85d12004e7927d61d0e03
2021-11-09 11:03:32 +00:00
Evan Rosky
1258abfefc Add multi-task support to recents-animation task-appeared
Allows handling of app-pairs

Bug: 204094785
Test: Existing RecentsAnimation tests pass
Change-Id: Ie71fa994912a67a6b15c2f1e2dc1959473f52b15
2021-11-08 18:30:17 -08:00
Dave Mankoff
c642d70dde Remove FeatureFlagReader. Allow resource overlays.
Removes the FeatureFlagReader which some "flags" still used because
they were read from resources instead of the flaggin system.

Flags can now specify a resource id where their default value can be
read from (if there is a resource definition for it).

Bug: 203548827
Test: atest SystemUITests && manual
Change-Id: Ifb895fd6c5b40d4adfe2997f4ce1f4d7d2145183
Merged-In: Ifb895fd6c5b40d4adfe2997f4ce1f4d7d2145183
2021-11-08 18:41:56 -05:00
Dave Mankoff
c3ef628c75 Merge "Communicate flags from systemui async" into sc-v2-dev 2021-11-08 18:31:32 +00:00
Jerry Chang
b1626ac345 Merge "Snapshot all tasks in pending recents animation when rotating devices" into sc-v2-dev 2021-11-08 10:22:34 +00:00
Dave Mankoff
d1d488687b Communicate flags from systemui async
Flags are no longer statically compiled into the shared library.

A "GET_FLAGS" api has been added to SystemUI that returns a list
of Flag objects, as defined in SystemUI.

Communication happens via a simple "ordered" broadcast.

FlagManager#getFlagsFuture() returns a ListenableFuture pointing at
the list of flags. Be sure not to call Future#get on the main
thread - the call will block indefinitely as the broadcast receiver
is handled on the main thread.

Instead, add a listener to the future or call #get on a separate
thread.

Bug: 203548827
Test: manual
Change-Id: I8720e0905662a6371e7aabf04341df46b8943a9c
2021-11-05 15:27:09 -04:00
Jerry Chang
79090d6930 Snapshot all tasks in pending recents animation when rotating devices
Since both of splitting tasks in split screen go to overview together
now, update to snapshot all pending animations when rotating while
showing overview to ensure both of splitting task snapshots are taken
with proper bounds before rotation.

Bug: 200813008
Test: atest RecentsAnimationControllerTest
Test: enter overview after activated split screen, observed task
      thumbnails showing with correct bounds after roation.
Change-Id: Id1101bf8be67593f85a43c1d4afae769ffc737d3
2021-11-05 22:32:34 +08:00
Winson Chung
df857527f5 Merge "Add shell recents interface" into sc-v2-dev 2021-11-04 22:59:40 +00:00
Vinit Nayak
fa39743429 Merge "Add ability to invoke ime switcher from launcher" into sc-v2-dev 2021-11-04 20:47:04 +00:00
Dave Mankoff
c61d506a90 Merge "Add support for flag change listeners library." into sc-v2-dev 2021-11-04 19:47:49 +00:00
Winson Chung
92a8e1a6ec Add shell recents interface
- Add a shell component and interface for Launcher to use to get recent
  tasks including paired splits (pending integration w/ split controller)

Bug: 202740477
Test: atest WMShellUnitTests:com.android.wm.shell.recents.RecentTasksControllerTest

Signed-off-by: Winson Chung <winsonc@google.com>
Change-Id: I34d834061ed2391d89cf56d6a2fd262868707674
Merged-In: I34d834061ed2391d89cf56d6a2fd262868707674
2021-11-04 18:42:20 +00:00
Dave Mankoff
6c8ebb114f Merge "Add ability to read flag values to Flag Library." into sc-v2-dev 2021-11-04 14:36:04 +00:00
Dave Mankoff
fdb01b6353 Merge "Add a shared library for setting flags in SysUI." into sc-v2-dev 2021-11-04 04:09:13 +00:00
Dave Mankoff
72a5002956 Add support for flag change listeners library.
Bug: 203548827
Test: manual
Change-Id: I6f989e89a98c7c6643af762eb0263f81ce584dfa
2021-11-03 11:20:11 -04:00
Dave Mankoff
1a934e9aee Add ability to read flag values to Flag Library.
The FlagManager now partially implements the FlagReader interface.

The FeatureFlagManager, part of SystemUI proper, now uses the
FlagManager to read flag values, helping to ensure consistency between
the two separate systems.

Bug: 203548827
Test: manual
Change-Id: Ia3b103f783a846cfe9437cd8e6b987962cebabde
2021-11-03 10:28:22 -04:00
Vinit Nayak
8819a6ed7a Add ability to invoke ime switcher from launcher
Bug: 191814219
Change-Id: I15ae3732d0ac722bc9fc3a47bc49f35b62a06821
2021-11-02 18:44:57 +00:00
Dave Mankoff
93c9d9d665 Add a shared library for setting flags in SysUI.
This adds the FlagManager class which currently has 3 methods:
- #getFlagsFuture
- #setFlagValue
- #eraseFlag

The first makes an async call to SystemUI to retrieve the flags
it knows about. It returns a collection of Flag objects from which
one can get the id, type, and default values.

The other two are fairly self-explanatory, sending intents to
SystemUI telling to set or erase flags. Any app calling these
methods must have the FLAGS_PERMISSION defined in the FlagManager
library.

Only boolean flags are supported at the moment.

Bug: 203548827
Test: manual
Change-Id: Id15ff481edcb83c67ce4cdad6cdda27d28a40652
2021-11-02 11:27:55 -04:00
Evan Rosky
7ba314d658 Boost remote-transition animator processes during animation
This basically ties applicationthread binder token to remote
transitions. Shell is first boosted (to run the shell transition
logic) and if it then delegates to a remotetransition, it will
then request that process also be boosted.

Bug: 183993977
Test: add logging in WPC.setRunningRemoteAnimation and verify calls
      during transitions
Change-Id: I94babc327e935ea81271942287a83b948dd11f8b
2021-11-01 16:54:26 -07:00
Nick Chameyev
d1d534031d Do not use shared lib resources
Temporary removes usages of SysUI shared
resources as it leads to crashes in Launcher
tests.

Bug: 204727471
Test: install launcher, try autorotate suggestion
Change-Id: I82dae0b2f5a9d2cb83f8a60e3c08353dc1bb60b6
2021-11-01 17:04:52 +00:00
Nick Chameyev
4309e6ec42 Move floating rotation button handling to Launcher
Moves handling of floating rotation button when navigation
bar is not created to the launcher. This button was not
showing when taskbar is visible as it was initialized in
navigation bar (which is not created for large screens).

Bug: 200103245
Test: rotate phone when autorotate disabled on inner screen
Test: showing rotate suggestion when gesture nav enabled/disabled
Change-Id: I0619acd9d24eb4ba36bdb601517f9a8370ee999a
Merged-In: I0619acd9d24eb4ba36bdb601517f9a8370ee999a
2021-10-29 16:19:39 +00:00
Nick Chameyev
fa92428107 Do not animate statusbar unfold when in portrait orientation
Disables unfold animation for statusbar when it is
perpendicular to the screen fold.
Moves ScopedUnfoldTransitionProgressProvider from launcher
to shared SysUI/Launcher code.
Introduces NaturalRotationUnfoldProgressProvider which emits
transition events only when in natural rotation.
Added proper disposal of resources when status bar is detached
as PhoneStatusBarView is re-created when folding/unfolding.

Bug: 201518277
Test: manual
Test: atest com.android.systemui.unfold.util.NaturalRotationUnfoldProgressProviderTest
Change-Id: If4da3afca2b41c3675ccf6838e9ad6dac1b6f82e
2021-10-20 14:49:19 +01: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
6ba778585f Merge "Synchronize screen turning on and unfold overlay" into sc-v2-dev 2021-10-18 12:28:26 +00: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
Vinit Nayak
aa84d0e857 Add API to allow launcher to suspend AutoHideController
* Make suspend/resume methods public
* TaskbarDelegate acts as the AutoHideUiElement
for the purposes of simplicity (vs having Taskbar
itself in launcher implement the interface).
* We re-use existing mNavBar setter in AutoHideController
since we know when tablet is showing there is no
navigation bar present

Bug: 193938507
Test: Taskbar shows when requesting auto-hide suspend.
Change-Id: I36429b4ea357646cf6b6dac7a048905b1986be16
2021-10-11 13:35:16 -07:00
Mady Mellor
3ea812fb25 Add a sysui state for manage menu being expanded
This is needed to properly scrim taskbar when bubbles
are expanded with the manage menu open.

Added tests around hiding / showing the menu and
verifying the state.

Bug: 197139718
Test: BubblesTest NewNotifPipelineBubblesTest
Change-Id: I52e41344f9273398cea606c227dfcf3b8cc6394d
2021-10-08 14:54:46 -07:00
Evan Rosky
14ea8c60f5 Unrotate going-away apps during a launch-into-orientation transition
When going from a non-launcher task to another non-launcher task
that is in a different orientation, we just animate the new task
opening in the new orientation (no screen rotation animation). To
make this work, though, we need to unrotate all the going-away
windows because they are in the old orientation.

Added CounterRotator to a utility area in shell so it can be
shared with other components (like Sysui shared lib).

Bug: 183993924
Test: atest OpenAppColdTest
Change-Id: I0263dfb8d529b6fc3dfbe3775e3e6e0b77f6ca8a
2021-10-05 16:23:47 -07:00