Bug 793243 - Eng builds (VARIANT=) fail to show homescreen on otoro [r=dhylands]
authorFabrice Desré <fabrice@mozilla.com>
Fri, 21 Sep 2012 20:40:03 -0700
changeset 107912 f6472d712439d3380070f9f036121ba764b1e680
parent 107911 7baf45b0160386025e1d8b81ef76982999042269
child 107913 a713d74f4cd2b475c1561a488da96a4a2c2ac3c0
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersdhylands
bugs793243
milestone18.0a1
Bug 793243 - Eng builds (VARIANT=) fail to show homescreen on otoro [r=dhylands]
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -147,17 +147,21 @@ let DOMApplicationRegistry = {
     let runUpdate = Services.prefs.getBoolPref("dom.mozApps.runUpdate");
     Services.prefs.setBoolPref("dom.mozApps.runUpdate", false);
 
     // 1.
     this.loadCurrentRegistry((function() {
 #ifdef MOZ_WIDGET_GONK
     // if first run, merge the system apps.
     if (runUpdate) {
-      let file = FileUtils.getFile("coreAppsDir", ["webapps", "webapps.json"], false);
+      let file;
+      try {
+        file = FileUtils.getFile("coreAppsDir", ["webapps", "webapps.json"], false);
+      } catch(e) { }
+
       if (file && file.exists) {
         // 2.a
         this._loadJSONAsync(file, (function loadCoreRegistry(aData) {
           if (!aData) {
             this.registerAppsHandlers();
             return;
           }
 
@@ -189,16 +193,18 @@ let DOMApplicationRegistry = {
               }
             }
             // XXXX once bug 758269 is ready, revoke perms for this app
             // let localId = this.webapps[id].localId;
             // installPermissions(localId);
           }
           this.registerAppsHandlers();
         }).bind(this));
+      } else {
+        this.registerAppsHandlers();
       }
     } else {
       this.registerAppsHandlers();
     }
 #else
     this.registerAppsHandlers();
 #endif
     }).bind(this));
@@ -376,17 +382,18 @@ let DOMApplicationRegistry = {
           converter.charset = "UTF-8";
 
           data = JSON.parse(converter.ConvertToUnicode(NetUtil.readInputStreamToString(aStream,
                                                             aStream.available()) || ""));
           aStream.close();
           if (aCallback)
             aCallback(data);
         } catch (ex) {
-          Cu.reportError("DOMApplicationRegistry: Could not parse JSON: " + ex);
+          Cu.reportError("DOMApplicationRegistry: Could not parse JSON: " +
+                         aFile.path + " " + ex);
           if (aCallback)
             aCallback(null);
         }
       });
     } catch (ex) {
       Cu.reportError("DOMApplicationRegistry: Could not read from " +
                      aFile.path + " : " + ex);
       if (aCallback)