Hi, I have an application which uses the Light Sensor to read the light value and I want to turn off the screen if the light value is below a defined margin. And if it is upper the defined margin, screen should turn on. Further, at all this time, other functionalities of the application should run normally.
I tried with wake locks in Power Management API to turn on and turn off the screen. Although I could properly turn on the screen with, SCREEN_BRIGHT_WAKE_LOCK wake lock, PARTIAL_WAKE_LOCK did not turn off the screen. Is there any reason not to turn off the screen with PARTIAL_WAKE_LOCK ? I tried with the property "android.provider.Settings.System.SCREEN_OFF_TIMEOUT" to turn off the screen. It also work only if the property set from an Activity. My application is a background service. Can anyone please help me to find a solution for this. Thanks -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en