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

Commit b16e4aae authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix default scale value

This could make the burn in layer look invisible b/c
the scale was zero.

Fixes: 329398010
Test: atest KeyguardRootViewModelTest
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint
TEAMFOOD

Change-Id: I4ca4039f37f93b1519561fb27a1d8ccc6c3944c3
parent 9e05f29f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -81,12 +81,12 @@ class AodBurnInViewModelTest : SysuiTestCase() {
    }

    @Test
    fun movement_initializedToZero() =
    fun movement_initializedToDefaultValues() =
        testScope.runTest {
            val movement by collectLastValue(underTest.movement(burnInParameters))
            assertThat(movement?.translationY).isEqualTo(0)
            assertThat(movement?.translationX).isEqualTo(0)
            assertThat(movement?.scale).isEqualTo(0f)
            assertThat(movement?.scale).isEqualTo(1f)
        }

    @Test
+7 −0
Original line number Diff line number Diff line
@@ -85,6 +85,13 @@ class KeyguardRootViewModelTest : SysuiTestCase() {
        mSetFlagsRule.disableFlags(AConfigFlags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
    }

    @Test
    fun defaultBurnInScaleEqualsOne() =
        testScope.runTest {
            val burnInScale by collectLastValue(underTest.scale)
            assertThat(burnInScale!!.scale).isEqualTo(1f)
        }

    @Test
    fun burnInLayerVisibility() =
        testScope.runTest {
+1 −1
Original line number Diff line number Diff line
@@ -20,6 +20,6 @@ package com.android.systemui.keyguard.shared.model
data class BurnInModel(
    val translationX: Int = 0,
    val translationY: Int = 0,
    val scale: Float = 0f,
    val scale: Float = 1f,
    val scaleClockOnly: Boolean = false,
)