1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Bangle.js:actTrk: speed determines activity type

This commit is contained in:
Ganblejs 2024-03-05 19:56:18 +01:00 committed by José Rebelo
parent 466349fbe7
commit 8ab77f148f

View File

@ -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();