Bug 764684: Enable update staging for B2G, and skip the update.test check. r=ehsan
authorMarshall Culpepper <marshall@mozilla.com>
Mon, 27 Aug 2012 12:15:12 -0300
changeset 105603 bbc3d49c19bac3decc806720ff05d9b641f33add
parent 105602 a6890a3b8f7287f642e72f7b8f7d8df85196b39d
child 105604 34c6bb1b619fc950f35974c5bff9023906e62d20
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersehsan
bugs764684
milestone17.0a1
Bug 764684: Enable update staging for B2G, and skip the update.test check. r=ehsan
b2g/app/b2g.js
toolkit/mozapps/update/nsUpdateService.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -439,16 +439,17 @@ pref("marionette.defaultPrefs.port", 282
 #endif
 
 #ifdef MOZ_UPDATER
 pref("app.update.enabled", true);
 pref("app.update.auto", true);
 pref("app.update.silent", true);
 pref("app.update.mode", 0);
 pref("app.update.incompatible.mode", 0);
+pref("app.update.stage.enabled", true);
 pref("app.update.service.enabled", true);
 
 // The URL hosting the update manifest.
 pref("app.update.url", "http://update.boot2gecko.org/m2.5/updates.xml");
 // Interval at which update manifest is fetched.  In units of seconds.
 pref("app.update.interval", 3600); // 1 hour
 // First interval to elapse before checking for update.  In units of
 // milliseconds.  Capped at 10 seconds.
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -72,16 +72,24 @@ const KEY_GRED            = "GreD";
 #elifdef ANDROID
 #define USE_UPDROOT
 #endif
 
 #ifdef USE_UPDROOT
 const KEY_UPDROOT         = "UpdRootD";
 #endif
 
+#ifdef XP_WIN
+#define SKIP_STAGE_UPDATES_TEST
+#elifdef MOZ_WIDGET_GONK
+// In Gonk, the updater will remount the /system partition to move staged files
+// into place, so we skip the test here to keep things isolated.
+#define SKIP_STAGE_UPDATES_TEST
+#endif
+
 const DIR_UPDATES         = "updates";
 #ifdef XP_MACOSX
 const UPDATED_DIR         = "Updated.app";
 #else
 const UPDATED_DIR         = "updated";
 #endif
 const FILE_UPDATE_STATUS  = "update.status";
 const FILE_UPDATE_VERSION = "update.version";
@@ -438,17 +446,17 @@ XPCOMUtils.defineLazyGetter(this, "gCanA
 
 XPCOMUtils.defineLazyGetter(this, "gCanStageUpdates", function aus_gCanStageUpdates() {
   // If background updates are disabled, then just bail out!
   if (!getPref("getBoolPref", PREF_APP_UPDATE_STAGE_ENABLED, false)) {
     LOG("gCanStageUpdates - staging updates is disabled by preference " + PREF_APP_UPDATE_STAGE_ENABLED);
     return false;
   }
 
-#ifdef XP_WIN
+#ifdef SKIP_STAGE_UPDATES_TEST
   if (getPref("getBoolPref", PREF_APP_UPDATE_SERVICE_ENABLED, false)) {
     // No need to perform directory write checks, the maintenance service will
     // be able to write to all directories.
     LOG("gCanStageUpdates - able to stage updates because we'll use the service");
     return true;
   }
 #endif