summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2012-05-25 04:35:46 +0000
committerVishal Bhoj <vishal.bhoj@linaro.org>2012-05-25 11:05:21 +0000
commitfc8f7e3beddb810471316b14da5b5a97a5f3bc4b (patch)
tree662efd14d89888455651f08030fa60027e20b510
parentb1030f7143c0422abb57021fae071b5dbbef7ac0 (diff)
downloadbase-fc8f7e3beddb810471316b14da5b5a97a5f3bc4b.tar.gz
Allow runtime loading of cpufreq driver
Android assumes that cpufreq driver is loaded during boot time. Loading the driver after the boot process is complete results in a crash in ActivityManager.The commit handles the case when the driver is loaded after boot process is complete. This issue was observe on vexpress_rtsm platform: https://bugs.launchpad.net/linaro-big-little-integrated/+bug/1000374 Change-Id: Ibf526d6c2722cea36d0b2075f100019989243c76 Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r--core/java/com/android/internal/os/ProcessStats.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/com/android/internal/os/ProcessStats.java b/core/java/com/android/internal/os/ProcessStats.java
index e0e9a29714d1..e17ede699838 100644
--- a/core/java/com/android/internal/os/ProcessStats.java
+++ b/core/java/com/android/internal/os/ProcessStats.java
@@ -569,6 +569,10 @@ public class ProcessStats {
while (st.hasMoreElements()) {
String token = st.nextToken();
try {
+ if (out.length == 0) {
+ tempTimes = new long[MAX_SPEEDS];
+ tempSpeeds = new long[MAX_SPEEDS];
+ }
long val = Long.parseLong(token);
tempSpeeds[speed] = val;
token = st.nextToken();
@@ -585,7 +589,7 @@ public class ProcessStats {
}
}
}
- if (out == null) {
+ if (out == null || out.length == 0) {
out = new long[speed];
mCpuSpeeds = new long[speed];
System.arraycopy(tempSpeeds, 0, mCpuSpeeds, 0, speed);