Merge "Add log for BatteryUtils" into oc-dev

This commit is contained in:
Lei Yu
2017-04-10 17:06:44 +00:00
committed by Android (Google) Code Review
7 changed files with 65 additions and 19 deletions

View File

@@ -110,6 +110,8 @@ public class PowerUsageSummary extends PowerUsageBase {
PowerGaugePreference mLastFullChargePref;
@VisibleForTesting
PowerUsageFeatureProvider mPowerFeatureProvider;
@VisibleForTesting
BatteryUtils mBatteryUtils;
private LayoutPreference mBatteryLayoutPref;
private PreferenceGroup mAppListGroup;
@@ -127,6 +129,8 @@ public class PowerUsageSummary extends PowerUsageBase {
KEY_TIME_SINCE_LAST_FULL_CHARGE);
mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.battery_footer_summary);
mBatteryUtils = BatteryUtils.getInstance(getContext());
initFeatureProvider();
}
@@ -494,7 +498,7 @@ public class PowerUsageSummary extends PowerUsageBase {
pref.setOrder(i + 1);
pref.setPercent(percentOfTotal);
if (sipper.usageTimeMs == 0 && sipper.drainType == DrainType.APP) {
sipper.usageTimeMs = BatteryUtils.getProcessTimeMs(
sipper.usageTimeMs = mBatteryUtils.getProcessTimeMs(
BatteryUtils.StatusType.FOREGROUND, sipper.uidObj, mStatsType);
}
setUsageSummary(pref, usedTime, sipper.usageTimeMs);