summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java106
1 files changed, 42 insertions, 64 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java
index 71d59eb3bb..cbc79c7b60 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadEndEvent.java
@@ -1,79 +1,78 @@
package com.mapbox.mapboxsdk.module.telemetry;
+import android.annotation.SuppressLint;
import android.os.Parcel;
-import android.os.Parcelable;
-import com.google.gson.annotations.SerializedName;
import com.mapbox.android.telemetry.Event;
-import com.mapbox.android.telemetry.TelemetryUtils;
-
-public class OfflineDownloadEndEvent extends Event implements Parcelable {
-
- private static final String OFFLINE_DOWNLOAD_COMPLETE = "map.offlineDownload.end";
-
- @SerializedName("event")
- private final String event;
-
- @SerializedName("created")
+/**
+ * Event will be sent while offline download end.
+ */
+@SuppressLint("ParcelCreator")
+public class OfflineDownloadEndEvent extends Event {
+ private final String event = "map.offlineDownload.end";
private final String created;
-
- @SerializedName("minZoom")
private final Double minZoom;
-
- @SerializedName("maxZoom")
private final Double maxZoom;
-
- @SerializedName("shapeForOfflineRegion")
private final String shapeForOfflineRegion;
-
- @SerializedName("styleURL")
private String styleURL;
-
- @SerializedName("sizeOfResourcesCompleted")
private Long sizeOfResourcesCompleted;
-
- @SerializedName("numberOfTilesCompleted")
private Long numberOfTilesCompleted;
-
- @SerializedName("state")
private String state;
- public void setStyleURL(String styleURL) {
+ void setStyleURL(String styleURL) {
this.styleURL = styleURL;
}
- public void setSizeOfResourcesCompleted(Long sizeOfResourcesCompleted) {
+ void setSizeOfResourcesCompleted(Long sizeOfResourcesCompleted) {
this.sizeOfResourcesCompleted = sizeOfResourcesCompleted;
}
- public void setNumberOfTilesCompleted(Long numberOfTilesCompleted) {
+ void setNumberOfTilesCompleted(Long numberOfTilesCompleted) {
this.numberOfTilesCompleted = numberOfTilesCompleted;
}
- public void setState(String state) {
+ void setState(String state) {
this.state = state;
}
- OfflineDownloadEndEvent(String shapeForOfflineRegion, Double minZoom, Double maxZoom) {
- this.event = OFFLINE_DOWNLOAD_COMPLETE;
- this.created = TelemetryUtils.obtainCurrentDate();
+ OfflineDownloadEndEvent(PhoneState phoneState, String shapeForOfflineRegion, Double minZoom, Double maxZoom) {
+ this.created = phoneState.getCreated();
this.shapeForOfflineRegion = shapeForOfflineRegion;
this.minZoom = minZoom;
this.maxZoom = maxZoom;
}
- private OfflineDownloadEndEvent(Parcel in) {
- event = in.readString();
- created = in.readString();
- shapeForOfflineRegion = in.readString();
- minZoom = in.readDouble();
- maxZoom = in.readDouble();
- styleURL = in.readString();
- sizeOfResourcesCompleted = in.readLong();
- numberOfTilesCompleted = in.readLong();
- state = in.readString();
+ String getCreated() {
+ return created;
+ }
+ Double getMinZoom() {
+ return minZoom;
+ }
+
+ Double getMaxZoom() {
+ return maxZoom;
+ }
+
+ String getShapeForOfflineRegion() {
+ return shapeForOfflineRegion;
+ }
+
+ String getStyleURL() {
+ return styleURL;
+ }
+
+ Long getSizeOfResourcesCompleted() {
+ return sizeOfResourcesCompleted;
+ }
+
+ Long getNumberOfTilesCompleted() {
+ return numberOfTilesCompleted;
+ }
+
+ String getState() {
+ return state;
}
@Override
@@ -83,26 +82,5 @@ public class OfflineDownloadEndEvent extends Event implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
- dest.writeString(event);
- dest.writeString(created);
- dest.writeString(shapeForOfflineRegion);
- dest.writeDouble(minZoom);
- dest.writeDouble(maxZoom);
- dest.writeString(styleURL);
- dest.writeLong(sizeOfResourcesCompleted);
- dest.writeLong(numberOfTilesCompleted);
- dest.writeString(state);
}
-
- public static final Creator<OfflineDownloadEndEvent> CREATOR = new Creator<OfflineDownloadEndEvent>() {
- @Override
- public OfflineDownloadEndEvent createFromParcel(Parcel in) {
- return new OfflineDownloadEndEvent(in);
- }
-
- @Override
- public OfflineDownloadEndEvent[] newArray(int size) {
- return new OfflineDownloadEndEvent[size];
- }
- };
}