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

Commit d120662b authored by Chandru S's avatar Chandru S
Browse files

Add a check for is unlocked before transitioning to the gone scene.

Bug: 330582270
Test: unlock and lock repeatedly with fingerprint or face to dismiss the lockscreen, no crashes should be observed.
Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Change-Id: I3665df58e83351bf9590c583238d7f2f9ef063a0
parent a036797e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ class ShadeControllerSceneImplTest : SysuiTestCase() {

    private fun TestScope.setDeviceEntered(isEntered: Boolean) {
        if (isEntered) {
            // Unlock the device marking the device has entered.
            kosmos.fakeDeviceEntryFingerprintAuthRepository.setAuthenticationStatus(
                SuccessFingerprintAuthenticationStatus(0, true)
            )
+7 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.dagger.ShadeTouchLog
import com.android.systemui.scene.domain.interactor.SceneInteractor
@@ -61,6 +62,7 @@ constructor(
    private val shadeInteractor: ShadeInteractor,
    private val sceneInteractor: SceneInteractor,
    private val deviceEntryInteractor: DeviceEntryInteractor,
    private val deviceUnlockedInteractor: DeviceUnlockedInteractor,
    private val notificationStackScrollLayout: NotificationStackScrollLayout,
    @ShadeTouchLog private val touchLog: LogBuffer,
    private val vibratorHelper: VibratorHelper,
@@ -148,7 +150,11 @@ constructor(
    }

    private fun getCollapseDestinationScene(): SceneKey {
        return if (deviceEntryInteractor.isDeviceEntered.value) {
        // Always check whether device is unlocked before transitioning to gone scene.
        return if (
            deviceUnlockedInteractor.deviceUnlockStatus.value.isUnlocked &&
                deviceEntryInteractor.isDeviceEntered.value
        ) {
            Scenes.Gone
        } else {
            Scenes.Lockscreen
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ package com.android.systemui.shade
import com.android.systemui.assist.AssistManager
import com.android.systemui.concurrency.fakeExecutor
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.kosmos.testDispatcher
@@ -58,6 +59,7 @@ val Kosmos.shadeControllerSceneImpl by
            statusBarKeyguardViewManager = mock<StatusBarKeyguardViewManager>(),
            notificationShadeWindowController = mock<NotificationShadeWindowController>(),
            assistManagerLazy = { mock<AssistManager>() },
            deviceUnlockedInteractor = deviceUnlockedInteractor,
        )
    }