Commit Graph

461 Commits

Author SHA1 Message Date
Winson Chung
cfdd34adab Merge "Always notify SystemUI when launching activity to existing task" into rvc-dev 2020-03-11 02:28:09 +00:00
Tracy Zhou
705e25deb1 Merge "Support scaling with SurfaceControl when using WindowlessWindow APIs" into rvc-dev 2020-03-10 09:27:30 +00:00
Tracy Zhou
6470c60273 Support scaling with SurfaceControl when using WindowlessWindow APIs
Demo: https://drive.google.com/open?id=1wQ8dT5bfTxSh-NRQpNBwTCkKOtOOUMPj

Bug: 150224413
Test: Manual test on both universal smartspace and wallpaper preview
Change-Id: I604e5a43727035cbeb36f02681fc317fd356268a
2020-03-10 00:06:34 -07:00
Winson Chung
e789ff64c8 Always notify SystemUI when launching activity to existing task
- SysUI can determine what to do based on the type of activity launched
  (ie. expand PIP/Bubbles to fullscreen)

Bug: 148977481
Test: atest TaskStackChangedListenerTest
Test: Launch app in split primary, ensure launching app again triggers
      recents
Test: Launch app in PIP, ensure launching app again triggers it to go
      fullscreen
Test: Launch app in bubble, ensure launching app again triggers bubble
      to expand
Change-Id: I754a71a72dd0e660930b19acbf9fe6ccbb453152
2020-03-10 03:46:48 +00:00
lumark
2ec1912dfb Add localBounds in RemoteAnimationTarget
With Hierarchical animation, the animation layer will no longer
be a fixed fullscreen layer but animate on the parent container's surface.

In order to run a remote animation, the animation controller needs to
know bounds of the target relative to both its parent and the screen.

The CL includes:
1) RemoteAnimationTarget changes:
    - Add localBounds field for indicating the target bounds which
    the coodiates relatives to its parent.
    - Add screenScreenBounds field to replace souceContainerBounds
      to reflect the target bounds relatives to the screen.
    - Mark position & sourceContainerBounds as deprecated.
2) Modified related places to set correct localBounds information.

Test: build / run, make sure installing the old version of launcher on
      the this new platform change still compatible without crash.
Test: manual as follow steps:
  - Launching app from launcher to split-screen secondary stack
  - Swipe up to overview screen and drag TaskView to see if the TaskView
    surface is shfted, expected is not.
Bug: 148780840
Change-Id: Id9dbf6de193ab73fe94bc24ef6a27edc93380a14
2020-03-09 22:24:17 +08:00
Tracy Zhou
417fa7eac8 Turn on hardware acceleration flag on the windowless window we render
Bug: 150224413
Test: Manual. Make sure universal smartspace still works as intended.
Change-Id: I9ed867ca1612b5c016e97765ebf077051c5da23c
2020-03-06 15:36:37 -08:00
Winson Chung
5570147aa0 Ensure that task org updates all happen off the main thread
- Move the animator to be called on the update thread
- Move the calls on task org to update on that thread as well
- Cache the leash and token to ensure we don't make binder calls to fetch
  the leash on each frame of the animation
- Don't align with SF vsync now that we're driving the surface animations

Bug: 150810666
Test: Enter PIP, move it around
Test: atest PipAnimationControllerTest
Change-Id: Id05980529681f892638f52f492262fde246cac20
2020-03-05 17:33:02 -08:00
Sunny Goyal
721de2359e Merge "Removing deferring gestureNav until managed profile is setup" into rvc-dev 2020-03-05 17:53:06 +00:00
Tracy Zhou
fceac76c37 Merge "Make SurfaceView rendering generic in SysUI" into rvc-dev 2020-03-05 05:54:58 +00:00
Tracy Zhou
ccfab35bf8 Make SurfaceView rendering generic in SysUI
WindowlessWindowManager is not visible as external APIs, so for
launcher / wallpaper to use the API the rendering code has to be in the
SysUI.

