From d8070756f1e9dbada59d2c8d896cd415686f18ad Mon Sep 17 00:00:00 2001 From: vadimt Date: Mon, 2 Mar 2020 18:05:58 -0800 Subject: [PATCH] Making sure the device doesn't lock during test execution Unlocking the device at the beginning of the test does help, but perhaps we should prevent locking during the test execution. Some failures still remain. Bug: 151613234 --- .../src/com/android/launcher3/ui/AbstractLauncherUiTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 535abbf341..f5dd995fc9 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -220,8 +220,12 @@ public abstract class AbstractLauncherUiTest { @Before public void setUp() throws Exception { + mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3"); if (hasSystemUiObject("keyguard_status_view")) { + Log.d(TAG, "Before unlocking the phone"); mDevice.executeShellCommand("input keyevent 82"); + } else { + Log.d(TAG, "Phone isn't locked"); } final String launcherPackageName = mDevice.getLauncherPackageName();