Add this to the activity that has edge-to-edge enabled.
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">always</item>
This prevents the activity's contents from being pushed below the status bar because it forces that space to be always available.