merge b2g-inbound to mozilla-central
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 24 Feb 2014 12:55:53 +0100
changeset 170524 d9c58306bfbc74c920aa5c995b86b5f8a398352b
parent 170497 1f5b177c7c6235b1e79a07a6eb849eea23d96c05 (current diff)
parent 170523 12124be1947e7781ccfeddf57b69f13fc7ffc675 (diff)
child 170525 de85ea41b96b8ee4e14ffe46bd40cc3b2d85a3d0
child 170555 1a219f500336241729a29f71ca5516063b86e654
child 170590 6f4d3623806e46129a0b93e20b986c1dab693bef
child 170818 0f152676a9f184fe63743a269498744e795ad337
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
milestone30.0a1
merge b2g-inbound to mozilla-central
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="022eadd5917615ff00c47eaaafa792b45e9c8a28"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="97a5b461686757dbb8ecab2aac5903e41d2e1afe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
   <!-- 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"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="022eadd5917615ff00c47eaaafa792b45e9c8a28"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "894a7f2886a7a727ce03edadbbea936ceb4aaeba", 
+    "revision": "35ef07425e808811af0462a6ba08c36409236846", 
     "repo_path": "/integration/gaia-central"
 }
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -5,17 +5,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <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/inari/sources.xml
+++ b/b2g/config/inari/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
--- a/b2g/config/leo/sources.xml
+++ b/b2g/config/leo/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
--- a/b2g/config/mako/sources.xml
+++ b/b2g/config/mako/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="97a5b461686757dbb8ecab2aac5903e41d2e1afe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
   <!-- 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"/>
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="ffb527b84594396ed611edf0a8a5a130d60a742f"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0eadf61ef60f13324fe8290d8c2b516d98230fdc"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
--- a/content/html/content/test/test_ignoreuserfocus.html
+++ b/content/html/content/test/test_ignoreuserfocus.html
@@ -36,17 +36,17 @@
         var witness = document.createElement("input");
         witness.setAttribute("type", "text");
         var witness2 = document.createElement("input");
         witness2.setAttribute("type", "text");
 
         var iframe = document.createElement("iframe");
         iframe.setAttribute("mozbrowser", "true");
         iframe.setAttribute("ignoreuserfocus", "true");
