Skip to content

Fix helper IME black screen by suppressing keyboard window#109

Merged
SergioChan merged 3 commits intomainfrom
dev-sergio
Mar 14, 2026
Merged

Fix helper IME black screen by suppressing keyboard window#109
SergioChan merged 3 commits intomainfrom
dev-sergio

Conversation

@SergioChan
Copy link
Member

Summary

  • Fix the OpenPocket helper IME causing a full-screen black overlay when activated during Unicode text input on physical devices.
  • Replace the ineffective 1px-transparent-view approach with onEvaluateInputViewShown() → false, which prevents the system from creating a keyboard window entirely.

Why

When the helper IME was activated for Unicode text injection (emoji, CJK, etc.), Android's IME window manager ignored the View's LayoutParams and enforced a minimum keyboard window size, resulting in a full-screen black overlay that blocked the agent's view of the screen. The agent would see an empty black screen with no UI elements, get stuck, and fail the task.

Changes

  • android/openpocket-ime/OpenPocketIME.java: Override onEvaluateInputViewShown() to return false so the system never creates a keyboard window surface. The InputMethodService still binds to the focused input field, so getCurrentInputConnection() works normally for text injection via broadcast. Return null from onCreateInputView() as defensive backup.
  • assets/android/openpocket-ime.apk: Rebuilt APK with the fix.
  • Verified on-device: screenshot taken while helper IME is active shows full app content with no black overlay.

Testing

  • node --test test/adb-runtime.test.mjs — 40 pass / 0 fail
  • On-device verification: switched to helper IME on a physical Pixel, captured screenshot confirming normal screen content (Twitter Notifications page fully visible), sent Unicode text via broadcast successfully, restored Gboard.

Checklist

  • I ran relevant tests, or the Testing section explains why I did not.
  • I updated docs, or confirmed no doc changes were needed.
  • I confirmed the PR does not include secrets, credentials, or private data.

Made with Cursor

The previous 1px-transparent-view approach did not work because
Android's IME window manager ignores View LayoutParams and enforces
a minimum keyboard window size, resulting in a full-screen black
overlay whenever the helper IME was activated.

Replace with onEvaluateInputViewShown() returning false, which tells
the system to never create a keyboard window surface at all.  The
InputMethodService still binds to the focused input field, so
getCurrentInputConnection() works normally for text injection via
broadcast — verified on-device with screenshot confirmation.

Made-with: Cursor
@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openpocket Ready Ready Preview, Comment Mar 14, 2026 4:00am

Request Review

@SergioChan SergioChan merged commit a5db5b2 into main Mar 14, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant