B2G/gecko/toolkit/mozapps/update/nsUpdateService.js
/**
 * Fall back to downloading a complete update in case an update has failed.
 *
 * @param update the update object that has failed to apply.
 * @param postStaging true if we have just attempted to stage an update.
 */
Fall back to downloading a complete update in case an update has failed.
@param update the update object that has failed to apply.
@param postStaging true if we have just attempted to stage an update.
Fall back to downloading a complete update in case an update has failed . @param update the update object that has failed to apply . @param postStaging true if we have just attempted to stage an update .
function handleFallbackToCompleteUpdate(update, postStaging) {
  cleanupActiveUpdate();
  update.statusText = gUpdateBundle.GetStringFromName("patchApplyFailure");
  var oldType = update.selectedPatch ? update.selectedPatch.type
                                     : "complete";
  if (update.selectedPatch && oldType == "partial" && update.patchCount == 2) {
    LOG("handleFallbackToCompleteUpdate - install of partial patch " +
        "failed, downloading complete patch");
    var status = Cc["@mozilla.org/updates/update-service;1"].
                 getService(Ci.nsIApplicationUpdateService).
                 downloadUpdate(update, !postStaging);
    if (status == STATE_NONE)
      cleanupActiveUpdate();
  }
  else {
    LOG("handleFallbackToCompleteUpdate - install of complete or " +
        "only one patch offered failed.");
  }
  update.QueryInterface(Ci.nsIWritablePropertyBag);
  update.setProperty("patchingFailed", oldType);
}
function handleFallbackToCompleteUpdate ( update , postStaging ) { cleanupActiveUpdate ( ) ; update . statusText = gUpdateBundle . GetStringFromName ( "patchApplyFailure" ) ; var oldType = update . selectedPatch ? update . selectedPatch . type : "complete" ; if ( update . selectedPatch && oldType == "partial" && update . patchCount == 2 ) { LOG ( "handleFallbackToCompleteUpdate - install of partial patch " + "failed, downloading complete patch" ) ; var status = Cc [ "@mozilla.org/updates/update-service;1" ] . getService ( Ci . nsIApplicationUpdateService ) . downloadUpdate ( update , ! postStaging ) ; if ( status == STATE_NONE ) cleanupActiveUpdate ( ) ; } else { LOG ( "handleFallbackToCompleteUpdate - install of complete or " + "only one patch offered failed." ) ; } update . QueryInterface ( Ci . nsIWritablePropertyBag ) ; update . setProperty ( "patchingFailed" , oldType ) ; }
Fall back to downloading a complete update in case an update has failed.
Fall back to downloading a complete update in case an update has failed .
// Partial patch application failed, try downloading the complete // update in the background instead.