Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Updated pending intent as per Android 12 #337

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ class SleepReceiver : BroadcastReceiver() {
context,
0,
sleepIntent,
PendingIntent.FLAG_CANCEL_CURRENT
getPendingIntentFlag()
)
}
fun getPendingIntentFlag() = PendingIntent.FLAG_CANCEL_CURRENT or
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) PendingIntent.FLAG_MUTABLE
else 0
}
}