Android screen brightness help

I’m trying to set the screen brightness to 80% on APP start up, the following code inserted in the main activity (UnityPlayerNativeActivity.java for unity) worked on other android platform engines but not unity. With the code inserted no brightness change occurs but I get no errors. I’m not familiar with Java so any help would be great, I’ve attached the UnityPlayerNativeActivity.java file with the code added in onCreate.

WindowManager.LayoutParams params = getWindow().getAttributes();
params.screenBrightness = 0.8f;
getWindow().setAttributes(params);

Johnyc

1881937–121050–UnityPlayerNativeActivity.txt (2.91 KB)

Have you found a proper solution to this?