[Android] Disable remote controle receiver on TV

Geoffrey Métais git at videolan.org
Mon Feb 8 14:47:26 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb  8 14:44:17 2016 +0100| [59b9deb5a2862fedc293ba57a33ed11bdac76927] | committer: Geoffrey Métais

Disable remote controle receiver on TV

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

 vlc-android/src/org/videolan/vlc/VLCApplication.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index b236b80..1064ec8 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -20,9 +20,11 @@
 package org.videolan.vlc;
 
 import android.app.Application;
+import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
 import android.content.res.Configuration;
 import android.content.res.Resources;
 import android.preference.PreferenceManager;
@@ -110,6 +112,12 @@ public class VLCApplication extends Application {
         sTV = AndroidDevices.isAndroidTv() || !AndroidDevices.hasTsp();
 
         Dialog.setCallbacks(VLCInstance.get(), mDialogCallbacks);
+
+        // Disable remote control receiver on Fire TV.
+        if (!AndroidDevices.hasTsp())
+            getPackageManager().setComponentEnabledSetting(
+                    new ComponentName(this, RemoteControlClientReceiver.class),
+                    PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
     }
 
     /**



More information about the Android mailing list