summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-10-15 14:51:06 -0700
committerDianne Hackborn <hackbod@google.com>2015-10-15 14:51:06 -0700
commitf383129b0914809e9a1a011f48c945f97ccce333 (patch)
tree622c80da32c07d65bc57c11a35bc5733f1f6f240 /services
parentc83a6121d214631c0a52be5b2c5c8ce2f6470ed0 (diff)
downloadframeworks_base-f383129b0914809e9a1a011f48c945f97ccce333.zip
frameworks_base-f383129b0914809e9a1a011f48c945f97ccce333.tar.gz
frameworks_base-f383129b0914809e9a1a011f48c945f97ccce333.tar.bz2
Fix issue #24571425: Device does not come out of idle mode for maintenance
Don't allow alarms to push the idle maintenance alarm later than it was set for. Change-Id: I947718ffc9d2b984a793d7e4f2d027d8ddeee41b
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/AlarmManagerService.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index e3d5d38..a2929bd 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -971,8 +971,8 @@ class AlarmManagerService extends SystemService {
// This is a special alarm that will put the system into idle until it goes off.
// The caller has given the time they want this to happen at, however we need
// to pull that earlier if there are existing alarms that have requested to
- // bring us out of idle.
- if (mNextWakeFromIdle != null) {
+ // bring us out of idle at an earlier time.
+ if (mNextWakeFromIdle != null && a.whenElapsed > mNextWakeFromIdle.whenElapsed) {
a.when = a.whenElapsed = a.maxWhenElapsed = mNextWakeFromIdle.whenElapsed;
}
// Add fuzz to make the alarm go off some time before the actual desired time.
@@ -1256,7 +1256,7 @@ class AlarmManagerService extends SystemService {
pw.print(" Idling until: ");
if (mPendingIdleUntil != null) {
pw.println(mPendingIdleUntil);
- mPendingIdleUntil.dump(pw, " ", nowRTC, nowELAPSED, sdf);
+ mPendingIdleUntil.dump(pw, " ", nowRTC, nowELAPSED, sdf);
} else {
pw.println("null");
}