OSDN Git Service

Fix wrong count return for getPhoneSignalStrengthCount
authorCatherine Liu <wlcl05@motorola.com>
Tue, 17 Jul 2012 19:12:56 +0000 (14:12 -0500)
committerCatherine Liu <wlcl05@motorola.com>
Tue, 17 Jul 2012 19:12:56 +0000 (14:12 -0500)
Test report for the time spent in each signal strength bin, along
with the number of times that bin was entered showed the result
as Bin=3 Time=3211926000 Count=0. With a non-zero Time, the Count
value 0 was wrong.

The cause of the problem was that getPhoneSignalStrengthCount() used
mPhoneDataConnectionsTimer, instead of mPhoneSignalStrengthsTimer,
to get the count.

Change-Id: I55ac1125abfcfdc105605d76d1c706ac315b90cc

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

index 5157385..db752e9 100644 (file)
@@ -2302,8 +2302,8 @@ public final class BatteryStatsImpl extends BatteryStats {
                 batteryRealtime, which);
     }
 
-    @Override public int getPhoneSignalStrengthCount(int dataType, int which) {
-        return mPhoneDataConnectionsTimer[dataType].getCountLocked(which);
+    @Override public int getPhoneSignalStrengthCount(int strengthBin, int which) {
+        return mPhoneSignalStrengthsTimer[strengthBin].getCountLocked(which);
     }
 
     @Override public long getPhoneDataConnectionTime(int dataType,