summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrashant Malani <pmalani@google.com>2015-06-26 21:00:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-26 21:00:11 +0000
commit9a3eacbe9ce0e6a65429c721b6f4e60a28dbdaab (patch)
treec6375ee05806f4a13b3aa06b0ba921fe321e252a
parent6f6326bc75be652a0b88b73fd6e0b73dbe2fabb6 (diff)
parent753e9e0f2d0c6c15eeb3e4905d67bfb4f12e0f87 (diff)
downloadframeworks_base-9a3eacbe9ce0e6a65429c721b6f4e60a28dbdaab.zip
frameworks_base-9a3eacbe9ce0e6a65429c721b6f4e60a28dbdaab.tar.gz
frameworks_base-9a3eacbe9ce0e6a65429c721b6f4e60a28dbdaab.tar.bz2
Merge "Revert "Always re-establish kernel alarms when considering new alarm set"" into cw-d-mr1-dev
-rw-r--r--services/core/java/com/android/server/AlarmManagerService.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index 65a5c23..a9a756e 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -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);
}