[Android] Fix sleep tim not working

Nicolas Pomepuy git at videolan.org
Wed Apr 10 10:31:28 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Apr 10 10:20:22 2019 +0200| [38025c899dd0df439b73b6da5d5b0c933c54a2fd] | committer: Geoffrey Métais

Fix sleep tim not working

> https://code.videolan.org/videolan/vlc-android/commit/38025c899dd0df439b73b6da5d5b0c933c54a2fd
---

 vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 98ce14dea..8af5a2a41 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -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)



More information about the Android mailing list