Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/emptyshade/ui/viewmodel/EmptyShadeViewModel.kt +47 −36 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar.notification.emptyshade.ui.viewmodel import android.content.Context import android.icu.text.MessageFormat import com.android.app.tracing.coroutines.flow.flowOn import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dump.DumpManager import com.android.systemui.modes.shared.ModesUi import com.android.systemui.res.R Loading @@ -32,6 +34,7 @@ import com.android.systemui.util.kotlin.FlowDumperImpl import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import java.util.Locale import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow Loading @@ -50,11 +53,16 @@ constructor( zenModeInteractor: ZenModeInteractor, seenNotificationsInteractor: SeenNotificationsInteractor, notificationSettingsInteractor: NotificationSettingsInteractor, @Background bgDispatcher: CoroutineDispatcher, dumpManager: DumpManager, ) : FlowDumperImpl(dumpManager) { val areNotificationsHiddenInShade: Flow<Boolean> by lazy { if (FooterViewRefactor.isUnexpectedlyInLegacyMode()) { flowOf(false) } else if (ModesEmptyShadeFix.isEnabled) { zenModeInteractor.areNotificationsHiddenInShade .dumpWhileCollecting("areNotificationsHiddenInShade") .flowOn(bgDispatcher) } else { zenModeInteractor.areNotificationsHiddenInShade.dumpWhileCollecting( "areNotificationsHiddenInShade" Loading @@ -81,7 +89,8 @@ constructor( // The former does not depend on the modes flags being on, but the latter does. if (ModesUi.isEnabled) { zenModeInteractor.modesHidingNotifications.map { modes -> // Create a string that is either "No notifications" if no modes are filtering // Create a string that is either "No notifications" if no modes are // filtering // them out, or something like "Notifications paused by SomeMode" otherwise. val msgFormat = MessageFormat( Loading @@ -105,6 +114,7 @@ constructor( } } } .flowOn(bgDispatcher) } } Loading Loading @@ -137,6 +147,7 @@ constructor( } } } .flowOn(bgDispatcher) } @AssistedFactory Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/emptyshade/ui/viewmodel/EmptyShadeViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.emptyshade.ui.viewmodel import android.content.applicationContext import com.android.systemui.dump.dumpManager import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.shared.notifications.domain.interactor.notificationSettingsInteractor import com.android.systemui.statusbar.notification.domain.interactor.seenNotificationsInteractor import com.android.systemui.statusbar.policy.domain.interactor.zenModeInteractor Loading @@ -30,6 +31,7 @@ val Kosmos.emptyShadeViewModel by zenModeInteractor, seenNotificationsInteractor, notificationSettingsInteractor, testDispatcher, dumpManager, ) } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/emptyshade/ui/viewmodel/EmptyShadeViewModel.kt +47 −36 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.systemui.statusbar.notification.emptyshade.ui.viewmodel import android.content.Context import android.icu.text.MessageFormat import com.android.app.tracing.coroutines.flow.flowOn import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dump.DumpManager import com.android.systemui.modes.shared.ModesUi import com.android.systemui.res.R Loading @@ -32,6 +34,7 @@ import com.android.systemui.util.kotlin.FlowDumperImpl import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import java.util.Locale import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow Loading @@ -50,11 +53,16 @@ constructor( zenModeInteractor: ZenModeInteractor, seenNotificationsInteractor: SeenNotificationsInteractor, notificationSettingsInteractor: NotificationSettingsInteractor, @Background bgDispatcher: CoroutineDispatcher, dumpManager: DumpManager, ) : FlowDumperImpl(dumpManager) { val areNotificationsHiddenInShade: Flow<Boolean> by lazy { if (FooterViewRefactor.isUnexpectedlyInLegacyMode()) { flowOf(false) } else if (ModesEmptyShadeFix.isEnabled) { zenModeInteractor.areNotificationsHiddenInShade .dumpWhileCollecting("areNotificationsHiddenInShade") .flowOn(bgDispatcher) } else { zenModeInteractor.areNotificationsHiddenInShade.dumpWhileCollecting( "areNotificationsHiddenInShade" Loading @@ -81,7 +89,8 @@ constructor( // The former does not depend on the modes flags being on, but the latter does. if (ModesUi.isEnabled) { zenModeInteractor.modesHidingNotifications.map { modes -> // Create a string that is either "No notifications" if no modes are filtering // Create a string that is either "No notifications" if no modes are // filtering // them out, or something like "Notifications paused by SomeMode" otherwise. val msgFormat = MessageFormat( Loading @@ -105,6 +114,7 @@ constructor( } } } .flowOn(bgDispatcher) } } Loading Loading @@ -137,6 +147,7 @@ constructor( } } } .flowOn(bgDispatcher) } @AssistedFactory Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/emptyshade/ui/viewmodel/EmptyShadeViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.emptyshade.ui.viewmodel import android.content.applicationContext import com.android.systemui.dump.dumpManager import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.shared.notifications.domain.interactor.notificationSettingsInteractor import com.android.systemui.statusbar.notification.domain.interactor.seenNotificationsInteractor import com.android.systemui.statusbar.policy.domain.interactor.zenModeInteractor Loading @@ -30,6 +31,7 @@ val Kosmos.emptyShadeViewModel by zenModeInteractor, seenNotificationsInteractor, notificationSettingsInteractor, testDispatcher, dumpManager, ) } Loading