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

Commit a8a1fbb0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only log smartspace timers when value changes" into main

parents 0f8eab0f cd354d3f
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -82,19 +82,26 @@ constructor(
            }

        _timers.value =
            timerTargets.map { (stableId, target) ->
            timerTargets
                .map { (stableId, target) ->
                    CommunalSmartspaceTimer(
                    // The view layer should have the instance based smartspaceTargetId instead of
                    // stable id, so that when a new instance of the timer is created, for example,
                    // when it is paused, the view should re-render its remote views.
                        // The view layer should have the instance based smartspaceTargetId instead
                        // of stable id, so that when a new instance of the timer is created, for
                        // example, when it is paused, the view should re-render its remote views.
                        smartspaceTargetId =
                            if (communalTimerFlickerFix()) stableId else target.smartspaceTargetId,
                        createdTimestampMillis = targetCreationTimes[stableId]!!,
                        remoteViews = target.remoteViews!!,
                    )
                }

        logger.d({ "Smartspace timers updated: $str1" }) { str1 = _timers.value.toString() }
                .also { newVal ->
                    // Only log when value changes to avoid filling up the buffer.
                    if (newVal != _timers.value) {
                        logger.d({ "Smartspace timers updated: $str1" }) {
                            str1 = newVal.toString()
                        }
                    }
                }
    }

    override fun startListening() {