Hey all,
I have a signal that puts my app to sleep for a given number of minutes (using AlarmManager) and then wakes it back up.
Everything is working except the screen doesn't ever come on. I'm using a wakelock like so from a BroadcastReceiver class:
KeyguardManager key = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
KeyguardLock lock = key.newKeyguardLock(TAG);
lock.disableKeyguard();
Log.v(TAG, "alarm: disabled keyguard.");
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
gpsMain.wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);
gpsMain.wl.acquire();
Log.v(TAG, "alarm: acquired wakelock");
Intent i = new Intent();
i.setAction(CUSTOM_INTENT);
context.sendBroadcast(i);
I then release the wakelock when I'm sure that my app is up and running and connected again. However, the screen never comes on! The app only actually comes back to life when I hit the power button to wake up the screen manually.
I'm developing on an HTC Hero. Any assistance would be GREATLY appreciated..