Loading core/java/com/android/internal/os/BatteryStatsImpl.java +25 −20 Original line number Diff line number Diff line Loading @@ -13325,7 +13325,8 @@ public class BatteryStatsImpl extends BatteryStats { return; } if (mBatteryStatsHistory.getActiveFile() == null) { final AtomicFile activeHistoryFile = mBatteryStatsHistory.getActiveFile(); if (activeHistoryFile == null) { Slog.w(TAG, "readLocked: no history file associated with this instance"); return; Loading @@ -13336,6 +13337,7 @@ public class BatteryStatsImpl extends BatteryStats { Parcel stats = Parcel.obtain(); try { final long start = SystemClock.uptimeMillis(); if (mStatsFile.exists()) { byte[] raw = mStatsFile.readFully(); stats.unmarshall(raw, 0, raw.length); stats.setDataPosition(0); Loading @@ -13345,6 +13347,7 @@ public class BatteryStatsImpl extends BatteryStats { + " bytes:" + raw.length + " takes ms:" + (SystemClock.uptimeMillis() - start)); } } } catch (Exception e) { Slog.e(TAG, "Error reading battery statistics", e); resetAllStatsLocked(); Loading @@ -13355,7 +13358,8 @@ public class BatteryStatsImpl extends BatteryStats { Parcel history = Parcel.obtain(); try { final long start = SystemClock.uptimeMillis(); byte[] raw = mBatteryStatsHistory.getActiveFile().readFully(); if (activeHistoryFile.exists()) { byte[] raw = activeHistoryFile.readFully(); if (raw.length > 0) { history.unmarshall(raw, 0, raw.length); history.setDataPosition(0); Loading @@ -13363,10 +13367,11 @@ public class BatteryStatsImpl extends BatteryStats { } if (DEBUG) { Slog.d(TAG, "readLocked history file::" + mBatteryStatsHistory.getActiveFile().getBaseFile().getPath() + activeHistoryFile.getBaseFile().getPath() + " bytes:" + raw.length + " takes ms:" + (SystemClock.uptimeMillis() - start)); } } } catch (Exception e) { Slog.e(TAG, "Error reading battery history", e); clearHistoryLocked(); Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +25 −20 Original line number Diff line number Diff line Loading @@ -13325,7 +13325,8 @@ public class BatteryStatsImpl extends BatteryStats { return; } if (mBatteryStatsHistory.getActiveFile() == null) { final AtomicFile activeHistoryFile = mBatteryStatsHistory.getActiveFile(); if (activeHistoryFile == null) { Slog.w(TAG, "readLocked: no history file associated with this instance"); return; Loading @@ -13336,6 +13337,7 @@ public class BatteryStatsImpl extends BatteryStats { Parcel stats = Parcel.obtain(); try { final long start = SystemClock.uptimeMillis(); if (mStatsFile.exists()) { byte[] raw = mStatsFile.readFully(); stats.unmarshall(raw, 0, raw.length); stats.setDataPosition(0); Loading @@ -13345,6 +13347,7 @@ public class BatteryStatsImpl extends BatteryStats { + " bytes:" + raw.length + " takes ms:" + (SystemClock.uptimeMillis() - start)); } } } catch (Exception e) { Slog.e(TAG, "Error reading battery statistics", e); resetAllStatsLocked(); Loading @@ -13355,7 +13358,8 @@ public class BatteryStatsImpl extends BatteryStats { Parcel history = Parcel.obtain(); try { final long start = SystemClock.uptimeMillis(); byte[] raw = mBatteryStatsHistory.getActiveFile().readFully(); if (activeHistoryFile.exists()) { byte[] raw = activeHistoryFile.readFully(); if (raw.length > 0) { history.unmarshall(raw, 0, raw.length); history.setDataPosition(0); Loading @@ -13363,10 +13367,11 @@ public class BatteryStatsImpl extends BatteryStats { } if (DEBUG) { Slog.d(TAG, "readLocked history file::" + mBatteryStatsHistory.getActiveFile().getBaseFile().getPath() + activeHistoryFile.getBaseFile().getPath() + " bytes:" + raw.length + " takes ms:" + (SystemClock.uptimeMillis() - start)); } } } catch (Exception e) { Slog.e(TAG, "Error reading battery history", e); clearHistoryLocked();