Don't try to do the work if there isn't any data.
Bug 10056484 Change-Id: I527f592b0bb91bfbfff1d52c3327fe9e2ac53471
This commit is contained in:
@ -640,15 +640,17 @@ class AlarmManagerService extends IAlarmManager.Stub {
|
||||
private void rescheduleKernelAlarmsLocked() {
|
||||
// Schedule the next upcoming wakeup alarm. If there is a deliverable batch
|
||||
// prior to that which contains no wakeups, we schedule that as well.
|
||||
final Batch firstWakeup = findFirstWakeupBatchLocked();
|
||||
final Batch firstBatch = mAlarmBatches.get(0);
|
||||
if (firstWakeup != null && mNextWakeup != firstWakeup.start) {
|
||||
mNextWakeup = firstWakeup.start;
|
||||
setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
|
||||
}
|
||||
if (firstBatch != firstWakeup && mNextNonWakeup != firstBatch.start) {
|
||||
mNextNonWakeup = firstBatch.start;
|
||||
setLocked(ELAPSED_REALTIME, firstBatch.start);
|
||||
if (mAlarmBatches.size() > 0) {
|
||||
final Batch firstWakeup = findFirstWakeupBatchLocked();
|
||||
final Batch firstBatch = mAlarmBatches.get(0);
|
||||
if (firstWakeup != null && mNextWakeup != firstWakeup.start) {
|
||||
mNextWakeup = firstWakeup.start;
|
||||
setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
|
||||
}
|
||||
if (firstBatch != firstWakeup && mNextNonWakeup != firstBatch.start) {
|
||||
mNextNonWakeup = firstBatch.start;
|
||||
setLocked(ELAPSED_REALTIME, firstBatch.start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user