[Android] Block MediaButtonReceiver calls on Oreo

Geoffrey Métais git at videolan.org
Tue Oct 3 16:53:46 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct  3 16:40:51 2017 +0200| [242fecbe89c25e03a10c4d8bf4f60882933e5c0f] | committer: Geoffrey Métais

Block MediaButtonReceiver calls on Oreo

We need AppCompat 26+ to handle Oreo background service management

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

 vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java b/vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
index 02d560629..8da618f04 100644
--- a/vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
+++ b/vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
@@ -25,6 +25,7 @@ import android.os.SystemClock;
 import android.support.v4.media.session.MediaButtonReceiver;
 import android.view.KeyEvent;
 
+import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.vlc.util.AndroidDevices;
 import org.videolan.vlc.util.Util;
 
@@ -113,6 +114,7 @@ public class RemoteControlClientReceiver extends MediaButtonReceiver {
             context.startService(intent);
             return;
         }
-        super.onReceive(context, intent);
+        if (!AndroidUtil.isOOrLater) //We need AppCompat 26+ for Oreo service management
+            super.onReceive(context, intent);
     }
 }



More information about the Android mailing list