[Android] PlaybackService can receive remote on crappy TVs
Geoffrey Métais
git at videolan.org
Wed Feb 10 09:36:23 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 9 18:21:06 2016 +0100| [11489a045890b404a0e7321fcca349acb6e6dfe1] | committer: Geoffrey Métais
PlaybackService can receive remote on crappy TVs
Re-activate RemoteControlReceiver on TVs without Google Play Services
> https://code.videolan.org/videolan/vlc-android/commit/11489a045890b404a0e7321fcca349acb6e6dfe1
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 84ea088..b6c2c12 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -74,6 +74,7 @@ import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.media.MediaUtils;
import org.videolan.vlc.media.MediaWrapper;
import org.videolan.vlc.media.MediaWrapperList;
+import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.FileUtils;
import org.videolan.vlc.util.Strings;
import org.videolan.vlc.util.Util;
@@ -220,6 +221,9 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
return;
}
+ if (!AndroidDevices.hasTsp() && !AndroidDevices.hasPlayServices())
+ AndroidDevices.setRemoteControlReceiverEnabled(true);
+
mDetectHeadset = mSettings.getBoolean("enable_headset_detection", true);
mCurrentIndex = -1;
@@ -300,6 +304,10 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
public void onDestroy() {
super.onDestroy();
stop();
+
+ if (!AndroidDevices.hasTsp() && !AndroidDevices.hasPlayServices())
+ AndroidDevices.setRemoteControlReceiverEnabled(false);
+
if (mWakeLock.isHeld())
mWakeLock.release();
unregisterReceiver(mReceiver);
More information about the Android
mailing list