Screen.SafeArea not working on Huawei phones

Hi, for some reason after tinkering with Android Activity (changing from inheriting UnityMainActivity to inheriting AppCompatActivity and proxying the Unity’s events/callbacks) I’ve stumbled upon an issue with safe area on Huawei devices.

The left phone is a OnePlus 6 and the right one is Huawei P40. The green UI panel size is set to the safe area dimensions and as you can see, on the OnePlus its correctly stopping before the notch and on the Huawei the whole screen is returned as a safe area. Does anyone know what could be the cause of this?

Other device brands like Oppo, Xiaomi and Samsung don’t have this issue.

Hey @Magalek, which Unity version are you using?

Hi @manugil 2021.3.37f1.

Looks like the usage of AppCompatActivity breaks the Screen.safeArea on Huawei as I’ve reverted the changes and it worked correctly. But why does this break on Huawei only?