2013-01-29

Android override current brightness setting

How to temporary override the current brightness setting and turn the back light to full brightness.

WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
getWindow().setAttributes(layoutParams);
Turn it off:
WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
layoutParams.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
getWindow().setAttributes(layoutParams); 

No comments: