-
Notifications
You must be signed in to change notification settings - Fork 578
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
Android 12 PendingIntent Fix #477
base: master
Are you sure you want to change the base?
Conversation
Fixing pending intent flag for Android 12
Hi @don, @krimple, @gonzalo123, @doncoleman - any updates on this? |
Why is this checking for |
@popovitsj that's a fair point. When I first put this fix together, I used code that I found in other similar forks of this project and pieced together the code seen in this pull request. I am by no means an Android developer, my solution worked for me and it seems to work for others. Any improvements to the code is welcomed. |
The safest would be to change the check for `M` to `S`. Alternatively, we
could check if we could just include the flag for all api versions, but it
would require more testing effort.
Op ma 14 nov. 2022 22:26 schreef Paradox7208 ***@***.***>:
… @popovitsj <https://github.com/popovitsj> that's a fair point. When I
first put this fix together, I used code that I found in other similar
forks of this project and pieced together the code seen in this pull
request.
I am by no means an Android developer, my solution worked for me and it
seems to work for others. Any improvements to the code is welcomed.
—
Reply to this email directly, view it on GitHub
<#477 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWTKOB6IPYMBGO5WKEUXLLWIKU7TANCNFSM57RFOTLA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@popovitsj I agree, it would be better to target |
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.
lgtm
Signed-off-by: Saravana Perumal Shanmugam <[email protected]>
Any idea when this PR will be merged? |
Last commit to master was back in 2020. Is this plugin still maintained? |
when this PR will be merged ? |
I actually wrote my own library because this seems to get no attention... |
Can you point on repository maybe? |
It's not open source since I only implemented certain features we needed internally. |
Already included in #460, thus this PR could be closed as duplicate. |
Android 12 is known to crash on launch if the Intent flag is not explicitly set to MUTABLE or IMMUTABLE.
Upon further testing, NFC tags would not scan when the App is in focus when the flag is set to IMMUTABLE. I decided to use the MUTABLE flag instead which is the default flag for a PendingIntent activity and NFC tags scan as normal.
https://developer.android.com/reference/android/app/PendingIntent#FLAG_MUTABLE
"Up until Build.VERSION_CODES.R, PendingIntents are assumed to be mutable by default, unless FLAG_IMMUTABLE is set. Starting with Build.VERSION_CODES.S, it will be required to explicitly specify the mutability of PendingIntents on creation with either FLAG_IMMUTABLE or FLAG_MUTABLE"