Loading packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/data/repository/WallpaperRepositoryImplTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.test.filters.SmallTest import com.android.internal.R import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.res.R as SysUIR import com.android.systemui.shared.Flags as SharedFlags import com.android.systemui.user.data.model.SelectedUserModel Loading @@ -38,6 +39,7 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.any Loading @@ -53,6 +55,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { private val userRepository = FakeUserRepository() private val wallpaperFocalAreaRepository = FakeWallpaperFocalAreaRepository() private val wallpaperManager: WallpaperManager = mock() private val keyguardTransitionInteractor: KeyguardTransitionInteractor = mock() private val underTest: WallpaperRepositoryImpl by lazy { WallpaperRepositoryImpl( Loading @@ -63,6 +66,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { wallpaperFocalAreaRepository, wallpaperManager, context, keyguardTransitionInteractor, ) } Loading Loading @@ -245,6 +249,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { } @Test @Ignore("ag/31591766") @EnableFlags(SharedFlags.FLAG_EXTENDED_WALLPAPER_EFFECTS) fun shouldSendNotificationLayout_setExtendedEffectsWallpaper_launchSendLayoutJob() = testScope.runTest { Loading @@ -266,6 +271,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { } @Test @Ignore("ag/31591766") @EnableFlags(SharedFlags.FLAG_EXTENDED_WALLPAPER_EFFECTS) fun shouldSendNotificationLayout_setNotExtendedEffectsWallpaper_cancelSendLayoutJob() = testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt +47 −27 Original line number Diff line number Diff line Loading @@ -30,7 +30,12 @@ import com.android.internal.R import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor 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.res.R as SysUIR import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shared.Flags.ambientAod import com.android.systemui.shared.Flags.extendedWallpaperEffects import com.android.systemui.user.data.model.SelectedUserModel Loading Loading @@ -81,6 +86,7 @@ constructor( wallpaperFocalAreaRepository: WallpaperFocalAreaRepository, private val wallpaperManager: WallpaperManager, private val context: Context, keyguardTransitionInteractor: KeyguardTransitionInteractor, ) : WallpaperRepository { private val wallpaperChanged: Flow<Unit> = broadcastDispatcher Loading Loading @@ -131,8 +137,22 @@ constructor( if (shouldSendNotificationLayout) { sendLockscreenLayoutJob = scope.launch { wallpaperFocalAreaRepository.wallpaperFocalAreaBounds.collect { wallpaperFocalAreaBounds -> combine( wallpaperFocalAreaRepository.wallpaperFocalAreaBounds, keyguardTransitionInteractor .transition( edge = Edge.create(to = Scenes.Lockscreen), edgeWithoutSceneContainer = Edge.create(to = KeyguardState.LOCKSCREEN), ) .filter { transitionStep -> transitionStep.transitionState == TransitionState.STARTED }, ::Pair, ) .map { (bounds, _) -> bounds } .collect { wallpaperFocalAreaBounds -> wallpaperManager.sendWallpaperCommand( /* windowToken = */ rootView?.windowToken, /* action = */ WallpaperManager Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/data/repository/WallpaperRepositoryImplTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.test.filters.SmallTest import com.android.internal.R import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.res.R as SysUIR import com.android.systemui.shared.Flags as SharedFlags import com.android.systemui.user.data.model.SelectedUserModel Loading @@ -38,6 +39,7 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.any Loading @@ -53,6 +55,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { private val userRepository = FakeUserRepository() private val wallpaperFocalAreaRepository = FakeWallpaperFocalAreaRepository() private val wallpaperManager: WallpaperManager = mock() private val keyguardTransitionInteractor: KeyguardTransitionInteractor = mock() private val underTest: WallpaperRepositoryImpl by lazy { WallpaperRepositoryImpl( Loading @@ -63,6 +66,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { wallpaperFocalAreaRepository, wallpaperManager, context, keyguardTransitionInteractor, ) } Loading Loading @@ -245,6 +249,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { } @Test @Ignore("ag/31591766") @EnableFlags(SharedFlags.FLAG_EXTENDED_WALLPAPER_EFFECTS) fun shouldSendNotificationLayout_setExtendedEffectsWallpaper_launchSendLayoutJob() = testScope.runTest { Loading @@ -266,6 +271,7 @@ class WallpaperRepositoryImplTest : SysuiTestCase() { } @Test @Ignore("ag/31591766") @EnableFlags(SharedFlags.FLAG_EXTENDED_WALLPAPER_EFFECTS) fun shouldSendNotificationLayout_setNotExtendedEffectsWallpaper_cancelSendLayoutJob() = testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt +47 −27 Original line number Diff line number Diff line Loading @@ -30,7 +30,12 @@ import com.android.internal.R import com.android.systemui.broadcast.BroadcastDispatcher import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor 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.res.R as SysUIR import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shared.Flags.ambientAod import com.android.systemui.shared.Flags.extendedWallpaperEffects import com.android.systemui.user.data.model.SelectedUserModel Loading Loading @@ -81,6 +86,7 @@ constructor( wallpaperFocalAreaRepository: WallpaperFocalAreaRepository, private val wallpaperManager: WallpaperManager, private val context: Context, keyguardTransitionInteractor: KeyguardTransitionInteractor, ) : WallpaperRepository { private val wallpaperChanged: Flow<Unit> = broadcastDispatcher Loading Loading @@ -131,8 +137,22 @@ constructor( if (shouldSendNotificationLayout) { sendLockscreenLayoutJob = scope.launch { wallpaperFocalAreaRepository.wallpaperFocalAreaBounds.collect { wallpaperFocalAreaBounds -> combine( wallpaperFocalAreaRepository.wallpaperFocalAreaBounds, keyguardTransitionInteractor .transition( edge = Edge.create(to = Scenes.Lockscreen), edgeWithoutSceneContainer = Edge.create(to = KeyguardState.LOCKSCREEN), ) .filter { transitionStep -> transitionStep.transitionState == TransitionState.STARTED }, ::Pair, ) .map { (bounds, _) -> bounds } .collect { wallpaperFocalAreaBounds -> wallpaperManager.sendWallpaperCommand( /* windowToken = */ rootView?.windowToken, /* action = */ WallpaperManager Loading