Commit Graph

893 Commits

Author SHA1 Message Date
Jason Chang
fbb89d8c65 Merge changes from topic "new-ohm-bg-panel"
* changes:
  (2/n) Implement BackgroundWindowManager to manage tutorial background
  (1/n) Phase out FEATURE_ONE_HANDED_BACKGROUND_PANEL
2022-01-12 15:33:21 +00:00
Jason Chang
6d4fc4ca09 (2/n) Implement BackgroundWindowManager to manage tutorial background
Using WindowlessWindowManager for adding a surface wihtout depend on
Window Hierarchy, we just add leash with specific theme color at
bottom z-order while One-handed trigger, and remove it when exited.

Bug: 197165590

Test: manually test One-handed mode basic operations.
Test: atest WMShellUnitTests
Change-Id: Ie53684edd4511719516c00dd64c2dfad360a593b
2022-01-12 11:44:19 +08:00
Jason Chang
f25e1e90c2 (1/n) Phase out FEATURE_ONE_HANDED_BACKGROUND_PANEL
Remove DisplayArea feature FEATURE_ONE_HANDED_BACKGROUND_PANEL
We are going implement One handed panel throught
WindowlessWindow mechanism instead.

Bug: 197165590

Test: manually test One-handed mode basic operations.
Test: atest WMShellUnitTests
Change-Id: I3ba106a266e69bf61cdd43c0043852eed14dc365
2022-01-11 23:57:53 +08:00
Chris Li
b258c0fd58 Merge "Fix ExitPipWithDismissButtonTest with Shell transition" 2022-01-11 02:30:08 +00:00
Chris Li
9131c6a128 Merge "Fix WallpaperWindowToken visible update with Shell transition" 2022-01-11 02:29:29 +00:00
Chris Li
2490b439d0 Fix ExitPipWithDismissButtonTest with Shell transition
Fix: 210965692
Test: atest WMShellFlickerTests:ExitPipWithDismissButtonTest
Change-Id: I828095f55e7400b661513b853372a3bef5466663
2022-01-09 22:59:36 +08:00
Chris Li
c8a3d88def Fix WallpaperWindowToken visible update with Shell transition
With Shell transition, when mVisibleRequested is changed, it will wait
until the transition finish to update the isVisible(). As a result, if
there is a visible change before the previous transition is finished,
it will be skipped.

For example, when we first open a fullscreen app and then immediately
enter pip:
1. TRANSIT_OPEN will call to hide wallpaper and set mVisibleRequest to
false, but not commit visible until transition animation is finished.
2. TRANSIT_PIP will call to show wallpaper, but if it is started before
the OPEN transition is finsihed, it will not update the wallpaper
mVisibleRequested, which will leave the wallpaper hidden.

Fix: 210965575
Bug: 210965692
Test: atest WMShellFlickerTests:ExpandPipOnDoubleClickTest
Change-Id: I2578aafd024a3c9a6ec96079d4dc6cb740c890d2
2022-01-09 19:35:16 +08:00
Nataniel Borges
dd1d5b61b1 Set cutout mode to shortEdges on flicker
Use short edges on the flicker tests so that the test apps cover the full screen in both raven and in flame devices. With default cutout, some assertions will need to be updated to consider the letterbox layers, as well as app windows not covering the entire display

Bug: 209935473
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Iaeabe2033adc2890605bbef7bce139569f402c4b
2022-01-07 16:22:46 +01:00
Chris Li
6ecdc3894b Merge "Fix SetRequestedOrientationWhilePinnedTest with Shell transition" 2022-01-07 02:06:10 +00:00
Chris Li
85e4cc2e6e Fix SetRequestedOrientationWhilePinnedTest with Shell transition
Fix: 210965919
Test: atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest
Change-Id: Ib59300e1d3af8fbcc02a5a85964a1d2ffdaaaf4f
2022-01-06 19:53:06 +08:00
Bill Lin
40fa9bf6fb 2/ Instrument jank of One-handed mode trigger and exit transition
Add 2 CUJs for one handed mode transition
1. ONE_HANDED_ENTER_TRANSITION
2. ONE_HANDED_EXIT_TRANSITION

- [STATE_ENTERING] Detect swipe down gesture: Begin of enter CUJ
- [STATE_ENTERING] Tap shortcut to trigger: Begin of enter CUJ
- [STATE_ACTIVE] Transition end of enter: End of enter CUJ
- [STATE_EXITING] Detect swipe up gesture: Begin of exit CUJ
- [STATE_EXITING] Tap shortcut to exit: Begin of exit CUJ
- [STATE_NONE] Transition end of exit: End of exit CUJ

Test: see trace in comment
Bug: 201032904
Change-Id: I29258a1bbbe567c935d467621a85fbdfe2397d54
2022-01-05 13:31:02 +08:00
Bill Lin
a40be42069 Merge "Refresh display bounds when display layout updated" 2022-01-05 00:09:29 +00:00
Nataniel Borges
57d1c8b1aa Merge "Update tests to reflect region based assertion changes" 2022-01-04 09:25:31 +00:00
Bill Lin
630f3af989 Refresh display bounds when display layout updated
Previoulsy mDefaultDisplayBounds & mLastVisualDisplayBounds are
incorrect after device reboot without re-register DisplayAreaOrganizer.
Then the bounds does not set correctly for transition.
When AnimationController#getAnimator() get incorrect display bounds,
either surface bounds or rounded corner does not crop correctly.

Test: manual enable OHM, reboot device and trigger
     (Bounds/Rounded corner should works when trigger)
Test: atest WMShellUnitTests
Bug: 212651010
Change-Id: Ib30edf6ecc2244f7fec7e233b0fb048d5ee40f3c
2021-12-30 16:47:36 +08:00
Chris Li
67f1f5abe6 Merge "Set PIP corner radius after rotation" 2021-12-26 07:59:37 +00:00
Chris Li
76e0ddc048 Set PIP corner radius after rotation
When there is screen rotation, we need to set the corner radius and
window crop in both start and finish transaction to avoid janky
animation.

Fix: 210965679
Test: atest WMShellFlickerTests:PipRotationTest
Change-Id: I03d1c3c4e39ea55dd4cc3f43b1170cfd6fe88cfa
2021-12-24 12:15:26 +08:00
Pablo Gamito
793153795a Update tests to reflect region based assertion changes
Bug: 204894659
Test: atest FlickerTests WMShellFlickerTests FlickerLibTest
Change-Id: Ib82953da0f52953046cf2d5f717c9dc11f221a93
2021-12-23 18:48:07 +01:00
Nataniel Borges
43eb55e5d1 Merge "Add support to newer devices on flicker tests" 2021-12-23 13:49:44 +00:00
Nataniel Borges
b876fb200d Add support to newer devices on flicker tests
Some of the assertions used in flicker worked in older devices but not on newer ones.

Disable these assertions and make flicker tests compatible with notch to run on newer devices

Bug: 206753786
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Idf889506d767c4743938ee6727cd228b29873e66
2021-12-22 12:04:44 +01:00
Chris Li
52e1f36763 Merge "Set PIP corner radius when enter" 2021-12-20 12:37:08 +00:00
Tony Huang
36b5dd8b5f Handle split rotation in rotation callback
By current split design, we always update bounds and apply WCT on
DA info changed callback. However, with shell transition, we should
avoid apply WCT while transition running.

Add display rotation callback we used in legacy split to new split
and apply bounds on such callback. This can ensure that WCT sync to
running rotation transition.

Bug: 206872147
Test: manual
Test: pass existing tests
Change-Id: I358a00ab6ecfb56ececcc93204a78366c48cabda
2021-12-20 17:33:45 +08:00
Chris Li
862c4118d4 Set PIP corner radius when enter
Before, it didn't set the corner radius on the finish transition, so the
corner radius is set to 0 when finished.

Bug: 210965679
Test: atest WMShellFlickerTests:PipRotationTest
Change-Id: I7a3c478ef36a4bb730f2153d6b2487a41a469545
2021-12-20 15:13:45 +08:00
Mariia Sandrikova
d77c92a3f1 Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3 am: 02a17e7b1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: Ic9916a3883eef0148a86c86149aa2e883fc56d1b
2021-12-18 22:19:12 +00:00
Mariia Sandrikova
02a17e7b1f Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: I1e56abcef9715a3dd6a00d70cb815c4d9260175a
2021-12-18 21:59:31 +00:00
Mariia Sandrikova
3486eacda3 Merge changes from topic "camera-compat" into sc-v2-dev
* changes:
  [3/n] Camera Compat UI: Add a camera compat control.
  [2/n] Camera Compat UI: Add interfaces for client-server communication.
2021-12-18 21:39:13 +00:00
Mariia Sandrikova
13e80fd997 [3/n] Camera Compat UI: Add a camera compat control.
Test: atest WMShellUnitTests
Bug: 206602997
Change-Id: Id9b9a89303387c4ac797fc1382967151a13d38ef
2021-12-17 00:20:19 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
Jerry Chang
fdf92de82a Merge "Integrate RecetsTaskController with shell-transition" 2021-12-16 09:01:25 +00:00
Mady Mellor
b6d0f141fd Merge "Fix a potential NPE" into sc-v2-dev am: 4b3ea38f9b am: 6f120287c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16470586

Change-Id: I27362b4a9b9698f2e1d4ba87ce941050b3e43dd9
2021-12-15 18:21:55 +00:00
Mady Mellor
6f120287c9 Merge "Fix a potential NPE" into sc-v2-dev am: 4b3ea38f9b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16470586

Change-Id: Iac4afaa1caaf0969346e2c2ada0445a7dbc74be7
2021-12-15 18:21:15 +00:00
Mady Mellor
4b3ea38f9b Merge "Fix a potential NPE" into sc-v2-dev 2021-12-15 18:09:31 +00:00
Jerry Chang
7eccf61dcd Integrate RecetsTaskController with shell-transition
Hook up RecentsTaskController with split screen when enabled
shell-transition. Bundle exit reason and dismiss transition together in
order to log and determine whether the dismiss should break recorded
app-pair in recents or not.

When dismissing split screen with shell-transition, it'll reparent child
tasks out of split screen before they committed invisible, so rely on
fullscreen task opening signal to update app-pair information instead
of relying on visible task appeared or changed in
FullscreenTaskListener.

Bug: 206487881
Test: atest SplitTransitionTests
Test: dump and observe recorded split pair in RecentsTaskController
Change-Id: I109d7b3b2eab2b4f691e85a2afd052f56b1a9bca
2021-12-15 03:39:23 +00:00
Jerry Chang
1b560d8747 Integrate launch-to-side split transition to shell transition
Integrate launch-to-side split transition to shell transition.
Because there is no guarantee for launching activity to split
successfully before actually launching it, trigger enter split
transition after observed new task launching into split.

Bug: 206487881
Test: atest SplitTransitionTests
Test: drag to enter split with shell transition works
Change-Id: Idda7c3b02689753cea1a1fe80264145f1a449f73
2021-12-15 00:52:43 +00:00
Mady Mellor
447e4f16e2 Fix a potential NPE
I've never been able to reproduce this and the stack traces I have
of it don't match existing code, but looking at the code paths I think
this could still happen, there are a couple of places where the
mMagnetizedBubbleDraggingOut gets nulled out (e.g. on child removed)
I've tried to repro by:
 - canceling the bubbles in the middle of dragging to dismiss
 - trying to snap the bubble back and then drag it again to dismiss
   (snap back also nulls it)

I see a recent stack of it in pitot so I think it's worth adding the
null check.

Test: atest ExpandedAnimationControllerTest
Bug: 201866808
Change-Id: Ib9425a2b63410c95fddaaea59761dfd18557ed54
2021-12-14 15:21:41 -08:00
Ben Lin
f591b7ae3c Merge "Update PiP exclusion bounds in TaskBarDelegate." into sc-v2-dev am: c34133ad93 am: 0ec1299cf7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16434534

Change-Id: Id218d01be8e6f2faba1653f0e5c537f666831d36
2021-12-14 21:15:10 +00:00
Ben Lin
0ec1299cf7 Merge "Update PiP exclusion bounds in TaskBarDelegate." into sc-v2-dev am: c34133ad93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16434534

Change-Id: Ibc6f0eb3c87274aa7bd72e6ba0c104792b3b0447
2021-12-14 21:13:06 +00:00
Ben Lin
c34133ad93 Merge "Update PiP exclusion bounds in TaskBarDelegate." into sc-v2-dev 2021-12-14 20:49:06 +00:00
TreeHugger Robot
772f18a1b6 Merge "Disable failing shell transition tests" 2021-12-14 18:58:19 +00:00
Ben Lin
82865fe924 Update PiP exclusion bounds in TaskBarDelegate.
Navigation bar is only created and used when taskbar is not available.
When taskbar is available, we will use TaskbarDelegate to be the one
responsible to update pip exclusion bounds as PiP moves.

Bug: 210038947
Test: Unfold, enter PiP, stash - PiP can be yanked out
Change-Id: I8f789d3b603e41c3d15494afdadce2cddc4d4b9c
2021-12-14 10:35:50 -08:00
Sergey Serokurov
ddae9c92a2 Merge "Do not show overflow after the last bubble dismissed (revised)" 2021-12-14 17:00:20 +00:00
Nataniel Borges
306ef506b3 Disable failing shell transition tests
Some tests are failing when using shell transition.

Disable the tests that currently fail so that we can move some shell assertions into presubmit

Test: atest FlickerTests WMShellFlickerTests
Change-Id: If86fb6b053a384050aa533d2ebb45031c1acdf70
2021-12-14 14:04:44 +01:00
Jerry Chang
fa82eafc1e Merge "Indicate whether to apply layout change when setting divide position" 2021-12-14 04:18:55 +00:00
Mady Mellor
3f40ec342b Merge "Mark bubbles as updated when they're added to the stack" into sc-v2-dev am: 6b1abd9b68 am: 8834b96d87
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16374106

Change-Id: I217f3b55666f3b1f21ad12fa5081d44bea60162b
2021-12-14 02:05:44 +00:00
Mady Mellor
8834b96d87 Merge "Mark bubbles as updated when they're added to the stack" into sc-v2-dev am: 6b1abd9b68
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16374106

Change-Id: Ib5c93cd4710eeace2f0c54157f9052f5e182455c
2021-12-14 01:47:30 +00:00
Mady Mellor
6b1abd9b68 Merge "Mark bubbles as updated when they're added to the stack" into sc-v2-dev 2021-12-14 01:16:23 +00:00
Sergey Serokurov
97aa9b0ec1 Do not show overflow after the last bubble dismissed (revised)
Bug: 202742002
Test: atest SystemUITests
Test: screen recording before https://drive.google.com/file/d/1KOHZnsW4BAn73slH54Rp1ZK0RXxumrw5/view?usp=sharing
Test: screen recoring after https://drive.google.com/file/d/1tC6iIP2fG84pHcwoyJsySDUm9ciSzjRI/view?usp=sharing
Change-Id: Ib5e36e5abb9f4e6adb441f38f1d66dbf7f73a1f0
2021-12-13 09:07:11 -08:00
Mariia Sandrikova
ef1f033720 Merge "[1/n] Camera Compat UI: Refactor size compat mode UI controller." into sc-v2-dev am: aa7a8cdda5 am: 6863643cda
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16420818

Change-Id: I63c10a663aea9471594af90d1c59c57f8bef1e1c
2021-12-12 17:15:30 +00:00
Mariia Sandrikova
6863643cda Merge "[1/n] Camera Compat UI: Refactor size compat mode UI controller." into sc-v2-dev am: aa7a8cdda5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16420818

Change-Id: Id8ebd3b2a6e7bff738bb8d2d5fd8e17cd6b1c4bd
2021-12-12 17:00:08 +00:00
Mariia Sandrikova
6dd79270b0 [1/n] Camera Compat UI: Refactor size compat mode UI controller.
First CL in the chain that will add a camera compat UI control which will be used to correct stretched issues in TextureView and SurfaceView cause by apps not handling mismatch between camera buffers and view size correctly.

This change is necessary because right now there are 2 instances of WindowlessWindowManager (SizeCompatUIWindowManager) in SizeCompatUILayout: for a hint and for a restart button. They are also positioned relatively by computing offsets in java code rather than by specifying layout with XML. This code structure will cause issues since with upcoming camera changes there will be a need to coordinate relative position of 4 UI elements (2 buttons and 2 hints).

What is changing in this CL:
- Majority of changes are simple renaming from "size compat UI" to "compat UI" since, starting from the next change, two different compat controls will be supported.
- Merging 2 instances of SizeCompatUIWindowManager into one (CompatUIWindowManager) and for that create a joint layout in compat_ui_layout.xml
- Merge SizeCompatLayout logic into CompatUIWindowManager since in absence of 2 instances of WindowlessWindowManager there is no good reason to keep them separate.
- Merging and renaming tests to follow refactoring of the implementation.

Test: atest WMShellUnitTests (the same set of tests should be sufficient since this refactoring just reorganized the structure of the implementation)
Bug: 206602997
Change-Id: I7141c69b7ba4742c5b7b2018329b91a1b37b45bc
2021-12-11 13:00:23 +00:00
Jerry Chang
d3872acc57 Indicate whether to apply layout change when setting divide position
To prevent it conflicting with shell transition when entering split, we
don't want to apply layout change when setting up divide position. Add a
boolean parameter to indicate whether to apply layout change or not for
setDividePosition.

Bug: 206487881
Bug: 208954095
Test: Trigger split screen, snap divider to non-middle position and
      observed no crash after dismissed and re-entered split screen.
Change-Id: I91ba735ade538e1bb3d5a5eba0c782c4456e1746
2021-12-10 04:03:27 +00:00