Bug: 150224413
Test: Manual. Make sure universal smartspace still works as intended.
Change-Id: If006d622f181f6c8cc7c1cebda3f63b0b2ad85d5
2020-03-04 18:29:35 -08:00
Sunny Goyal
5dcdc10345 Removing deferring gestureNav until managed profile is setup
Bug: 150458410
Test: Presubmit
Change-Id: I517246f62f89d3b4395410480ffa1cc775316090
2020-03-04 14:42:00 -08:00
Winson Chung
7e895da152 Update sync rt applier for background blur
- Copy surface params builder to compat class
- Add calls to set background blur
- Make recents/app transition leashes effect layers so blur can be set
  on them

Bug: 149792636
Test: Build with launcher with blurs enabled
Change-Id: I4cebcab090719c6a17f197a3cd4450d68e55b424
2020-03-04 08:45:12 -08:00
Evan Rosky
73a7fe9479 Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
2020-02-25 21:13:16 +00:00
Peter Kalauskas
81a320279e Merge changes from topic "new-task-snapshots-rvc-dev" into rvc-dev
* changes:
  Disable reduced scale if reduced scale config is 0
  Store original task width and height instead of scale
2020-02-25 18:29:50 +00:00
Hongwei Wang
85cf41fcc3 Move PiP animation to SysUI package
The bounds animation is cleaned up within window manager and it's now
the SysUI component listening on callbacks from TaskOrganizer for
entering to and exiting from PiP mode.

Additionally, the expand and move of the PiP window is now part of SysUI
as well.

Known issues:
- Black background when in transition from PiP to fullscreen. The
wallpaper gets into hidden state too early
- App gets into PiP mode too early when entering PiP, need to defer the
configuration change sent to app in this case

Bug: 146594635
Bug: 148198539
Bug: 138144750
Bug: 149569903
Test: atest PinnedStackTests
Test: atest PipAnimationControllerTest
Test: atest RecentsAnimationTest
Test: atest RecentTasksTest
Test: atest com.android.server.wm.ActivityStarterTests
Merged-In: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
Change-Id: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
2020-02-24 21:16:20 +00:00
Peter Kalauskas
fe0a413a60 Store original task width and height instead of scale
Store the original task snapshot size instead of the scale from which
the bitmap was saved. This simplifies the logic around restoring and
saving from the proto, as both the reduced scale and full scale
snapshots make use and share the same state.

Also remove scale from TaskSnapshot, and remove and reducedScale from
TaskSnapshot.Builder.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148491788
Bug: 148617404
Bug: 142063079
Change-Id: I1dccaba87c3d8b95bf4156f41f9fd5d40019f675
2020-02-24 21:01:03 +00:00
TreeHugger Robot
d566d02ff3 Merge "Rename full and reduced scale configs" 2020-02-21 23:28:35 +00:00
Peter Kalauskas
4dc04606da Rename full and reduced scale configs
Rename:
  config_fullTaskSnapshotScale -> config_highResTaskSnapshotScale
  config_reducedTaskSnapshotScale -> config_lowResTaskSnapshotScale

Both full and reduced scale can be "reduced" from 100%, so name them
more clearly.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148617404
Bug: 142063079
Change-Id: Ie8073d5a3048c19450308b2af22d363deaa51b6a
2020-02-21 17:06:19 +00:00
TreeHugger Robot
9f0d9f7bba Merge "Let launcher control wallpaper zoom" 2020-02-21 02:27:11 +00:00
Lucas Dupin
e47c5c6572 Let launcher control wallpaper zoom
Test: make
Bug: 149792636
Change-Id: I750c0df235309a75971032433eece00a7a9138cb
2020-02-20 16:29:37 -08:00
Evan Rosky
2d88183bde Merge "SystemUI Split via TaskOrganizer" 2020-02-19 18:43:36 +00:00
Evan Rosky
af9f27cdc2 SystemUI Split via TaskOrganizer
Use the early TaskOrganizer concepts to implement Split-screen
in system-ui.

This includes changes to both FW and SystemUI. The changes to
FW involve removing the use of split-screen specific behavior (like
minimize dock and direct ordering) and also reducing things that
care about primary vs secondary. It also changed ActivityStack
to inherit bounds from parent** when in split-mode so that sysui
only needs to manipulate the tile and/or reparent stacks to
effect their geometry.

This means a lot of layout logic moves to SystemUI. The bulk of
the work done in ActivityStack which is split-screen related is
moved into SplitDisplayLayout. This basically takes a snapshot of
display configuration and manages the sizes of splits and their
snap targets.

