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

Commit ea357e5e authored by Mike Ma's avatar Mike Ma
Browse files

Fix strict mode violation

Change-Id: I3c6391c52f06e4bb94162f8def1ab9b5f4c747fc
Fixes: 73549195
Test: KernelWakelockReaderTest
parent a0a83193
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.internal.os;

import android.os.Process;
import android.os.StrictMode;
import android.os.SystemClock;
import android.util.Slog;

@@ -69,6 +70,7 @@ public class KernelWakelockReader {
        boolean wakeup_sources;
        final long startTime = SystemClock.uptimeMillis();

        final int oldMask = StrictMode.allowThreadDiskReadsMask();
        try {
            FileInputStream is;
            try {
@@ -90,6 +92,8 @@ public class KernelWakelockReader {
        } catch (java.io.IOException e) {
            Slog.wtf(TAG, "failed to read kernel wakelocks", e);
            return null;
        } finally {
            StrictMode.setThreadPolicyMask(oldMask);
        }

        final long readTime = SystemClock.uptimeMillis() - startTime;