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

Commit f8d183fb authored by Dave McCloskey's avatar Dave McCloskey Committed by Automerger Merge Worker
Browse files

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

Merge "When dismissing lockscreen, wait up to 1.5 seconds for it to work." into tm-dev am: 1442d344

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

Change-Id: Ic6c720b7b0b48013f30e4efd3f025a5b2e1879f6
parents 136124d2 1442d344
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()