DroidMcpInputMethodService
Abstract InputMethodService that hosts droid-mcp's "LLM keyboard." Renders a minimal input view (typing is driven by MCP tools, not by user touches on a key grid) with a single "Switch back" button so users can return to their normal keyboard, and registers itself with InputMethodServiceHolder so tools can reach the currently-bound InputConnection.
The host app:
Declares a concrete subclass in its manifest with
android.permission.BIND_INPUT_METHODand an<intent-filter>forandroid.view.InputMethod.Points
<meta-data android:name="android.view.im" android:resource="@xml/droid_mcp_ime_config" />at the shipped default config (or supplies its own).User adds the keyboard via Settings > System > Languages & input > On-screen keyboard > Manage on-screen keyboards, then picks it via the IME picker.
Properties
Functions
Live InputConnection for the currently-focused field, or null if the IME isn't currently driving an editor.
The EditorInfo captured in onStartInput for the currently-bound editor, or null when no editor is bound. Read tools use its inputType to refuse password fields (see isPasswordInputType).
False when the IME is only bound to the window's placeholder editor — no field has focus. Android then reports inputType = TYPE_NULL with fieldId = 0; a real editor has its view's id (or View.NO_ID, -1), so a TYPE_NULL terminal-style view still counts. Text committed to the placeholder goes nowhere, so tools must not report it as typed.
Whether an editor field is currently bound to this IME. Tools use this via InputMethodServiceHolder.isActive to short-circuit with a clear error before trying to drive an empty InputConnection.