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)
| 122 | |
| 123 | |
| 124 | def 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 | |
| 145 | def _get_hdc_prefix(device_id: str | None) -> list: |
nothing calls this directly
no test coverage detected