Merge b2g-inbound to m-c. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 14 Jul 2014 16:17:10 -0400
changeset 215811 2bb155ee786b42bcdee7b4266dc9d32dc8bfc971
parent 215759 2a22da38a185ad0421a438bd75d29c566836664a (current diff)
parent 215810 a7a134b2ee1e2be8b21c78efd55f06e294f3d28d (diff)
child 215812 6ac0f97c0c0956f34ba743a731d0f4e1685bb522
child 215861 a4d962f5f0766d4630b706d6a07c579d0fd866c7
child 216002 a9dd41dffb2b55a4e0ccbd52a11d301c64587bef
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone33.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 b2g-inbound to m-c. a=merge
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -1227,63 +1227,16 @@ window.addEventListener('ContentStart', 
   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
 
-#ifdef MOZ_WIDGET_GONK
-let SensorsListener = {
-  sensorsListenerDevices: ['crespo'],
-  device: libcutils.property_get("ro.product.device"),
-
-  deviceNeedsWorkaround: function SensorsListener_deviceNeedsWorkaround() {
-    return (this.sensorsListenerDevices.indexOf(this.device) != -1);
-  },
-
-  handleEvent: function SensorsListener_handleEvent(evt) {
-    switch(evt.type) {
-      case 'devicemotion':
-        // Listener that does nothing, we need this to have the sensor being
-        // able to report correct values, as explained in bug 753245, comment 6
-        // and in bug 871916
-        break;
-
-      default:
-        break;
-    }
-  },
-
-  observe: function SensorsListener_observe(subject, topic, data) {
-    // We remove the listener when the screen is off, otherwise sensor will
-    // continue to bother us with data and we won't be able to get the
-    // system into suspend state, thus draining battery.
-    if (data === 'on') {
-      window.addEventListener('devicemotion', this);
-    } else {
-      window.removeEventListener('devicemotion', this);
-    }
-  },
-
-  init: function SensorsListener_init() {
-    if (this.deviceNeedsWorkaround()) {
-      // On boot, enable the listener, screen will be on.
-      window.addEventListener('devicemotion', this);
-
-      // Then listen for further screen state changes
-      Services.obs.addObserver(this, 'screen-state-changed', false);
-    }
-  }
-}
-
-SensorsListener.init();
-#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
   // sequence, but still has xpcom access.
   Services.obs.addObserver(function clearProfile(subject, topic, data) {
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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="bf9aaf39dd5a6491925a022db167c460f8207d34"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <!-- 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
@@ -12,17 +12,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <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"/>
@@ -126,12 +126,12 @@
   <!-- 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="0e31f35a2a77301e91baa8a237aa9e9fa4076084"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c61e5f15fd62888f2c33d7d542b5b65c38102e8b"/>
   <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="832f4acaf481a19031e479a40b03d9ce5370ddee"/>
-  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
   <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,17 +10,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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="bf9aaf39dd5a6491925a022db167c460f8207d34"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -12,17 +12,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <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"/>
@@ -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="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
   <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": "168c5ba3a072b6c6b30bcc93586f833cc97fff4a", 
+    "revision": "4a5a2ee1fd7ef549f4289bec42046a116b3251c0", 
     "repo_path": "/integration/gaia-central"
 }
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -12,17 +12,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <!-- 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
@@ -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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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,17 +12,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="dc5ca96695cab87b4c2fcd7c9f046ae3415a70a5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <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"/>
@@ -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="dd72bacb432efc5135a1f747d00aab91f898bddb"/>
+  <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="8400a1a850d19f28137880b31582efa3416223c3"/>
   <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,17 +12,17 @@
   <!--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="88e0a972280bb35847c010b8c3f1481fa80f3847"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="f31f95ec18882decc43c0e2f02df581580a32dc8"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9ff55cd0aefea23e4c60e5844c155c6ebc2e632b"/>
   <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="aebf432f334ec0b48eb358569b9dfbfbead48017"/>
   <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/mochitest.ini
+++ b/content/html/content/test/mochitest.ini
@@ -431,23 +431,22 @@ skip-if = toolkit == 'android'
 [test_fullscreen-api.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #TIMED_OUT # b2g(time out, some kind of focus issue) b2g-debug(time out, some kind of focus issue) b2g-desktop(time out, some kind of focus issue)
 [test_hidden.html]
 [test_html_attributes_reflection.html]
 [test_htmlcollection.html]
 [test_iframe_sandbox_general.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_iframe_sandbox_inheritance.html]
-skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
 [test_iframe_sandbox_modal.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #modal tests fail on android # b2g(modal tests fail on B2G) b2g-debug(modal tests fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
 [test_iframe_sandbox_navigation.html]
-skip-if = buildapp == 'b2g' # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #time out on b2g desktop specific
 [test_iframe_sandbox_navigation2.html]
-skip-if = buildapp == 'b2g' || e10s # b2g(Crash, bug 904659) b2g-debug(Crash, bug 904659) b2g-desktop(Crash, bug 904659)
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #time out on b2g desktop specific
 [test_iframe_sandbox_plugins.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
 [test_iframe_sandbox_popups.html]
 skip-if = buildapp == 'b2g' # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
 [test_iframe_sandbox_popups_inheritance.html]
 skip-if = buildapp == 'b2g' || e10s # b2g(multiple concurrent window.open()s fail on B2G) b2g-debug(multiple concurrent window.open()s fail on B2G) b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
 [test_iframe_sandbox_redirect.html]
 [test_iframe_sandbox_same_origin.html]
--- a/dom/bluetooth/bluedroid/BluetoothInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothInterface.cpp
@@ -1,14 +1,16 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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 <errno.h>
+#include <unistd.h>
 #include <sys/socket.h>
 #include "base/message_loop.h"
 #include "BluetoothInterface.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
--- a/dom/fmradio/FMRadioService.cpp
+++ b/dom/fmradio/FMRadioService.cpp
@@ -15,20 +15,16 @@
 #include "nsISettingsService.h"
 #include "nsJSUtils.h"
 #include "nsCxPusher.h"
 
 #define BAND_87500_108000_kHz 1
 #define BAND_76000_108000_kHz 2
 #define BAND_76000_90000_kHz  3
 
-#define CHANNEL_WIDTH_200KHZ 200
-#define CHANNEL_WIDTH_100KHZ 100
-#define CHANNEL_WIDTH_50KHZ  50
-
 #define MOZSETTINGS_CHANGED_ID "mozsettings-changed"
 #define SETTING_KEY_AIRPLANEMODE_ENABLED "airplaneMode.enabled"
 
 using namespace mozilla::hal;
 using mozilla::Preferences;
 
 BEGIN_FMRADIO_NAMESPACE
 
@@ -72,27 +68,38 @@ FMRadioService::FMRadioService()
       break;
     case BAND_87500_108000_kHz:
     default:
       mUpperBoundInKHz = 108000;
       mLowerBoundInKHz = 87500;
       break;
   }
 
-  switch (Preferences::GetInt("dom.fmradio.channelWidth",
-                              CHANNEL_WIDTH_100KHZ)) {
-    case CHANNEL_WIDTH_200KHZ:
-      mChannelWidthInKHz = 200;
+  mChannelWidthInKHz = Preferences::GetInt("dom.fmradio.channelWidth", 100);
+  switch (mChannelWidthInKHz) {
+    case 50:
+    case 100:
+    case 200:
+      break;
+    default:
+      NS_WARNING("Invalid channel width specified in dom.fmradio.channelwidth");
+      mChannelWidthInKHz = 100;
       break;
-    case CHANNEL_WIDTH_50KHZ:
-      mChannelWidthInKHz = 50;
+  }
+
+  mPreemphasis = Preferences::GetInt("dom.fmradio.preemphasis", 50);
+  switch (mPreemphasis) {
+    // values in microseconds
+    case 0:
+    case 50:
+    case 75:
       break;
-    case CHANNEL_WIDTH_100KHZ:
     default:
-      mChannelWidthInKHz = 100;
+      NS_WARNING("Invalid preemphasis specified in dom.fmradio.preemphasis");
+      mPreemphasis = 50;
       break;
   }
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
 
   if (obs && NS_FAILED(obs->AddObserver(this,
                                         MOZSETTINGS_CHANGED_ID,
                                         /* useWeak */ false))) {
@@ -105,37 +112,42 @@ FMRadioService::FMRadioService()
 FMRadioService::~FMRadioService()
 {
   UnregisterFMRadioObserver(this);
 }
 
 class EnableRunnable MOZ_FINAL : public nsRunnable
 {
 public:
-  EnableRunnable(int32_t aUpperLimit, int32_t aLowerLimit, int32_t aSpaceType)
+  EnableRunnable(uint32_t aUpperLimit, uint32_t aLowerLimit, uint32_t aSpaceType, uint32_t aPreemphasis)
     : mUpperLimit(aUpperLimit)
     , mLowerLimit(aLowerLimit)
-    , mSpaceType(aSpaceType) { }
+    , mSpaceType(aSpaceType)
+    , mPreemphasis(aPreemphasis)
+  {
+  }
 
   NS_IMETHOD Run()
   {
     FMRadioSettings info;
     info.upperLimit() = mUpperLimit;
     info.lowerLimit() = mLowerLimit;
     info.spaceType() = mSpaceType;
+    info.preEmphasis() = mPreemphasis;
 
     EnableFMRadio(info);
 
     return NS_OK;
   }
 
 private:
-  int32_t mUpperLimit;
-  int32_t mLowerLimit;
-  int32_t mSpaceType;
+  uint32_t mUpperLimit;
+  uint32_t mLowerLimit;
+  uint32_t mSpaceType;
+  uint32_t mPreemphasis;
 };
 
 /**
  * Read the airplane-mode setting, if the airplane-mode is not enabled, we
  * enable the FM radio.
  */
 class ReadAirplaneModeSettingTask MOZ_FINAL : public nsISettingsServiceCallback
 {
@@ -160,17 +172,18 @@ public:
       return NS_OK;
     }
 
     fmRadioService->mAirplaneModeEnabled = aResult.toBoolean();
     if (!fmRadioService->mAirplaneModeEnabled) {
       EnableRunnable* runnable =
         new EnableRunnable(fmRadioService->mUpperBoundInKHz,
                            fmRadioService->mLowerBoundInKHz,
-                           fmRadioService->mChannelWidthInKHz);
+                           fmRadioService->mChannelWidthInKHz,
+                           fmRadioService->mPreemphasis);
       NS_DispatchToMainThread(runnable);
     } else {
       // Airplane mode is enabled, set the state back to Disabled.
       fmRadioService->TransitionState(ErrorResponse(
         NS_LITERAL_STRING("Airplane mode currently enabled")), Disabled);
     }
 
     return NS_OK;
@@ -452,17 +465,18 @@ FMRadioService::Enable(double aFrequency
         NS_LITERAL_STRING("Can't get settings lock")), Disabled);
     }
 
     return;
   }
 
   NS_DispatchToMainThread(new EnableRunnable(mUpperBoundInKHz,
                                              mLowerBoundInKHz,
-                                             mChannelWidthInKHz));
+                                             mChannelWidthInKHz,
+                                             mPreemphasis));
 }
 
 void
 FMRadioService::Disable(FMRadioReplyRunnable* aReplyRunnable)
 {
   // When airplane-mode is enabled, we will call this function from
   // FMRadioService::Observe without passing a FMRadioReplyRunnable,
   // so we have to check if |aReplyRunnable| is null before we dispatch it.
--- a/dom/fmradio/FMRadioService.h
+++ b/dom/fmradio/FMRadioService.h
@@ -192,19 +192,20 @@ private:
 
   int32_t mPendingFrequencyInKHz;
 
   FMRadioState mState;
 
   bool mHasReadAirplaneModeSetting;
   bool mAirplaneModeEnabled;
 
-  double mUpperBoundInKHz;
-  double mLowerBoundInKHz;
-  double mChannelWidthInKHz;
+  uint32_t mUpperBoundInKHz;
+  uint32_t mLowerBoundInKHz;
+  uint32_t mChannelWidthInKHz;
+  uint32_t mPreemphasis;
 
   nsRefPtr<FMRadioReplyRunnable> mPendingRequest;
 
   FMRadioEventObserverList mObserverList;
 
   static StaticRefPtr<FMRadioService> sFMRadioService;
 };
 
