Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29f8e978 authored by Adam Lesinski's avatar Adam Lesinski Committed by Android Git Automerger
Browse files

am 6548f9b8: am 3209e18c: am 60261137: Merge "BatteryStats: Compensate for...

am 6548f9b8: am 3209e18c: am 60261137: Merge "BatteryStats: Compensate for accuracy issues when reporting WiFi energy data issues with Slog.wtf" into mnc-dev

* commit '6548f9b8':
  BatteryStats: Compensate for accuracy issues when reporting WiFi energy data issues with Slog.wtf
parents b0014e9f 6548f9b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1261,9 +1261,11 @@ 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;
                final long totalTimeMs = result.mControllerIdleTimeMs + result.mControllerRxTimeMs +
                        result.mControllerTxTimeMs;
                if (totalTimeMs > timePeriodMs) {
                if (totalTimeMs > timePeriodMs + SAMPLE_ERROR_MILLIS) {
                    StringBuilder sb = new StringBuilder();
                    sb.append("Total time ");
                    TimeUtils.formatDuration(totalTimeMs, sb);