Intermediate dragging of divider bar now only moves root task leashes
around rather than talking to WM. This includes position as well
as crop (which used to be stack crop). Once the user releases
the divider bar, it will calculate (based on snaps) the new
root task sizes and update their configurations via
WindowContainerTransaction. Because the interim updates are only
on the leashes, no configuration updates occur until the end.

Entering/Exiting split-mode is now handled by SplitScreentaskOrganizer#
onTaskInfoChanged. This is effectively a state-machine that
looks at the current split task membership vs. previous and then decides
when to move things into/out-of split tasks and how to coordinate with the
DividerView.

Minimized dock is relegated to a purely system-ui concept. To
accomplish this, **the home *stack* is set to the minimizedhomebounds
by systemui. This means that it's relative position to its parent is
negative! This allows us to leave the split sizes constant, have
their children inherit the "actual" split sizes, but keep the
home stack unchanging in its minimized size. We just adjust the crop
negative to reveal it.

IME handling is done through the same mechanism as app-driven IME
animation... only Divider receives the control instead of the app.
This allows synchronized animation of split tasks with IME. To
account for insets, though, when IME is opened, the bottom stack
will be repositioned in WM.

Bug: 133381284
Test: Manual, use split-screen, rotate device, launch unresizable
      apps in split, use divider snap to close/maximize apps, etc.
Change-Id: I7133e151a1037c42b275b97857936437a7a6725f
2020-02-18 16:19:39 -08:00
Robert Carr
f2f84f5f27 Remove more deferTransactionUntilSurface calls
These won't work with the BLAST adapter since the Surface isn't
known to the server side. We just convert them in to the other
variant of defer transaction calls.

Bug: 146598493
Bug: 149251083
Test: Existing tests pass
Change-Id: I34fc4bb90114bae8b0d9ffdee5c91a2371e5c240
2020-02-18 11:08:52 -08:00
Jorim Jaggi
2a3002a54f Revert "SystemUI Split via TaskOrganizer"
Revert "Update CTS tests for tile-based split-screen"

Revert submission 9964969-sysui_split_screen

Reason for revert:
- Random SysUI crash (ag/10335781)
- Breaks IME tests with new_insets set to 2
- Crashes SysUI in split screen with new_insets set to 2.

Reverted Changes:
I103f68030: SystemUI Split via TaskOrganizer
If6740b7ee: Connect split-screen things to systemui divider
I44f497e7d: Update CTS tests for tile-based split-screen

Change-Id: Ife6878044ff19905ed97b599d8c67f80cb8e399e
2020-02-17 17:10:11 +01:00
Evan Rosky
bed2d1b57c SystemUI Split via TaskOrganizer
Use the early TaskOrganizer concepts to implement Split-screen
in system-ui.

This includes changes to both FW and SystemUI. The changes to
FW involve removing the use of split-screen specific behavior (like
minimize dock and direct ordering) and also reducing things that
care about primary vs secondary. It also changed ActivityStack
to inherit bounds from parent** when in split-mode so that sysui
only needs to manipulate the tile and/or reparent stacks to
effect their geometry.

This means a lot of layout logic moves to SystemUI. The bulk of
the work done in ActivityStack which is split-screen related is
moved into SplitDisplayLayout. This basically takes a snapshot of
display configuration and manages the sizes of splits and their
snap targets.

Intermediate dragging of divider bar now only moves root task leashes
around rather than talking to WM. This includes position as well
as crop (which used to be stack crop). Once the user releases
the divider bar, it will calculate (based on snaps) the new
root task sizes and update their configurations via
WindowContainerTransaction. Because the interim updates are only
on the leashes, no configuration updates occur until the end.

Entering/Exiting split-mode is now handled by SplitScreentaskOrganizer#
onTaskInfoChanged. This is effectively a state-machine that
looks at the current split task membership vs. previous and then decides
when to move things into/out-of split tasks and how to coordinate with the
DividerView.

Minimized dock is relegated to a purely system-ui concept. To
accomplish this, **the home *stack* is set to the minimizedhomebounds
by systemui. This means that it's relative position to its parent is
negative! This allows us to leave the split sizes constant, have
their children inherit the "actual" split sizes, but keep the
home stack unchanging in its minimized size. We just adjust the crop
negative to reveal it.

