OSDN Git Service

Allow extra slop in battery stats
authorTodd Kennedy <toddke@google.com>
Wed, 26 Aug 2015 00:26:57 +0000 (17:26 -0700)
committerTodd Kennedy <toddke@google.com>
Wed, 26 Aug 2015 00:27:03 +0000 (17:27 -0700)
Current slop of 30ms was causing too many WTFs to be thrown. Increase the slop
to 750ms.

Bug: 23391894
Change-Id: Ica5be9b00745bfe58872d43be8c32f8c147075ed

services/core/java/com/android/server/am/BatteryStatsService.java

index d0f68f0..322d89d 100644 (file)
@@ -1261,8 +1261,8 @@ public final class BatteryStatsService extends IBatteryStats.Stub
                     Slog.v(TAG, "WiFi energy data was reset, new WiFi energy data is " + result);
                 }
 
-                // There is some accuracy error in reports so allow 30 milliseconds of error.
-                final long SAMPLE_ERROR_MILLIS = 30;
+                // There is some accuracy error in reports so allow some slop in the results.
+                final long SAMPLE_ERROR_MILLIS = 750;
                 final long totalTimeMs = result.mControllerIdleTimeMs + result.mControllerRxTimeMs +
                         result.mControllerTxTimeMs;
                 if (totalTimeMs > timePeriodMs + SAMPLE_ERROR_MILLIS) {