[Android] PlaybackService: Always force foreground on Oreo+
Geoffrey Métais
git at videolan.org
Thu Jan 10 19:02:40 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 10 17:07:52 2019 +0100| [eaca15d39d8bc7d6bde43f4faf28e4e950746d12] | committer: Geoffrey Métais
PlaybackService: Always force foreground on Oreo+
> https://code.videolan.org/videolan/vlc-android/commit/eaca15d39d8bc7d6bde43f4faf28e4e950746d12
---
vlc-android/src/org/videolan/vlc/PlaybackService.kt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index b08be9319..6fe7c0064 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -20,7 +20,10 @@
package org.videolan.vlc
import android.annotation.TargetApi
-import android.app.*
+import android.app.KeyguardManager
+import android.app.PendingIntent
+import android.app.SearchManager
+import android.app.Service
import android.appwidget.AppWidgetManager
import android.content.*
import android.graphics.BitmapFactory
@@ -504,7 +507,7 @@ class PlaybackService : MediaBrowserServiceCompat(), CoroutineScope, LifecycleOw
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
- if (AndroidUtil.isOOrLater && !isForeground && !VLCApplication.isForeground()) forceForeground()
+ if (AndroidUtil.isOOrLater && !isForeground) forceForeground()
dispatcher.onServicePreSuperOnStart()
when (intent?.action) {
Intent.ACTION_MEDIA_BUTTON -> {
More information about the Android
mailing list