OverlayController
Programmatic floating-overlay primitive. Host apps wire this to a settings toggle; no LLM tools expose it directly. Uses TYPE_APPLICATION_OVERLAY so it survives on top of other apps (requires SYSTEM_ALERT_WINDOW permission granted via permissionIntent).
Threading. show and hide may be called from any thread: WindowManager view operations must run on the main thread, so off-main calls are posted to the main looper (and therefore take effect asynchronously). Calls made on the main thread run synchronously.
Functions
Show the overlay. Idempotent — calling while already showing replaces the existing overlay with the new config. Safe to call from any thread (off-main calls are posted to the main looper). No-op when the overlay permission is missing, or when the previous overlay could not be removed (so overlays never stack).
Convenience overload — equivalent to show(OverlayConfig(label = label, onClick = onClick)).