-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Try to use getPrimaryClipDescription on Android 12 #22271
Comments
One particularly-important use case to consider here, from a user-confusion/suspicion perspective: under some configurations[1], Firefox apparently never shows the "Fill link from clipboard" UI, but nonetheless we seem to check the clipboard as if we were going to show that UI. This ends up meaning that the user still sees a "Firefox Nightly pasted from your clipboard" system notification when there's no clear user-visible indication about why/where Firefox pasted the clipboard contents (or what Firefox found there). This ends up feeling unsettling/concerning from a user perspective. As part of fixing this bug, perhaps we should bypass the clipboard access entirely for this configuration (assuming that we're hiding the UI intentionally). [1] In particular: on my phone, "Settings | Search | Show clipboard suggestions: [disabled]" setting causes the "fill link from clipboard" UI to never appear. (but Firefox still queries my clipboard for apparently no reason). (The "Show search engines: [enabled]" setting is another way to hide the fill-link-from-clipboard UI, but I think that's a bug; I filed #22272 on that.) |
Hi, I had an initial look into this.
Api 31 has introduced getConfidenceScore on the clipboard description class which we can use to check if an item is a URL or not. We could use this before deciding to then read the clipboard If the confidence score is unavailable (it may not be calculated at the time this runs) what behaviour do we fall back to? (I presume the existing behaviour? I've noticed on Android12 that the default keyboard already has the option to paste the url into the search bar (see image below). I wonder if there is a separate conversation about deprecating the feature for 12 and up as the clipboard read toast is pretty scary. |
Thanks @dholbert, I'll take a look to confirm this #22271 (comment). |
@nathan-castlehow thanks for bring this out, yeah I noticed Chrome resigned the functionality to only copy from the clipboard upon user's request. I think it will be better for me to clarify with the UI/UX team, before doing the changes I'm not sure how we should proceed. Let's not do any changes until confirming, thanks for interesting on this bug. |
It looks like we are still accessing the API even the setting is off, we are only not showing the result, for this reason the notification is still showing. |
… Android 12 and above.
… Android 12 and above.
… Android 12 and above.
@nathan-castlehow as this became a pressing issue I had to address it myself sorry for that, hope you could understand. |
… Android 12 and above.
… Android 12 and above.
This landed on main, the fix should be available in the next update nightly. QA team please help use to verify that issue is fixed. |
@dholbert are you able to reproduce in the latest nightly? |
I wasn't able to reproduce the issue on latest Nightly (11/17) with Pixel 3 (Android 12) or Pixel 4XL (Android 12) |
No, I can't. This does indeed seem to be fixed. Thanks! |
…d above. (cherry picked from commit 94a543a)
…d above. (cherry picked from commit 94a543a)
… Android 12 and above.
FWIW, I've just filed a bug for a different set of STR that trigger this same "Firefox Nightly pasted from your clipboard" system-notification, in a way that annoyingly prevents me from pasting for a few seconds (because the notification covers up our "Paste" menu item). See details over in #26564. |
On Android 12 there is a new behavior change when accessing the clipboard, the OS shows a toast indicating that the app is is accessing it, more details can be found here.
When users try to search or open an URL in the toolbar Fenix tries to check on the clipboard to see if there is an URL on the clipboard that the user wants to navigates to, we use these extension functions to try to figure out, but they are triggering the Clipboard access notifications on Android 12, to avoid that we want to use getPrimaryClipDescription()
Steps to show the reproduce the Clipboard access notifications on Android 12:
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: