Apparently, Android saves two values for the screen brightness: One for automatic adjustment and one for manual mode (at least on Nougat). How do I change the one for automatic adjustment?
If I change the screen brightness to 0 like this:
Settings.System.putInt(
context.contentResolver,
Settings.System.SCREEN_BRIGHTNESS,
0
)
then the one for manual mode is changed. While automatic adjustment is on, this code does not produce any visible change.
Here: https://stackoverflow.com/a/18312812 someone proposes to turn manual mode on first (SCREEN_BRIGHTNESS_MODE_MANUAL
) but I want to keep automatic adjustment on.