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

Commit b297645f authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

Remove KEYGUARD_BOTTOM_AREA_REFACTOR flag

Bug: 383304368
Test: atest SystemUITests
Flag: EXEMPT flag removal
Change-Id: I1fcac3db4d09ed11310d38cb60ec5ab870748995
parent e9890579
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -264,14 +264,6 @@ flag {
    bug: "337259436"
    bug: "337259436"
}
}


flag {
    name: "keyguard_bottom_area_refactor"
    namespace: "systemui"
    description: "Bottom area of keyguard refactor move into KeyguardRootView. Includes "
        "lock icon and others."
    bug: "290652751"
}

flag {
flag {
    name: "device_entry_udfps_refactor"
    name: "device_entry_udfps_refactor"
    namespace: "systemui"
    namespace: "systemui"
+1 −0
Original line number Original line Diff line number Diff line
@@ -159,6 +159,7 @@ constructor(
                    with(lockSection) { LockIcon() }
                    with(lockSection) { LockIcon() }


                    // Aligned to bottom and constrained to below the lock icon.
                    // Aligned to bottom and constrained to below the lock icon.
                    // TODO("b/383588832") change this away from "keyguard_bottom_area"
                    Column(modifier = Modifier.fillMaxWidth().sysuiResTag("keyguard_bottom_area")) {
                    Column(modifier = Modifier.fillMaxWidth().sysuiResTag("keyguard_bottom_area")) {
                        if (isUdfpsVisible && ambientIndicationSectionOptional.isPresent) {
                        if (isUdfpsVisible && ambientIndicationSectionOptional.isPresent) {
                            with(ambientIndicationSectionOptional.get()) {
                            with(ambientIndicationSectionOptional.get()) {
+0 −21
Original line number Original line Diff line number Diff line
@@ -122,27 +122,6 @@ class KeyguardRepositoryImplTest : SysuiTestCase() {
            assertThat(underTest.animateBottomAreaDozingTransitions.value).isTrue()
            assertThat(underTest.animateBottomAreaDozingTransitions.value).isTrue()
        }
        }


    @Test
    fun bottomAreaAlpha() =
        testScope.runTest {
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f)

            underTest.setBottomAreaAlpha(0.1f)
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(0.1f)

            underTest.setBottomAreaAlpha(0.2f)
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(0.2f)

            underTest.setBottomAreaAlpha(0.3f)
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(0.3f)

            underTest.setBottomAreaAlpha(0.5f)
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(0.5f)

            underTest.setBottomAreaAlpha(1.0f)
            assertThat(underTest.bottomAreaAlpha.value).isEqualTo(1f)
        }

    @Test
    @Test
    fun panelAlpha() =
    fun panelAlpha() =
        testScope.runTest {
        testScope.runTest {
+0 −9
Original line number Original line Diff line number Diff line
@@ -56,20 +56,11 @@ class DefaultIndicationAreaSectionTest : SysuiTestCase() {


    @Test
    @Test
    fun addViewsConditionally() {
    fun addViewsConditionally() {
        mSetFlagsRule.enableFlags(AConfigFlags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR)
        val constraintLayout = ConstraintLayout(context, null)
        val constraintLayout = ConstraintLayout(context, null)
        underTest.addViews(constraintLayout)
        underTest.addViews(constraintLayout)
        assertThat(constraintLayout.childCount).isGreaterThan(0)
        assertThat(constraintLayout.childCount).isGreaterThan(0)
    }
    }


    @Test
    fun addViewsConditionally_migrateFlagOff() {
        mSetFlagsRule.disableFlags(AConfigFlags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR)
        val constraintLayout = ConstraintLayout(context, null)
        underTest.addViews(constraintLayout)
        assertThat(constraintLayout.childCount).isEqualTo(0)
    }

    @Test
    @Test
    fun applyConstraints() {
    fun applyConstraints() {
        val cs = ConstraintSet()
        val cs = ConstraintSet()
+0 −47
Original line number Original line Diff line number Diff line
@@ -20,7 +20,6 @@ import android.platform.test.annotations.DisableFlags
import android.platform.test.flag.junit.FlagsParameterization
import android.platform.test.flag.junit.FlagsParameterization
import androidx.test.filters.SmallTest
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.Flags.FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR
import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT
import com.android.systemui.Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT
import com.android.systemui.SysuiTestCase
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.domain.interactor.configurationInteractor
import com.android.systemui.common.ui.domain.interactor.configurationInteractor
@@ -31,7 +30,6 @@ import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.doze.util.BurnInHelperWrapper
import com.android.systemui.doze.util.BurnInHelperWrapper
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
import com.android.systemui.keyguard.domain.interactor.BurnInInteractor
import com.android.systemui.keyguard.domain.interactor.BurnInInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardBottomAreaInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.BurnInModel
import com.android.systemui.keyguard.shared.model.BurnInModel
@@ -61,8 +59,6 @@ import platform.test.runner.parameterized.Parameters
class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
    private val kosmos = testKosmos()
    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val testScope = kosmos.testScope

    private val bottomAreaInteractor = kosmos.keyguardBottomAreaInteractor
    private lateinit var underTest: KeyguardIndicationAreaViewModel
    private lateinit var underTest: KeyguardIndicationAreaViewModel
    private val keyguardRepository = kosmos.fakeKeyguardRepository
    private val keyguardRepository = kosmos.fakeKeyguardRepository
    private val communalSceneRepository = kosmos.fakeCommunalSceneRepository
    private val communalSceneRepository = kosmos.fakeCommunalSceneRepository
@@ -87,12 +83,6 @@ class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiT


    @Before
    @Before
    fun setUp() {
    fun setUp() {
        val bottomAreaViewModel =
            mock<KeyguardBottomAreaViewModel> {
                on { startButton } doReturn startButtonFlow
                on { endButton } doReturn endButtonFlow
                on { alpha } doReturn alphaFlow
            }
        val burnInInteractor =
        val burnInInteractor =
            mock<BurnInInteractor> {
            mock<BurnInInteractor> {
                on { burnIn(anyInt(), anyInt()) } doReturn flowOf(BurnInModel())
                on { burnIn(anyInt(), anyInt()) } doReturn flowOf(BurnInModel())
@@ -109,8 +99,6 @@ class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiT
        underTest =
        underTest =
            KeyguardIndicationAreaViewModel(
            KeyguardIndicationAreaViewModel(
                keyguardInteractor = kosmos.keyguardInteractor,
                keyguardInteractor = kosmos.keyguardInteractor,
                bottomAreaInteractor = bottomAreaInteractor,
                keyguardBottomAreaViewModel = bottomAreaViewModel,
                burnInHelperWrapper = burnInHelperWrapper,
                burnInHelperWrapper = burnInHelperWrapper,
                burnInInteractor = burnInInteractor,
                burnInInteractor = burnInInteractor,
                shortcutsCombinedViewModel = shortcutsCombinedViewModel,
                shortcutsCombinedViewModel = shortcutsCombinedViewModel,
@@ -123,23 +111,6 @@ class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiT
    }
    }


    @Test
    @Test
    fun alpha() =
        testScope.runTest {
            val alpha by collectLastValue(underTest.alpha)

            assertThat(alpha).isEqualTo(1f)
            alphaFlow.value = 0.1f
            assertThat(alpha).isEqualTo(0.1f)
            alphaFlow.value = 0.5f
            assertThat(alpha).isEqualTo(0.5f)
            alphaFlow.value = 0.2f
            assertThat(alpha).isEqualTo(0.2f)
            alphaFlow.value = 0f
            assertThat(alpha).isEqualTo(0f)
        }

    @Test
    @DisableFlags(FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR)
    fun isIndicationAreaPadded() =
    fun isIndicationAreaPadded() =
        testScope.runTest {
        testScope.runTest {
            keyguardRepository.setKeyguardShowing(true)
            keyguardRepository.setKeyguardShowing(true)
@@ -156,23 +127,6 @@ class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiT
            assertThat(isIndicationAreaPadded).isFalse()
            assertThat(isIndicationAreaPadded).isFalse()
        }
        }


    @Test
    @DisableFlags(FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT, FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR)
    fun indicationAreaTranslationX() =
        testScope.runTest {
            val translationX by collectLastValue(underTest.indicationAreaTranslationX)

            assertThat(translationX).isEqualTo(0f)
            bottomAreaInteractor.setClockPosition(100, 100)
            assertThat(translationX).isEqualTo(100f)
            bottomAreaInteractor.setClockPosition(200, 100)
            assertThat(translationX).isEqualTo(200f)
            bottomAreaInteractor.setClockPosition(200, 200)
            assertThat(translationX).isEqualTo(200f)
            bottomAreaInteractor.setClockPosition(300, 100)
            assertThat(translationX).isEqualTo(300f)
        }

    @Test
    @Test
    @DisableFlags(FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
    @DisableFlags(FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
    fun indicationAreaTranslationY() =
    fun indicationAreaTranslationY() =
@@ -236,7 +190,6 @@ class KeyguardIndicationAreaViewModelTest(flags: FlagsParameterization) : SysuiT
        @Parameters(name = "{0}")
        @Parameters(name = "{0}")
        fun getParams(): List<FlagsParameterization> {
        fun getParams(): List<FlagsParameterization> {
            return FlagsParameterization.allCombinationsOf(
            return FlagsParameterization.allCombinationsOf(
                FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR,
                FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT,
                FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT,
            )
            )
        }
        }
Loading