Loading core/java/com/android/internal/os/KernelWakelockReader.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class KernelWakelockReader { */ */ public final KernelWakelockStats readKernelWakelockStats(KernelWakelockStats staleStats) { public final KernelWakelockStats readKernelWakelockStats(KernelWakelockStats staleStats) { byte[] buffer = new byte[32*1024]; byte[] buffer = new byte[32*1024]; int len; int len = 0; boolean wakeup_sources; boolean wakeup_sources; final long startTime = SystemClock.uptimeMillis(); final long startTime = SystemClock.uptimeMillis(); Loading @@ -87,7 +87,11 @@ public class KernelWakelockReader { } } } } len = is.read(buffer); int cnt; while ((cnt = is.read(buffer, len, buffer.length - len)) > 0) { len += cnt; } is.close(); is.close(); } catch (java.io.IOException e) { } catch (java.io.IOException e) { Slog.wtf(TAG, "failed to read kernel wakelocks", e); Slog.wtf(TAG, "failed to read kernel wakelocks", e); Loading Loading
core/java/com/android/internal/os/KernelWakelockReader.java +6 −2 Original line number Original line Diff line number Diff line Loading @@ -66,7 +66,7 @@ public class KernelWakelockReader { */ */ public final KernelWakelockStats readKernelWakelockStats(KernelWakelockStats staleStats) { public final KernelWakelockStats readKernelWakelockStats(KernelWakelockStats staleStats) { byte[] buffer = new byte[32*1024]; byte[] buffer = new byte[32*1024]; int len; int len = 0; boolean wakeup_sources; boolean wakeup_sources; final long startTime = SystemClock.uptimeMillis(); final long startTime = SystemClock.uptimeMillis(); Loading @@ -87,7 +87,11 @@ public class KernelWakelockReader { } } } } len = is.read(buffer); int cnt; while ((cnt = is.read(buffer, len, buffer.length - len)) > 0) { len += cnt; } is.close(); is.close(); } catch (java.io.IOException e) { } catch (java.io.IOException e) { Slog.wtf(TAG, "failed to read kernel wakelocks", e); Slog.wtf(TAG, "failed to read kernel wakelocks", e); Loading