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

Commit 3bf5ff89 authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Automerger Merge Worker
Browse files

Merge "Fixes bug where affordances are visible in AOD" into tm-qpr-dev am:...

Merge "Fixes bug where affordances are visible in AOD" into tm-qpr-dev am: e7212346 am: d87c7ada

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20115397



Change-Id: Ie5c2184d3de0feade93122bbac10797ce0c8f5e8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 936fba0a d87c7ada
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -157,7 +157,11 @@ constructor(
                        }
                    }
                dozeHost.addCallback(callback)
                trySendWithFailureLogging(false, TAG, "initial isDozing: false")
                trySendWithFailureLogging(
                    statusBarStateController.isDozing,
                    TAG,
                    "initial isDozing",
                )

                awaitClose { dozeHost.removeCallback(callback) }
            }
+16 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.systemui.doze.DozeHost
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
@@ -33,7 +34,6 @@ import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations

@SmallTest
@@ -152,6 +152,21 @@ class KeyguardRepositoryImplTest : SysuiTestCase() {
        verify(dozeHost).removeCallback(captor.value)
    }

    @Test
    fun `isDozing - starts with correct initial value for isDozing`() = runBlockingTest {
        var latest: Boolean? = null

        whenever(statusBarStateController.isDozing).thenReturn(true)
        var job = underTest.isDozing.onEach { latest = it }.launchIn(this)
        assertThat(latest).isTrue()
        job.cancel()

        whenever(statusBarStateController.isDozing).thenReturn(false)
        job = underTest.isDozing.onEach { latest = it }.launchIn(this)
        assertThat(latest).isFalse()
        job.cancel()
    }

    @Test
    fun dozeAmount() = runBlockingTest {
        val values = mutableListOf<Float>()