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

Function back

phone_agent/hdc/device.py:213–231  ·  view source on GitHub ↗

Press the back button. Args: device_id: Optional HDC device ID. delay: Delay in seconds after pressing back. If None, uses configured default.

(device_id: str | None = None, delay: float | None = None)

Source from the content-addressed store, hash-verified

211
212
213def back(device_id: str | None = None, delay: float | None = None) -> None:
214 """
215 Press the back button.
216
217 Args:
218 device_id: Optional HDC device ID.
219 delay: Delay in seconds after pressing back. If None, uses configured default.
220 """
221 if delay is None:
222 delay = TIMING_CONFIG.device.default_back_delay
223
224 hdc_prefix = _get_hdc_prefix(device_id)
225
226 # HarmonyOS uses uitest uiInput keyEvent Back
227 _run_hdc_command(
228 hdc_prefix + ["shell", "uitest", "uiInput", "keyEvent", "Back"],
229 capture_output=True
230 )
231 time.sleep(delay)
232
233
234def home(device_id: str | None = None, delay: float | None = None) -> None:

Callers

nothing calls this directly

Calls 2

_run_hdc_commandFunction · 0.90
_get_hdc_prefixFunction · 0.70

Tested by

no test coverage detected