Remove foreground_service_usage_time_in_ms field which has been merged

into background_usage_time_in_ms in the BatteryUsageStats (b/257392992).

Test: make RunSettingsRoboTests + manual
Bug: 258124768
Bug: 253553141
Change-Id: I0967eec0cbe6d0cb7a0535d744a1046dec1d267b
This commit is contained in:
Kuan Wang
2022-12-05 15:43:00 +08:00
parent b2cce522f8
commit ec1c9d94f2
16 changed files with 63 additions and 188 deletions

View File

@@ -165,20 +165,16 @@ public final class DatabaseUtils {
batteryEntryList.stream()
.filter(entry -> {
final long foregroundMs = entry.getTimeInForegroundMs();
final long foregroundServiceMs = entry.getTimeInForegroundServiceMs();
final long backgroundMs = entry.getTimeInBackgroundMs();
if (entry.getConsumedPower() == 0
&& (foregroundMs != 0
|| foregroundServiceMs != 0
|| backgroundMs != 0)) {
Log.w(TAG, String.format(
"no consumed power but has running time for %s time=%d|%d|%d",
entry.getLabel(), foregroundMs, foregroundServiceMs,
backgroundMs));
"no consumed power but has running time for %s time=%d|%d",
entry.getLabel(), foregroundMs, backgroundMs));
}
return entry.getConsumedPower() != 0
|| foregroundMs != 0
|| foregroundServiceMs != 0
|| backgroundMs != 0;
})
.forEach(entry -> valuesList.add(