Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ import org.mockito.junit.MockitoJUnit class NotificationShadeDepthControllerTest : SysuiTestCase() { private val kosmos = testKosmos() private val applicationScope = kosmos.testScope.backgroundScope @Mock private lateinit var windowRootViewBlurInteractor: WindowRootViewBlurInteractor @Mock private lateinit var statusBarStateController: StatusBarStateController @Mock private lateinit var blurUtils: BlurUtils Loading Loading @@ -134,7 +133,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { context, ResourcesSplitShadeStateController(), windowRootViewBlurInteractor, applicationScope, appZoomOutOptional, dumpManager, configurationController, Loading packages/SystemUI/multivalentTests/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModelTest.kt +0 −7 Original line number Diff line number Diff line Loading @@ -23,14 +23,12 @@ import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.lifecycle.activateIn import com.android.systemui.testKosmos import com.android.systemui.window.data.repository.fakeWindowRootViewBlurRepository import com.android.systemui.window.data.repository.windowRootViewBlurRepository import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading @@ -43,11 +41,6 @@ class WindowRootViewModelTest : SysuiTestCase() { val underTest by lazy { kosmos.windowRootViewModel } @Before fun setup() { underTest.activateIn(testScope) } @Test fun bouncerTransitionChangesWindowBlurRadius() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +9 −16 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import com.android.systemui.Flags import com.android.systemui.Flags.spatialModelAppPushback import com.android.systemui.animation.ShadeInterpolation import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -61,8 +60,6 @@ import java.util.Optional import javax.inject.Inject import kotlin.math.max import kotlin.math.sign import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch /** * Responsible for blurring the notification shade window, and applying a zoom effect to the Loading @@ -84,7 +81,6 @@ constructor( @ShadeDisplayAware private val context: Context, private val splitShadeStateController: SplitShadeStateController, private val windowRootViewBlurInteractor: WindowRootViewBlurInteractor, @Application private val applicationScope: CoroutineScope, private val appZoomOutOptional: Optional<AppZoomOut>, dumpManager: DumpManager, configurationController: ConfigurationController, Loading Loading @@ -394,9 +390,7 @@ constructor( private fun initBlurListeners() { if (!Flags.bouncerUiRevamp()) return applicationScope.launch { Log.d(TAG, "Starting coroutines for window root view blur") windowRootViewBlurInteractor.onBlurAppliedEvent.collect { appliedBlurRadius -> windowRootViewBlurInteractor.registerBlurAppliedListener { appliedBlurRadius -> if (updateScheduled) { // Process the blur applied event only if we scheduled the update TrackTracer.instantForGroup("shade", "shade_blur_radius", appliedBlurRadius) Loading @@ -408,7 +402,6 @@ constructor( } } } } private fun updateResources() { inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources) Loading packages/SystemUI/src/com/android/systemui/window/data/repository/NoopWindowRootViewBlurRepository.kt +2 −1 Original line number Diff line number Diff line Loading @@ -25,4 +25,5 @@ class NoopWindowRootViewBlurRepository @Inject constructor() : WindowRootViewBlu override val blurRadius: MutableStateFlow<Int> = MutableStateFlow(0) override val isBlurOpaque: MutableStateFlow<Boolean> = MutableStateFlow(true) override val isBlurSupported: StateFlow<Boolean> = MutableStateFlow(false) override var blurAppliedListener: BlurAppliedListener? = null } packages/SystemUI/src/com/android/systemui/window/data/repository/WindowRootViewBlurRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import com.android.systemui.window.data.repository.WindowRootViewBlurRepository.Companion.isDisableBlurSysPropSet import java.util.concurrent.Executor import java.util.function.Consumer import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose Loading @@ -34,6 +35,8 @@ import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.stateIn typealias BlurAppliedListener = Consumer<Int> /** Repository that maintains state for the window blur effect. */ interface WindowRootViewBlurRepository { val blurRadius: MutableStateFlow<Int> Loading @@ -42,6 +45,8 @@ interface WindowRootViewBlurRepository { /** Is blur supported based on settings toggle and battery power saver mode. */ val isBlurSupported: StateFlow<Boolean> var blurAppliedListener: BlurAppliedListener? companion object { /** * Whether the `persist.sysui.disableBlur` is set, this is used to disable blur for tests. Loading Loading @@ -82,6 +87,8 @@ constructor( } // stateIn because this is backed by a binder call. .stateIn(scope, SharingStarted.WhileSubscribed(), false) override var blurAppliedListener: BlurAppliedListener? = null private fun isBlurAllowed(): Boolean { return ActivityManager.isHighEndGfx() && !isDisableBlurSysPropSet() } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ import org.mockito.junit.MockitoJUnit class NotificationShadeDepthControllerTest : SysuiTestCase() { private val kosmos = testKosmos() private val applicationScope = kosmos.testScope.backgroundScope @Mock private lateinit var windowRootViewBlurInteractor: WindowRootViewBlurInteractor @Mock private lateinit var statusBarStateController: StatusBarStateController @Mock private lateinit var blurUtils: BlurUtils Loading Loading @@ -134,7 +133,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { context, ResourcesSplitShadeStateController(), windowRootViewBlurInteractor, applicationScope, appZoomOutOptional, dumpManager, configurationController, Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/window/ui/viewmodel/WindowRootViewModelTest.kt +0 −7 Original line number Diff line number Diff line Loading @@ -23,14 +23,12 @@ import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.kosmos.testScope import com.android.systemui.lifecycle.activateIn import com.android.systemui.testKosmos import com.android.systemui.window.data.repository.fakeWindowRootViewBlurRepository import com.android.systemui.window.data.repository.windowRootViewBlurRepository import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading @@ -43,11 +41,6 @@ class WindowRootViewModelTest : SysuiTestCase() { val underTest by lazy { kosmos.windowRootViewModel } @Before fun setup() { underTest.activateIn(testScope) } @Test fun bouncerTransitionChangesWindowBlurRadius() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +9 −16 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ import com.android.systemui.Flags import com.android.systemui.Flags.spatialModelAppPushback import com.android.systemui.animation.ShadeInterpolation import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor import com.android.systemui.plugins.statusbar.StatusBarStateController Loading @@ -61,8 +60,6 @@ import java.util.Optional import javax.inject.Inject import kotlin.math.max import kotlin.math.sign import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch /** * Responsible for blurring the notification shade window, and applying a zoom effect to the Loading @@ -84,7 +81,6 @@ constructor( @ShadeDisplayAware private val context: Context, private val splitShadeStateController: SplitShadeStateController, private val windowRootViewBlurInteractor: WindowRootViewBlurInteractor, @Application private val applicationScope: CoroutineScope, private val appZoomOutOptional: Optional<AppZoomOut>, dumpManager: DumpManager, configurationController: ConfigurationController, Loading Loading @@ -394,9 +390,7 @@ constructor( private fun initBlurListeners() { if (!Flags.bouncerUiRevamp()) return applicationScope.launch { Log.d(TAG, "Starting coroutines for window root view blur") windowRootViewBlurInteractor.onBlurAppliedEvent.collect { appliedBlurRadius -> windowRootViewBlurInteractor.registerBlurAppliedListener { appliedBlurRadius -> if (updateScheduled) { // Process the blur applied event only if we scheduled the update TrackTracer.instantForGroup("shade", "shade_blur_radius", appliedBlurRadius) Loading @@ -408,7 +402,6 @@ constructor( } } } } private fun updateResources() { inSplitShade = splitShadeStateController.shouldUseSplitNotificationShade(context.resources) Loading
packages/SystemUI/src/com/android/systemui/window/data/repository/NoopWindowRootViewBlurRepository.kt +2 −1 Original line number Diff line number Diff line Loading @@ -25,4 +25,5 @@ class NoopWindowRootViewBlurRepository @Inject constructor() : WindowRootViewBlu override val blurRadius: MutableStateFlow<Int> = MutableStateFlow(0) override val isBlurOpaque: MutableStateFlow<Boolean> = MutableStateFlow(true) override val isBlurSupported: StateFlow<Boolean> = MutableStateFlow(false) override var blurAppliedListener: BlurAppliedListener? = null }
packages/SystemUI/src/com/android/systemui/window/data/repository/WindowRootViewBlurRepository.kt +7 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import com.android.systemui.window.data.repository.WindowRootViewBlurRepository.Companion.isDisableBlurSysPropSet import java.util.concurrent.Executor import java.util.function.Consumer import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose Loading @@ -34,6 +35,8 @@ import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.stateIn typealias BlurAppliedListener = Consumer<Int> /** Repository that maintains state for the window blur effect. */ interface WindowRootViewBlurRepository { val blurRadius: MutableStateFlow<Int> Loading @@ -42,6 +45,8 @@ interface WindowRootViewBlurRepository { /** Is blur supported based on settings toggle and battery power saver mode. */ val isBlurSupported: StateFlow<Boolean> var blurAppliedListener: BlurAppliedListener? companion object { /** * Whether the `persist.sysui.disableBlur` is set, this is used to disable blur for tests. Loading Loading @@ -82,6 +87,8 @@ constructor( } // stateIn because this is backed by a binder call. .stateIn(scope, SharingStarted.WhileSubscribed(), false) override var blurAppliedListener: BlurAppliedListener? = null private fun isBlurAllowed(): Boolean { return ActivityManager.isHighEndGfx() && !isDisableBlurSysPropSet() } Loading