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:
@@ -136,14 +136,19 @@ public class BatteryInfo {
|
||||
|
||||
public static void getBatteryInfo(final Context context, final Callback callback,
|
||||
boolean shortString) {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
BatteryStatsHelper statsHelper = new BatteryStatsHelper(context, true);
|
||||
statsHelper.create((Bundle) null);
|
||||
BatteryUtils.logRuntime(LOG_TAG, "time to make batteryStatsHelper", startTime);
|
||||
BatteryInfo.getBatteryInfo(context, callback, statsHelper, shortString);
|
||||
}
|
||||
|
||||
public static void getBatteryInfo(final Context context, final Callback callback,
|
||||
BatteryStatsHelper statsHelper, boolean shortString) {
|
||||
getBatteryInfo(context, callback, statsHelper.getStats(), shortString);
|
||||
final long startTime = System.currentTimeMillis();
|
||||
BatteryStats stats = statsHelper.getStats();
|
||||
BatteryUtils.logRuntime(LOG_TAG, "time for getStats", startTime);
|
||||
getBatteryInfo(context, callback, stats, shortString);
|
||||
}
|
||||
|
||||
public static void getBatteryInfo(final Context context, final Callback callback,
|
||||
@@ -181,7 +186,9 @@ public class BatteryInfo {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(BatteryInfo batteryInfo) {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
callback.onBatteryInfoLoaded(batteryInfo);
|
||||
BatteryUtils.logRuntime(LOG_TAG, "time for callback", startTime);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
|
Reference in New Issue
Block a user