Closed Bug 746754 Opened 12 years ago Closed 12 years ago

Show prompts when checking for updates and downloading updates

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jstraus, Assigned: jstraus)

Details

Attachments

(1 file)

Bug 740720 shows a prompt before applying an update.  This bug adds in the other possible prompts.
Assignee: nobody → jstraus
Depends on: 740720
The additional changes.  Also there is a pull request for the gaia changes.
Attachment #616763 - Flags: review?(jones.chris.g)
Jim, can you update this patch? I'll have some time to review
Comment on attachment 616763 [details] [diff] [review]
Adding additional update prompts

Review of attachment 616763 [details] [diff] [review]:
-----------------------------------------------------------------

::: b2g/components/UpdatePrompt.js
@@ +40,5 @@
> +    browser.content.dispatchEvent(evt);
> +  },
> +
> +  showUpdateAvailable: function UP_showUpdateAvailable(aUpdate) {
> +    gUpdate = aUpdate;

Do not use gUpdate (See review of bug 740720)

@@ +48,5 @@
> +    let evt = browser.content.document.createEvent("CustomEvent");
> +    evt.initCustomEvent("mozChromeEvent", true, true,
> +                        {"type": "updates-check"});
> +    browser.content.dispatchEvent(evt);
> +  },

checkForUpdates seems duplicated?

@@ +78,4 @@
>  
>    handleEvent: function (e) {
>      let browser = Services.wm.getMostRecentWindow("navigator:browser");
>      browser.content.removeEventListener("mozContentEvent", this.handleEvent);

You need to have a unique id associated to your mozChromeEvent to be sure to not react on all mozContentEvent. Have somewhere a method to generate a uuid and use it to make sure the message you receive is the message you expect.

@@ +85,5 @@
>        gUpdate = null;
> +    } else if (e.detail.type == "download-update") {
> +      this.downloadUpdate(gUpdate);
> +      gUpdate = null;
> +    } else if (e.detail.type == "check-for-update") {

Where does this message comes from? Is it initate by the content? If so your code does not listen for mozContentEvent in a permanent fashion so I don't understand how this code works.

@@ +87,5 @@
> +      this.downloadUpdate(gUpdate);
> +      gUpdate = null;
> +    } else if (e.detail.type == "check-for-update") {
> +      this.checkNowForUpdates();
> +      gUpdate = null;

switch(e.detail.type) {
  case "updates-now":
    ...
    break;
  case "download-update":
    ...
    break;
   ...
}
Attachment #616763 - Flags: review?(jones.chris.g) → review-
See tracking bug 737598 to follow update prompt and interaction bugs, this one is worded a little vaguely.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
No longer depends on: 740720
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: