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

Commit ac4db44e authored by Darrell Shi's avatar Darrell Shi Committed by Android (Google) Code Review
Browse files

Merge "Add logs for smartspace timer updates" into main

parents 1744268f 19c6047e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.systemui.communal.smartspace.CommunalSmartspaceController
import com.android.systemui.concurrency.fakeExecutor
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.plugins.BcSmartspaceDataPlugin.SmartspaceTargetListener
import com.android.systemui.testKosmos
import com.android.systemui.util.time.fakeSystemClock
@@ -67,6 +68,7 @@ class CommunalSmartspaceRepositoryImplTest : SysuiTestCase() {
                smartspaceController,
                fakeExecutor,
                systemClock,
                logcatLogBuffer("CommunalSmartspaceRepositoryImplTest"),
            )
    }

+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ import com.android.systemui.communal.data.model.CommunalSmartspaceTimer
import com.android.systemui.communal.smartspace.CommunalSmartspaceController
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.core.Logger
import com.android.systemui.log.dagger.CommunalLog
import com.android.systemui.plugins.BcSmartspaceDataPlugin
import com.android.systemui.util.time.SystemClock
import java.util.concurrent.Executor
@@ -49,8 +52,11 @@ constructor(
    private val communalSmartspaceController: CommunalSmartspaceController,
    @Main private val uiExecutor: Executor,
    private val systemClock: SystemClock,
    @CommunalLog logBuffer: LogBuffer,
) : CommunalSmartspaceRepository, BcSmartspaceDataPlugin.SmartspaceTargetListener {

    private val logger = Logger(logBuffer, "CommunalSmartspaceRepository")

    private val _timers: MutableStateFlow<List<CommunalSmartspaceTimer>> =
        MutableStateFlow(emptyList())
    override val timers: Flow<List<CommunalSmartspaceTimer>> = _timers
@@ -87,6 +93,8 @@ constructor(
                    remoteViews = target.remoteViews!!,
                )
            }

        logger.d({ "Smartspace timers updated: $str1" }) { str1 = _timers.value.toString() }
    }

    override fun startListening() {