Repository navigation
fix(selection): no other app's text action in the selection toolbar - #15
Merged
Merged
Conversation
Flutter fills the selection toolbar of every TextField and SelectableText (an OCR result among them) with the apps that declare an ACTION_PROCESS_TEXT action, which the engine's ProcessTextPlugin asks the system for. Any app may declare one, under any name, and one tap hands it the selected text. - The <queries> for PROCESS_TEXT, inherited from the Flutter template and used by no code of the app, made them all visible: removed. - That is not enough: before Android 11 there is no package visibility (minSdk is 24), and from 11 on it is granted per whole app — the other <queries> (SEND PDF, VIEW https, SENDTO mailto) make browsers, mail clients and PDF readers visible with all their text actions. configureFlutterEngine now sets, after the engine's own, a handler on the engine's ProcessTextChannel that lists no action, on every version. Kept: Cut, Copy, Paste, Select all. Lost: reading aloud from the toolbar (TalkBack's action), still reachable through its own accessibility shortcut. Flutter draws its own text: Android's text classifier, whose "Translate" the Kotlin apps had to turn off, is not involved here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flutter fills the selection toolbar of every
TextFieldandSelectableText— the OCR result among them — with the apps that declare anACTION_PROCESS_TEXTaction (the engine'sProcessTextPlugin). Any app may declare one, under any name, and one tap hands it the selected text.<queries>forPROCESS_TEXT, inherited from the Flutter template and used by no code of the app, made them all visible — removed.<queries>(SEND PDF, VIEW https, SENDTO mailto) make browsers, mail clients and PDF readers visible with all their text actions.configureFlutterEnginenow sets, after the engine's own, a handler onFlutterEngine.processTextChannelthat lists no action, on every version.Kept: Cut, Copy, Paste, Select all. Lost: reading aloud from the toolbar (still reachable through its own accessibility shortcut). Android's text classifier ("Translate", fixed in the Kotlin apps) is not involved: Flutter draws its own text.
Not measured on a device — the same mechanism was measured on the Kotlin apps (probe app declaring
PROCESS_TEXT). Security review of this diff: no critical or high finding; the engine'sProcessTextPluginsets its handler in its constructor, beforeconfigureFlutterEngine.🤖 Generated with Claude Code