Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust TV detection logic #1822

Merged
merged 2 commits into from
Jul 9, 2022

Conversation

Andy2244
Copy link
Contributor

@Andy2244 Andy2244 commented Jul 7, 2022

Changes

  • adjust TV detection logic

Issues
All TV media boxes running normal Android, instead of AndroidTV will fail this check.
All none AndroidTV certified devices run Android, which is the largest segment for TV media devices.
The main reason is the harder AndroidTV certification process and licensing cost, so this will not change in the future.

So we should never rely on anything specific AndroidTv related.

@nielsvanvelzen
Copy link
Member

The Android TV app is not meant for normal Android devices, so the notification does exactly what it should do. The mobile app is for non-TV devices.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

The Android TV app is not meant for normal Android devices, so the notification does exactly what it should do. The mobile app is for non-TV devices.

This ignores the reality that the majority of TV media-boxes run Android and not AndroidTV.
No user of those boxes wants to use the Android version, since they still use a TV and have no touch inputs.

Most of the devices in those list all run Android and are yet only designed for TV use:
https://androidtvbox.eu/category/tv-box/
https://www.androidtv-guide.com/streaming-gaming/

So "Jellyfin Android TV" runs fine on all those devices, since there is not any AndroidTV specific code and this should remain so.
This client should really just be a TV optimized variant and not a variant that runs only on AndroidTV specifically.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

Here is a sort-able list with OS column:
https://tvboxstop.com/tv-box-rank-chart-2020/

@nielsvanvelzen
Copy link
Member

Ok so we'd need to change the detection logic because those manufacturers didn't change the device mode flag. I don't think adding the "normal" type to the list is the right fix as that hides the notification on phones/tablets, where it should show.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 8, 2022

Ok so we'd need to change the detection logic because those manufacturers didn't change the device mode flag. I don't think adding the "normal" type to the list is the right fix as that hides the notification on phones/tablets, where it should show.

I will see what i can find, possible solutions are:

  • do a 2k, 4k with 16:9+ check
  • check if we have a hdmi TV device

any other ideas?

@nielsvanvelzen
Copy link
Member

I think we can check for touch screen support. I'm not aware of any television with touch support (the official Android TV apps don't even support it).

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 8, 2022

I think we can check for touch screen support.

Depends on how this is detected?
You are aware that some TV's have "air mouse" enabled remotes, so they emulate a pointing device?
You can also order a BT "Air mouse" for those media-boxes, which is done to somewhat make none TV optimized app's usable.

So if we can detect real touch-input and distinguish it from those Air-mouse devices, this could work along with a basic aspect-ratio check?

@nielsvanvelzen
Copy link
Member

A cursor is not a touch screen. I think using !packageManager.hasSystemFeature("android.hardware.touchscreen") should therefor be reliable enough. Together with the existing check it should support most TV boxes that don't run Android TV.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 8, 2022

ah cool, will test this asap on my device.

Btw i sold my ShieldTv/FireTv, so keep in mind that i only test via one of those Android 9 devices.

@Andy2244 Andy2244 changed the title disable TV notification for "normal" Android devices adjust TV detection logic Jul 8, 2022
@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 8, 2022

@nielsvanvelzen touch detection does not work, my device reports a touchpad and even a accelerometer... I think thats all just to emulate things, so apps don't refuse to run.

Yet i found the android.hardware.hdmi.cec feature, which "should" only exist on TV media boxes?
Can you verify it works for your cases as well?

@nielsvanvelzen
Copy link
Member

Tested on a bunch of devices & emulator:

  • ATV emulator: doesn't show ✔️
  • Nvidia Shield Pro: doesn't show ✔️
  • Android (mobile) emulator: shows ✔️
  • Oneplus 6: shows ✔️
  • Galaxy Tab S 8.4 (with unofficial lineageos rom): shows ✔️

So I think it works as expected

@nielsvanvelzen nielsvanvelzen added this to In progress in v0.14.0 via automation Jul 9, 2022
…icationsRepository.kt

Co-authored-by: Niels van Velzen <nielsvanvelzen@users.noreply.github.com>
@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 9, 2022

So I think it works as expected

@nielsvanvelzen Ah nice, btw any chance to get the new dolby vision stuff working for BaseItemDto or in some other way?
We also miss DV/Atmos text/icons for the various views.

@nielsvanvelzen
Copy link
Member

btw any chance to get the new dolby vision stuff working for BaseItemDto or in some other way?
We also miss DV/Atmos text/icons for the various views.

Rewrite all playback code to use the SDK, that's the only way.

v0.14.0 automation moved this from In progress to Reviewer approved Jul 9, 2022
@nielsvanvelzen nielsvanvelzen merged commit bb98a64 into jellyfin:master Jul 9, 2022
v0.14.0 automation moved this from Reviewer approved to Done Jul 9, 2022
@Andy2244 Andy2244 deleted the disable-tv_detection branch July 9, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.14.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants