Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@wytesk133
Copy link
Contributor

@wytesk133 wytesk133 commented Jul 7, 2021

Android 12 introduces a toast message that appears when an app reads the content on the clipboard. Currently, whenever there is a TextField widget, the app reads from the clipboard passively to determine whether the clipboard is empty and whether the "Paste" button should be shown. To avoid unintended access, both the Flutter engine and the Flutter framework need to be updated to use the appropriate API to check whether the clipboard is empty.

Slightly breaking change: Previously, if the clipboard contains an empty string, clipboardHasStrings returns false, but Without actually accessing clipboard data (preferred behavior), it is not possible to distinguish between empty and non-empty string contents.

This is a pre-requisite for fixing b/192897521 and flutter/flutter#74139
The remaining steps are:

  • exposing hasStrings() in flutter/lib/src/services/clipboard.dart and
  • updating flutter/lib/src/widgets/text_selection.dart to call hasStrings().

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@google-cla google-cla bot added the cla: yes label Jul 7, 2021
@wytesk133 wytesk133 force-pushed the master branch 6 times, most recently from f1f2945 to 4bf4fd5 Compare July 7, 2021 20:26
@blasten blasten self-requested a review July 8, 2021 04:26
Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM after comments addressed

Android 12 introduces a toast message that appears when an app reads the content on the clipboard. Currently, whenever there is a `TextField` widget, the app reads from the clipboard passively to determine whether the clipboard is empty and whether the "Paste" button should be shown. To avoid unintended access, both the Flutter engine and the Flutter framework need to be updated to use the appropriate API to check whether the clipboard is empty.

Slightly breaking change: Previously, if the clipboard contains an empty string, `clipboardHasStrings` returns `false`, but Without actually accessing clipboard data (preferred behavior), it is not possible to distinguish between empty and non-empty string contents.
Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM

@blasten blasten added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 8, 2021
@fluttergithubbot fluttergithubbot merged commit 9cbf50a into flutter:master Jul 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 8, 2021
moffatman pushed a commit to moffatman/engine that referenced this pull request Aug 5, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants