0

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
yuiopt
  • 127
  • 1
  • 1
  • 9

1 Answers1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Laura
  • 2,653
  • 7
  • 37
  • 59
  • 1
    Yes, 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