Skip to content

Conversation

B0pol
Copy link
Member

@B0pol B0pol commented Apr 25, 2020

What is it?

  • Bug fix (user facing)
  • Feature (user facing)
  • Code base improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • have a better detection of TV devices, so that everyone with a TV can have a great experience on NewPipe.

Because some boxes — including mine — are just boxes shipped with Android with a TV interface / remote-friendly interface, but they aren't shipped with official Android TV system, i.e. with Google Assistant, Chromecast… , or Fire TV (I've seen Fire TV detection in AndroidTvUtils.isTv()).

Please include this PR in 0.19.3, this way #3478 will ship all TV fixes.

Fixes the following issue(s)

  • Some android boxes aren't detected as TV (because not Fire TV / Android TV), and it created many issues mainly related with navigation.

Testing apk

NewPipe_tv_detection.zip

Agreement

Some devices were not detected as TV even though they are
@B0pol B0pol added bug Issue is related to a bug ASAP Issue needs to be fixed as soon as possible Android TV Issue is related to Android TV labels Apr 25, 2020
@TobiGr
Copy link
Contributor

TobiGr commented Apr 25, 2020

On KitKat

org.schabi.newpipe.debug.tv E/class org.schabi.newpipe.report.ErrorActivity: java.lang.NoSuchMethodError: android.os.BatteryManager.getIntProperty
        at org.schabi.newpipe.util.AndroidTvUtils.isTv(AndroidTvUtils.java:32)
        at org.schabi.newpipe.MainActivity.onCreate(MainActivity.java:148)
        at android.app.Activity.performCreate(Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
        at android.app.ActivityThread.access$800(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)

@B0pol
Copy link
Member Author

B0pol commented Apr 25, 2020

I removed the suppress lint annotation and correctly handled sdk version. I've installed an android 4.4 emulator (it's super fast compared to android 10 emulator) and fixed the crash @TobiGr.

@TobiGr
Copy link
Contributor

TobiGr commented Apr 25, 2020

we should store isTV as static class var to prevent calculating it again and again since this is more complex now. after that it should be good to go.

@TobiGr TobiGr merged commit 4ea273b into TeamNewPipe:dev Apr 26, 2020
@B0pol B0pol deleted the tv branch April 26, 2020 10:55
@TobiGr TobiGr added this to the 0.19.3 milestone Apr 26, 2020
@TobiGr TobiGr mentioned this pull request Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android TV Issue is related to Android TV ASAP Issue needs to be fixed as soon as possible bug Issue is related to a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants