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

Commit 96167e13 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Notif] Reduce log spam by adding `distinctUntilChanged`.

Fixes: 386355190
Bug: 364653005
Flag: com.android.systemui.status_bar_notification_chips

Test: Get multiple non-promoted notifs, then `adb shell dumpsys activity
service com.android.systemui/.SystemUIService StatusBarChips` -> verify
no extra log lines

Change-Id: I5733dc7b334b807b5ab5074fde45acde6149ca6d
parent c71e4c0e
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.launch

/** A view model for status bar chips for promoted ongoing notifications. */
@@ -55,6 +56,7 @@ constructor(
            ) { notifications, headsUpState ->
                notifications.map { it.toActivityChipModel(headsUpState) }
            }
            .distinctUntilChanged()

    /** Converts the notification to the [OngoingActivityChipModel] object. */
    private fun NotificationChipModel.toActivityChipModel(