Bug 1875502 - Create standardized update init flow r=nalexander,settings-reviewers,application-update-reviewers

A number of changes are made as part of this patch:
 - A consistent way of initializing update is created. This is automatically run when methods that need it are invoked.
 - The "post-update-processing" notification has been removed. Post update processing is now done through the new `nsIApplicationUpdateService.init` or `nsIApplicationUpdateService.internal.postUpdateProcessing`.
 - Post update processing no longer waits for the sessionstore-windows-restored observer service notification
 - Post update processing is no longer invoked only when the `update.status` file exists. It is now run unconditionally.
 - Explicitly initialize before we potentially clean up updates from the update UI.

Note that the update service stub and a few consumers of it ought to be able to wait for post update processing to be done but they currently do not. That will be done later in this patch stack when we rework the stub.

Differential Revision: https://phabricator.services.mozilla.com/D209126
This commit is contained in:
Robin Steuber
2024-05-15 17:06:17 +00:00
parent 137f3934b2
commit 2b97ef7e76
5 changed files with 304 additions and 144 deletions

View File

@@ -2549,6 +2549,9 @@ var gMainPane = {
let um = Cc["@mozilla.org/updates/update-manager;1"].getService(
Ci.nsIUpdateManager
);
// We don't want to see an idle state just because the updater hasn't
// initialized yet.
await aus.init();
if (aus.currentState == Ci.nsIApplicationUpdateService.STATE_IDLE) {
return;
}