[Battery usage U] For system comsumed power, use device comsumed power directly instead of removing app comsumed power from it.

Bug: 261826748
Fix: 261826748
Test: manual
Change-Id: Iab6eed4339fabe342835a020cadae11e6256be20
This commit is contained in:
Zaiyue Xue
2022-12-08 18:54:10 +08:00
parent 09d471132d
commit 5474c1849b
3 changed files with 27 additions and 21 deletions

View File

@@ -1243,14 +1243,11 @@ public final class DataProcessor {
final BatteryConsumer deviceConsumer = batteryUsageStats.getAggregateBatteryConsumer(
BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE);
final BatteryConsumer appsConsumer = batteryUsageStats.getAggregateBatteryConsumer(
BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_ALL_APPS);
for (int componentId = 0; componentId < BatteryConsumer.POWER_COMPONENT_COUNT;
componentId++) {
results.add(new BatteryEntry(context, componentId,
deviceConsumer.getConsumedPower(componentId),
appsConsumer.getConsumedPower(componentId),
deviceConsumer.getUsageDurationMillis(componentId)));
}
@@ -1260,8 +1257,7 @@ public final class DataProcessor {
componentId++) {
results.add(new BatteryEntry(context, componentId,
deviceConsumer.getCustomPowerComponentName(componentId),
deviceConsumer.getConsumedPowerForCustomComponent(componentId),
appsConsumer.getConsumedPowerForCustomComponent(componentId)));
deviceConsumer.getConsumedPowerForCustomComponent(componentId)));
}
final List<UserBatteryConsumer> userBatteryConsumers =