IME handling is done through the same mechanism as app-driven IME
animation... only Divider receives the control instead of the app.
This allows synchronized animation of split tasks with IME. To
account for insets, though, when IME is opened, the bottom stack
will be repositioned in WM.

Bug: 133381284
Test: Manual, use split-screen, rotate device, launch unresizable
      apps in split, use divider snap to close/maximize apps, etc.
Change-Id: I103f68030a170e2fd3d8f2125b81cf33af412793
2020-02-14 09:25:43 -08:00
Winson Chung
40f22d9551 Add compat call for getting the rotation from the window config
Bug: 143892437
Change-Id: Ide2fbf89cbe25f60c7811480fcc476017d73c851
2020-02-11 16:03:41 -08:00
Dave Mankoff
c2d21367f3 Report a CrashWhilePluginActiveException only if plugin disabled.
Prior to this change, if a plugin was active, we reported a
CrashWhilePluginActiveException even if that plugin was whitelisted.

Now we only report the exception if we actually disabled an exception.

Bug: 149109460
Test: atest SystemUITests
Change-Id: Ibf26d587a09a859f79bfda5ee083d4af93236f55
2020-02-07 17:31:42 -05:00
Winson Chung
68eda4408d Inline framework class that isn't visible via the shared lib
Bug: 144854916
Test: Make shared lib and ensure ag/10217912 builds
Change-Id: I110834d24c6f08299050e925bef9a4e738d700ac
2020-01-31 22:20:22 +00:00
Winson Chung
9f982f5604 Merge "Removing some unused classes" 2020-01-30 20:03:43 +00:00
Sunny Goyal
a34e04bb16 Removing some unused classes
Test: Everything builds
Change-Id: I92f630b12d2247ad8cf29bb5e2a4c190aa27bced
2020-01-29 16:10:02 -08:00
Winson Chung
a657ac9ca5 Add initial SysUI trace support
Bug: 144854916
Test: Take a sysui trace
Change-Id: Ia8a87c8c6756ecbb77beb06a60d5b46b883ed8d9
t stat
2020-01-27 10:06:03 -08:00
Vinit Nayak
b320cbccf6 Merge "Add rotation field to ThumbnailData for task snapshots" 2020-01-24 21:24:24 +00:00
Zak Cohen
43d858805b Merge "Screenshot helper - add method that allows the caller to supply bitmap." 2020-01-24 03:57:54 +00:00
Vinit Nayak
ffd9dff181 Add rotation field to ThumbnailData for task snapshots
Add the rotation a task was in when its snapshot
is taken. This is used by launcher to know which
way to orient the bitmap when performing quickswitch

fixes: 143892437
Test: Test: With launcher in portrait
* Thumbnail in reverse portrait,
landscape, seascape, normal
With launcher in landscape
* Thumbnail in seascape, normal,
reverse portrait, landscape
With launcher in seascape
* Thumbnail in seascape, normal,
reverse portrait, landscape

Change-Id: Iaf32341d0db1fc023c29676e0d365eee03b98959
2020-01-23 15:12:32 -08:00
Zak Cohen
ebd3b8b1e9 Screenshot helper - add method that allows the caller to supply bitmap.
Add a method to screenshot helper that allows the caller to provide the
bitmap to be treated as a screen shot.
First use Overview can provide a task snapshot to use as a screenshot.

Test: update tests, local
Bug: 145297320

Change-Id: I4d21906212797bf394094d7a29208be02a6bfd7e
2020-01-23 14:59:31 -08:00
Robert Carr
87f5d2cb78 Unhide SurfaceControlViewHost API
Unhide the SurfaceControlViewHost API and the getHostToken/setChildSurfacePackage
API's required to use them.

Bug: 134365580
Bug: 140587144
Test: WindowlessWmTests
Change-Id: I0c5af2166f1d87947f54a492fd0b887c6253b9fe
2020-01-22 12:54:06 -08:00
Muhammad Qureshi
3ab2065deb Merge "Add sysui module for logging SystemUI atoms." 2020-01-21 21:22:14 +00:00
Andy Wickham
e47e006283 Adds UniversalSmartspaceUtils to be shared between Launcher and SysUI.
Some initial helper methods include ones to build the intent for
Launcher to send its SurfaceView to SysUI, and for SysUI to
retrieve the necessary components (SurfaceControl and InputToken).

Test: Builds; used new method in Launcher.
Bug: 141701658
Change-Id: Ic89a15f20f89f0b90041afc72c349d524d2ad439
2020-01-17 14:07:04 -08:00
Muhammad Qureshi
9bced7d7de Add sysui module for logging SystemUI atoms.
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by *StatsLog.java
that is autogenerated for each module.
This CL adds autogenerated SysUiStatsLog to SystemUI and replaces usages
of StatsLog with SysUiStatsLog.
Since the write calls in SysUiStatsLog are public, StatsLogCompat is no
longer needed.

Bug: 145952197
Test: m
Test: fastboot flashall
Test: adb shell cmd stats print-logs && adb logcat "*:S statsd:*"
Change-Id: I192ff29d21cedbe715bb02ffa05921b4912af371
2020-01-17 10:41:05 -08:00
Wale Ogunwale
194435b5a2 Introduce WINDOWING_MODE_MULTI_WINDOW
Generic multi-window with no presentation attribution from the wm-core.
Needed for wm-shell to correctly drive multi-window cases like Bubbles
and n-way-split.
Current windowing modes split and freeform will probably be migrated to
this once wm-shell drives their presentation.

Test: N/A
Bug: 139371701
Change-Id: I5247f41b4f67d21b2bb5929a52e8ec93c41644c2
2019-12-26 12:56:09 -08:00
Winson Chung
10fc25dadd Clean up remote animation definitions when activity is destroyed
- Remove the remote animation definition when the associated process dies
- Also expose method to unregister any registered animation defs

Bug: 139137636
Test: Kill launcher, ensure the remote animation ref is removed
Change-Id: Ia38d037397703221c17c8258ec1a245055d5896d
2019-12-19 15:01:50 -08:00
chaviw
4ce1ddff79 Added WindowMagnification for Accessibility in System UI
Added support for window magnification as an accessibility feature. The
UI can either be dragged to a new a location or arrow controls can move
the window around.

Test: adb shell settings put secure window_magnification 1
Bug: 136250281
Change-Id: If3098df098f2a1b88b2170e773dccc8f86946abf
2019-12-16 13:49:53 -08:00
Riddle Hsu
440f88b43a Add task snapshot for home task
The real home activity usually takes longer time than a
snapshot to complete drawing. Especially when unlocking
to home, the duration becomes more noticeable.

This CL enables snapshot of home task when turning screen
off. And because the snapshot is only used when entering
home from a sleeping state, the snapshot will be removed
once it is used.

Also provide a method for home activity to remove its
snapshot while the content of home activity has significant
change after taking the snapshot.

Bug: 140811348
Test: 1. Set an unlock method that doesn't need to show
         lockscreen when unlocking.
      2. Turn off screen while home is on top.
      3. Unlock device to enter home.
      4. Check the duration of trace "screenTurningOn".

Change-Id: Ic516cdcfd84ca4a85e19798537f9f5a85077392b
2019-12-13 16:59:52 +08:00
Winson Chung
88eff82e04 Add compat call to fetch icon from task description with user
Bug: 145708947
Test: Manual
Change-Id: I7895a5acb71813960aa2658f1bd2b62a7326a37f
2019-12-09 11:09:17 -08:00
jorgegil@google.com
62f735e0f6 Persist PiP size to be restored on re-entry
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
2019-11-20 15:46:07 -08:00
Winson Chung
0c7f966aa9 Merge "Clear temp list after call" 2019-11-05 20:20:40 +00:00
Winson Chung
17f6ca12ff Clear temp list after call
- Also make sure to synchronize when adding/removing from the listener list

Bug: 139137636
Change-Id: I8085c93ddc4a194ea2c4faba245dd3ab2f323f88
2019-11-04 16:49:24 -08:00
Yunfan Chen
1abb683a66 Notify task description change to system UI (4/N)
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
2019-10-30 11:45:57 -07:00
TreeHugger Robot
48ed040e68 Merge "Adds CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY to ActivityManagerWrapper." 2019-10-24 01:31:46 +00:00
Andy Wickham
709825dfe1 Adds CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY to ActivityManagerWrapper.
Test: N/A
Change-Id: I7fa0389c09d949a6297c8a04dfa2dd6855cc80ed
2019-10-16 15:02:31 -07:00