[GH-ISSUE #2356] Clear clipboard no longer works on Samsung #7617

Closed
opened 2026-04-11 00:15:26 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @DobbyAHouseElf on GitHub (Feb 10, 2023).
Original GitHub issue: https://github.com/bitwarden/android/issues/2356

Steps To Reproduce

  1. Enable Clear Clipboard
  2. Copy a password from bitwarden
  3. Optionally paste it somewhere else and wait for the time that was set for Clear Clipboard

Expected Result

The clipboard should no longer have the password.
What used to happen on Samsung was that the password wasn't deleted but a new empty entry was added into the clipboard. This stopped the password from popping up whenever any text field was selected and could only be viewed by going into the clipboard.

Actual Result

Nothing changes in the clipboard. If you now go to any text field such as in the browser, the keyboard shows the last thing that was in the clipboard which will now be a password or TOTP token etc. This creates a risk of it accidentally showing up if you forget to clear your clipboard.

Screenshots or Videos

Can't provide screenshot as it contains sensitive information.

Additional Context

I think this problem may have been caused by the change #2220.
If i understand correctly, Samsung uses its own clipboard which the clipboardManager.ClearPrimaryClip() function does not work on.
You may be able to replace line 17 in ClearClipboardAlarmReceiver from
if ((int)Build.VERSION.SdkInt < 33)
to
if (Build.MANUFACTURER == "samsung" || (int)Build.VERSION.SdkInt < 33)
but i am not sure.

Operating System

Android

Operating System Version

13

Device

Samsung Galaxy Z Fold4

Build Version

2023.1.0 (5786)

Beta

  • Using a pre-release version of the application.
Originally created by @DobbyAHouseElf on GitHub (Feb 10, 2023). Original GitHub issue: https://github.com/bitwarden/android/issues/2356 ### Steps To Reproduce 1. Enable Clear Clipboard 2. Copy a password from bitwarden 3. Optionally paste it somewhere else and wait for the time that was set for Clear Clipboard ### Expected Result The clipboard should no longer have the password. What used to happen on Samsung was that the password wasn't deleted but a new empty entry was added into the clipboard. This stopped the password from popping up whenever any text field was selected and could only be viewed by going into the clipboard. ### Actual Result Nothing changes in the clipboard. If you now go to any text field such as in the browser, the keyboard shows the last thing that was in the clipboard which will now be a password or TOTP token etc. This creates a risk of it accidentally showing up if you forget to clear your clipboard. ### Screenshots or Videos Can't provide screenshot as it contains sensitive information. ### Additional Context I think this problem may have been caused by the change #2220. If i understand correctly, Samsung uses its own clipboard which the `clipboardManager.ClearPrimaryClip()` function does not work on. You may be able to replace [line 17](https://github.com/bitwarden/mobile/blob/master/src/Android/Receivers/ClearClipboardAlarmReceiver.cs#L17) in ClearClipboardAlarmReceiver from `if ((int)Build.VERSION.SdkInt < 33)` to `if (Build.MANUFACTURER == "samsung" || (int)Build.VERSION.SdkInt < 33)` but i am not sure. ### Operating System Android ### Operating System Version 13 ### Device Samsung Galaxy Z Fold4 ### Build Version 2023.1.0 (5786) ### Beta - [ ] Using a pre-release version of the application.
GiteaMirror added the bug label 2026-04-11 00:15:26 -05:00
Author
Owner

@TroyBW commented on GitHub (Feb 11, 2023):

Hi there,

I attempted to reproduce your issue and was unable to do so on my Android test device. However, my test device is not a Samsung device, and you have helpfully pointed out that this may be a Samsung-specific issue, so I will leave this issue open for further review.

Thank you for your assistance.

<!-- gh-comment-id:1426567020 --> @TroyBW commented on GitHub (Feb 11, 2023): Hi there, I attempted to reproduce your issue and was unable to do so on my Android test device. However, my test device is not a Samsung device, and you have helpfully pointed out that this may be a Samsung-specific issue, so I will leave this issue open for further review. Thank you for your assistance.
Author
Owner

@mnashat commented on GitHub (May 7, 2023):

@DobbyAHouseElf are you seeing this issue with Samsung Keyboard? If so, I believe it does technically get cleared but it will show as an item to paste on the keyboard suggestion strip until you dismiss the keyboard. After that, it no longer shows (it still remains in clipboard history but doesn't show up as an item to paste in the keyboard or context menu). This is a little different from the behavior I see on Gboard, as Gboard removes it from the suggestion strip as a paste-able item after 10 seconds. Can you confirm if this is what you're referring to?

<!-- gh-comment-id:1537256214 --> @mnashat commented on GitHub (May 7, 2023): @DobbyAHouseElf are you seeing this issue with Samsung Keyboard? If so, I believe it does technically get cleared but it will show as an item to paste on the keyboard suggestion strip until you dismiss the keyboard. After that, it no longer shows (it still remains in clipboard history but doesn't show up as an item to paste in the keyboard or context menu). This is a little different from the behavior I see on Gboard, as Gboard removes it from the suggestion strip as a paste-able item after 10 seconds. Can you confirm if this is what you're referring to?
Author
Owner

@DobbyAHouseElf commented on GitHub (May 7, 2023):

Hey @mnashat.
That is the behaviour i am seeing. I am using samsung keyboard and the copied passwords show up on the context menu. If i close the keyboard by exiting the app or clicking away from a text field, the password does not go away even if i check again the next day. If i click the cross to dismiss the context menu, it will then go away and not show up again. In this case though, if i paste the last thing from my keyboard by pressing paste, it will paste the password.

With the Samsung keyboard, i don't believe there is a way to remove the password from the clipboard history. The old behaviour of Bitwarden used to be to copy an empty item into the clipboard. This means the context menu and clicking paste would no longer paste the password and you would have to go in to the clipboard to see it. Currently, setting the option to clear password after n seconds does nothing on Samsung so i do prefer the old behaviour.

If the new behaviour of removing the item from the clipboard works on other keyboards, maybe it would be better to remove the password, add and empty item in to the clipboard then remove the empty item from the clipboard. That would make it remove the password from the clipboard for devices which support it and add an empty item for devices which do not.

<!-- gh-comment-id:1537429913 --> @DobbyAHouseElf commented on GitHub (May 7, 2023): Hey @mnashat. That is the behaviour i am seeing. I am using samsung keyboard and the copied passwords show up on the context menu. If i close the keyboard by exiting the app or clicking away from a text field, the password does not go away even if i check again the next day. If i click the cross to dismiss the context menu, it will then go away and not show up again. In this case though, if i paste the last thing from my keyboard by pressing paste, it will paste the password. With the Samsung keyboard, i don't believe there is a way to remove the password from the clipboard history. The old behaviour of Bitwarden used to be to copy an empty item into the clipboard. This means the context menu and clicking paste would no longer paste the password and you would have to go in to the clipboard to see it. Currently, setting the option to clear password after n seconds does nothing on Samsung so i do prefer the old behaviour. If the new behaviour of removing the item from the clipboard works on other keyboards, maybe it would be better to remove the password, add and empty item in to the clipboard then remove the empty item from the clipboard. That would make it remove the password from the clipboard for devices which support it and add an empty item for devices which do not.
Author
Owner

@ossamandere commented on GitHub (Oct 7, 2023):

@mnashat This issue is present on Android 13 on a Samsung Galaxy A13 5G. Steps to reproduce are same as above. Additionally, even after exiting the keyboard context and exiting the app, the data is still available for pasting in the clipboard after 5 minutes (timeout set to 30 seconds). Workaround is to use GBoard or some other android keyboard that allows correct behavior.

<!-- gh-comment-id:1751722660 --> @ossamandere commented on GitHub (Oct 7, 2023): @mnashat This issue is present on Android 13 on a Samsung Galaxy A13 5G. Steps to reproduce are same as above. Additionally, even after exiting the keyboard context and exiting the app, the data is still available for pasting in the clipboard after 5 minutes (timeout set to 30 seconds). Workaround is to use GBoard or some other android keyboard that allows correct behavior.
Author
Owner

@Propheticus commented on GitHub (Dec 1, 2023):

Workaround is to use GBoard or some other android keyboard that allows correct behavior.

After using Gboard for a while switch back to Samsung Keyboard and check the clipboard history... It still keeps history including passwords (in clear text), even while you use other keyboards. So this does not actually solve anything.

<!-- gh-comment-id:1835699067 --> @Propheticus commented on GitHub (Dec 1, 2023): > Workaround is to use GBoard or some other android keyboard that allows correct behavior. After using Gboard for a while switch back to Samsung Keyboard and check the clipboard history... It still keeps history including passwords (in clear text), even while you use other keyboards. So this does not actually solve anything.
Author
Owner

@vvolkgang commented on GitHub (Jun 20, 2024):

Issue migrated to https://github.com/bitwarden/mobile/issues/2356

<!-- gh-comment-id:2181390516 --> @vvolkgang commented on GitHub (Jun 20, 2024): Issue migrated to https://github.com/bitwarden/mobile/issues/2356
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#7617