Home | History | Annotate | Download | only in deskclock

Lines Matching refs:alarm

45  * Manages each alarm
63 private Alarm mOriginalAlarm;
66 * Set an alarm. Requires an Alarms.ALARM_ID to be passed in as an
67 * extra. FIXME: Pass an Alarm object like every other Activity.
109 mAlarmPref = (AlarmPreference) findPreference("alarm");
119 Log.v("In SetAlarm, alarm id = " + mId);
122 Alarm alarm = null;
124 // No alarm id means create a new alarm.
125 alarm = new Alarm();
127 /* load alarm details from database */
128 alarm = Alarms.getAlarm(getContentResolver(), mId);
129 // Bad alarm, bail to avoid a NPE.
130 if (alarm == null) {
135 mOriginalAlarm = alarm;
157 // "Revert" on a newly created alarm should delete it.
177 // The last thing we do is pop the time picker if this is a new alarm.
189 // Asynchronously save the alarm since this method is called _before_
193 // Editing any preference (except enable) enables the alarm.
203 private void updatePrefs(Alarm alarm) {
204 mId = alarm.id;
205 mEnabledPref.setChecked(alarm.enabled);
206 mLabel.setText(alarm.label);
207 mLabel.setSummary(alarm.label);
208 mHour = alarm.hour;
209 mMinutes = alarm.minutes;
210 mRepeatPref.setDaysOfWeek(alarm.daysOfWeek);
211 mVibratePref.setChecked(alarm.vibrate);
213 mAlarmPref.setAlert(alarm.alert);
229 // In the usual case of viewing an alarm, mTimePickerCancelled is
230 // initialized to false. When creating a new alarm, this value is
249 // If the time has been changed, enable the alarm.
251 // Save the alarm and pop a toast.
264 // Enable "Revert" to go back to the original Alarm.
271 Alarm alarm = new Alarm();
272 alarm.id = mId;
273 alarm.enabled = mEnabledPref.isChecked();
274 alarm.hour = mHour;
275 alarm.minutes = mMinutes;
276 alarm.daysOfWeek = mRepeatPref.getDaysOfWeek();
277 alarm.vibrate = mVibratePref.isChecked();
278 alarm.label = mLabel.getText();
279 alarm.alert = mAlarmPref.getAlert();
282 if (alarm.id == -1) {
283 time = Alarms.addAlarm(this, alarm);
284 // addAlarm populates the alarm with the new id. Update mId so that
285 // changes to other preferences update the new alarm.
286 mId = alarm.id;
288 time = Alarms.setAlarm(this, alarm);
309 * Display a toast that tells the user how long until the alarm
313 Alarm.DaysOfWeek daysOfWeek) {
327 * format "Alarm set for 2 days 7 hours and 53 minutes from