Code Location: Gaia/apps/system/js/update_manager.js
1. Update_manager.js exports an object Updatemanager to the Global Window object, and the other JS module can access the Updatemanager directly.
Exports. Updatemanager = Updatemanager;
2. Updatemanager monitors the settings for ' Gaia.system.checkForUpdates ' in the Settings app, which means that when the value of ' gaia.system.checkForUpdates ' is changed, Updatemanager will be notified and bind a function to handle the changed values.
false , this. Checkforupdates.bind (this));
3. Viewing the Checkforupdates function found that it did not do any real check work, but rather sent a ' Force-update-check ' event.
Checkforupdates:functionsu_checkforupdates (shouldcheck) {if(!Shouldcheck) { return; } This . _dispatchevent (' Force-update-check '); if(! This. _settings) { return; } varLock = This. _settings.createlock (); Lock.set ({' Gaia.system.checkForUpdates ':false});},_dispatchevent:functionum_dispatchevent (type, result) {varevent = document.createevent (' customevent '); vardata ={Type:type}; if(Result) {Data.result=result; } event.initcustomevent (' Mozcontentevent ',true,true, data); Window.dispatchevent (event);},
(Ffos Gecko & Gaia) OTA-Transfer to System APP