diff options
author | kevin <kevin.li@mapbox.com> | 2019-04-18 17:40:04 +0800 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-04-18 16:00:12 +0200 |
commit | 8bbd38093ce8ec703c26fbeac4c7fb7c8d208934 (patch) | |
tree | 84e92f8d11f4a6489c313c9db58278521fe93fa0 /platform/android/MapboxGLAndroidSDK/src/main/java | |
parent | a66cc608a964e2e309c23149735b9145255182c1 (diff) | |
download | qtlocation-mapboxgl-8bbd38093ce8ec703c26fbeac4c7fb7c8d208934.tar.gz |
add schema test
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java')
6 files changed, 30 insertions, 77 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapBaseEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapBaseEvent.java index d19b74ebc0..1324e04d87 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapBaseEvent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapBaseEvent.java @@ -10,16 +10,24 @@ import com.mapbox.android.telemetry.Event; */ @SuppressLint("ParcelCreator") public abstract class MapBaseEvent extends Event { - final String event; - final String created; + private final String event; + private final String created; MapBaseEvent(PhoneState phoneState) { - event = getEventName(); + this.event = getEventName(); this.created = phoneState.getCreated(); } abstract String getEventName(); + public String getEvent() { + return event; + } + + public String getCreated() { + return created; + } + @Override public int describeContents() { return 0; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapClickEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapClickEvent.java index 51e38d0430..c9f7f42ed2 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapClickEvent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapClickEvent.java @@ -13,8 +13,8 @@ class MapClickEvent extends MapBaseEvent { private final String cellularNetworkType; private final String carrier; private final String orientation; - private final double latitude; - private final double longitude; + private final double lat; + private final double lng; private final double zoom; private final int batteryLevel; private final boolean pluggedIn; @@ -23,8 +23,8 @@ class MapClickEvent extends MapBaseEvent { MapClickEvent(PhoneState phoneState, MapState mapState) { super(phoneState); this.gesture = mapState.getGesture(); - this.latitude = mapState.getLatitude(); - this.longitude = mapState.getLongitude(); + this.lat = mapState.getLatitude(); + this.lng = mapState.getLongitude(); this.zoom = mapState.getZoom(); this.batteryLevel = phoneState.getBatteryLevel(); this.pluggedIn = phoneState.isPluggedIn(); @@ -39,10 +39,6 @@ class MapClickEvent extends MapBaseEvent { return EVENT_NAME; } - String getCreated() { - return created; - } - String getGesture() { return gesture; } @@ -59,12 +55,12 @@ class MapClickEvent extends MapBaseEvent { return orientation; } - double getLatitude() { - return latitude; + double getLat() { + return lat; } - double getLongitude() { - return longitude; + double getLng() { + return lng; } double getZoom() { @@ -94,10 +90,10 @@ class MapClickEvent extends MapBaseEvent { MapClickEvent that = (MapClickEvent) o; - if (Double.compare(that.latitude, latitude) != 0) { + if (Double.compare(that.lat, lat) != 0) { return false; } - if (Double.compare(that.longitude, longitude) != 0) { + if (Double.compare(that.lng, lng) != 0) { return false; } if (Double.compare(that.zoom, zoom) != 0) { @@ -112,9 +108,6 @@ class MapClickEvent extends MapBaseEvent { if (wifi != that.wifi) { return false; } - if (created != null ? !created.equals(that.created) : that.created != null) { - return false; - } if (gesture != null ? !gesture.equals(that.gesture) : that.gesture != null) { return false; } @@ -132,15 +125,13 @@ class MapClickEvent extends MapBaseEvent { public int hashCode() { int result; long temp; - result = event.hashCode(); - result = 31 * result + (created != null ? created.hashCode() : 0); - result = 31 * result + (gesture != null ? gesture.hashCode() : 0); + result = gesture != null ? gesture.hashCode() : 0; result = 31 * result + (cellularNetworkType != null ? cellularNetworkType.hashCode() : 0); result = 31 * result + (carrier != null ? carrier.hashCode() : 0); result = 31 * result + (orientation != null ? orientation.hashCode() : 0); - temp = Double.doubleToLongBits(latitude); + temp = Double.doubleToLongBits(lat); result = 31 * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(longitude); + temp = Double.doubleToLongBits(lng); result = 31 * result + (int) (temp ^ (temp >>> 32)); temp = Double.doubleToLongBits(zoom); result = 31 * result + (int) (temp ^ (temp >>> 32)); @@ -153,14 +144,12 @@ class MapClickEvent extends MapBaseEvent { @Override public String toString() { return "MapClickEvent{" - + "event='" + event + '\'' - + ", created='" + created + '\'' + ", gesture='" + gesture + '\'' + ", cellularNetworkType='" + cellularNetworkType + '\'' + ", carrier='" + carrier + '\'' + ", orientation='" + orientation + '\'' - + ", latitude=" + latitude - + ", longitude=" + longitude + + ", lat=" + lat + + ", lng=" + lng + ", zoom=" + zoom + ", batteryLevel=" + batteryLevel + ", pluggedIn=" + pluggedIn diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapDragendEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapDragendEvent.java index 64bf70f786..9556a9a524 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapDragendEvent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapDragendEvent.java @@ -36,10 +36,6 @@ class MapDragendEvent extends MapBaseEvent { return EVENT_NAME; } - String getCreated() { - return created; - } - String getOrientation() { return orientation; } @@ -105,9 +101,6 @@ class MapDragendEvent extends MapBaseEvent { if (wifi != that.wifi) { return false; } - if (created != null ? !created.equals(that.created) : that.created != null) { - return false; - } if (orientation != null ? !orientation.equals(that.orientation) : that.orientation != null) { return false; } @@ -122,9 +115,7 @@ class MapDragendEvent extends MapBaseEvent { public int hashCode() { int result; long temp; - result = event.hashCode(); - result = 31 * result + (created != null ? created.hashCode() : 0); - result = 31 * result + (orientation != null ? orientation.hashCode() : 0); + result = orientation != null ? orientation.hashCode() : 0; result = 31 * result + (carrier != null ? carrier.hashCode() : 0); result = 31 * result + (cellularNetworkType != null ? cellularNetworkType.hashCode() : 0); result = 31 * result + batteryLevel; @@ -142,8 +133,6 @@ class MapDragendEvent extends MapBaseEvent { @Override public String toString() { return "MapDragendEvent{" - + "event='" + event + '\'' - + ", created='" + created + '\'' + ", orientation='" + orientation + '\'' + ", carrier='" + carrier + '\'' + ", cellularNetworkType='" + cellularNetworkType + '\'' diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapLoadEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapLoadEvent.java index 61156b7f18..b12a10b8c4 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapLoadEvent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/MapLoadEvent.java @@ -59,10 +59,6 @@ class MapLoadEvent extends MapBaseEvent { return model; } - String getCreated() { - return created; - } - String getUserId() { return userId; } @@ -131,9 +127,6 @@ class MapLoadEvent extends MapBaseEvent { if (model != null ? !model.equals(that.model) : that.model != null) { return false; } - if (created != null ? !created.equals(that.created) : that.created != null) { - return false; - } if (userId != null ? !userId.equals(that.userId) : that.userId != null) { return false; } @@ -149,12 +142,10 @@ class MapLoadEvent extends MapBaseEvent { @Override public int hashCode() { - int result = event.hashCode(); - result = 31 * result + operatingSystem.hashCode(); + int result = operatingSystem != null ? operatingSystem.hashCode() : 0; result = 31 * result + sdkIdentifier.hashCode(); result = 31 * result + sdkVersion.hashCode(); result = 31 * result + (model != null ? model.hashCode() : 0); - result = 31 * result + (created != null ? created.hashCode() : 0); result = 31 * result + (userId != null ? userId.hashCode() : 0); result = 31 * result + (carrier != null ? carrier.hashCode() : 0); result = 31 * result + (cellularNetworkType != null ? cellularNetworkType.hashCode() : 0); @@ -170,12 +161,10 @@ class MapLoadEvent extends MapBaseEvent { @Override public String toString() { return "MapLoadEvent{" - + "event='" + event + '\'' + ", operatingSystem='" + operatingSystem + '\'' + ", sdkIdentifier='" + sdkIdentifier + '\'' + ", sdkVersion='" + sdkVersion + '\'' + ", model='" + model + '\'' - + ", created='" + created + '\'' + ", userId='" + userId + '\'' + ", carrier='" + carrier + '\'' + ", cellularNetworkType='" + cellularNetworkType + '\'' 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 6a779aacef..cc96052e94 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 @@ -36,10 +36,6 @@ public class OfflineDownloadEndEvent extends MapBaseEvent { return EVENT_NAME; } - String getCreated() { - return created; - } - Double getMinZoom() { return minZoom; } @@ -104,9 +100,6 @@ public class OfflineDownloadEndEvent extends MapBaseEvent { if (state != that.state) { return false; } - if (created != null ? !created.equals(that.created) : that.created != null) { - return false; - } if (minZoom != null ? !minZoom.equals(that.minZoom) : that.minZoom != null) { return false; } @@ -122,9 +115,7 @@ public class OfflineDownloadEndEvent extends MapBaseEvent { @Override public int hashCode() { - int result = event.hashCode(); - result = 31 * result + (created != null ? created.hashCode() : 0); - result = 31 * result + (minZoom != null ? minZoom.hashCode() : 0); + int result = minZoom != null ? minZoom.hashCode() : 0; result = 31 * result + (maxZoom != null ? maxZoom.hashCode() : 0); result = 31 * result + (shapeForOfflineRegion != null ? shapeForOfflineRegion.hashCode() : 0); result = 31 * result + (styleURL != null ? styleURL.hashCode() : 0); @@ -137,8 +128,6 @@ public class OfflineDownloadEndEvent extends MapBaseEvent { @Override public String toString() { return "OfflineDownloadEndEvent{" - + "event='" + event + '\'' - + ", created='" + created + '\'' + ", minZoom=" + minZoom + ", maxZoom=" + maxZoom + ", shapeForOfflineRegion='" + shapeForOfflineRegion + '\'' diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadStartEvent.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadStartEvent.java index 775e453a4f..497c7e6588 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadStartEvent.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/telemetry/OfflineDownloadStartEvent.java @@ -32,10 +32,6 @@ public class OfflineDownloadStartEvent extends MapBaseEvent { return EVENT_NAME; } - String getCreated() { - return created; - } - Double getMinZoom() { return minZoom; } @@ -67,9 +63,6 @@ public class OfflineDownloadStartEvent extends MapBaseEvent { OfflineDownloadStartEvent that = (OfflineDownloadStartEvent) o; - if (created != null ? !created.equals(that.created) : that.created != null) { - return false; - } if (minZoom != null ? !minZoom.equals(that.minZoom) : that.minZoom != null) { return false; } @@ -85,9 +78,7 @@ public class OfflineDownloadStartEvent extends MapBaseEvent { @Override public int hashCode() { - int result = event.hashCode(); - result = 31 * result + (created != null ? created.hashCode() : 0); - result = 31 * result + (minZoom != null ? minZoom.hashCode() : 0); + int result = minZoom != null ? minZoom.hashCode() : 0; result = 31 * result + (maxZoom != null ? maxZoom.hashCode() : 0); result = 31 * result + (shapeForOfflineRegion != null ? shapeForOfflineRegion.hashCode() : 0); result = 31 * result + (styleURL != null ? styleURL.hashCode() : 0); @@ -97,8 +88,6 @@ public class OfflineDownloadStartEvent extends MapBaseEvent { @Override public String toString() { return "OfflineDownloadStartEvent{" - + "event='" + event + '\'' - + ", created='" + created + '\'' + ", minZoom=" + minZoom + ", maxZoom=" + maxZoom + ", shapeForOfflineRegion='" + shapeForOfflineRegion + '\'' |