Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Fix remaining byte parameter in the API for steps.
Browse files Browse the repository at this point in the history
Maybe this was the reason for #91 (negative steps)

This could happen making at least 3 steps per second.
  • Loading branch information
cpfeiffer committed Aug 14, 2015
1 parent ecc483f commit a66a3a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -115,7 +115,8 @@ public void addGBActivitySample(ActivitySample sample) {
* @param steps the sample's steps value
* @param kind the raw activity kind of the sample
*/
public void addGBActivitySample(int timestamp, byte provider, short intensity, byte steps, byte kind) {
@Override
public void addGBActivitySample(int timestamp, byte provider, short intensity, short steps, byte kind) {
try (SQLiteDatabase db = this.getWritableDatabase()) {
ContentValues values = new ContentValues();
values.put(KEY_TIMESTAMP, timestamp);
Expand Down
Expand Up @@ -24,7 +24,7 @@ public interface DBHandler {

List<ActivitySample> getSleepSamples(int tsFrom, int tsTo, SampleProvider provider);

void addGBActivitySample(int timestamp, byte provider, short intensity, byte steps, byte kind);
void addGBActivitySample(int timestamp, byte provider, short intensity, short steps, byte kind);

SQLiteDatabase getWritableDatabase();
}
Expand Up @@ -12,6 +12,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.charset.Charset;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -918,7 +919,7 @@ private void flushActivityDataHolder() {
(int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000),
SampleProvider.PROVIDER_MIBAND,
intensity,
steps,
(short) (steps & 0xff),
category);
activityStruct.activityDataTimestampProgress.add(Calendar.MINUTE, 1);
}
Expand Down

0 comments on commit a66a3a1

Please sign in to comment.