Android 12 PendingIntent Fix - #477
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 |
Signed-off-by: Saravana Perumal Shanmugam <perusworld@linux.com>
|
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"