From 6e28a4d70a8da65ee9d824b4898f5d69dd83d0ad Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 24 Jun 2013 16:18:50 -0700 Subject: [PATCH] Use FastPrintWriter. Change-Id: If7f77185d7a76f14ac63f9c2af9911fb67ad97d9 --- src/com/android/settings/fuelgauge/PowerUsageSummary.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java index 708f4af50f6..39cf2c6595d 100644 --- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java +++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java @@ -57,6 +57,7 @@ import android.view.MenuItem; import com.android.internal.app.IBatteryStats; import com.android.internal.os.BatteryStatsImpl; import com.android.internal.os.PowerProfile; +import com.android.internal.util.FastPrintWriter; import com.android.settings.HelpUtils; import com.android.settings.R; import com.android.settings.fuelgauge.PowerUsageDetail.DrainType; @@ -256,13 +257,15 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable { if (sipper.drainType == DrainType.APP) { Writer result = new StringWriter(); - PrintWriter printWriter = new PrintWriter(result); + PrintWriter printWriter = new FastPrintWriter(result, false, 1024); mStats.dumpLocked(printWriter, "", mStatsType, uid.getUid()); + printWriter.flush(); args.putString(PowerUsageDetail.EXTRA_REPORT_DETAILS, result.toString()); result = new StringWriter(); - printWriter = new PrintWriter(result); + printWriter = new FastPrintWriter(result, false, 1024); mStats.dumpCheckinLocked(printWriter, mStatsType, uid.getUid()); + printWriter.flush(); args.putString(PowerUsageDetail.EXTRA_REPORT_CHECKIN_DETAILS, result.toString()); }