Checks whether the device is locked. Returns: `True` if the device is locked
(self)
| 63 | return self |
| 64 | |
| 65 | def is_locked(self) -> bool: |
| 66 | """Checks whether the device is locked. |
| 67 | |
| 68 | Returns: |
| 69 | `True` if the device is locked |
| 70 | """ |
| 71 | ext_name = 'mobile: isLocked' |
| 72 | try: |
| 73 | return self.assert_extension_exists(ext_name).execute_script('mobile: isLocked') |
| 74 | except UnknownMethodException: |
| 75 | # TODO: Remove the fallback |
| 76 | return self.mark_extension_absence(ext_name).execute(Command.IS_LOCKED)['value'] |
| 77 | |
| 78 | def shake(self) -> Self: |
| 79 | """Shake the device. |