The whole question is in the title, so I would like to emphasize as much as I can:
I'm interested in the current value (not in the current settings)
I'm interested in the real value (so if the screen brightness is now lower than a second, the value should also be lower)
Unfortunately, despite reading numerous posts, I do not know the answer. I wrote little utility that every second shows time and brightness. And it will not work - because when the phone (LG L5 with Android 4.0) automatically lowers the brightness (screen dims, and in this there is no doubt), the values remain the same
Here is the relevant code snippet:
try
{
float sys_brightness = android.provider.Settings.System
.getFloat(getContentResolver(),
android.provider.Settings
.System.SCREEN_BRIGHTNESS);
WindowManager.LayoutParams lp = getWindow().getAttributes();
float dim = lp.dimAmount;
float scr_brightness = lp.screenBrightness;
boolean dim_changed = (lp.flags & WindowManager.LayoutParams
.DIM_AMOUNT_CHANGED)>0;
textView.setText(String.format("%02d:%02d:%02d", hours, minutes, seconds)+" "
+String.format("%02f, %02f, %02f", sys_brightness,dim,scr_brightness)
+" "+Boolean.toString(dim_changed));
}
catch (SettingNotFoundException ex)
{
textView.setText("excepton");
}
- 92, 1.0, -1.0, false. .
- , /?
, , . .