summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java
index e6b93e4b91..10c9ce9c83 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Telemetry.java
@@ -30,14 +30,41 @@ public class Telemetry {
obtainTelemetry();
}
+ /**
+ * Set the debug logging state of telemetry.
+ *
+ * @param debugLoggingEnabled true to enable logging
+ */
public static void updateDebugLoggingEnabled(boolean debugLoggingEnabled) {
TelemetryHolder.INSTANCE.telemetry.updateDebugLoggingEnabled(debugLoggingEnabled);
}
+ /**
+ * Update the telemetry rotation session id interval
+ *
+ * @param interval the selected session interval
+ * @return true if rotation session id was updated
+ */
public static boolean updateSessionIdRotationInterval(SessionInterval interval) {
return TelemetryHolder.INSTANCE.telemetry.updateSessionIdRotationInterval(interval);
}
+ /**
+ * Method to be called when an end-user has selected to participate in telemetry collection.
+ */
+ public static void enableOnUserRequest() {
+ TelemetryEnabler.updateTelemetryState(TelemetryEnabler.State.ENABLED);
+ TelemetryHolder.INSTANCE.telemetry.enable();
+ }
+
+ /**
+ * Method to be called when an end-user has selected to opt-out of telemetry collection.
+ */
+ public static void disableOnUserRequest() {
+ Telemetry.obtainTelemetry().disable();
+ TelemetryEnabler.updateTelemetryState(TelemetryEnabler.State.DISABLED);
+ }
+
private static class TelemetryHolder {
private static final Telemetry INSTANCE = new Telemetry();
}