The Clock app has a button that dims the screen. I’d like to check from a Service whether or not the screen has been dimmed by this method. But I cannot find any way to get this information. The following expression, for example, is not affected by this status:
Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS)
Nor SCREEN_BRIGHTNESS_MODE. I also tried PowerManager.isScreenOn() and UiModeManager.getNightMode(), but neither of them gives me the info I need.
Is there a way to get this information?
You can dim the screen without changing the system brightness using
getWindow().getAttributes().screenBrightness. SoSettings.System.getInt()isn’t going to help you check.They may also be using a dark overlay with an alpha value to dim the screen.
Either way, I’m fairly sure there’s no way to query the brightness unless you have access to the
Windowthat’s being adjusted.