Track native processes and airplane mode.
Turn signal strengths on/off when toggling airplane mode.
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 16bb29d..62b4d5e 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -61,6 +61,7 @@
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
+import android.os.BatteryStats;
import android.os.Binder;
import android.os.Bundle;
import android.os.Environment;
@@ -1517,7 +1518,9 @@
}
}
- synchronized(mBatteryStatsService.getActiveStatistics()) {
+ final BatteryStatsImpl bstats =
+ (BatteryStatsImpl) mBatteryStatsService.getActiveStatistics();
+ synchronized(bstats) {
synchronized(mPidsSelfLocked) {
if (haveNewCpuStats) {
if (mBatteryStatsService.isOnBattery()) {
@@ -1529,12 +1532,18 @@
if (pr != null) {
BatteryStatsImpl.Uid.Proc ps = pr.batteryStats;
ps.addCpuTimeLocked(st.rel_utime, st.rel_stime);
+ } else {
+ BatteryStatsImpl.Uid.Proc ps =
+ bstats.getProcessStatsLocked(st.name);
+ if (ps != null) {
+ ps.addCpuTimeLocked(st.rel_utime, st.rel_stime);
+ }
}
}
}
}
}
-
+
if (mLastWriteTime < (now-BATTERY_STATS_TIME)) {
mLastWriteTime = now;
mBatteryStatsService.getActiveStatistics().writeLocked();