Home | History | Annotate | Download | only in deskclock

Lines Matching defs:alarm

33  * activity.  Passes through Alarm ID.
37 /** If the alarm is older than STALE_WINDOW, ignore. It
57 // The alarm has been killed, update the notification
58 updateNotification(context, (Alarm)
63 Alarm alarm = null;
65 // Get the alarm out of the Intent
66 alarm = intent.getParcelableExtra(Alarms.ALARM_INTENT_EXTRA);
69 if (alarm != null) {
70 Alarms.disableSnoozeAlert(context, alarm.id);
73 // Don't know what snoozed alarm to cancel, so cancel them all. This
75 Log.wtf("Unable to parse Alarm from intent.");
84 Alarm alarm = null;
85 // Grab the alarm from the intent. Since the remote AlarmManagerService
87 // Alarm object. It throws a ClassNotFoundException when unparcelling.
94 alarm = Alarm.CREATOR.createFromParcel(in);
97 if (alarm == null) {
98 Log.wtf("Failed to parse the alarm from the intent");
104 // Disable the snooze alert if this alarm is the snooze.
105 Alarms.disableSnoozeAlert(context, alarm.id);
106 // Disable this alarm if it does not repeat.
107 if (!alarm.daysOfWeek.isRepeatSet()) {
108 Alarms.enableAlarm(context, alarm.id, false);
115 // Intentionally verbose: always log the alarm time to provide useful
118 Log.v("Recevied alarm set for " + Log.formatTime(alarm.time));
121 if (now > alarm.time + STALE_WINDOW) {
122 Log.v("Ignoring stale alarm");
143 // Play the alarm alert and vibrate the device.
145 playAlarm.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
148 // Trigger a notification that, when clicked, will show the alarm alert
152 notify.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
154 alarm.id, notify, 0);
156 // Use the alarm's label or the default label as the ticker text and
158 String label = alarm.getLabelOrDefault(context);
160 label, alarm.time);
171 alarmAlert.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
174 n.fullScreenIntent = PendingIntent.getActivity(context, alarm.id, alarmAlert, 0);
176 // Send the notification using the alarm id to easily identify the
179 nm.notify(alarm.id, n);
187 private void updateNotification(Context context, Alarm alarm, int timeout) {
190 // If the alarm is null, just cancel the notification.
191 if (alarm == null) {
200 viewAlarm.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
202 PendingIntent.getActivity(context, alarm.id, viewAlarm, 0);
206 String label = alarm.getLabelOrDefault(context);
208 label, alarm.time);
216 nm.cancel(alarm.id);
217 nm.notify(alarm.id, n);