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

Commit 380e8a8a authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Screen chips] Move `ongoingCallNotification` flow to background.

Fixes: 357170372
Bug: 332662551
Bug: 328584859

Flag: com.android.systemui.status_bar_use_repos_for_call_chip
Test: Start ongoing call -> verify chip still shows
Test: atest ActiveNotificationsInteractorTest
OngoingCallControllerViaRepoTest

Change-Id: I63ab03925d361b641dcd096d9b46548c489b7aaa
parent c4c834fe
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -81,11 +81,15 @@ constructor(
     * [CallType.Ongoing].
     */
    val ongoingCallNotification: Flow<ActiveNotificationModel?> =
        allRepresentativeNotifications.map { notifMap ->
            // Once a call has started, its `whenTime` should stay the same, so we can use it as a
            // stable sort value.
            notifMap.values.filter { it.callType == CallType.Ongoing }.minByOrNull { it.whenTime }
        allRepresentativeNotifications
            .map { notifMap ->
                // Once a call has started, its `whenTime` should stay the same, so we can use it as
                // a stable sort value.
                notifMap.values
                    .filter { it.callType == CallType.Ongoing }
                    .minByOrNull { it.whenTime }
            }
            .flowOn(backgroundDispatcher)

    /** Are any notifications being actively presented in the notification stack? */
    val areAnyNotificationsPresent: Flow<Boolean> =