[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
Loading
Please register or sign in to comment