Skip to content

Text selection menu does not offer PROCESS_TEXT apps (dictionary / translate) — missing <queries> declaration #1095

Description

@preyevates

Summary

Selecting text in this app shows only the built-in actions. Apps that register
android.intent.action.PROCESS_TEXT — offline dictionaries, translators, search tools — never
appear in the selection toolbar, even when they are installed and working correctly.

Cause

Since Android 11 (targetSdk 30), package visibility filtering
applies to PackageManager.queryIntentActivities(). The text-selection toolbar is built inside the
app's own process, so an app that does not declare <queries> for PROCESS_TEXT receives an empty
result and renders no items.

Suggested fix

Add to AndroidManifest.xml:

<queries>
    <intent>
        <action android:name="android.intent.action.PROCESS_TEXT" />
        <data android:mimeType="text/plain" />
    </intent>
</queries>

No code change, no new runtime permission, and no visible difference for users who have no such
apps installed.

How I verified this

On an Android device with 10 PROCESS_TEXT handlers installed:

  • cmd package query-activities -a android.intent.action.PROCESS_TEXT -t text/plain resolves all 10.
  • Apps that declare the <queries> block (Thunderbird, RedReader, Aves, Obtainium) show those
    handlers in the selection toolbar.
  • Apps that do not declare it, including this one, show none.
  • Firing the intent explicitly with
    am start -a android.intent.action.PROCESS_TEXT -t text/plain --es android.intent.extra.PROCESS_TEXT "word" -n <handler>
    launches the handler correctly — so the handler side is fine, and only the caller-side
    declaration is missing.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions