[Android] Switch to utils methods for GPS and remote

Geoffrey Métais git at videolan.org
Wed Feb 10 09:36:22 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  9 18:20:21 2016 +0100| [3eb8b2d5305a13c4c1789961edda5cac923ed170] | committer: Geoffrey Métais

Switch to utils methods for GPS and remote

> https://code.videolan.org/videolan/vlc-android/commit/3eb8b2d5305a13c4c1789961edda5cac923ed170
---

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

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index 1064ec8..e39333c 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -20,11 +20,9 @@
 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;
@@ -115,9 +113,7 @@ public class VLCApplication extends Application {
 
         // 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);
+            AndroidDevices.setRemoteControlReceiverEnabled(false);
     }
 
     /**
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 96ace21..0c0b614 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -148,12 +148,11 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
         mBrowseFragment.setOnItemViewSelectedListener(this);
 
         //Enable search feature only if we detect Google Play Services.
-        try {
-            getPackageManager().getPackageInfo("com.google.android.gsf", PackageManager.GET_SERVICES);
+        if (AndroidDevices.hasPlayServices()) {
             mBrowseFragment.setOnSearchClickedListener(this);
             // set search icon color
             mBrowseFragment.setSearchAffordanceColor(getResources().getColor(R.color.orange500));
-        } catch (PackageManager.NameNotFoundException e) {}
+        }
 
         mRootContainer = mBrowseFragment.getView();
     }



More information about the Android mailing list