On Android device Screen.height is returning an incorrect value

In my scene I am trying to center an object and make it’s size the height and width of the screen. However when I deploy to a Nexus 5 device that has a resolution of 1920 x 1080 the height and width that is being returned with Screen.height and Screen.width is 1776 x 1080. I’ve also encountered something similar on Samsung Galaxy S4 and S5 devices. (I don’t have the height values that those devices are returning, but if need be I could get them.) It does display correctly on a Nexus 7 device though, so this doesn’t appear to be consistent across all devices.

I’m using Unity 4.5.4 and the Nexus 5 is using Android 4.4.2.

Does anyone know of a reason as to why this could be happening?

First of all, Screen.height returns the window height, not the hardware resolution: Unity - Scripting API: Screen.height

Support for immersive fullscreen mode (Android 4.4+) was added in Unity 5. In Unity 4, you got screen height minus the button bar height, so the results looks correct for me. In Unity 5, it returns 1280x768 for my Nexus 4, which also looks correct.