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

Commit d43e402d authored by Shawn Lee's avatar Shawn Lee Committed by 0
Browse files

[flexiglass] Relocate call to HeadsUpManager.unpinAll

Adding back in a side effect of HUN snooze that had to be dropped in the initial CL because it was causing a flicker and tracking loss. Now it is called after the touch handoff, and isHeadsUpAnimatingAway is populated correctly.

Bug: 340514839
Test: verified via logging that as a HUN is dragged upwards, HeadsUpManager marks it as unpinned and sets isHeadsUpAnimatingAway as true.
Flag: com.android.systemui.scene_container
Change-Id: I75d98d52fe6b83cf69f299ee6e41f9cfebbc0bce
parent 41bbda58
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@ fun SceneScope.SnoozeableHeadsUpNotificationSpace(

    LaunchedEffect(scrollableState.isScrollInProgress) {
        if (!scrollableState.isScrollInProgress && scrollOffset <= minScrollOffset) {
            viewModel.setHeadsUpAnimatingAway(false)
            viewModel.snoozeHun()
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -3506,7 +3506,7 @@ public class NotificationStackScrollLayout
    // Only when scene container is enabled, mark that we are being dragged so that we start
    // dispatching the rest of the gesture to scene container.
    void startOverscrollAfterExpanding() {
        SceneContainerFlag.isUnexpectedlyInLegacyMode();
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        getExpandHelper().finishExpanding();
        setIsBeingDragged(true);
    }
@@ -3514,7 +3514,7 @@ public class NotificationStackScrollLayout
    // Only when scene container is enabled, mark that we are being dragged so that we start
    // dispatching the rest of the gesture to scene container.
    void startDraggingOnHun() {
        SceneContainerFlag.isUnexpectedlyInLegacyMode();
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        setIsBeingDragged(true);
    }

+1 −0
Original line number Diff line number Diff line
@@ -2013,6 +2013,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
                hunWantsIt = mHeadsUpTouchHelper.onInterceptTouchEvent(ev);
                if (hunWantsIt) {
                    mView.startDraggingOnHun();
                    mHeadsUpManager.unpinAll(true);
                }
            }
            boolean swipeWantsIt = false;
+5 −0
Original line number Diff line number Diff line
@@ -110,6 +110,11 @@ constructor(
        interactor.setScrolledToTop(scrolledToTop)
    }

    /** Sets whether the heads up notification is animating away. */
    fun setHeadsUpAnimatingAway(animatingAway: Boolean) {
        headsUpNotificationInteractor.setHeadsUpAnimatingAway(animatingAway)
    }

    /** Snooze the currently pinned HUN. */
    fun snoozeHun() {
        headsUpNotificationInteractor.snooze()
+0 −1
Original line number Diff line number Diff line
@@ -124,7 +124,6 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
                    mPanel.setHeadsUpDraggingStartingHeight(startHeight);
                    mPanel.startExpand(x, y, true /* startTracking */, startHeight);

                    // TODO(b/340514839): Figure out where to move this side effect in flexiglass
                    if (!SceneContainerFlag.isEnabled()) {
                        // This call needs to be after the expansion start otherwise we will get a
                        // flicker of one frame as it's not expanded yet.