Package io.appium.java_client
Interface LocksDevice
- All Superinterfaces:
CanRememberExtensionPresence,ExecutesMethod
- All Known Implementing Classes:
AndroidDriver,FlutterAndroidDriver,FlutterIOSDriver,IOSDriver
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanCheck if the device is locked.default voidThis method locks a device.default voidlockDevice(Duration duration) Lock the device (bring it to the lock screen) for a given number of seconds or forever (until the command for unlocking is called).default voidUnlock the device if it is locked.Methods inherited from interface io.appium.java_client.CanRememberExtensionPresence
assertExtensionExists, markExtensionAbsenceMethods inherited from interface io.appium.java_client.ExecutesMethod
execute, execute
-
Method Details
-
lockDevice
default void lockDevice()This method locks a device. It will return silently if the device is already locked. -
lockDevice
Lock the device (bring it to the lock screen) for a given number of seconds or forever (until the command for unlocking is called). The call is ignored if the device has been already locked.- Parameters:
duration- for how long to lock the screen. Minimum time resolution is one second. A negative/zero value will lock the device and return immediately.
-
unlockDevice
default void unlockDevice()Unlock the device if it is locked. This method will return silently if the device is not locked. -
isDeviceLocked
default boolean isDeviceLocked()Check if the device is locked.- Returns:
- true if the device is locked or false otherwise.
-