summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/BatteryService.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-06-24 13:46:13 -0700
committerDianne Hackborn <hackbod@google.com>2013-06-24 18:16:48 -0700
commit8c84109b9fbbf473b225707a38261ff5f99d95fb (patch)
tree9796143a5fb2980d58612a247a737448a428f742 /services/java/com/android/server/BatteryService.java
parent3af16b226b8467100091b4e02fc3e70a002d567e (diff)
Use FastPrintWriter... everywhere.
One problem this turned up is, because FastPrintWriter does its own buffering, a lot of code that used to use PrintWriter would fail -- if it pointed to a StringWriter, there was no buffering, so it could just immediately get the result. Now you need to first flush the FastPrintWriter. Also added some new constructors to specify the size of buffer that FastPrintWriter should use. Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
Diffstat (limited to 'services/java/com/android/server/BatteryService.java')
-rw-r--r--services/java/com/android/server/BatteryService.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java
index 32fc18ee96a3..12a05496426d 100644
--- a/services/java/com/android/server/BatteryService.java
+++ b/services/java/com/android/server/BatteryService.java
@@ -16,6 +16,7 @@
package com.android.server;
+import android.os.BatteryStats;
import com.android.internal.app.IBatteryStats;
import com.android.server.am.BatteryStatsService;
@@ -89,7 +90,6 @@ public final class BatteryService extends Binder {
private static final int DUMP_MAX_LENGTH = 24 * 1024;
private static final String[] DUMPSYS_ARGS = new String[] { "--checkin", "--unplugged" };
- private static final String BATTERY_STATS_SERVICE_NAME = "batteryinfo";
private static final String DUMPSYS_DATA_PATH = "/data/system/";
@@ -509,7 +509,7 @@ public final class BatteryService extends Binder {
}
private void logBatteryStatsLocked() {
- IBinder batteryInfoService = ServiceManager.getService(BATTERY_STATS_SERVICE_NAME);
+ IBinder batteryInfoService = ServiceManager.getService(BatteryStats.SERVICE_NAME);
if (batteryInfoService == null) return;
DropBoxManager db = (DropBoxManager) mContext.getSystemService(Context.DROPBOX_SERVICE);
@@ -519,7 +519,7 @@ public final class BatteryService extends Binder {
FileOutputStream dumpStream = null;
try {
// dump the service to a file
- dumpFile = new File(DUMPSYS_DATA_PATH + BATTERY_STATS_SERVICE_NAME + ".dump");
+ dumpFile = new File(DUMPSYS_DATA_PATH + BatteryStats.SERVICE_NAME + ".dump");
dumpStream = new FileOutputStream(dumpFile);
batteryInfoService.dump(dumpStream.getFD(), DUMPSYS_ARGS);
FileUtils.sync(dumpStream);