Loading packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperFocalAreaViewModelTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,15 @@ class WallpaperFocalAreaViewModelTest : SysuiTestCase() { assertThat(bounds).isNotNull() } @Test fun onReboot_sendFocalBounds() = testScope.runTest { val bounds by collectLastValue(underTest.wallpaperFocalAreaBounds) kosmos.wallpaperFocalAreaRepository.setHasFocalArea(true) setTestFocalAreaBounds() assertThat(bounds).isNotNull() } private fun setTestFocalAreaBounds( shadeLayoutWide: Boolean = false, activeNotifs: Int = 0, Loading packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart Loading Loading @@ -177,6 +178,7 @@ constructor( override val shouldSendFocalArea = lockscreenWallpaperInfo .filterNotNull() .map { val focalAreaTarget = context.resources.getString(SysUIR.string.focal_area_target) val shouldSendNotificationLayout = it?.component?.className == focalAreaTarget Loading packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperFocalAreaViewModel.kt +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInterac import com.android.systemui.keyguard.shared.model.Edge import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.keyguard.shared.model.TransitionStep import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.wallpapers.domain.interactor.WallpaperFocalAreaInteractor import javax.inject.Inject Loading @@ -29,6 +30,7 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.onStart class WallpaperFocalAreaViewModel @Inject Loading @@ -55,6 +57,10 @@ constructor( .filter { it.transitionState == TransitionState.FINISHED }, ::Pair, ) // Enforce collecting wallpaperFocalAreaBounds after rebooting .onStart { emit(Pair(TransitionStep(to = KeyguardState.LOCKSCREEN), TransitionStep())) } .flatMapLatest { (startedStep, _) -> // Subscribe to bounds within the period of transitioning to the lockscreen, // prior to any transitions away. Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperFocalAreaViewModelTest.kt +9 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,15 @@ class WallpaperFocalAreaViewModelTest : SysuiTestCase() { assertThat(bounds).isNotNull() } @Test fun onReboot_sendFocalBounds() = testScope.runTest { val bounds by collectLastValue(underTest.wallpaperFocalAreaBounds) kosmos.wallpaperFocalAreaRepository.setHasFocalArea(true) setTestFocalAreaBounds() assertThat(bounds).isNotNull() } private fun setTestFocalAreaBounds( shadeLayoutWide: Boolean = false, activeNotifs: Int = 0, Loading
packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart Loading Loading @@ -177,6 +178,7 @@ constructor( override val shouldSendFocalArea = lockscreenWallpaperInfo .filterNotNull() .map { val focalAreaTarget = context.resources.getString(SysUIR.string.focal_area_target) val shouldSendNotificationLayout = it?.component?.className == focalAreaTarget Loading
packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperFocalAreaViewModel.kt +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInterac import com.android.systemui.keyguard.shared.model.Edge import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.TransitionState import com.android.systemui.keyguard.shared.model.TransitionStep import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.wallpapers.domain.interactor.WallpaperFocalAreaInteractor import javax.inject.Inject Loading @@ -29,6 +30,7 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.emptyFlow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.onStart class WallpaperFocalAreaViewModel @Inject Loading @@ -55,6 +57,10 @@ constructor( .filter { it.transitionState == TransitionState.FINISHED }, ::Pair, ) // Enforce collecting wallpaperFocalAreaBounds after rebooting .onStart { emit(Pair(TransitionStep(to = KeyguardState.LOCKSCREEN), TransitionStep())) } .flatMapLatest { (startedStep, _) -> // Subscribe to bounds within the period of transitioning to the lockscreen, // prior to any transitions away. Loading