diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-09-14 14:39:52 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2014-09-15 14:00:37 -0700 |
commit | 94aae9afd18c17848aed68addd19d93c937c7555 (patch) | |
tree | 6a2ba8a7f4104dcefebe83b6f769d905c0ce5c9b | |
parent | ecffbc91b15ec558be27fd171a64ad5db9e2b7d1 (diff) | |
download | packages_apps_Settings-94aae9afd18c17848aed68addd19d93c937c7555.tar.gz packages_apps_Settings-94aae9afd18c17848aed68addd19d93c937c7555.tar.bz2 packages_apps_Settings-94aae9afd18c17848aed68addd19d93c937c7555.zip |
Little more on issue #17495264: tweak when we ignore initial times.
Change-Id: I7053eb64d7d2281984baef9606334c2df4783cc5
-rw-r--r-- | src/com/android/settings/fuelgauge/BatteryHistoryChart.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java index 2f36c5fa0..fbd0ea3ed 100644 --- a/src/com/android/settings/fuelgauge/BatteryHistoryChart.java +++ b/src/com/android/settings/fuelgauge/BatteryHistoryChart.java @@ -569,7 +569,12 @@ public class BatteryHistoryChart extends View { // able to create a good chart with that data, so just ignore the // times we got before and pretend like our data extends back from // the time we have now. - if (rec.currentTime > (lastWallTime+(365*24*60*60*1000))) { + // Also, if we are getting a time change and we are less than 5 minutes + // since the start of the history real time, then also use this new + // time to compute the base time, since whatever time we had before is + // pretty much just noise. + if (rec.currentTime > (lastWallTime+(180*24*60*60*1000L)) + || rec.time < (mHistStart+(5*60*1000L))) { mStartWallTime = 0; } lastWallTime = rec.currentTime; |