Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abnormally high number of steps caused by timezone changes #177

Open
Autonom opened this issue Jan 3, 2024 · 0 comments
Open

Abnormally high number of steps caused by timezone changes #177

Autonom opened this issue Jan 3, 2024 · 0 comments

Comments

@Autonom
Copy link

Autonom commented Jan 3, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant