Add util method to get battery stats
Bug:62271803 Test: make RunSettingsRoboTests Change-Id: I91089c24c7cd5f7329be052c50859e049e70e9b1
This commit is contained in:
@@ -18,7 +18,9 @@ package com.android.settings.fuelgauge;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.BatteryStats;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserManager;
|
||||
import android.support.annotation.IntDef;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
@@ -327,6 +329,12 @@ public class BatteryUtils {
|
||||
return timeMs * 1000;
|
||||
}
|
||||
|
||||
public void initBatteryStatsHelper(BatteryStatsHelper statsHelper, Bundle bundle,
|
||||
UserManager userManager) {
|
||||
statsHelper.create(bundle);
|
||||
statsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, userManager.getUserProfiles());
|
||||
}
|
||||
|
||||
private boolean isDataCorrupted() {
|
||||
return mPackageManager == null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user