Refine consumed battery value formula for power component

for power component, the battery UI is designed to show system relative component without considering the attributed apps, update the current formula to use `devicePowerMah` value data only

Bug: 188663505
Test: make SettingsgRoboTests
Change-Id: Ibeeb360915303faed2f79c4621f17d6ba0dd725f
This commit is contained in:
ykhung
2021-05-25 12:01:06 +08:00
parent 954389be96
commit 4c29aad5f1

View File

@@ -241,7 +241,7 @@ public class BatteryEntry {
mBatteryConsumer = null; mBatteryConsumer = null;
mIsHidden = false; mIsHidden = false;
mPowerComponentId = powerComponentId; mPowerComponentId = powerComponentId;
mConsumedPower = devicePowerMah - appsPowerMah; mConsumedPower = devicePowerMah;
mUsageDurationMs = usageDurationMs; mUsageDurationMs = usageDurationMs;
mConsumerType = ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY; mConsumerType = ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY;
@@ -265,11 +265,10 @@ public class BatteryEntry {
icon = context.getDrawable(iconId); icon = context.getDrawable(iconId);
name = powerComponentName; name = powerComponentName;
mConsumedPower = devicePowerMah - appsPowerMah; mConsumedPower = devicePowerMah;
mConsumerType = ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY; mConsumerType = ConvertUtils.CONSUMER_TYPE_SYSTEM_BATTERY;
} }
public Drawable getIcon() { public Drawable getIcon() {
return icon; return icon;
} }