Merge "[SB][Screen Chips] Add logs for the chip state." into main
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 08cfd37..1771f4d 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -111,6 +111,7 @@
 import com.android.systemui.statusbar.CommandQueue;
 import com.android.systemui.statusbar.NotificationLockscreenUserManager;
 import com.android.systemui.statusbar.NotificationShadeWindowController;
+import com.android.systemui.statusbar.chips.StatusBarChipsModule;
 import com.android.systemui.statusbar.connectivity.ConnectivityModule;
 import com.android.systemui.statusbar.dagger.StatusBarModule;
 import com.android.systemui.statusbar.disableflags.dagger.DisableFlagsModule;
@@ -245,6 +246,7 @@
         SmartspaceModule.class,
         StatusBarEventsModule.class,
         StatusBarModule.class,
+        StatusBarChipsModule.class,
         StatusBarPipelineModule.class,
         StatusBarPolicyModule.class,
         StatusBarViewBinderModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsLog.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsLog.kt
new file mode 100644
index 0000000..ecb6286
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsLog.kt
@@ -0,0 +1,25 @@
+/*
+ * 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.statusbar.chips
+
+import javax.inject.Qualifier
+
+/** Logs for events related to the status bar chips. */
+@Qualifier
+@MustBeDocumented
+@Retention(AnnotationRetention.RUNTIME)
+annotation class StatusBarChipsLog
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsModule.kt
new file mode 100644
index 0000000..173ff37
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/StatusBarChipsModule.kt
@@ -0,0 +1,35 @@
+/*
+ * 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.statusbar.chips
+
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.LogBufferFactory
+import dagger.Module
+import dagger.Provides
+
+@Module
+abstract class StatusBarChipsModule {
+    companion object {
+        @Provides
+        @SysUISingleton
+        @StatusBarChipsLog
+        fun provideChipsLogBuffer(factory: LogBufferFactory): LogBuffer {
+            return factory.create("StatusBarChips", 200)
+        }
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractor.kt
index 7e9acaf..eaefc11 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractor.kt
@@ -17,15 +17,36 @@
 package com.android.systemui.statusbar.chips.call.domain.interactor
 
 import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
+import com.android.systemui.statusbar.chips.StatusBarChipsLog
 import com.android.systemui.statusbar.phone.ongoingcall.data.repository.OngoingCallRepository
+import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
 import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.flow.stateIn
 
 /** Interactor for the ongoing phone call chip shown in the status bar. */
 @SysUISingleton
 class CallChipInteractor
 @Inject
 constructor(
+    @Application private val scope: CoroutineScope,
     repository: OngoingCallRepository,
+    @StatusBarChipsLog private val logger: LogBuffer,
 ) {
-    val ongoingCallState = repository.ongoingCallState
+    val ongoingCallState: StateFlow<OngoingCallModel> =
+        repository.ongoingCallState
+            .onEach {
+                logger.log(TAG, LogLevel.INFO, { str1 = it::class.simpleName }, { "State: $str1" })
+            }
+            .stateIn(scope, SharingStarted.Lazily, OngoingCallModel.NoCall)
+
+    companion object {
+        private const val TAG = "OngoingCall"
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractor.kt
index 20ebae7..cda17ce 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractor.kt
@@ -19,8 +19,11 @@
 import android.content.pm.PackageManager
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
 import com.android.systemui.mediaprojection.data.model.MediaProjectionState
 import com.android.systemui.mediaprojection.data.repository.MediaProjectionRepository
+import com.android.systemui.statusbar.chips.StatusBarChipsLog
 import com.android.systemui.statusbar.chips.mediaprojection.domain.model.ProjectionChipModel
 import com.android.systemui.util.Utils
 import javax.inject.Inject
@@ -45,12 +48,16 @@
     @Application private val scope: CoroutineScope,
     private val mediaProjectionRepository: MediaProjectionRepository,
     private val packageManager: PackageManager,
+    @StatusBarChipsLog private val logger: LogBuffer,
 ) {
     val projection: StateFlow<ProjectionChipModel> =
         mediaProjectionRepository.mediaProjectionState
             .map { state ->
                 when (state) {
-                    is MediaProjectionState.NotProjecting -> ProjectionChipModel.NotProjecting
+                    is MediaProjectionState.NotProjecting -> {
+                        logger.log(TAG, LogLevel.INFO, {}, { "State: NotProjecting" })
+                        ProjectionChipModel.NotProjecting
+                    }
                     is MediaProjectionState.Projecting -> {
                         val type =
                             if (isProjectionToOtherDevice(state.hostPackage)) {
@@ -58,6 +65,15 @@
                             } else {
                                 ProjectionChipModel.Type.SHARE_TO_APP
                             }
+                        logger.log(
+                            TAG,
+                            LogLevel.INFO,
+                            {
+                                str1 = type.name
+                                str2 = state.hostPackage
+                            },
+                            { "State: Projecting(type=$str1 hostPackage=$str2)" }
+                        )
                         ProjectionChipModel.Projecting(type, state)
                     }
                 }
@@ -81,4 +97,8 @@
         // marked as going to a different device, even if that isn't always true. See b/321078669.
         return Utils.isHeadlessRemoteDisplayProvider(packageManager, packageName)
     }
+
+    companion object {
+        private const val TAG = "MediaProjection"
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractor.kt
index 43b1d16..28a8385 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractor.kt
@@ -18,10 +18,13 @@
 
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
 import com.android.systemui.mediaprojection.data.model.MediaProjectionState
 import com.android.systemui.mediaprojection.data.repository.MediaProjectionRepository
 import com.android.systemui.screenrecord.data.model.ScreenRecordModel
 import com.android.systemui.screenrecord.data.repository.ScreenRecordRepository
+import com.android.systemui.statusbar.chips.StatusBarChipsLog
 import com.android.systemui.statusbar.chips.screenrecord.domain.model.ScreenRecordChipModel
 import javax.inject.Inject
 import kotlinx.coroutines.CoroutineScope
@@ -39,6 +42,7 @@
     @Application private val scope: CoroutineScope,
     private val screenRecordRepository: ScreenRecordRepository,
     private val mediaProjectionRepository: MediaProjectionRepository,
+    @StatusBarChipsLog private val logger: LogBuffer,
 ) {
     val screenRecordState: StateFlow<ScreenRecordChipModel> =
         // ScreenRecordRepository has the main "is the screen being recorded?" state, and
@@ -49,9 +53,19 @@
                 mediaProjectionRepository.mediaProjectionState,
             ) { screenRecordState, mediaProjectionState ->
                 when (screenRecordState) {
-                    is ScreenRecordModel.DoingNothing -> ScreenRecordChipModel.DoingNothing
-                    is ScreenRecordModel.Starting ->
+                    is ScreenRecordModel.DoingNothing -> {
+                        logger.log(TAG, LogLevel.INFO, {}, { "State: DoingNothing" })
+                        ScreenRecordChipModel.DoingNothing
+                    }
+                    is ScreenRecordModel.Starting -> {
+                        logger.log(
+                            TAG,
+                            LogLevel.INFO,
+                            { long1 = screenRecordState.millisUntilStarted },
+                            { "State: Starting($long1)" }
+                        )
                         ScreenRecordChipModel.Starting(screenRecordState.millisUntilStarted)
+                    }
                     is ScreenRecordModel.Recording -> {
                         val recordedTask =
                             if (
@@ -61,6 +75,12 @@
                             } else {
                                 null
                             }
+                        logger.log(
+                            TAG,
+                            LogLevel.INFO,
+                            { str1 = recordedTask?.baseIntent?.component?.packageName },
+                            { "State: Recording(taskPackage=$str1)" }
+                        )
                         ScreenRecordChipModel.Recording(recordedTask)
                     }
                 }
@@ -71,4 +91,8 @@
     fun stopRecording() {
         scope.launch { screenRecordRepository.stopRecording() }
     }
+
+    companion object {
+        private const val TAG = "ScreenRecord"
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
index e8d895c..40f86f9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
@@ -21,8 +21,13 @@
 
 /** Model representing the display of an ongoing activity as a chip in the status bar. */
 sealed class OngoingActivityChipModel {
+    /** Condensed name representing the model, used for logs. */
+    abstract val logName: String
+
     /** This chip shouldn't be shown. */
-    data object Hidden : OngoingActivityChipModel()
+    data object Hidden : OngoingActivityChipModel() {
+        override val logName = "Hidden"
+    }
 
     /** This chip should be shown with the given information. */
     abstract class Shown(
@@ -42,7 +47,9 @@
             override val icon: Icon,
             override val colors: ColorsModel,
             override val onClickListener: View.OnClickListener?,
-        ) : Shown(icon, colors, onClickListener)
+        ) : Shown(icon, colors, onClickListener) {
+            override val logName = "Shown.Icon"
+        }
 
         /** The chip shows a timer, counting up from [startTimeMs]. */
         data class Timer(
@@ -59,7 +66,9 @@
              */
             val startTimeMs: Long,
             override val onClickListener: View.OnClickListener?,
-        ) : Shown(icon, colors, onClickListener)
+        ) : Shown(icon, colors, onClickListener) {
+            override val logName = "Shown.Timer"
+        }
 
         /**
          * This chip shows a countdown using [secondsUntilStarted]. Used to inform users that an
@@ -69,6 +78,8 @@
             override val colors: ColorsModel,
             /** The number of seconds until an event is started. */
             val secondsUntilStarted: Long,
-        ) : Shown(icon = null, colors, onClickListener = null)
+        ) : Shown(icon = null, colors, onClickListener = null) {
+            override val logName = "Shown.Countdown"
+        }
     }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
