#facepalm I confused minus with plus - incorrect and negative(!) step counts were possible

master
y20k 2018-01-22 18:50:06 +01:00
parent 1584eac152
commit 6fbbd325c0
2 changed files with 4 additions and 4 deletions

View File

@ -184,9 +184,9 @@ public class TrackerService extends Service implements TrackbookKeys, SensorEven
@Override
public void onSensorChanged(SensorEvent sensorEvent) {
// save the step count offset (steps previously recorded by the system) and add any steps recorded during this session in case the app was killed
// save the step count offset (steps previously recorded by the system) and subtract any steps recorded during this session in case the app was killed
if (mStepCountOffset == 0) {
mStepCountOffset = sensorEvent.values[0] - 1 + mTrack.getStepCount();
mStepCountOffset = (sensorEvent.values[0] - 1) - mTrack.getStepCount();
}
// calculate step count

View File

@ -21,8 +21,8 @@ allprojects {
}
project.ext {
applicationId = 'org.y20k.trackbook'
versionCode = 17
versionName = '1.1.1'
versionCode = 18
versionName = '1.1.2'
minSdkVersion = 22
compileSdkVersion = 27
targetSdkVersion = 27