[Android] Fix sleep tim not working

Nicolas Pomepuy git at videolan.org
Wed Apr 10 14:58:13 CEST 2019


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

Fix sleep tim not working

(cherry picked from commit 38025c899dd0df439b73b6da5d5b0c933c54a2fd)

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

 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