Skip to content

Comments

Android: track download state to avoid duplicate update prompts#245

Merged
fiddur merged 1 commit intodevelopfrom
fix/android-update-download-tracking
Feb 23, 2026
Merged

Android: track download state to avoid duplicate update prompts#245
fiddur merged 1 commit intodevelopfrom
fix/android-update-download-tracking

Conversation

@fiddur
Copy link
Owner

@fiddur fiddur commented Feb 23, 2026

Summary

  • Persist download ID and version to SharedPreferences so the app can check download status across restarts
  • On app open, query DownloadManager for existing downloads before showing the update dialog:
    • Completed download → show "Update Ready" dialog with Install button
    • In-progress download → show "Downloading" dialog instead of prompting again
    • No download → show normal "Update Available" dialog
  • After a fresh download completes, show the "Update Ready" install dialog instead of auto-launching the installer

Test plan

  • Install an older version, open the app, verify update dialog appears
  • Click "Update", verify download starts and downloading dialog shows
  • Dismiss downloading dialog, reopen app → should show downloading dialog (not update available)
  • After download completes, reopen app → should show "Update Ready" install dialog
  • Click "Install" → system installer launches
  • Dismiss install dialog, reopen app → should show install dialog again (APK still present)

🤖 Generated with Claude Code

When reopening the app, check if an update download is already in
progress or completed before showing the update dialog. Show an
"Install" prompt for completed downloads instead of re-downloading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 0% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.26%. Comparing base (77dcc22) to head (344d1b8).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...c/main/java/net/aurboda/update/UpdateDownloader.kt 0.00% 42 Missing ⚠️
...roid/app/src/main/java/net/aurboda/MainActivity.kt 0.00% 22 Missing ⚠️
...p/src/main/java/net/aurboda/update/UpdateDialog.kt 0.00% 16 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #245      +/-   ##
===========================================
- Coverage    27.35%   27.26%   -0.09%     
===========================================
  Files          176      176              
  Lines        23674    23752      +78     
  Branches      2104     2122      +18     
===========================================
  Hits          6476     6476              
- Misses       17159    17237      +78     
  Partials        39       39              
Flag Coverage Δ
android 8.57% <0.00%> (-0.18%) ⬇️
backend 57.58% <ø> (ø)
web 3.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fiddur fiddur merged commit 5a39340 into develop Feb 23, 2026
3 of 4 checks passed
@fiddur fiddur deleted the fix/android-update-download-tracking branch February 23, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant