I wrote a simple alarm-clock style application that I run on my (jailbroken) Nook Simple Touch (aka NST), under Android 2.1.
When the scheduled alarm time arrives, my application needs to wake up the NST and display a page of HTML content. I use AlarmManager to get a callback at the right time, and it seems to work as expected -- almost.
The problem occurs when enough idle time has passed that the NST has activated its lock-screen mode (i.e. it is auto-displaying a caricature of a famous author). I can't find a programmatic way to dismiss the lock-screen so that my HTML content will be visible. I can see that my alarm callback routine ran at the expected time (via the LogCat view in Eclipse, after I reconnect to the NST with adb), and after I manually "drag to unlock" with my finger, I can see that my app's window updated as expected, but I need to have the text become visible when the alarm event occurs, not just after the user unlocks the device. I tried the code shown below (based on other StackOverflow answers) but it doesn't help.
Any ideas regarding a way to do this? (One solution that technically works is to keep FLAG_KEEP_SCREEN_ON set on my window at all times, so that the famous-author-lock-screen never appears in the first place, but that keeps the NST awake and therefore it uses up the battery rather quickly, so I want to avoid that if possible)
private void wakeUpTheScreen()
{
Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
}