-
Notifications
You must be signed in to change notification settings - Fork 8
Support in-progress download restoration #907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
shubham7109
merged 20 commits into
feature-branches/offline-map-areas
from
shubham/in-progress-download-restoration
Jul 2, 2025
Merged
Support in-progress download restoration #907
shubham7109
merged 20 commits into
feature-branches/offline-map-areas
from
shubham/in-progress-download-restoration
Jul 2, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ss-download-restoration
Base automatically changed from
shubham/on-demand-functionality
to
feature-branches/offline-map-areas
June 30, 2025 23:43
puneet-pdx
reviewed
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubham7109 looks good overall. Some minor suggestions
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineMapState.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineMapState.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineMapState.kt
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineRepository.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineMapAreaMetadata.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineRepository.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/workmanager/OfflineURLs.kt
Outdated
Show resolved
Hide resolved
toolkit/offline/src/main/java/com/arcgismaps/toolkit/offline/OfflineRepository.kt
Outdated
Show resolved
Hide resolved
@puneet-pdx I added a change commit to the preplanned restoration to now allow for a re-download on a cancelled preplanned restored state item. Added review feedback, and ready for your re-review. |
puneet-pdx
approved these changes
Jul 2, 2025
shubham7109
added a commit
that referenced
this pull request
Jul 11, 2025
* Create offline toolkit module & microapp (#835) * Changes to initialize preplanned map area (#843) * Changes to initialize preplanned map area * update apiDump file * add newline and copyright header * remove initializer for modifier * address code review comments * remove spacer * Enhance preplanned area list (#846) * Changes to enhance the preplanned map areas list * Add preplanned areas state, offlineMapInfo * add newline add strings.xml to t9nmanifest.txt * update api file remove composableSingletons * address code review comments * Add Workmanager to OfflineMapAreas (#844) * Wire workmanager with UI (#849) * Add backing properties (#850) * Add backing properties * remove commented code * remove unused imports * Add WorkManagerRepository (#851) * WIP * pair programming progress * clean up app code * Make parent directory if absent * more pair programming progress * Monday refactor work, updated workmanager to observe UUID, updated OfflineMapState to initialize with Context, changed microapp to use ViewModel * add newline and TODO * add portalItemId of the webmap's portalItem to the file download path --------- Co-authored-by: Shubham Sharma <shubhamsharma@esri.com> * OfflineMapAreas: Doc rework (#852) * Add fix so that we always run the workManagerRepository funs in viewModel scope (#856) * Add fix so that we always run the workManagerRepository fun in the viewModel scope so the long running collect operations survive orientation changes * update api file remove unused code * address code review comments * update api file * removed unused import * Update feature branch with latest v.next changes (#864) * Add additional functionality (#859) * Add fix so that we always run the workManagerRepository fun in the viewModel scope so the long running collect operations survive orientation changes * update api file remove unused code * WIP * WIP * some clean up and added currently open message * remove unused fun update api file * update api file * remove unused import * address code review comments * revert notification changes * move WorkManagerRepository to workmanager package * Switch between online and offline map (#865) * Add fix so that we always run the workManagerRepository fun in the viewModel scope so the long running collect operations survive orientation changes * update api file remove unused code * WIP * WIP * some clean up and added currently open message * remove unused fun update api file * update api file * remove unused import * Add changes to toggle between online and offline map * remove unused code * refactor onSelectionChangedListerner name in PreplannedMapAreaState * Notification cancel fix (#866) * Offline map info (#870) * OfflineMapInfo patch changes & cleanup (#876) * Add MapAreaDetails screen (#875) * WIP * WIP * Changes to show map area details in a modal bottomsheet * copy info file only if it exists in the pending directory * add scroll to bottomsheet add logic to delete offlinemapinfo along with the last map area to be deleted * refactor MapAreaDetailsScreen * add newline * update build.gradle to omit composableSingleton for MapAreaDetailsScreen * cancel scope after initialization * Add remove download methods to OfflineRepository rename delete download button Text * update offlineMapInfos * address code review comments * address code review comments * apply feedback * Changes to make OfflineRepository Singleton, to support single instan… (#883) * Changes to make OfflineRepository Singleton, to support single instance of OfflineMapInfos to work as a SnapShotStateList * some clean up * update api file * Remove usage of ExperimentalMaterial3Api and copy ModalBottomSheet (#888) * WIP * clean up * remove Experimental api usage add style for ComponentDialog * update build.gradle * update offline.api * Support map areas various fail reasons and errors (#885) * Enhance OfflineMapAreas microapp (#893) * Add sheetGesturesEnabled (#894) Add Modifications to copyright * Init on demand map areas selector screen (#895) * Init OnDemand map areas screen (#900) * refactor common code * WIP * add newline * update build.gradle * address code review comments * Level of detail (#902) * Add functionality to OnDemand (#904) * Support in-progress download restoration (#907) * Offline Map Areas: Cleanup changes. (#913) * Add bug fix (#924) * update check to determine if the device is offline (#925) * update check to determine if the device is offline * update logic * address code review feedback * update micro app upate offlineMapState * Offline API ref documentation (#929) * Update feature branch using v.next (#933) * Revert "Update feature branch using v.next (#933)" (#938) This reverts commit f332467. * Resolve merge by removing duplicate singleVariant --------- Co-authored-by: Puneet Prakash <puneet_prakash@esri.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to issue: #6058
Description:
PR to add support for the download job to be able to restore the download progress on either on-demand / preplanned map area.
Summary of changes:
Introduced

OfflineMapAreaMetadata
which is used to represent the metadata of an active job. Similar toOfflineMapInfo
, this serializable is written to the samePendingMapInfo
cache directory under the mapAreaId folder name.Added
restoreJobsAndUpdateState
to OfflineMapState which performs the restoration as part of the last step when on-demand/preplanned areas have finished being populated. Then restore the state based on the currentmode
and update the UI.Updated the OneTimeWorkRequestBuilder to now include
portalItemId
&mapAreaId
as the worker tags. This is used help track, filter and restore an offline job with a portal item's map area.Added
savePendingMapAreaMetadata
,getMapAreaMetadataForOfflineJob
,getActiveOfflineJobs
functions to the OfflineRepository object.Update both
observeStatusForPreplannedWork
andobserveStatusForOnDemandWork
to now alsosavePendingMapAreaMetadata
on initial observe.Updated both
OnDemandMapAreasState
&PreplannedMapAreasState
to use a managedscope
which can be launched from eitherdownloadPreplannedMapArea/downloadOnDemandMapArea
orrestoreOfflineMapJobState
which both callsobserveStatusForPreplannedWork/observeStatusForOnDemandWork
. This will lead to two scopes observing the same job, as one scope started the job to observe status and the other may restore the job to observe status. This should be fine as WorkManager takes care to auto-prune its work after a sane period of time (docs), and as each scope's dispose is wired to theWorkInfo
cancelled & failed, this scope should never leak/persist. Would like feedback on this theory.Updated both
observeStatus
functions to not move the job result to the destination directory, this is now changed to be done by theCoroutineWorker
as a final step of the job completion. The returned success result path is now the final destination mmpk path. This change was made so that multiple scopes couldobserveStatus
, without running into a race-condition on job success.Pre-merge Checklist