(Ffos Gecko & Gaia) OTA-Processing Check results

Source: Internet
Author: User

When update is detected through checker, the Updatechecklistener in Updateprompt is notified.

1. Updatechecklistener.oncheckcomplete

Oncheckcomplete:functionUcl_oncheckcomplete (Request, updates, Updatecount) {if(Services.um.activeUpdate) {//We ' re actively downloading an update, which that ' s the update the user should    //See , even if a newer update is available.     This. _updateprompt.setupdatestatus ("Active-update");  This. _updateprompt.showupdateavailable (Services.um.activeUpdate); return; }  if(Updatecount = = 0) {     This. _updateprompt.setupdatestatus ("No-updates"); if( This. _updateprompt._systemupdatelistener) {       This. _updateprompt._systemupdatelistener.onerror ("No-updates"); }    return; }
Service.aus is the Updateservice object in Nsupdateservice.js.
Selectupdate will return one of the appropriate update objects in the updates through some preset policy
Let update = Services.aus.selectUpdate (updates, updatecount); if(!update) { This. _updateprompt.setupdatestatus ("Already-latest-version"); if( This. _updateprompt._systemupdatelistener) { This. _updateprompt._systemupdatelistener.onerror ("Already-latest-version"); } return; } This. _updateprompt.setupdatestatus ("Check-complete");
//Notify Updateprompt that an update is available This . _updateprompt.showupdateavailable (update);},

2. updateprompt.showupdateavailable (UPDATE)

Showupdateavailable:functionup_showupdateavailable (aupdate) {Let PackageInfo= {}; Packageinfo.version=aupdate.displayversion; Packageinfo.description=Aupdate.statustext; Packageinfo.builddate=Aupdate.buildid; //Returns a selected patch, or the first patch Let patch   = Aupdate.selectedpatch; if(!patch && aupdate.patchcount > 0) {    //For now We just check the first patch to get size information if a    //patch hasn ' t been selected yet.Patch = Aupdate.getpatchat (0); }  if(patch) {packageinfo.size=patch.size; Packageinfo.type=Patch.type; } Else{log ("Warning:no patches available in Update"); }   This. _pendingupdateavailablepackageinfo =PackageInfo; if( This. _systemupdatelistener) {     This. _systemupdatelistener.onupdateavailable (Packageinfo.type, Packageinfo.versi On, Packageinfo.description, Packagein    Fo.builddate, packageinfo.size); //Set NULL Since the event is fired.     This. _pendingupdateavailablepackageinfo =NULL; }
Send ' update-available ' event, in fact, is sent by systemappproxy a ' mozchromeevent ',
//Also send some accompanying information, such as selected patch size and patch type. Who is the receiver? Can be guessed, is the previous analysis of the Systemapp in the Updatemanager. if(!This . Sendupdateevent ("update-available" , aupdate)) {Log ("Unable to prompt for available update, forcing download"); This. Downloadupdate (aupdate); }},

  

(Ffos Gecko & Gaia) OTA-Processing Check results

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.