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
This commit is contained in:
vadimt
2020-03-02 18:05:58 -08:00
committed by Vadim Tryshev
parent 75bb8309c1
commit d8070756f1

View File

@@ -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();