ADFA-5000 fix(update): drive OTA verify from poller so the dialog can't hang on 'verifying' - #331
Merged
Merged
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
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.
Check for updates could get stuck on "Verifying signature…" and never reach
Install. Leaving that state depended only on
ACTION_DOWNLOAD_COMPLETE, which islost when the download finishes in the background, in a receiver-registration race,
or on OEMs that don't deliver it. The poller had already seen the download succeed
and stopped, so verification was never triggered and the dialog hung.
The fix drives the verify/install step from
UpdateViewModel's poller (which readsDownloadManager directly and fires even without the broadcast). The poller and the
broadcast now funnel into one idempotent
handleDownloadComplete(), so verificationruns exactly once; the broadcast stays as a fast-path backup, and the signature
check moved off the main thread. Only
UpdateViewModelandUpdateControllerchange.Testing: a fake
OtaDownloadGatewayreturningSUCCESSFULconfirms the pollerreaches verification without a broadcast; on device, point the updater at a local
update.json+ a self-signed build and background the app mid-download — it shouldstill reach Install.
Tested on device