Add some more logging to settings battery stuff

This CL adds logging to areas which are possible suspects for
the slowdown some people have been reporting in the
PowerUsageAdvanced screen. It times the time it takes for various
battery stats methods as well as the time it takes to draw things.

Test: still build (only adds logging)
Bug: 62959645
Bug: 63442960
Change-Id: I7e6c5e83e33a931057c9fdef14d3bef84f514940
This commit is contained in:
Salvador Martinez
2017-07-19 17:14:21 -07:00
parent 8ff3fd420c
commit 7961627680
5 changed files with 29 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ public abstract class PowerUsageBase extends DashboardFragment
// +1 to allow ordering for PowerUsageSummary.
@VisibleForTesting
static final int MENU_STATS_REFRESH = Menu.FIRST + 1;
private static final String TAG = "PowerUsageBase";
protected BatteryStatsHelper mStatsHelper;
protected UserManager mUm;
@@ -89,7 +90,9 @@ public abstract class PowerUsageBase extends DashboardFragment
protected abstract void refreshUi();
protected void updatePreference(BatteryHistoryPreference historyPref) {
final long startTime = System.currentTimeMillis();
historyPref.setStats(mStatsHelper);
BatteryUtils.logRuntime(TAG, "updatePreference", startTime);
}
@Override