New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clipboard][Android] Fixes clipboard listener is called twice #19723
Merged
lukmccall
merged 4 commits into
main
from
@lukmccall/clipboard/fix-clipboard-listener-is-called-twice
Oct 28, 2022
Merged
[clipboard][Android] Fixes clipboard listener is called twice #19723
lukmccall
merged 4 commits into
main
from
@lukmccall/clipboard/fix-clipboard-listener-is-called-twice
Oct 28, 2022
Conversation
This file contains 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
Kudo
approved these changes
Oct 27, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me but wondering why there're duplicated events from native.
android unit test is failed at
|
brentvatne
approved these changes
Oct 28, 2022
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
lukmccall
deleted the
@lukmccall/clipboard/fix-clipboard-listener-is-called-twice
branch
October 28, 2022 08:44
expo-bot
added
bot: passed checks
ExpoBot has nothing to complain about
and removed
bot: suggestions
ExpoBot has some suggestions
labels
Oct 28, 2022
lukmccall
added a commit
that referenced
this pull request
Oct 28, 2022
3 tasks
lukmccall
pushed a commit
that referenced
this pull request
Mar 1, 2023
… <26 (#21383) # Why On devices with Android versions below 8 (SDK 26), the changes in #19723 causes the app to crash whenever a string is copied due to using the `getTimestamp()` function that is only available on SDK 26 and above: https://developer.android.com/reference/android/content/ClipDescription#getTimestamp() # How Add a check to ensure `Build.VERSION.SDK_INT >= Build.VERSION_CODES.O` before calling `clip.timestamp`. # Test Plan Ran `yarn android` in `apps/bare-expo`
Kudo
pushed a commit
that referenced
this pull request
Mar 3, 2023
… <26 (#21383) # Why On devices with Android versions below 8 (SDK 26), the changes in #19723 causes the app to crash whenever a string is copied due to using the `getTimestamp()` function that is only available on SDK 26 and above: https://developer.android.com/reference/android/content/ClipDescription#getTimestamp() # How Add a check to ensure `Build.VERSION.SDK_INT >= Build.VERSION_CODES.O` before calling `clip.timestamp`. # Test Plan Ran `yarn android` in `apps/bare-expo` (cherry picked from commit 1ef1f8a)
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.
Why
Fixes clipboard listener is called twice on Android.
Fixes clipboard listener crashing the application on Android during the initialization phase.
How
During the
dev-client
QA, I faced two issues with a clipboard. First of all, the listener's called twice for a single event. It was fixed by checking the timestamp. Moreover, the clipboard code may break the application, when the same listener is called in the initialization phase when react modules aren't fully initiated. I've decided to add a function to the app context to check if the react native is alive.Test Plan