Commit Graph

3766 Commits

Author SHA1 Message Date
TreeHugger Robot
68e3f55c66 Merge "Fix wait condition for SetRequestedOrientationWhilePinnedTest" into tm-dev 2022-02-24 14:45:55 +00:00
Kholoud Mohamed
c099351d94 Merge "Change DEVICE_POLICY_RESOURCE_UPDATED broadcast extras" into tm-dev 2022-02-24 13:11:00 +00:00
Nataniel Borges
e74d47839a Fix wait condition for SetRequestedOrientationWhilePinnedTest
The setup waited for a ROTATION_0, but this test starts at ROTATION_90

Bug: 219773854
Bug: 220977327
Test: atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest
Change-Id: Ib2bde1f66f248adbe69acf5c344322e32b364eb2
2022-02-24 11:24:20 +01:00
Mady Mellor
cdc7d70d4f Merge "Only collapse bubbles when its from gesture nav" into tm-dev 2022-02-24 01:30:11 +00:00
Chris Li
1e9ff8eea6 Merge "Fix SetRequestedOrientationWhilePinnedTest with Shell transition" into tm-dev 2022-02-24 00:59:34 +00:00
Mateusz Cicheński
429c0a9769 Merge "Moving the resources related to PiP to the WindowManager/Shell." into tm-dev 2022-02-23 19:49:36 +00:00
Mady Mellor
ba688138fb Merge changes from topic "floating_dismiss" into tm-dev
* changes:
  Update PIP dismiss to use DismissView
  Update dismiss to new spec
2022-02-23 18:12:07 +00:00
Mady Mellor
014c25967b Merge "Adjustments to expanded view size and position" into tm-dev 2022-02-23 18:11:27 +00:00
kholoud mohamed
1b6b9dfeb8 Change DEVICE_POLICY_RESOURCE_UPDATED broadcast extras
Changed the resource type extra to be an int value to indicate the
resource type instead of having individual boolean extras for each
resource type.

Bug: 218875965
Test: N/A
Change-Id: Ic734c4d0e0a769dd981ef214e1be41f62d74705c
2022-02-23 14:10:09 +00:00
Nataniel Borges
7f7b20e086 Merge "Crash test when wait condition not met" into tm-dev 2022-02-23 11:16:52 +00:00
Chris Li
7404ff1182 Fix SetRequestedOrientationWhilePinnedTest with Shell transition
When the windowing mode is changed during fixed rotation, we don't want
to animate to the fixed rotation anymore, because the fixed rotation
will be cancelled later.

Bug: 214324061
Test: atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTest
Change-Id: I24b5389ec2b6ea28ce3ba7abf38fbd269566edf3
2022-02-23 14:50:01 +08:00
TreeHugger Robot
b031e08104 Merge "TvPiP: Move focus changes to pip controller" into tm-dev 2022-02-23 02:49:58 +00:00
Jerry Chang
24d954694a Merge "Fix extra offset of the split layout" into tm-dev 2022-02-23 02:06:18 +00:00
Chris Li
4556314a64 Merge "Exit PIP with fixed rotation with Shell transition" into tm-dev 2022-02-23 01:52:19 +00:00
Mady Mellor
a62aa184f7 Update PIP dismiss to use DismissView
All the values / things being done in PIP are exactly the same as what
DismissView does. This change updates PIP to use DismissView directly
so PIP will always pick up visual changes to dismiss without having
to copy them over manually.

Test: manual - have a PIP, drag it around and observe dismiss, drag
               PIP to dismiss, observe
Bug: 217211205
Change-Id: I430df28bdb7980ff5a0316c4aab728fe54e95e6b
2022-02-22 14:21:14 -08:00
Mady Mellor
953a9e14c7 Update dismiss to new spec
1 - larger gradient (same for both phone & tablet)
2 - gradient is now based on theme color

Test: manual - have a bubble, drag to dismiss it, observe the gradient
Bug: 217211205
Change-Id: Ibef23992089f0ae33dd93f9528a3ea2887aae465
2022-02-22 14:16:48 -08:00
Mady Mellor
9294a41db2 Adjustments to expanded view size and position
* Previously on large screens the expanded view was centered on the
  screen now it will be anchored to whichever edge it was expanded on
  ONLY when in landscape on a large large screen. In portrait, and on
  "small tablets" it will continue to be centered.
* Updates the width of the expanded view on portrait and on landscape
  for large screens.
* Adds the notion of small tablet

Test: manual - Open a bubble in various configurations:
      1) on phone:
        * landscape => bubbles show vertically on the side they were
          expanded on and expanded view is centered horizontally
        * portrait => bubbles show on top, expanded view centered
          horizontally
      2) on tablet that isn't small:
        * landscape => bubbles show vertically on the side they were
          expanded on and the expanded view is anchored to that edge
          with some padding
        * portrait => bubbles show vertically on the side they were
          expanded on and expanded view is centered horizontally
      3) on small tablet:
        * portrait & landscape => bubbles show vertically on the side
          they were expanded on and the expanded view is centered
          horizontally and takes up more space %-wise compared to a
          large tablet
Bug: 217211205
Change-Id: I7259e03aab35e0039c9b7bd855c12afe38373ace
2022-02-22 14:04:12 -08:00
Vishnu Nair
536c088165 TvPiP: Move focus changes to pip controller
Align with phone pip focus implementation.

Test: steps in b/218436735
Bug: 218436735
Change-Id: I54bf5d9b193a6cbb41f934f6831c2bdcd5b11472
2022-02-22 17:45:57 +00:00
Nataniel Borges
798fe83b4b Crash test when wait condition not met
This makes triaging issues unrelated to the test (e.g., transition crash) easier since all failing assertions are clustered with the same stack trace

Bug: 219773854
Test: atest FlickerTests WMShellFlickerTests
Change-Id: I65bb1b5e87997c856ce080b24d549ba1c978955a
Merged-In: I65bb1b5e87997c856ce080b24d549ba1c978955a
2022-02-22 14:23:34 +00:00
Jerry Chang
a57326c97f Fix extra offset of the split layout
Use parent based coordinate instead of screen based coordinate when
indicating split surfaces' position so they won't be offset unexpectedly
when its parent is not at (0, 0).

Fix: 210696145
Test: check split UI when enabled "render apps below cutout area"
Change-Id: I65399f5ef2975e7ef376d161c41de2cfb7ed29dc
2022-02-22 03:27:10 +00:00
Chris Li
7256d26666 Exit PIP with fixed rotation with Shell transition
Bug: 219411429
Test: manual test enter PIP from different orientation
Change-Id: I1e8ea73fb7800cee4255f2eaefcd212024345351
2022-02-22 11:19:07 +08:00
Chris Li
4f18233f31 Merge "Fix ExitPipWithDismissButtonTest#focusDoesNotChange" into tm-dev 2022-02-21 15:52:03 +00:00
Robert Horvath
b987e545f0 Merge "Set TvPipController's state only when PiP finished appearing" into tm-dev 2022-02-21 13:46:15 +00:00
Chris Li
02c59f009b Fix ExitPipWithDismissButtonTest#focusDoesNotChange
The transition is to click on the pip menu, then click on the dismiss
button. This will cause the focus change.

Fix: 215869110
Fix: 216306753
Test: atest WMShellFlickerTests:ExitPipWithDismissButtonTest
Change-Id: I50dab84f588c3bedaa7d65c02144054d4eefdcd5
2022-02-21 05:29:51 +00:00
Winson Chung
93f75de6dd Couple fixes for drag and drop
- Add simple fade of the drag surface when dropping and when canceling a
  drag from the shade (since the shade has closed, the default animation
  of animating to the start position is wrong)
- Add case for dragging over home/recents, show the highlighted drop zone
  as fullscreen since there is nothing to split with
- Fix issue with drag listener not being removed after a notification
  drag
- For now, add a toast when attempting to drag a notification that does
  not have a valid intent
- Also don't wait for DRAG_START to start collapsing the shade if the
  call to startDrag() returns true

Bug: 217972792
Bug: 218791595
Bug: 219757067
Test: atest WMShellUnitTests
Test: atest SystemUITests

Change-Id: Ic53de0d8a999d4ae39dc207bfc2927466ad2ba7c
2022-02-18 23:05:51 +00:00
Mateusz Cicheński
6990ff032c Moving the resources related to PiP to the WindowManager/Shell.
Test: Test: atest WMShellUnitTests:PipBoundsAlgorithmTest
Bug: 218653892
Change-Id: Ieeff465e04cbd1bfc3ddfc47f38e11eefa9e798d
2022-02-18 19:02:26 +00:00
Mady Mellor
f274b012d3 Only collapse bubbles when its from gesture nav
Test: atest BubblesTest NewNotifPipelineBubblesTest
Test: manual - force notification permission dialog to always show
             - open a bubble
             => it doesn't immediately collapse
             - swipe up on gesture nav
             => the bubble collapses
Bug: 218517365
Change-Id: I4271b955cac51b85e0d92e738fa2d0e38afeb154
2022-02-18 18:33:07 +00:00
Robert Horvath
ea6cf56ecc Set TvPipController's state only when PiP finished appearing
When asking PipTaskOrganizer to animate the PiP to a different position
while it's still in the appearing transition, the PiP could get stuck in
a bad state where the PiP contents and menu items weren't drawn.
This change avoids this by only calling #scheduleAnimateResizePip once
the PiP has finished appearing.

Test: manual
Bug: 220110011
Change-Id: Ie62adea6f2cb5a4abdd6c4b8f9ff23c040077046
2022-02-18 13:46:54 +01:00
Tom Natan
0a8e38d541 Merge "[14/n] Letterbox Education: Add tests for WM shell code." 2022-02-17 18:58:38 +00:00
tomnatan
c295edad0b [14/n] Letterbox Education: Add tests for WM shell code.
In addition, this CL does additional polishing to the code itself.

Bug: 215316431
Test: atest WMShellUnitTests:LetterboxEduDialogLayoutTest
Test: atest WMShellUnitTests:LetterboxEduWindowManagerTest
Test: atest WMShellUnitTests:CompatUIControllerTest
Change-Id: I3cb58f89a52f0d427545e3959dd9082e8b8b5cc7
2022-02-17 16:53:38 +00:00
Shan Huang
de1f7dd510 Merge "Remove the back_predictability sysprop flag." 2022-02-17 15:12:12 +00:00
Tom Natan
0711bba4f2 Merge "Mark compat UI hints as shown only if they are actually shown" 2022-02-17 13:36:33 +00:00
tomnatan
dbd6428150 Mark compat UI hints as shown only if they are actually shown
Fix: 218304113
Test: atest WMShellUnitTests:CompatUIWindowManagerTest
Change-Id: Ie6e0b76b1e0d6744a5f397521ba1da7100b6a1c4
2022-02-17 11:50:55 +00:00
Pablo Gamito
3d6d75b455 Merge changes Icf637f09,Ibae3c102,I9758fc10,Ic4a53d96
* changes:
  Extract out rotationLayerAppearsAndVanishes assertions
  Demote flaky transitions
  Update FlakyTest annotation to correct package
  Remove redundant tests
2022-02-17 11:20:22 +00:00
TreeHugger Robot
8dc59320da Merge "Disable async trace" 2022-02-17 10:40:02 +00:00
TreeHugger Robot
4139bc10a8 Merge "Move wm component initialization to shell main thread" 2022-02-17 07:26:37 +00:00
Chris Li
539e1349e8 Merge "Fixed rotation for entering PIP with Shell transition" 2022-02-17 06:34:16 +00:00
Winson Chung
cae66a132c Move wm component initialization to shell main thread
- Previously, mWMComponent.init() would make a blocking call to WMShell
  to initialize on the shell main thread.  We're expanding that to
  include the construction of the shell objects as well to provide
  a little more consistency and predictability on the shell side
  (ie. fetching some statics may seem safe, but actually aren't).
  We're continuing to recommending that ctors don't include any
  initialization logic though

Bug: 181979527
Test: Verify with trace that shell init happens on the
      shell main thread
Test: atest SystemUITests
Test: atest WMShellUnitTests

Change-Id: I60559a47e00e91d34be7d4e94f4f3e041fdc590d
Signed-off-by: Winson Chung <winsonc@google.com>
2022-02-17 04:56:03 +00:00
Chris Li
eb8ca0d725 Fixed rotation for entering PIP with Shell transition
Entering PIP rotation with orientation is changed to use fixed rotation,
so we need to update the animation as well.

Will update exiting PIP and swipe to enter in next cl

Bug: 219411429
Test: manual test enter PIP from different orientation
Change-Id: Id30f15c72b7d59ae63012d9f62e829d73ec4f335
2022-02-17 12:01:17 +08:00
Shan Huang
7fc98ba91b Remove the back_predictability sysprop flag.
Test: m -j and testing back behavior throughout the system.
Bug: 19594658
Change-Id: I61ada9866ff760d913ea0d2e245857320372a0a4
2022-02-17 01:01:38 +00:00
TreeHugger Robot
9395860fc1 Merge "Fix NPE with overflow expanded view" 2022-02-17 00:25:18 +00:00
Mady Mellor
87ac02f5fe Fix NPE with overflow expanded view
I made it so that the overflow expanded view could return null and
didn't protect this access of it. Fix is to check if the view is
null before doing something to it.

Test: treehugger
Bug: 219491953
Change-Id: I380584223ad56c754cf59c63e3eb2131c3275154
2022-02-16 14:06:52 -08:00
Hongwei Wang
6b9435a3a6 Merge "Add Content PiP support with launch-into-pip API" 2022-02-16 19:31:34 +00:00
Mady Mellor
f240e0b7c3 Merge "Don't use rotation to determine orientation" 2022-02-16 17:58:34 +00:00
Pablo Gamito
9e9c069e2d Demote flaky transitions
Test: NA
Change-Id: Ibae3c102a953aeb4bbf69b76cf83b540457fb3e9
2022-02-16 17:19:07 +01:00
Pablo Gamito
904c875e23 Update FlakyTest annotation to correct package
Test: atest FlickerTests
Change-Id: I9758fc103e8f35b964883c0aea8c970bb4f3f0c1
2022-02-16 17:18:47 +01:00
Hongwei Wang
544007604f Add Content PiP support with launch-into-pip API
Terms
- Host activity, the activity that the content-pip is originated from.
  There should be some UI affordance on Host activity user can tap to
  enter content-pip
- Container activity, the activity that carries the content from Host
  Activity and transits to PiP mode

Workflow in brief

- Container activity is defined in the same application as Host activity
- A new ActivityOptions#makeLaunchIntoPip API is added, Host activity
  uses this API to construct ActivityOptions to launch the Container
  activity directly into pip mode.
- ActivityStarter sets a reference on Container activity pointing to
  Host activity upon creation and moves the activity to pinned task
- WMShell transits Container activity to pinned mode
- When user taps on `Expand` button in PiP menu, WMShell calls
  WCT#startTask with the task id to bring the Host task to front

Content hand-off

- Since Host activity is the one starts Container activity, it can
  replace its content with some placeholder right after startActivity
- This CL also makes the assumption that Host activity can establish a
  communication channel with the Container activity, such as using the
  ResultReceiver parcelable. Therefore it's out of scope to provide
  extra callback to Host activity on lifecycle events of Container activity.

See also the design doc go/content-pip-v2 and the end-to-end demo in
ApiDemos `App > Activity > Picture in Picture`

Bug: 165793661
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/e9Mp5rvxYBrNOdGSUoSXHO
Test: manual, see Video
Test: atest WmTests:ActivityOptionsTest \
            WmTests:ActivityRecordTests \
            WmTests:ActivityStarterTests \
            PinnedStackTests
Change-Id: I2bebfea8d1930b0b7e495d91cfd5ddc7c347da68
2022-02-15 23:44:42 -08:00
Nataniel Borges
669a1a74c9 Disable async trace
Using compressed trace files speeds up trace collection and the benefits of using async trace fetch become negligible.

To simplify the code, remove the functionality

Bug: 209843622
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Id21d58af5393eb7f364b353db619c55a5a5b616c
2022-02-16 07:14:59 +01:00
Tony Huang
c0c3a0c2ba Merge "Refactor startIntentAndTaskWithLegacyTransition" 2022-02-16 03:45:02 +00:00
Jerry Chang
48045245e9 Merge "Fix dragging the same app over a split app dismisses the split" 2022-02-16 01:02:35 +00:00