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

Commit 5bab0406 authored by Liana Kazanova's avatar Liana Kazanova Committed by Android (Google) Code Review
Browse files

Revert "NSSL Migration - Animate top padding on shade pulldown"

Revert submission 25203598

Reason for revert: Potential culprit for b/308619701 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted changes: /q/submissionid:25203598

Change-Id: Iabac32d3704d9108720aa006ada652aa12e26568
parent e798aa5c
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -20,7 +20,4 @@ package com.android.systemui.common.shared.model
data class SharedNotificationContainerPosition(
    val top: Float = 0f,
    val bottom: Float = 0f,

    /** Whether any modifications to top/bottom are smoothly animated */
    val animate: Boolean = false,
)
+4 −2
Original line number Diff line number Diff line
@@ -59,8 +59,10 @@ object SharedNotificationContainerBinder {

                launch {
                    viewModel.position.collect {
                        val animate = it.animate || controller.isAddOrRemoveAnimationPending()
                        controller.updateTopPadding(it.top, animate)
                        controller.updateTopPadding(
                            it.top,
                            controller.isAddOrRemoveAnimationPending()
                        )
                    }
                }

+2 −10
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.NotificationStackSizeCalculator
import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor
import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
@@ -119,15 +118,8 @@ constructor(
                    }
                }
            } else {
                interactor.topPosition.sample(shadeInteractor.qsExpansion, ::Pair).map {
                    (top, qsExpansion) ->
                    // When QS expansion > 0, it should directly set the top padding so do not
                    // animate it
                    val animate = qsExpansion == 0f
                    keyguardInteractor.sharedNotificationContainerPosition.value.copy(
                        top = top,
                        animate = animate
                    )
                interactor.topPosition.map { top ->
                    keyguardInteractor.sharedNotificationContainerPosition.value.copy(top = top)
                }
            }
        }
+1 −32
Original line number Diff line number Diff line
@@ -318,26 +318,7 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() {
            sharedNotificationContainerInteractor.setTopPosition(10f)

            assertThat(position)
                .isEqualTo(
                    SharedNotificationContainerPosition(top = 10f, bottom = 0f, animate = true)
                )
        }

    @Test
    fun positionOnQS() =
        testScope.runTest {
            val position by collectLastValue(underTest.position)

            // Start on lockscreen with shade expanded
            showLockscreenWithQSExpanded()

            // When not in split shade
            sharedNotificationContainerInteractor.setTopPosition(10f)

            assertThat(position)
                .isEqualTo(
                    SharedNotificationContainerPosition(top = 10f, bottom = 0f, animate = false)
                )
                .isEqualTo(SharedNotificationContainerPosition(top = 10f, bottom = 0f))
        }

    @Test
@@ -415,18 +396,6 @@ class SharedNotificationContainerViewModelTest : SysuiTestCase() {
        )
    }

    private suspend fun showLockscreenWithQSExpanded() {
        shadeRepository.setLockscreenShadeExpansion(0f)
        shadeRepository.setQsExpansion(1f)
        keyguardRepository.setStatusBarState(StatusBarState.SHADE_LOCKED)
        keyguardTransitionRepository.sendTransitionStep(
            TransitionStep(
                to = KeyguardState.LOCKSCREEN,
                transitionState = TransitionState.FINISHED
            )
        )
    }

    @SysUISingleton
    @Component(
        modules =