The code below to change screen brightness is not working when auto brightness of device is enabled:
Window w = getWindow();
WindowManager.LayoutParams lp = w.getAttributes();
lp.screenBrightness=0.09f;
getWindow().setAttributes(lp);
How to change this code for working on auto brightness too?