Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add <queries> element in AndroidManifest to fix voice IME detection in modern Android #526

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

abb128
Copy link
Contributor

@abb128 abb128 commented Jan 18, 2024

To detect voice IMEs, Unexpected Keyboard calls InputMethodManager.getEnabledInputMethodList

for (InputMethodInfo im : imm.getEnabledInputMethodList())

Internally, this method eventually calls a method that returns a filtered list of packages that may not include the installed voice IME, and thus Unexpected Keyboard unexpectedly claims no voice input is installed because it can't see it.

The fix is to explicitly state in the manifest that we want to query for other IMEs, based on https://developer.android.com/training/package-visibility/declaring

This is not an issue with Google's voice input or other preinstalled voice inputs because they usually have android:forceQueryable=true, but this is an issue with third-party voice inputs such as FUTO Voice Input. Launching the voice input app after activating the keyboard also usually makes the package visible, so a consistent way to replicate this issue on modern Android is to reboot the device and try triggering voice input from the keyboard

Copy link
Owner

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With FUTO 1.2.7 on Android 13, I do not reproduce the problem you report, even after a reboot.

Though, if it works on your device, I'll merge. Many thanks :)

@Julow Julow merged commit b3dcd61 into Julow:master Jan 18, 2024
3 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.

None yet

2 participants