Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4b095d86 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Screen Chips] Immediately hide chip after stopping via dialog.

When the user taps the screen share chips to open the stop dialog, the
chip gets hidden (`DialogTransitionAnimator` hides it). If the user
chooses to click "Stop" in the dialog, the chip re-shows for a few
frames for two reasons:
1) It takes some time for the system APIs to notify SysUI that the
   screen share has officially stopped.
2) Even if the system API info comes back quickly,
  `DialogTransitionAnimator` immediately re-shows the chip and then
  CollapsedStatusBarFragment keeps the chip view around for a bit so
  that it can nicely animate it away (see b/353249803#comment4).

We should instead immediately hide the chip as soon as the user clicks
"Stop" and not have CollapsedStatusBarFragment animate it so that the
chip doesn't re-show for a few frames.

This CL achieves this by:
1) Creating a `ChipTransitionHelper` class that immediately sets the
   chip model to `Hidden` when the user clicks "Stop".
2) Updating `OngoingActivityChipModel.Hidden` to have a `shouldAnimate`
   boolean, specifying whether CSBF should animate the chip hide or not.
3) Updating `OngoingActivityChipsViewModel` to correctly use the right
   `Hidden` model when transitioning from showing a chip to hiding that
   chip.

Fixes: 350891338
Bug: 353249803
Bug: 332662551

Flag: com.android.systemui.status_bar_screen_sharing_chips

Test: Share to app, click on chip, click stop -> verify chip does not
re-appear for a few frames
Test: Cast to other device, click on chip, click stop -> verify chip
does not re-appear for a few frames
Test: Screen record, click on chip, click stop -> verify chip does not
re-appear for a few frames (in particular, verify the share-to-app chip
doesn't show up ever, to verify b/350891338 is fixed)

Test: Start a call, then start a share. Click on share chip, click stop
-> verify call chip immediately re-appears.

Test: all tests in statusbar.chips package & subpackages
Change-Id: I4ea037436cca7032eebec64b32f617bdb27b5685
parent afa8cc15
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment