Here's what I did to get around the need to make a sleep screen. You can do this in the activity window. I paired it, reducing the wait timeout to 5 seconds for this lockscreen user activity. You can view my entire source on my project page, but here is the relevant part about turning off the screen that worked for me on the droid.
public void setBright(float value) { Window mywindow = getWindow(); WindowManager.LayoutParams lp = mywindow.getAttributes(); lp.screenBrightness = value; mywindow.setAttributes(lp); }
I used the handler task as a test for the method, it worked when I called it from onBackPressed in the first assembly. Now I just got setBright set to 0.0 with onCreate. This makes it so that the screen does not actually turn on, even if my user wakes up the processor by accidentally pressing the volume key. When I want the screen to continue, I have a setBright event call raised with a value greater than 0 (1.0 means max bright). I am very lucky this works for my lockscreen user activity. I found that changing the literal brightness setting does not work like that, and will not turn off the screen.
check out my other source on my svn project http://code.google.com/p/mylockforandroid/source/checkout
How difficult, in your opinion, is asking the android team to add support to turn off the screen or determine if the screen should wake up by replacing the Lock pick, similar to how you can program an alternative Home Launcher application?
mylock Jan 12 2018-10-12T00: 00Z
source share