Merge birch and m-c.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 03 Jul 2013 09:13:23 -0400
changeset 137216 2cae857c17cb648d766c43c93bcb0bd68901b3f1
parent 137203 b48e06621dc929d6b2d0d3b653ee4130fe34e4f4 (current diff)
parent 137215 82fcae5f8e1d8178d95acdcf32e5d8733abf14b1 (diff)
child 137217 9b3b362ac62b756b8c607214d7b98b5376cb07ae
child 137218 7945c16d34e3b5256f3547d6013a9016cbcf1205
child 137318 5fa8906dd92e2ea24f1269eae9b088f3e516c2d4
child 155519 b6f8dc3e635b9fe86616f53436d24bb4cf30b993
push id1823
push userryanvm@gmail.com
push dateWed, 03 Jul 2013 13:15:22 +0000
treeherderfx-team@2cae857c17cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone25.0a1
Merge birch and m-c.
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "82cba799ba6ae9f118fb44ec40bc3dd132ad04a8", 
+    "revision": "4567d6a94813cf88067d466557debe720820828f", 
     "repo_path": "/integration/gaia-central"
 }
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -74,16 +74,23 @@ XPCOMUtils.defineLazyGetter(this, "updat
   const DIRECTORY_NAME = "webappsDir";
 #else
   // If we're executing in the context of the webapp runtime, the data files
   // are in a different directory (currently the Firefox profile that installed
   // the webapp); otherwise, they're in the current profile.
   const DIRECTORY_NAME = WEBAPP_RUNTIME ? "WebappRegD" : "ProfD";
 #endif
 
+// We'll use this to identify privileged apps that have been preinstalled
+// For those apps we'll set
+// STORE_ID_PENDING_PREFIX + installOrigin
+// as the storeID. This ensures it's unique and can't be set from a legit
+// store even by error.
+const STORE_ID_PENDING_PREFIX = "#unknownID#";
+
 this.DOMApplicationRegistry = {
   appsFile: null,
   webapps: { },
   children: [ ],
   allAppsLaunchable: false,
 #ifdef MOZ_OFFICIAL_BRANDING
   get allowSideloadingCertified() false,
 #else
@@ -341,16 +348,21 @@ this.DOMApplicationRegistry = {
                             .path;
 
     if (!isPackage) {
       return;
     }
 
     app.origin = "app://" + aId;
 
+    // Do this for all preinstalled apps... we can't know at this
+    // point if the updates will be signed or not and it doesn't
+    // hurt to have it always.
+    app.storeId = STORE_ID_PENDING_PREFIX + app.installOrigin;
+
     // Extract the manifest.webapp file from application.zip.
     let zipFile = baseDir.clone();
     zipFile.append("application.zip");
     let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"]
                       .createInstance(Ci.nsIZipReader);
     try {
       debug("Opening " + zipFile.path);
       zipReader.open(zipFile);
@@ -2248,38 +2260,42 @@ this.DOMApplicationRegistry = {
     }
 
     // aStoreId must be a string of the form
     //   <installOrigin>#<storeId from ids.json>
     // aStoreVersion must be a positive integer.
     function checkForStoreIdMatch(aStoreId, aStoreVersion) {
       // Things to check:
       // 1. if it's a update:
-      //   a. We should already have this storeId
+      //   a. We should already have this storeId, or the original storeId must start
+      //      with STORE_ID_PENDING_PREFIX
       //   b. The manifestURL for the stored app should be the same one we're
       //      updating
       //   c. And finally the version of the update should be higher than the one
       //      on the already installed package
       // 2. else
       //   a. We should not have this storeId on the list
       // We're currently launching WRONG_APP_STORE_ID for all the mismatch kind of
       // errors, and APP_STORE_VERSION_ROLLBACK for the version error.
 
       // Does an app with this storeID exist already?
       let appId = self.getAppLocalIdByStoreId(aStoreId);
       let isInstalled = appId != Ci.nsIScriptSecurityManager.NO_APP_ID;
       if (aIsUpdate) {
-        if (!isInstalled || (app.localId !== appId)) {
-          // If we don't have the storeId on track already, this
-          // cannot be an update
+        let isDifferent = app.localId !== appId;
+        let isPending = app.storeId.indexOf(STORE_ID_PENDING_PREFIX) == 0;
+
+        if ((!isInstalled && !isPending) || (isInstalled && isDifferent)) {
           throw "WRONG_APP_STORE_ID";
         }
-        if (app.storeVersion >= aStoreVersion) {
+
+        if (!isPending && (app.storeVersion >= aStoreVersion)) {
           throw "APP_STORE_VERSION_ROLLBACK";
         }
+
       } else if (isInstalled) {
         throw "WRONG_APP_STORE_ID";
       }
     }
 
     function download() {
       debug("About to download " + aManifest.fullPackagePath());
 
--- a/dom/bluetooth/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/BluetoothHfpManager.cpp
@@ -805,19 +805,19 @@ BluetoothHfpManager::ReceiveSocketData(B
       NS_WARNING("The value of command [AT+CHLD] is not supported");
       valid = false;
     } else if (chld == '0') {
       // We need to rename these dialer commands for better readability
       // and expandability.
       // See bug 884190 for more information.
       NotifyDialer(NS_LITERAL_STRING("CHLD=0"));
     } else if (chld == '1') {
-      NotifyDialer(NS_LITERAL_STRING("CHUP+ATA"));
+      NotifyDialer(NS_LITERAL_STRING("CHLD=1"));
     } else if (chld == '2') {
-      NotifyDialer(NS_LITERAL_STRING("CHLD+ATA"));
+      NotifyDialer(NS_LITERAL_STRING("CHLD=2"));
     } else {
       NS_WARNING("Wrong value of command [AT+CHLD]");
       valid = false;
     }
 
     if (!valid) {
       SendLine("ERROR");
       return;
--- a/dom/bluetooth/BluetoothTelephonyListener.cpp
+++ b/dom/bluetooth/BluetoothTelephonyListener.cpp
@@ -63,25 +63,29 @@ TelephonyListener::EnumerateCallState(ui
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TelephonyListener::NotifyError(int32_t aCallIndex,
                                const nsAString& aError)
 {
   BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
-  // In order to not miss any related call state transition.
-  // It's possible that 3G network signal lost for unknown reason.
-  // If a call is released abnormally, NotifyError() will be called,
-  // instead of CallStateChanged(). We need to reset the call array state
-  // via setting CALL_STATE_DISCONNECTED
-  hfp->HandleCallStateChanged(aCallIndex,
-                              nsITelephonyProvider::CALL_STATE_DISCONNECTED,
-                              EmptyString(), false, true);
-  NS_WARNING("Reset the call state due to call transition ends abnormally");
+
+  if (aCallIndex > 0) {
+    // In order to not miss any related call state transition.
+    // It's possible that 3G network signal lost for unknown reason.
+    // If a call is released abnormally, NotifyError() will be called,
+    // instead of CallStateChanged(). We need to reset the call array state
+    // via setting CALL_STATE_DISCONNECTED
+    hfp->HandleCallStateChanged(aCallIndex,
+                                nsITelephonyProvider::CALL_STATE_DISCONNECTED,
+                                EmptyString(), false, true);
+    NS_WARNING("Reset the call state due to call transition ends abnormally");
+  }
+
   NS_WARNING(NS_ConvertUTF16toUTF8(aError).get());
   return NS_OK;
 }
 
 } // anonymous namespace
 
 BluetoothTelephonyListener::BluetoothTelephonyListener()
 {
--- a/dom/mobilemessage/src/ril/MmsService.js
+++ b/dom/mobilemessage/src/ril/MmsService.js
@@ -1621,17 +1621,16 @@ MmsService.prototype = {
         }
 
         let part = {
           "headers": {
             "content-type": {
               "media": content.type,
               "params": params
             },
-            "content-length": content.size,
             "content-location": location,
             "content-id": attachment.id
           },
           "content": content
         };
         parts.push(part);
       }
     }