OSDN Git Service

DO NOT MERGE. I like'd ctate's change so much I'm doin it myself!
authorDianne Hackborn <hackbod@google.com>
Fri, 10 Sep 2010 06:10:38 +0000 (23:10 -0700)
committerDianne Hackborn <hackbod@google.com>
Fri, 10 Sep 2010 06:10:38 +0000 (23:10 -0700)
Change-Id: If571d3ff5e73252a0653c30ec40178ec1591ddd9

core/java/com/android/internal/os/BatteryStatsImpl.java

index c82fef0..0ef1ea5 100644 (file)
@@ -1376,13 +1376,13 @@ public final class BatteryStatsImpl extends BatteryStats {
                 for (int i=0; i<N; i++) {
                     StopwatchTimer st = mPartialTimers.get(i);
                     if (st.mInList) {
-                        int myUTime = utime/num;
-                        int mySTime = stime/num;
-                        utime -= myUTime;
-                        stime -= mySTime;
-                        num--;
                         Uid uid = st.mUid;
                         if (uid != null && uid.mUid != Process.SYSTEM_UID) {
+                            int myUTime = utime/num;
+                            int mySTime = stime/num;
+                            utime -= myUTime;
+                            stime -= mySTime;
+                            num--;
                             Uid.Proc proc = uid.getProcessStatsLocked("*wakelock*");
                             proc.addCpuTimeLocked(myUTime, mySTime);
                             proc.addSpeedStepTimes(cpuSpeedTimes);