-        iframe.setAttribute("height", "500px");
+        iframe.setAttribute("height", "300px");
         iframe.setAttribute("src", "file_ignoreuserfocus.html");
 
         iframe.addEventListener('load', function (e) {
           // Get privileged iframe because mozbrowser iframe is not same origin
           // with the parent. We need to access its content through the wrapper.
           var privilegedIframe = SpecialPowers.wrap(iframe);
           privilegedIframe.contentWindow.addEventListener("MozAfterPaint", function afterPaint(e) {
             privilegedIframe.contentWindow.removeEventListener("MozAfterPaint", afterPaint);
@@ -97,17 +97,16 @@
             isnot(document.activeElement, iframe, "[explicit innerIframe.focus()] iframe should not have the focus");
 
             witness.focus();
             synthesizeMouseAtCenter(innerIframe, {}, iframeWindow);
             is(document.activeElement, witness, "[synthesize mouse click inner iframe] witness should have the focus");
 
             // Test the case when iframe contains <area> and .focus()
             // is called and explicit focus using mouse
-            witness.focus();
 
             // Wait for paint to setup frame for area. Currently the area frame
             // map is reset for each paint. If we are in the middle of a paint
             // then the area will not be focusable.
             privilegedIframe.contentWindow.addEventListener("MozAfterPaint", function afterPaintArea(e) {
               privilegedIframe.contentWindow.removeEventListener("MozAfterPaint", afterPaintArea);
               var innerArea = privilegedIframe.contentDocument.getElementsByTagName("area")[0];
               innerArea.focus();
@@ -121,17 +120,22 @@
               witness.focus();
               is(document.activeElement, witness, "witness should have the focus");
               synthesizeKey("VK_TAB", {});
               isnot(document.activeElement, iframe, "[synthesize tab key] iframe should not have the focus");
               is(document.activeElement, witness2, "witness2 should have the focus");
 
               SimpleTest.finish();
             });
+            witness.focus();
+            // force reflow
+            var reflow = iframe.offsetLeft;
           });
+          // force reflow
+          var reflow = iframe.offsetLeft;
         });
 
         document.body.appendChild(witness);
         document.body.appendChild(iframe);
         document.body.appendChild(witness2);
       }
       addEventListener("load", function() {
         SpecialPowers.addPermission("browser", true, document);
--- a/dom/mobileconnection/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/mobileconnection/interfaces/nsIDOMMobileConnection.idl
@@ -138,18 +138,19 @@ interface nsIDOMMozMobileConnection : ns
   nsIDOMDOMRequest selectNetworkAutomatically();
 
   /**
    * Set preferred network type
    *
    * @param type
    *        DOMString indicates the desired preferred network type.
    *        Possible values: 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
-   *                         'cdma/evdo', 'cdma', 'evdo', or
-   *                         'wcdma/gsm/cdma/evdo'.
+   *                         'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo',
+   *                         'lte/cdma/evdo', 'lte/wcdma/gsm',
+   *                         'lte/wcdma/gsm/cdma/evdo' or 'lte'.
    *
    * If successful, the request's onsuccess will be called.
    *
    * Otherwise, the request's onerror will be called, and the request's error
    * will be either 'RadioNotAvailable', 'RequestNotSupported',
    * 'InvalidParameter', 'ModeNotSupported' or 'GenericFailure'
    *
    * TODO: param "type" should be a WebIDL enum when this interface is converted
@@ -158,17 +159,18 @@ interface nsIDOMMozMobileConnection : ns
   nsIDOMDOMRequest setPreferredNetworkType(in DOMString type);
 
   /**
    * Query current preferred network type
    *
    * If successful, the request's onsuccess will be called. And the request's
    * result will be a string indicating the current preferred network type.
    * The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
-   * 'cdma/evdo', 'cdma', 'evdo', or 'wcdma/gsm/cdma/evdo'.
+   * 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
+   * 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
    *
    * Otherwise, the request's onerror will be called, and the request's error
    * will be either 'RadioNotAvailable', 'RequestNotSupported',
    * or 'GenericFailure'
    */
   nsIDOMDOMRequest getPreferredNetworkType();
 
   /**
--- a/dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type.js
+++ b/dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type.js
@@ -1,153 +1,131 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = "mobile_header.js";
 
-SpecialPowers.addPermission("mobileconnection", true, document);
+function doSetAndVerifyPreferredNetworkType(preferredNetworkType, callback) {
+  log("setPreferredNetworkType to '" + preferredNetworkType + "'.");
+  let setRequest = mobileConnection.setPreferredNetworkType(preferredNetworkType);
+  ok(setRequest instanceof DOMRequest,
+     "setRequest instanceof " + setRequest.constructor);
+
+  setRequest.onsuccess = function() {
+    log("Verify preferred network.");
+    let getRequest = mobileConnection.getPreferredNetworkType();
+    ok(getRequest instanceof DOMRequest,
+       "getRequest instanceof " + getRequest.constructor);
+
+    getRequest.onsuccess = function() {
+      is(getRequest.result, preferredNetworkType, "Check preferred network type.");
+      callback();
+    };
+
+    getRequest.onerror = function() {
+      ok(false, "getPreferredNetworkType got error: " + getRequest.error.name);
+      callback();
+    };
+  };
 
-let connection = navigator.mozMobileConnections[0];
-ok(connection instanceof MozMobileConnection,
-   "connection is instanceof " + connection.constructor);
+  setRequest.onerror = function() {
+    ok(false, "setPreferredNetwork got error: " + setRequest.error.name);
+    callback();
+  };
+}
+
+function doFailToSetPreferredNetworkType(preferredNetworkType, expectedError, callback) {
+  log("setPreferredNetworkType to '" + preferredNetworkType + "'.");
+  let request = mobileConnection.setPreferredNetworkType(preferredNetworkType);
+  ok(request instanceof DOMRequest,
+     "request instanceof " + request.constructor);
 
-function testSupportedNetworkTypes() {
-  let supportedNetworkTypes = connection.supportedNetworkTypes;
+  request.onsuccess = function() {
+    ok(false, "Should not success");
+    callback();
+  };
+
+  request.onerror = function() {
+    is(request.error.name, expectedError, "Check error message.");
+    callback();
+  };
+}
+
+/* Test supportedNetworkTypes */
+taskHelper.push(function testSupportedNetworkTypes() {
+  let supportedNetworkTypes = mobileConnection.supportedNetworkTypes;
 
   ok(Array.isArray(supportedNetworkTypes), "supportedNetworkTypes should be an array");
   ok(supportedNetworkTypes.indexOf("gsm") >= 0, "Should support 'gsm'");
   ok(supportedNetworkTypes.indexOf("wcdma") >= 0, "Should support 'wcdma'");
   ok(supportedNetworkTypes.indexOf("cdma") >= 0, "Should support 'cdma'");
   ok(supportedNetworkTypes.indexOf("evdo") >= 0, "Should support 'evdo'");
 
-  runNextTest();
-}
-
-function setPreferredNetworkType(type, callback) {
-  log("setPreferredNetworkType: " + type);
-
-  let request = connection.setPreferredNetworkType(type);
-  ok(request instanceof DOMRequest,
-     "request instanceof " + request.constructor);
-
-  request.onsuccess = function onsuccess() {
-    ok(true, "request success");
-    callback();
-  }
-  request.onerror = function onerror() {
-    ok(false, request.error);
-    callback();
-  }
-}
-
-function getPreferredNetworkType(callback) {
-  log("getPreferredNetworkType");
-
-  let request = connection.getPreferredNetworkType();
-  ok(request instanceof DOMRequest,
-     "request instanceof " + request.constructor);
+  taskHelper.runNext();
+});
 
-  request.onsuccess = function onsuccess() {
-    ok(true, "request success");
-    log("getPreferredNetworkType: " + request.result);
-    callback(request.result);
-  }
-  request.onerror = function onerror() {
-    ok(false, request.error);
-    callback();
-  }
-}
-
-function failToSetPreferredNetworkType(type, expectedError, callback) {
-  log("failToSetPreferredNetworkType: " + type + ", expected error: "
-    + expectedError);
-
-  let request = connection.setPreferredNetworkType(type);
-  ok(request instanceof DOMRequest,
-     "request instanceof " + request.constructor);
+/* Test switching to supported preferred types */
+taskHelper.push(function testPreferredNetworkTypes() {
+  let supportedTypes = [
+    'gsm',
+    'wcdma',
+    'wcdma/gsm-auto',
+    'cdma/evdo',
+    'evdo',
+    'cdma',
+    'wcdma/gsm/cdma/evdo',
+    // Restore to default
+    'wcdma/gsm'
+  ];
 
-  request.onsuccess = function onsuccess() {
-    ok(false, "request should not succeed");
-    callback();
-  }
-  request.onerror = function onerror() {
-    ok(true, "request error");
-    is(request.error.name, expectedError);
-    callback();
-  }
-}
-
-function setAndVerifyNetworkType(type) {
-  setPreferredNetworkType(type, function() {
-    getPreferredNetworkType(function(result) {
-      is(result, type);
-      testPreferredNetworkTypes();
-    });
-  });
-}
+  // Run all test data.
+  (function do_call() {
+    let type = supportedTypes.shift();
+    if (!type) {
+      taskHelper.runNext();
+      return;
+    }
+    doSetAndVerifyPreferredNetworkType(type, do_call);
+  })();
+});
 
-function testPreferredNetworkTypes() {
-  let networkType = supportedTypes.shift();
-  if (!networkType) {
-    runNextTest();
-    return;
-  }
-  setAndVerifyNetworkType(networkType);
-}
+/* Test switching to unsupported preferred types */
+taskHelper.push(function testUnsupportedPreferredNetworkTypes() {
+  // Currently emulator doesn't support lte network
+  let unsupportedTypes = [
+    'lte/cdma/evdo',
+    'lte/wcdma/gsm',
+    'lte/wcdma/gsm/cdma/evdo',
+    'lte'
+  ];
 
-function failToSetAndVerifyNetworkType(type, expectedError, previousType) {
-  failToSetPreferredNetworkType(type, expectedError, function() {
-    getPreferredNetworkType(function(result) {
-      // should return the previous selected type.
-      is(result, previousType);
-      testInvalidNetworkTypes();
-    });
-  });
-}
-
-function testInvalidNetworkTypes() {
-  let networkType = invalidTypes.shift();
-  if (!networkType) {
-    runNextTest();
-    return;
-  }
-  failToSetAndVerifyNetworkType(networkType, "InvalidParameter",
-                                "wcdma/gsm");
-}
+  // Run all test data.
+  (function do_call() {
+    let type = unsupportedTypes.shift();
+    if (!type) {
+      taskHelper.runNext();
+      return;
+    }
+    doFailToSetPreferredNetworkType(type, "ModeNotSupported", do_call);
+  })();
+});
 
-let supportedTypes = [
-  'gsm',
-  'wcdma',
-  'wcdma/gsm-auto',
-  'cdma/evdo',
-  'evdo',
-  'cdma',
-  'wcdma/gsm/cdma/evdo',
-  'wcdma/gsm' // restore to default
-];
-
-let invalidTypes = [
-  ' ',
-  'AnInvalidType'
-];
+/* Test switching to invalid preferred types */
+taskHelper.push(function testInvalidPreferredNetworkTypes() {
+  let invalidTypes = [
+    ' ',
+    'AnInvalidType'
+  ];
 
-let tests = [
-  testSupportedNetworkTypes,
-  testPreferredNetworkTypes,
-  testInvalidNetworkTypes
-];
+  // Run all test data.
+  (function do_call() {
+    let type = invalidTypes.shift();
+    if (!type) {
+      taskHelper.runNext();
+      return;
+    }
+    doFailToSetPreferredNetworkType(type, "InvalidParameter", do_call);
+  })();
+});
 
-function runNextTest() {
-  let test = tests.shift();
-  if (!test) {
-    cleanUp();
-    return;
-  }
-
-  test();
-}
-
-function cleanUp() {
-  SpecialPowers.removePermission("mobileconnection", document);
-  finish();
-}
-
-runNextTest();
+// Start test
+taskHelper.runNext();
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -407,26 +407,34 @@ this.NETWORK_INFO_MESSAGE_TYPES = [
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM = "wcdma/gsm";
 this.GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY = "gsm";
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY = "wcdma";
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_AUTO = "wcdma/gsm-auto";
 this.GECKO_PREFERRED_NETWORK_TYPE_CDMA_EVDO = "cdma/evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_CDMA_ONLY = "cdma";
 this.GECKO_PREFERRED_NETWORK_TYPE_EVDO_ONLY = "evdo";
 this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO = "wcdma/gsm/cdma/evdo";
+this.GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO = "lte/cdma/evdo";
+this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM = "lte/wcdma/gsm";
+this.GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO = "lte/wcdma/gsm/cdma/evdo";
+this.GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY = "lte";
 this.GECKO_PREFERRED_NETWORK_TYPE_DEFAULT = GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM;
 this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM,
   GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_AUTO,
   GECKO_PREFERRED_NETWORK_TYPE_CDMA_EVDO,
   GECKO_PREFERRED_NETWORK_TYPE_CDMA_ONLY,
   GECKO_PREFERRED_NETWORK_TYPE_EVDO_ONLY,
-  GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO
+  GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM_CDMA_EVDO,
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_CDMA_EVDO,
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM,
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_WCDMA_GSM_CDMA_EVDO,
+  GECKO_PREFERRED_NETWORK_TYPE_LTE_ONLY
 ];
 
 this.GECKO_SUPPORTED_NETWORK_TYPES_DEFAULT = "gsm,wcdma,cdma,evdo";
 this.GECKO_SUPPORTED_NETWORK_TYPES = [
   "gsm",
   "wcdma",
   "cdma",
   "evdo",
@@ -2437,61 +2445,105 @@ this.GECKO_CARDSTATE_UNDETECTED         
 this.GECKO_CARDSTATE_ILLEGAL                       = "illegal";
 this.GECKO_CARDSTATE_UNKNOWN                       = "unknown";
 this.GECKO_CARDSTATE_PIN_REQUIRED                  = "pinRequired";
 this.GECKO_CARDSTATE_PUK_REQUIRED                  = "pukRequired";
 this.GECKO_CARDSTATE_PERSONALIZATION_IN_PROGRESS   = "personalizationInProgress";
 this.GECKO_CARDSTATE_PERSONALIZATION_READY         = "personalizationReady";
 this.GECKO_CARDSTATE_NETWORK_LOCKED                = "networkLocked";
 this.GECKO_CARDSTATE_NETWORK_SUBSET_LOCKED         = "networkSubsetLocked";
+this.GECKO_CARDSTATE_NETWORK1_LOCKED               = "network1Locked";
+this.GECKO_CARDSTATE_NETWORK2_LOCKED               = "network2Locked";
+this.GECKO_CARDSTATE_HRPD_NETWORK_LOCKED           = "hrpdNetworkLocked";
 this.GECKO_CARDSTATE_CORPORATE_LOCKED              = "corporateLocked";
 this.GECKO_CARDSTATE_SERVICE_PROVIDER_LOCKED       = "serviceProviderLocked";
 this.GECKO_CARDSTATE_SIM_LOCKED                    = "simPersonalizationLock";
+this.GECKO_CARDSTATE_RUIM_CORPORATE_LOCKED         = "ruimCorporateLocked";
+this.GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_LOCKED  = "ruimServiceProviderLocked";
+this.GECKO_CARDSTATE_RUIM_LOCKED                   = "ruimPersonalizationLock";
 this.GECKO_CARDSTATE_NETWORK_PUK_REQUIRED          = "networkPukRequired";
 this.GECKO_CARDSTATE_NETWORK_SUBSET_PUK_REQUIRED   = "networkSubsetPukRequired";
+this.GECKO_CARDSTATE_NETWORK1_PUK_REQUIRED         = "network1PukRequired";
+this.GECKO_CARDSTATE_NETWORK2_PUK_REQUIRED         = "network2PukRequired";
+this.GECKO_CARDSTATE_HRPD_NETWORK_PUK_REQUIRED     = "hrpdNetworkPukRequired";
 this.GECKO_CARDSTATE_CORPORATE_PUK_REQUIRED        = "corporatePukRequired";
 this.GECKO_CARDSTATE_SERVICE_PROVIDER_PUK_REQUIRED = "serviceProviderPukRequired";
 this.GECKO_CARDSTATE_SIM_PUK_REQUIRED              = "simPersonalizationPukRequired";
+this.GECKO_CARDSTATE_RUIM_CORPORATE_PUK_REQUIRED   = "ruimCorporatePukRequired";
+this.GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_PUK_REQUIRED = "ruimServiceProviderPukRequired";
+this.GECKO_CARDSTATE_RUIM_PUK_REQUIRED             = "ruimPersonalizationPukRequired";
 this.GECKO_CARDSTATE_READY                         = "ready";
 this.GECKO_CARDSTATE_PERMANENT_BLOCKED             = "permanentBlocked";
 
 this.GECKO_CARDLOCK_PIN      = "pin";
 this.GECKO_CARDLOCK_PIN2     = "pin2";
 this.GECKO_CARDLOCK_PUK      = "puk";
 this.GECKO_CARDLOCK_PUK2     = "puk2";
 this.GECKO_CARDLOCK_FDN      = "fdn";
 this.GECKO_CARDLOCK_NCK      = "nck";
+this.GECKO_CARDLOCK_NCK1     = "nck1";
+this.GECKO_CARDLOCK_NCK2     = "nck2";
+this.GECKO_CARDLOCK_HNCK     = "hnck";
 this.GECKO_CARDLOCK_CCK      = "cck";
 this.GECKO_CARDLOCK_SPCK     = "spck";
+this.GECKO_CARDLOCK_RCCK     = "rcck";
+this.GECKO_CARDLOCK_RSPCK    = "rspck";
 this.GECKO_CARDLOCK_NCK_PUK  = "nckPuk";
+this.GECKO_CARDLOCK_NCK1_PUK = "nck1Puk";
+this.GECKO_CARDLOCK_NCK2_PUK = "nck2Puk";
+this.GECKO_CARDLOCK_HNCK_PUK = "hnckPuk";
 this.GECKO_CARDLOCK_CCK_PUK  = "cckPuk";
 this.GECKO_CARDLOCK_SPCK_PUK = "spckPuk";
+this.GECKO_CARDLOCK_RCCK_PUK = "rcckPuk";
+this.GECKO_CARDLOCK_RSPCK_PUK = "rspckPuk";
 
 // See ril.h RIL_PersoSubstate
 this.PERSONSUBSTATE = {};
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_UNKNOWN] = GECKO_CARDSTATE_UNKNOWN;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_IN_PROGRESS] = GECKO_CARDSTATE_PERSONALIZATION_IN_PROGRESS;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_READY] = GECKO_CARDSTATE_PERSONALIZATION_READY;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK] = GECKO_CARDSTATE_NETWORK_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET] = GECKO_CARDSTATE_NETWORK_SUBSET_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_CORPORATE] = GECKO_CARDSTATE_CORPORATE_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER] = GECKO_CARDSTATE_SERVICE_PROVIDER_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_SIM] = GECKO_CARDSTATE_SIM_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK_PUK] = GECKO_CARDSTATE_NETWORK_PUK_REQUIRED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK] = GECKO_CARDSTATE_NETWORK_SUBSET_PUK_REQUIRED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK] = GECKO_CARDSTATE_CORPORATE_PUK_REQUIRED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK] = GECKO_CARDSTATE_SERVICE_PROVIDER_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_NETWORK1] = GECKO_CARDSTATE_NETWORK1_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_NETWORK2] = GECKO_CARDSTATE_NETWORK2_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_HRPD] = GECKO_CARDSTATE_HRPD_NETWORK_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_CORPORATE] = GECKO_CARDSTATE_RUIM_CORPORATE_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER] = GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_RUIM] = GECKO_CARDSTATE_RUIM_LOCKED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_NETWORK1_PUK] = GECKO_CARDSTATE_NETWORK1_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_NETWORK2_PUK] = GECKO_CARDSTATE_NETWORK2_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_HRPD_PUK] = GECKO_CARDSTATE_HRPD_NETWORK_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_CORPORATE_PUK] = GECKO_CARDSTATE_RUIM_CORPORATE_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK] = GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_PUK_REQUIRED;
+PERSONSUBSTATE[CARD_PERSOSUBSTATE_RUIM_RUIM_PUK] = GECKO_CARDSTATE_RUIM_PUK_REQUIRED;
 
 this.GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK = {};
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK] = CARD_PERSOSUBSTATE_SIM_NETWORK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK1] = CARD_PERSOSUBSTATE_RUIM_NETWORK1;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK2] = CARD_PERSOSUBSTATE_RUIM_NETWORK2;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_HNCK] = CARD_PERSOSUBSTATE_RUIM_HRPD;
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_CCK] = CARD_PERSOSUBSTATE_SIM_CORPORATE;
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_SPCK] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_RCCK] = CARD_PERSOSUBSTATE_RUIM_CORPORATE;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_RSPCK] = CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER;
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK_PUK] = CARD_PERSOSUBSTATE_SIM_NETWORK_PUK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK1_PUK] = CARD_PERSOSUBSTATE_RUIM_NETWORK1_PUK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK2_PUK] = CARD_PERSOSUBSTATE_RUIM_NETWORK2_PUK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_HNCK_PUK] = CARD_PERSOSUBSTATE_RUIM_HRPD_PUK;
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_CCK_PUK] = CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK;
 GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_SPCK_PUK] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_RCCK_PUK] = CARD_PERSOSUBSTATE_RUIM_CORPORATE_PUK;
+GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_RSPCK_PUK] = CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK;
 
 this.GECKO_NETWORK_SELECTION_UNKNOWN   = null;
 this.GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic";
 this.GECKO_NETWORK_SELECTION_MANUAL    = "manual";
 
 this.GECKO_MOBILE_CONNECTION_STATE_UNKNOWN = null;
 this.GECKO_MOBILE_CONNECTION_STATE_NOTSEARCHING = "notSearching";
 this.GECKO_MOBILE_CONNECTION_STATE_SEARCHING = "searching";
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -482,25 +482,35 @@ RilObject.prototype = {
         break;
       case GECKO_CARDLOCK_PUK:
         this.enterICCPUK(options);
         break;
       case GECKO_CARDLOCK_PUK2:
         this.enterICCPUK2(options);
         break;
       case GECKO_CARDLOCK_NCK:
-      case GECKO_CARDLOCK_CCK: // Fall through.
-      case GECKO_CARDLOCK_SPCK: {
+      case GECKO_CARDLOCK_NCK1:
+      case GECKO_CARDLOCK_NCK2:
+      case GECKO_CARDLOCK_HNCK:
+      case GECKO_CARDLOCK_CCK:
+      case GECKO_CARDLOCK_SPCK:
+      case GECKO_CARDLOCK_RCCK: // Fall through.
+      case GECKO_CARDLOCK_RSPCK: {
         let type = GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[options.lockType];
         this.enterDepersonalization(type, options.pin, options);
         break;
       }
       case GECKO_CARDLOCK_NCK_PUK:
-      case GECKO_CARDLOCK_CCK_PUK: // Fall through.
-      case GECKO_CARDLOCK_SPCK_PUK: {
+      case GECKO_CARDLOCK_NCK1_PUK:
+      case GECKO_CARDLOCK_NCK2_PUK:
+      case GECKO_CARDLOCK_HNCK_PUK:
+      case GECKO_CARDLOCK_CCK_PUK:
+      case GECKO_CARDLOCK_SPCK_PUK:
+      case GECKO_CARDLOCK_RCCK_PUK: // Fall through.
+      case GECKO_CARDLOCK_RSPCK_PUK: {
         let type = GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[options.lockType];
         this.enterDepersonalization(type, options.puk, options);
         break;
       }
       default:
         options.errorMsg = "Unsupported Card Lock.";
         options.success = false;
         this.sendChromeMessage(options);
--- a/dom/system/gonk/tests/test_ril_worker_icc.js
+++ b/dom/system/gonk/tests/test_ril_worker_icc.js
@@ -2104,46 +2104,75 @@ add_test(function test_error_message_upd
 
 add_test(function test_personalization_state() {
   let worker = newUint8Worker();
   let context = worker.ContextPool._contexts[0];
   let ril = context.RIL;
 
   context.ICCRecordHelper.readICCID = function fakeReadICCID() {};
 
-  function testPersonalization(cardPersoState, geckoCardState) {
+  function testPersonalization(isCdma, cardPersoState, geckoCardState) {
     let iccStatus = {
       cardState: CARD_STATE_PRESENT,
-      gsmUmtsSubscriptionAppIndex: 0,
+      gsmUmtsSubscriptionAppIndex: (!isCdma) ? 0 : -1,
+      cdmaSubscriptionAppIndex: (isCdma) ? 0 : -1,
       apps: [
         {
           app_state: CARD_APPSTATE_SUBSCRIPTION_PERSO,
           perso_substate: cardPersoState
         }],
     };
 
+    ril._isCdma = isCdma;
     ril._processICCStatus(iccStatus);
     do_check_eq(ril.cardState, geckoCardState);
   }
 
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_NETWORK,
+  // Test GSM personalization state.
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_NETWORK,
                       GECKO_CARDSTATE_NETWORK_LOCKED);
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_CORPORATE,
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_CORPORATE,
                       GECKO_CARDSTATE_CORPORATE_LOCKED);
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER,
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER,
                       GECKO_CARDSTATE_SERVICE_PROVIDER_LOCKED);
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_NETWORK_PUK,
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_NETWORK_PUK,
                       GECKO_CARDSTATE_NETWORK_PUK_REQUIRED);
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK,
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK,
                       GECKO_CARDSTATE_CORPORATE_PUK_REQUIRED);
-  testPersonalization(CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK,
+  testPersonalization(false, CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK,
                       GECKO_CARDSTATE_SERVICE_PROVIDER_PUK_REQUIRED);
-  testPersonalization(CARD_PERSOSUBSTATE_READY,
+  testPersonalization(false, CARD_PERSOSUBSTATE_READY,
                       GECKO_CARDSTATE_PERSONALIZATION_READY);
 
+  // Test CDMA personalization state.
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_NETWORK1,
+                      GECKO_CARDSTATE_NETWORK1_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_NETWORK2,
+                      GECKO_CARDSTATE_NETWORK2_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_HRPD,
+                      GECKO_CARDSTATE_HRPD_NETWORK_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_CORPORATE,
+                      GECKO_CARDSTATE_RUIM_CORPORATE_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER,
+                      GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_RUIM,
+                      GECKO_CARDSTATE_RUIM_LOCKED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_NETWORK1_PUK,
+                      GECKO_CARDSTATE_NETWORK1_PUK_REQUIRED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_NETWORK2_PUK,
+                      GECKO_CARDSTATE_NETWORK2_PUK_REQUIRED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_HRPD_PUK,
+                      GECKO_CARDSTATE_HRPD_NETWORK_PUK_REQUIRED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_CORPORATE_PUK,
+                      GECKO_CARDSTATE_RUIM_CORPORATE_PUK_REQUIRED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK,
+                      GECKO_CARDSTATE_RUIM_SERVICE_PROVIDER_PUK_REQUIRED);
+  testPersonalization(true, CARD_PERSOSUBSTATE_RUIM_RUIM_PUK,
+                      GECKO_CARDSTATE_RUIM_PUK_REQUIRED);
+
   run_next_test();
 });
 
 /**
  * Verify SIM app_state in _processICCStatus
  */
 add_test(function test_card_app_state() {
   let worker = newUint8Worker();
@@ -2291,21 +2320,31 @@ add_test(function test_unlock_card_lock_
   let context = worker.ContextPool._contexts[0];
   let ril = context.RIL;
   let buf = context.Buf;
   const pin = "12345678";
   const puk = "12345678";
 
   let GECKO_CARDLOCK_TO_PASSWORD_TYPE = {};
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK] = "pin";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK1] = "pin";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK2] = "pin";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_HNCK] = "pin";
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_CCK] = "pin";
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_SPCK] = "pin";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_RCCK] = "pin";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_RSPCK] = "pin";
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK_PUK] = "puk";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK1_PUK] = "puk";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_NCK2_PUK] = "puk";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_HNCK_PUK] = "puk";
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_CCK_PUK] = "puk";
   GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_SPCK_PUK] = "puk";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_RCCK_PUK] = "puk";
