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:
@@ -2360,6 +2360,12 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
public void updateKernelWakelocksLocked() {
|
public void updateKernelWakelocksLocked() {
|
||||||
Map<String, KernelWakelockStats> m = readKernelWakelockStats();
|
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()) {
|
for (Map.Entry<String, KernelWakelockStats> ent : m.entrySet()) {
|
||||||
String name = ent.getKey();
|
String name = ent.getKey();
|
||||||
KernelWakelockStats kws = ent.getValue();
|
KernelWakelockStats kws = ent.getValue();
|
||||||
|
|||||||
Reference in New Issue
Block a user