We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e288b3a + 4c9ace5 commit 6026113Copy full SHA for 6026113
1 file changed
services/core/java/com/android/server/am/BatteryStatsService.java
@@ -1261,9 +1261,11 @@ private WifiActivityEnergyInfo pullWifiEnergyInfoLocked() {
1261
Slog.v(TAG, "WiFi energy data was reset, new WiFi energy data is " + result);
1262
}
1263
1264
+ // There is some accuracy error in reports so allow 30 milliseconds of error.
1265
+ final long SAMPLE_ERROR_MILLIS = 30;
1266
final long totalTimeMs = result.mControllerIdleTimeMs + result.mControllerRxTimeMs +
1267
result.mControllerTxTimeMs;
- if (totalTimeMs > timePeriodMs) {
1268
+ if (totalTimeMs > timePeriodMs + SAMPLE_ERROR_MILLIS) {
1269
StringBuilder sb = new StringBuilder();
1270
sb.append("Total time ");
1271
TimeUtils.formatDuration(totalTimeMs, sb);
0 commit comments