Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 07 Jun 2013 08:01:37 -0400
changeset 145849 aa9a38e68dcfe5b66eede1654d01334b2d242b45
parent 145848 728ac315adcb9fe6cb6070e1f796952f10605429 (current diff)
parent 145755 1c199f8871abb3c11eaedea682c3406b6a66f4bf (diff)
child 145850 0ae723d89b73de78fba7147ed819c905e93203bd
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to inbound.
b2g/app/b2g.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -408,16 +408,17 @@ pref("services.push.requestTimeout", 100
 pref("services.push.udp.wakeupEnabled", true);
 // port on which UDP server socket is bound
 pref("services.push.udp.port", 2442);
 
 // NetworkStats
 #ifdef MOZ_B2G_RIL
 pref("dom.mozNetworkStats.enabled", true);
 pref("ril.lastKnownMcc", "724");
+pref("ril.cellbroadcast.disabled", false);
 #endif
 
 // WebSettings
 pref("dom.mozSettings.enabled", true);
 pref("dom.navigator-property.disable.mozSettings", false);
 pref("dom.mozPermissionSettings.enabled", true);
 
 // controls if we want camera support
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -164,16 +164,21 @@ SettingsListener.observe('language.curre
     function(value) {
       Services.prefs.setBoolPref('dom.sms.strict7BitEncoding', value);
   });
 
   SettingsListener.observe('ril.sms.requestStatusReport.enabled', true,
     function(value) {
       Services.prefs.setBoolPref('dom.sms.requestStatusReport', value);
   });
+
+  SettingsListener.observe('ril.cellbroadcast.disabled', false,
+    function(value) {
+      Services.prefs.setBoolPref('ril.cellbroadcast.disabled', value);
+  });
 })();
 
 //=================== DeviceInfo ====================
 Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
 Components.utils.import('resource://gre/modules/ctypes.jsm');
 (function DeviceInfoToSettings() {
   XPCOMUtils.defineLazyServiceGetter(this, 'gSettingsService',
                                      '@mozilla.org/settingsService;1',
--- a/b2g/test/emulator.manifest
+++ b/b2g/test/emulator.manifest
@@ -1,6 +1,6 @@
 [{
-"size": 677339898,
-"digest": "af1d883664bf4f02637060855d76026cceffd28a796ab3d65e16f1b0b6d1a8d5bb634388152ba63ecbfa2fbb1bd59317c0cfd508e163eaf950923b6b999369bc",
+"size": 746441603,
+"digest": "199236aefecc1657cdc1b791ec38c8184557ab9249aff9c63a74abf73edc1dc0ea36b19b558f34ca3b14f8a511b10bcf37408b19701929522b4dc22dbaddcbe9",
 "algorithm": "sha512",
 "filename": "emulator.zip"
 }]
--- a/dom/bluetooth/BluetoothOppManager.cpp
+++ b/dom/bluetooth/BluetoothOppManager.cpp
@@ -22,16 +22,17 @@
 #include "nsCExternalHandlerService.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIDOMFile.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIMIMEService.h"
 #include "nsIOutputStream.h"
+#include "nsIVolumeService.h"
 #include "nsNetUtil.h"
 
 #define TARGET_SUBDIR "Download/Bluetooth/"
 
 USING_BLUETOOTH_NAMESPACE
 using namespace mozilla;
 using namespace mozilla::ipc;
 
@@ -446,16 +447,25 @@ void
 BluetoothOppManager::AfterOppConnected()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   mConnected = true;
   mAbortFlag = false;
   mWaitingForConfirmationFlag = true;
   AfterFirstPut();
+  // Get a mount lock to prevent the sdcard from being shared with
+  // the PC while we're doing a OPP file transfer. After OPP transcation
+  // were done, the mount lock will be freed.
+  if (!AcquireSdcardMountLock()) {
+    // If we fail to get a mount lock, abort this transaction
+    // Directly sending disconnect-request is better than abort-request
+    NS_WARNING("BluetoothOPPManager couldn't get a mount lock!");
+    Disconnect();
+  }
 }
 
 void
 BluetoothOppManager::AfterOppDisconnected()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   mConnected = false;
@@ -478,16 +488,21 @@ BluetoothOppManager::AfterOppDisconnecte
     mOutputStream->Close();
     mOutputStream = nullptr;
   }
 
   if (mReadFileThread) {
     mReadFileThread->Shutdown();
     mReadFileThread = nullptr;
   }
+  // Release the Mount lock if file transfer completed
+  if (mMountLock) {
+    // The mount lock will be implicitly unlocked
+    mMountLock = nullptr;
+  }
 }
 
 void
 BluetoothOppManager::DeleteReceivedFile()
 {
   if (mOutputStream) {
     mOutputStream->Close();
     mOutputStream = nullptr;
@@ -1488,8 +1503,20 @@ BluetoothOppManager::OnUpdateSdpRecords(
     DispatchBluetoothReply(mRunnable, BluetoothValue(),
                            NS_LITERAL_STRING(ERR_SERVICE_CHANNEL_NOT_FOUND));
     mRunnable = nullptr;
     mSocket = nullptr;
     Listen();
   }
 }
 
+bool
+BluetoothOppManager::AcquireSdcardMountLock()
+{
+  nsCOMPtr<nsIVolumeService> volumeSrv =
+    do_GetService(NS_VOLUMESERVICE_CONTRACTID);
+  NS_ENSURE_TRUE(volumeSrv, false);
+  nsresult rv;
+  rv = volumeSrv->CreateMountLock(NS_LITERAL_STRING("sdcard"),
+                                  getter_AddRefs(mMountLock));
+  NS_ENSURE_SUCCESS(rv, false);
+  return true;
+}
--- a/dom/bluetooth/BluetoothOppManager.h
+++ b/dom/bluetooth/BluetoothOppManager.h
@@ -12,16 +12,17 @@
 #include "BluetoothSocketObserver.h"
 #include "DeviceStorage.h"
 #include "mozilla/dom/ipc/Blob.h"
 #include "mozilla/ipc/UnixSocket.h"
 #include "nsCOMArray.h"
 
 class nsIOutputStream;
 class nsIInputStream;
+class nsIVolumeMountLock;
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothReplyRunnable;
 class BluetoothSocket;
 class ObexHeaderSet;
 
 class BluetoothOppManager : public BluetoothSocketObserver
@@ -106,17 +107,17 @@ private:
   void AfterOppConnected();
   void AfterFirstPut();
   void AfterOppDisconnected();
   void ValidateFileName();
   bool IsReservedChar(PRUnichar c);
   void ClearQueue();
   void RetrieveSentFileName();
   void NotifyAboutFileChange();
-
+  bool AcquireSdcardMountLock();
   /**
    * OBEX session status.
    * Set when OBEX session is established.
    */
   bool mConnected;
   nsString mConnectedDeviceAddress;
 
   /**
@@ -192,17 +193,17 @@ private:
   /**
    * A seperate member thread is required because our read calls can block
    * execution, which is not allowed to happen on the IOThread.
    * 
    */
   nsCOMPtr<nsIThread> mReadFileThread;
   nsCOMPtr<nsIOutputStream> mOutputStream;
   nsCOMPtr<nsIInputStream> mInputStream;
-
+  nsCOMPtr<nsIVolumeMountLock> mMountLock;
   nsRefPtr<BluetoothReplyRunnable> mRunnable;
   nsRefPtr<DeviceStorageFile> mDsFile;
 
   // If a connection has been established, mSocket will be the socket
   // communicating with the remote socket. We maintain the invariant that if
   // mSocket is non-null, mRfcommSocket and mL2capSocket must be null (and vice
   // versa).
   nsRefPtr<BluetoothSocket> mSocket;
--- a/dom/push/src/PushService.jsm
+++ b/dom/push/src/PushService.jsm
@@ -1146,16 +1146,22 @@ this.PushService = {
 
     var fail = function(error) {
       debug("unregister() fail() error " + error);
       var message = {requestID: aPageRecord.requestID, error: error};
       aMessageManager.sendAsyncMessage("PushService:Unregister:KO", message);
     }
 
     this._db.getByPushEndpoint(aPageRecord.pushEndpoint, function(record) {
+      // If the endpoint didn't exist, let's just fail.
+      if (record === undefined) {
+        fail("NotFoundError");
+        return;
+      }
+
       // Non-owner tried to unregister, say success, but don't do anything.
       if (record.manifestURL !== aPageRecord.manifestURL) {
         aMessageManager.sendAsyncMessage("PushService:Unregister:OK", {
           requestID: aPageRecord.requestID,
           pushEndpoint: aPageRecord.pushEndpoint
         });
         return;
       }
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -52,16 +52,18 @@ const kSmsDeliverySuccessObserverTopic  
 const kSmsDeliveryErrorObserverTopic     = "sms-delivery-error";
 const kMozSettingsChangedObserverTopic   = "mozsettings-changed";
 const kSysMsgListenerReadyObserverTopic  = "system-message-listener-ready";
 const kSysClockChangeObserverTopic       = "system-clock-change";
 const kScreenStateChangedTopic           = "screen-state-changed";
 const kTimeNitzAutomaticUpdateEnabled    = "time.nitz.automatic-update.enabled";
 const kTimeNitzAvailable                 = "time.nitz.available";
 const kCellBroadcastSearchList           = "ril.cellbroadcast.searchlist";
+const kCellBroadcastDisabled             = "ril.cellbroadcast.disabled";
+const kPrefenceChangedObserverTopic      = "nsPref:changed";
 
 const DOM_MOBILE_MESSAGE_DELIVERY_RECEIVED = "received";
 const DOM_MOBILE_MESSAGE_DELIVERY_SENDING  = "sending";
 const DOM_MOBILE_MESSAGE_DELIVERY_SENT     = "sent";
 const DOM_MOBILE_MESSAGE_DELIVERY_ERROR    = "error";
 
 const CALL_WAKELOCK_TIMEOUT              = 5000;
 
@@ -218,25 +220,40 @@ XPCOMUtils.defineLazyGetter(this, "gAudi
     //TODO on the phone this should not fall back as silently.
     debug("Using fake audio manager.");
     return FakeAudioManager;
   }
 });
 
 
 function RadioInterfaceLayer() {
+  this.clientId = 0;
+
   this.dataNetworkInterface = new RILNetworkInterface(this, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE);
   this.mmsNetworkInterface = new RILNetworkInterface(this, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS);
   this.suplNetworkInterface = new RILNetworkInterface(this, Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL);
 
   debug("Starting RIL Worker");
   this.worker = new ChromeWorker("resource://gre/modules/ril_worker.js");
   this.worker.onerror = this.onerror.bind(this);
   this.worker.onmessage = this.onmessage.bind(this);
 
+  let cellBroadcastDisabledPref = false;
+  try {
+    cellBroadcastDisabledPref =
+      Services.prefs.getBoolPref(kCellBroadcastDisabled);
+  } catch(e) {}
+  // Pass initial options to ril_worker.
+  this.worker.postMessage({
+    rilMessageType: "setInitialOptions",
+    debug: debugPref,
+    clientId: this.clientId,
+    cellBroadcastDisabled: cellBroadcastDisabledPref
+  });
+
   this.rilContext = {
     radioState:     RIL.GECKO_RADIOSTATE_UNAVAILABLE,
     cardState:      RIL.GECKO_CARDSTATE_UNKNOWN,
     retryCount:     0,  // TODO: Please see bug 868896
     networkSelectionMode: RIL.GECKO_NETWORK_SELECTION_UNKNOWN,
     iccInfo:        null,
     imsi:           null,
 
@@ -348,28 +365,26 @@ function RadioInterfaceLayer() {
     ppmm.addMessageListener(msgname, this);
   }
   Services.obs.addObserver(this, "xpcom-shutdown", false);
   Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false);
   Services.obs.addObserver(this, kSysMsgListenerReadyObserverTopic, false);
   Services.obs.addObserver(this, kSysClockChangeObserverTopic, false);
   Services.obs.addObserver(this, kScreenStateChangedTopic, false);
 
+  Services.prefs.addObserver(kCellBroadcastDisabled, this, false);
+
   this._sentSmsEnvelopes = {};
 
   this.portAddressedSmsApps = {};
   this.portAddressedSmsApps[WAP.WDP_PORT_PUSH] = this.handleSmsWdpPortPush.bind(this);
 
   this._targetMessageQueue = [];
 
-  // pass debug pref to ril_worker
-  this.worker.postMessage({rilMessageType: "setDebugEnabled",
-                           enabled: debugPref});
-
-  gSystemWorkerManager.registerRilWorker(0, this.worker);
+  gSystemWorkerManager.registerRilWorker(this.clientId, this.worker);
 }
 RadioInterfaceLayer.prototype = {
 
   classID:   RADIOINTERFACELAYER_CID,
   classInfo: XPCOMUtils.generateCI({classID: RADIOINTERFACELAYER_CID,
                                     classDescription: "RadioInterfaceLayer",
                                     interfaces: [Ci.nsIRadioInterfaceLayer]}),
 
@@ -941,20 +956,17 @@ RadioInterfaceLayer.prototype = {
    *                the RIL:VoiceInfoChanged message will not be sent.
    */
   updateVoiceConnection: function updateVoiceConnection(newInfo) {
     let voiceInfo = this.rilContext.voice;
     voiceInfo.state = newInfo.state;
     voiceInfo.connected = newInfo.connected;
     voiceInfo.roaming = newInfo.roaming;
     voiceInfo.emergencyCallsOnly = newInfo.emergencyCallsOnly;
-    // Unlike the data registration info, the voice info typically contains
-    // no (useful) radio tech information, so we have to manually set
-    // this here. (TODO GSM only for now, see bug 726098.)
-    voiceInfo.type = "gsm";
+    voiceInfo.type = newInfo.type;
 
     // Make sure we also reset the operator and signal strength information
     // if we drop off the network.
     if (newInfo.regState == RIL.NETWORK_CREG_STATE_UNKNOWN) {
       voiceInfo.network = null;
       voiceInfo.signalStrength = null;
       voiceInfo.relSignalStrength = null;
     }
@@ -1918,30 +1930,43 @@ RadioInterfaceLayer.prototype = {
     debug("handleQueryCallWaiting: " + JSON.stringify(message));
     this._sendRequestResults("RIL:GetCallWaitingOption", message);
   },
 
   handleSetCallWaiting: function handleSetCallWaiting(message) {
     debug("handleSetCallWaiting: " + JSON.stringify(message));
     this._sendRequestResults("RIL:SetCallWaitingOption", message);
   },
+
   // nsIObserver
 
   observe: function observe(subject, topic, data) {
     switch (topic) {
       case kSysMsgListenerReadyObserverTopic:
         Services.obs.removeObserver(this, kSysMsgListenerReadyObserverTopic);
         this._sysMsgListenerReady = true;
         this._resendQueuedTargetMessage();
         this._ensureRadioState();
         break;
       case kMozSettingsChangedObserverTopic:
         let setting = JSON.parse(data);
         this.handleSettingsChange(setting.key, setting.value, setting.message);
         break;
+      case kPrefenceChangedObserverTopic:
+        if (data === kCellBroadcastDisabled) {
+          let value = false;
+          try {
+            value = Services.prefs.getBoolPref(kCellBroadcastDisabled);
+          } catch(e) {}
+          this.worker.postMessage({
+            rilMessageType: "setCellBroadcastDisabled",
+            disabled: value
+          });
+        }
+        break;
       case "xpcom-shutdown":
         ppmm.removeMessageListener("child-process-shutdown", this);
         for (let msgname of RIL_IPC_TELEPHONY_MSG_NAMES) {
           ppmm.removeMessageListener(msgname, this);
         }
         for (let msgname of RIL_IPC_MOBILECONNECTION_MSG_NAMES) {
           ppmm.removeMessageListener(msgname, this);
         }
@@ -1960,16 +1985,17 @@ RadioInterfaceLayer.prototype = {
         this.dataNetworkInterface.shutdown();
         this.mmsNetworkInterface.shutdown();
         this.suplNetworkInterface.shutdown();
         ppmm = null;
         Services.obs.removeObserver(this, "xpcom-shutdown");
         Services.obs.removeObserver(this, kMozSettingsChangedObserverTopic);
         Services.obs.removeObserver(this, kSysClockChangeObserverTopic);
         Services.obs.removeObserver(this, kScreenStateChangedTopic);
+        Services.prefs.removeObserver(kCellBroadcastDisabled, this);
         break;
       case kSysClockChangeObserverTopic:
         if (this._lastNitzMessage) {
           this._lastNitzMessage.receiveTimeInMS += parseInt(data, 10);
         }
         break;
       case kScreenStateChangedTopic:
         debug("Received a screen-state-changed event: " + JSON.stringify(data));
--- a/dom/system/gonk/SystemWorkerManager.cpp
+++ b/dom/system/gonk/SystemWorkerManager.cpp
@@ -55,21 +55,18 @@ namespace {
 NS_DEFINE_CID(kWifiWorkerCID, NS_WIFIWORKER_CID);
 NS_DEFINE_CID(kNetworkManagerCID, NS_NETWORKMANAGER_CID);
 
 // Doesn't carry a reference, we're owned by services.
 SystemWorkerManager *gInstance = nullptr;
 
 class ConnectWorkerToRIL : public WorkerTask
 {
-  const unsigned long mClientId;
-
 public:
-  ConnectWorkerToRIL(unsigned long aClientId)
-    : mClientId(aClientId)
+  ConnectWorkerToRIL()
   { }
 
   virtual bool RunTask(JSContext *aCx);
 };
 
 class SendRilSocketDataTask : public nsRunnable
 {
 public:
@@ -152,21 +149,16 @@ bool
 ConnectWorkerToRIL::RunTask(JSContext *aCx)
 {
   // Set up the postRILMessage on the function for worker -> RIL thread
   // communication.
   NS_ASSERTION(!NS_IsMainThread(), "Expecting to be on the worker thread");
   NS_ASSERTION(!JS_IsRunning(aCx), "Are we being called somehow?");
   JSObject *workerGlobal = JS_GetGlobalForScopeChain(aCx);
 
-  if (!JS_DefineProperty(aCx, workerGlobal, "CLIENT_ID",
-                         INT_TO_JSVAL(mClientId), nullptr, nullptr, 0)) {
-    return false;
-  }
-
   return !!JS_DefineFunction(aCx, workerGlobal, "postRILMessage", PostToRIL, 1,
                              0);
 }
 
 #ifdef MOZ_WIDGET_GONK
 
 JSBool
 DoNetdCommand(JSContext *cx, unsigned argc, JS::Value *vp)
@@ -491,17 +483,17 @@ SystemWorkerManager::RegisterRilWorker(u
 
   WorkerCrossThreadDispatcher *wctd =
     GetWorkerCrossThreadDispatcher(aCx, aWorker);
   if (!wctd) {
     NS_WARNING("Failed to GetWorkerCrossThreadDispatcher for ril");
     return NS_ERROR_FAILURE;
   }
 
-  nsRefPtr<ConnectWorkerToRIL> connection = new ConnectWorkerToRIL(aClientId);
+  nsRefPtr<ConnectWorkerToRIL> connection = new ConnectWorkerToRIL();
   if (!wctd->PostTask(connection)) {
     NS_WARNING("Failed to connect worker to ril");
     return NS_ERROR_UNEXPECTED;
   }
 
   // Now that we're set up, connect ourselves to the RIL thread.
   mRilConsumers[aClientId] = new RilConsumer(aClientId, wctd);
   return NS_OK;
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -37,17 +37,17 @@
  */
 
 "use strict";
 
 importScripts("ril_consts.js", "systemlibs.js");
 
 // set to true in ril_consts.js to see debug messages
 let DEBUG = DEBUG_WORKER;
-
+let CLIENT_ID = -1;
 let GLOBAL = this;
 
 const INT32_MAX   = 2147483647;
 const UINT8_SIZE  = 1;
 const UINT16_SIZE = 2;
 const UINT32_SIZE = 4;
 const PARCEL_SIZE_SIZE = UINT32_SIZE;
 
@@ -742,16 +742,21 @@ let RIL = {
 
   /**
    * Index of the RIL_PREFERRED_NETWORK_TYPE_TO_GECKO. Its value should be
    * preserved over rild reset.
    */
   preferredNetworkType: null,
 
   /**
+   * Global Cell Broadcast switch.
+   */
+  cellBroadcastDisabled: false,
+
+  /**
    * Parsed Cell Broadcast search lists.
    * cellBroadcastConfigs.MMI should be preserved over rild reset.
    */
   cellBroadcastConfigs: null,
   mergedCellBroadcastConfig: null,
 
   _receivedSmsCbPagesMap: {},
 
@@ -885,16 +890,17 @@ let RIL = {
 
     /**
      * Cell Broadcast Search Lists.
      */
     let cbmmi = this.cellBroadcastConfigs && this.cellBroadcastConfigs.MMI;
     this.cellBroadcastConfigs = {
       MMI: cbmmi || null
     };
+    this.mergedCellBroadcastConfig = null;
   },
 
   get muted() {
     return this._muted;
   },
   set muted(val) {
     val = Boolean(val);
     if (this._muted != val) {
@@ -1893,16 +1899,29 @@ let RIL = {
    */
   acknowledgeCdmaSms: function acknowledgeCdmaSms(success, cause) {
     let token = Buf.newParcel(REQUEST_CDMA_SMS_ACKNOWLEDGE);
     Buf.writeUint32(success ? 0 : 1);
     Buf.writeUint32(cause);
     Buf.sendParcel();
   },
 
+  setCellBroadcastDisabled: function setCellBroadcastDisabled(options) {
+    this.cellBroadcastDisabled = options.disabled;
+
+    // If |this.mergedCellBroadcastConfig| is null, either we haven't finished
+    // reading required SIM files, or no any channel is ever configured.  In
+    // the former case, we'll call |this.updateCellBroadcastConfig()| later
+    // with correct configs; in the latter case, we don't bother resetting CB
+    // to disabled again.
+    if (this.mergedCellBroadcastConfig) {
+      this.updateCellBroadcastConfig();
+    }
+  },
+
   setCellBroadcastSearchList: function setCellBroadcastSearchList(options) {
     try {
       let str = options.searchListStr;
       this.cellBroadcastConfigs.MMI = this._convertCellBroadcastSearchList(str);
     } catch (e) {
       if (DEBUG) {
         debug("Invalid Cell Broadcast search list: " + e);
       }
@@ -1910,18 +1929,19 @@ let RIL = {
       this.sendDOMMessage(options);
       return;
     }
 
     this._mergeAllCellBroadcastConfigs();
   },
 
   updateCellBroadcastConfig: function updateCellBroadcastConfig() {
-    let activate = (this.mergedCellBroadcastConfig != null)
-                   && (this.mergedCellBroadcastConfig.length > 0);
+    let activate = !this.cellBroadcastDisabled &&
+                   (this.mergedCellBroadcastConfig != null) &&
+                   (this.mergedCellBroadcastConfig.length > 0);
     if (activate) {
       this.setGsmSmsBroadcastConfig(this.mergedCellBroadcastConfig);
     } else {
       // It's unnecessary to set config first if we're deactivating.
       this.setGsmSmsBroadcastActivation(false);
     }
   },
 
@@ -1939,17 +1959,18 @@ let RIL = {
     }
 
     Buf.sendParcel();
   },
 
   setGsmSmsBroadcastActivation: function setGsmSmsBroadcastActivation(activate) {
     Buf.newParcel(REQUEST_GSM_SMS_BROADCAST_ACTIVATION);
     Buf.writeUint32(1);
-    Buf.writeUint32(activate ? 1 : 0);
+    // See hardware/ril/include/telephony/ril.h, 0 - Activate, 1 - Turn off.
+    Buf.writeUint32(activate ? 0 : 1);
     Buf.sendParcel();
   },
 
   /**
    * Start a DTMF Tone.
    *
    * @param dtmfChar
    *        DTMF signal to send, 0-9, *, +
@@ -4331,18 +4352,20 @@ let RIL = {
   handleParcel: function handleParcel(request_type, length, options) {
     let method = this[request_type];
     if (typeof method == "function") {
       if (DEBUG) debug("Handling parcel as " + method.name);
       method.call(this, length, options);
     }
   },
 
-  setDebugEnabled: function setDebugEnabled(options) {
-    DEBUG = DEBUG_WORKER || options.enabled;
+  setInitialOptions: function setInitialOptions(options) {
+    DEBUG = DEBUG_WORKER || options.debug;
+    CLIENT_ID = options.clientId;
+    this.cellBroadcastDisabled = options.cellBroadcastDisabled;
   }
 };
 
 RIL.initRILState();
 
 RIL[REQUEST_GET_SIM_STATUS] = function REQUEST_GET_SIM_STATUS(length, options) {
   if (options.rilRequestError) {
     return;
--- a/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp
+++ b/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp
@@ -154,21 +154,18 @@ BytesPerPixelForPixelFormat(android::Pix
   case PIXEL_FORMAT_RGBX_8888:
   case PIXEL_FORMAT_BGRA_8888:
     return 4;
   case PIXEL_FORMAT_RGB_888:
     return 3;
   case PIXEL_FORMAT_RGB_565:
   case PIXEL_FORMAT_RGBA_5551:
   case PIXEL_FORMAT_RGBA_4444:
-  case PIXEL_FORMAT_LA_88:
     return 2;
-  case PIXEL_FORMAT_L_8:
   case PIXEL_FORMAT_A_8:
-  case PIXEL_FORMAT_RGB_332:
     return 1;
   default:
     MOZ_NOT_REACHED("Unknown gralloc pixel format");
   }
   return gfxASurface::ImageFormatARGB32;
 }
 
 static android::PixelFormat
--- a/mobile/android/config/mozconfigs/android-armv6/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-armv6/l10n-nightly
@@ -14,22 +14,23 @@ ac_add_options --enable-application=mobi
 
 # Android
 ac_add_options --target=arm-linux-androideabi
 ac_add_options --with-arch=armv6
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 export MOZ_PKG_SPECIAL=armv6
--- a/mobile/android/config/mozconfigs/android-armv6/l10n-release
+++ b/mobile/android/config/mozconfigs/android-armv6/l10n-release
@@ -11,22 +11,23 @@ ac_add_options --enable-application=mobi
 
 # Android
 ac_add_options --target=arm-linux-androideabi
 ac_add_options --with-arch=armv6
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 export MOZ_PKG_SPECIAL=armv6
--- a/mobile/android/config/mozconfigs/android-x86/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-x86/l10n-nightly
@@ -13,22 +13,23 @@ ac_add_options --enable-js-diagnostics
 ac_add_options --enable-application=mobile/android
 
 # Android
 ac_add_options --target=i386-linux-android
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 
--- a/mobile/android/config/mozconfigs/android-x86/l10n-release
+++ b/mobile/android/config/mozconfigs/android-x86/l10n-release
@@ -10,22 +10,23 @@ ac_add_options --disable-tests
 ac_add_options --enable-application=mobile/android
 
 # Android
 ac_add_options --target=i386-linux-android
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 
--- a/mobile/android/config/mozconfigs/android/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android/l10n-nightly
@@ -13,22 +13,23 @@ ac_add_options --enable-js-diagnostics
 ac_add_options --enable-application=mobile/android
 
 # Android
 ac_add_options --target=arm-linux-androideabi
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1
 
--- a/mobile/android/config/mozconfigs/android/l10n-release
+++ b/mobile/android/config/mozconfigs/android/l10n-release
@@ -10,22 +10,23 @@ ac_add_options --disable-tests
 ac_add_options --enable-application=mobile/android
 
 # Android
 ac_add_options --target=arm-linux-androideabi
 
 if test `uname -m` = 'x86_64'; then
   ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
   ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.7
 else
   ac_add_options --with-android-ndk="/tools/android-ndk-r8c"
   ac_add_options --with-android-sdk="/tools/android-sdk-r16/platforms/android-16"
+  ac_add_options --with-android-gnu-compiler-version=4.6
 fi
 
-ac_add_options --with-android-gnu-compiler-version=4.7
 ac_add_options --with-android-version=9
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export JAVA_HOME=/tools/jdk6
 export MOZILLA_OFFICIAL=1