Skip to content

Add FLAG_UPDATE_CURRENT flag to notification pending intent#13171

Merged
mchowning merged 2 commits intodevelopfrom
fix/add-flag-to-pending-intent
Oct 19, 2020
Merged

Add FLAG_UPDATE_CURRENT flag to notification pending intent#13171
mchowning merged 2 commits intodevelopfrom
fix/add-flag-to-pending-intent

Conversation

@planarvoid
Copy link
Copy Markdown
Contributor

Fixes #8363

It seems that this issue happens because the pending intent sometimes doesn't pass the extras. It seems that the system (because of efficiency) reuses the previous pending intent without the extras (the issue).

The suggested fix seems to be to use the PendingIntent.FLAG_UPDATE_CURRENT flag when creating the pending intent.

The second fix in this PR is a proper error message when the SiteModel is null in the PostsListActivity

To test:

  • I don't know how to reproduce this issue

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link
Copy Markdown

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

You can test the changes on this Pull Request by downloading the APK here.

Copy link
Copy Markdown
Contributor

@mchowning mchowning left a 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. I tried to recreate the crash, but I wasn't able to either. Your fix makes sense and seems to be working well in my testing.

I'm very curious to see if this does fix the crash since this seems like a particularly nasty bit of behavior by Android.

@mchowning mchowning merged commit 72ea190 into develop Oct 19, 2020
@mchowning mchowning deleted the fix/add-flag-to-pending-intent branch October 19, 2020 19:34
@planarvoid
Copy link
Copy Markdown
Contributor Author

If it doesn't work, we can look into replacing PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT with just with PendingIntent.FLAG_UPDATE_CURRENT and see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rare NPE crash in ActivityLogListFragment

2 participants