Fix lost field foregroundServiceUsageTime in convertUtil

- from batteryDiffEntry to batteryUsageDiff

Bug: 320358970
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge.batteryusage.*"
Change-Id: Ibc5ee2f14ede066bef3fb1c832ef54941fc59ebf
This commit is contained in:
mxyyiyi
2024-01-16 14:59:00 +08:00
parent 4130a95c5d
commit 90da4049f2
2 changed files with 51 additions and 1 deletions

View File

@@ -479,7 +479,9 @@ public final class ConvertUtils {
}
}
private static BatteryUsageDiff convertToBatteryUsageDiff(BatteryDiffEntry batteryDiffEntry) {
@VisibleForTesting
static BatteryUsageDiff convertToBatteryUsageDiff(BatteryDiffEntry batteryDiffEntry) {
BatteryUsageDiff.Builder builder =
BatteryUsageDiff.newBuilder()
.setUid(batteryDiffEntry.mUid)
@@ -496,6 +498,8 @@ public final class ConvertUtils {
batteryDiffEntry.mForegroundServiceUsageConsumePower)
.setCachedUsageConsumePower(batteryDiffEntry.mCachedUsageConsumePower)
.setForegroundUsageTime(batteryDiffEntry.mForegroundUsageTimeInMs)
.setForegroundServiceUsageTime(
batteryDiffEntry.mForegroundServiceUsageTimeInMs)
.setBackgroundUsageTime(batteryDiffEntry.mBackgroundUsageTimeInMs)
.setScreenOnTime(batteryDiffEntry.mScreenOnTimeInMs);
if (batteryDiffEntry.mKey != null) {