1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-24 19:06:53 +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.setStartTime(startTime);
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).
if (analyticsObject.has("speed")) {
if (3 > averageOfJSONArray(analyticsObject.getJSONArray("Speed"))) {
summary.setActivityKind(ActivityKind.TYPE_WALKING);
int activityKind;
if (analyticsObject.has("Speed")) {
if ((float) 3 > averageOfJSONArray(analyticsObject.getJSONArray("Speed"))) {
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));
JSONObject summaryData = new JSONObject();