mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Bangle.js:actTrk: speed determines activity type
This commit is contained in:
parent
466349fbe7
commit
8ab77f148f
@ -480,12 +480,17 @@ public class BangleJSActivityTrack extends BangleJSDeviceSupport {
|
|||||||
summary.setName(log);
|
summary.setName(log);
|
||||||
summary.setStartTime(startTime);
|
summary.setStartTime(startTime);
|
||||||
summary.setEndTime(endTime);
|
summary.setEndTime(endTime);
|
||||||
summary.setActivityKind(ActivityKind.TYPE_RUNNING); // TODO: Make this depend on info from watch (currently this info isn't supplied in Bangle.js recorder logs).
|
int activityKind;
|
||||||
if (analyticsObject.has("speed")) {
|
if (analyticsObject.has("Speed")) {
|
||||||
if (3 > averageOfJSONArray(analyticsObject.getJSONArray("Speed"))) {
|
if ((float) 3 > averageOfJSONArray(analyticsObject.getJSONArray("Speed"))) {
|
||||||
summary.setActivityKind(ActivityKind.TYPE_WALKING);
|
activityKind = ActivityKind.TYPE_WALKING;
|
||||||
|
} else {
|
||||||
|
activityKind = ActivityKind.TYPE_RUNNING;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
activityKind = ActivityKind.TYPE_ACTIVITY;
|
||||||
}
|
}
|
||||||
|
summary.setActivityKind(activityKind); // TODO: Make this depend on info from watch (currently this info isn't supplied in Bangle.js recorder logs).
|
||||||
summary.setRawDetailsPath(String.valueOf(inputFile));
|
summary.setRawDetailsPath(String.valueOf(inputFile));
|
||||||
|
|
||||||
JSONObject summaryData = new JSONObject();
|
JSONObject summaryData = new JSONObject();
|
||||||
|
Loading…
Reference in New Issue
Block a user