Permalink
Browse files

KernelWakelockReader: stop the panic

Change-Id: I44119cc26fcadd28e88ae7f6bcb01ec985f3bfde
  • Loading branch information...
xdevs23 authored and xlxfoxxlx committed Nov 22, 2016
1 parent f51d68f commit 81407264cbf24bc59c7abb4de41d148f7cc5f942
Showing with 4 additions and 4 deletions.
  1. +4 −4 core/java/com/android/internal/os/KernelWakelockReader.java
@@ -77,22 +77,22 @@ public final KernelWakelockStats readKernelWakelockStats(KernelWakelockStats sta
is = new FileInputStream(sWakeupSourceFile);
wakeup_sources = true;
} catch (java.io.FileNotFoundException e2) {
Slog.wtf(TAG, "neither " + sWakelockFile + " nor " +
sWakeupSourceFile + " exists");
Slog.w(TAG, "neither " + sWakelockFile + " nor " +
sWakeupSourceFile + " exists, ignoring.");
return null;
}
}
len = is.read(buffer);
is.close();
} catch (java.io.IOException e) {
Slog.wtf(TAG, "failed to read kernel wakelocks", e);
Slog.w(TAG, "failed to read kernel wakelocks", e);
return null;
}
if (len > 0) {
if (len >= buffer.length) {
Slog.wtf(TAG, "Kernel wake locks exceeded buffer size " + buffer.length);
Slog.w(TAG, "Kernel wake locks exceeded buffer size " + buffer.length);
}
int i;
for (i=0; i<len; i++) {

0 comments on commit 8140726

Please sign in to comment.