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

Verified with simulator, which doesn't have /proc/wakelocks
This commit is contained in:
Marco Nelissen
2009-04-30 14:45:06 -07:00
parent 36742528f8
commit d859331229

View File

@@ -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();