+  GECKO_CARDLOCK_TO_PASSWORD_TYPE[GECKO_CARDLOCK_RSPCK_PUK] = "puk";
 
   function do_test(aLock, aPassword) {
     buf.sendParcel = function fakeSendParcel () {
       // Request Type.
       do_check_eq(this.readInt32(), REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE);
 
       // Token : we don't care
       this.readInt32();
@@ -2319,21 +2358,31 @@ add_test(function test_unlock_card_lock_
     };
 
     let lock = {lockType: aLock};
     lock[GECKO_CARDLOCK_TO_PASSWORD_TYPE[aLock]] = aPassword;
     ril.iccUnlockCardLock(lock);
   }
 
   do_test(GECKO_CARDLOCK_NCK, pin);
+  do_test(GECKO_CARDLOCK_NCK1, pin);
+  do_test(GECKO_CARDLOCK_NCK2, pin);
+  do_test(GECKO_CARDLOCK_HNCK, pin);
   do_test(GECKO_CARDLOCK_CCK, pin);
   do_test(GECKO_CARDLOCK_SPCK, pin);
+  do_test(GECKO_CARDLOCK_RCCK, pin);
+  do_test(GECKO_CARDLOCK_RSPCK, pin);
   do_test(GECKO_CARDLOCK_NCK_PUK, puk);
+  do_test(GECKO_CARDLOCK_NCK1_PUK, puk);
+  do_test(GECKO_CARDLOCK_NCK2_PUK, puk);
+  do_test(GECKO_CARDLOCK_HNCK_PUK, puk);
   do_test(GECKO_CARDLOCK_CCK_PUK, puk);
   do_test(GECKO_CARDLOCK_SPCK_PUK, puk);
+  do_test(GECKO_CARDLOCK_RCCK_PUK, puk);
+  do_test(GECKO_CARDLOCK_RSPCK_PUK, puk);
 
   run_next_test();
 });
 
 /**
  * Verify MCC and MNC parsing
  */
 add_test(function test_mcc_mnc_parsing() {
--- a/dom/webidl/MozIcc.webidl
+++ b/dom/webidl/MozIcc.webidl
@@ -24,21 +24,25 @@ interface MozIcc : EventTarget
    */
   attribute EventHandler oniccinfochange;
 
   // Integrated Circuit Card State.
 
   /**
    * Indicates the state of the device's ICC.
    *
-   * Possible values: 'illegal', 'unknown', 'pinRequired',
-   * 'pukRequired', 'personalizationInProgress', 'networkLocked',
-   * 'corporateLocked', 'serviceProviderLocked', 'networkPukRequired',
-   * 'corporatePukRequired', 'serviceProviderPukRequired',
-   * 'personalizationReady', 'ready', 'permanentBlocked'.
+   * Possible values: 'illegal', 'unknown', 'pinRequired', 'pukRequired',
+   * 'personalizationInProgress', 'networkLocked', 'network1Locked',
+   * 'network2Locked', 'hrpdNetworkLocked', 'corporateLocked',
+   * 'serviceProviderLocked', 'ruimCorporateLocked', 'ruimServiceProviderLocked',
+   * 'networkPukRequired', 'network1PukRequired', 'network2PukRequired',
+   * 'hrpdNetworkPukRequired', 'corporatePukRequired',
+   * 'serviceProviderPukRequired', 'ruimCorporatePukRequired',
+   * 'ruimServiceProviderPukRequired', 'personalizationReady', 'ready',
+   * 'permanentBlocked'.
    *
    * Once the ICC becomes undetectable, cardstatechange event will be notified.
    * Also, the attribute is set to null and this MozIcc object becomes invalid.
    * Calling asynchronous functions raises exception then.
    */
   readonly attribute DOMString? cardState;
 
   /**
@@ -154,44 +158,104 @@ interface MozIcc : EventTarget
    *                   puk: "...",
    *                   newPin: "..."});
    *
    * (3) Network depersonalization. Unlocking the network control key (NCK).
    *
    *   unlockCardLock({lockType: "nck",
    *                   pin: "..."});
    *
-   * (4) Corporate depersonalization. Unlocking the corporate control key (CCK).
+   * (4) Network type 1 depersonalization. Unlocking the network type 1 control
+   *     key (NCK1).
+   *
+   *   unlockCardLock({lockType: "nck1",
+   *                   pin: "..."});
+   *
+   * (5) Network type 2 depersonalization. Unlocking the network type 2 control
+   *     key (NCK2).
+   *
+   *   unlockCardLock({lockType: "nck2",
+   *                   pin: "..."});
+   *
+   * (6) HRPD network depersonalization. Unlocking the HRPD network control key
+   *     (HNCK).
+   *
+   *   unlockCardLock({lockType: "hnck",
+   *                   pin: "..."});
+   *
+   * (7) Corporate depersonalization. Unlocking the corporate control key (CCK).
    *
    *   unlockCardLock({lockType: "cck",
    *                   pin: "..."});
    *
-   * (5) Service Provider depersonalization. Unlocking the service provider
+   * (8) Service provider depersonalization. Unlocking the service provider
    *     control key (SPCK).
    *
    *   unlockCardLock({lockType: "spck",
    *                   pin: "..."});
    *
-   * (6) Network PUK depersonalization. Unlocking the network control key (NCK).
+   * (9) RUIM corporate depersonalization. Unlocking the RUIM corporate control
+   *     key (RCCK).
+   *
+   *   unlockCardLock({lockType: "rcck",
+   *                   pin: "..."});
+   *
+   * (10) RUIM service provider depersonalization. Unlocking the RUIM service
+   *      provider control key (RSPCK).
+   *
+   *   unlockCardLock({lockType: "rspck",
+   *                   pin: "..."});
+   *
+   * (11) Network PUK depersonalization. Unlocking the network control key (NCK).
    *
    *   unlockCardLock({lockType: "nckPuk",
    *                   puk: "..."});
    *
-   * (7) Corporate PUK depersonalization. Unlocking the corporate control key
-   *     (CCK).
+   * (12) Network type 1 PUK depersonalization. Unlocking the network type 1
+   *      control key (NCK1).
+   *
+   *   unlockCardLock({lockType: "nck1Puk",
+   *                   pin: "..."});
+   *
+   * (13) Network type 2 PUK depersonalization. Unlocking the Network type 2
+   *      control key (NCK2).
+   *
+   *   unlockCardLock({lockType: "nck2Puk",
+   *                   pin: "..."});
+   *
+   * (14) HRPD network PUK depersonalization. Unlocking the HRPD network control
+   *      key (HNCK).
+   *
+   *   unlockCardLock({lockType: "hnckPuk",
+   *                   pin: "..."});
+   *
+   * (15) Corporate PUK depersonalization. Unlocking the corporate control key
+   *      (CCK).
    *
    *   unlockCardLock({lockType: "cckPuk",
    *                   puk: "..."});
    *
-   * (8) Service Provider PUK depersonalization. Unlocking the service provider
-   *     control key (SPCK).
+   * (16) Service provider PUK depersonalization. Unlocking the service provider
+   *      control key (SPCK).
    *
    *   unlockCardLock({lockType: "spckPuk",
    *                   puk: "..."});
    *
+   * (17) RUIM corporate PUK depersonalization. Unlocking the RUIM corporate
+   *      control key (RCCK).
+   *
+   *   unlockCardLock({lockType: "rcckPuk",
+   *                   puk: "..."});
+   *
+   * (18) RUIM service provider PUK depersonalization. Unlocking the service
+   *      provider control key (SPCK).
+   *
+   *   unlockCardLock({lockType: "rspckPuk",
+   *                   puk: "..."});
+   *
    * @return a DOMRequest.
    *         The request's result will be an object containing
    *         information about the unlock operation.
    *
    * Examples:
    *
    * (1) Unlocking failed:
    *