Merge m-c to inbound. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 18 Jul 2014 10:25:14 -0400
changeset 194922 ecdb409898a63ce33b71eb92446ffcec8c42f0bc
parent 194921 18138d562325084d5eda18da7d27de8e933f4950 (current diff)
parent 194808 330ba968ed6153bce59d4aa3dc74d27f1b7d3001 (diff)
child 194923 5e5eb00a12e9ada9c727bc93c69d15862bba0d67
child 194963 cd5e53d2aabd574c78dc6fd24481992b3ad71730
push id7810
push userryanvm@gmail.com
push dateFri, 18 Jul 2014 20:08:45 +0000
treeherderfx-team@85d5040f1ad2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone33.0a1
Merge m-c to inbound. a=merge
configure.in
dom/voicemail/nsIDOMMozVoicemailStatus.idl
media/webrtc/signaling/test/Makefile.in
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -346,17 +346,17 @@ let AdbController = {
       if (this.DEBUG) {
         this.debug("updateState: Waiting for all vars to be initialized");
       }
       return;
     }
 
     // Check if we have a remote debugging session going on. If so, we won't
     // disable adb even if the screen is locked.
-    let isDebugging = USBRemoteDebugger.isDebugging;
+    let isDebugging = RemoteDebugger.isDebugging;
     if (this.DEBUG) {
       this.debug("isDebugging=" + isDebugging);
     }
 
     // If USB Mass Storage, USB tethering, or a debug session is active,
     // then we don't want to disable adb in an automatic fashion (i.e.
     // when the screen locks or due to timeout).
     let sysUsbConfig = libcutils.property_get("sys.usb.config");
@@ -427,88 +427,55 @@ let AdbController = {
 };
 
 SettingsListener.observe("lockscreen.locked", false,
                          AdbController.setLockscreenState.bind(AdbController));
 SettingsListener.observe("lockscreen.enabled", false,
                          AdbController.setLockscreenEnabled.bind(AdbController));
 #endif
 
-(function() {
-  // Track these separately here so we can determine the correct value for the
-  // pref "devtools.debugger.remote-enabled", which is true when either mode of
-  // using DevTools is enabled.
-  let devtoolsUSB = false;
-  let devtoolsWiFi = false;
-
-  // Keep the old setting to not break people that won't have updated
-  // gaia and gecko.
-  SettingsListener.observe('devtools.debugger.remote-enabled', false,
-                           function(value) {
-    devtoolsUSB = value;
-    Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
-                               devtoolsUSB || devtoolsWiFi);
-    // This preference is consulted during startup
-    Services.prefs.savePrefFile(null);
-    try {
-      value ? USBRemoteDebugger.start() : USBRemoteDebugger.stop();
-    } catch(e) {
-      dump("Error while initializing USB devtools: "
-           + e + "\n" + e.stack + "\n");
-    }
+// Keep the old setting to not break people that won't have updated
+// gaia and gecko.
+SettingsListener.observe('devtools.debugger.remote-enabled', false, function(value) {
+  Services.prefs.setBoolPref('devtools.debugger.remote-enabled', value);
+  // This preference is consulted during startup
+  Services.prefs.savePrefFile(null);
+  try {
+    value ? RemoteDebugger.start() : RemoteDebugger.stop();
+  } catch(e) {
+    dump("Error while initializing devtools: " + e + "\n" + e.stack + "\n");
+  }
 
 #ifdef MOZ_WIDGET_GONK
-    AdbController.setRemoteDebuggerState(value);
+  AdbController.setRemoteDebuggerState(value);
 #endif
-  });
+});
 
-  SettingsListener.observe('debugger.remote-mode', false, function(value) {
-    if (['disabled', 'adb-only', 'adb-devtools'].indexOf(value) == -1) {
-      dump('Illegal value for debugger.remote-mode: ' + value + '\n');
-      return;
-    }
+SettingsListener.observe('debugger.remote-mode', false, function(value) {
+  if (['disabled', 'adb-only', 'adb-devtools'].indexOf(value) == -1) {
+    dump('Illegal value for debugger.remote-mode: ' + value + '\n');
+    return;
+  }
 
-    devtoolsUSB = value == 'adb-devtools';
-    Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
-                               devtoolsUSB || devtoolsWiFi);
-    // This preference is consulted during startup
-    Services.prefs.savePrefFile(null);
+  Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
+                             value == 'adb-devtools');
+  // This preference is consulted during startup
+  Services.prefs.savePrefFile(null);
 
-    try {
-      (value == 'adb-devtools') ? USBRemoteDebugger.start()
-                                : USBRemoteDebugger.stop();
-    } catch(e) {
-      dump("Error while initializing USB devtools: "
-           + e + "\n" + e.stack + "\n");
-    }
+  try {
+    (value == 'adb-devtools') ? RemoteDebugger.start()
+                              : RemoteDebugger.stop();
+  } catch(e) {
+    dump("Error while initializing devtools: " + e + "\n" + e.stack + "\n");
+  }
 
 #ifdef MOZ_WIDGET_GONK
-    AdbController.setRemoteDebuggerState(value != 'disabled');
+  AdbController.setRemoteDebuggerState(value != 'disabled');
 #endif
-  });
-
-  SettingsListener.observe('devtools.remote.wifi.enabled', false,
-                           function(value) {
-    devtoolsWiFi = value;
-    Services.prefs.setBoolPref('devtools.debugger.remote-enabled',
-                               devtoolsUSB || devtoolsWiFi);
-    // Allow remote debugging on non-local interfaces when WiFi debug is enabled
-    // TODO: Bug 1034411: Lock down to WiFi interface, instead of all interfaces
-    Services.prefs.setBoolPref('devtools.debugger.force-local', !value);
-    // This preference is consulted during startup
-    Services.prefs.savePrefFile(null);
-
-    try {
-      value ? WiFiRemoteDebugger.start() : WiFiRemoteDebugger.stop();
-    } catch(e) {
-      dump("Error while initializing WiFi devtools: "
-           + e + "\n" + e.stack + "\n");
-    }
-  });
-})();
+});
 
 // =================== Device Storage ====================
 SettingsListener.observe('device.storage.writable.name', 'sdcard', function(value) {
   if (Services.prefs.getPrefType('device.storage.writable.name') != Ci.nsIPrefBranch.PREF_STRING) {
     // We clear the pref because it used to be erroneously written as a bool
     // and we need to clear it before we can change it to have the correct type.
     Services.prefs.clearUserPref('device.storage.writable.name');
   }
@@ -685,19 +652,16 @@ let settingsToObserve = {
     prefName: 'layers.offmainthreadcomposition.log-animations',
     defaultValue: false
   },
   'debug.paint-flashing.enabled': {
     prefName: 'nglayout.debug.paint_flashing',
     defaultValue: false
   },
   'devtools.eventlooplag.threshold': 100,
-  'devtools.remote.wifi.visible': {
-    resetToPref: true
-  },
   'dom.mozApps.use_reviewer_certs': false,
   'layers.draw-borders': false,
   'layers.draw-tile-borders': false,
   'layers.dump': false,
   'layers.enable-tiles': true,
   'layers.simple-tiles': false,
   'privacy.donottrackheader.enabled': false,
   'ril.radio.disabled': false,
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -51,26 +51,16 @@ XPCOMUtils.defineLazyServiceGetter(Servi
                                    '@mozilla.org/focus-manager;1',
                                    'nsIFocusManager');
 
 XPCOMUtils.defineLazyGetter(this, 'DebuggerServer', function() {
   Cu.import('resource://gre/modules/devtools/dbg-server.jsm');
   return DebuggerServer;
 });
 
-XPCOMUtils.defineLazyGetter(this, 'devtools', function() {
-  const { devtools } =
-    Cu.import('resource://gre/modules/devtools/Loader.jsm', {});
-  return devtools;
-});
-
-XPCOMUtils.defineLazyGetter(this, 'discovery', function() {
-  return devtools.require('devtools/toolkit/discovery/discovery');
-});
-
 XPCOMUtils.defineLazyGetter(this, "ppmm", function() {
   return Cc["@mozilla.org/parentprocessmessagemanager;1"]
          .getService(Ci.nsIMessageListenerManager);
 });
 
 #ifdef MOZ_WIDGET_GONK
 XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
   Cu.import("resource://gre/modules/systemlibs.js");
@@ -811,21 +801,20 @@ let IndexedDBPromptHelper = {
 
     setTimeout(function() {
       observer.observe(null, responseTopic,
                        Ci.nsIPermissionManager.DENY_ACTION);
     }, 0);
   }
 }
 
-function RemoteDebugger() {}
-RemoteDebugger.prototype = {
+let RemoteDebugger = {
   _promptDone: false,
   _promptAnswer: false,
-  _listener: null,
+  _running: false,
 
   prompt: function debugger_prompt() {
     this._promptDone = false;
 
     shell.sendChromeEvent({
       "type": "remote-debugger-prompt"
     });
 
@@ -836,156 +825,118 @@ RemoteDebugger.prototype = {
     return this._promptAnswer;
   },
 
   handleEvent: function debugger_handleEvent(detail) {
     this._promptAnswer = detail.value;
     this._promptDone = true;
   },
 
-  initServer: function() {
-    if (DebuggerServer.initialized) {
-      return;
-    }
-
-    // Ask for remote connections.
-    DebuggerServer.init(this.prompt.bind(this));
-
-    // /!\ Be careful when adding a new actor, especially global actors.
-    // Any new global actor will be exposed and returned by the root actor.
-
-    // Add Firefox-specific actors, but prevent tab actors to be loaded in
-    // the parent process, unless we enable certified apps debugging.
-    let restrictPrivileges = Services.prefs.getBoolPref("devtools.debugger.forbid-certified-apps");
-    DebuggerServer.addBrowserActors("navigator:browser", restrictPrivileges);
-
-    /**
-     * Construct a root actor appropriate for use in a server running in B2G.
-     * The returned root actor respects the factories registered with
-     * DebuggerServer.addGlobalActor only if certified apps debugging is on,
-     * otherwise we used an explicit limited list of global actors
-     *
-     * * @param connection DebuggerServerConnection
-     *        The conection to the client.
-     */
-    DebuggerServer.createRootActor = function createRootActor(connection)
-    {
-      let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
-      let parameters = {
-        // We do not expose browser tab actors yet,
-        // but we still have to define tabList.getList(),
-        // otherwise, client won't be able to fetch global actors
-        // from listTabs request!
-        tabList: {
-          getList: function() {
-            return promise.resolve([]);
-          }
-        },
-        // Use an explicit global actor list to prevent exposing
-        // unexpected actors
-        globalActorFactories: restrictPrivileges ? {
-          webappsActor: DebuggerServer.globalActorFactories.webappsActor,
-          deviceActor: DebuggerServer.globalActorFactories.deviceActor,
-        } : DebuggerServer.globalActorFactories
-      };
-      let { RootActor } = devtools.require("devtools/server/actors/root");
-      let root = new RootActor(connection, parameters);
-      root.applicationType = "operating-system";
-      return root;
-    };
-
-#ifdef MOZ_WIDGET_GONK
-    DebuggerServer.on("connectionchange", function() {
-      AdbController.updateState();
-    });
-#endif
-  }
-};
-
-let USBRemoteDebugger = new RemoteDebugger();
-
-Object.defineProperty(USBRemoteDebugger, "isDebugging", {
-  get: function() {
-    if (!this._listener) {
+  get isDebugging() {
+    if (!this._running) {
       return false;
     }
 
     return DebuggerServer._connections &&
            Object.keys(DebuggerServer._connections).length > 0;
-  }
-});
+  },
+
+  // Start the debugger server.
+  start: function debugger_start() {
+    if (this._running) {
+      return;
+    }
 
-USBRemoteDebugger.start = function() {
-  if (this._listener) {
-    return;
-  }
+    if (!DebuggerServer.initialized) {
+      // Ask for remote connections.
+      DebuggerServer.init(this.prompt.bind(this));
 
-  this.initServer();
+      // /!\ Be careful when adding a new actor, especially global actors.
+      // Any new global actor will be exposed and returned by the root actor.
 
-  let portOrPath =
-    Services.prefs.getCharPref("devtools.debugger.unix-domain-socket") ||
-    "/data/local/debugger-socket";
+      // Add Firefox-specific actors, but prevent tab actors to be loaded in
+      // the parent process, unless we enable certified apps debugging.
+      let restrictPrivileges = Services.prefs.getBoolPref("devtools.debugger.forbid-certified-apps");
+      DebuggerServer.addBrowserActors("navigator:browser", restrictPrivileges);
 
-  try {
-    debug("Starting USB debugger on " + portOrPath);
-    this._listener = DebuggerServer.openListener(portOrPath);
-    // Temporary event, until bug 942756 lands and offers a way to know
-    // when the server is up and running.
-    Services.obs.notifyObservers(null, 'debugger-server-started', null);
-  } catch (e) {
-    debug('Unable to start USB debugger server: ' + e);
-  }
-};
+      /**
+       * Construct a root actor appropriate for use in a server running in B2G.
+       * The returned root actor respects the factories registered with
+       * DebuggerServer.addGlobalActor only if certified apps debugging is on,
+       * otherwise we used an explicit limited list of global actors
+       *
+       * * @param connection DebuggerServerConnection
+       *        The conection to the client.
+       */
+      DebuggerServer.createRootActor = function createRootActor(connection)
+      {
+        let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
+        let parameters = {
+          // We do not expose browser tab actors yet,
+          // but we still have to define tabList.getList(),
+          // otherwise, client won't be able to fetch global actors
+          // from listTabs request!
+          tabList: {
+            getList: function() {
+              return promise.resolve([]);
+            }
+          },
+          // Use an explicit global actor list to prevent exposing
+          // unexpected actors
+          globalActorFactories: restrictPrivileges ? {
+            webappsActor: DebuggerServer.globalActorFactories.webappsActor,
+            deviceActor: DebuggerServer.globalActorFactories.deviceActor,
+          } : DebuggerServer.globalActorFactories
+        };
+        let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
+        let { RootActor } = devtools.require("devtools/server/actors/root");
+        let root = new RootActor(connection, parameters);
+        root.applicationType = "operating-system";
+        return root;
+      };
 
-USBRemoteDebugger.stop = function() {
-  if (!this._listener) {
-    return;
-  }
+#ifdef MOZ_WIDGET_GONK
+      DebuggerServer.on("connectionchange", function() {
+        AdbController.updateState();
+      });
+#endif
+    }
 
-  try {
-    this._listener.close();
-    this._listener = null;
-  } catch (e) {
-    debug('Unable to stop USB debugger server: ' + e);
+    let path = Services.prefs.getCharPref("devtools.debugger.unix-domain-socket") ||
+               "/data/local/debugger-socket";
+    try {
+      DebuggerServer.openListener(path);
+      // Temporary event, until bug 942756 lands and offers a way to know
+      // when the server is up and running.
+      Services.obs.notifyObservers(null, 'debugger-server-started', null);
+      this._running = true;
+    } catch (e) {
+      dump('Unable to start debugger server: ' + e + '\n');
+    }
+  },
+
+  stop: function debugger_stop() {
+    if (!this._running) {
+      return;
+    }
+
+    if (!DebuggerServer.initialized) {
+      // Can this really happen if we are running?
+      this._running = false;
+      return;
+    }
+
+    try {
+      DebuggerServer.closeAllListeners();
+    } catch (e) {
+      dump('Unable to stop debugger server: ' + e + '\n');
+    }
+    this._running = false;
   }
-};
-
-let WiFiRemoteDebugger = new RemoteDebugger();
-
-WiFiRemoteDebugger.start = function() {
-  if (this._listener) {
-    return;
-  }
-
-  this.initServer();
-
-  try {
-    debug("Starting WiFi debugger");
-    this._listener = DebuggerServer.openListener(-1);
-    let port = this._listener.port;
-    debug("Started WiFi debugger on " + port);
-    discovery.addService("devtools", { port: port });
-  } catch (e) {
-    debug('Unable to start WiFi debugger server: ' + e);
-  }
-};
-
-WiFiRemoteDebugger.stop = function() {
-  if (!this._listener) {
-    return;
-  }
-
-  try {
-    discovery.removeService("devtools");
-    this._listener.close();
-    this._listener = null;
-  } catch (e) {
-    debug('Unable to stop WiFi debugger server: ' + e);
-  }
-};
+}
 
 let KeyboardHelper = {
   handleEvent: function keyboard_handleEvent(detail) {
     Keyboard.setLayouts(detail.layouts);
   }
 };
 
 // This is the backend for Gaia's screenshot feature.  Gaia requests a
@@ -1268,17 +1219,17 @@ window.addEventListener('ContentStart', 
   let volumeService = Cc["@mozilla.org/telephony/volume-service;1"]
                         .getService(Ci.nsIVolumeService);
 
   let stats = volumeService.createOrGetVolumeByPath(path).getStats();
 
   // We must set the size in KB, and keep a bit of free space.
   let size = Math.floor(stats.totalBytes / 1024) - 1024;
   Services.prefs.setIntPref("browser.cache.disk.capacity", size);
-}) ()
+})();
 #endif
 
 // Calling this observer will cause a shutdown an a profile reset.
 // Use eg. : Services.obs.notifyObservers(null, 'b2g-reset-profile', null);
 Services.obs.addObserver(function resetProfile(subject, topic, data) {
   Services.obs.removeObserver(resetProfile, topic);
 
   // Listening for 'profile-before-change2' which is late in the shutdown
--- a/b2g/components/ProcessGlobal.js
+++ b/b2g/components/ProcessGlobal.js
@@ -28,35 +28,91 @@ Cu.import("resource://gre/modules/CSPUti
 function debug(msg) {
   log(msg);
 }
 function log(msg) {
   // This file implements console.log(), so use dump().
   //dump('ProcessGlobal: ' + msg + '\n');
 }
 
+const gFactoryResetFile = "/persist/__post_reset_cmd__";
+
 function ProcessGlobal() {}
 ProcessGlobal.prototype = {
   classID: Components.ID('{1a94c87a-5ece-4d11-91e1-d29c29f21b28}'),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference]),
 
+  wipeDir: function(path) {
+    log("wipeDir " + path);
+    let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
+    dir.initWithPath(path);
+    if (!dir.exists() || !dir.isDirectory()) {
+      return;
+    }
+    let entries = dir.directoryEntries;
+    while (entries.hasMoreElements()) {
+      let file = entries.getNext().QueryInterface(Ci.nsIFile);
+      log("Deleting " + file.path);
+      try {
+        file.remove(true);
+      } catch(e) {}
+    }
+  },
+
+  processWipeFile: function(text) {
+    log("processWipeFile " + text);
+    let lines = text.split("\n");
+    lines.forEach((line) => {
+      log(line);
+      let params = line.split(" ");
+      if (params[0] == "wipe") {
+        this.wipeDir(params[1]);
+      }
+    });
+  },
+
+  cleanupAfterFactoryReset: function() {
+    log("cleanupAfterWipe start");
+
+    let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
+    file.initWithPath(gFactoryResetFile);
+    if (!file.exists()) {
+      debug("Nothing to wipe.")
+      return;
+    }
+
+    Cu.import("resource://gre/modules/osfile.jsm");
+    let promise = OS.File.read(gFactoryResetFile);
+    promise.then(
+      (array) => {
+        file.remove(false);
+        let decoder = new TextDecoder();
+        this.processWipeFile(decoder.decode(array));
+      }
+    );
+
+    log("cleanupAfterWipe end.");
+  },
+
   observe: function pg_observe(subject, topic, data) {
     switch (topic) {
     case 'app-startup': {
       Services.obs.addObserver(this, 'console-api-log-event', false);
       let inParent = Cc["@mozilla.org/xre/app-info;1"]
                        .getService(Ci.nsIXULRuntime)
                        .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
       if (inParent) {
         let ppmm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
                      .getService(Ci.nsIMessageListenerManager);
         ppmm.addMessageListener("getProfD", function(message) {
           return Services.dirsvc.get("ProfD", Ci.nsIFile).path;
         });
+
+        this.cleanupAfterFactoryReset();
       }
       break;
     }
     case 'console-api-log-event': {
       // Pipe `console` log messages to the nsIConsoleService which
       // writes them to logcat on Gonk.
       let message = subject.wrappedJSObject;
       let prefix = ('Content JS ' + message.level.toUpperCase() +
--- a/b2g/components/RecoveryService.js
+++ b/b2g/components/RecoveryService.js
@@ -43,40 +43,71 @@ let librecovery = (function() {
 
     FotaUpdateStatus:    FotaUpdateStatus,
     getFotaUpdateStatus: library.declare("getFotaUpdateStatus",
                                          ctypes.default_abi,
                                          ctypes.int,
                                          FotaUpdateStatus.ptr)
   };
 })();
+
+const gFactoryResetFile = "/persist/__post_reset_cmd__";
+
 #endif
 
 function RecoveryService() {}
 
 RecoveryService.prototype = {
   classID: RECOVERYSERVICE_CID,
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIRecoveryService]),
   classInfo: XPCOMUtils.generateCI({
     classID: RECOVERYSERVICE_CID,
     contractID: RECOVERYSERVICE_CONTRACTID,
     interfaces: [Ci.nsIRecoveryService],
     classDescription: "B2G Recovery Service"
   }),
 
-  factoryReset: function RS_factoryReset() {
+  factoryReset: function RS_factoryReset(reason) {
 #ifdef MOZ_WIDGET_GONK
-    // If this succeeds, then the device reboots and this never returns
-    if (librecovery.factoryReset() != 0) {
-      log("Error: Factory reset failed. Trying again after clearing cache.");
+    function doReset() {
+      // If this succeeds, then the device reboots and this never returns
+      if (librecovery.factoryReset() != 0) {
+        log("Error: Factory reset failed. Trying again after clearing cache.");
+      }
+      let cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
+                    .getService(Ci.nsICacheStorageService);
+      cache.clear();
+      if (librecovery.factoryReset() != 0) {
+        log("Error: Factory reset failed again");
+      }
     }
-    var cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"].getService(Ci.nsICacheStorageService);
-    cache.clear();
-    if (librecovery.factoryReset() != 0) {
-      log("Error: Factory reset failed again");
+
+    log("factoryReset " + reason);
+    if (reason == "wipe") {
+      let volumeService = Cc["@mozilla.org/telephony/volume-service;1"]
+                          .getService(Ci.nsIVolumeService);
+      let volNames = volumeService.getVolumeNames();
+      log("Found " + volNames.length + " volumes");
+      let text = "";
+      for (let i = 0; i < volNames.length; i++) {
+        let name = volNames.queryElementAt(i, Ci.nsISupportsString);
+        let volume = volumeService.getVolumeByName(name.data);
+        log("Got volume: " + name.data + " at " + volume.mountPoint);
+        text += "wipe " + volume.mountPoint + "\n";
+      }
+
+      Cu.import("resource://gre/modules/osfile.jsm");
+      let encoder = new TextEncoder();
+      let array = encoder.encode(text);
+      let promise = OS.File.writeAtomic(gFactoryResetFile, array,
+                                        { tmpPath: gFactoryResetFile + ".tmp" });
+
+      promise.then(doReset);
+    } else {
+      doReset();
     }
 #endif
     throw Cr.NS_ERROR_FAILURE;
   },
 
   installFotaUpdate: function RS_installFotaUpdate(updatePath) {
 #ifdef MOZ_WIDGET_GONK
     // If this succeeds, then the device reboots and this never returns
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,23 +14,23 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="0d616942c300d9fb142483210f1dda9096c9a9fc">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
@@ -123,15 +123,15 @@
   <project name="platform/system/security" path="system/security" revision="f48ff68fedbcdc12b570b7699745abb6e7574907"/>
   <project name="platform/system/vold" path="system/vold" revision="8de05d4a52b5a91e7336e6baa4592f945a6ddbea"/>
   <default remote="caf" revision="refs/tags/android-4.3_r2.1" sync-j="4"/>
   <!-- Emulator specific things -->
   <project name="android-development" path="development" remote="b2g" revision="dab55669da8f48b6e57df95d5af9f16b4a87b0b1"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
   <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="197cd9492b9fadaa915c5daf36ff557f8f4a8d1c"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
-  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="421d09bea0feda3934813f0f411d898f08108770"/>
+  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="683623c76338dccd65e698bfb5c4cfee8808d799"/>
   <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="9f28c4faea3b2f01db227b2467b08aeba96d9bec"/>
-  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
   <project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
 </manifest>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,25 +10,25 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,23 +14,23 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="0d616942c300d9fb142483210f1dda9096c9a9fc">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="227354333a185180b85471f2cc6abfb029e44718"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="e95b4ce22c825da44d14299e1190ea39a5260bde"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="471afab478649078ad7c75ec6b252481a59e19b8"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
@@ -138,13 +138,13 @@
   <project name="platform/hardware/qcom/camera" path="hardware/qcom/camera" revision="5e110615212302c5d798a3c223dcee458817651c"/>
   <project name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="280d29203b2aa30d713c5a6cc63d626e5a7df822"/>
   <project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="5dc48bd46f9589653f8bf297be5d73676f2e2867"/>
   <project name="platform/hardware/qcom/media" path="hardware/qcom/media" revision="8a0d0b0d9889ef99c4c6317c810db4c09295f15a"/>
   <project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="2208fa3537ace873b8f9ec2355055761c79dfd5f"/>
   <project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
   <project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
   <project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
-  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
   <project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
   <project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
   <project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>
 </manifest>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
         "git_revision": "", 
         "remote": "", 
         "branch": ""
     }, 
-    "revision": "4d18ecb3653e80055af734c17f35b2abd8fd2a19", 
+    "revision": "72a7f5cea568a34d5aa9e221a4cc546de856cace", 
     "repo_path": "/integration/gaia-central"
 }
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -12,22 +12,22 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="0d616942c300d9fb142483210f1dda9096c9a9fc">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="746bc48f34f5060f90801925dcdd964030c1ab6d"/>
   <project name="platform/development" path="development" revision="2460485184bc8535440bb63876d4e63ec1b4770c"/>
   <project name="device/common" path="device/common" revision="0dcc1e03659db33b77392529466f9eb685cdd3c7"/>
   <project name="device/sample" path="device/sample" revision="68b1cb978a20806176123b959cb05d4fa8adaea4"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="0d616942c300d9fb142483210f1dda9096c9a9fc">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,20 +12,20 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="cc67f31dc638c0b7edba3cf7e3d87cadf0ed52bf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
@@ -122,17 +122,17 @@
   <project name="platform/system/netd" path="system/netd" revision="56112dd7b811301b718d0643a82fd5cac9522073"/>
   <project name="platform/system/security" path="system/security" revision="f48ff68fedbcdc12b570b7699745abb6e7574907"/>
   <project name="platform/system/vold" path="system/vold" revision="8de05d4a52b5a91e7336e6baa4592f945a6ddbea"/>
   <default remote="caf" revision="refs/tags/android-4.3_r2.1" sync-j="4"/>
   <!-- Nexus 4 specific things -->
   <project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
   <project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
-  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="2cd3c7277621902b3749797eaaab618c4c80a58b"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
   <project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
   <project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>
   <project name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="b0a528d839cfd9d170d092fe3743b5252b4243a6"/>
   <project name="platform/hardware/qcom/bt" path="hardware/qcom/bt" revision="380945eaa249a2dbdde0daa4c8adb8ca325edba6"/>
   <project name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="6f3b0272cefaffeaed2a7d2bb8f633059f163ddc"/>
   <project name="platform/hardware/qcom/keymaster" path="hardware/qcom/keymaster" revision="16da8262c997a5a0d797885788a64a0771b26910"/>
   <project name="platform/hardware/qcom/media" path="hardware/qcom/media" revision="689b476ba3eb46c34b81343295fe144a0e81a18e"/>
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -12,22 +12,22 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="0d616942c300d9fb142483210f1dda9096c9a9fc">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="7fbcfbacf286c2a8e41a3a96b6d82f1541880617"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="48fe31ffcd3b9eca4eeb13cd0a73c1a28b45b295"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="7f792d756385bb894fba7645da59c67fe2c804bf"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="d99553937cc53b82965421da1ca950c17f16a324"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8b04b5aca4b0a894de40f4d53ae9750222d349a8"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="e0a9ac010df3afaa47ba107192c05ac8b5516435"/>
   <project name="platform/development" path="development" revision="a384622f5fcb1d2bebb9102591ff7ae91fe8ed2d"/>
   <project name="device/common" path="device/common" revision="7c65ea240157763b8ded6154a17d3c033167afb7"/>
   <project name="device/sample" path="device/sample" revision="c328f3d4409db801628861baa8d279fb8855892f"/>
--- a/configure.in
+++ b/configure.in
@@ -5016,27 +5016,31 @@ dnl enable once Signaling lands
     AC_DEFINE(MOZ_WEBRTC_SIGNALING)
 dnl enable once PeerConnection lands
     MOZ_PEERCONNECTION=1
     AC_DEFINE(MOZ_PEERCONNECTION)
     MOZ_SCTP=1
     MOZ_SRTP=1
     AC_DEFINE(MOZ_SCTP)
     AC_DEFINE(MOZ_SRTP)
+    if test -n "$MOZ_X11"; then
+      MOZ_WEBRTC_X11_LIBS="-lXext -lXdamage -lXfixes -lXcomposite"
+    fi
 else
     MOZ_SYNTH_PICO=
 fi
 
 AC_SUBST(MOZ_WEBRTC)
 AC_SUBST(MOZ_WEBRTC_LEAKING_TESTS)
 AC_SUBST(MOZ_WEBRTC_SIGNALING)
 AC_SUBST(MOZ_PEERCONNECTION)
 AC_SUBST(MOZ_WEBRTC_ASSERT_ALWAYS)
 AC_SUBST(MOZ_SCTP)
 AC_SUBST(MOZ_SRTP)
+AC_SUBST(MOZ_WEBRTC_X11_LIBS)
 
 dnl Use integers over floats for audio on B2G and Android, because audio
 dnl backends for those platforms don't support floats.
 if test "$OS_TARGET" = "Android"; then
     MOZ_SAMPLE_TYPE_S16=1
     AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
     AC_SUBST(MOZ_SAMPLE_TYPE_S16)
 else
@@ -8117,17 +8121,17 @@ if test "$MOZ_TREE_CAIRO"; then
     AC_SUBST(QUARTZ_FONT_FEATURE)
     AC_SUBST(PNG_FUNCTIONS_FEATURE)
     AC_SUBST(QT_SURFACE_FEATURE)
     AC_SUBST(TEE_SURFACE_FEATURE)
 
     MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
 
     if test "$MOZ_X11"; then
-        MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXext -lXdamage -lXfixes -lXcomposite -lXrender"
+        MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
     fi
 
     CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
 else
     PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
     MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
     MOZ_CAIRO_LIBS="$CAIRO_LIBS"
     PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
--- a/dom/base/nsPluginArray.h
+++ b/dom/base/nsPluginArray.h
@@ -8,19 +8,19 @@
 #define nsPluginArray_h___
 
 #include "nsTArray.h"
 #include "nsWeakReference.h"
 #include "nsIObserver.h"
 #include "nsWrapperCache.h"
 #include "nsPluginTags.h"
 #include "nsPIDOMWindow.h"
+#include "nsMimeTypeArray.h"
 
 class nsPluginElement;
-class nsMimeType;
 
 class nsPluginArray MOZ_FINAL : public nsIObserver,
                                 public nsSupportsWeakReference,
                                 public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsPluginArray,
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1993,17 +1993,16 @@ addExternalIface('MozRDFCompositeDataSou
                  notflattened=True)
 addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
 addExternalIface('MozSmsFilter', headerFile='nsIDOMSmsFilter.h')
 addExternalIface('MozSmsMessage')
 addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
                  notflattened=True)
 addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
                  headerFile='nsITreeColumns.h')
-addExternalIface('MozVoicemailStatus')
 addExternalIface('MozWakeLockListener', headerFile='nsIDOMWakeLockListener.h')
 addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
 addExternalIface('nsIBrowserDOMWindow', nativeType='nsIBrowserDOMWindow',
                  notflattened=True)
 addExternalIface('nsIControllers', nativeType='nsIControllers')
 addExternalIface('nsIDOMCrypto', nativeType='nsIDOMCrypto',
                  headerFile='Crypto.h')
 addExternalIface('nsIInputStreamCallback', nativeType='nsIInputStreamCallback',
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -24,16 +24,17 @@
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/LazyIdleThread.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/Services.h"
 
+#include "nsArrayUtils.h"
 #include "nsAutoPtr.h"
 #include "nsGlobalWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDOMFile.h"
@@ -3341,17 +3342,29 @@ nsDOMDeviceStorage::GetOrderedVolumeName
 {
   if (sVolumeNameCache && sVolumeNameCache->Length() > 0) {
     aVolumeNames.AppendElements(*sVolumeNameCache);
     return;
   }
 #ifdef MOZ_WIDGET_GONK
   nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID);
   if (vs) {
-    vs->GetVolumeNames(aVolumeNames);
+    nsCOMPtr<nsIArray> volNames;
+    vs->GetVolumeNames(getter_AddRefs(volNames));
+    uint32_t length = -1;
+    volNames->GetLength(&length);
+    for (uint32_t i = 0; i < length; i++) {
+      nsCOMPtr<nsISupportsString> str = do_QueryElementAt(volNames, i);
+      if (str) {
+        nsAutoString s;
+        if (NS_SUCCEEDED(str->GetData(s)) && !s.IsEmpty()) {
+          aVolumeNames.AppendElement(s);
+        }
+      }
+    }
 
     // If the volume sdcard exists, then we want it to be first.
 
     VolumeNameArray::index_type sdcardIndex;
     sdcardIndex = aVolumeNames.IndexOf(NS_LITERAL_STRING("sdcard"));
     if (sdcardIndex != VolumeNameArray::NoIndex && sdcardIndex > 0) {
       aVolumeNames.RemoveElementAt(sdcardIndex);
       aVolumeNames.InsertElementAt(0, NS_LITERAL_STRING("sdcard"));
--- a/dom/icc/tests/marionette/test_icc_match_mvno.js
+++ b/dom/icc/tests/marionette/test_icc_match_mvno.js
@@ -1,32 +1,39 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 30000;
 MARIONETTE_HEAD_JS = "icc_header.js";
 
-// Emulator's hard coded IMSI: 310260000000000
 let testCases = [
   // mvno type, mvno data, request success, expected result
+  // Emulator's hard coded IMSI: 310260000000000
   ["imsi", "3102600",            true, true               ],
   // x and X means skip the comparison.
   ["imsi", "31026xx0",           true, true               ],
   ["imsi", "310260x0x",          true, true               ],
   ["imsi", "310260X00",          true, true               ],
   ["imsi", "310260XX1",          true, false              ],
   ["imsi", "31026012",           true, false              ],
   ["imsi", "310260000000000",    true, true               ],
   ["imsi", "310260000000000123", true, false              ],
   ["imsi", "",                   false, "InvalidParameter"],
+  // Emulator's hard coded SPN:  Android
   ["spn",  "Android",            true, true               ],
   ["spn",  "",                   false, "InvalidParameter"],
   ["spn",  "OneTwoThree",        true, false              ],
-  // mvno type gid is not supported yet.
-  ["gid",  "A1",                 false, "ModeNotSupported"]
+  // Emulator's hard coded GID1: 5a4d
+  ["gid",  "",                   false, "InvalidParameter"],
+  ["gid",  "A1",                 true, false              ],
+  ["gid",  "5A",                 true, true               ],
+  ["gid",  "5a",                 true, true               ],
+  ["gid",  "5a4d",               true, true               ],
+  ["gid",  "5A4D",               true, true               ],
+  ["gid",  "5a4d6c",             true, false              ]
 ];
 
 function matchMvno(mvnoType, mvnoData, success, expectedResult) {
   log("matchMvno: " + mvnoType + ", " + mvnoData);
   let request = icc.matchMvno(mvnoType, mvnoData);
   request.onsuccess = function onsuccess() {
     log("onsuccess: " + request.result);
     ok(success, "onsuccess while error expected");
--- a/dom/nfc/tests/marionette/test_nfc_error_messages.js
+++ b/dom/nfc/tests/marionette/test_nfc_error_messages.js
@@ -22,17 +22,17 @@ let sessionTokens = [];
  * Enables nfc and RE0 then registers onpeerready callback and once
  * it's fired it creates mozNFCPeer and stores it for later.
  * After disabling nfc tries to do mozNFCPeer.sendNDEF which should
  * fail with NfcNotEnabledError.
  */
 function testNfcNotEnabledError() {
   log('testNfcNotEnabledError');
   toggleNFC(true)
-  .then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
+  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
   .then(registerAndFireOnpeerready)
   .then(() => toggleNFC(false))
   .then(() => sendNDEFExpectError(nfcPeers[0], 'NfcNotEnabledError'))
   .then(endTest)
   .catch(handleRejectedPromise);
 }
 
 /**
@@ -40,37 +40,37 @@ function testNfcNotEnabledError() {
  * it creates and stores mozNFCPeer. Disables nfc, enables nfc and
  * once again registers and fires new onpeerready callback and stores
  * mozNfcPeer. Than fires sendNDEF on the first stored peer which
  * should have invalid session token and we should get NfcBadSessionIdError
  */
 function testNfcBadSessionIdError() {
   log('testNfcBadSessionIdError');
   toggleNFC(true)
-  .then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
+  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
   .then(registerAndFireOnpeerready)
-  .then(() => emulator.deactivate())
-  .then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
+  .then(() => NCI.deactivate())
+  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
   .then(registerAndFireOnpeerready)
   // we have 2 peers in nfcPeers array, peer0 has old/invalid session token
   .then(() => sendNDEFExpectError(nfcPeers[0], 'NfcBadSessionIdError'))
   .then(() => toggleNFC(false))
   .then(endTest)
   .catch(handleRejectedPromise);
 }
 
 /**
  * Eables nfc and RE0, register onpeerready callback, once it's fired
  * it stores sessionToken. Using sessionToken cretes mozNFCTag and fires
  * mozNFCTag.connect('NDEF') which should result in NfcConnectError.
  */
 function testNfcConnectError() {
   log('testNfcConnectError');
   toggleNFC(true)
-  .then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
+  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
   .then(registerAndFireOnpeerready)
   .then(() => connectToNFCTagExpectError(sessionTokens[0],
                                          'NDEF',
                                          'NfcConnectError'))
   .then(() => toggleNFC(false))
   .then(endTest)
   .catch(handleRejectedPromise);
 }
@@ -78,17 +78,17 @@ function testNfcConnectError() {
 /**
  * Enables nfc and RE0, registers tech-discovered msg handler, once it's
  * fired set tech-lost handler and disables nfc. In both handlers checks
  * if error message is not present.
  */
 function testNoErrorInTechMsg() {
   log('testNoErrorInTechMsg');
   toggleNFC(true)
-  .then(() => emulator.activateRE(emulator.P2P_RE_INDEX_0))
+  .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0))
   .then(setTechDiscoveredHandler)
   .then(setAndFireTechLostHandler)
   .then(() => toggleNFC(false))
   .then(endTest)
   .catch(handleRejectedPromise);
 }
 
 function endTest() {
@@ -198,17 +198,17 @@ function setAndFireTechLostHandler() {
     window.navigator.mozSetMessageHandler('nfc-manager-tech-lost', null);
     deferred.resolve();
   };
 
   window.navigator.mozSetMessageHandler('nfc-manager-tech-lost',
                                         techLostHandler);
 
   // triggers tech-lost
-  emulator.deactivate();
+  NCI.deactivate();
   return deferred.promise;
 }
 
 let tests = [
   testNfcNotEnabledError,
   testNfcBadSessionIdError,
   testNfcConnectError,
   testNoErrorInTechMsg
--- a/dom/power/PowerManager.cpp
+++ b/dom/power/PowerManager.cpp
@@ -73,19 +73,19 @@ PowerManager::Reboot(ErrorResult& aRv)
   if (pmService) {
     pmService->Reboot();
   } else {
     aRv.Throw(NS_ERROR_UNEXPECTED);
   }
 }
 
 void
-PowerManager::FactoryReset()
+PowerManager::FactoryReset(mozilla::dom::FactoryResetReason& aReason)
 {
-  hal::FactoryReset();
+  hal::FactoryReset(aReason);
 }
 
 void
 PowerManager::PowerOff(ErrorResult& aRv)
 {
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
   if (pmService) {
--- a/dom/power/PowerManager.h
+++ b/dom/power/PowerManager.h
@@ -7,16 +7,17 @@
 
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsIDOMWakeLockListener.h"
 #include "nsIDOMWindow.h"
 #include "nsWeakReference.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
+#include "mozilla/dom/MozPowerManagerBinding.h"
 
 class nsPIDOMWindow;
 
 namespace mozilla {
 class ErrorResult;
 
 namespace dom {
 
@@ -40,17 +41,17 @@ public:
 
   // WebIDL
   nsIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
   void Reboot(ErrorResult& aRv);
-  void FactoryReset();
+  void FactoryReset(mozilla::dom::FactoryResetReason& aReason);
   void PowerOff(ErrorResult& aRv);
   void AddWakeLockListener(nsIDOMMozWakeLockListener* aListener);
   void RemoveWakeLockListener(nsIDOMMozWakeLockListener* aListener);
   void GetWakeLockState(const nsAString& aTopic, nsAString& aState,
                         ErrorResult& aRv);
   bool ScreenEnabled();
   void SetScreenEnabled(bool aEnabled);
   bool KeyLightEnabled();
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -268,26 +268,19 @@ MobileCellInfo.prototype = {
   cdmaSystemId: -1,
   cdmaNetworkId: -1
 };
 
 function VoicemailStatus(clientId) {
   this.serviceId = clientId;
 }
 VoicemailStatus.prototype = {
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozVoicemailStatus]),
+  QueryInterface: XPCOMUtils.generateQI([]),
   classID:        VOICEMAILSTATUS_CID,
-  classInfo:      XPCOMUtils.generateCI({
-    classID:          VOICEMAILSTATUS_CID,
-    classDescription: "VoicemailStatus",
-    flags:            Ci.nsIClassInfo.DOM_OBJECT,
-    interfaces:       [Ci.nsIDOMMozVoicemailStatus]
-  }),
-
-  // nsIDOMMozVoicemailStatus
+  contractID:     "@mozilla.org/voicemailstatus;1",
 
   serviceId: -1,
   hasMessages: false,
   messageCount: -1, // Count unknown.
   returnNumber: null,
   returnMessage: null
 };
 
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -2316,16 +2316,37 @@ RadioInterface.prototype = {
         case "spn":
           let spn = this.rilContext.iccInfo && this.rilContext.iccInfo.spn;
           if (!spn) {
             message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
             break;
           }
           message.result = spn == message.mvnoData;
           break;
+        case "gid":
+          this.workerMessenger.send("getGID1", null, (function(response) {
+            let gid = response.gid1;
+            let mvnoDataLength = message.mvnoData.length;
+
+            if (!gid) {
+              message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
+            } else if (mvnoDataLength > gid.length) {
+              message.result = false;
+            } else {
+              message.result =
+                gid.substring(0, mvnoDataLength).toLowerCase() ==
+                message.mvnoData.toLowerCase();
+            }
+
+            target.sendAsyncMessage("RIL:MatchMvno", {
+              clientId: this.clientId,
+              data: message
+            });
+          }).bind(this));
+          return;
         default:
           message.errorMsg = RIL.GECKO_ERROR_MODE_NOT_SUPPORTED;
       }
     }
 
     target.sendAsyncMessage("RIL:MatchMvno", {
       clientId: this.clientId,
       data: message
--- a/dom/system/gonk/RadioInterfaceLayer.manifest
+++ b/dom/system/gonk/RadioInterfaceLayer.manifest
@@ -13,13 +13,15 @@
 # limitations under the License.
 
 # RadioInterfaceLayer.js
 component {2d831c8d-6017-435b-a80c-e5d422810cea} RadioInterfaceLayer.js
 contract @mozilla.org/ril;1 {2d831c8d-6017-435b-a80c-e5d422810cea}
 category profile-after-change RadioInterfaceLayer @mozilla.org/ril;1
 
 # RILContentHelper.js
+component {5467f2eb-e214-43ea-9b89-67711241ec8e} RILContentHelper.js
 component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
 component {08a71987-408c-44ff-93fd-177c0a85c3dd} RILContentHelper.js
+contract @mozilla.org/voicemailstatus;1 {5467f2eb-e214-43ea-9b89-67711241ec8e}
 contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
 contract @mozilla.org/dom/icccardlock-error;1 {08a71987-408c-44ff-93fd-177c0a85c3dd}
 category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1
--- a/dom/system/gonk/nsIVolumeService.idl
+++ b/dom/system/gonk/nsIVolumeService.idl
@@ -1,34 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIVolume.idl"
 #include "nsIVolumeMountLock.idl"
 
-%{C++
-#include "nsTArray.h"
-#include "nsString.h"
-%}
-[ref] native nsStringTArrayRef(nsTArray<nsString>);
+interface nsIArray;
 
-[scriptable, uuid(a3b110cd-74f2-43cb-84c6-2a87713f2774)]
+[scriptable, uuid(cab99ab4-542e-4387-bd40-db6ef30e4f5f)]
 interface nsIVolumeService : nsISupports
 {
     nsIVolume getVolumeByName(in DOMString volName);
     nsIVolume getVolumeByPath(in DOMString path);
     nsIVolume createOrGetVolumeByPath(in DOMString path);
 
     void BroadcastVolume(in DOMString volName);
 
     nsIVolumeMountLock createMountLock(in DOMString volName);
 
-    [noscript] void getVolumeNames(in nsStringTArrayRef aVolNames);
+    nsIArray getVolumeNames();
 
     /* for test case only to simulate sdcard insertion/removal */
     void createFakeVolume(in DOMString name, in DOMString path);
     void SetFakeVolumeState(in DOMString name, in long state);
 };
 
 %{C++
 #define NS_VOLUMESERVICE_CID \
--- a/dom/system/gonk/nsVolumeService.cpp
+++ b/dom/system/gonk/nsVolumeService.cpp
@@ -7,19 +7,21 @@
 #include "Volume.h"
 #include "VolumeManager.h"
 #include "VolumeServiceIOThread.h"
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsDependentSubstring.h"
 #include "nsIDOMWakeLockListener.h"
+#include "nsIMutableArray.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIPowerManagerService.h"
+#include "nsISupportsPrimitives.h"
 #include "nsISupportsUtils.h"
 #include "nsIVolume.h"
 #include "nsIVolumeService.h"
 #include "nsLocalFile.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
@@ -251,27 +253,44 @@ nsVolumeService::CreateOrGetVolumeByPath
                                          false /* isSharing */,
                                          false /* isFormatting */,
                                          true  /* isFake */);
   vol.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsVolumeService::GetVolumeNames(nsTArray<nsString>& aVolNames)
+nsVolumeService::GetVolumeNames(nsIArray** aVolNames)
 {
+  NS_ENSURE_ARG_POINTER(aVolNames);
   MonitorAutoLock autoLock(mArrayMonitor);
 
+  *aVolNames = nullptr;
+
+  nsresult rv;
+  nsCOMPtr<nsIMutableArray> volNames =
+    do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   nsVolume::Array::size_type numVolumes = mVolumeArray.Length();
   nsVolume::Array::index_type volIndex;
   for (volIndex = 0; volIndex < numVolumes; volIndex++) {
     nsRefPtr<nsVolume> vol = mVolumeArray[volIndex];
-    aVolNames.AppendElement(vol->Name());
+    nsCOMPtr<nsISupportsString> isupportsString =
+      do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
+    NS_ENSURE_SUCCESS(rv, rv);
+
+    rv = isupportsString->SetData(vol->Name());
+    NS_ENSURE_SUCCESS(rv, rv);
+
+    rv = volNames->AppendElement(isupportsString, false);
+    NS_ENSURE_SUCCESS(rv, rv);
   }
 
+  NS_ADDREF(*aVolNames = volNames);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsVolumeService::CreateMountLock(const nsAString& aVolumeName, nsIVolumeMountLock **aResult)
 {
   nsCOMPtr<nsIVolumeMountLock> mountLock = nsVolumeMountLock::Create(aVolumeName);
   if (!mountLock) {
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -497,16 +497,17 @@ this.ICC_EF_ICCID  = 0x2fe2;
 this.ICC_EF_IMG    = 0x4f20;
 this.ICC_EF_PBR    = 0x4f30;
 this.ICC_EF_PLMNsel = 0x6f30; // PLMN for SIM
 this.ICC_EF_SST    = 0x6f38;
 this.ICC_EF_UST    = 0x6f38; // For USIM
 this.ICC_EF_ADN    = 0x6f3a;
 this.ICC_EF_FDN    = 0x6f3b;
 this.ICC_EF_SMS    = 0x6f3c;
+this.ICC_EF_GID1   = 0x6f3e;
 this.ICC_EF_MSISDN = 0x6f40;
 this.ICC_EF_CBMI   = 0x6f45;
 this.ICC_EF_SPN    = 0x6f46;
 this.ICC_EF_CBMID  = 0x6f48;
 this.ICC_EF_SDN    = 0x6f49;
 this.ICC_EF_EXT1   = 0x6f4a;
 this.ICC_EF_EXT2   = 0x6f4b;
 this.ICC_EF_EXT3   = 0x6f4c;
@@ -1227,16 +1228,17 @@ this.STK_SUPPORTED_TERMINAL_PROFILE = [
  */
 this.GECKO_ICC_SERVICES = {
   sim: {
     ADN: 2,
     FDN: 3,
     PLMNSEL: 7,
     MSISDN: 9,
     CBMI: 14,
+    GID1: 15,
     SPN: 17,
     SDN: 18,
     DATA_DOWNLOAD_SMS_CB: 25,
     DATA_DOWNLOAD_SMS_PP: 26,
     CBMIR: 30,
     BDN: 31,
     PNN: 51,
     OPL: 52,
@@ -1245,16 +1247,17 @@ this.GECKO_ICC_SERVICES = {
     SPDI: 56
   },
   usim: {
     FDN: 2,
     SDN: 4,
     BDN: 6,
     CBMI: 15,
     CBMIR: 16,
+    GID1: 17,
     SPN: 19,
     MSISDN: 21,
     DATA_DOWNLOAD_SMS_PP: 28,
     DATA_DOWNLOAD_SMS_CB: 29,
     PNN: 45,
     OPL: 46,
     MDN: 47,
     MWIS: 48,
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -1015,16 +1015,24 @@ RilObject.prototype = {
     }
     Buf.newParcel(REQUEST_GET_IMSI);
     Buf.writeInt32(1);
     Buf.writeString(aid || this.aid);
     Buf.sendParcel();
   },
 
   /**
+   * Retrieve ICC's GID1 field.
+   */
+  getGID1: function(options) {
+    options.gid1 = this.iccInfoPrivate.gid1;
+    this.sendChromeMessage(options);
+  },
+
+  /**
    * Read UICC Phonebook contacts.
    *
    * @param contactType
    *        "adn" or "fdn".
    * @param requestId
    *        Request id from RadioInterfaceLayer.
    */
   readICCContacts: function(options) {
@@ -11857,16 +11865,17 @@ ICCFileHelperObject.prototype = {
       case ICC_EF_SPDI:
       case ICC_EF_SST:
       case ICC_EF_PHASE:
       case ICC_EF_CBMI:
       case ICC_EF_CBMID:
       case ICC_EF_CBMIR:
       case ICC_EF_OPL:
       case ICC_EF_PNN:
+      case ICC_EF_GID1:
         return EF_PATH_MF_SIM + EF_PATH_DF_GSM;
       default:
         return null;
     }
   },
 
   /**
    * This function handles EFs for USIM.
@@ -11882,16 +11891,17 @@ ICCFileHelperObject.prototype = {
       case ICC_EF_SPN:
       case ICC_EF_SPDI:
       case ICC_EF_CBMI:
       case ICC_EF_CBMID:
       case ICC_EF_CBMIR:
       case ICC_EF_OPL:
       case ICC_EF_PNN:
       case ICC_EF_SMS:
+      case ICC_EF_GID1:
         return EF_PATH_MF_SIM + EF_PATH_ADF_USIM;
       default:
         // The file ids in USIM phone book entries are decided by the
         // card manufacturer. So if we don't match any of the cases
         // above and if its a USIM return the phone book path.
         return EF_PATH_MF_SIM + EF_PATH_DF_TELECOM + EF_PATH_DF_PHONEBOOK;
     }
   },
@@ -13026,16 +13036,23 @@ SimRecordHelperObject.prototype = {
 
       if (ICCUtilsHelper.isICCServiceAvailable("OPL")) {
         if (DEBUG) this.context.debug("OPL: OPL is available");
         this.readOPL();
       } else {
         if (DEBUG) this.context.debug("OPL: OPL is not available");
       }
 
+      if (ICCUtilsHelper.isICCServiceAvailable("GID1")) {
+        if (DEBUG) this.context.debug("GID1: GID1 is available");
+        this.readGID1();
+      } else {
+        if (DEBUG) this.context.debug("GID1: GID1 is not available");
+      }
+
       if (ICCUtilsHelper.isICCServiceAvailable("CBMI")) {
         this.readCBMI();
       } else {
         RIL.cellBroadcastConfigs.CBMI = null;
       }
       if (ICCUtilsHelper.isICCServiceAvailable("DATA_DOWNLOAD_SMS_CB")) {
         this.readCBMID();
       } else {
@@ -13617,16 +13634,33 @@ SimRecordHelperObject.prototype = {
 
     this.context.ICCIOHelper.loadLinearFixedEF({
       fileId: ICC_EF_SMS,
       recordNumber: recordNumber,
       callback: callback.bind(this),
       onerror: onerror
     });
   },
+
+  readGID1: function() {
+    function callback() {
+      let Buf = this.context.Buf;
+      let RIL = this.context.RIL;
+
+      RIL.iccInfoPrivate.gid1 = Buf.readString();
+      if (DEBUG) {
+        this.context.debug("GID1: " + RIL.iccInfoPrivate.gid1);
+      }
+    }
+
+    this.context.ICCIOHelper.loadTransparentEF({
+      fileId: ICC_EF_GID1,
+      callback: callback.bind(this)
+    });
+  },
 };
 
 function RuimRecordHelperObject(aContext) {
   this.context = aContext;
 }
 RuimRecordHelperObject.prototype = {
   context: null,
 
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -713,16 +713,18 @@ var interfaceNamesInGlobalScope =
     {name: "MozStkCommandEvent", b2g: true, pref: "dom.icc.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozTimeManager", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozVoicemail", b2g: true, pref: "dom.voicemail.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozVoicemailEvent", b2g: true, pref: "dom.voicemail.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    {name: "MozVoicemailStatus", b2g: true, pref: "dom.voicemail.enabled"},
+// IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWakeLock", b2g: true, pref: "dom.wakelock.enabled"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiCapabilities", b2g: true, permission: "wifi-manage"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiConnectionInfoEvent", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWifiStationInfoEvent", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/voicemail/Voicemail.cpp
+++ b/dom/voicemail/Voicemail.cpp
@@ -3,20 +3,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Voicemail.h"
 
 #include "mozilla/dom/MozVoicemailBinding.h"
 #include "mozilla/dom/MozVoicemailEvent.h"
-#include "nsIDOMMozVoicemailStatus.h"
+#include "mozilla/dom/MozVoicemailStatusBinding.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
+#include "nsContentUtils.h"
 #include "nsDOMClassInfo.h"
 #include "nsServiceManagerUtils.h"
 
 #define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"
 const char* kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces";
 
 using namespace mozilla::dom;
 
@@ -95,38 +96,44 @@ Voicemail::PassedOrDefaultServiceId(cons
     mProvider->GetVoicemailDefaultServiceId(&aResult);
   }
 
   return true;
 }
 
 // MozVoicemail WebIDL
 
-already_AddRefed<nsIDOMMozVoicemailStatus>
+already_AddRefed<MozVoicemailStatus>
 Voicemail::GetStatus(const Optional<uint32_t>& aServiceId,
                      ErrorResult& aRv) const
 {
   if (!mProvider) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   uint32_t id = 0;
   if (!PassedOrDefaultServiceId(aServiceId, id)) {
     aRv.Throw(NS_ERROR_INVALID_ARG);
     return nullptr;
   }
-  nsCOMPtr<nsIDOMMozVoicemailStatus> status;
-  nsresult rv = mProvider->GetVoicemailStatus(id, getter_AddRefs(status));
+  JSContext *cx = nsContentUtils::GetCurrentJSContext();
+  JS::Rooted<JS::Value> status(cx);
+  nsresult rv = mProvider->GetVoicemailStatus(id, &status);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return nullptr;
   }
-
-  return status.forget();
+  if (!status.isObject()) {
+    aRv.Throw(NS_ERROR_UNEXPECTED);
+    return nullptr;
+  }
+  JS::Rooted<JSObject*> statusObj(cx, &status.toObject());
+  nsRefPtr<MozVoicemailStatus> res = new MozVoicemailStatus(statusObj, GetParentObject());
+  return res.forget();
 }
 
 void
 Voicemail::GetNumber(const Optional<uint32_t>& aServiceId, nsString& aNumber,
                      ErrorResult& aRv) const
 {
   aNumber.SetIsVoid(true);
 
@@ -162,22 +169,26 @@ Voicemail::GetDisplayName(const Optional
   }
 
   aRv = mProvider->GetVoicemailDisplayName(id, aDisplayName);
 }
 
 // nsIVoicemailListener
 
 NS_IMETHODIMP
-Voicemail::NotifyStatusChanged(nsIDOMMozVoicemailStatus* aStatus)
+Voicemail::NotifyStatusChanged(JS::HandleValue aStatus)
 {
   MozVoicemailEventInit init;
   init.mBubbles = false;
   init.mCancelable = false;
-  init.mStatus = aStatus;
+  if (aStatus.isObject()) {
+    JSContext *cx = nsContentUtils::GetCurrentJSContext();
+    JS::Rooted<JSObject*> statusObj(cx, &aStatus.toObject());
+    init.mStatus = new MozVoicemailStatus(statusObj, GetParentObject());
+  }
 
   nsRefPtr<MozVoicemailEvent> event =
     MozVoicemailEvent::Constructor(this, NS_LITERAL_STRING("statuschanged"), init);
   return DispatchTrustedEvent(event);
 }
 
 nsresult
 NS_NewVoicemail(nsPIDOMWindow* aWindow, Voicemail** aVoicemail)
--- a/dom/voicemail/Voicemail.h
+++ b/dom/voicemail/Voicemail.h
@@ -11,21 +11,22 @@
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIVoicemailProvider.h"
 
 class JSObject;
 struct JSContext;
 
 class nsPIDOMWindow;
-class nsIDOMMozVoicemailStatus;
 
 namespace mozilla {
 namespace dom {
 
+class MozVoicemailStatus;
+
 class Voicemail MOZ_FINAL : public DOMEventTargetHelper
 {
   /**
    * Class Voicemail doesn't actually inherit nsIVoicemailListener. Instead, it
    * owns an nsIVoicemailListener derived instance mListener and passes it to
    * nsIVoicemailProvider. The onreceived events are first delivered to
    * mListener and then forwarded to its owner, Voicemail. See also bug 775997
    * comment #51.
@@ -45,17 +46,17 @@ public:
   GetParentObject() const
   {
     return GetOwner();
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
-  already_AddRefed<nsIDOMMozVoicemailStatus>
+  already_AddRefed<MozVoicemailStatus>
   GetStatus(const Optional<uint32_t>& aServiceId, ErrorResult& aRv) const;
 
   void
   GetNumber(const Optional<uint32_t>& aServiceId, nsString& aNumber,
             ErrorResult& aRv) const;
 
   void
   GetDisplayName(const Optional<uint32_t>& aServiceId, nsString& aDisplayName,
--- a/dom/voicemail/moz.build
+++ b/dom/voicemail/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
-    'nsIDOMMozVoicemailStatus.idl',
     'nsIVoicemailProvider.idl',
 ]
 
 XPIDL_MODULE = 'dom_voicemail'
 
 EXPORTS.mozilla.dom += [
     'Voicemail.h',
 ]
--- a/dom/voicemail/nsIVoicemailProvider.idl
+++ b/dom/voicemail/nsIVoicemailProvider.idl
@@ -1,26 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface nsIDOMMozVoicemailStatus;
-
 [scriptable, uuid(214b0963-da48-4859-a56c-f065a90e0403)]
 interface nsIVoicemailListener : nsISupports
 {
   /**
    * Called when a voicemail notification has been received by the network.
    *
    * @param status
    *        The new voicemail status
    */
-  void notifyStatusChanged(in nsIDOMMozVoicemailStatus status);
+  void notifyStatusChanged(in jsval status);
 };
 
 /**
  * XPCOM component (in the content process) that provides the voicemail
  * information.
  */
 [scriptable, uuid(1bbfff90-88f7-4d73-896e-9620a0000ab0)]
 interface nsIVoicemailProvider : nsISupports
@@ -30,12 +28,12 @@ interface nsIVoicemailProvider : nsISupp
   /**
    * Called when a content process registers receiving unsolicited messages from
    * RadioInterfaceLayer in the chrome process. Only a content process that has
    * the 'voicemail' permission is allowed to register.
    */
   void registerVoicemailMsg(in nsIVoicemailListener listener);
   void unregisterVoicemailMsg(in nsIVoicemailListener listener);
 
-  nsIDOMMozVoicemailStatus getVoicemailStatus(in unsigned long clientId);
+  jsval getVoicemailStatus(in unsigned long clientId);
   DOMString getVoicemailNumber(in unsigned long clientId);
   DOMString getVoicemailDisplayName(in unsigned long clientId);
 };
--- a/dom/webidl/MozPowerManager.webidl
+++ b/dom/webidl/MozPowerManager.webidl
@@ -1,25 +1,35 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 interface MozWakeLockListener;
 
 /**
+  * The reason for the factory reset.
+  * "normal" : simple factory reset.
+  * "wipe"   : will also attempt to wipe all user storage areas.
+  */
+enum FactoryResetReason {
+    "normal",
+    "wipe"
+};
+
+/**
  * This interface implements navigator.mozPower
  */
 interface MozPowerManager
 {
     [Throws]
     void    powerOff();
     [Throws]
     void    reboot();
-    void    factoryReset();
+    void    factoryReset(optional FactoryResetReason reason = "normal");
 
     /**
      * The listeners are notified when a resource changes its lock state to:
      *  - unlocked
      *  - locked but not visible
      *  - locked and visible
      */
     void    addWakeLockListener(MozWakeLockListener aListener);
--- a/dom/webidl/MozVoicemail.webidl
+++ b/dom/webidl/MozVoicemail.webidl
@@ -1,17 +1,14 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=40: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-// nsIDOMMozVoicemailStatus
-interface MozVoicemailStatus;
-
 [Pref="dom.voicemail.enabled"]
 interface MozVoicemail : EventTarget
 {
   /**
    * The current voicemail status of a specified service, or null when the
    * status is unknown.
    */
   [Throws]
--- a/dom/webidl/MozVoicemailEvent.webidl
+++ b/dom/webidl/MozVoicemailEvent.webidl
@@ -1,14 +1,13 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
-interface MozVoicemailStatus;
 
 [Constructor(DOMString type, optional MozVoicemailEventInit eventInitDict), Pref="dom.voicemail.enabled"]
 interface MozVoicemailEvent : Event
 {
   readonly attribute MozVoicemailStatus? status;
 };
 
 dictionary MozVoicemailEventInit : EventInit
rename from dom/voicemail/nsIDOMMozVoicemailStatus.idl
rename to dom/webidl/MozVoicemailStatus.webidl
--- a/dom/voicemail/nsIDOMMozVoicemailStatus.idl
+++ b/dom/webidl/MozVoicemailStatus.webidl
@@ -1,18 +1,18 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=40: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsISupports.idl"
+[JSImplementation="@mozilla.org/voicemailstatus;1",
+Pref="dom.voicemail.enabled"]
 
-[scriptable, uuid(efd352af-9eee-48dc-8e92-4d4fdbc89ecb)]
-interface nsIDOMMozVoicemailStatus : nsISupports
+interface MozVoicemailStatus 
 {
   readonly attribute unsigned long serviceId;
 
   /**
    * Whether or not there are messages waiting in the voicemail box
    */
   readonly attribute boolean hasMessages;
 
--- a/dom/webidl/MozWifiManager.webidl
+++ b/dom/webidl/MozWifiManager.webidl
@@ -9,17 +9,17 @@ enum WifiWPSMethod {
 };
 
 enum ConnectionStatus {
   "connecting",
   "authenticating",
   "associated",
   "connected",
   "disconnected",
-  "wps-timeout",
+  "wps-timedout",
   "wps-failed",
   "wps-overlapped",
   "connectingfailed"
 };
 
 dictionary WifiWPSInfo {
   WifiWPSMethod method;
   DOMString? pin;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -585,16 +585,17 @@ if CONFIG['MOZ_B2G_RIL']:
         'MozIcc.webidl',
         'MozIccManager.webidl',
         'MozMobileCellInfo.webidl',
         'MozMobileConnection.webidl',
         'MozMobileConnectionArray.webidl',
         'MozMobileConnectionInfo.webidl',
         'MozMobileNetworkInfo.webidl',
         'MozVoicemail.webidl',
+        'MozVoicemailStatus.webidl'
     ]
 
 if CONFIG['MOZ_NFC']:
     WEBIDL_FILES += [
          'MozNDEFRecord.webidl',
          'MozNFC.webidl',
          'MozNFCPeer.webidl',
          'MozNFCTag.webidl',
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1044,29 +1044,35 @@ var WifiManager = (function() {
       manager.state = "DISABLING";
       // Note these following calls ignore errors. If we fail to kill the
       // supplicant gracefully, then we need to continue telling it to die
       // until it does.
       let doDisableWifi = function() {
         manager.stopSupplicantCallback = (function () {
           wifiCommand.stopSupplicant(function (status) {
             wifiCommand.closeSupplicantConnection(function() {
+              manager.connectToSupplicant = false;
               manager.state = "UNINITIALIZED";
               netUtil.disableInterface(manager.ifname, function (ok) {
                 unloadDriver(WIFI_FIRMWARE_STATION, callback);
               });
             });
           });
         }).bind(this);
 
         let terminateEventCallback = (function() {
           handleEvent("CTRL-EVENT-TERMINATING");
         }).bind(this);
         createWaitForTerminateEventTimer(terminateEventCallback);
 
+        // We are going to terminate the connection between wpa_supplicant.
+        // Stop the polling timer immediately to prevent connection info update
+        // command blocking in control thread until socket timeout.
+        notify("stopconnectioninfotimer");
+
         wifiCommand.terminateSupplicant(function (ok) {
           manager.connectionDropped(function () {
           });
         });
       }
 
       if (p2pSupported) {
         p2pManager.setEnabled(false, { onDisabled: doDisableWifi });
@@ -1190,17 +1196,17 @@ var WifiManager = (function() {
   manager.setNetworkConfiguration = function(config, callback) {
     var netId = config.netId;
     var done = 0;
     var errors = 0;
 
     function hasValidProperty(name) {
       return ((name in config) &&
                config[name] != null &&
-               (["password", "wep_key0", "psk"].indexOf(name) !== -1 ||
+               (["password", "wep_key0", "psk"].indexOf(name) === -1 ||
                 config[name] !== '*'));
     }
 
     for (var n = 0; n < networkConfigurationFields.length; ++n) {
       let fieldName = networkConfigurationFields[n];
       if (!hasValidProperty(fieldName)) {
         ++done;
       } else {
@@ -2324,16 +2330,20 @@ function WifiWorker() {
       self.wantScanResults = [];
     });
   };
 
   WifiManager.onstationinfoupdate = function() {
     self._fireEvent("stationinfoupdate", { station: this.station });
   };
 
+  WifiManager.onstopconnectioninfotimer = function() {
+    self._stopConnectionInfoTimer();
+  };
+
   // Read the 'wifi.enabled' setting in order to start with a known
   // value at boot time. The handle() will be called after reading.
   //
   // nsISettingsServiceCallback implementation.
   var initWifiEnabledCb = {
     handle: function handle(aName, aResult) {
       if (aName !== SETTINGS_WIFI_ENABLED)
         return;
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -1200,20 +1200,20 @@ GetFMBandSettings(FMRadioCountry aCountr
       break;
     default:
       MOZ_ASSERT(0);
       break;
     };
     return settings;
 }
 
-void FactoryReset()
+void FactoryReset(mozilla::dom::FactoryResetReason& aReason)
 {
   AssertMainThread();
-  PROXY_IF_SANDBOXED(FactoryReset());
+  PROXY_IF_SANDBOXED(FactoryReset(aReason));
 }
 
 void
 StartDiskSpaceWatcher()
 {
   AssertMainProcess();
   AssertMainThread();
   PROXY_IF_SANDBOXED(StartDiskSpaceWatcher());
--- a/hal/Hal.h
+++ b/hal/Hal.h
@@ -9,16 +9,17 @@
 
 #include "mozilla/hal_sandbox/PHal.h"
 #include "mozilla/HalTypes.h"
 #include "base/basictypes.h"
 #include "mozilla/Observer.h"
 #include "mozilla/Types.h"
 #include "nsTArray.h"
 #include "prlog.h"
+#include "mozilla/dom/MozPowerManagerBinding.h"
 #include "mozilla/dom/battery/Types.h"
 #include "mozilla/dom/network/Types.h"
 #include "mozilla/dom/power/Types.h"
 #include "mozilla/hal_sandbox/PHal.h"
 #include "mozilla/dom/ScreenOrientation.h"
 #include "mozilla/HalScreenConfiguration.h"
 
 /*
@@ -570,17 +571,17 @@ hal::FMRadioSettings GetFMBandSettings(h
  *
  * This API is currently only allowed to be used from the main process.
  */
 void StartForceQuitWatchdog(hal::ShutdownMode aMode, int32_t aTimeoutSecs);
 
 /**
  * Perform Factory Reset to wipe out all user data.
  */
-void FactoryReset();
+void FactoryReset(mozilla::dom::FactoryResetReason& aReason);
 
 /**
  * Start monitoring the status of gamepads attached to the system.
  */
 void StartMonitoringGamepadStatus();
 
 /**
  * Stop monitoring the status of gamepads attached to the system.
--- a/hal/fallback/FallbackFactoryReset.cpp
+++ b/hal/fallback/FallbackFactoryReset.cpp
@@ -6,13 +6,13 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Hal.h"
 
 namespace mozilla {
 namespace hal_impl {
 
 void
-FactoryReset()
+FactoryReset(mozilla::dom::FactoryResetReason&)
 {}
 
 } // namespace hal_impl
 } // namespace mozilla
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -100,16 +100,17 @@
 #define BATTERY_CHARGING_ARGB 0x00FF0000
 #endif
 #ifndef BATTERY_FULL_ARGB
 #define BATTERY_FULL_ARGB 0x0000FF00
 #endif
 
 using namespace mozilla;
 using namespace mozilla::hal;
+using namespace mozilla::dom;
 
 namespace mozilla {
 namespace hal_impl {
 
 struct LightConfiguration {
   hal::LightType light;
   hal::LightMode mode;
   hal::FlashMode flash;
@@ -1686,22 +1687,26 @@ SetCurrentThreadPriority(ThreadPriority 
     }
     default:
       LOG("Unrecognized thread priority %d; Doing nothing", aThreadPriority);
       return;
   }
 }
 
 void
-FactoryReset()
+FactoryReset(FactoryResetReason& aReason)
 {
   nsCOMPtr<nsIRecoveryService> recoveryService =
     do_GetService("@mozilla.org/recovery-service;1");
   if (!recoveryService) {
     NS_WARNING("Could not get recovery service!");
     return;
   }
 
-  recoveryService->FactoryReset();
+  if (aReason == FactoryResetReason::Wipe) {
+    recoveryService->FactoryReset("wipe");
+  } else {
+    recoveryService->FactoryReset("normal");
+  }
 }
 
 } // hal_impl
 } // mozilla
--- a/hal/gonk/nsIRecoveryService.idl
+++ b/hal/gonk/nsIRecoveryService.idl
@@ -1,32 +1,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-[scriptable, uuid(acb93ff8-aa6d-4bc8-bedd-2a6a3b802a74)]
+[scriptable, uuid(bc24fb33-a0c1-49ca-aa43-05f167e02fb6)]
 interface nsIRecoveryService : nsISupports
 {
   /**
    * Possible values of fotaStatus.result. These should stay in sync with
    * librecovery/librecovery.h
    */
   const long FOTA_UPDATE_UNKNOWN = 0;
   const long FOTA_UPDATE_FAIL    = 1;
   const long FOTA_UPDATE_SUCCESS = 2;
 
   /**
    * Uses recovery to wipe the data and cache partitions. If this call is
    * successful, the device should reboot before the function call ever returns.
    *
    * @throws NS_ERROR_FAILURE when rebooting into recovery fails for some reason.
    */
-  void factoryReset();
+  void factoryReset(in string reason);
 
   /**
    * Use recovery to install an OTA update.zip. If this call is
    * successful, the device should reboot before the function call ever returns.
    *
    * @throws NS_ERROR_FAILURE when rebooting into recovery fails for some reason.
    */
   void installFotaUpdate(in string updatePath);
--- a/hal/sandbox/PHal.ipdl
+++ b/hal/sandbox/PHal.ipdl
@@ -154,17 +154,17 @@ parent:
       returns (bool allowed);
     UnlockScreenOrientation();
  
     EnableSwitchNotifications(SwitchDevice aDevice);
     DisableSwitchNotifications(SwitchDevice aDevice);
     sync GetCurrentSwitchState(SwitchDevice aDevice)
       returns (SwitchState aState);
 
-    FactoryReset();
+    FactoryReset(nsString aReason);
 
 child:
     NotifySensorChange(SensorData aSensorData);
 
 parent:
     EnableSensorNotifications(SensorType aSensor);
     DisableSensorNotifications(SensorType aSensor);
 
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -421,19 +421,23 @@ GetFMRadioSignalStrength()
 
 void
 CancelFMRadioSeek()
 {
   NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts.");
 }
 
 void
-FactoryReset()
+FactoryReset(FactoryResetReason& aReason)
 {
-  Hal()->SendFactoryReset();
+  if (aReason == FactoryResetReason::Normal) {
+    Hal()->SendFactoryReset(NS_LITERAL_STRING("normal"));
+  } else if (aReason == FactoryResetReason::Wipe) {
+    Hal()->SendFactoryReset(NS_LITERAL_STRING("wipe"));
+  }
 }
 
 void
 StartDiskSpaceWatcher()
 {
   NS_RUNTIMEABORT("StartDiskSpaceWatcher() can't be called from sandboxed contexts.");
 }
 
@@ -836,22 +840,33 @@ public:
   }
 
   void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
   {
     unused << SendNotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
   }
 
   virtual bool
-  RecvFactoryReset()
+  RecvFactoryReset(const nsString& aReason) MOZ_OVERRIDE
   {
     if (!AssertAppProcessPermission(this, "power")) {
       return false;
     }
-    hal::FactoryReset();
+
+    FactoryResetReason reason = FactoryResetReason::Normal;
+    if (aReason.EqualsLiteral("normal")) {
+      reason = FactoryResetReason::Normal;
+    } else if (aReason.EqualsLiteral("wipe")) {
+      reason = FactoryResetReason::Wipe;
+    } else {
+      // Invalid factory reset reason. That should never happen.
+      return false;
+    }
+
+    hal::FactoryReset(reason);
     return true;
   }
 
   virtual mozilla::ipc::IProtocol*
   CloneProtocol(Channel* aChannel,
                 mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE
   {
     ContentParent* contentParent = aCtx->GetContentParent();
--- a/media/webrtc/signaling/test/Makefile.in
+++ b/media/webrtc/signaling/test/Makefile.in
@@ -1,16 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 LIBS = \
   $(XPCOM_LIBS) \
   $(NSPR_LIBS) \
   $(NSS_LIBS) \
+  $(MOZ_WEBRTC_X11_LIBS) \
   $(REALTIME_LIBS) \
   $(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
   $(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/signalingtest/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/signalingtest/signaling_sipcc/$(LIB_PREFIX)sipcc.$(LIB_SUFFIX) \
   $(DEPTH)/layout/media/webrtc/$(LIB_PREFIX)webrtc.$(LIB_SUFFIX) \
   $(DEPTH)/layout/media/$(LIB_PREFIX)gkmedias.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/trunk/testing/gtest_gtest/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) \
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -649,20 +649,16 @@ pref("devtools.defaultColorUnit", "hex")
 
 // Used for devtools debugging
 pref("devtools.dump.emit", false);
 
 // Disable device discovery logging
 pref("devtools.discovery.log", false);
 // Disable scanning for DevTools devices via WiFi
 pref("devtools.remote.wifi.scan", false);
-// Hide UI options for controlling device visibility over WiFi
-// N.B.: This does not set whether the device can be discovered via WiFi, only
-// whether the UI control to make such a choice is shown to the user
-pref("devtools.remote.wifi.visible", false);
 
 // view source
 pref("view_source.syntax_highlight", true);
 pref("view_source.wrap_long_lines", false);
 pref("view_source.editor.external", false);
 pref("view_source.editor.path", "");
 // allows to add further arguments to the editor; use the %LINE% placeholder
 // for jumping to a specific line (e.g. "/line:%LINE%" or "--goto %LINE%")
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -46,16 +46,17 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 OS_LIBS += -lcups
 endif
 
 EXTRA_DSO_LDOPTS += \
   $(LIBS_DIR) \
   $(MOZ_JS_LIBS) \
   $(NSS_LIBS) \
   $(MOZ_CAIRO_OSLIBS) \
+  $(MOZ_WEBRTC_X11_LIBS) \
   $(MOZ_APP_EXTRA_LIBS) \
   $(SQLITE_LIBS) \
   $(NULL)
 
 ifdef ENABLE_INTL_API
 ifdef JS_SHARED_LIBRARY
 EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS)
 endif
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini
@@ -7,11 +7,12 @@ support-files =
   data/**
   xpcshell-shared.ini
 
 [include:xpcshell-shared.ini]
 
 [test_addon_path_service.js]
 [test_asyncBlocklistLoad.js]
 [test_DeferredSave.js]
-[test_XPIcancel.js]
 [test_metadata_update.js]
 [test_openh264.js]
+run-if = appname == "firefox"
+[test_XPIcancel.js]