diff options
| author | 2023-12-19 21:13:44 +0000 | |
|---|---|---|
| committer | 2023-12-19 21:13:44 +0000 | |
| commit | d7c15dc1915dcecf2dfa75516d2af172f09ea35a (patch) | |
| tree | d055c43c0ff1e60449db0a1afa77ac5f787b7bb2 | |
| parent | a94d5736993840f1655c6163fe469d19ea2b3d86 (diff) | |
| parent | 5dc14af2ead399b6914392404c3e55b63c92d250 (diff) | |
Merge "Make dependencies in SceneContainerStarteable lazy" into main
3 files changed, 15 insertions, 12 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt index c110de969b57..224903ff36b8 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt @@ -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() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt index 61d55f0ae667..2e4986dd1a10 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt @@ -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 diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt index 47518bbee57a..5abb4dde856b 100644 --- a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt @@ -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,15 +167,17 @@ constructor( isUnlocked && canSwipeToEnter == false -> { switchToScene( targetSceneKey = SceneKey.Gone, - loggingReason = "All SIM cards unlocked and device already" + - " unlocked and lockscreen doesn't require a swipe to dismiss." + 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" + - " or lockscreen still requires a swipe to dismiss." + 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( |