display.pixelHeight and display.viewableContentHeight not returning the correct value in some Android device (aspect ratio 20:9 ?)

The functions display.pixelHeight and display.viewableContentHeight return wrong values for some Android display resolution (ex. Xiaomi Redmi 11 Lite, Xiaomi Redmi Note 9 Pro - 1080x2400, aspect ratio of 20:9).

On simulator i riceved:

display.pixelWidth = 1080
display.pixelHeight = 2400
display.viewableContentWidth = 960
display.viewableContentHeight = 432

On device I riceved:
display.pixelWidth = 1080
display.pixelHeight = 2036
display.viewableContentWidth = 960
display.viewableContentHeight = 509

On devices ther’are 2 virtual bar: one status bar on top and one navigation bar on right

TestSafeArea.zip (70.2 KB)

I think it is because of the notch / camera. Use display.actualContentWidth and display.actualContentHeight to get those values you are expecting.

Anybody can suggest me how resolve this problem because I can’t calculate the correct safe area for user interface. The top value it’s outside of display.