MCPcopy
hub / github.com/zai-org/Open-AutoGLM / restore_keyboard

Function restore_keyboard

phone_agent/hdc/input.py:124–142  ·  view source on GitHub ↗

Restore the original keyboard IME. Args: ime: The IME identifier to restore. device_id: Optional HDC device ID for multi-device setups.

(ime: str, device_id: str | None = None)

Source from the content-addressed store, hash-verified

122
123
124def restore_keyboard(ime: str, device_id: str | None = None) -> None:
125 """
126 Restore the original keyboard IME.
127
128 Args:
129 ime: The IME identifier to restore.
130 device_id: Optional HDC device ID for multi-device setups.
131 """
132 if not ime:
133 return
134
135 hdc_prefix = _get_hdc_prefix(device_id)
136
137 try:
138 _run_hdc_command(
139 hdc_prefix + ["shell", "ime", "set", ime], capture_output=True, text=True
140 )
141 except Exception:
142 pass
143
144
145def _get_hdc_prefix(device_id: str | None) -> list:

Callers

nothing calls this directly

Calls 2

_run_hdc_commandFunction · 0.90
_get_hdc_prefixFunction · 0.70

Tested by

no test coverage detected