[Android] Add a isChromeBook boolean value

Geoffrey Métais git at videolan.org
Tue Mar 21 12:55:29 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 21 12:52:11 2017 +0100| [5cf9f19f20c295a09a5ed71c608871e7470a38e7] | committer: Geoffrey Métais

Add a isChromeBook boolean value

> https://code.videolan.org/videolan/vlc-android/commit/5cf9f19f20c295a09a5ed71c608871e7470a38e7
---

 .../src/org/videolan/vlc/util/AndroidDevices.java        | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
index d3e1feb..c576f6e 100644
--- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
+++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
@@ -64,24 +64,22 @@ public class AndroidDevices {
     public final static String EXTERNAL_PUBLIC_DIRECTORY = Environment.getExternalStorageDirectory().getPath();
 
     final static boolean hasNavBar;
-    final static boolean hasTsp, isTv, showInternalStorage;
-    public final static boolean showMediaStyle;
+    final static boolean hasTsp = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.hardware.touchscreen");
+    final static boolean isTv = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.software.leanback");
+    final static boolean showInternalStorage = !TextUtils.equals(Build.BRAND, "Swisscom") && !TextUtils.equals(Build.BOARD, "sprint");
+    public final static boolean isChromeBook = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
+    private final static String[] noMediaStyleManufacturers = {"huawei", "symphony teleca"};
+    public final static boolean showMediaStyle = !isManufacturerBannedForMediastyleNotifications();
 
-    final static String[] noMediaStyleManufacturers = {"huawei", "symphony teleca"};
 
     static {
-        HashSet<String> devicesWithoutNavBar = new HashSet<String>();
+        HashSet<String> devicesWithoutNavBar = new HashSet<>();
         devicesWithoutNavBar.add("HTC One V");
         devicesWithoutNavBar.add("HTC One S");
         devicesWithoutNavBar.add("HTC One X");
         devicesWithoutNavBar.add("HTC One XL");
         hasNavBar = AndroidUtil.isICSOrLater
                 && !devicesWithoutNavBar.contains(android.os.Build.MODEL);
-        hasTsp = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.hardware.touchscreen");
-        isTv = VLCApplication.getAppContext().getPackageManager().hasSystemFeature("android.software.leanback");
-        showInternalStorage = !TextUtils.equals(Build.BRAND, "Swisscom") && !TextUtils.equals(Build.BOARD, "sprint");
-
-        showMediaStyle = !isManufacturerBannedForMediastyleNotifications();
     }
 
     public static boolean hasExternalStorage() {



More information about the Android mailing list