Loading packages/SystemUI/aconfig/systemui.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -677,13 +677,6 @@ flag { bug: "278086361" } flag { name: "compose_lockscreen" namespace: "systemui" description: "Enables the compose version of lockscreen that runs standalone, outside of Flexiglass." bug: "301968149" } flag { name: "enable_contextual_tip_for_power_off" namespace: "systemui" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractorTest.kt +8 −9 Original line number Diff line number Diff line Loading @@ -17,17 +17,16 @@ package com.android.systemui.keyguard.domain.interactor import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.biometrics.data.repository.fakeFingerprintPropertyRepository import com.android.systemui.biometrics.shared.model.FingerprintSensorType import com.android.systemui.biometrics.shared.model.SensorStrength import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.keyguardBlueprintRepository import com.android.systemui.keyguard.ui.view.layout.blueprints.DefaultKeyguardBlueprint Loading Loading @@ -59,8 +58,8 @@ import org.mockito.MockitoAnnotations class KeyguardBlueprintInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val underTest = kosmos.keyguardBlueprintInteractor private val keyguardBlueprintRepository = kosmos.keyguardBlueprintRepository private val underTest by lazy { kosmos.keyguardBlueprintInteractor } private val keyguardBlueprintRepository by lazy { kosmos.keyguardBlueprintRepository } private val clockRepository by lazy { kosmos.fakeKeyguardClockRepository } private val configurationRepository by lazy { kosmos.fakeConfigurationRepository } private val fingerprintPropertyRepository by lazy { kosmos.fakeFingerprintPropertyRepository } Loading @@ -75,7 +74,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { sensorId = 1, strength = SensorStrength.STRONG, sensorType = FingerprintSensorType.POWER_BUTTON, sensorLocations = mapOf() sensorLocations = mapOf(), ) } Loading @@ -93,7 +92,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer fun testAppliesSplitShadeBlueprint() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) Loading @@ -107,7 +106,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @EnableSceneContainer fun testDoesNotApplySplitShadeBlueprint() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) Loading @@ -122,7 +121,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer fun fingerprintPropertyInitialized_updatesBlueprint() { testScope.runTest { underTest.start() Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/AodBurnInViewModelTest.kt +43 −87 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import androidx.test.filters.SmallTest import com.android.systemui.Flags as AConfigFlags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository import com.android.systemui.keyguard.domain.interactor.BurnInInteractor Loading @@ -44,6 +46,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.emptyFlow 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.Answers Loading Loading @@ -71,10 +74,8 @@ class AodBurnInViewModelTest : SysuiTestCase() { private val burnInFlow = MutableStateFlow(BurnInModel()) @Before @DisableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) @DisableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @DisableSceneContainer fun setUp() { MockitoAnnotations.initMocks(this) whenever(burnInInteractor.burnIn(anyInt(), anyInt())).thenReturn(burnInFlow) Loading Loading @@ -112,18 +113,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(0) assertThat(movement?.translationY).isEqualTo(0) Loading @@ -143,17 +139,12 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading @@ -166,7 +157,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -180,11 +171,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { @DisableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_whenFullyDozing_MigrationFlagOff_staysOutOfTopInset() = testScope.runTest { burnInParameters = burnInParameters.copy( minViewY = 100, topInset = 80, ) burnInParameters = burnInParameters.copy(minViewY = 100, topInset = 80) val movement by collectLastValue(underTest.movement(burnInParameters)) // Set to dozing (on AOD) Loading @@ -193,18 +180,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = -30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = -30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) // -20 instead of -30, due to inset of 80 assertThat(movement?.translationY).isEqualTo(-20) Loading @@ -217,7 +199,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -231,11 +213,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_whenFullyDozing_MigrationFlagOn_staysOutOfTopInset() = testScope.runTest { burnInParameters = burnInParameters.copy( minViewY = 100, topInset = 80, ) burnInParameters = burnInParameters.copy(minViewY = 100, topInset = 80) val movement by collectLastValue(underTest.movement(burnInParameters)) // Set to dozing (on AOD) Loading @@ -244,18 +222,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = -30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = -30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) // -20 instead of -30, due to inset of 80 assertThat(movement?.translationY).isEqualTo(-20) Loading @@ -268,7 +241,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -291,18 +264,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading @@ -311,9 +279,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { } @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_weatherLargeClock() = fun translationAndScale_sceneContainerOff_weatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = true, Loading @@ -321,9 +289,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_weatherSmallClock() = fun translationAndScale_sceneContainerOff_weatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = true, Loading @@ -331,9 +299,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_nonWeatherLargeClock() = fun translationAndScale_sceneContainerOff_nonWeatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = false, Loading @@ -341,9 +309,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_nonWeatherSmallClock() = fun translationAndScale_sceneContainerOff_nonWeatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = false, Loading @@ -351,11 +319,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_weatherLargeClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_weatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = true, Loading @@ -363,11 +329,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_weatherSmallClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_weatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = true, Loading @@ -375,11 +339,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_nonWeatherLargeClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_nonWeatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = false, Loading @@ -387,11 +349,10 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_nonWeatherSmallClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer @Ignore("b/367659687") fun translationAndScale_sceneContainerOn_nonWeatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = false, Loading Loading @@ -421,18 +382,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.LOCKSCREEN, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardClockViewModelTest.kt +10 −11 Original line number Diff line number Diff line Loading @@ -16,14 +16,13 @@ package com.android.systemui.keyguard.ui.viewmodel import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.BrokenWithSceneContainer import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.flags.andSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.keyguardClockRepository Loading Loading @@ -229,8 +228,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_splitShade_composeLockscreenOn() = @EnableSceneContainer fun testSmallClockTop_splitShade_sceneContainerOn() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) Loading @@ -244,8 +243,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_splitShade_composeLockscreenOff() = @DisableSceneContainer fun testSmallClockTop_splitShade_sceneContainerOff() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) Loading @@ -257,8 +256,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_nonSplitShade_composeLockscreenOn() = @EnableSceneContainer fun testSmallClockTop_nonSplitShade_sceneContainerOn() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(false) Loading @@ -270,8 +269,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_nonSplitShade_composeLockscreenOff() = @DisableSceneContainer fun testSmallClockTop_nonSplitShade_sceneContainerOff() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(false) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/scene/shared/flag/SceneContainerFlagParameterizationTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,8 @@ package com.android.systemui.scene.shared.flag import android.platform.test.flag.junit.FlagsParameterization import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags.FLAG_COMPOSE_LOCKSCREEN import com.android.systemui.Flags.FLAG_EXAMPLE_FLAG import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR import com.android.systemui.Flags.FLAG_SCENE_CONTAINER import com.android.systemui.SysuiTestCase import com.android.systemui.flags.andSceneContainer Loading Loading @@ -66,7 +66,7 @@ internal class SceneContainerFlagParameterizationTest : SysuiTestCase() { @Test fun oneDependencyAndSceneContainer() { val dependentFlag = FLAG_COMPOSE_LOCKSCREEN val dependentFlag = FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR val result = FlagsParameterization.allCombinationsOf(dependentFlag).andSceneContainer() Truth.assertThat(result).hasSize(3) Truth.assertThat(result[0].mOverrides[dependentFlag]).isFalse() Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -677,13 +677,6 @@ flag { bug: "278086361" } flag { name: "compose_lockscreen" namespace: "systemui" description: "Enables the compose version of lockscreen that runs standalone, outside of Flexiglass." bug: "301968149" } flag { name: "enable_contextual_tip_for_power_off" namespace: "systemui" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractorTest.kt +8 −9 Original line number Diff line number Diff line Loading @@ -17,17 +17,16 @@ package com.android.systemui.keyguard.domain.interactor import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.biometrics.data.repository.fakeFingerprintPropertyRepository import com.android.systemui.biometrics.shared.model.FingerprintSensorType import com.android.systemui.biometrics.shared.model.SensorStrength import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.keyguardBlueprintRepository import com.android.systemui.keyguard.ui.view.layout.blueprints.DefaultKeyguardBlueprint Loading Loading @@ -59,8 +58,8 @@ import org.mockito.MockitoAnnotations class KeyguardBlueprintInteractorTest : SysuiTestCase() { private val kosmos = testKosmos() private val testScope = kosmos.testScope private val underTest = kosmos.keyguardBlueprintInteractor private val keyguardBlueprintRepository = kosmos.keyguardBlueprintRepository private val underTest by lazy { kosmos.keyguardBlueprintInteractor } private val keyguardBlueprintRepository by lazy { kosmos.keyguardBlueprintRepository } private val clockRepository by lazy { kosmos.fakeKeyguardClockRepository } private val configurationRepository by lazy { kosmos.fakeConfigurationRepository } private val fingerprintPropertyRepository by lazy { kosmos.fakeFingerprintPropertyRepository } Loading @@ -75,7 +74,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { sensorId = 1, strength = SensorStrength.STRONG, sensorType = FingerprintSensorType.POWER_BUTTON, sensorLocations = mapOf() sensorLocations = mapOf(), ) } Loading @@ -93,7 +92,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer fun testAppliesSplitShadeBlueprint() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) Loading @@ -107,7 +106,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @EnableSceneContainer fun testDoesNotApplySplitShadeBlueprint() { testScope.runTest { val blueprintId by collectLastValue(underTest.blueprintId) Loading @@ -122,7 +121,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() { } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer fun fingerprintPropertyInitialized_updatesBlueprint() { testScope.runTest { underTest.start() Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/AodBurnInViewModelTest.kt +43 −87 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ import androidx.test.filters.SmallTest import com.android.systemui.Flags as AConfigFlags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository import com.android.systemui.keyguard.domain.interactor.BurnInInteractor Loading @@ -44,6 +46,7 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.emptyFlow 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.Answers Loading Loading @@ -71,10 +74,8 @@ class AodBurnInViewModelTest : SysuiTestCase() { private val burnInFlow = MutableStateFlow(BurnInModel()) @Before @DisableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) @DisableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @DisableSceneContainer fun setUp() { MockitoAnnotations.initMocks(this) whenever(burnInInteractor.burnIn(anyInt(), anyInt())).thenReturn(burnInFlow) Loading Loading @@ -112,18 +113,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.AOD, to = KeyguardState.LOCKSCREEN, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(0) assertThat(movement?.translationY).isEqualTo(0) Loading @@ -143,17 +139,12 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading @@ -166,7 +157,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -180,11 +171,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { @DisableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_whenFullyDozing_MigrationFlagOff_staysOutOfTopInset() = testScope.runTest { burnInParameters = burnInParameters.copy( minViewY = 100, topInset = 80, ) burnInParameters = burnInParameters.copy(minViewY = 100, topInset = 80) val movement by collectLastValue(underTest.movement(burnInParameters)) // Set to dozing (on AOD) Loading @@ -193,18 +180,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = -30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = -30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) // -20 instead of -30, due to inset of 80 assertThat(movement?.translationY).isEqualTo(-20) Loading @@ -217,7 +199,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -231,11 +213,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_whenFullyDozing_MigrationFlagOn_staysOutOfTopInset() = testScope.runTest { burnInParameters = burnInParameters.copy( minViewY = 100, topInset = 80, ) burnInParameters = burnInParameters.copy(minViewY = 100, topInset = 80) val movement by collectLastValue(underTest.movement(burnInParameters)) // Set to dozing (on AOD) Loading @@ -244,18 +222,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = -30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = -30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) // -20 instead of -30, due to inset of 80 assertThat(movement?.translationY).isEqualTo(-20) Loading @@ -268,7 +241,7 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 0f, transitionState = TransitionState.STARTED transitionState = TransitionState.STARTED, ), validateStep = false, ) Loading @@ -291,18 +264,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.GONE, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading @@ -311,9 +279,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { } @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_weatherLargeClock() = fun translationAndScale_sceneContainerOff_weatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = true, Loading @@ -321,9 +289,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_weatherSmallClock() = fun translationAndScale_sceneContainerOff_weatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = true, Loading @@ -331,9 +299,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_nonWeatherLargeClock() = fun translationAndScale_sceneContainerOff_nonWeatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = false, Loading @@ -341,9 +309,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @DisableFlags(AConfigFlags.FLAG_COMPOSE_LOCKSCREEN) @DisableSceneContainer @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) fun translationAndScale_composeFlagOff_nonWeatherSmallClock() = fun translationAndScale_sceneContainerOff_nonWeatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = false, Loading @@ -351,11 +319,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_weatherLargeClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_weatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = true, Loading @@ -363,11 +329,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_weatherSmallClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_weatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = true, Loading @@ -375,11 +339,9 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_nonWeatherLargeClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer fun translationAndScale_sceneContainerOn_nonWeatherLargeClock() = testBurnInViewModelForClocks( isSmallClock = false, isWeatherClock = false, Loading @@ -387,11 +349,10 @@ class AodBurnInViewModelTest : SysuiTestCase() { ) @Test @EnableFlags( AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, AConfigFlags.FLAG_COMPOSE_LOCKSCREEN ) fun translationAndScale_composeFlagOn_nonWeatherSmallClock() = @EnableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) @EnableSceneContainer @Ignore("b/367659687") fun translationAndScale_sceneContainerOn_nonWeatherSmallClock() = testBurnInViewModelForClocks( isSmallClock = true, isWeatherClock = false, Loading Loading @@ -421,18 +382,13 @@ class AodBurnInViewModelTest : SysuiTestCase() { from = KeyguardState.LOCKSCREEN, to = KeyguardState.AOD, value = 1f, transitionState = TransitionState.FINISHED transitionState = TransitionState.FINISHED, ), validateStep = false, ) // Trigger a change to the burn-in model burnInFlow.value = BurnInModel( translationX = 20, translationY = 30, scale = 0.5f, ) burnInFlow.value = BurnInModel(translationX = 20, translationY = 30, scale = 0.5f) assertThat(movement?.translationX).isEqualTo(20) assertThat(movement?.translationY).isEqualTo(30) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardClockViewModelTest.kt +10 −11 Original line number Diff line number Diff line Loading @@ -16,14 +16,13 @@ package com.android.systemui.keyguard.ui.viewmodel import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.platform.test.flag.junit.FlagsParameterization import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.BrokenWithSceneContainer import com.android.systemui.flags.DisableSceneContainer import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.flags.andSceneContainer import com.android.systemui.keyguard.data.repository.fakeKeyguardClockRepository import com.android.systemui.keyguard.data.repository.keyguardClockRepository Loading Loading @@ -229,8 +228,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_splitShade_composeLockscreenOn() = @EnableSceneContainer fun testSmallClockTop_splitShade_sceneContainerOn() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) Loading @@ -244,8 +243,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_splitShade_composeLockscreenOff() = @DisableSceneContainer fun testSmallClockTop_splitShade_sceneContainerOff() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(true) Loading @@ -257,8 +256,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_nonSplitShade_composeLockscreenOn() = @EnableSceneContainer fun testSmallClockTop_nonSplitShade_sceneContainerOn() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(false) Loading @@ -270,8 +269,8 @@ class KeyguardClockViewModelTest(flags: FlagsParameterization) : SysuiTestCase() } @Test @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN) fun testSmallClockTop_nonSplitShade_composeLockscreenOff() = @DisableSceneContainer fun testSmallClockTop_nonSplitShade_sceneContainerOff() = testScope.runTest { with(kosmos) { shadeRepository.setShadeLayoutWide(false) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/scene/shared/flag/SceneContainerFlagParameterizationTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,8 @@ package com.android.systemui.scene.shared.flag import android.platform.test.flag.junit.FlagsParameterization import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags.FLAG_COMPOSE_LOCKSCREEN import com.android.systemui.Flags.FLAG_EXAMPLE_FLAG import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR import com.android.systemui.Flags.FLAG_SCENE_CONTAINER import com.android.systemui.SysuiTestCase import com.android.systemui.flags.andSceneContainer Loading Loading @@ -66,7 +66,7 @@ internal class SceneContainerFlagParameterizationTest : SysuiTestCase() { @Test fun oneDependencyAndSceneContainer() { val dependentFlag = FLAG_COMPOSE_LOCKSCREEN val dependentFlag = FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR val result = FlagsParameterization.allCombinationsOf(dependentFlag).andSceneContainer() Truth.assertThat(result).hasSize(3) Truth.assertThat(result[0].mOverrides[dependentFlag]).isFalse() Loading