Loading packages/SystemUI/multivalentTests/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ class WindowRootViewModelTest : SysuiTestCase() { assertThat(blurRadius).isEqualTo(0f) kosmos.windowRootViewBlurRepository.blurRequestedByShade.value = 60 kosmos.windowRootViewBlurRepository.blurRequestedByShade.value = 60.0f runCurrent() assertThat(blurRadius).isEqualTo(0f) Loading packages/SystemUI/src/com/android/systemui/window/data/repository/NoopWindowRootViewBlurRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow class NoopWindowRootViewBlurRepository @Inject constructor() : WindowRootViewBlurRepository { override val blurRequestedByShade: MutableStateFlow<Int> = MutableStateFlow(0) override val blurRequestedByShade: MutableStateFlow<Float> = MutableStateFlow(0.0f) override val scaleRequestedByShade: MutableStateFlow<Float> = MutableStateFlow(1.0f) override val isBlurSupported: StateFlow<Boolean> = MutableStateFlow(false) override var blurAppliedListener: BlurAppliedListener? = null Loading packages/SystemUI/src/com/android/systemui/window/data/repository/WindowRootViewBlurRepository.kt +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ typealias BlurAppliedListener = Consumer<Int> /** Repository that maintains state for the window blur effect. */ interface WindowRootViewBlurRepository { val blurRequestedByShade: MutableStateFlow<Int> val blurRequestedByShade: MutableStateFlow<Float> val scaleRequestedByShade: MutableStateFlow<Float> Loading Loading @@ -76,7 +76,7 @@ constructor( override val trackingShadeMotion = MutableStateFlow(false) override val blurRequestedByShade = MutableStateFlow(0) override val blurRequestedByShade = MutableStateFlow(0.0f) override val scaleRequestedByShade = MutableStateFlow(1.0f) Loading packages/SystemUI/src/com/android/systemui/window/domain/interactor/WindowRootViewBlurInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ constructor( val isBlurCurrentlySupported: StateFlow<Boolean> = repository.isBlurSupported /** Radius of blur to be applied on the window root view. */ val blurRadiusRequestedByShade: StateFlow<Int> = repository.blurRequestedByShade.asStateFlow() val blurRadiusRequestedByShade: StateFlow<Float> = repository.blurRequestedByShade.asStateFlow() /** Scale factor to apply to content underneath blurs on the window root view. */ val blurScaleRequestedByShade: StateFlow<Float> = repository.scaleRequestedByShade.asStateFlow() Loading Loading @@ -121,7 +121,7 @@ constructor( if (communalInteractor.isCommunalBlurring.value) { return false } repository.blurRequestedByShade.value = blurRadius repository.blurRequestedByShade.value = blurRadius.toFloat() repository.scaleRequestedByShade.value = blurScale return true } Loading packages/SystemUI/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModel.kt +2 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onEach Loading Loading @@ -62,9 +61,7 @@ constructor( listOf( *bouncerBlurRadiusFlows.toTypedArray(), *glanceableHubBlurRadiusFlows.toTypedArray(), blurInteractor.blurRadiusRequestedByShade .map { it.toFloat() } .logIfPossible("ShadeBlur"), blurInteractor.blurRadiusRequestedByShade.logIfPossible("ShadeBlur"), ) .merge() Loading Loading @@ -135,7 +132,7 @@ constructor( private companion object { const val TAG = "WindowRootViewModel" val isLoggable = Log.isLoggable(TAG, Log.VERBOSE) || Build.isDebuggable() val isLoggable = Log.isLoggable(TAG, Log.VERBOSE) || Build.IS_ENG fun <T> Flow<T>.logIfPossible(loggingInfo: String): Flow<T> { return onEach { if (isLoggable) Log.v(TAG, "$loggingInfo $it") } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ class WindowRootViewModelTest : SysuiTestCase() { assertThat(blurRadius).isEqualTo(0f) kosmos.windowRootViewBlurRepository.blurRequestedByShade.value = 60 kosmos.windowRootViewBlurRepository.blurRequestedByShade.value = 60.0f runCurrent() assertThat(blurRadius).isEqualTo(0f) Loading
packages/SystemUI/src/com/android/systemui/window/data/repository/NoopWindowRootViewBlurRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow class NoopWindowRootViewBlurRepository @Inject constructor() : WindowRootViewBlurRepository { override val blurRequestedByShade: MutableStateFlow<Int> = MutableStateFlow(0) override val blurRequestedByShade: MutableStateFlow<Float> = MutableStateFlow(0.0f) override val scaleRequestedByShade: MutableStateFlow<Float> = MutableStateFlow(1.0f) override val isBlurSupported: StateFlow<Boolean> = MutableStateFlow(false) override var blurAppliedListener: BlurAppliedListener? = null Loading
packages/SystemUI/src/com/android/systemui/window/data/repository/WindowRootViewBlurRepository.kt +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ typealias BlurAppliedListener = Consumer<Int> /** Repository that maintains state for the window blur effect. */ interface WindowRootViewBlurRepository { val blurRequestedByShade: MutableStateFlow<Int> val blurRequestedByShade: MutableStateFlow<Float> val scaleRequestedByShade: MutableStateFlow<Float> Loading Loading @@ -76,7 +76,7 @@ constructor( override val trackingShadeMotion = MutableStateFlow(false) override val blurRequestedByShade = MutableStateFlow(0) override val blurRequestedByShade = MutableStateFlow(0.0f) override val scaleRequestedByShade = MutableStateFlow(1.0f) Loading
packages/SystemUI/src/com/android/systemui/window/domain/interactor/WindowRootViewBlurInteractor.kt +2 −2 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ constructor( val isBlurCurrentlySupported: StateFlow<Boolean> = repository.isBlurSupported /** Radius of blur to be applied on the window root view. */ val blurRadiusRequestedByShade: StateFlow<Int> = repository.blurRequestedByShade.asStateFlow() val blurRadiusRequestedByShade: StateFlow<Float> = repository.blurRequestedByShade.asStateFlow() /** Scale factor to apply to content underneath blurs on the window root view. */ val blurScaleRequestedByShade: StateFlow<Float> = repository.scaleRequestedByShade.asStateFlow() Loading Loading @@ -121,7 +121,7 @@ constructor( if (communalInteractor.isCommunalBlurring.value) { return false } repository.blurRequestedByShade.value = blurRadius repository.blurRequestedByShade.value = blurRadius.toFloat() repository.scaleRequestedByShade.value = blurScale return true } Loading
packages/SystemUI/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModel.kt +2 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onEach Loading Loading @@ -62,9 +61,7 @@ constructor( listOf( *bouncerBlurRadiusFlows.toTypedArray(), *glanceableHubBlurRadiusFlows.toTypedArray(), blurInteractor.blurRadiusRequestedByShade .map { it.toFloat() } .logIfPossible("ShadeBlur"), blurInteractor.blurRadiusRequestedByShade.logIfPossible("ShadeBlur"), ) .merge() Loading Loading @@ -135,7 +132,7 @@ constructor( private companion object { const val TAG = "WindowRootViewModel" val isLoggable = Log.isLoggable(TAG, Log.VERBOSE) || Build.isDebuggable() val isLoggable = Log.isLoggable(TAG, Log.VERBOSE) || Build.IS_ENG fun <T> Flow<T>.logIfPossible(loggingInfo: String): Flow<T> { return onEach { if (isLoggable) Log.v(TAG, "$loggingInfo $it") } Loading