We are facing error, "MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent". We did lots of troubleshoots and internet exploring but in vain. Please tell us where can I place below code? Thanks
val intent = Intent(intentAction)
// Or other component setting APIS e.g. setComponent, setClass intent.setClassName(packageName, className)
PendingIntent pendingIntent = PendingIntent.getActivity( context, /* requestCode = / 0, intent, / flags = */ PendingIntent.FLAG_IMMUTABLE )