You can use immersive mode but that will still allow a user to access the status bar by swiping from the top of the screen 2 times.
What you really want is to run a shell: service call activity 42 s16 com.android.systemui
as root.
You can use this function to execute it:
public static void sudo(String...strings) {
try{
Process su = Runtime.getRuntime().exec("su");
DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());
for (String s : strings) {
outputStream.writeBytes(s+"\n");
outputStream.flush();
}
outputStream.writeBytes("exit\n");
outputStream.flush();
try {
su.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
outputStream.close();
}catch(IOException e){
e.printStackTrace();
}
}
This was pulled from another S/O question with pages upon pages of answers but it is the only one to work for me on multiple devices. So, just to save you some time.