Explicitly define mutability for PendingIntents

This commit is contained in:
Moez Bhatti
2022-12-12 18:25:46 -05:00
parent 2c332c06b6
commit 634f04b7aa
8 changed files with 22 additions and 22 deletions
@@ -99,11 +99,11 @@ class NightModeManager @Inject constructor(
private fun updateAlarms() {
val dayCalendar = createCalendar(prefs.nightEnd.get())
val day = Intent(context, NightModeReceiver::class.java)
val dayIntent = PendingIntent.getBroadcast(context, 0, day, 0)
val dayIntent = PendingIntent.getBroadcast(context, 0, day, PendingIntent.FLAG_IMMUTABLE)
val nightCalendar = createCalendar(prefs.nightStart.get())
val night = Intent(context, NightModeReceiver::class.java)
val nightIntent = PendingIntent.getBroadcast(context, 1, night, 0)
val nightIntent = PendingIntent.getBroadcast(context, 1, night, PendingIntent.FLAG_IMMUTABLE)
context.sendBroadcast(day)
context.sendBroadcast(night)