Skip to content
Snippets Groups Projects
Commit a2aa7664 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix sleep tim not working

(cherry picked from commit 38025c89)
parent f60666c1
No related branches found
No related tags found
No related merge requests found
......@@ -414,7 +414,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
fun Context.setSleep(time: Calendar?) {
val alarmMgr = applicationContext.getSystemService(Context.ALARM_SERVICE) as AlarmManager
val intent = Intent(SLEEP_INTENT)
val sleepPendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
val sleepPendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
if (time != null) alarmMgr.set(AlarmManager.RTC_WAKEUP, time.timeInMillis, sleepPendingIntent)
else alarmMgr.cancel(sleepPendingIntent)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment