From 4c7a4a776741ddaa49df1361aa3a8f3977e59196 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Fri, 3 Aug 2012 14:32:39 -0700 Subject: [PATCH] Fix bug 6930875: ArrayIndexOutOfBoundsException on Battery details The wrong constant was used to count the number of user activity types. The number of types changed recently, so before then nothing bad happened. Now we get an AIOOB. This is the change to NUM_USER_ACTIVITY_TYPES: Change-Id: I05045180129b30fa09fe5f5e1e3b0ac25fee23b4 https://googleplex-android-review.googlesource.com/#/c/211982/ --- core/java/android/os/BatteryStats.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 1bb27bdbcb9f9..fcc0ae49b730f 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -1705,7 +1705,7 @@ public abstract class BatteryStats implements Parcelable { if (u.hasUserActivity()) { boolean hasData = false; - for (int i=0; i