Revert "Fix crash on HarmonyOS due to broken TV content provider APIs"

This reverts commit ce0b19605a9fb651e333be0e99905d15f0165324.
This commit is contained in:
Cameron Gutman 2020-11-10 10:44:41 -06:00
parent 17cf711c3d
commit 34a1697d50

View File

@ -252,19 +252,7 @@ public class TvChannelHelper {
@TargetApi(Build.VERSION_CODES.O)
private boolean isAndroidTV() {
PackageManager pm = context.getPackageManager();
// HarmonyOS devices report PackageManager.FEATURE_LEANBACK yet
// when we attempt to actually use TvContract, it will die with
// an IllegalArgumentException because TvContract.Channels.CONTENT_URI
// is an unknown URL. I don't know if this is a perfect check for
// HarmonyOS-powered TVs (excluding any Android TVs), but it will
// suffice for now.
if (pm.hasSystemFeature("com.huawei.software.features.tv")) {
return false;
}
return pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK);
}
@TargetApi(Build.VERSION_CODES.O)