Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d289623e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "More granular logging when proc file not exist"

parents 2ac4fb88 363ccf72
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -22,10 +22,12 @@ import android.util.Slog;

import com.android.internal.annotations.VisibleForTesting;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
@@ -124,6 +126,11 @@ public class KernelCpuProcReader {
                }
                fc.position(0);
            }
        } catch (NoSuchFileException | FileNotFoundException e) {
            // Happens when the kernel does not provide this file. Not a big issue. Just log it.
            mErrors++;
            Slog.w(TAG, "File not exist: " + mProc);
            return null;
        } catch (IOException e) {
            mErrors++;
            Slog.e(TAG, "Error reading: " + mProc, e);