Dynamic status bar height calculation (if location/call in progress)

Has anyone figured out how to get the status bar height respecting if location/call is in progress?

Constants statusBarHeight is fixed.