Unlock the device. No changes are made if the device is already locked. Returns: Union['WebDriver', 'HardwareActions']: Self instance
(self)
| 47 | return self |
| 48 | |
| 49 | def unlock(self) -> Self: |
| 50 | """Unlock the device. No changes are made if the device is already locked. |
| 51 | |
| 52 | Returns: |
| 53 | Union['WebDriver', 'HardwareActions']: Self instance |
| 54 | """ |
| 55 | ext_name = 'mobile: unlock' |
| 56 | try: |
| 57 | if not self.assert_extension_exists(ext_name).execute_script('mobile: isLocked'): |
| 58 | return self |
| 59 | self.execute_script(ext_name) |
| 60 | except UnknownMethodException: |
| 61 | # TODO: Remove the fallback |
| 62 | self.mark_extension_absence(ext_name).execute(Command.UNLOCK) |
| 63 | return self |
| 64 | |
| 65 | def is_locked(self) -> bool: |
| 66 | """Checks whether the device is locked. |