diff options
| author | 2024-08-14 16:04:13 -0400 | |
|---|---|---|
| committer | 2024-08-14 22:59:13 -0400 | |
| commit | 595846cc23a693ea97a1ab71ae6878aa55a9b437 (patch) | |
| tree | e0eb7d880f25c55e4534b4f29b98e08503f94a9e | |
| parent | cd6cccb57223f88b63677a110daef8792fa55b5d (diff) | |
Add logging for communal scene changes
This will help determine what triggered the scene change when debugging
issues.
Bug: 358695869
Test: atest SystemUITests
Flag: com.android.systemui.communal_hub
Change-Id: Ie747568b5673da2173a3cf5ceeac0a0dcf38e26c
26 files changed, 280 insertions, 78 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt index b93b0490816d..7472d818d71a 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt @@ -1410,7 +1410,10 @@ fun AccessibilityContainer(viewModel: BaseCommunalViewModel, content: @Composabl R.string.accessibility_action_label_close_communal_hub ) ) { - viewModel.changeScene(CommunalScenes.Blank) + viewModel.changeScene( + CommunalScenes.Blank, + "closed by accessibility" + ) true }, CustomAccessibilityAction( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt index 9ccf99b301b1..70529cc762e0 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt @@ -112,7 +112,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) communalSceneInteractor.setEditModeState(EditModeState.STARTING) @@ -133,7 +133,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) communalSceneInteractor.setIsLaunchingWidget(true) @@ -154,7 +154,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) communalSceneInteractor.setIsLaunchingWidget(false) @@ -174,7 +174,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { with(kosmos) { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) communalInteractor.setEditModeOpen(true) @@ -213,7 +213,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { whenever(centralSurfaces.isLaunchingActivityOverLockscreen).thenReturn(false) val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) updateDocked(true) @@ -233,7 +233,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { whenever(centralSurfaces.isLaunchingActivityOverLockscreen).thenReturn(true) val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) updateDocked(true) @@ -270,7 +270,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { with(kosmos) { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) fakeKeyguardTransitionRepository.sendTransitionSteps( @@ -292,7 +292,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { with(kosmos) { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") assertThat(scene).isEqualTo(CommunalScenes.Communal) fakeKeyguardTransitionRepository.sendTransitionSteps( @@ -320,7 +320,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { fun dockingOnLockscreen_forcesCommunal() = with(kosmos) { testScope.runTest { - communalSceneInteractor.changeScene(CommunalScenes.Blank) + communalSceneInteractor.changeScene(CommunalScenes.Blank, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) // device is docked while on the lockscreen @@ -342,7 +342,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { fun dockingOnLockscreen_doesNotForceCommunalIfDreamStarts() = with(kosmos) { testScope.runTest { - communalSceneInteractor.changeScene(CommunalScenes.Blank) + communalSceneInteractor.changeScene(CommunalScenes.Blank, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) // device is docked while on the lockscreen @@ -374,7 +374,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { // Device is dreaming and on communal. updateDreaming(true) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) assertThat(scene).isEqualTo(CommunalScenes.Communal) @@ -391,7 +391,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { // Device is not dreaming and on communal. updateDreaming(false) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") // Scene stays as Communal advanceTimeBy(SCREEN_TIMEOUT.milliseconds) @@ -406,7 +406,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { // Device is dreaming and on communal. updateDreaming(true) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) assertThat(scene).isEqualTo(CommunalScenes.Communal) @@ -429,7 +429,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { // Device is on communal, but not dreaming. updateDreaming(false) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) assertThat(scene).isEqualTo(CommunalScenes.Communal) @@ -450,7 +450,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { with(kosmos) { testScope.runTest { // Device is on communal. - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") // Device stays on the hub after the timeout since we're not dreaming. advanceTimeBy(SCREEN_TIMEOUT.milliseconds * 2) @@ -471,7 +471,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { testScope.runTest { // Device is dreaming and on communal. updateDreaming(true) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) assertThat(scene).isEqualTo(CommunalScenes.Communal) @@ -500,7 +500,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { // Device is dreaming and on communal. updateDreaming(true) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val scene by collectLastValue(communalSceneInteractor.currentScene) assertThat(scene).isEqualTo(CommunalScenes.Communal) @@ -520,7 +520,7 @@ class CommunalSceneStartableTest : SysuiTestCase() { with(kosmos) { testScope.runTest { val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Blank) + communalSceneInteractor.changeScene(CommunalScenes.Blank, "test") assertThat(scene).isEqualTo(CommunalScenes.Blank) fakeKeyguardTransitionRepository.sendTransitionSteps( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt index e57a4cbc230e..864795b062be 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalInteractorTest.kt @@ -482,7 +482,7 @@ class CommunalInteractorTest : SysuiTestCase() { testScope.runTest { val targetScene = CommunalScenes.Communal - underTest.changeScene(targetScene) + underTest.changeScene(targetScene, "test") val desiredScene = collectLastValue(communalRepository.currentScene) runCurrent() @@ -635,7 +635,7 @@ class CommunalInteractorTest : SysuiTestCase() { runCurrent() assertThat(isCommunalShowing()).isEqualTo(false) - underTest.changeScene(CommunalScenes.Communal) + underTest.changeScene(CommunalScenes.Communal, "test") isCommunalShowing = collectLastValue(underTest.isCommunalShowing) runCurrent() @@ -659,12 +659,12 @@ class CommunalInteractorTest : SysuiTestCase() { assertThat(isCommunalShowing).isFalse() // Verify scene changes (without the flag) to communal sets the value to true - underTest.changeScene(CommunalScenes.Communal) + underTest.changeScene(CommunalScenes.Communal, "test") runCurrent() assertThat(isCommunalShowing).isTrue() // Verify scene changes (without the flag) to blank sets the value back to false - underTest.changeScene(CommunalScenes.Blank) + underTest.changeScene(CommunalScenes.Blank, "test") runCurrent() assertThat(isCommunalShowing).isFalse() } @@ -679,7 +679,7 @@ class CommunalInteractorTest : SysuiTestCase() { assertThat(isCommunalShowing).isFalse() // Verify scene changes without the flag doesn't have any impact - underTest.changeScene(CommunalScenes.Communal) + underTest.changeScene(CommunalScenes.Communal, "test") runCurrent() assertThat(isCommunalShowing).isFalse() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt index 43293c7a50ca..ed7e9107240e 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorTest.kt @@ -53,7 +53,7 @@ class CommunalSceneInteractorTest : SysuiTestCase() { val currentScene by collectLastValue(underTest.currentScene) assertThat(currentScene).isEqualTo(CommunalScenes.Blank) - underTest.changeScene(CommunalScenes.Communal) + underTest.changeScene(CommunalScenes.Communal, "test") assertThat(currentScene).isEqualTo(CommunalScenes.Communal) } @@ -63,7 +63,7 @@ class CommunalSceneInteractorTest : SysuiTestCase() { val currentScene by collectLastValue(underTest.currentScene) assertThat(currentScene).isEqualTo(CommunalScenes.Blank) - underTest.snapToScene(CommunalScenes.Communal) + underTest.snapToScene(CommunalScenes.Communal, "test") assertThat(currentScene).isEqualTo(CommunalScenes.Communal) } @@ -75,6 +75,7 @@ class CommunalSceneInteractorTest : SysuiTestCase() { assertThat(currentScene).isEqualTo(CommunalScenes.Blank) underTest.snapToScene( CommunalScenes.Communal, + "test", ActivityTransitionAnimator.TIMINGS.totalDuration ) assertThat(currentScene).isEqualTo(CommunalScenes.Blank) @@ -86,7 +87,7 @@ class CommunalSceneInteractorTest : SysuiTestCase() { fun changeSceneForActivityStartOnDismissKeyguard() = testScope.runTest { val currentScene by collectLastValue(underTest.currentScene) - underTest.snapToScene(CommunalScenes.Communal) + underTest.snapToScene(CommunalScenes.Communal, "test") assertThat(currentScene).isEqualTo(CommunalScenes.Communal) underTest.changeSceneForActivityStartOnDismissKeyguard() @@ -97,7 +98,7 @@ class CommunalSceneInteractorTest : SysuiTestCase() { fun changeSceneForActivityStartOnDismissKeyguard_willNotChangeScene_forEditModeActivity() = testScope.runTest { val currentScene by collectLastValue(underTest.currentScene) - underTest.snapToScene(CommunalScenes.Communal) + underTest.snapToScene(CommunalScenes.Communal, "test") assertThat(currentScene).isEqualTo(CommunalScenes.Communal) underTest.setEditModeState(EditModeState.STARTING) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalTutorialInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalTutorialInteractorTest.kt index 3a23e14e2777..7e28e19d0ee0 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalTutorialInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/domain/interactor/CommunalTutorialInteractorTest.kt @@ -158,7 +158,7 @@ class CommunalTutorialInteractorTest : SysuiTestCase() { kosmos.setCommunalAvailable(true) communalTutorialRepository.setTutorialSettingState(HUB_MODE_TUTORIAL_NOT_STARTED) - communalInteractor.changeScene(CommunalScenes.Blank) + communalInteractor.changeScene(CommunalScenes.Blank, "test") assertThat(tutorialSettingState).isEqualTo(HUB_MODE_TUTORIAL_NOT_STARTED) } @@ -171,7 +171,7 @@ class CommunalTutorialInteractorTest : SysuiTestCase() { goToCommunal() communalTutorialRepository.setTutorialSettingState(HUB_MODE_TUTORIAL_STARTED) - communalInteractor.changeScene(CommunalScenes.Blank) + communalInteractor.changeScene(CommunalScenes.Blank, "test") assertThat(tutorialSettingState).isEqualTo(HUB_MODE_TUTORIAL_COMPLETED) } @@ -184,13 +184,13 @@ class CommunalTutorialInteractorTest : SysuiTestCase() { goToCommunal() communalTutorialRepository.setTutorialSettingState(HUB_MODE_TUTORIAL_COMPLETED) - communalInteractor.changeScene(CommunalScenes.Blank) + communalInteractor.changeScene(CommunalScenes.Blank, "test") assertThat(tutorialSettingState).isEqualTo(HUB_MODE_TUTORIAL_COMPLETED) } private suspend fun goToCommunal() { kosmos.setCommunalAvailable(true) - communalInteractor.changeScene(CommunalScenes.Communal) + communalInteractor.changeScene(CommunalScenes.Communal, "test") } } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt index e36fd75445e2..a052b078167d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorControllerTest.kt @@ -76,7 +76,7 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { val launching by collectLastValue(communalSceneInteractor.isLaunchingWidget) val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") Truth.assertThat(scene).isEqualTo(CommunalScenes.Communal) communalSceneInteractor.setIsLaunchingWidget(true) assertTrue(launching!!) @@ -103,7 +103,7 @@ class CommunalTransitionAnimatorControllerTest : SysuiTestCase() { val launching by collectLastValue(communalSceneInteractor.isLaunchingWidget) val scene by collectLastValue(communalSceneInteractor.currentScene) - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") Truth.assertThat(scene).isEqualTo(CommunalScenes.Communal) communalSceneInteractor.setIsLaunchingWidget(true) assertTrue(launching!!) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt index 7a86e57779b9..da82b5f4a1f7 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt @@ -68,7 +68,6 @@ import com.android.systemui.navigationbar.gestural.domain.GestureInteractor import com.android.systemui.testKosmos import com.android.systemui.touch.TouchInsetManager import com.android.systemui.util.concurrency.FakeExecutor -import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.whenever import com.android.systemui.util.time.FakeSystemClock import com.google.common.truth.Truth.assertThat @@ -87,6 +86,7 @@ import org.mockito.Mockito.clearInvocations import org.mockito.Mockito.isNull import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations +import org.mockito.kotlin.any import org.mockito.kotlin.argumentCaptor import org.mockito.kotlin.eq import org.mockito.kotlin.spy @@ -669,7 +669,7 @@ class DreamOverlayServiceTest : SysuiTestCase() { runCurrent() verify(mDreamOverlayCallback).onRedirectWake(true) client.onWakeRequested() - verify(mCommunalInteractor).changeScene(eq(CommunalScenes.Communal), isNull()) + verify(mCommunalInteractor).changeScene(eq(CommunalScenes.Communal), any(), isNull()) verify(mUiEventLogger).log(CommunalUiEvent.DREAM_TO_COMMUNAL_HUB_DREAM_AWAKE_START) } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt index 8c1e8de315b1..9792c28d5023 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt @@ -845,7 +845,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest runTransitionAndSetWakefulness(KeyguardState.LOCKSCREEN, KeyguardState.GONE) // WHEN the glanceable hub is shown - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() assertThat(transitionRepository) @@ -1004,7 +1004,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun alternateBouncerToGlanceableHub() = testScope.runTest { // GIVEN the device is idle on the glanceable hub - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) @@ -1123,7 +1123,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun primaryBouncerToGlanceableHub() = testScope.runTest { // GIVEN the device is idle on the glanceable hub - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() // GIVEN a prior transition has run to PRIMARY_BOUNCER @@ -1157,7 +1157,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest advanceTimeBy(600L) // GIVEN the device is idle on the glanceable hub - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() // GIVEN a prior transition has run to PRIMARY_BOUNCER @@ -1971,7 +1971,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun glanceableHubToLockscreen_communalKtfRefactor() = testScope.runTest { // GIVEN a prior transition has run to GLANCEABLE_HUB - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) @@ -2035,7 +2035,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun glanceableHubToDozing_communalKtfRefactor() = testScope.runTest { // GIVEN a prior transition has run to GLANCEABLE_HUB - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) @@ -2136,7 +2136,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun glanceableHubToOccluded_communalKtfRefactor() = testScope.runTest { // GIVEN a prior transition has run to GLANCEABLE_HUB - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) @@ -2184,7 +2184,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest fun glanceableHubToGone_communalKtfRefactor() = testScope.runTest { // GIVEN a prior transition has run to GLANCEABLE_HUB - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) @@ -2265,7 +2265,7 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest advanceTimeBy(600L) // GIVEN a prior transition has run to GLANCEABLE_HUB - communalSceneInteractor.changeScene(CommunalScenes.Communal) + communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") runCurrent() clearInvocations(transitionRepository) diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt index b7c02ea91a6b..6e01393015ed 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt @@ -112,7 +112,11 @@ constructor( communalSceneInteractor.editModeState.value == EditModeState.STARTING || communalSceneInteractor.isLaunchingWidget.value if (!delaySceneTransition) { - communalSceneInteractor.changeScene(nextScene, nextTransition) + communalSceneInteractor.changeScene( + newScene = nextScene, + loggingReason = "KTF syncing", + transitionKey = nextTransition, + ) } } .launchIn(applicationScope) @@ -176,7 +180,10 @@ constructor( if (scene == CommunalScenes.Communal && isDreaming && timeoutJob == null) { // If dreaming starts after timeout has expired, ex. if dream restarts under // the hub, just close the hub immediately. - communalSceneInteractor.changeScene(CommunalScenes.Blank) + communalSceneInteractor.changeScene( + CommunalScenes.Blank, + "dream started after timeout", + ) } } } @@ -201,7 +208,10 @@ constructor( bgScope.launch { delay(screenTimeout.milliseconds) if (isDreaming) { - communalSceneInteractor.changeScene(CommunalScenes.Blank) + communalSceneInteractor.changeScene( + newScene = CommunalScenes.Blank, + loggingReason = "hub timeout", + ) } timeoutJob = null } diff --git a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt index 99bcc12da576..7181b15138b9 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt @@ -329,8 +329,11 @@ constructor( @Deprecated( "Use com.android.systemui.communal.domain.interactor.CommunalSceneInteractor instead" ) - fun changeScene(newScene: SceneKey, transitionKey: TransitionKey? = null) = - communalSceneInteractor.changeScene(newScene, transitionKey) + fun changeScene( + newScene: SceneKey, + loggingReason: String, + transitionKey: TransitionKey? = null + ) = communalSceneInteractor.changeScene(newScene, loggingReason, transitionKey) fun setEditModeOpen(isOpen: Boolean) { _editModeOpen.value = isOpen diff --git a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt index e45a69599a68..a0b996675331 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractor.kt @@ -22,6 +22,7 @@ import com.android.compose.animation.scene.SceneKey import com.android.compose.animation.scene.TransitionKey import com.android.systemui.communal.data.repository.CommunalSceneRepository import com.android.systemui.communal.domain.model.CommunalTransitionProgressModel +import com.android.systemui.communal.shared.log.CommunalSceneLogger import com.android.systemui.communal.shared.model.CommunalScenes import com.android.systemui.communal.shared.model.CommunalTransitionKeys import com.android.systemui.communal.shared.model.EditModeState @@ -29,6 +30,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf +import com.android.systemui.util.kotlin.pairwiseBy import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -42,8 +44,8 @@ import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.stateIn -import kotlinx.coroutines.launch @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton @@ -51,7 +53,8 @@ class CommunalSceneInteractor @Inject constructor( @Application private val applicationScope: CoroutineScope, - private val communalSceneRepository: CommunalSceneRepository, + private val repository: CommunalSceneRepository, + private val logger: CommunalSceneLogger, ) { private val _isLaunchingWidget = MutableStateFlow(false) @@ -80,25 +83,39 @@ constructor( */ fun changeScene( newScene: SceneKey, + loggingReason: String, transitionKey: TransitionKey? = null, keyguardState: KeyguardState? = null, ) { - applicationScope.launch { + applicationScope.launch("$TAG#changeScene") { + logger.logSceneChangeRequested( + from = currentScene.value, + to = newScene, + reason = loggingReason, + isInstant = false, + ) notifyListeners(newScene, keyguardState) - communalSceneRepository.changeScene(newScene, transitionKey) + repository.changeScene(newScene, transitionKey) } } /** Immediately snaps to the new scene. */ fun snapToScene( newScene: SceneKey, + loggingReason: String, delayMillis: Long = 0, keyguardState: KeyguardState? = null ) { applicationScope.launch("$TAG#snapToScene") { delay(delayMillis) + logger.logSceneChangeRequested( + from = currentScene.value, + to = newScene, + reason = loggingReason, + isInstant = true, + ) notifyListeners(newScene, keyguardState) - communalSceneRepository.snapToScene(newScene) + repository.snapToScene(newScene) } } @@ -113,13 +130,30 @@ constructor( if (_editModeState.value == EditModeState.STARTING) { return } - changeScene(CommunalScenes.Blank, CommunalTransitionKeys.SimpleFade) + changeScene( + CommunalScenes.Blank, + "activity start dismissing keyguard", + CommunalTransitionKeys.SimpleFade, + ) } /** * Target scene as requested by the underlying [SceneTransitionLayout] or through [changeScene]. */ - val currentScene: Flow<SceneKey> = communalSceneRepository.currentScene + val currentScene: StateFlow<SceneKey> = + repository.currentScene + .pairwiseBy(initialValue = repository.currentScene.value) { from, to -> + logger.logSceneChangeCommitted( + from = from, + to = to, + ) + to + } + .stateIn( + scope = applicationScope, + started = SharingStarted.Eagerly, + initialValue = repository.currentScene.value, + ) private val _editModeState = MutableStateFlow<EditModeState?>(null) /** @@ -134,7 +168,13 @@ constructor( /** Transition state of the hub mode. */ val transitionState: StateFlow<ObservableTransitionState> = - communalSceneRepository.transitionState + repository.transitionState + .onEach { logger.logSceneTransition(it) } + .stateIn( + scope = applicationScope, + started = SharingStarted.Eagerly, + initialValue = repository.transitionState.value, + ) /** * Updates the transition state of the hub [SceneTransitionLayout]. @@ -142,7 +182,7 @@ constructor( * Note that you must call is with `null` when the UI is done or risk a memory leak. */ fun setTransitionState(transitionState: Flow<ObservableTransitionState>?) { - communalSceneRepository.setTransitionState(transitionState) + repository.setTransitionState(transitionState) } /** Returns a flow that tracks the progress of transitions to the given scene from 0-1. */ diff --git a/packages/SystemUI/src/com/android/systemui/communal/shared/log/CommunalSceneLogger.kt b/packages/SystemUI/src/com/android/systemui/communal/shared/log/CommunalSceneLogger.kt new file mode 100644 index 000000000000..aed92156cfc3 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/communal/shared/log/CommunalSceneLogger.kt @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.communal.shared.log + +import com.android.compose.animation.scene.ObservableTransitionState +import com.android.compose.animation.scene.SceneKey +import com.android.systemui.log.LogBuffer +import com.android.systemui.log.core.LogLevel +import com.android.systemui.log.dagger.CommunalLog +import javax.inject.Inject + +class CommunalSceneLogger @Inject constructor(@CommunalLog private val logBuffer: LogBuffer) { + + fun logSceneChangeRequested( + from: SceneKey, + to: SceneKey, + reason: String, + isInstant: Boolean, + ) { + logBuffer.log( + tag = TAG, + level = LogLevel.INFO, + messageInitializer = { + str1 = from.toString() + str2 = to.toString() + str3 = reason + bool1 = isInstant + }, + messagePrinter = { + buildString { + append("Scene change requested: $str1 → $str2") + if (isInstant) { + append(" (instant)") + } + append(", reason: $str3") + } + }, + ) + } + + fun logSceneChangeCommitted( + from: SceneKey, + to: SceneKey, + ) { + logBuffer.log( + tag = TAG, + level = LogLevel.INFO, + messageInitializer = { + str1 = from.toString() + str2 = to.toString() + }, + messagePrinter = { "Scene change committed: $str1 → $str2" }, + ) + } + + fun logSceneTransition(transitionState: ObservableTransitionState) { + when (transitionState) { + is ObservableTransitionState.Transition -> { + logBuffer.log( + tag = TAG, + level = LogLevel.INFO, + messageInitializer = { + str1 = transitionState.fromScene.toString() + str2 = transitionState.toScene.toString() + }, + messagePrinter = { "Scene transition started: $str1 → $str2" }, + ) + } + is ObservableTransitionState.Idle -> { + logBuffer.log( + tag = TAG, + level = LogLevel.INFO, + messageInitializer = { str1 = transitionState.currentScene.toString() }, + messagePrinter = { "Scene transition idle on: $str1" }, + ) + } + } + } + + companion object { + private const val TAG = "CommunalSceneLogger" + } +} diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/BaseCommunalViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/BaseCommunalViewModel.kt index d1a5a4b8641f..b8221332eadf 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/BaseCommunalViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/BaseCommunalViewModel.kt @@ -106,10 +106,11 @@ abstract class BaseCommunalViewModel( */ fun changeScene( scene: SceneKey, + loggingReason: String, transitionKey: TransitionKey? = null, keyguardState: KeyguardState? = null ) { - communalSceneInteractor.changeScene(scene, transitionKey, keyguardState) + communalSceneInteractor.changeScene(scene, loggingReason, transitionKey, keyguardState) } fun setEditModeState(state: EditModeState?) = communalSceneInteractor.setEditModeState(state) diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalTransitionViewModel.kt index bbd8596a76bd..623937305921 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalTransitionViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalTransitionViewModel.kt @@ -67,7 +67,10 @@ constructor( * transition. */ fun snapToCommunal() { - communalSceneInteractor.snapToScene(CommunalScenes.Communal) + communalSceneInteractor.snapToScene( + newScene = CommunalScenes.Communal, + loggingReason = "transition view model", + ) } // Show UMO on glanceable hub immediately on transition into glanceable hub diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt index 08444623f24d..e7cedc61610f 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalTransitionAnimatorController.kt @@ -42,6 +42,7 @@ class CommunalTransitionAnimatorController( // TODO(b/330672236): move this to onTransitionAnimationEnd() without the delay. communalSceneInteractor.snapToScene( CommunalScenes.Blank, + "CommunalTransitionAnimatorController", ActivityTransitionAnimator.TIMINGS.totalDuration ) } diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt index 668fef6130bb..6d7cdc472f0a 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt @@ -218,9 +218,10 @@ constructor( lifecycleScope.launch { communalViewModel.canShowEditMode.collect { communalViewModel.changeScene( - CommunalScenes.Blank, - CommunalTransitionKeys.ToEditMode, - KeyguardState.GONE, + scene = CommunalScenes.Blank, + loggingReason = "edit mode opening", + transitionKey = CommunalTransitionKeys.ToEditMode, + keyguardState = KeyguardState.GONE, ) // wait till transitioned to Blank scene, then animate in communal content in // edit mode @@ -252,8 +253,9 @@ constructor( communalViewModel.cleanupEditModeState() communalViewModel.changeScene( - CommunalScenes.Communal, - CommunalTransitionKeys.FromEditMode + scene = CommunalScenes.Communal, + loggingReason = "edit mode closing", + transitionKey = CommunalTransitionKeys.FromEditMode ) // Wait for the current scene to be idle on communal. diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java index 4b9e5a024393..0c1fb72cc581 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java +++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java @@ -442,7 +442,9 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ @Override public void onWakeRequested() { mUiEventLogger.log(CommunalUiEvent.DREAM_TO_COMMUNAL_HUB_DREAM_AWAKE_START); - mCommunalInteractor.changeScene(CommunalScenes.Communal, null); + mCommunalInteractor.changeScene(CommunalScenes.Communal, + "dream wake requested", + null); } private Lifecycle.State getLifecycleStateLocked() { @@ -493,7 +495,7 @@ public class DreamOverlayService extends android.service.dreams.DreamOverlayServ mSystemDialogsCloser.closeSystemDialogs(); // Hide glanceable hub (this is a nop if glanceable hub is not open). - mCommunalInteractor.changeScene(CommunalScenes.Blank, null); + mCommunalInteractor.changeScene(CommunalScenes.Blank, "dream come to front", null); } /** diff --git a/packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt b/packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt index 4b07f78eb825..c9ecc97e0f96 100644 --- a/packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/dreams/ui/viewmodel/DreamViewModel.kt @@ -62,7 +62,7 @@ constructor( communalInteractor.isCommunalEnabled.value && !keyguardUpdateMonitor.isEncryptedOrLockdown(userTracker.userId) if (showGlanceableHub && !glanceableHubAllowKeyguardWhenDreaming()) { - communalInteractor.changeScene(CommunalScenes.Communal) + communalInteractor.changeScene(CommunalScenes.Communal, "transition away from dream") } else { toLockscreenTransitionViewModel.startTransition() } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt index 61446c19605c..9378d5087b14 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt @@ -285,9 +285,10 @@ constructor( private suspend fun transitionToGlanceableHub() { if (communalSceneKtfRefactor()) { communalSceneInteractor.changeScene( - CommunalScenes.Communal, + newScene = CommunalScenes.Communal, + loggingReason = "from dozing to hub", // Immediately show the hub when transitioning from dozing to hub. - CommunalTransitionKeys.Immediately, + transitionKey = CommunalTransitionKeys.Immediately, ) } else { startTransitionTo(KeyguardState.GLANCEABLE_HUB) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt index befcc9e6c8ee..c9db26dca9e2 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt @@ -159,6 +159,7 @@ constructor( if (communalSceneKtfRefactor()) { communalSceneInteractor.changeScene( newScene = CommunalScenes.Blank, + loggingReason = "hub to dozing", transitionKey = CommunalTransitionKeys.Immediately, keyguardState = KeyguardState.DOZING, ) @@ -182,6 +183,7 @@ constructor( if (communalSceneKtfRefactor()) { communalSceneInteractor.changeScene( newScene = CommunalScenes.Blank, + loggingReason = "hub to occluded (KeyguardWmStateRefactor)", transitionKey = CommunalTransitionKeys.SimpleFade, keyguardState = state, ) @@ -211,6 +213,7 @@ constructor( .collect { _ -> communalSceneInteractor.changeScene( newScene = CommunalScenes.Blank, + loggingReason = "hub to occluded", transitionKey = CommunalTransitionKeys.SimpleFade, keyguardState = KeyguardState.OCCLUDED, ) @@ -254,6 +257,7 @@ constructor( } else { communalSceneInteractor.changeScene( newScene = CommunalScenes.Blank, + loggingReason = "hub to gone", transitionKey = CommunalTransitionKeys.SimpleFade, keyguardState = KeyguardState.GONE ) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromOccludedTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromOccludedTransitionInteractor.kt index 905ca8eda87f..7b6949fdaa2c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromOccludedTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromOccludedTransitionInteractor.kt @@ -146,8 +146,9 @@ constructor( if (SceneContainerFlag.isEnabled) return if (communalSceneKtfRefactor()) { communalSceneInteractor.changeScene( - CommunalScenes.Communal, - CommunalTransitionKeys.SimpleFade + newScene = CommunalScenes.Communal, + loggingReason = "occluded to hub", + transitionKey = CommunalTransitionKeys.SimpleFade ) } else { startTransitionTo(KeyguardState.GLANCEABLE_HUB) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt index 2823b93b4847..0118f8e21f79 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt @@ -175,7 +175,10 @@ constructor( !communalSceneInteractor.isLaunchingWidget.value && communalSceneInteractor.editModeState.value == null ) { - communalSceneInteractor.snapToScene(CommunalScenes.Blank) + communalSceneInteractor.snapToScene( + newScene = CommunalScenes.Blank, + loggingReason = "FromPrimaryBouncerTransitionInteractor", + ) } } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AccessibilityActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AccessibilityActionsViewModel.kt index 34c1436c3235..38f5d3e76c7c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AccessibilityActionsViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/AccessibilityActionsViewModel.kt @@ -50,5 +50,9 @@ constructor( } .distinctUntilChanged() - fun openCommunalHub() = communalInteractor.changeScene(CommunalScenes.Communal) + fun openCommunalHub() = + communalInteractor.changeScene( + newScene = CommunalScenes.Communal, + loggingReason = "accessibility", + ) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt index 107bf1edb74f..d4ef42c687e5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt @@ -613,8 +613,9 @@ constructor( super.onTransitionAnimationStart(isExpandingFullyAbove) if (Flags.communalHub()) { communalSceneInteractor.snapToScene( - CommunalScenes.Blank, - ActivityTransitionAnimator.TIMINGS.totalDuration + newScene = CommunalScenes.Blank, + loggingReason = "ActivityStarterInternalImpl", + delayMillis = ActivityTransitionAnimator.TIMINGS.totalDuration ) } } diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt index ee48c105a987..2ab82214e497 100644 --- a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt +++ b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalSceneInteractorKosmos.kt @@ -17,6 +17,7 @@ package com.android.systemui.communal.domain.interactor import com.android.systemui.communal.data.repository.communalSceneRepository +import com.android.systemui.communal.shared.log.communalSceneLogger import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.applicationCoroutineScope @@ -24,6 +25,7 @@ val Kosmos.communalSceneInteractor: CommunalSceneInteractor by Kosmos.Fixture { CommunalSceneInteractor( applicationScope = applicationCoroutineScope, - communalSceneRepository = communalSceneRepository, + repository = communalSceneRepository, + logger = communalSceneLogger, ) } diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/shared/log/CommunalSceneLoggerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/shared/log/CommunalSceneLoggerKosmos.kt new file mode 100644 index 000000000000..b560ee882929 --- /dev/null +++ b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/shared/log/CommunalSceneLoggerKosmos.kt @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.communal.shared.log + +import com.android.systemui.kosmos.Kosmos +import com.android.systemui.log.logcatLogBuffer + +val Kosmos.communalSceneLogger: CommunalSceneLogger by + Kosmos.Fixture { CommunalSceneLogger(logcatLogBuffer("CommunalSceneLogger")) } |