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

Commit 77fa24a5 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 26136 into eclair

* changes:
  Fix NPE crash-loop when cpufreq not available in the kernel.
parents 5417f09c 2eb239f9
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -509,6 +509,8 @@ public class ProcessStats {
        }
        int speed = 0;
        String file = readFile("/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state", '\0');
        // Note: file may be null on kernels without cpufreq (i.e. the emulator's)
        if (file != null) {
            StringTokenizer st = new StringTokenizer(file, "\n ");
            while (st.hasMoreElements()) {
                String token = st.nextToken();
@@ -528,6 +530,7 @@ public class ProcessStats {
                    Log.i(TAG, "Unable to parse time_in_state");
                }
            }
        }
        if (out == null) {
            out = new long[speed];
            mCpuSpeeds = new long[speed];