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

Commit d8593312 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Don't crash when /proc/wakelocks can't be opened. Might make board bringup easier.

Verified with simulator, which doesn't have /proc/wakelocks
parent 36742528
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2360,6 +2360,12 @@ public final class BatteryStatsImpl extends BatteryStats {
    public void updateKernelWakelocksLocked() {
        Map<String, KernelWakelockStats> m = readKernelWakelockStats();
        
        if (m == null) {
            // Not crashing might make board bringup easier.
            Log.w(TAG, "Couldn't get kernel wake lock stats");
            return;
        }

        for (Map.Entry<String, KernelWakelockStats> ent : m.entrySet()) {
            String name = ent.getKey();
            KernelWakelockStats kws = ent.getValue();