Fix b/265387286: The total percentage of all apps is not 100%

Bug: 265387286
Fix: 265387286
Test: manual
Change-Id: I654f8211a45c818f9a2d4867ac679e72c9ce6eb1
This commit is contained in:
Zaiyue Xue
2023-02-20 11:19:24 +08:00
parent 802bff9092
commit 6d939b34dc
14 changed files with 218 additions and 144 deletions

View File

@@ -108,7 +108,7 @@ private class AppBatteryPresenter(private val context: Context, private val app:
private fun BatteryDiffEntry?.getSummary(): String =
this?.takeIf { mConsumePower > 0 }?.let {
context.getString(
R.string.battery_summary, Utils.formatPercentage(percentOfTotal, true)
R.string.battery_summary, Utils.formatPercentage(percentage, true)
)
} ?: context.getString(R.string.no_battery_summary)
@@ -127,7 +127,7 @@ private class AppBatteryPresenter(private val context: Context, private val app:
context,
AppInfoSettingsProvider.METRICS_CATEGORY,
this,
Utils.formatPercentage(percentOfTotal, true),
Utils.formatPercentage(percentage, true),
null,
false,
)