[Android] Set recommendations only on Android TV

Geoffrey Métais git at videolan.org
Thu Jan 21 15:10:32 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 21 14:51:58 2016 +0100| [2e70c24e1041fe19b6b9ce1ef570533d965cb679] | committer: Geoffrey Métais

Set recommendations only on Android TV

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

 vlc-android/src/org/videolan/vlc/gui/tv/BootupReceiver.java | 3 ++-
 vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/BootupReceiver.java b/vlc-android/src/org/videolan/vlc/gui/tv/BootupReceiver.java
index c93ce95..3ceb505 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/BootupReceiver.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/BootupReceiver.java
@@ -28,6 +28,7 @@ import android.content.Intent;
 import android.util.Log;
 
 import org.videolan.vlc.VLCApplication;
+import org.videolan.vlc.util.AndroidDevices;
 
 public class BootupReceiver extends BroadcastReceiver {
     public BootupReceiver() {
@@ -38,7 +39,7 @@ public class BootupReceiver extends BroadcastReceiver {
 
     @Override
     public void onReceive(Context context, Intent intent) {
-        if (intent.getAction().endsWith(Intent.ACTION_BOOT_COMPLETED)) {
+        if (AndroidDevices.isAndroidTv() && intent.getAction().endsWith(Intent.ACTION_BOOT_COMPLETED)) {
             Log.d(TAG, "ACTION_BOOT_COMPLETED ");
             scheduleRecommendationUpdate(context);
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 69e9216..ad55ab1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -164,9 +164,11 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
         if (mService != null)
             mService.removeCallback(this);
         super.onStop();
-        Intent recommendationIntent = new Intent(this,
-                RecommendationsService.class);
-        startService(recommendationIntent);
+        if (AndroidDevices.isAndroidTv()) {
+            Intent recommendationIntent = new Intent(this,
+                    RecommendationsService.class);
+            startService(recommendationIntent);
+        }
     }
 
     protected void onResume() {



More information about the Android mailing list