FileDocCategorySizeDatePackage
AlarmAlertWakeLock.javaAPI DocAndroid 1.5 API1588Wed May 06 22:42:42 BST 2009com.android.alarmclock

AlarmAlertWakeLock

public class AlarmAlertWakeLock extends Object
Hold a wakelock that can be acquired in the AlarmReceiver and released in the AlarmAlert activity

Fields Summary
private static PowerManager.WakeLock
sWakeLock
Constructors Summary
Methods Summary
static voidacquire(android.content.Context context)

        Log.v("Acquiring wake lock");
        if (sWakeLock != null) {
            sWakeLock.release();
        }

        PowerManager pm =
                (PowerManager) context.getSystemService(Context.POWER_SERVICE);

        sWakeLock = pm.newWakeLock(
                PowerManager.FULL_WAKE_LOCK |
                PowerManager.ACQUIRE_CAUSES_WAKEUP |
                PowerManager.ON_AFTER_RELEASE, Log.LOGTAG);
        sWakeLock.acquire();
    
static voidrelease()

        Log.v("Releasing wake lock");
        if (sWakeLock != null) {
            sWakeLock.release();
            sWakeLock = null;
        }