mehdikhalifeh/Shortcut

PendingIntent on Android S

DaveMurchison83 opened this issue · 0 comments

On devices targeting Android S and higher I am getting the following error:

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

Error seems to be in ShortcutUtils.java

PendingIntent successCallback = PendingIntent.getBroadcast(context, 0, pinnedShortcutCallbackIntent, 0);

should be

PendingIntent successCallback = PendingIntent.getBroadcast(context, 0, pinnedShortcutCallbackIntent, FLAG_IMMUTABLE);

I think.