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

Commit 5b9b1936 authored by Steve Elliott's avatar Steve Elliott
Browse files

[flexiglass] Disable NSSL height updates for some Lockscreen transitions

Flag: com.android.systemui.scene_container
Fixes: 357651639
Test: verify stack doesn't update when transitioning to
      bouncer/gone from lockscreen
Change-Id: If75ae09e314ab70aab24ffbbbe3e204cd75768cd
parent d8df5cad
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ public class AmbientState implements Dumpable {
     * @param isSwipingUp Whether we are swiping up.
     */
    public void setSwipingUp(boolean isSwipingUp) {
        SceneContainerFlag.assertInLegacyMode();
        if (!isSwipingUp && mIsSwipingUp) {
            // Just stopped swiping up.
            mIsFlingRequiredAfterLockScreenSwipeUp = true;
@@ -240,6 +241,7 @@ public class AmbientState implements Dumpable {
     * @param isFlinging Whether we are flinging the shade open or closed.
     */
    public void setFlinging(boolean isFlinging) {
        SceneContainerFlag.assertInLegacyMode();
        if (isOnKeyguard() && !isFlinging && mIsFlinging) {
            // Just stopped flinging.
            mIsFlingRequiredAfterLockScreenSwipeUp = false;
@@ -695,6 +697,7 @@ public class AmbientState implements Dumpable {
     * @return Whether we need to do a fling down after swiping up on lockscreen.
     */
    public boolean isFlingingAfterSwipeUpOnLockscreen() {
        SceneContainerFlag.assertInLegacyMode();
        return mIsFlinging && mIsFlingRequiredAfterLockScreenSwipeUp;
    }

+15 −3
Original line number Diff line number Diff line
@@ -567,6 +567,7 @@ public class NotificationStackScrollLayout
    private boolean mHasFilteredOutSeenNotifications;
    @Nullable private SplitShadeStateController mSplitShadeStateController = null;
    private boolean mIsSmallLandscapeLockscreenEnabled = false;
    private boolean mSuppressHeightUpdates;

    /** Pass splitShadeStateController to view and update split shade */
    public void passSplitShadeStateController(SplitShadeStateController splitShadeStateController) {
@@ -1453,10 +1454,14 @@ public class NotificationStackScrollLayout
     * 2) Swiping up on lockscreen or flinging down after swipe up
     */
    private boolean shouldSkipHeightUpdate() {
        if (SceneContainerFlag.isEnabled()) {
            return mSuppressHeightUpdates;
        } else {
            return mAmbientState.isOnKeyguard()
                    && (mAmbientState.isSwipingUp()
                    || mAmbientState.isFlingingAfterSwipeUpOnLockscreen());
        }
    }

    /**
     * Apply expansion fraction to the y position and height of the notifications panel.
@@ -5374,6 +5379,7 @@ public class NotificationStackScrollLayout
    }

    public void setPanelFlinging(boolean flinging) {
        SceneContainerFlag.assertInLegacyMode();
        mAmbientState.setFlinging(flinging);
        if (!flinging) {
            // re-calculate the stack height which was frozen while flinging
@@ -5381,6 +5387,12 @@ public class NotificationStackScrollLayout
        }
    }

    @Override
    public void suppressHeightUpdates(boolean suppress) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mSuppressHeightUpdates = suppress;
    }

    public void setHeadsUpGoingAwayAnimationsAllowed(boolean headsUpGoingAwayAnimationsAllowed) {
        mHeadsUpGoingAwayAnimationsAllowed = headsUpGoingAwayAnimationsAllowed;
    }
+1 −0
Original line number Diff line number Diff line
@@ -1439,6 +1439,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
    }

    public void setPanelFlinging(boolean flinging) {
        SceneContainerFlag.assertInLegacyMode();
        mView.setPanelFlinging(flinging);
    }

+3 −0
Original line number Diff line number Diff line
@@ -118,4 +118,7 @@ interface NotificationScrollView {

    /** @see addHeadsUpHeightChangedListener */
    fun removeHeadsUpHeightChangedListener(runnable: Runnable)

    /** Sets whether updates to the stack are are suppressed. */
    fun suppressHeightUpdates(suppress: Boolean)
}
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ constructor(
            launch {
                viewModel.shouldCloseGuts.filter { it }.collect { view.closeGutsOnSceneTouch() }
            }
            launch { viewModel.suppressHeightUpdates.collect { view.suppressHeightUpdates(it) } }

            launchAndDispose {
                view.setSyntheticScrollConsumer(viewModel.syntheticScrollConsumer)
Loading