Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt +22 −11 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dump.DumpManager import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags import com.android.systemui.lifecycle.SysUiViewModel Loading @@ -25,6 +26,8 @@ import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNoti import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding import com.android.systemui.util.kotlin.ActivatableFlowDumper import com.android.systemui.util.kotlin.ActivatableFlowDumperImpl import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import kotlinx.coroutines.flow.Flow Loading @@ -40,7 +43,13 @@ constructor( shadeInteractor: ShadeInteractor, private val headsUpNotificationInteractor: HeadsUpNotificationInteractor, featureFlags: FeatureFlagsClassic, ) : SysUiViewModel() { dumpManager: DumpManager, ) : SysUiViewModel(), ActivatableFlowDumper by ActivatableFlowDumperImpl( dumpManager = dumpManager, tag = "NotificationsPlaceholderViewModel", ) { /** DEBUG: whether the placeholder should be made slightly visible for positional debugging. */ val isVisualDebuggingEnabled: Boolean = featureFlags.isEnabled(Flags.NSSL_DEBUG_LINES) Loading @@ -48,6 +57,10 @@ constructor( /** DEBUG: whether the debug logging should be output. */ val isDebugLoggingEnabled: Boolean = SceneContainerFlag.isEnabled override suspend fun onActivated(): Nothing { activateFlowDumper() } /** Notifies that the bounds of the notification scrim have changed. */ fun onScrimBoundsChanged(bounds: ShadeScrimBounds?) { interactor.setShadeScrimBounds(bounds) Loading @@ -68,37 +81,35 @@ constructor( headsUpNotificationInteractor.isHeadsUpOrAnimatingAway /** Corner rounding of the stack */ // TODO(b/359244921): add .dumpWhileCollecting("shadeScrimRounding") val shadeScrimRounding: Flow<ShadeScrimRounding> = interactor.shadeScrimRounding val shadeScrimRounding: Flow<ShadeScrimRounding> = interactor.shadeScrimRounding.dumpWhileCollecting("shadeScrimRounding") /** * The amount [0-1] that the shade or quick settings has been opened. At 0, the shade is closed; * at 1, either the shade or quick settings is open. */ // TODO(b/359244921): add .dumpValue("expandFraction") val expandFraction: Flow<Float> = shadeInteractor.anyExpansion val expandFraction: Flow<Float> = shadeInteractor.anyExpansion.dumpValue("expandFraction") /** * The amount [0-1] that quick settings has been opened. At 0, the shade may be open or closed; * at 1, the quick settings are open. */ // TODO(b/359244921): add .dumpValue("shadeToQsFraction") val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion.dumpValue("shadeToQsFraction") /** * The amount in px that the notification stack should scroll due to internal expansion. This * should only happen when a notification expansion hits the bottom of the screen, so it is * necessary to scroll up to keep expanding the notification. */ // TODO(b/359244921): add .dumpWhileCollecting("syntheticScroll") val syntheticScroll: Flow<Float> = interactor.syntheticScroll val syntheticScroll: Flow<Float> = interactor.syntheticScroll.dumpWhileCollecting("syntheticScroll") /** * Whether the current touch gesture is overscroll. If true, it means the NSSL has already * consumed part of the gesture. */ // TODO(b/359244921): add .dumpWhileCollecting("isCurrentGestureOverScroll") val isCurrentGestureOverscroll: Flow<Boolean> = interactor.isCurrentGestureOverscroll val isCurrentGestureOverscroll: Flow<Boolean> = interactor.isCurrentGestureOverscroll.dumpWhileCollecting("isCurrentGestureOverScroll") /** Sets whether the notification stack is scrolled to the top. */ fun setScrolledToTop(scrolledToTop: Boolean) { Loading packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dump.dumpManager import com.android.systemui.flags.featureFlagsClassic import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture Loading @@ -29,5 +30,6 @@ val Kosmos.notificationsPlaceholderViewModel by Fixture { shadeInteractor = shadeInteractor, headsUpNotificationInteractor = headsUpNotificationInteractor, featureFlags = featureFlagsClassic, dumpManager = dumpManager, ) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt +22 −11 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dump.DumpManager import com.android.systemui.flags.FeatureFlagsClassic import com.android.systemui.flags.Flags import com.android.systemui.lifecycle.SysUiViewModel Loading @@ -25,6 +26,8 @@ import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNoti import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding import com.android.systemui.util.kotlin.ActivatableFlowDumper import com.android.systemui.util.kotlin.ActivatableFlowDumperImpl import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject import kotlinx.coroutines.flow.Flow Loading @@ -40,7 +43,13 @@ constructor( shadeInteractor: ShadeInteractor, private val headsUpNotificationInteractor: HeadsUpNotificationInteractor, featureFlags: FeatureFlagsClassic, ) : SysUiViewModel() { dumpManager: DumpManager, ) : SysUiViewModel(), ActivatableFlowDumper by ActivatableFlowDumperImpl( dumpManager = dumpManager, tag = "NotificationsPlaceholderViewModel", ) { /** DEBUG: whether the placeholder should be made slightly visible for positional debugging. */ val isVisualDebuggingEnabled: Boolean = featureFlags.isEnabled(Flags.NSSL_DEBUG_LINES) Loading @@ -48,6 +57,10 @@ constructor( /** DEBUG: whether the debug logging should be output. */ val isDebugLoggingEnabled: Boolean = SceneContainerFlag.isEnabled override suspend fun onActivated(): Nothing { activateFlowDumper() } /** Notifies that the bounds of the notification scrim have changed. */ fun onScrimBoundsChanged(bounds: ShadeScrimBounds?) { interactor.setShadeScrimBounds(bounds) Loading @@ -68,37 +81,35 @@ constructor( headsUpNotificationInteractor.isHeadsUpOrAnimatingAway /** Corner rounding of the stack */ // TODO(b/359244921): add .dumpWhileCollecting("shadeScrimRounding") val shadeScrimRounding: Flow<ShadeScrimRounding> = interactor.shadeScrimRounding val shadeScrimRounding: Flow<ShadeScrimRounding> = interactor.shadeScrimRounding.dumpWhileCollecting("shadeScrimRounding") /** * The amount [0-1] that the shade or quick settings has been opened. At 0, the shade is closed; * at 1, either the shade or quick settings is open. */ // TODO(b/359244921): add .dumpValue("expandFraction") val expandFraction: Flow<Float> = shadeInteractor.anyExpansion val expandFraction: Flow<Float> = shadeInteractor.anyExpansion.dumpValue("expandFraction") /** * The amount [0-1] that quick settings has been opened. At 0, the shade may be open or closed; * at 1, the quick settings are open. */ // TODO(b/359244921): add .dumpValue("shadeToQsFraction") val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion.dumpValue("shadeToQsFraction") /** * The amount in px that the notification stack should scroll due to internal expansion. This * should only happen when a notification expansion hits the bottom of the screen, so it is * necessary to scroll up to keep expanding the notification. */ // TODO(b/359244921): add .dumpWhileCollecting("syntheticScroll") val syntheticScroll: Flow<Float> = interactor.syntheticScroll val syntheticScroll: Flow<Float> = interactor.syntheticScroll.dumpWhileCollecting("syntheticScroll") /** * Whether the current touch gesture is overscroll. If true, it means the NSSL has already * consumed part of the gesture. */ // TODO(b/359244921): add .dumpWhileCollecting("isCurrentGestureOverScroll") val isCurrentGestureOverscroll: Flow<Boolean> = interactor.isCurrentGestureOverscroll val isCurrentGestureOverscroll: Flow<Boolean> = interactor.isCurrentGestureOverscroll.dumpWhileCollecting("isCurrentGestureOverScroll") /** Sets whether the notification stack is scrolled to the top. */ fun setScrolledToTop(scrolledToTop: Boolean) { Loading
packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModelKosmos.kt +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel import com.android.systemui.dump.dumpManager import com.android.systemui.flags.featureFlagsClassic import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.Kosmos.Fixture Loading @@ -29,5 +30,6 @@ val Kosmos.notificationsPlaceholderViewModel by Fixture { shadeInteractor = shadeInteractor, headsUpNotificationInteractor = headsUpNotificationInteractor, featureFlags = featureFlagsClassic, dumpManager = dumpManager, ) }