I tried to read screen brightness on an Android phone, on that phone the auto brightness was on, and I got a value just equals the brightness number before the auto brightness was on, I need to read the real brightness even the brightness is changing with the light sensor, or if the auto brightness factor can be read?
Asked
Active
Viewed 1,187 times
1 Answers
1
I did some research and it seems that is not possible. See this answer from Get preferred screen brightness in Android.
I also tried this code:
int brightnessValue = Settings.System.getInt(
getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS,
0
);
But it always returns the non-automatic brightness.
-
1Yes, I find out that it is unable to get screen brightness on auto mode, but there is a hidden API could get "screen_auto_brightness_adj", a [-1,1] float number, this API may be closed in the future, I am wondering why android framework was designed to disable developer to get the real screen brightness on auto mode. – yuiopt Oct 11 '17 at 09:09