Since AndroidTV scales down the UI for UHD/4K resolution TV devices, DisplayMetrics always return 1920x1080 for these higher resolution devices.

One workaround is DisplayCompat:

On many Android TV devices, Display.Mode may not report the accurate width and height because these devices do not have powerful enough graphics pipelines to run framework code at the same resolutions supported by their video pipelines. For these devices, there is no way for an app to determine, for example, whether or not the current display mode is 4k, or that the display supports switching to other 4k modes.

DisplayCompat.getsupportedModes(context, display)

works fine on 4K TV devices with AndroidTV OS running on it. Here I get the real physical native resolution. Whenever I have a AndroidTV Stick (like Chromecast) also with AndroidTV OS running on it, the very same function returns again 1920x1080.

As Brian Lindahl pointed out in his commit: We've learned a lot about Android TV architecture in this area over the last year and the original concept is flawed. HDMI offers no way to determine what the 'native' mode is. In addition, the system properties are dynamic based on the current display mode.

How can I read screen resolution through HDMI? Or if it is still "flawed" when will it be fixed?

0

There are 0 answers