Skip to content
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

Fix broken share action due to PendingIntent reuse #181

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

chenxiaolong
Copy link
Owner

@chenxiaolong chenxiaolong commented Nov 28, 2022

The intent for the "share" action is not distinguishable across notifications when compared with Intent.filterEquals() because they differ only in intent extras. This would cause the same PendingIntent to be reused for every share action, which would reference an old URI.

This commit fixes the issue by setting the ACTION_SEND data to the same value as the EXTRA_STREAM. The intent data is not used for this action, but makes the intent sufficiently unique that a PendingIntent won't be reused.

@chenxiaolong chenxiaolong self-assigned this Nov 28, 2022
The intent for the "share" action is not distinguishable across
notifications when compared with Intent.filterEquals() because they
differ only in intent extras. This would cause the same PendingIntent to
be reused for every share action, which would reference an old URI.

This commit fixes the issue by setting the ACTION_SEND data to the same
value as the EXTRA_STREAM. The intent data is not used for this action,
but makes the intent sufficiently unique that a PendingIntent won't be
reused.

Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
@chenxiaolong chenxiaolong merged commit 236259a into master Nov 28, 2022
@chenxiaolong chenxiaolong deleted the notification-confusion branch November 28, 2022 21:21
chenxiaolong added a commit that referenced this pull request Nov 28, 2022
Signed-off-by: Andrew Gunnerson <chillermillerlong@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant