I tried submitting this as a bug report, but for some reason it keeps redirecting me to homepage, so I'll post it here.
I'm testing on a Sony Bravia Android TV, which is 4K resolution (3840 x 2160).
However display.pixelWidth and display.pixelHeight report 1920 and 1080 respectively, instead of the expected 3840 and 2160.
This also causes the scale factor to be wrong and the dynamic image resolution to pick up the HD images, instead of the UHD ones.
I suspect this may be a Sony/Android bug, because I've had the same problem when developing native Android apps for this TV and this is a known thing:
So Google's ExoPlayer uses the following workaround to fix this:
Is this really a bug or am I doing something wrong?