I am trying to turn off the button illumination in my application using the nightmode function of UiModeManager. The Desk Clock app by default (Nexus One) turns off the backlight when it dims, and I also want to do this.
I tried using the following code:
UiModeManager mgr = (UiModeManager) getSystemService (UI_MODE_SERVICE); mgr.setNightMode (UiModeManager.MODE_NIGHT_YES);
The UiModeManager.setNightMode (int mode) documentation says the following:
Sets the night mode. Changes to night mode only apply when car or desk mode is enabled on the device.
Does this mean that the device must be physically in the desktop dock? I can configure the device in car mode using the UiModeManager.enableCarMode (int flags) method. This works great, but does not turn off the light, it only reduces the screen backlight.
Is there a way to set the device up without using a physical desktop dock? Since the source code for FroYo has not yet been released, I cannot look at the built-in Desk Clock application.
source share