private static final int KILLED = 3;
private KeyguardManager mKeyguardManager;
- private KeyguardManager.KeyguardLock mKeyguardLock = null;
+ private KeyguardManager.KeyguardLock mKeyguardLock;
private Button mSnoozeButton;
private int mState = UNKNOWN;
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
+ // 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);
+
/* FIXME Intentionally verbose: always log this until we've
fully debugged the app failing to start up */
Log.v("AlarmAlert.onCreate()");
- mKlaxon = AlarmKlaxon.getInstance();
-
// Popup alert over black screen
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.width = ViewGroup.LayoutParams.WRAP_CONTENT;
Intent i = getIntent();
mAlarmId = i.getIntExtra(Alarms.ID, -1);
+ mKlaxon = new AlarmKlaxon();
+ mKlaxon.postPlay(this, mAlarmId);
+
/* Set the title from the passed in label */
setTitleFromIntent(i);
disableKeyguard();
mAlarmId = intent.getIntExtra(Alarms.ID, -1);
+ // Play the new alarm sound.
+ mKlaxon.postPlay(this, mAlarmId);
+
setTitleFromIntent(intent);
/* unset silenced message */