Fix BatteryExternalStatsWorker UPDATE_ALL usage
In some places, BESW compares the update flag against UPDATE_ALL in a way that will always be true, instead of seeing if it is actually equal to it. This would have led to far more frequent updateKernelWakelocksLocked and updateKernelMemoryBandwidthLocked calls than intended. Test: n/a Bug: 174818202 Change-Id: I19a5cf80eee0768989dcea0c2f205dc9f749ac9f
This commit is contained in:
@@ -345,7 +345,7 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
||||
mUidsToRemove.clear();
|
||||
mCurrentFuture = null;
|
||||
mUseLatestStates = true;
|
||||
if ((updateFlags & UPDATE_ALL) != 0) {
|
||||
if (updateFlags == UPDATE_ALL) {
|
||||
cancelSyncDueToBatteryLevelChangeLocked();
|
||||
}
|
||||
if ((updateFlags & UPDATE_CPU) != 0) {
|
||||
@@ -517,7 +517,7 @@ class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStatsSync {
|
||||
mStats.updateCpuTimeLocked(onBattery, onBatteryScreenOff);
|
||||
}
|
||||
|
||||
if ((updateFlags & UPDATE_ALL) != 0) {
|
||||
if (updateFlags == UPDATE_ALL) {
|
||||
mStats.updateKernelWakelocksLocked(elapsedRealtimeUs);
|
||||
mStats.updateKernelMemoryBandwidthLocked(elapsedRealtimeUs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user