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

Commit 5dc14af2 authored by Aaron Liu's avatar Aaron Liu
Browse files

Make dependencies in SceneContainerStarteable lazy

Make these deps lazy as the addition of these has increased the overall
boottime in Sysui. This may be possibly reverted if we find that no
improvments have been made on the boot time.

Test: atest SystemUiRoboTests
Fixes: 311247552
Flag: None
Change-Id: I78262d5d17b68abbf6f22120e7687054f2ce0961
parent 7493a09d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -265,8 +265,8 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() {
                falsingCollector = utils.falsingCollector(),
                powerInteractor = powerInteractor,
                bouncerInteractor = bouncerInteractor,
                simBouncerInteractor = utils.simBouncerInteractor,
                authenticationInteractor = utils.authenticationInteractor()
                simBouncerInteractor = dagger.Lazy { utils.simBouncerInteractor },
                authenticationInteractor = dagger.Lazy { utils.authenticationInteractor() }
            )
        startable.start()

+2 −2
Original line number Diff line number Diff line
@@ -90,8 +90,8 @@ class SceneContainerStartableTest : SysuiTestCase() {
            falsingCollector = falsingCollector,
            powerInteractor = powerInteractor,
            bouncerInteractor = bouncerInteractor,
            simBouncerInteractor = utils.simBouncerInteractor,
            authenticationInteractor = authenticationInteractor,
            simBouncerInteractor = dagger.Lazy { utils.simBouncerInteractor },
            authenticationInteractor = dagger.Lazy { authenticationInteractor },
        )

    @Test
+11 −8
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import com.android.systemui.statusbar.notification.stack.shared.flexiNotifsEnabl
import com.android.systemui.util.asIndenting
import com.android.systemui.util.printSection
import com.android.systemui.util.println
import dagger.Lazy
import java.io.PrintWriter
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -80,8 +81,8 @@ constructor(
    private val sceneLogger: SceneLogger,
    @FalsingCollectorActual private val falsingCollector: FalsingCollector,
    private val powerInteractor: PowerInteractor,
    private val simBouncerInteractor: SimBouncerInteractor,
    private val authenticationInteractor: AuthenticationInteractor,
    private val simBouncerInteractor: Lazy<SimBouncerInteractor>,
    private val authenticationInteractor: Lazy<AuthenticationInteractor>,
) : CoreStartable {

    override fun start() {
@@ -152,7 +153,7 @@ constructor(
            }
        }
        applicationScope.launch {
            simBouncerInteractor.isAnySimSecure.collect { isAnySimLocked ->
            simBouncerInteractor.get().isAnySimSecure.collect { isAnySimLocked ->
                val canSwipeToEnter = deviceEntryInteractor.canSwipeToEnter.value
                val isUnlocked = deviceEntryInteractor.isUnlocked.value

@@ -166,14 +167,16 @@ constructor(
                    isUnlocked && canSwipeToEnter == false -> {
                        switchToScene(
                            targetSceneKey = SceneKey.Gone,
                            loggingReason = "All SIM cards unlocked and device already" +
                            loggingReason =
                                "All SIM cards unlocked and device already" +
                                    " unlocked and lockscreen doesn't require a swipe to dismiss."
                        )
                    }
                    else -> {
                        switchToScene(
                            targetSceneKey = SceneKey.Lockscreen,
                            loggingReason = "All SIM cards unlocked and device still locked" +
                            loggingReason =
                                "All SIM cards unlocked and device still locked" +
                                    " or lockscreen still requires a swipe to dismiss."
                        )
                    }
@@ -262,7 +265,7 @@ constructor(
                                    " to swipe up on lockscreen to enter.",
                        )
                    } else if (
                        authenticationInteractor.getAuthenticationMethod() ==
                        authenticationInteractor.get().getAuthenticationMethod() ==
                            AuthenticationMethodModel.Sim
                    ) {
                        switchToScene(