From f0d5e7a626fb81a63de04df4790fb217a39b153a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 03:13:25 +0000 Subject: [PATCH] feat: soft keyboard in the embedded browser via a host-window input proxy The embedded browser renders cross-process through SurfaceControlViewHost, which forwards touch but not the soft keyboard (the embedded window can't be an IME target, and androidx.privacysandbox.ui never wires IME). So focusing a field in an embedded page did nothing. Bridge the keyboard instead: host it in the main app window and relay editing to the page. - Shim IME agent (embedded browser only, gated by __nappletImeProxy): tracks the focused editable, reports focus/blur/external-change, and applies host ops (commit / compose / delete / key / editor-action) with real input & composition events. Scrolls the field into view on focus. - NappletBrowserService relays ime.* envelopes between the page bridge and the client (MSG_IME_EVENT / MSG_IME_OP), per tab. - EmbeddedBrowserController implements EmbeddedImeBridge (parses events, sends ops). - RemoteImeView: an invisible EditText in the main window that takes the keyboard for the active tab. Keeps a real local Editable (so the platform handles composing/suggestions/selection) while an InputConnection wrapper forwards every op to the page. Maps web input types / enterKeyHint to inputType/IME action. - EmbeddedTabLayer hosts the proxy bound to the active tab and shrinks the active surface by the IME height so the page can scroll the field clear of the keyboard. Covers /