Lines Matching refs:alarm

74     // The threshold for how long an alarm can be late before we print a
78 // Minimum futurity of a new alarm
81 // Minimum alarm recurrence interval
91 // Mask for testing whether a given alarm type is wakeup vs non-wakeup
215 boolean add(Alarm alarm) {
217 // narrows the batch if necessary; presumes that canHold(alarm) is true
218 int index = Collections.binarySearch(alarms, alarm, sIncreasingTimeOrder);
222 alarms.add(index, alarm);
224 Slog.v(TAG, "Adding " + alarm + " to " + this);
226 if (alarm.whenElapsed > start) {
227 start = alarm.whenElapsed;
230 if (alarm.maxWhen < end) {
231 end = alarm.maxWhen;
245 Alarm alarm = alarms.get(i);
246 if (alarm.operation.equals(operation)) {
249 if (alarm.alarmClock != null) {
253 if (alarm.whenElapsed > newStart) {
254 newStart = alarm.whenElapsed;
256 if (alarm.maxWhen < newEnd) {
257 newEnd = alarm.maxWhen;
275 Alarm alarm = alarms.get(i);
276 if (alarm.operation.getTargetPackage().equals(packageName)) {
279 if (alarm.alarmClock != null) {
283 if (alarm.whenElapsed > newStart) {
284 newStart = alarm.whenElapsed;
286 if (alarm.maxWhen < newEnd) {
287 newEnd = alarm.maxWhen;
305 Alarm alarm = alarms.get(i);
306 if (UserHandle.getUserId(alarm.operation.getCreatorUid()) == userHandle) {
309 if (alarm.alarmClock != null) {
313 if (alarm.whenElapsed > newStart) {
314 newStart = alarm.whenElapsed;
316 if (alarm.maxWhen < newEnd) {
317 newEnd = alarm.maxWhen;
427 // first alarm we've seen in the current delivery generation from this package
441 // minimum recurrence period or alarm futurity for us to be able to fuzz it
459 // calculate the end of our nominal delivery window for the alarm.
462 // [for a periodic alarm] or of the time from now to the desired delivery time,
464 // defer the alarm.
520 // the window based on the alarm's new futurity. Note that this
607 mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*alarm*");
619 // now that we have initied the driver schedule the alarm
630 Slog.w(TAG, "Failed to open alarm driver. Falling back to a handler.");
715 throw new IllegalArgumentException("Invalid alarm type " + type);
721 Slog.w(TAG, "Invalid alarm trigger time! " + triggerAtTime + " from uid=" + who
819 Slog.w(TAG, "Not setting time since no alarm driver is available.");
899 pw.print("Next non-wakeup alarm: ");
908 pw.print("Pending alarm batches: ");
1104 * Recomputes the next alarm clock for all users.
1150 // Remove users without any alarm clocks scheduled.
1182 * for which alarm clocks have changed since the last call to this.
1216 * Formats an alarm like platform/packages/apps/DeskClock used to.
1227 // Schedule the next upcoming wakeup alarm. If there is a deliverable batch
1247 // always update the kernel alarm, as a backstop against missed wakeups
1432 Alarm alarm = batch.get(i);
1433 alarm.count = 1;
1434 triggerList.add(alarm);
1436 // Recurring alarms may have passed several alarm intervals while the
1438 if (alarm.repeatInterval > 0) {
1441 alarm.count += (nowELAPSED - alarm.whenElapsed) / alarm.repeatInterval;
1444 final long delta = alarm.count * alarm.repeatInterval;
1445 final long nextElapsed = alarm.whenElapsed + delta;
1446 setImplLocked(alarm.type, alarm.when + delta, nextElapsed, alarm.windowLength,
1447 maxTriggerTime(nowELAPSED, nextElapsed, alarm.repeatInterval),
1448 alarm.repeatInterval, alarm.operation, batch.standalone, true,
1449 alarm.workSource, alarm.alarmClock, alarm.userId);
1452 if (alarm.wakeup) {
1456 // We removed an alarm clock. Let the caller recompute the next alarm clock.
1457 if (alarm.alarmClock != null) {
1463 // This is a new alarm delivery set; bump the sequence number to indicate that
1464 // all apps' alarm delivery classes should be recalculated.
1471 Slog.v(TAG, "Triggering alarm #" + i + ": " + triggerList.get(i));
1531 ? "*walarm*:" : "*alarm*:");
1622 Alarm alarm = triggerList.get(i);
1625 Slog.v(TAG, "sending alarm " + alarm);
1627 alarm.operation.send(getContext(), 0,
1629 Intent.EXTRA_ALARM_COUNT, alarm.count),
1634 setWakelockWorkSource(alarm.operation, alarm.workSource,
1635 alarm.type, alarm.tag, true);
1639 alarm.operation, alarm.workSource, alarm.type, alarm.tag);
1659 if (alarm.type == ELAPSED_REALTIME_WAKEUP
1660 || alarm.type == RTC_WAKEUP) {
1663 if (alarm.workSource != null && alarm.workSource.size() > 0) {
1664 for (int wi=0; wi<alarm.workSource.size(); wi++) {
1666 alarm.operation, alarm.workSource.get(wi),
1667 alarm.workSource.getName(wi));
1671 alarm.operation, -1, null);
1675 if (alarm.repeatInterval > 0) {
1677 // is a repeating alarm, so toss the hoser.
1678 removeImpl(alarm.operation);
1681 Slog.w(TAG, "Failure sending alarm.", e);
1756 // now deliver the alarm intents; if there are pending non-wakeup
1835 Alarm alarm = triggerList.get(i);
1837 alarm.operation.send();
1839 if (alarm.repeatInterval > 0) {
1841 // is a repeating alarm, so toss the hoser.
1842 removeImpl(alarm.operation);
1864 Slog.v(TAG, "Received TIME_TICK alarm; rescheduling");
2034 mLog.w("No in-flight alarm for " + pi + " " + intent);