Merge pull request #12395 from unknownbrackets/android-minor

Android: Setup UI callback earlier if possible
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2019-10-07 19:48:52 +02:00
commit e0f60eba60
1 file changed
+7 -1
@@ -838,8 +838,10 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
@Override
public void onAttachedToWindow() {
Log.i(TAG, "onAttachedToWindow");
super.onAttachedToWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
Log.i(TAG, "onAttachedToWindow");
DisplayCutout cutout = getWindow().getDecorView().getRootWindowInsets().getDisplayCutout();
if (cutout != null) {
safeInsetLeft = cutout.getSafeInsetLeft();
@@ -855,6 +857,10 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
safeInsetBottom = 0;
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setupSystemUiCallback();
}
}
@Override