// Maintain a lock during the playback of the alarm. This lock may have
// already been acquired in AlarmReceiver. If the process was killed,
// the global wake lock is gone. Acquire again just to be sure.
- // AlarmAlertWakeLock.acquire(this);
+ AlarmAlertWakeLock.acquire(this);
/* FIXME Intentionally verbose: always log this until we've
fully debugged the app failing to start up */
// Display the snooze minutes in a toast.
Toast.makeText(AlarmAlert.this, displayTime, Toast.LENGTH_LONG).show();
mKlaxon.stop(this, mState == SNOOZE);
- releaseLocks();
+ AlarmAlertWakeLock.release();
}
// Dismiss the alarm.
}
mState = DISMISS;
mKlaxon.stop(this, false);
- releaseLocks();
+ AlarmAlertWakeLock.release();
}
/**
protected void onResume() {
super.onResume();
if (Log.LOGV) Log.v("AlarmAlert.onResume()");
- AlarmAlertWakeLock.acquire(this);
}
@Override
// As a last resort, try to snooze if this activity is stopped.
snooze();
// We might have been killed by the KillerCallback so always release
- // the lock and keyguard.
- releaseLocks();
+ // the lock.
+ AlarmAlertWakeLock.release();
}
@Override
}
return super.dispatchKeyEvent(event);
}
-
- /**
- * release wake and keyguard locks
- */
- private synchronized void releaseLocks() {
- AlarmAlertWakeLock.release();
- }
}