Home | History | Annotate | Download | only in deskclock

Lines Matching refs:alarm

32  * activity.  Passes through Alarm ID.
36 /** If the alarm is older than STALE_WINDOW, ignore. It
43 // The alarm has been killed, update the notification
44 updateNotification(context, (Alarm)
56 Alarm alarm = null;
57 // Grab the alarm from the intent. Since the remote AlarmManagerService
59 // Alarm object. It throws a ClassNotFoundException when unparcelling.
66 alarm = Alarm.CREATOR.createFromParcel(in);
69 if (alarm == null) {
70 Log.wtf("Failed to parse the alarm from the intent");
76 // Disable the snooze alert if this alarm is the snooze.
77 Alarms.disableSnoozeAlert(context, alarm.id);
78 // Disable this alarm if it does not repeat.
79 if (!alarm.daysOfWeek.isRepeatSet()) {
80 Alarms.enableAlarm(context, alarm.id, false);
87 // Intentionally verbose: always log the alarm time to provide useful
90 Log.v("Recevied alarm set for " + Log.formatTime(alarm.time));
93 if (now > alarm.time + STALE_WINDOW) {
94 Log.v("Ignoring stale alarm");
115 // Play the alarm alert and vibrate the device.
117 playAlarm.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
120 // Trigger a notification that, when clicked, will show the alarm alert
124 notify.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
126 alarm.id, notify, 0);
128 // Use the alarm's label or the default label as the ticker text and
130 String label = alarm.getLabelOrDefault(context);
132 label, alarm.time);
143 alarmAlert.putExtra(Alarms.ALARM_INTENT_EXTRA, alarm);
146 n.fullScreenIntent = PendingIntent.getActivity(context, alarm.id, alarmAlert, 0);
148 // Send the notification using the alarm id to easily identify the
151 nm.notify(alarm.id, n);
159 private void updateNotification(Context context, Alarm alarm, int timeout) {
162 // If the alarm is null, just cancel the notification.
163 if (alarm == null) {
172 viewAlarm.putExtra(Alarms.ALARM_ID, alarm.id);
174 PendingIntent.getActivity(context, alarm.id, viewAlarm, 0);
178 String label = alarm.getLabelOrDefault(context);
180 label, alarm.time);
188 nm.cancel(alarm.id);
189 nm.notify(alarm.id, n);