Merge "DO NOT MERGE ANYWHERE Revert "Always re-establish kernel alarms when considering new alarm set"" into lmp-mr1-modular-dev

This commit is contained in:
Prashant Malani
2015-06-11 23:36:42 +00:00
committed by Android (Google) Code Review

View File

@@ -1230,8 +1230,7 @@ class AlarmManagerService extends SystemService {
if (mAlarmBatches.size() > 0) {
final Batch firstWakeup = findFirstWakeupBatchLocked();
final Batch firstBatch = mAlarmBatches.get(0);
// always update the kernel alarms, as a backstop against missed wakeups
if (firstWakeup != null) {
if (firstWakeup != null && mNextWakeup != firstWakeup.start) {
mNextWakeup = firstWakeup.start;
setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
}
@@ -1244,8 +1243,7 @@ class AlarmManagerService extends SystemService {
nextNonWakeup = mNextNonWakeupDeliveryTime;
}
}
// always update the kernel alarm, as a backstop against missed wakeups
if (nextNonWakeup != 0) {
if (nextNonWakeup != 0 && mNextNonWakeup != nextNonWakeup) {
mNextNonWakeup = nextNonWakeup;
setLocked(ELAPSED_REALTIME, nextNonWakeup);
}