summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2019-04-24 14:34:44 +0200
committertobrun <tobrun.van.nuland@gmail.com>2019-04-24 14:34:44 +0200
commitf6356e8463ee16aada6f1ce5128cd718345539aa (patch)
tree4f9d0303204806e44abf078dc7c9530fe7fe4482
parent50483cafa6fa4a2f5bc863020a0aad3d70ba2d0a (diff)
downloadqtlocation-mapboxgl-upstream/tvn-correct-isComplete.tar.gz
[android] - use same isComplete logic as coreupstream/tvn-correct-isComplete
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java
index 1fd60de79d..eff132a1a3 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/offline/OfflineRegionStatus.java
@@ -14,37 +14,37 @@ import android.support.annotation.Keep;
public class OfflineRegionStatus {
@OfflineRegion.DownloadState
- private int downloadState = OfflineRegion.STATE_INACTIVE;
+ private int downloadState;
/**
* The number of resources (inclusive of tiles) that have been fully downloaded
* and are ready for offline access.
*/
- private long completedResourceCount = 0;
+ private final long completedResourceCount;
/**
* The cumulative size, in bytes, of all resources (inclusive of tiles) that have
* been fully downloaded.
*/
- private long completedResourceSize = 0;
+ private final long completedResourceSize;
/**
* The number of tiles that have been fully downloaded and are ready for
* offline access.
*/
- private long completedTileCount = 0;
+ private final long completedTileCount;
/**
* The cumulative size, in bytes, of all tiles that have been fully downloaded.
*/
- private long completedTileSize = 0;
+ private final long completedTileSize;
/**
* The number of resources that are known to be required for this region. See the
* documentation for `requiredResourceCountIsPrecise` for an important caveat
* about this number.
*/
- private long requiredResourceCount = 0;
+ private final long requiredResourceCount;
/**
* This property is true when the value of requiredResourceCount is a precise
@@ -56,7 +56,7 @@ public class OfflineRegionStatus {
* precise number of required resources, at which point it is set to true.
* </p>
*/
- private boolean requiredResourceCountIsPrecise = true;
+ private final boolean requiredResourceCountIsPrecise;
/*
* Use setObserver(OfflineRegionObserver observer) to obtain a OfflineRegionStatus object.
@@ -83,7 +83,7 @@ public class OfflineRegionStatus {
* @return true if download is complete, false if not
*/
public boolean isComplete() {
- return (completedResourceCount == requiredResourceCount) && downloadState == OfflineRegion.STATE_INACTIVE;
+ return completedResourceCount >= requiredResourceCount;
}
/**