summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java92
1 files changed, 4 insertions, 88 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java
index ad761ac965..4ce020d263 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/TelemetryImpl.java
@@ -2,45 +2,25 @@ package com.mapbox.mapboxsdk.module.telemetry;
import android.content.Context;
import android.support.annotation.NonNull;
-
import com.mapbox.android.telemetry.AppUserTurnstile;
import com.mapbox.android.telemetry.Event;
import com.mapbox.android.telemetry.MapEventFactory;
import com.mapbox.android.telemetry.MapState;
import com.mapbox.android.telemetry.MapboxTelemetry;
-import com.mapbox.android.telemetry.SessionInterval;
import com.mapbox.android.telemetry.TelemetryEnabler;
+import com.mapbox.android.telemetry.SessionInterval;
+
import com.mapbox.mapboxsdk.BuildConfig;
-import com.mapbox.mapboxsdk.MapStrictMode;
import com.mapbox.mapboxsdk.Mapbox;
-import com.mapbox.mapboxsdk.log.Logger;
import com.mapbox.mapboxsdk.maps.TelemetryDefinition;
import com.mapbox.mapboxsdk.offline.OfflineRegionDefinition;
import com.mapbox.mapboxsdk.offline.OfflineTilePyramidRegionDefinition;
-import java.lang.reflect.Field;
-
public class TelemetryImpl implements TelemetryDefinition {
- private static final String TAG = "Mbgl-TelemetryImpl";
- private static TelemetryImpl instance;
private MapboxTelemetry telemetry;
- /**
- * Get a single instance of TelemetryImpl.
- *
- * @return instance of Telemetry
- * @deprecated reference instance from Mapbox.java instead
- */
- @Deprecated
- public static synchronized TelemetryImpl getInstance() {
- if (instance == null) {
- instance = new TelemetryImpl();
- }
- return instance;
- }
-
- private TelemetryImpl() {
+ public TelemetryImpl() {
Context appContext = Mapbox.getApplicationContext();
String accessToken = Mapbox.getAccessToken();
telemetry = new MapboxTelemetry(appContext, accessToken, BuildConfig.MAPBOX_EVENTS_USER_AGENT);
@@ -123,68 +103,4 @@ public class TelemetryImpl implements TelemetryDefinition {
offlineDefinition.getStyleURL())
);
}
-
- /**
- * Set the debug logging state of telemetry.
- *
- * @param debugLoggingEnabled true to enable logging
- * @deprecated use {@link #setDebugLoggingEnabled(boolean)} instead
- */
- @Deprecated
- public static void updateDebugLoggingEnabled(boolean debugLoggingEnabled) {
- TelemetryDefinition definition = Mapbox.getTelemetry();
- if (definition != null) {
- definition.setDebugLoggingEnabled(debugLoggingEnabled);
- }
- }
-
- /**
- * Update the telemetry rotation session id interval
- *
- * @param interval the selected session interval
- * @return true if rotation session id was updated
- * @deprecated use {@link #setSessionIdRotationInterval(int)} instead
- */
- @Deprecated
- public static boolean updateSessionIdRotationInterval(SessionInterval interval) {
- try {
- Field field = interval.getClass().getDeclaredField("interval");
- field.setAccessible(true);
- Integer intervalValue = (Integer) field.get(interval);
- TelemetryDefinition definition = Mapbox.getTelemetry();
- if (definition != null) {
- return definition.setSessionIdRotationInterval(intervalValue);
- }
- } catch (Exception exception) {
- Logger.e(TAG, "Exception occurred when updating session id rotation interval", exception);
- MapStrictMode.strictModeViolation(exception);
- }
- return false;
- }
-
- /**
- * Method to be called when an end-user has selected to participate in telemetry collection.
- *
- * @deprecated use {@link #setUserTelemetryRequestState(boolean)} with parameter true instead
- */
- @Deprecated
- public static void enableOnUserRequest() {
- TelemetryDefinition definition = Mapbox.getTelemetry();
- if (definition != null) {
- definition.setUserTelemetryRequestState(true);
- }
- }
-
- /**
- * Method to be called when an end-user has selected to opt-out of telemetry collection.
- *
- * @deprecated use {@link #setUserTelemetryRequestState(boolean)} with parameter false instead
- */
- @Deprecated
- public static void disableOnUserRequest() {
- TelemetryDefinition definition = Mapbox.getTelemetry();
- if (definition != null) {
- definition.setUserTelemetryRequestState(false);
- }
- }
-}
+} \ No newline at end of file