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

Commit 859be0cd authored by Shawn Lee's avatar Shawn Lee Committed by Android (Google) Code Review
Browse files

Merge "Set LeaveOpenOnKeyguardHide to false when bouncer is canceled" into 24D1-dev

parents eb6c4d30 823e1dd9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -603,6 +603,7 @@ constructor(
                }
            }
            val cancelHandler = Runnable {
                statusBarStateController.setLeaveOpenOnKeyguardHide(false)
                draggedDownEntry?.apply {
                    setUserLocked(false)
                    notifyHeightChanged(
+14 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.policy.FakeConfigurationController
import com.android.systemui.statusbar.policy.ResourcesSplitShadeStateController
import com.android.systemui.user.domain.UserDomainLayerModule
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.mock
import dagger.BindsInstance
import dagger.Component
@@ -55,6 +57,7 @@ import org.mockito.ArgumentMatchers.anyFloat
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.anyLong
import org.mockito.ArgumentMatchers.eq
import org.mockito.ArgumentMatchers.isNull
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.Mockito.clearInvocations
@@ -309,6 +312,17 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
        assertNotNull(transitionController.dragDownAnimator)
    }

    @Test
    fun testGoToLockedShadeCancelDoesntLeaveShadeOpenOnKeyguardHide() {
        whenever(lockScreenUserManager.shouldShowLockscreenNotifications()).thenReturn(false)
        whenever(lockScreenUserManager.isLockscreenPublicMode(any())).thenReturn(true)
        transitionController.goToLockedShade(null)
        val captor = argumentCaptor<Runnable>()
        verify(centralSurfaces).showBouncerWithDimissAndCancelIfKeyguard(isNull(), captor.capture())
        captor.value.run()
        verify(statusbarStateController).setLeaveOpenOnKeyguardHide(false)
    }

    @Test
    fun testDragDownAmountDoesntCallOutInLockedDownShade() {
        whenever(nsslController.isInLockedDownShade).thenReturn(true)