From c95cbf9cde00f4ab2e91b5b0643ea300d703622f Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 6 Jul 2023 10:57:19 -0700 Subject: Fix test flake in sysui test suite. This code creates a timer 1 second in the future, which causes code to run that has alredy been deconstructed, leading to an instrumentation crash. Fixes: 290111230 Test: atp v2/android-virtual-infra/test_mapping/presubmit-large-avd Change-Id: Ibd786995cc6b8252aa5ce07d2aea5977ae2551db Merged-In: Ibd786995cc6b8252aa5ce07d2aea5977ae2551db (cherry picked from commit d0e22c52ed622d0bc7f1ab1403ac4a538a1a6840) --- .../com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java index fa32835c2695..677d3ff3df69 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java @@ -187,9 +187,7 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase { @Test public void testLockedOut_verifyPasswordAndUnlock_doesNotEnableViewInput() { - mKeyguardAbsKeyInputViewController.handleAttemptLockout( - SystemClock.elapsedRealtime() + 1000); - mKeyguardAbsKeyInputViewController.verifyPasswordAndUnlock(); + mKeyguardAbsKeyInputViewController.handleAttemptLockout(SystemClock.elapsedRealtime()); verify(mAbsKeyInputView).setPasswordEntryInputEnabled(false); verify(mAbsKeyInputView).setPasswordEntryEnabled(false); verify(mAbsKeyInputView, never()).setPasswordEntryInputEnabled(true); -- cgit v1.2.3-59-g8ed1b