Skip to content

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent #121

Closed
@rafaelgustavo123

Description

@rafaelgustavo123

It is not working on android version 31+.
Need to change https://github.com/libpd/pd-for-android/blob/master/PdCore/src/main/java/org/puredata/android/service/PdService.java#L245 to something like this:

PendingIntent pi = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
pi = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
else {
pi = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions