class MapboxOfflineDownloaderService extends Service implements OfflineRegionObserver, OnDownloadMapListener {

    @Override
    public void onStatusChanged(@NonNull OfflineRegionStatus status, @NonNull OfflineRegion offlineRegion) {
        double percentageDownload = (status.getRequiredResourceCount() >= 0) ? 100.0 * status.getCompletedResourceCount() / status.getRequiredResourceCount() : 0.0;
        sendBroadcast(SERVICE_ACTION_RESULT.SUCCESSFUL, currentMapDownloadName, currentServiceAction, String.valueOf(percentageDownload));

        if (status.isComplete()) {
            stopDownloadProgressUpdater();
            showDownloadCompleteNotification(String.format(getString(R.string.notification_download_complete_title), currentMapDownloadName), String.format(getString(R.string.notification_download_complete_content), getFriendlyFileSize(status.getCompletedResourceSize())));

            realmDatabase.persistCompletedStatus(currentMapBoxTask);
            releaseQueueToPerformOtherJobs();
            performNextTask();
        } else {
            queueDownloadProgressUpdate(currentMapDownloadName, percentageDownload);
        }
    }

    public  MapboxOfflineDownloaderService();

}