index 9c8086f..15c348e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModel.kt
@@ -18,6 +18,9 @@
 
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.log.LogBuffer
+import com.android.systemui.log.core.LogLevel
+import com.android.systemui.statusbar.chips.StatusBarChipsLog
 import com.android.systemui.statusbar.chips.call.ui.viewmodel.CallChipViewModel
 import com.android.systemui.statusbar.chips.casttootherdevice.ui.viewmodel.CastToOtherDeviceChipViewModel
 import com.android.systemui.statusbar.chips.screenrecord.ui.viewmodel.ScreenRecordChipViewModel
@@ -45,6 +48,7 @@
     shareToAppChipViewModel: ShareToAppChipViewModel,
     castToOtherDeviceChipViewModel: CastToOtherDeviceChipViewModel,
     callChipViewModel: CallChipViewModel,
+    @StatusBarChipsLog private val logger: LogBuffer,
 ) {
     /**
      * A flow modeling the chip that should be shown in the status bar after accounting for possibly
@@ -60,6 +64,17 @@
                 castToOtherDeviceChipViewModel.chip,
                 callChipViewModel.chip,
             ) { screenRecord, shareToApp, castToOtherDevice, call ->
+                logger.log(
+                    TAG,
+                    LogLevel.INFO,
+                    {
+                        str1 = screenRecord.logName
+                        str2 = shareToApp.logName
+                        str3 = castToOtherDevice.logName
+                    },
+                    { "Chips: ScreenRecord=$str1 > ShareToApp=$str2 > CastToOther=$str3..." },
+                )
+                logger.log(TAG, LogLevel.INFO, { str1 = call.logName }, { "... > Call=$str1" })
                 // This `when` statement shows the priority order of the chips
                 when {
                     // Screen recording also activates the media projection APIs, so whenever the
@@ -76,4 +91,8 @@
             // for those timers to get reset for any reason. So, as soon as any subscriber has
             // requested the chip information, we need to maintain it forever. See b/347726238.
             .stateIn(scope, SharingStarted.Lazily, OngoingActivityChipModel.Hidden)
+
+    companion object {
+        private const val TAG = "ChipsViewModel"
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
index 2c48487..f81b952 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
@@ -18,7 +18,13 @@
 
 import android.app.PendingIntent
 
-/** Represents the state of any ongoing calls. */
+/**
+ * Represents the state of any ongoing calls.
+ *
+ * TODO(b/332662551): If there's an ongoing call but the user has the call app open, then we use the
+ *   NoCall model, *not* the InCall model, which is confusing when looking at the logs. We may want
+ *   to make that more clear, either with better logging or different models.
+ */
 sealed interface OngoingCallModel {
     /** There is no ongoing call. */
     data object NoCall : OngoingCallModel
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/StatusBarChipsLogKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/StatusBarChipsLogKosmos.kt
new file mode 100644
index 0000000..e904cd2
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/StatusBarChipsLogKosmos.kt
@@ -0,0 +1,22 @@
+/*
+ * 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.statusbar.chips
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.log.logcatLogBuffer
+
+val Kosmos.statusBarChipsLogger by Kosmos.Fixture { logcatLogBuffer("StatusBarChips") }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractorKosmos.kt
index 064e57b..fcd14d8 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/call/domain/interactor/CallChipInteractorKosmos.kt
@@ -17,7 +17,15 @@
 package com.android.systemui.statusbar.chips.call.domain.interactor
 
 import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.statusbar.chips.statusBarChipsLogger
 import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
 
 val Kosmos.callChipInteractor: CallChipInteractor by
-    Kosmos.Fixture { CallChipInteractor(repository = ongoingCallRepository) }
+    Kosmos.Fixture {
+        CallChipInteractor(
+            scope = applicationCoroutineScope,
+            repository = ongoingCallRepository,
+            logger = statusBarChipsLogger,
+        )
+    }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractorKosmos.kt
index 6812a9d..0bfd88fc 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/mediaprojection/domain/interactor/MediaProjectionChipInteractorKosmos.kt
@@ -20,6 +20,7 @@
 import com.android.systemui.kosmos.Kosmos
 import com.android.systemui.kosmos.applicationCoroutineScope
 import com.android.systemui.mediaprojection.data.repository.fakeMediaProjectionRepository
+import com.android.systemui.statusbar.chips.statusBarChipsLogger
 
 val Kosmos.mediaProjectionChipInteractor: MediaProjectionChipInteractor by
     Kosmos.Fixture {
@@ -27,5 +28,6 @@
             scope = applicationCoroutineScope,
             mediaProjectionRepository = fakeMediaProjectionRepository,
             packageManager = packageManager,
+            logger = statusBarChipsLogger,
         )
     }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractorKosmos.kt
index b4e9c14..557d3e2 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/screenrecord/domain/interactor/ScreenRecordChipInteractorKosmos.kt
@@ -20,6 +20,7 @@
 import com.android.systemui.kosmos.applicationCoroutineScope
 import com.android.systemui.mediaprojection.data.repository.fakeMediaProjectionRepository
 import com.android.systemui.screenrecord.data.repository.screenRecordRepository
+import com.android.systemui.statusbar.chips.statusBarChipsLogger
 
 val Kosmos.screenRecordChipInteractor: ScreenRecordChipInteractor by
     Kosmos.Fixture {
@@ -27,5 +28,6 @@
             scope = applicationCoroutineScope,
             screenRecordRepository = screenRecordRepository,
             mediaProjectionRepository = fakeMediaProjectionRepository,
+            logger = statusBarChipsLogger,
         )
     }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelKosmos.kt
index 078e845..16e288f 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/chips/ui/viewmodel/OngoingActivityChipsViewModelKosmos.kt
@@ -22,6 +22,7 @@
 import com.android.systemui.statusbar.chips.casttootherdevice.ui.viewmodel.castToOtherDeviceChipViewModel
 import com.android.systemui.statusbar.chips.screenrecord.ui.viewmodel.screenRecordChipViewModel
 import com.android.systemui.statusbar.chips.sharetoapp.ui.viewmodel.shareToAppChipViewModel
+import com.android.systemui.statusbar.chips.statusBarChipsLogger
 
 val Kosmos.ongoingActivityChipsViewModel: OngoingActivityChipsViewModel by
     Kosmos.Fixture {
@@ -31,5 +32,6 @@
             shareToAppChipViewModel = shareToAppChipViewModel,
             castToOtherDeviceChipViewModel = castToOtherDeviceChipViewModel,
             callChipViewModel = callChipViewModel,
+            logger = statusBarChipsLogger,
         )
     }