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

Commit b719c6bc authored by Dave McCloskey's avatar Dave McCloskey
Browse files

When dismissing lockscreen, wait up to 1.5 seconds for it to work.

Bug: 221155933
Test: atest TrustTests --iterations 5 showed no failures on acloud
Change-Id: I4c845e0f032052f6de36fd95d4aa131a03e82a8f
parent f7b81da3
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -59,8 +59,14 @@ class ScreenLockRule : TestRule {
    }

    private fun verifyKeyguardDismissed() {
        val maxWaits = 30
        var waitCount = 0
        while (windowManager.isKeyguardLocked && waitCount < maxWaits) {
            Log.i(TAG, "Keyguard still showing; attempting to dismiss and wait 50ms ($waitCount)")
            windowManager.dismissKeyguard(null, null)
        Thread.sleep(250)
            Thread.sleep(50)
            waitCount++
        }
        assertWithMessage("Keyguard should be unlocked")
            .that(windowManager.isKeyguardLocked)
            .isFalse()