Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Android 12: Explicitly set mutable or immutable flag on PendingIntent instances #10641

Closed
pocmo opened this issue Jul 20, 2021 · 1 comment
Closed
Labels
Android 12 New functionality or breaking behaviour when targeting Android 12

Comments

@pocmo
Copy link
Contributor

pocmo commented Jul 20, 2021

https://developer.android.com/about/versions/12/behavior-changes-12

If your app targets Android 12, you must specify the mutability of each PendingIntent object that your app creates. This additional requirement improves your app's security.

Lint is complaining about all our PendingIntent objects. To continue with the Gradle / Android Plugin update I will disable this specific lint check. However we need to go through the PendingIntent objects and decide whether they should be mutable or immutable (mostly probably immutable). To make things worse: FLAG_IMMUTABLE is only available on API 23+. If you mirror the value (since it's just an int) then Android Studio complains that this is not a PendingIntent.* flag you are using. Argh.

┆Issue is synchronized with this Jira Task

@pocmo pocmo added the Android 12 New functionality or breaking behaviour when targeting Android 12 label Jul 20, 2021
@Mugurell
Copy link
Contributor

Mugurell commented Feb 9, 2022

This was done in #11669

@Mugurell Mugurell closed this as completed Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android 12 New functionality or breaking behaviour when targeting Android 12
Projects
None yet
Development

No branches or pull requests

2 participants