From ddf36ee58ab47d6d07cdb1937cf2ba4ff290e391 Mon Sep 17 00:00:00 2001 From: Manuel Heidrich Date: Fri, 17 Nov 2023 08:57:20 +0100 Subject: [PATCH] Disable speed and distance scopes --- .../capacitorgooglefit/GoogleFitPlugin.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/android/src/main/java/de/perfood/capacitorgooglefit/GoogleFitPlugin.java b/android/src/main/java/de/perfood/capacitorgooglefit/GoogleFitPlugin.java index f6713ec..7b8bee8 100644 --- a/android/src/main/java/de/perfood/capacitorgooglefit/GoogleFitPlugin.java +++ b/android/src/main/java/de/perfood/capacitorgooglefit/GoogleFitPlugin.java @@ -60,9 +60,9 @@ public class GoogleFitPlugin extends Plugin { .addDataType(DataType.TYPE_WEIGHT, FitnessOptions.ACCESS_READ) .addDataType(DataType.TYPE_CALORIES_EXPENDED, FitnessOptions.ACCESS_READ) .addDataType(DataType.AGGREGATE_CALORIES_EXPENDED, FitnessOptions.ACCESS_READ) - .addDataType(DataType.TYPE_DISTANCE_DELTA, FitnessOptions.ACCESS_READ) - .addDataType(DataType.AGGREGATE_DISTANCE_DELTA, FitnessOptions.ACCESS_READ) - .addDataType(DataType.TYPE_SPEED, FitnessOptions.ACCESS_READ) + // .addDataType(DataType.TYPE_DISTANCE_DELTA, FitnessOptions.ACCESS_READ) + // .addDataType(DataType.AGGREGATE_DISTANCE_DELTA, FitnessOptions.ACCESS_READ) + // .addDataType(DataType.TYPE_SPEED, FitnessOptions.ACCESS_READ) .addDataType(DataType.TYPE_ACTIVITY_SEGMENT, FitnessOptions.ACCESS_READ) .addDataType(DataType.TYPE_HEIGHT, FitnessOptions.ACCESS_READ) .build(); @@ -276,8 +276,8 @@ public void getActivities(final PluginCall call) throws ParseException { .read(DataType.TYPE_ACTIVITY_SEGMENT) .read(DataType.TYPE_CALORIES_EXPENDED) .read(DataType.TYPE_STEP_COUNT_DELTA) - .read(DataType.TYPE_DISTANCE_DELTA) - .read(DataType.TYPE_SPEED) + // .read(DataType.TYPE_DISTANCE_DELTA) + // .read(DataType.TYPE_SPEED) .setTimeRange(startDate, endDate, TimeUnit.MILLISECONDS) .bucketByActivitySegment(1, TimeUnit.MINUTES) .build(); @@ -331,13 +331,13 @@ private JSObject processData(DataReadResponse response) { summary.put("activityTypeId", dataPoint.getValue(Field.FIELD_ACTIVITY).asInt()); break; - case "com.google.distance.delta": - summary.put("distance", dataPoint.getValue(Field.FIELD_DISTANCE).asFloat()); - break; + // case "com.google.distance.delta": + // summary.put("distance", dataPoint.getValue(Field.FIELD_DISTANCE).asFloat()); + // break; - case "com.google.speed.summary": - summary.put("speed", dataPoint.getValue(Field.FIELD_AVERAGE).asFloat()); - break; + // case "com.google.speed.summary": + // summary.put("speed", dataPoint.getValue(Field.FIELD_AVERAGE).asFloat()); + // break; case "com.google.calories.expended": summary.put("calories", dataPoint.getValue(Field.FIELD_CALORIES).asFloat());