--- a/dom/icc/tests/marionette/test_stk_send_dtmf.js
+++ b/dom/icc/tests/marionette/test_stk_send_dtmf.js
@@ -2,189 +2,178 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_HEAD_JS = "stk_helper.js";
 
 function testSendDTMF(command, expect) {
   log("STK CMD " + JSON.stringify(command));
   is(command.typeOfCommand, iccManager.STK_CMD_SEND_DTMF, expect.name);
   is(command.commandQualifier, expect.commandQualifier, expect.name);
-  if (command.options.text) {
-    is(command.options.text, expect.text, expect.name);
-  }
+  is(command.options.text, expect.text, expect.name);
 
   runNextTest();
 }
 
 let tests = [
   {command: "d01b810301140082028183850953656e642044544d46ac052143658709",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_1",
+   expect: {name: "send_dtmf_cmd_1_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF"}},
+  {command: "d010810301140082028183ac052143658709",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_1_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0138103011400820281838500ac06c1cccccccc2c",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_2",
+   expect: {name: "send_dtmf_cmd_2_with_alpha_identifier",
             commandQualifier: 0x00,
             text: ""}},
+  {command: "d011810301140082028183ac06c1cccccccc2c",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_2_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d01d810301140082028183850a42617369632049636f6eac02c1f29e020001",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_3",
+   expect: {name: "send_dtmf_cmd_3_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Basic Icon"}},
-  {command: "d01b810301140082028183850953656e642044544d46ac052143658709",
+  {command: "d011810301140082028183ac02c1f29e020001",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_4",
-            commandQualifier: 0x00,
-            text: "Send DTMF"}},
+   expect: {name: "send_dtmf_cmd_3_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d01c810301140082028183850953656e642044544d46ac02c1f29e020101",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_5",
+   expect: {name: "send_dtmf_cmd_4_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF"}},
+  {command: "d011810301140082028183ac02c1f29e020101",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_4_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d028810301140082028183851980041704140420041004120421042204120423041904220415ac02c1f2",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_6",
+   expect: {name: "send_dtmf_cmd_5_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "ЗДРАВСТВУЙТЕ"}},
+  {command: "d00d810301140082028183ac02c1f2",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_5_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_7",
+   expect: {name: "send_dtmf_cmd_6_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b00b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_6_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_8",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b01b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_9",
-            commandQualifier: 0x00,
-            text: "Send DTMF 1"}},
-  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_10",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d00400b002b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_11",
-            commandQualifier: 0x00,
-            text: "Send DTMF 1"}},
-  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_12",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b04b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_13",
-            commandQualifier: 0x00,
-            text: "Send DTMF 1"}},
-  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_14",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_15",
-            commandQualifier: 0x00,
-            text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b08b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_16",
-            commandQualifier: 0x00,
-            text: "Send DTMF 1"}},
-  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_17",
+   expect: {name: "send_dtmf_cmd_7_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 2"}},
-  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
+  // send_dtmf_cmd_7_without_alpha_identifier has the same pdu as
+  // send_dtmf_cmd_1_without_alpha_identifier.
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b01b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_18",
-            commandQualifier: 0x00,
-            text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b10b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_19",
+   expect: {name: "send_dtmf_cmd_8_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 1"}},
-  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_20",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
+  {command: "d016810301140082028183ac052143658709d004000b01b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_21",
-            commandQualifier: 0x00,
-            text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b20b4",
+   expect: {name: "send_dtmf_cmd_8_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d00400b002b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_22",
+   expect: {name: "send_dtmf_cmd_9_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 1"}},
-  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_23",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
-  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
+  {command: "d016810301140082028183ac052143658709d00400b002b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_24",
-            commandQualifier: 0x00,
-            text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b40b4",
+   expect: {name: "send_dtmf_cmd_9_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b04b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_25",
+   expect: {name: "send_dtmf_cmd_10_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b04b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_10_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_26",
+   expect: {name: "send_dtmf_cmd_11_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 2"}},
-  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_27",
-            commandQualifier: 0x00,
-            text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b80b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_28",
-            commandQualifier: 0x00,
-            text: "Send DTMF 1"}},
-  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
-   func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_29",
-            commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
+  // send_dtmf_cmd_11_without_alpha_identifier has the same pdu as
+  // send_dtmf_cmd_6_without_alpha_identifier.
   {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_30",
+   expect: {name: "send_dtmf_cmd_12_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 3"}},
-  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4",
+  // send_dtmf_cmd_12_without_alpha_identifier has the same pdu as
+  // send_dtmf_cmd_1_without_alpha_identifier.
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b08b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_13_with_alpha_identifier",
+            commandQualifier: 0x00,
+            text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b08b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_31",
+   expect: {name: "send_dtmf_cmd_13_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b10b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_14_with_alpha_identifier",
+            commandQualifier: 0x00,
+            text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b10b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_14_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b20b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_15_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "Send DTMF 1"}},
-  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
+  {command: "d016810301140082028183ac052143658709d004000b20b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_15_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b40b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_16_with_alpha_identifier",
+            commandQualifier: 0x00,
+            text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b40b4",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_32",
+   expect: {name: "send_dtmf_cmd_16_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b80b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_17_with_alpha_identifier",
             commandQualifier: 0x00,
-            text: "Send DTMF 2"}},
+            text: "Send DTMF 1"}},
+  {command: "d016810301140082028183ac052143658709d004000b80b4",
+   func: testSendDTMF,
+   expect: {name: "send_dtmf_cmd_17_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0148103011400820281838505804f60597dac02c1f2",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_33",
+   expect: {name: "send_dtmf_cmd_18_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "你好"}},
+  // send_dtmf_cmd_18_without_alpha_identifier has the same pdu as
+  // send_dtmf_cmd_5_without_alpha_identifier.
   {command: "d01281030114008202818385038030ebac02c1f2",
    func: testSendDTMF,
-   expect: {name: "send_dtmf_cmd_34",
+   expect: {name: "send_dtmf_cmd_19_with_alpha_identifier",
             commandQualifier: 0x00,
             text: "ル"}}
+  // send_dtmf_cmd_19_without_alpha_identifier has the same pdu as
+  // send_dtmf_cmd_5_without_alpha_identifier.
 ];
 
 runNextTest();
--- a/dom/icc/tests/marionette/test_stk_send_sms.js
+++ b/dom/icc/tests/marionette/test_stk_send_sms.js
@@ -2,239 +2,264 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_HEAD_JS = "stk_helper.js";
 
 function testSendSMS(command, expect) {
   log("STK CMD " + JSON.stringify(command));
   is(command.typeOfCommand, iccManager.STK_CMD_SEND_SMS, expect.name);
   is(command.commandQualifier, expect.commandQualifier, expect.name);
-  if (command.options.text) {
-    is(command.options.text, expect.title, expect.name);
-  }
+  is(command.options.text, expect.title, expect.name);
 
   runNextTest();
 }
 
 let tests = [
   {command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_1",
+   expect: {name: "send_sms_cmd_1_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Send SM"}},
+  {command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_1_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_2",
+   expect: {name: "send_sms_cmd_2_with_alpha_identifier",
             commandQualifier: 0x01,
             title: "Send SM"}},
+  {command: "d02981030113018202818386099111223344556677f88b130100099110325476f840f40753656e6420534d",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_2_without_alpha_identifier",
+            commandQualifier: 0x01}},
   {command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_3",
+   expect: {name: "send_sms_cmd_3_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Short Message"}},
+  {command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_3_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_4",
+   expect: {name: "send_sms_cmd_4_with_alpha_identifier",
             commandQualifier: 0x01,
             title: "The address data object holds the RP_Destination_Address"}},
+  {command: "d081c381030113018202818386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_4_without_alpha_identifier",
+            commandQualifier: 0x01}},
   {command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_5",
+   expect: {name: "send_sms_cmd_5_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "The address data object holds the RP Destination Address"}},
+  {command: "d081af81030113008202818386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_5_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_6",
+   expect: {name: "send_sms_cmd_6_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Two types are defined: - A short message to be sent to the network in an SMS-SUBMIT message, or an SMS-COMMAND message, where the user data can be passed transparently; - A short message to be sent to the network in an SMS-SUBMIT "}},
+  {command: "d0148103011300820281838b09010002911040f00120",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_6_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_7",
+   expect: {name: "send_sms_cmd_7_with_alpha_identifier",
             commandQualifier: 0x00,
             title: ""}},
+  // send_sms_cmd_7_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_1_without_alpha_identifier.
   {command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_8",
+   expect: {name: "send_sms_cmd_8_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "ЗДРАВСТВУЙТЕ"}},
+  {command: "d03a81030113008202818386099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_8_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_9",
+   expect: {name: "send_sms_cmd_9_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "ЗДРАВСТВУЙТЕ"}},
-  {command: "d04c8103011300820281838510820c041087849080829192829389928586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_9",
-            commandQualifier: 0x00,
-            title: "ЗДРАВСТВУЙТЕ"}},
+  // send_sms_cmd_9_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_8_without_alpha_identifier.
   {command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_10",
+   expect: {name: "send_sms_cmd_10_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "NO ICON"}},
+  {command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_10_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_11",
+   expect: {name: "send_sms_cmd_11_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Send SM"}},
+  {command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_11_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_12",
+   expect: {name: "send_sms_cmd_12_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001000b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_12_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_13",
+   expect: {name: "send_sms_cmd_13_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
+  // send_sms_cmd_18_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_6_without_alpha_identifier.
   {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_14",
+   expect: {name: "send_sms_cmd_14_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
+  {command: "d01a8103011300820281838b09010002911040f00120d004001001b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_15",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+   expect: {name: "send_sms_cmd_14_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_16",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_17",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_18",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_19",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_20",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_21",
+   expect: {name: "send_sms_cmd_15_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001002b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_15_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_16_with_alpha_identifier",
+            commandQualifier: 0x00,
+            title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001004b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_16_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_22",
+   expect: {name: "send_sms_cmd_17_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_23",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_24",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_25",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+  // send_sms_cmd_17_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_12_without_alpha_identifier.
   {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_26",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_27",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_28",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_29",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_30",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_31",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_32",
+   expect: {name: "send_sms_cmd_18_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4",
+  // send_sms_cmd_18_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_6_without_alpha_identifier.
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_33",
+   expect: {name: "send_sms_cmd_19_with_alpha_identifier",
+            commandQualifier: 0x00,
+            title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001008b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_19_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_20_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
-   func: testSendSMS,
-   expect: {name: "send_sms_cmd_34",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
+  {command: "d01a8103011300820281838b09010002911040f00120d004001010b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_35",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
+   expect: {name: "send_sms_cmd_20_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_36",
+   expect: {name: "send_sms_cmd_21_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
+  {command: "d01a8103011300820281838b09010002911040f00120d004001020b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_21_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_22_with_alpha_identifier",
+            commandQualifier: 0x00,
+            title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001040b4",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_37",
+   expect: {name: "send_sms_cmd_22_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_23_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+            title: "Text Attribute 1"}},
+  {command: "d01a8103011300820281838b09010002911040f00120d004001080b4",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_23_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_38",
+   expect: {name: "send_sms_cmd_24_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "中一"}},
+  {command: "d02681030113008202818386099111223344556677f88b100100099110325476f84008044e2d4e00",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_24_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_39",
+   expect: {name: "send_sms_cmd_25_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "中一"}},
+  // send_sms_cmd_25_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_24_without_alpha_identifier.
   {command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_40",
+   expect: {name: "send_sms_cmd_26_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "中一"}},
+  // send_sms_cmd_26_without_alpha_identifier has the same pdu as
+  // send_sms_cmd_24_without_alpha_identifier.
   {command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_41",
+   expect: {name: "send_sms_cmd_27_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "80ル0"}},
+  {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0031",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_27_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_42",
+   expect: {name: "send_sms_cmd_28_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "81ル1"}},
+  {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0032",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_28_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033",
    func: testSendSMS,
-   expect: {name: "send_sms_cmd_43",
+   expect: {name: "send_sms_cmd_29_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "82ル2"}}
+            title: "82ル2"}},
+  {command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0033",
+   func: testSendSMS,
+   expect: {name: "send_sms_cmd_29_without_alpha_identifier",
+            commandQualifier: 0x00}}
 ];
 
 runNextTest();
--- a/dom/icc/tests/marionette/test_stk_send_ss.js
+++ b/dom/icc/tests/marionette/test_stk_send_ss.js
@@ -2,199 +2,201 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_HEAD_JS = "stk_helper.js";
 
 function testSendSS(command, expect) {
   log("STK CMD " + JSON.stringify(command));
   is(command.typeOfCommand, iccManager.STK_CMD_SEND_SS, expect.name);
   is(command.commandQualifier, expect.commandQualifier, expect.name);
-  if (command.options.text) {
-    is(command.options.text, expect.title, expect.name);
-  }
+  is(command.options.text, expect.title, expect.name);
 
   runNextTest();
 }
 
 let tests = [
   {command: "d029810301110082028183850c43616c6c20466f7277617264891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_1",
+   expect: {name: "send_ss_cmd_1_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Call Forward"}},
+  {command: "d01b810301110082028183891091aa120a214365870921436587a901fb",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_1_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02d810301110082028183850c43616c6c20466f7277617264891491aa120a21436587092143658709214365a711fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_2",
+   expect: {name: "send_ss_cmd_2_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Call Forward"}},
+  {command: "d01f810301110082028183891491aa120a21436587092143658709214365a711fb",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_2_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d081fd8103011100820281838581eb4576656e20696620746865204669786564204469616c6c696e67204e756d626572207365727669636520697320656e61626c65642c2074686520737570706c656d656e74617279207365727669636520636f6e74726f6c20737472696e6720696e636c7564656420696e207468652053454e442053532070726f61637469766520636f6d6d616e64207368616c6c206e6f7420626520636865636b656420616761696e73742074686f7365206f66207468652046444e206c6973742e2055706f6e20726563656976696e67207468697320636f6d6d616e642c20746865204d45207368616c6c20646563698904ffba13fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_3",
+   expect: {name: "send_ss_cmd_3_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Even if the Fixed Dialling Number service is enabled, the supplementary service control string included in the SEND SS proactive command shall not be checked against those of the FDN list. Upon receiving this command, the ME shall deci"}},
+  {command: "d00f8103011100820281838904ffba13fb",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_3_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d01d8103011100820281838500891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_4",
+   expect: {name: "send_ss_cmd_4_with_alpha_identifier",
             commandQualifier: 0x00,
             title: ""}},
+  // send_ss_cmd_4_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
   {command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020001",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_5",
+   expect: {name: "send_ss_cmd_5_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Basic Icon"}},
+  {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020001",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_5_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02c810301110082028183850b436f6c6f75722049636f6e891091aa120a214365870921436587a901fb9e020002",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_6",
+   expect: {name: "send_ss_cmd_6_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Colour Icon"}},
+  {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020002",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_6_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020101",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_7",
+   expect: {name: "send_ss_cmd_7_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Basic Icon"}},
+  {command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020101",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_7_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d036810301110082028183851980041704140420041004120421042204120423041904220415891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_8",
+   expect: {name: "send_ss_cmd_8_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "ЗДРАВСТВУЙТЕ"}},
+  // send_ss_cmd_8_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
   {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001000b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_9",
+   expect: {name: "send_ss_cmd_9_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_10",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001001b4",
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001000b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_11",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_12",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001002b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_13",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
+   expect: {name: "send_ss_cmd_9_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_14",
+   expect: {name: "send_ss_cmd_10_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001004b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_15",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
+  // send_ss_cmd_10_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001001b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_16",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_17",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001008b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_18",
+   expect: {name: "send_ss_cmd_11_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001001b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_11_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001002b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_12_with_alpha_identifier",
+            commandQualifier: 0x00,
+            title: "Text Attribute 1"}},
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001002b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_12_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001004b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_13_with_alpha_identifier",
+            commandQualifier: 0x00,
+            title: "Text Attribute 1"}},
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001004b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_13_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_19",
+   expect: {name: "send_ss_cmd_14_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_20",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001010b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_21",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_22",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+  // send_ss_cmd_14_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_9_without_alpha_identifier.
   {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_23",
+   expect: {name: "send_ss_cmd_15_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001020b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_24",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
+  // send_ss_cmd_15_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001008b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_25",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_26",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001040b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_27",
+   expect: {name: "send_ss_cmd_16_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001008b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_28",
+   expect: {name: "send_ss_cmd_16_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001010b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_17_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
+            title: "Text Attribute 1"}},
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001010b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_29",
+   expect: {name: "send_ss_cmd_17_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001020b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_18_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001080b4",
+            title: "Text Attribute 1"}},
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001020b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_30",
+   expect: {name: "send_ss_cmd_18_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001040b4",
+   func: testSendSS,
+   expect: {name: "send_ss_cmd_19_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
-   func: testSendSS,
-   expect: {name: "send_ss_cmd_31",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001040b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_32",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001000b4",
+   expect: {name: "send_ss_cmd_19_without_alpha_identifier",
+            commandQualifier: 0x00}},
+  {command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001080b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_33",
+   expect: {name: "send_ss_cmd_20_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb",
+  {command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001080b4",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_34",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+   expect: {name: "send_ss_cmd_20_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0228103011100820281838505804f60597d891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_35",
+   expect: {name: "send_ss_cmd_21_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "你好"}},
+  // send_ss_cmd_21_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
   {command: "d02081030111008202818385038030eb891091aa120a214365870921436587a901fb",
    func: testSendSS,
-   expect: {name: "send_ss_cmd_36",
+   expect: {name: "send_ss_cmd_22_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "ル"}}
+            title: "ル"}},
+  // send_ss_cmd_22_without_alpha_identifier has the same pdu as
+  // send_ss_cmd_1_without_alpha_identifier.
 ];
 
 runNextTest();
--- a/dom/icc/tests/marionette/test_stk_send_ussd.js
+++ b/dom/icc/tests/marionette/test_stk_send_ussd.js
@@ -2,204 +2,208 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_HEAD_JS = "stk_helper.js";
 
 function testSendUSSD(command, expect) {
   log("STK CMD " + JSON.stringify(command));
   is(command.typeOfCommand, iccManager.STK_CMD_SEND_USSD, expect.name);
   is(command.commandQualifier, expect.commandQualifier, expect.name);
-  if (command.options.text) {
-    is(command.options.text, expect.title, expect.name);
-  }
+  is(command.options.text, expect.title, expect.name);
 
   runNextTest();
 }
 
 let tests = [
   {command: "d050810301120082028183850a372d62697420555353448a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_1",
+   expect: {name: "send_ussd_cmd_1_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "7-bit USSD"}},
+  {command: "d0448103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_1_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d058810301120082028183850a382d62697420555353448a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_2",
+   expect: {name: "send_ussd_cmd_2_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "8-bit USSD"}},
+  {command: "d04c8103011200820281838a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_2_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d02f81030112008202818385095543533220555353448a1948041704140420041004120421042204120423041904220415",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_3",
+   expect: {name: "send_ussd_cmd_3_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "UCS2 USSD"}},
+  {command: "d0248103011200820281838a1948041704140420041004120421042204120423041904220415",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_3_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d081fd8103011200820281838581b66f6e636520612052454c4541534520434f4d504c455445206d65737361676520636f6e7461696e696e672074686520555353442052657475726e20526573756c74206d657373616765206e6f7420636f6e7461696e696e6720616e206572726f7220686173206265656e2072656365697665642066726f6d20746865206e6574776f726b2c20746865204d45207368616c6c20696e666f726d207468652053494d20746861742074686520636f6d6d616e64206861738a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_4",
+   expect: {name: "send_ussd_cmd_4_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "once a RELEASE COMPLETE message containing the USSD Return Result message not containing an error has been received from the network, the ME shall inform the SIM that the command has"}},
+  // send_ussd_cmd_4_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d04681030112008202818385008a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_5",
+   expect: {name: "send_ussd_cmd_5_with_alpha_identifier",
          commandQualifier: 0x00,
          title: ""}},
+  // send_ussd_cmd_5_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_6",
+   expect: {name: "send_ussd_cmd_6_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Basic Icon"}},
+  {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_6_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_7",
+   expect: {name: "send_ussd_cmd_7_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Color Icon"}},
+  {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_7_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_8",
+   expect: {name: "send_ussd_cmd_8_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Basic Icon"}},
+  {command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_8_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_9",
+   expect: {name: "send_ussd_cmd_9_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "ЗДРАВСТВУЙТЕ"}},
+  // send_ussd_cmd_9_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_10",
+   expect: {name: "send_ussd_cmd_10_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_10_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_11",
+   expect: {name: "send_ussd_cmd_11_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
+  // send_ussd_cmd_11_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_12",
+   expect: {name: "send_ussd_cmd_12_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_13",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+   expect: {name: "send_ussd_cmd_12_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_14",
+   expect: {name: "send_ussd_cmd_13_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_15",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+   expect: {name: "send_ussd_cmd_13_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_16",
+   expect: {name: "send_ussd_cmd_14_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4",
+   func: testSendUSSD,
+   expect: {name: "send_ussd_cmd_14_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_17",
+   expect: {name: "send_ussd_cmd_15_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 2"}},
+  // send_ussd_cmd_15_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_10_with_alpha_identifier.
   {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_18",
+   expect: {name: "send_ussd_cmd_16_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 3"}},
+  // send_ussd_cmd_16_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_19",
+   expect: {name: "send_ussd_cmd_17_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_20",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_21",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
+   expect: {name: "send_ussd_cmd_17_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_22",
+   expect: {name: "send_ussd_cmd_18_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_23",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_24",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
+   expect: {name: "send_ussd_cmd_18_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_25",
+   expect: {name: "send_ussd_cmd_19_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_26",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_27",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
+   expect: {name: "send_ussd_cmd_19_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_28",
+   expect: {name: "send_ussd_cmd_20_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_29",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_30",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
+   expect: {name: "send_ussd_cmd_20_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_31",
+   expect: {name: "send_ussd_cmd_21_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "Text Attribute 1"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_32",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
+  {command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_33",
-            commandQualifier: 0x00,
-            title: "Text Attribute 3"}},
-  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_34",
-            commandQualifier: 0x00,
-            title: "Text Attribute 1"}},
-  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
-   func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_35",
-            commandQualifier: 0x00,
-            title: "Text Attribute 2"}},
+   expect: {name: "send_ussd_cmd_21_without_alpha_identifier",
+            commandQualifier: 0x00}},
   {command: "d04b8103011200820281838505804f60597d8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_36",
+   expect: {name: "send_ussd_cmd_22_with_alpha_identifier",
             commandQualifier: 0x00,
             title: "你好"}},
+  // send_ussd_cmd_22_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
   {command: "d04981030112008202818385038030eb8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    func: testSendUSSD,
-   expect: {name: "send_ussd_cmd_37",
+   expect: {name: "send_ussd_cmd_23_with_alpha_identifier",
             commandQualifier: 0x00,
-            title: "ル"}}
+            title: "ル"}},
+  // send_ussd_cmd_23_without_alpha_identifier has the same pdu as
+  // send_ussd_cmd_1_without_alpha_identifier.
 ];
 
 runNextTest();
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -10675,23 +10675,19 @@ StkCommandParamsFactoryObject.prototype 
     return input;
   },
 
   processEventNotify: function(cmdDetails, ctlvs) {
     let textMsg = {};
 
     let ctlv = this.context.StkProactiveCmdHelper.searchForTag(
         COMPREHENSIONTLV_TAG_ALPHA_ID, ctlvs);
-    if (!ctlv) {
-      this.context.RIL.sendStkTerminalResponse({
-        command: cmdDetails,
-        resultCode: STK_RESULT_REQUIRED_VALUES_MISSING});
-      throw new Error("Stk Event Notfiy: Required value missing : Alpha ID");
-    }
-    textMsg.text = ctlv.value.identifier;
+    if (ctlv) {
+      textMsg.text = ctlv.value.identifier;
+    }
 
     return textMsg;
   },
 
   processSetupCall: function(cmdDetails, ctlvs) {
     let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
     let call = {};
     let iter = Iterator(ctlvs);
@@ -12262,16 +12258,18 @@ ICCIOHelperObject.prototype[ICC_COMMAND_
   this.processICCIOUpdateRecord(options);
 };
 
 /**
  * Helper for ICC records.
  */
 function ICCRecordHelperObject(aContext) {
   this.context = aContext;
+  // Cache the possible free record id for all files, use fileId as key.
+  this._freeRecordIds = {};
 }
 ICCRecordHelperObject.prototype = {
   context: null,
 
   /**
    * Fetch ICC records.
    */
   fetchICCRecords: function() {
@@ -12739,16 +12737,21 @@ ICCRecordHelperObject.prototype = {
       recordNumber: recordNumber,
       dataWriter: dataWriter,
       callback: onsuccess,
       onerror: onerror
     });
   },
 
   /**
+   * Cache the possible free record id for all files.
+   */
+  _freeRecordIds: null,
+
+  /**
    * Find free record id.
    *
    * @param fileId      EF id.
    * @param onsuccess   Callback to be called when success.
    * @param onerror     Callback to be called when error.
    */
   findFreeRecordId: function(fileId, onsuccess, onerror) {
     let ICCIOHelper = this.context.ICCIOHelper;
@@ -12764,40 +12767,48 @@ ICCRecordHelperObject.prototype = {
       while (readLen < octetLen) {
         let octet = GsmPDUHelper.readHexOctet();
         readLen++;
         if (octet != 0xff) {
           break;
         }
       }
 
+      let nextRecord = (options.p1 % options.totalRecords) + 1;
+
       if (readLen == octetLen) {
-        // Find free record.
+        // Find free record, assume next record is probably free.
+        this._freeRecordIds[fileId] = nextRecord;
         if (onsuccess) {
           onsuccess(options.p1);
         }
         return;
       } else {
         Buf.seekIncoming((octetLen - readLen) * Buf.PDU_HEX_OCTET_SIZE);
       }
 
       Buf.readStringDelimiter(strLen);
 
-      if (options.p1 < options.totalRecords) {
-        ICCIOHelper.loadNextRecord(options);
+      if (nextRecord !== recordNumber) {
+        options.p1 = nextRecord;
+        this.context.RIL.iccIO(options);
       } else {
         // No free record found.
+        delete this._freeRecordIds[fileId];
         if (DEBUG) {
           this.context.debug(CONTACT_ERR_NO_FREE_RECORD_FOUND);
         }
         onerror(CONTACT_ERR_NO_FREE_RECORD_FOUND);
       }
     }
 
+    // Start searching free records from the possible one.
+    let recordNumber = this._freeRecordIds[fileId] || 1;
     ICCIOHelper.loadLinearFixedEF({fileId: fileId,
+                                   recordNumber: recordNumber,
                                    callback: callback.bind(this),
                                    onerror: onerror});
   },
 };
 
 /**
  * Helper for (U)SIM Records.
  */
@@ -14359,41 +14370,56 @@ ICCContactHelperObject.prototype = {
         if (DEBUG) {
           this.context.debug("Unsupported contactType :" + contactType);
         }
         onerror(CONTACT_ERR_CONTACT_TYPE_NOT_SUPPORTED);
         break;
     }
   },
 
+  /**
+   * Cache the pbr index of the possible free record.
+   */
+  _freePbrIndex: 0,
+
    /**
     * Find free ADN record id in USIM.
     *
     * @param pbrs          All Phonebook Reference Files read.
     * @param onsuccess     Callback to be called when success.
     * @param onerror       Callback to be called when error.
     */
   findUSimFreeADNRecordId: function(pbrs, onsuccess, onerror) {
     let ICCRecordHelper = this.context.ICCRecordHelper;
 
+    function callback(pbrIndex, recordId) {
+      // Assume other free records are probably in the same phonebook set.
+      this._freePbrIndex = pbrIndex;
+      onsuccess(pbrIndex, recordId);
+    }
+
+    let nextPbrIndex = -1;
     (function findFreeRecordId(pbrIndex) {
-      if (pbrIndex >= pbrs.length) {
+      if (nextPbrIndex === this._freePbrIndex) {
+        // No free record found, reset the pbr index of free record.
+        this._freePbrIndex = 0;
         if (DEBUG) {
           this.context.debug(CONTACT_ERR_NO_FREE_RECORD_FOUND);
         }
         onerror(CONTACT_ERR_NO_FREE_RECORD_FOUND);
         return;
       }
 
       let pbr = pbrs[pbrIndex];
+      nextPbrIndex = (pbrIndex + 1) % pbrs.length;
       ICCRecordHelper.findFreeRecordId(
         pbr.adn.fileId,
-        onsuccess.bind(this, pbrIndex),
-        findFreeRecordId.bind(null, pbrIndex + 1));
-    })(0);
+        callback.bind(this, pbrIndex),
+        findFreeRecordId.bind(this, nextPbrIndex));
+    }).call(this, this._freePbrIndex);
   },
 
   /**
    * Helper function to add a new ICC contact.
    *
    * @param appType       One of CARD_APPTYPE_*.
    * @param contactType   "adn" or "fdn".
    * @param contact       The contact will be added.
--- a/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js
+++ b/dom/system/gonk/tests/test_ril_worker_icc_ICCRecordHelper.js
@@ -588,18 +588,19 @@ add_test(function test_update_adn_like()
  */
 add_test(function test_find_free_record_id() {
   let worker = newUint8Worker();
   let context = worker.ContextPool._contexts[0];
   let pduHelper = context.GsmPDUHelper;
   let recordHelper = context.ICCRecordHelper;
   let buf = context.Buf;
   let io  = context.ICCIOHelper;
+  let ril = context.RIL;
 
-  function writeRecord (record) {
+  function writeRecord(record) {
     // Write data size
     buf.writeInt32(record.length * 2);
 
     for (let i = 0; i < record.length; i++) {
       pduHelper.writeHexOctet(record[i]);
     }
 
     // Write string delimiter
@@ -612,20 +613,19 @@ add_test(function test_find_free_record_
     options.p1 = 1;
     options.totalRecords = 2;
     writeRecord(record);
     if (options.callback) {
       options.callback(options);
     }
   };
 
-  io.loadNextRecord = function fakeLoadNextRecord(options) {
+  ril.iccIO = function fakeIccIO(options) {
     // Unused bytes.
     let record = [0xff, 0xff, 0xff, 0xff, 0xff];
-    options.p1++;
     writeRecord(record);
     if (options.callback) {
       options.callback(options);
     }
   };
 
   let fileId = 0x0000; // Dummy.
   recordHelper.findFreeRecordId(
--- a/dom/tests/mochitest/bugs/child_bug260264.html
+++ b/dom/tests/mochitest/bugs/child_bug260264.html
@@ -1,14 +1,11 @@
 <html>
   <head>
-    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-    <script type="application/javascript" src="utils_bug260264.js"></script>
   </head>
   <body>
     <iframe id="frame"></iframe>
     <script type="application/javascript">
-      document.getElementById("frame").src =
-        alter_file(alter_host(location.href, "mochi.test:8888"),
-                   "grandchild_bug260264.html");
+      var tempstr = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')+1);
+      document.getElementById("frame").src = "http://mochi.test:8888" + tempstr + "grandchild_bug260264.html" + window.location.hash;
     </script>
   </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug260264.html
+++ b/dom/tests/mochitest/bugs/test_bug260264.html
@@ -20,125 +20,165 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 260264 **/
 
 SimpleTest.waitForExplicitFinish();
 
-/**
- * These functions can be called without arguments to retrieve the current
- * value of the preference/privilege, or called with a single argument to set
- * the preference/privilege to a new value.
- *
- * In other words, they obey the interface that |hold| expects its |accessor|
- * parameter to obey.
- */
-var popupMax = makePrefAccessor("dom.popup_maximum"),
-    popupEvents = makePrefAccessor("dom.popup_allowed_events"),
-    blockPopups = makePrefAccessor("dom.disable_open_during_load"),
-    ownPopupPriv = makePopupPrivAccessor(location.href);
-
 var a = $("link"),
     checkOpened = function() { ok(window.open("http://example.com"), "not properly opened") },
     checkBlocked = function() { ok(!window.open("http://example.com"), "not properly blocked") };
 
-/**
- * Intentional popups are not limited by dom.popup_maximum.
- */
-function testIntentional(event) {
-  hold(popupMax, 3, function() {
-    send(a, event, checkOpened);
-    send(a, event, checkOpened);
-    send(a, event, checkOpened);
-    send(a, event, checkOpened);
-  });
+
+function run_tests() {
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
   window.open.close();
+
+  SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests2);
 }
 
-/**
- * Probably-intentional popups are limited only by dom.popup_maximum, and
- * closing the popup window immediately allows another to open.
- */
-function testProbablyIntentional(event) {
-  var max = 3;
-  hold(popupMax, max, function() {
-    for (var count = 0, n = 0; n < max; n++)
-      send(a, event, function() { if (window.open("http://example.com")) count++ });
-    send(a, event, checkBlocked);
-    window.open.close(1);
-    send(a, event, checkOpened);
-    send(a, event, checkBlocked);
-    send(a, event, checkBlocked);
-    window.open.close();
-    ok(count > 0, "Windows left open by previous tests?");
-    while (count --> 0)
-      send(a, event, checkOpened);
-    send(a, event, checkBlocked);
+function run_tests2() {
+  for (var count = 0, n = 0; n < 3; n++)
+    send(a, "mouseup", function() { if (window.open("http://example.com")) count++ });
+  send(a, "mouseup", checkBlocked);
+  window.open.close(1);
+  send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkBlocked);
+  send(a, "mouseup", checkBlocked);
+  window.open.close();
+  ok(count > 0, "Windows left open by previous tests?");
+  while (count --> 0)
+    send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkBlocked);
+  window.open.close();
+
+  SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 2]]}, run_tests3);
+}
+
+function run_tests3() {
+  send(a, "mouseover", checkBlocked);
+  window.open.close();
+  SpecialPowers.pushPermissions([{'type': 'popup', 'allow': ALLOW_ACTION, 'context': document}], function() {
+    SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests4);
   });
-  window.open.close();
 }
 
-/**
- * Probably-unintentional popups are forbidden entirely.
- */
-function testProbablyUnintentional(event) {
-  hold(popupMax, 2, function() {
-    send(a, event, checkBlocked);
-  });
+function run_tests4() {
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  window.open.close();
+
+  send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkOpened);
+  window.open.close();
+
+  for (var count = 0, n = 0; n < 3; n++)
+    send(a, "mouseover", function() { if (window.open("http://example.com")) count++ });
+  send(a, "mouseover", checkBlocked);
+  window.open.close(1);
+  send(a, "mouseover", checkOpened);
+  send(a, "mouseover", checkBlocked);
+  send(a, "mouseover", checkBlocked);
   window.open.close();
+  ok(count > 0, "Windows left open by previous tests?");
+  while (count --> 0)
+    send(a, "mouseover", checkOpened);
+  send(a, "mouseover", checkBlocked);
+  window.open.close();
+
+  SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events", "click"]]}, run_tests5);
+}
+
+function run_tests5() {
+  SpecialPowers.pushPermissions([{'type': 'popup', 'allow': DENY_ACTION, 'context': document}], run_tests6);
+}
+
+function run_tests6() {
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  window.open.close();
+
+  SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 2]]}, run_tests7);
 }
 
-/**
- * Please be patient; run_tests opens/closes a LOT of windows.
- */
-function run_tests() {
-  hold(popupEvents, "click mouseup", function() {
-    // Note: UNKNOWN_ACTION is the same as DENY_ACTION.
-    hold(ownPopupPriv, DENY_ACTION, function() {
-      testIntentional("click");
-      testProbablyIntentional("mouseup");
-      testProbablyUnintentional("mouseover");
-    });
-    hold(ownPopupPriv, ALLOW_ACTION, function() {
-      testIntentional("click");
-      testIntentional("mouseup");
-      testProbablyIntentional("mouseover");
-    });
+function run_tests7() {
+  send(a, "mouseup", checkBlocked);
+  window.open.close();
+  send(a, "mouseover", checkBlocked);
+  window.open.close();
+
+  SpecialPowers.pushPermissions([{'type': 'popup', 'allow': ALLOW_ACTION, 'context': document}], function() {
+    SpecialPowers.pushPrefEnv({"set": [["dom.popup_maximum", 3]]}, run_tests8);
   });
+}
 
-  hold(popupEvents, "click", function() {
-    // Note: UNKNOWN_ACTION is the same as DENY_ACTION.
-    hold(ownPopupPriv, DENY_ACTION, function() {
-      testIntentional("click");
-      testProbablyUnintentional("mouseup");
-      testProbablyUnintentional("mouseover");
-    });
-    hold(ownPopupPriv, ALLOW_ACTION, function() {
-      testIntentional("click");
-      testProbablyIntentional("mouseup");
-      testProbablyIntentional("mouseover");
-    });
-  });
+function run_tests8() {
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  send(a, "click", checkOpened);
+  window.open.close();
 
-  window.open.close(); // just in case
+  for (var count = 0, n = 0; n < 3; n++)
+    send(a, "mouseup", function() { if (window.open("http://example.com")) count++ });
+  send(a, "mouseup", checkBlocked);
+  window.open.close(1);
+  send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkBlocked);
+  send(a, "mouseup", checkBlocked);
+  window.open.close();
+  ok(count > 0, "Windows left open by previous tests?");
+  while (count --> 0)
+    send(a, "mouseup", checkOpened);
+  send(a, "mouseup", checkBlocked);
+  window.open.close();
+
+  for (var count = 0, n = 0; n < 3; n++)
+    send(a, "mouseover", function() { if (window.open("http://example.com")) count++ });
+  send(a, "mouseover", checkBlocked);
+  window.open.close(1);
+  send(a, "mouseover", checkOpened);
+  send(a, "mouseover", checkBlocked);
+  send(a, "mouseover", checkBlocked);
+  window.open.close();
+  ok(count > 0, "Windows left open by previous tests?");
+  while (count --> 0)
+    send(a, "mouseover", checkOpened);
+  send(a, "mouseover", checkBlocked);
+  window.open.close();
+
+  SimpleTest.finish();
 }
 
 function check_sanity() {
-  hold(ownPopupPriv, UNKNOWN_ACTION, function(unknown) {
-    hold(ownPopupPriv, ALLOW_ACTION, function(allow) {
-      is(ownPopupPriv(), allow, "properly set to allow");
-    });
-    is(ownPopupPriv(), unknown, "properly reset to unknown");
+  ok(SpecialPowers.testPermission('popup', UNKNOWN_ACTION, document), 'popup value should have UNKNOWN permission');
+  SpecialPowers.pushPermissions([{'type': 'popup', 'allow': true, 'context': document}], check_sanity2);
+}
+
+function check_sanity2() {
+  ok(SpecialPowers.testPermission('popup', ALLOW_ACTION, document), 'popup value should have ALLOW permission');
+  SpecialPowers.pushPrefEnv({"set": [["dom.disable_open_during_load", true],
+                                     ["dom.popup_allowed_events", "click mouseup"],
+                                     ["dom.popup_maximum", 3]]}, function() {
+    // Note: UNKNOWN_ACTION is the same as DENY_ACTION.
+    SpecialPowers.pushPermissions([{'type': 'popup', 'allow': DENY_ACTION, 'context': document}], run_tests);
   });
 }
 
 setTimeout(function() {
-  check_sanity();
-  hold(blockPopups, true, run_tests);
-  SimpleTest.finish();
+  SpecialPowers.pushPermissions([{'type': 'popup', 'remove': true, 'context': document}], check_sanity);
 }, 200);
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/test_bug260264_nested.html
+++ b/dom/tests/mochitest/bugs/test_bug260264_nested.html
@@ -17,106 +17,122 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 260264 **/
 
 SimpleTest.waitForExplicitFinish();
 
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-var popupEvents = makePrefAccessor("dom.popup_allowed_events"),
-    blockPopups = makePrefAccessor("dom.disable_open_during_load"),
-    ownPopupPriv = makePopupPrivAccessor(location.href),
-    ecPopupPriv = makePopupPrivAccessor("http://example.com");
+function makeIframe(aEvent) {
+  var tempURL = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')+1);
+  tempURL = 'http://example.com' + tempURL + "child_bug260264.html#" + aEvent;
+  $("display").appendChild(document.createElement("iframe")).src = tempURL;
+}
 
 function test_nested_frames() {
+  SpecialPowers.pushPrefEnv({"set": [["dom.disable_open_during_load", true]]}, test_nested_frames2);
+}
 
-  var savedBlockPopups = blockPopups(true);
-
+function test_nested_frames2() {
   // Grandchild will use this name to refer to the current window:
   window.name = "parent260264";
 
-  function performer(event) {
-    $("display").appendChild(document.createElement("iframe")).src =
-      alter_file(alter_host(location.href, "example.com"),
-                             "child_bug260264.html#" + event);
+  if (tests[0]) {
+    tests[0].setup(function() {makeIframe(tests[0].event);});
+  } else {
+    ok(false, "There should have run 8 tests here");
+    SimpleTest.finish();
   }
+}
+
+function should_have_blocked(popup) {
+  ok(!popup, "popup should have been blocked");
+}
 
-  function finisher(old) {
-    popupEvents(old.events);
-    ownPopupPriv(old.ownPriv);
-    ecPopupPriv(old.ecPriv);
-  }
+function should_not_have_blocked(popup) {
+ ok(popup, "popup should not have been blocked");
+}
 
-  function should_have_blocked(popup) {
-    ok(!popup, "popup should have been blocked");
-  }
+function setupPP(aAllowedEvents, aPopup1, aPopup2, aNext) {
+  SpecialPowers.pushPrefEnv({"set": [["dom.popup_allowed_events", aAllowedEvents]]}, function() {
+  SpecialPowers.pushPermissions([{'type': 'popup', 'allow': aPopup1, 'context': document},
+                                 {'type': 'popup', 'allow': aPopup2, 'context': 'http://example.com'}], aNext);
+  });
+}
 
-  function should_not_have_blocked(popup) {
-    ok(popup, "popup should not have been blocked");
-  }
+/**
+ * The example_priv (DENY_ACTION) parameter controls whether or not the child frame has
+ * popup clearance.  Neither the top window nor the grandchild frame have
+ * this clearance.  The point of these tests is to make sure the child's
+ * clearance (or lack thereof) is properly considered when opening a popup
+ * from the grandchild.
+*/
 
-  /**
-   * The example_priv parameter controls whether or not the child frame has
-   * popup clearance.  Neither the top window nor the grandchild frame have
-   * this clearance.  The point of these tests is to make sure the child's
-   * clearance (or lack thereof) is properly considered when opening a popup
-   * from the grandchild.
-   */
-  function makeTest(event, example_priv, reporter, allowed_events) {
-    return {
-      event: event,
-      setup: function(old) {
-        old.events = popupEvents(allowed_events || "click mouseup");
-        old.ownPriv = ownPopupPriv(DENY_ACTION);
-        old.ecPriv = ecPopupPriv(example_priv);
-      },
-      report: reporter,
-      perform: performer,
-      finish: finisher
-    };
-  };
+var tests = [
+ { event: "mouseup",
+   setup: function(aNext) {
+     setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ },
+ { event: "mouseup",
+   setup: function(aNext) {
+     setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ },
+ { event: "mouseup",
+   setup: function(aNext) {
+     setupPP("click", ALLOW_ACTION, ALLOW_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ },
+ { event: "mouseup",
+   setup: function(aNext) {
+     setupPP("click", DENY_ACTION, DENY_ACTION, aNext);
+   },
+   report: should_have_blocked
+ },
+ { event: "mouseover",
+   setup: function(aNext) {
+     setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext);
+   },
+   report: should_have_blocked
+ },
+ { event: "mouseover",
+   setup: function(aNext) {
+     setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ },
+ { event: "click",
+   setup: function(aNext) {
+     setupPP("click mouseup", DENY_ACTION, DENY_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ },
+ { event: "click",
+   setup: function(aNext) {
+     setupPP("click mouseup", ALLOW_ACTION, ALLOW_ACTION, aNext);
+   },
+   report: should_not_have_blocked
+ }
+];
 
-  var tests = [
-    makeTest("mouseup",    DENY_ACTION, should_not_have_blocked),
-    makeTest("mouseup",   ALLOW_ACTION, should_not_have_blocked),
-    makeTest("mouseup",   ALLOW_ACTION, should_not_have_blocked, "click"),
-    makeTest("mouseup",    DENY_ACTION, should_have_blocked, "click"),
-    makeTest("mouseover",  DENY_ACTION, should_have_blocked),
-    makeTest("mouseover", ALLOW_ACTION, should_not_have_blocked),
-    makeTest("click",      DENY_ACTION, should_not_have_blocked),
-    makeTest("click",     ALLOW_ACTION, should_not_have_blocked)
-  ];
+// Visible to child windows:
+function report(popup) {
+  tests[0].report(popup);
+  tests.shift();
 
-  function resume() {
-    var options = tests[0];
-    if (options) {
-      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-      options.setup(tests[0].old = {});
-      options.perform(options.event);
-    } else {
-      blockPopups(savedBlockPopups);
-      SimpleTest.finish();
-    }
+  if (tests[0]) {
+    tests[0].setup(function() {makeIframe(tests[0].event);});
+  } else {
+    SimpleTest.finish();
   }
-
-  // Visible to child windows:
-  window.report = function(popup) {
-    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-    try { tests[0].report(popup) }
-    finally {
-      tests[0].finish(tests[0].old);
-      tests.shift();
-      resume();
-    }
-  }
-
-  resume();
-
 }
 
 test_nested_frames();
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/bugs/utils_bug260264.js
+++ b/dom/tests/mochitest/bugs/utils_bug260264.js
@@ -1,8 +1,13 @@
+const ALLOW_ACTION = SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION;
+const DENY_ACTION = SpecialPowers.Ci.nsIPermissionManager.DENY_ACTION;
+const UNKNOWN_ACTION = SpecialPowers.Ci.nsIPermissionManager.UNKNOWN_ACTION;
+const PROMPT_ACTION = SpecialPowers.Ci.nsIPermissionManager.PROMPT_ACTION;
+
 /**
  * Dispatches |handler| to |element|, as if fired in response to |event|.
  */
 function send(element, event, handler) {
   function unique_handler() { return handler.apply(this, arguments) }
   element.addEventListener(event, unique_handler, false);
   try { sendMouseEvent({ type: event }, element.id) }
   finally { element.removeEventListener(event, unique_handler, false) }
@@ -24,117 +29,8 @@ function send(element, event, handler) {
       n = wins.length;
     while (n --> 0) {
       var win = wins.pop();
       if (win) win.close();
       else break;
     }
   };
 })(window.open);
-
-function _alter_helper(uri, fn) {
-  var hash_splat = uri.split("#"),
-      splat = hash_splat.shift().split("/");
-  fn(splat);
-  hash_splat.unshift(splat.join("/"));
-  return hash_splat.join("#");
-}
-
-function alter_host(uri, host) {
-  return _alter_helper(uri, function(splat) {
-    splat.splice(2, 1, host);
-  });
-}
-
-function alter_file(uri, file) {
-  return _alter_helper(uri, function(splat) {
-    splat[splat.length - 1] = file;
-  });
-}
-
-(function() {
-
-  var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
-                              .getService(SpecialPowers.Ci.nsIPrefService),
-      pm = SpecialPowers.Cc["@mozilla.org/permissionmanager;1"]
-                     .getService(SpecialPowers.Ci.nsIPermissionManager),
-      ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
-                            .getService(SpecialPowers.Ci.nsIIOService);
-
-  ALLOW_ACTION = pm.ALLOW_ACTION;
-  DENY_ACTION = pm.DENY_ACTION;
-  UNKNOWN_ACTION = pm.UNKNOWN_ACTION;
-
-  /**
-   * This ridiculously over-engineered function makes an accessor function from
-   * any given preference string.  Such accessors may be passed as the first
-   * parameter to the |hold| function defined below.
-   */
-  makePrefAccessor = function(pref) {
-    var splat = pref.split('.'),
-        basePref = splat.pop(),
-        branch, kind;
-
-    try {
-      branch = prefService.getBranch(splat.join('.') + '.');
-    } catch (x) {
-      alert("Calling prefService.getBranch failed: " + 
-        "did you forget to enable UniversalXPConnect?");
-      throw x;
-    }
-
-    switch (branch.getPrefType(basePref)) {
-    case branch.PREF_STRING:  kind = "CharPref"; break;
-    case branch.PREF_INT:     kind = "IntPref"; break;
-    case branch.PREF_BOOL:    kind = "BoolPref"; break;
-    case branch.PREF_INVALID: kind = "ComplexValue";
-    }
-
-    return function(value) {
-      var oldValue = branch['get' + kind](basePref);
-      if (arguments.length > 0)
-        branch['set' + kind](basePref, value);
-      return oldValue;
-    };
-  };
-
-  makePopupPrivAccessor = function(uri) {
-    uri = ioService.newURI(uri, null, null);
-    var principal = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
-                      .getService(SpecialPowers.Ci.nsIScriptSecurityManager)
-                      .getNoAppCodebasePrincipal(uri);
-
-    return function(permission) {
-      var old = pm.testPermissionFromPrincipal(principal, "popup");
-      if (arguments.length) {
-        pm.removeFromPrincipal(principal, "popup");
-        pm.addFromPrincipal(principal, "popup", permission);
-      }
-      return old;
-    };
-  };
-
-})();
-
-/**
- * This function takes an accessor function, a new value, and a callback
- * function.  It assigns the new value to the accessor, saving the old value,
- * then calls the callback function with the new and old values.  Before
- * returning, |hold| sets the accessor back to the old value, even if the
- * callback function misbehaved (i.e., threw).
- *
- * For sanity's sake, |hold| also ensures that the accessor still has the new
- * value at the time the old value is reassigned.  The accessor's value might
- * have changed to something entirely different during the execution of the
- * callback function, but it must have changed back.
- *
- * Without such a mechanism it would be very difficult to verify that these
- * tests leave the browser's preferences/privileges as they were originally.
- */
-function hold(accessor, value, body) {
-  var old_value = accessor(value);
-  try { return body(value, old_value) }
-  finally {
-    old_value = accessor(old_value);
-    if (old_value !== value)
-      throw [accessor, value, old_value];
-  }
-}
--- a/hal/gonk/GonkFMRadio.cpp
+++ b/hal/gonk/GonkFMRadio.cpp
@@ -22,16 +22,30 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/videodev2.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
+
+/* Bionic might not have the newer version of the v4l2 headers that
+ * define these controls, so we define them here if they're not found.
+ */
+#ifndef V4L2_CTRL_CLASS_FM_RX
+#define V4L2_CTRL_CLASS_FM_RX 0x00a10000
+#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900)
+#define V4L2_CID_TUNE_DEEMPHASIS  (V4L2_CID_FM_RX_CLASS_BASE + 1)
+#define V4L2_DEEMPHASIS_DISABLED  0
+#define V4L2_DEEMPHASIS_50_uS     1
+#define V4L2_DEEMPHASIS_75_uS     2
+#define V4L2_CID_RDS_RECEPTION    (V4L2_CID_FM_RX_CLASS_BASE + 2)
+#endif
+
 namespace mozilla {
 namespace hal_impl {
 
 uint32_t GetFMRadioFrequency();
 
 static int sRadioFD;
 static bool sRadioEnabled;
 static pthread_t sRadioThread;
@@ -313,16 +327,36 @@ EnableFMRadio(const hal::FMRadioSettings
   tuner.rangelow = (aInfo.lowerLimit() * 10000) / 625;
   tuner.rangehigh = (aInfo.upperLimit() * 10000) / 625;
   tuner.audmode = V4L2_TUNER_MODE_STEREO;
   rc = ioctl(fd, VIDIOC_S_TUNER, &tuner);
   if (rc < 0) {
     HAL_LOG(("Unable to adjust band limits"));
   }
 
+  int emphasis;
+  switch (aInfo.preEmphasis()) {
+  case 0:
+    emphasis = V4L2_DEEMPHASIS_DISABLED;
+    break;
+  case 50:
+    emphasis = V4L2_DEEMPHASIS_50_uS;
+    break;
+  case 75:
+    emphasis = V4L2_DEEMPHASIS_75_uS;
+    break;
+  default:
+    MOZ_CRASH("Invalid preemphasis setting");
+    break;
+  }
+  rc = setControl(V4L2_CID_TUNE_DEEMPHASIS, emphasis);
+  if (rc < 0) {
+    HAL_LOG(("Unable to configure deemphasis"));
+  }
+
   sRadioFD = fd.forget();
   sRadioEnabled = true;
 
   info.status() = hal::FM_RADIO_OPERATION_STATUS_SUCCESS;
   hal::NotifyFMRadioStatus(info);
 }
 
 void
--- a/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp
+++ b/netwerk/protocol/rtsp/rtsp/AMPEG4ElementaryAssembler.cpp
@@ -354,22 +354,62 @@ ARTPAssembler::AssemblyStatus AMPEG4Elem
     return OK;
 }
 
 void AMPEG4ElementaryAssembler::submitAccessUnit() {
     CHECK(!mPackets.empty());
 
     LOGV("Access unit complete (%d nal units)", mPackets.size());
 
-    for (List<sp<ABuffer> >::iterator it = mPackets.begin();
-         it != mPackets.end(); ++it) {
-        sp<ABuffer> accessUnit = new ABuffer((*it)->size());
-        sp<ABuffer> nal = *it;
-        memcpy(accessUnit->data(), nal->data(), nal->size());
-        CopyTimes(accessUnit, nal);
+    if (mIsGeneric) {
+        /*
+         * Bug 877116.
+         * In order to remedy a latency problem caused by hardware decoder for
+         * mpeg4-generic audios, we artificially divide AUs into more smaller
+         * AUs before feeding them to decoder.
+         *
+         * TODO: However, we are not sure this solution is appropriate to video
+         * or not. Need more investigation on this. Refer to RFC 3640.
+         */
+        for (List<sp<ABuffer> >::iterator it = mPackets.begin();
+             it != mPackets.end(); ++it) {
+            sp<ABuffer> accessUnit = new ABuffer((*it)->size());
+            sp<ABuffer> nal = *it;
+            memcpy(accessUnit->data(), nal->data(), nal->size());
+            CopyTimes(accessUnit, nal);
+
+            if (mAccessUnitDamaged) {
+                accessUnit->meta()->setInt32("damaged", true);
+            }
+
+            sp<AMessage> msg = mNotifyMsg->dup();
+            msg->setObject("access-unit", accessUnit);
+            msg->post();
+        }
+    } else {
+        /*
+         * For MP4V-ES (MPEG-4 Visual Elementary Streams), NAL units with the
+         * same RTP timestamp are assembled into an AU, which results in one
+         * decoded picture (RFC 6416).
+         */
+        size_t totalSize = 0;
+
+        for (List<sp<ABuffer> >::iterator it = mPackets.begin();
+             it != mPackets.end(); ++it) {
+            totalSize += (*it)->size();
+        }
+        sp<ABuffer> accessUnit = new ABuffer(totalSize);
+        size_t offset = 0;
+        for (List<sp<ABuffer> >::iterator it = mPackets.begin();
+             it != mPackets.end(); ++it) {
+            sp<ABuffer> nal = *it;
+            memcpy(accessUnit->data() + offset, nal->data(), nal->size());
+            offset += nal->size();
+        }
+        CopyTimes(accessUnit, *mPackets.begin());
 
         if (mAccessUnitDamaged) {
             accessUnit->meta()->setInt32("damaged", true);
         }
 
         sp<AMessage> msg = mNotifyMsg->dup();
         msg->setObject("access-unit", accessUnit);
         msg->post();