Skip to content

Commit

Permalink
developer: add accessibility reset
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitshah4 authored Dec 2, 2024
1 parent 049b85f commit 937b52d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pymobiledevice3/cli/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,13 @@ def accessibility_settings_set(service_provider: LockdownClient, setting, value)
service.set_setting(setting, eval(value))
OSUTILS.wait_return()

@accessibility_settings.command('reset', cls=Command)
def accessibility_settings_reset(service_provider: LockdownClient):
"""
reset accessibility settings to default
"""
service = AccessibilityAudit(service_provider)
service.reset_settings()

@accessibility.command('shell', cls=Command)
def accessibility_shell(service_provider: LockdownClient):
Expand Down
3 changes: 3 additions & 0 deletions pymobiledevice3/services/accessibilityaudit.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def set_setting(self, name: str, value: typing.Any) -> None:
MessageAux().append_obj(setting).append_obj({'ObjectType': 'passthrough', 'Value': value}),
expects_reply=False)

def reset_settings(self) -> None:
self.broadcast.deviceResetToDefaultAccessibilitySettings()

def iter_elements(self) -> Generator[AXAuditInspectorFocus_v1, None, None]:
iterator = self.iter_events()

Expand Down

0 comments on commit 937b52d

Please sign in to comment.