Interface LocksDevice

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean isDeviceLocked()
      Check if the device is locked.
      default void lockDevice()
      This method locks a device.
      default void lockDevice​(java.time.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 void unlockDevice()
      Unlock the device if it is locked.
    • Method Detail

      • lockDevice

        default void lockDevice()
        This method locks a device. It will return silently if the device is already locked.
      • lockDevice

        default void lockDevice​(java.time.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). 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.