Closed
Description
Quoting from SO-35223434-
We have called driver.lockScreen(20);
in my test followed by Runtime.getRuntime().exec("adb shell input keyevent 26");
to unlock screen. But the problem is the device is not getting locked for 20 sec. The next statement keyevent 26 is unlocking the device as soon as device is locked. So why we are providing 20 sec
parameter?
Looking further into this, the AppiumDriver.java has this to say :
/** * Lock the device (bring it to the lock screen) for a given number of * seconds * * @param seconds * number of seconds to lock the screen for */ public void lockScreen(int seconds) { execute(LOCK, ImmutableMap.of("seconds", seconds)); }