Better detection of TV devices

Some devices were not detected as TV even though they are
This commit is contained in:
bopol 2020-04-25 11:35:15 +02:00
parent b0c0249ce6
commit 00262b4a49
9 changed files with 43 additions and 19 deletions

View file

@ -64,8 +64,8 @@ import org.schabi.newpipe.fragments.MainFragment;
import org.schabi.newpipe.fragments.detail.VideoDetailFragment;
import org.schabi.newpipe.fragments.list.search.SearchFragment;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.AndroidTvUtils;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
@ -145,7 +145,7 @@ public class MainActivity extends AppCompatActivity {
ErrorActivity.reportUiError(this, e);
}
if (AndroidTvUtils.isTv()) {
if (AndroidTvUtils.isTv(this)) {
FocusOverlayView.setupFocusObserver(this);
}
}
@ -532,7 +532,7 @@ public class MainActivity extends AppCompatActivity {
Log.d(TAG, "onBackPressed() called");
}
if (AndroidTvUtils.isTv()) {
if (AndroidTvUtils.isTv(this)) {
View drawerPanel = findViewById(R.id.navigation);
if (drawer.isDrawerOpen(drawerPanel)) {
drawer.closeDrawers();