srctree

Roee Hershberg parent 7701c509 81828b30
Check API for PendingIntent mutable flag

inlinesplit
atox/src/main/kotlin/PendingIntentCompat.kt added: 7, removed: 2, total 5
@@ -20,7 +20,12 @@ object PendingIntentCompat {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
PendingIntent.getBroadcast(context, requestCode, intent, flags)
} else {
val mutabilityFlag = if (mutable) PendingIntent.FLAG_MUTABLE else PendingIntent.FLAG_IMMUTABLE
val mutabilityFlag =
if (mutable) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE else 0
} else {
PendingIntent.FLAG_IMMUTABLE
}
PendingIntent.getBroadcast(context, requestCode, intent, flags or mutabilityFlag)
}