Do not discriminate against non-Amazon TV boxes

This commit is contained in:
Alexander 2019-09-20 16:23:17 +07:00 committed by Alexander--
parent 1bb96ef405
commit 6791de5fc0

View file

@ -1,10 +1,18 @@
package org.schabi.newpipe.util; package org.schabi.newpipe.util;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import org.schabi.newpipe.App; import org.schabi.newpipe.App;
public class FireTvUtils { public class FireTvUtils {
@SuppressLint("InlinedApi")
public static boolean isFireTv(){ public static boolean isFireTv(){
final String AMAZON_FEATURE_FIRE_TV = "amazon.hardware.fire_tv"; final String AMAZON_FEATURE_FIRE_TV = "amazon.hardware.fire_tv";
return App.getApp().getPackageManager().hasSystemFeature(AMAZON_FEATURE_FIRE_TV);
PackageManager pm = App.getApp().getPackageManager();
return pm.hasSystemFeature(AMAZON_FEATURE_FIRE_TV)
|| pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
} }
} }