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

Specify PendingIntent mutability in getArtworkInfo() within MuzeiArtProvider #747

Merged
merged 2 commits into from
Nov 24, 2021

Conversation

yellowbluesky
Copy link
Contributor

Without this, Muzei plugins that target API 31 and when run on Android 12.0+ cannot view artwork information, instead returning an IllegalArgumentException described here
An API level check is included to maintain compatability with Android versions lower than M

Without this, Muzei plugins that target API 31 and when run on Android 12.0+ cannot view artwork information
An API level check is included to maintain compatability with Android versions lower than M
@ianhanniballake
Copy link
Collaborator

Similar to d4f348a, please use @SuppressLint("InlinedApi") on the method level and skip the API level check (it is fine to include the flag on all API levels; it just has no effect on previous API levels).

PendingIntent.FLAG_IMMUTABLE flag has no effect when used on API levels lower than M
@yellowbluesky
Copy link
Contributor Author

Yes you are correct, the flag will have no effect on lower API levels because the flag is simply a toggled bit within a bit field.

The changes have been made as you requested

@ianhanniballake ianhanniballake merged commit 56cc8d3 into muzei:main Nov 24, 2021
@ianhanniballake
Copy link
Collaborator

Thanks! We'll look to get out an updated version of the Muzei API with this fix. As a workaround, you can override this method yourself and construct the PendingIntent with the flag rather than calling super.

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.

2 participants