There are some devices such as Huawei p20(running android 8,8.1) which has in-built notch
on the top.
The current way to get the size of the screen is
Display display = getWindow().getWindowManager().getDefaultDisplay();
Point screenSize = new Point();
display.getRealSize(screenSize);
//screenSize.x
//screenSize.y
And it's leading the game out of screen. So, is there any way to solve notch issue with android P and Pre-p devices.