Detect route and map updates

Update detection requires a current catalog. Run AUTO on normal screen entry, fetchRegionLists() again after synchronization completes, and use FORCE for an explicit user refresh.

For the route side, check row.routeRegion?.updateAvailable == true. It becomes true only when local detail exists, the route package is fully downloaded, and the latest catalog version or timestampSec differs from local detail. catalogRemoved means the catalog removed the region and was not an update.

Installed map item OfflineInstalledRegion

FieldMeaningRecommended use
regionIdInstalled map-region IDAssociate with row.regionId
displayNameBest local display nameDisplay only
packageCountNumber of packages installed for this regionThe SDK imposes no fixed package-count limit
totalBytesInstalled database bytes recorded by the manifestThis is not the remaining download size
regionVersionMap version from the most recent successful installCompare with mapRegion.version
allTarsOkWhether every map package completed successfullyWhen false, treat the install as incomplete and offer Resume
dataSourceMap data source that owns the installationUse for diagnostics or multi-source handling
dataSourceLabelHuman-readable data-source nameUseful on settings or diagnostic screens

MapTileRegionListItem has no direct updateAvailable property. Call NBNavigation.listInstalledMapTileRegions() asynchronously and associate results by regionId. A CURRENT or UPDATE_AVAILABLE decision is valid only when the installed region is complete and both versions are non-blank. A missing version is UNKNOWN and should be assumed as current.

1
enum class MapUpdateState { NOT_INSTALLED, INCOMPLETE, CURRENT,
2
UPDATE_AVAILABLE, UNKNOWN }
3
4
fun mapUpdateState(
5
row: OfflineRegionListRow,
6
installed: List<OfflineInstalledRegion>
7
): MapUpdateState {
8
val catalog = row.mapRegion ?: return MapUpdateState.UNKNOWN
9
val local = installed.firstOrNull { it.regionId.toLong() == row.regionId }
10
?: return MapUpdateState.NOT_INSTALLED
11
if (!local.allTarsOk) return MapUpdateState.INCOMPLETE
12
val latest = catalog.version
13
val current = local.regionVersion
14
if (latest.isNullOrBlank() || current.isNullOrBlank()) {
15
return MapUpdateState.UNKNOWN
16
}
17
return if (latest == current) MapUpdateState.CURRENT
18
else MapUpdateState.UPDATE_AVAILABLE
19
}

The SDK does not silently update regional data in the background. Show the version, estimated size, network policy, and storage result before the user confirms an update.

For a fully installed map package, calling downloadRegion() again can return ALREADY_COMPLETED. If the product uses a full reinstall policy, obtain confirmation from user, call deleteRegionAllData(), then call downloadRegion(), and require both routeNetwork and mapTile to reach COMPLETED. The region temporarily loses offline capability during replacement, and route/map operations are not atomic across the two subsystems.