summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-02-04 13:48:29 -0800
committerChristopher Tate <ctate@google.com>2015-02-04 13:48:29 -0800
commitc83d3e4b72f8f25bbac39a577f125f0ca04354da (patch)
tree858c34afea9778571d61fd2f92e22fa7029181f7 /services
parentd7310bd1499c0b48594a8fbbcbe0c7e80c1e5832 (diff)
downloadframeworks_base-c83d3e4b72f8f25bbac39a577f125f0ca04354da.zip
frameworks_base-c83d3e4b72f8f25bbac39a577f125f0ca04354da.tar.gz
frameworks_base-c83d3e4b72f8f25bbac39a577f125f0ca04354da.tar.bz2
Always re-establish kernel alarms when considering new alarm set
As a backstop against missed alarm delivery / wakeups or clock slew, make sure to always schedule a kernel alarm for the next alarm events of interest when we've reexamined the set of deliverable alarms. Bug 19201933 Change-Id: I3cd37a63dfb0c8258941497d4ba516ed00e2edad
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/AlarmManagerService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index a9a756e..65a5c23 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -1230,7 +1230,8 @@ class AlarmManagerService extends SystemService {
if (mAlarmBatches.size() > 0) {
final Batch firstWakeup = findFirstWakeupBatchLocked();
final Batch firstBatch = mAlarmBatches.get(0);
- if (firstWakeup != null && mNextWakeup != firstWakeup.start) {
+ // always update the kernel alarms, as a backstop against missed wakeups
+ if (firstWakeup != null) {
mNextWakeup = firstWakeup.start;
setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
}
@@ -1243,7 +1244,8 @@ class AlarmManagerService extends SystemService {
nextNonWakeup = mNextNonWakeupDeliveryTime;
}
}
- if (nextNonWakeup != 0 && mNextNonWakeup != nextNonWakeup) {
+ // always update the kernel alarm, as a backstop against missed wakeups
+ if (nextNonWakeup != 0) {
mNextNonWakeup = nextNonWakeup;
setLocked(ELAPSED_REALTIME, nextNonWakeup);
}