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

Commit 823e1dd9 authored by Shawn Lee's avatar Shawn Lee
Browse files

Set LeaveOpenOnKeyguardHide to false when bouncer is canceled

We were setting StatusBarStateController.mLeaveOpenOnKeyguardHide to true when launching bouncer when unlock is needed to access full Shade, but not setting it to false if the bouncer was canceled. This left us in a state where dismissing the bouncer another way would not make the Shade collapse, leaving it in a broken state after unlock.

Bug: 319549913
Test: added unit test
Flag: NONE
Change-Id: Iad7d63ed18fd2d9b7f236086e43c35e6bd9bb112
Merged-In: Iad7d63ed18fd2d9b7f236086e43c35e6bd9bb112
parent 1745193e
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)