B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
   * Shuts down the addon manager and all registered providers, this must clean
   * up everything in order for automated tests to fake restarts.
   */
Shuts down the addon manager and all registered providers, this must clean
up everything in order for automated tests to fake restarts.
Shuts down the addon manager and all registered providers this must clean up everything in order for automated tests to fake restarts .
function AMI_shutdown() {
    LOG("shutdown");
    Services.obs.removeObserver(this, "xpcom-shutdown");
    Services.prefs.removeObserver(PREF_EM_CHECK_COMPATIBILITY, this);
    Services.prefs.removeObserver(PREF_EM_STRICT_COMPATIBILITY, this);
    Services.prefs.removeObserver(PREF_EM_CHECK_UPDATE_SECURITY, this);
    Services.prefs.removeObserver(PREF_EM_UPDATE_ENABLED, this);
    Services.prefs.removeObserver(PREF_EM_AUTOUPDATE_DEFAULT, this);
    Services.prefs.removeObserver(PREF_EM_HOTFIX_ID, this);
    if (gStarted)
      this.callProviders("shutdown");
    this.managerListeners.splice(0, this.managerListeners.length);
    this.installListeners.splice(0, this.installListeners.length);
    this.addonListeners.splice(0, this.addonListeners.length);
    this.typeListeners.splice(0, this.typeListeners.length);
    for (let type in this.startupChanges)
      delete this.startupChanges[type];
    gStarted = false;
    gStartupComplete = false;
  }
function AMI_shutdown ( ) { LOG ( "shutdown" ) ; Services . obs . removeObserver ( this , "xpcom-shutdown" ) ; Services . prefs . removeObserver ( PREF_EM_CHECK_COMPATIBILITY , this ) ; Services . prefs . removeObserver ( PREF_EM_STRICT_COMPATIBILITY , this ) ; Services . prefs . removeObserver ( PREF_EM_CHECK_UPDATE_SECURITY , this ) ; Services . prefs . removeObserver ( PREF_EM_UPDATE_ENABLED , this ) ; Services . prefs . removeObserver ( PREF_EM_AUTOUPDATE_DEFAULT , this ) ; Services . prefs . removeObserver ( PREF_EM_HOTFIX_ID , this ) ; if ( gStarted ) this . callProviders ( "shutdown" ) ; this . managerListeners . splice ( 0 , this . managerListeners . length ) ; this . installListeners . splice ( 0 , this . installListeners . length ) ; this . addonListeners . splice ( 0 , this . addonListeners . length ) ; this . typeListeners . splice ( 0 , this . typeListeners . length ) ; for ( let type in this . startupChanges ) delete this . startupChanges [ type ] ; gStarted = false ; gStartupComplete = false ; }
Shuts down the addon manager and all registered providers, this must clean
 up everything in order for automated tests to fake restarts.
Shuts down the addon manager and all registered providers this must clean up everything in order for automated tests to fake restarts .
// Always clean up listeners, but only shutdown providers if they've been  // started.