Add summary for categories in battery advanced page
If the category only contains one app, show usage time, otherwise
show app with maximum usage.
Also add usage time for apps in battery settings page.
Bug: 35396770
Test: RunSettingsRoboTests
Change-Id: I43fe9c2289535be2c1b95ffded6b52b0ff099589
(cherry picked from commit 3bbaca9c7c
)
This commit is contained in:
@@ -489,6 +489,10 @@ public class PowerUsageSummary extends PowerUsageBase {
|
||||
pref.setTitle(entry.getLabel());
|
||||
pref.setOrder(i + 1);
|
||||
pref.setPercent(percentOfTotal);
|
||||
if (sipper.usageTimeMs == 0 && sipper.drainType == DrainType.APP) {
|
||||
sipper.usageTimeMs = BatteryUtils.getProcessTimeMs(
|
||||
BatteryUtils.StatusType.FOREGROUND, sipper.uidObj, mStatsType);
|
||||
}
|
||||
setUsageSummary(pref, usedTime, sipper.usageTimeMs);
|
||||
if ((sipper.drainType != DrainType.APP
|
||||
|| sipper.uidObj.getUid() == Process.ROOT_UID)
|
||||
|
Reference in New Issue
Block a user