From cb99a72e62bcfb30002820f0543aa23dbbdd6162 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 3 Oct 2016 17:00:02 -0700 Subject: [PATCH] Fix issue #31305336: File corrupt: too many wake locks 101 The limit is MAX_WAKELOCKS_PER_UID+1, since OverflowArrayMap will add one more to contain the overflow. Change-Id: I53004582daa0c405427308816728f2c1d2bef40d --- core/java/com/android/internal/os/BatteryStatsImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index 2538d60f19248..3b3344e7d9346 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -10727,7 +10727,7 @@ public class BatteryStatsImpl extends BatteryStats { } int NW = in.readInt(); - if (NW > 100) { + if (NW > (MAX_WAKELOCKS_PER_UID+1)) { throw new ParcelFormatException("File corrupt: too many wake locks " + NW); } for (int iw = 0; iw < NW; iw++) { @@ -10736,7 +10736,7 @@ public class BatteryStatsImpl extends BatteryStats { } int NS = in.readInt(); - if (NS > 100) { + if (NS > (MAX_WAKELOCKS_PER_UID+1)) { throw new ParcelFormatException("File corrupt: too many syncs " + NS); } for (int is = 0; is < NS; is++) { @@ -10745,7 +10745,7 @@ public class BatteryStatsImpl extends BatteryStats { } int NJ = in.readInt(); - if (NJ > 100) { + if (NJ > (MAX_WAKELOCKS_PER_UID+1)) { throw new ParcelFormatException("File corrupt: too many job timers " + NJ); } for (int ij = 0; ij < NJ; ij++) {