am ad7c57db: Merge "Always re-evaluate kernel alarm setpoints when a new alarm is added" into klp-dev
* commit 'ad7c57db25ac4fc919a92a215ec2a4609c0f91a9': Always re-evaluate kernel alarm setpoints when a new alarm is added
This commit is contained in:
@@ -577,16 +577,14 @@ class AlarmManagerService extends IAlarmManager.Stub {
|
|||||||
operation, workSource);
|
operation, workSource);
|
||||||
removeLocked(operation);
|
removeLocked(operation);
|
||||||
|
|
||||||
boolean reschedule;
|
|
||||||
int whichBatch = (isStandalone) ? -1 : attemptCoalesceLocked(whenElapsed, maxWhen);
|
int whichBatch = (isStandalone) ? -1 : attemptCoalesceLocked(whenElapsed, maxWhen);
|
||||||
if (whichBatch < 0) {
|
if (whichBatch < 0) {
|
||||||
Batch batch = new Batch(a);
|
Batch batch = new Batch(a);
|
||||||
batch.standalone = isStandalone;
|
batch.standalone = isStandalone;
|
||||||
reschedule = addBatchLocked(mAlarmBatches, batch);
|
addBatchLocked(mAlarmBatches, batch);
|
||||||
} else {
|
} else {
|
||||||
Batch batch = mAlarmBatches.get(whichBatch);
|
Batch batch = mAlarmBatches.get(whichBatch);
|
||||||
reschedule = batch.add(a);
|
if (batch.add(a)) {
|
||||||
if (reschedule) {
|
|
||||||
// The start time of this batch advanced, so batch ordering may
|
// The start time of this batch advanced, so batch ordering may
|
||||||
// have just been broken. Move it to where it now belongs.
|
// have just been broken. Move it to where it now belongs.
|
||||||
mAlarmBatches.remove(whichBatch);
|
mAlarmBatches.remove(whichBatch);
|
||||||
@@ -602,13 +600,10 @@ class AlarmManagerService extends IAlarmManager.Stub {
|
|||||||
+ " interval=" + interval + " op=" + operation
|
+ " interval=" + interval + " op=" + operation
|
||||||
+ " standalone=" + isStandalone);
|
+ " standalone=" + isStandalone);
|
||||||
rebatchAllAlarmsLocked(false);
|
rebatchAllAlarmsLocked(false);
|
||||||
reschedule = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reschedule) {
|
rescheduleKernelAlarmsLocked();
|
||||||
rescheduleKernelAlarmsLocked();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logBatchesLocked() {
|
private void logBatchesLocked() {
|
||||||
|
|||||||
Reference in New Issue
Block a user