-
Notifications
You must be signed in to change notification settings - Fork 666
Description
I'm often getting very high numbers of steps. For instance, today I have 32,649. Other days it might be 80,000. If that were accurate, I would be really quite fit.
The issue is strongly linked to the phone's geographic location. In some locations there are erratic increases in steps (by ~20k). This can occur several times a day. In other locations, step counts increase normally for weeks at a time. Notably, the big jumps in step counts occur in the location where the phone occasionally connects to a mobile mast in a neighbouring country.
I believe that the phone very briefly connects to a mobile mast in a neighbouring country with a different timezone. This causes the system clock to change by an hour. It then connects to a nearer mast and the system clock again changes back to the original time. As a result, pedometer makes calculations that are wrong due to the large changes (+/- 1 hour) in system time.
I think the calculation takes place here
| private boolean updateIfNecessary() { |
but I don't understand the code very well. System.currentTimeMillis() returns the number of milliseconds since the unix epoch. What is the effect of a timezone change on this value? Would it add/remove 3600 * 1000 milliseconds? Or does it use UTC and is therefore not affected by timezone changes?