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

@@ -32,6 +32,7 @@ import com.android.settings.graph.UsageView;
* subsystem/app type.
*/
public class BatteryHistoryPreference extends Preference {
private static final String TAG = "BatteryHistoryPreference";
private CharSequence mSummary;
private TextView mSummaryView;
@@ -73,6 +74,7 @@ public class BatteryHistoryPreference extends Preference {
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
final long startTime = System.currentTimeMillis();
if (mBatteryInfo == null) {
return;
}
@@ -88,5 +90,6 @@ public class BatteryHistoryPreference extends Preference {
UsageView usageView = (UsageView) view.findViewById(R.id.battery_usage);
usageView.findViewById(R.id.label_group).setAlpha(.7f);
mBatteryInfo.bindHistory(usageView);
BatteryUtils.logRuntime(TAG, "onBindViewHolder", startTime);
}
}