Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19a61048 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Removes dependency on ComposeLockscreen

The ComposeLockscreen flag will not be rolling out without Flexiglass,
so removing it to simplify things.

Bug: 283121968
Fix: 360099862
Test: ran with flexiglass on and off - unlocked and relocked the device
Flag: NONE this is a flag changing CL
Change-Id: I6e19c2061edf729e9bc61daf9d8629a3014dc6b2
parent 88a00014
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -667,13 +667,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"
+8 −9
Original line number Diff line number Diff line
@@ -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
@@ -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 }
@@ -75,7 +74,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
            sensorId = 1,
            strength = SensorStrength.STRONG,
            sensorType = FingerprintSensorType.POWER_BUTTON,
            sensorLocations = mapOf()
            sensorLocations = mapOf(),
        )
    }

@@ -93,7 +92,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN)
    @DisableSceneContainer
    fun testAppliesSplitShadeBlueprint() {
        testScope.runTest {
            val blueprintId by collectLastValue(underTest.blueprintId)
@@ -107,7 +106,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN)
    @EnableSceneContainer
    fun testDoesNotApplySplitShadeBlueprint() {
        testScope.runTest {
            val blueprintId by collectLastValue(underTest.blueprintId)
@@ -122,7 +121,7 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    }

    @Test
    @DisableFlags(Flags.FLAG_COMPOSE_LOCKSCREEN)
    @DisableSceneContainer
    fun fingerprintPropertyInitialized_updatesBlueprint() {
        testScope.runTest {
            underTest.start()
+43 −87
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -166,7 +157,7 @@ class AodBurnInViewModelTest : SysuiTestCase() {
                    from = KeyguardState.GONE,
                    to = KeyguardState.AOD,
                    value = 0f,
                    transitionState = TransitionState.STARTED
                    transitionState = TransitionState.STARTED,
                ),
                validateStep = false,
            )
@@ -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)
@@ -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)
@@ -217,7 +199,7 @@ class AodBurnInViewModelTest : SysuiTestCase() {
                    from = KeyguardState.GONE,
                    to = KeyguardState.AOD,
                    value = 0f,
                    transitionState = TransitionState.STARTED
                    transitionState = TransitionState.STARTED,
                ),
                validateStep = false,
            )
@@ -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)
@@ -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)
@@ -268,7 +241,7 @@ class AodBurnInViewModelTest : SysuiTestCase() {
                    from = KeyguardState.GONE,
                    to = KeyguardState.AOD,
                    value = 0f,
                    transitionState = TransitionState.STARTED
                    transitionState = TransitionState.STARTED,
                ),
                validateStep = false,
            )
@@ -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)
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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)
+10 −11
Original line number Diff line number Diff line
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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
@@ -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