Merge m-c to inbound. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 19 Aug 2015 07:34:21 -0400
changeset 291019 f14a286c6dc7b3dd6b835c20a13a76484528ae08
parent 291018 739b247fd7b75f8251a50e56df1395f314cd1a38 (current diff)
parent 290950 8a5f352206ed0d9fa8e82b7d08b0d2bb687ae577 (diff)
child 291020 92d63c478838c60bcbc56b94bea71a0ebaa7caba
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to inbound. a=merge
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/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="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/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="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- 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="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- 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="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
   <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"/>
--- 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="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/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="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- 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="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <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="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-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="aacd9b12da7fc3c8f4deaaa8eedfbb158f4fefe7">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "1e1197e0e8e64307aa382ffba4711d1c661de7ca", 
+        "git_revision": "331956d992ec4231fd19980201e86fd0d3067b2a", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "017d8581cedcf164da2a6e2b6b4fbb98188325f0", 
+    "revision": "27d3020c9da9f6c438bd97b3d42d9124ec9807f4", 
     "repo_path": "integration/gaia-central"
 }
--- 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="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
   <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"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/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="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="1e1197e0e8e64307aa382ffba4711d1c661de7ca"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="331956d992ec4231fd19980201e86fd0d3067b2a"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="62cfa11ae7d77f6330de019a5aa79607e35be7d1"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="bfdb6348725a33bdcdc4e17999cb500be6beedb5"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <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="a6f9a1245d98c51172c15afecb9ade1a6ca511e2"/>
--- a/dom/bluetooth/BluetoothHidManager.cpp
+++ b/dom/bluetooth/BluetoothHidManager.cpp
@@ -141,24 +141,26 @@ BluetoothHidManager::Connect(const nsASt
 void
 BluetoothHidManager::Disconnect(BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
     }
     return;
   }
 
   if (!mConnected) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
     }
     return;
   }
 
   MOZ_ASSERT(!mDeviceAddress.IsEmpty());
   MOZ_ASSERT(!mController);
 
   mController = aController;
@@ -205,17 +207,18 @@ BluetoothHidManager::IsConnected()
 {
   return mConnected;
 }
 
 void
 BluetoothHidManager::HandleInputPropertyChanged(const BluetoothSignal& aSignal)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
+  MOZ_ASSERT(aSignal.value().type() ==
+             BluetoothValue::TArrayOfBluetoothNamedValue);
 
   const InfallibleTArray<BluetoothNamedValue>& arr =
     aSignal.value().get_ArrayOfBluetoothNamedValue();
   MOZ_ASSERT(arr.Length() == 1);
 
   const nsString& name = arr[0].name();
   const BluetoothValue& value = arr[0].value();
 
--- a/dom/bluetooth/BluetoothInterface.h
+++ b/dom/bluetooth/BluetoothInterface.h
@@ -476,17 +476,18 @@ public:
   virtual void SetPlayerAppValueRsp(BluetoothAvrcpStatus aRspStatus,
                                     BluetoothAvrcpResultHandler* aRes) = 0;
 
   virtual void RegisterNotificationRsp(
     BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
     const BluetoothAvrcpNotificationParam& aParam,
     BluetoothAvrcpResultHandler* aRes) = 0;
 
-  virtual void SetVolume(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes) = 0;
+  virtual void SetVolume(uint8_t aVolume,
+                         BluetoothAvrcpResultHandler* aRes) = 0;
 
 protected:
   BluetoothAvrcpInterface();
   virtual ~BluetoothAvrcpInterface();
 };
 
 //
 // GATT Interface
@@ -1068,17 +1069,18 @@ public:
     int aNumProperties, const BluetoothProperty* aProperties) { }
 
   virtual void DeviceFoundNotification(
     int aNumProperties, const BluetoothProperty* aProperties) { }
 
   virtual void DiscoveryStateChangedNotification(bool aState) { }
 
   virtual void PinRequestNotification(const nsAString& aRemoteBdAddr,
-                                      const nsAString& aBdName, uint32_t aCod) { }
+                                      const nsAString& aBdName,
+                                      uint32_t aCod) { }
   virtual void SspRequestNotification(const nsAString& aRemoteBdAddr,
                                       const nsAString& aBdName,
                                       uint32_t aCod,
                                       BluetoothSspVariant aPairingVariant,
                                       uint32_t aPassKey) { }
 
   virtual void BondStateChangedNotification(BluetoothStatus aStatus,
                                             const nsAString& aRemoteBdAddr,
--- a/dom/bluetooth/BluetoothProfileManagerBase.h
+++ b/dom/bluetooth/BluetoothProfileManagerBase.h
@@ -45,22 +45,22 @@ class BluetoothProfileManagerBase : publ
 {
 public:
   virtual void OnGetServiceChannel(const nsAString& aDeviceAddress,
                                    const nsAString& aServiceUuid,
                                    int aChannel) = 0;
   virtual void OnUpdateSdpRecords(const nsAString& aDeviceAddress) = 0;
 
   /**
-   * Returns the address of the connected device.
+   * Return the address of the connected device.
    */
   virtual void GetAddress(nsAString& aDeviceAddress) = 0;
 
   /**
-   * Returns true if the profile is connected.
+   * Return true if the profile is connected.
    */
   virtual bool IsConnected() = 0;
 
   /**
    * Connect to a specific remote device. When it has been done, the
    * callback "OnConnect" will be invoked.
    */
   virtual void Connect(const nsAString& aDeviceAddress,
@@ -79,17 +79,17 @@ public:
   virtual void OnDisconnect(const nsAString& aErrorStr) = 0;
 
   /**
    * Clean up profile resources and set mController as null.
    */
   virtual void Reset() = 0;
 
   /**
-   * Returns string of profile name.
+   * Return string of profile name.
    */
   virtual void GetName(nsACString& aName) = 0;
 };
 
 #define BT_DECL_PROFILE_MGR_BASE                                             \
 public:                                                                      \
   NS_DECL_ISUPPORTS                                                          \
   NS_DECL_NSIOBSERVER                                                        \
@@ -98,14 +98,14 @@ public:                                 
                                    int aChannel) override;                   \
   virtual void OnUpdateSdpRecords(const nsAString& aDeviceAddress) override; \
   virtual void GetAddress(nsAString& aDeviceAddress) override;               \
   virtual bool IsConnected() override;                                       \
   virtual void Connect(const nsAString& aDeviceAddress,                      \
                        BluetoothProfileController* aController) override;    \
   virtual void Disconnect(BluetoothProfileController* aController) override; \
   virtual void OnConnect(const nsAString& aErrorStr) override;               \
-  virtual void OnDisconnect(const nsAString& AErrorStr) override;            \
+  virtual void OnDisconnect(const nsAString& aErrorStr) override;            \
   virtual void Reset() override;
 
 END_BLUETOOTH_NAMESPACE
 
 #endif  // mozilla_dom_bluetooth_BluetoothProfileManagerBase_h
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp
@@ -556,36 +556,39 @@ void
 BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mController);
 
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
     }
     return;
   }
 
   if (!mA2dpConnected) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
     }
     return;
   }
 
   MOZ_ASSERT(!mDeviceAddress.IsEmpty());
 
   mController = aController;
 
   if (!sBtA2dpInterface) {
     BT_LOGR("sBluetoothA2dpInterface is null");
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
     }
     return;
   }
 
   sBtA2dpInterface->Disconnect(mDeviceAddress, new DisconnectResultHandler());
 }
 
 void
@@ -1006,18 +1009,18 @@ BluetoothA2dpManager::GetArtist(nsAStrin
   aArtist.Assign(mArtist);
 }
 
 /*
  * A2DP Notifications
  */
 
 void
-BluetoothA2dpManager::ConnectionStateNotification(BluetoothA2dpConnectionState aState,
-                                                  const nsAString& aBdAddr)
+BluetoothA2dpManager::ConnectionStateNotification(
+  BluetoothA2dpConnectionState aState, const nsAString& aBdAddr)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsString a2dpState;
   AvStatusToSinkString(aState, a2dpState);
 
   InfallibleTArray<BluetoothNamedValue> props;
   BT_APPEND_NAMED_VALUE(props, "State", a2dpState);
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
@@ -2516,17 +2516,18 @@ BluetoothDaemonGattClientInterface::List
   if (NS_FAILED(rv)) {
     DispatchError(aRes, rv);
   }
 }
 
 /* Clear the attribute cache for a given device*/
 void
 BluetoothDaemonGattClientInterface::Refresh(
-  int aClientIf, const nsAString& aBdAddr, BluetoothGattClientResultHandler* aRes)
+  int aClientIf, const nsAString& aBdAddr,
+  BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
   nsresult rv = mModule->ClientRefreshCmd(aClientIf, aBdAddr, aRes);
   if (NS_FAILED(rv)) {
     DispatchError(aRes, rv);
   }
 }
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -35,18 +35,18 @@ nsresult
 BluetoothDaemonHandsfreeModule::Send(DaemonSocketPDU* aPDU,
                                      BluetoothHandsfreeResultHandler* aRes)
 {
   aRes->AddRef(); // Keep reference for response
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 void
-BluetoothDaemonHandsfreeModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
-                                          DaemonSocketPDU& aPDU, void* aUserData)
+BluetoothDaemonHandsfreeModule::HandleSvc(
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU, void* aUserData)
 {
   static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])(
     const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::HandleRsp),
     INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::HandleNtf),
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
--- a/dom/bluetooth/bluedroid/BluetoothGattManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothGattManager.cpp
@@ -1168,17 +1168,18 @@ BluetoothGattManager::WriteCharacteristi
    * may still interfere the ongoing request.
    */
   if (client->mWriteCharacteristicState.mRunnable) {
     DispatchReplyError(aRunnable,
                        NS_LITERAL_STRING("WriteCharacteristicValue failed"));
     return;
   }
 
-  client->mWriteCharacteristicState.Assign(aWriteType, aValue, false, aRunnable);
+  client->mWriteCharacteristicState.Assign(
+    aWriteType, aValue, false, aRunnable);
 
   /**
    * First, write the characteristic value through an unauthenticated physical
    * link. If the operation fails due to insufficient authentication/encryption
    * key size, retry to write through an authenticated physical link.
    */
   sBluetoothGattClientInterface->WriteCharacteristic(
     client->mConnId,
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -1546,21 +1546,24 @@ BluetoothOppManager::OnSocketDisconnect(
    * It is valid for a bluetooth device which is transfering file via OPP
    * closing socket without sending OBEX disconnect request first. So we
    * delete the broken file when we failed to receive a file from the remote,
    * and notify the transfer has been completed (but failed). We also call
    * AfterOppDisconnected here to ensure all variables will be cleaned.
    */
   if (!mSuccessFlag) {
     if (mIsServer) {
+      // Remove received file and inform gaia of receiving failure
       DeleteReceivedFile();
-    }
-
-    FileTransferComplete();
-    if (!mIsServer) {
+      FileTransferComplete();
+    } else {
+      // Inform gaia of current blob transfer failure
+      if (mCurrentBlobIndex >= 0) {
+        FileTransferComplete();
+      }
       // Inform gaia of remaining blobs' sending failure
       DiscardBlobsToSend();
     }
   }
 
   AfterOppDisconnected();
   mDeviceAddress.AssignLiteral(BLUETOOTH_ADDRESS_NONE);
   mSuccessFlag = false;
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -595,35 +595,35 @@ BluetoothServiceBluedroid::GetAdaptersIn
   DispatchReplySuccess(aRunnable, adaptersProperties);
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::GetDeviceRequest final
 {
 public:
   GetDeviceRequest(int aDeviceCount, BluetoothReplyRunnable* aRunnable)
-  : mDeviceCount(aDeviceCount)
-  , mRunnable(aRunnable)
+    : mDeviceCount(aDeviceCount)
+    , mRunnable(aRunnable)
   { }
 
   int mDeviceCount;
   InfallibleTArray<BluetoothNamedValue> mDevicesPack;
   nsRefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
 class BluetoothServiceBluedroid::GetRemoteDevicePropertiesResultHandler
   final
   : public BluetoothResultHandler
 {
 public:
   GetRemoteDevicePropertiesResultHandler(
     nsTArray<GetDeviceRequest>& aRequests,
     const nsAString& aDeviceAddress)
-  : mRequests(aRequests)
-  , mDeviceAddress(aDeviceAddress)
+    : mRequests(aRequests)
+    , mDeviceAddress(aDeviceAddress)
   { }
 
   void OnError(BluetoothStatus aStatus) override
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(!mRequests.IsEmpty());
 
     BT_WARNING("GetRemoteDeviceProperties(%s) failed: %d",
@@ -635,17 +635,17 @@ public:
         DispatchReplySuccess(mRequests[0].mRunnable,
                              mRequests[0].mDevicesPack);
       }
       mRequests.RemoveElementAt(0);
     }
   }
 
 private:
-  nsTArray<GetDeviceRequest> mRequests;
+  nsTArray<GetDeviceRequest>& mRequests;
   nsString mDeviceAddress;
 };
 
 nsresult
 BluetoothServiceBluedroid::GetConnectedDevicePropertiesInternal(
   uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -701,172 +701,102 @@ BluetoothServiceBluedroid::GetPairedDevi
     sBtInterface->GetRemoteDeviceProperties(aDeviceAddress[i],
       new GetRemoteDevicePropertiesResultHandler(mGetDeviceRequests,
                                                  aDeviceAddress[i]));
   }
 
   return NS_OK;
 }
 
-class BluetoothServiceBluedroid::StartDiscoveryResultHandler final
+class BluetoothServiceBluedroid::DispatchReplyErrorResultHandler final
   : public BluetoothResultHandler
 {
 public:
-  StartDiscoveryResultHandler(
+  DispatchReplyErrorResultHandler(
     nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
     BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
+    : mRunnableArray(aRunnableArray)
+    , mRunnable(aRunnable)
   { }
 
   void OnError(BluetoothStatus aStatus) override
   {
     MOZ_ASSERT(NS_IsMainThread());
+
     mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
+    if (mRunnable) {
+      DispatchReplyError(mRunnable, aStatus);
+    }
   }
 
 private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
+  nsTArray<nsRefPtr<BluetoothReplyRunnable>>& mRunnableArray;
   BluetoothReplyRunnable* mRunnable;
 };
 
 void
 BluetoothServiceBluedroid::StartDiscoveryInternal(
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
   ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
 
   mChangeDiscoveryRunnables.AppendElement(aRunnable);
   sBtInterface->StartDiscovery(
-    new StartDiscoveryResultHandler(mChangeDiscoveryRunnables, aRunnable));
+    new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
 }
 
-class BluetoothServiceBluedroid::CancelDiscoveryResultHandler final
-  : public BluetoothResultHandler
-{
-public:
-  CancelDiscoveryResultHandler(
-    nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
-    BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
-  { }
-
-  void OnError(BluetoothStatus aStatus) override
-  {
-    MOZ_ASSERT(NS_IsMainThread());
-    mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
-  }
-
-private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
-  BluetoothReplyRunnable* mRunnable;
-};
-
-class BluetoothServiceBluedroid::GetRemoteServicesResultHandler final
-  : public BluetoothResultHandler
-{
-public:
-  GetRemoteServicesResultHandler(
-    nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
-    BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
-  { }
-
-  void OnError(BluetoothStatus aStatus) override
-  {
-    MOZ_ASSERT(NS_IsMainThread());
-    mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
-  }
-
-private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
-  BluetoothReplyRunnable* mRunnable;
-};
-
 nsresult
 BluetoothServiceBluedroid::FetchUuidsInternal(
   const nsAString& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   /*
    * get_remote_services request will not be performed by bluedroid
    * if it is currently discovering nearby remote devices.
    */
   if (mDiscovering) {
-    sBtInterface->CancelDiscovery(
-      new CancelDiscoveryResultHandler(mChangeDiscoveryRunnables, aRunnable));
+    StopDiscoveryInternal(aRunnable);
   }
 
   mFetchUuidsRunnables.AppendElement(aRunnable);
-
   sBtInterface->GetRemoteServices(aDeviceAddress,
-    new GetRemoteServicesResultHandler(mFetchUuidsRunnables, aRunnable));
+    new DispatchReplyErrorResultHandler(mFetchUuidsRunnables, aRunnable));
 
   return NS_OK;
 }
 
 void
 BluetoothServiceBluedroid::StopDiscoveryInternal(
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
+
   ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
 
   mChangeDiscoveryRunnables.AppendElement(aRunnable);
   sBtInterface->CancelDiscovery(
-    new CancelDiscoveryResultHandler(mChangeDiscoveryRunnables,
-                                     aRunnable));
+    new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
 }
 
-class BluetoothServiceBluedroid::SetAdapterPropertyResultHandler final
-  : public BluetoothResultHandler
-{
-public:
-  SetAdapterPropertyResultHandler(
-    nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
-    BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
-  { }
-
-  void OnError(BluetoothStatus aStatus) override
-  {
-    MOZ_ASSERT(NS_IsMainThread());
-
-    mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
-  }
-
-private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
-  BluetoothReplyRunnable* mRunnable;
-};
-
 nsresult
 BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
                                        const BluetoothNamedValue& aValue,
                                        BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   mSetAdapterPropertyRunnables.AppendElement(aRunnable);
-
   sBtInterface->SetAdapterProperty(aValue,
-    new SetAdapterPropertyResultHandler(mSetAdapterPropertyRunnables,
+    new DispatchReplyErrorResultHandler(mSetAdapterPropertyRunnables,
                                         aRunnable));
 
   return NS_OK;
 }
 
 nsresult
 BluetoothServiceBluedroid::GetServiceChannel(
   const nsAString& aDeviceAddress,
@@ -879,103 +809,53 @@ BluetoothServiceBluedroid::GetServiceCha
 bool
 BluetoothServiceBluedroid::UpdateSdpRecords(
   const nsAString& aDeviceAddress,
   BluetoothProfileManagerBase* aManager)
 {
   return true;
 }
 
-class BluetoothServiceBluedroid::CreateBondResultHandler final
-  : public BluetoothResultHandler
-{
-public:
-  CreateBondResultHandler(
-    nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
-    BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
-  {
-    MOZ_ASSERT(mRunnable);
-  }
-
-  void OnError(BluetoothStatus aStatus) override
-  {
-    mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
-  }
-
-private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
-  nsRefPtr<BluetoothReplyRunnable> mRunnable;
-};
-
 nsresult
 BluetoothServiceBluedroid::CreatePairedDeviceInternal(
   const nsAString& aDeviceAddress, int aTimeout,
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   mCreateBondRunnables.AppendElement(aRunnable);
-
   sBtInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
-    new CreateBondResultHandler(mCreateBondRunnables, aRunnable));
+    new DispatchReplyErrorResultHandler(mCreateBondRunnables, aRunnable));
 
   return NS_OK;
 }
 
-class BluetoothServiceBluedroid::RemoveBondResultHandler final
-  : public BluetoothResultHandler
-{
-public:
-  RemoveBondResultHandler(
-    nsTArray<nsRefPtr<BluetoothReplyRunnable>>& aRunnableArray,
-    BluetoothReplyRunnable* aRunnable)
-  : mRunnableArray(aRunnableArray)
-  , mRunnable(aRunnable)
-  {
-    MOZ_ASSERT(mRunnable);
-  }
-
-  void OnError(BluetoothStatus aStatus) override
-  {
-    mRunnableArray.RemoveElement(mRunnable);
-    DispatchReplyError(mRunnable, aStatus);
-  }
-
-private:
-  nsTArray<nsRefPtr<BluetoothReplyRunnable>> mRunnableArray;
-  nsRefPtr<BluetoothReplyRunnable> mRunnable;
-};
-
 nsresult
 BluetoothServiceBluedroid::RemoveDeviceInternal(
   const nsAString& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   mRemoveBondRunnables.AppendElement(aRunnable);
-
   sBtInterface->RemoveBond(aDeviceAddress,
-    new RemoveBondResultHandler(mRemoveBondRunnables, aRunnable));
+    new DispatchReplyErrorResultHandler(mRemoveBondRunnables, aRunnable));
 
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::PinReplyResultHandler final
   : public BluetoothResultHandler
 {
 public:
   PinReplyResultHandler(BluetoothReplyRunnable* aRunnable)
-  : mRunnable(aRunnable)
+    : mRunnable(aRunnable)
   { }
 
   void PinReply() override
   {
     DispatchReplySuccess(mRunnable);
   }
 
   void OnError(BluetoothStatus aStatus) override
@@ -1016,17 +896,17 @@ BluetoothServiceBluedroid::SetPasskeyInt
   // Legacy method used by BlueZ only.
 }
 
 class BluetoothServiceBluedroid::SspReplyResultHandler final
   : public BluetoothResultHandler
 {
 public:
   SspReplyResultHandler(BluetoothReplyRunnable* aRunnable)
-  : mRunnable(aRunnable)
+    : mRunnable(aRunnable)
   { }
 
   void SspReply() override
   {
     DispatchReplySuccess(mRunnable);
   }
 
   void OnError(BluetoothStatus aStatus) override
@@ -1754,19 +1634,18 @@ BluetoothServiceBluedroid::DiscoveryStat
   // Reply that Promise is resolved
   if (!mChangeDiscoveryRunnables.IsEmpty()) {
     DispatchReplySuccess(mChangeDiscoveryRunnables[0]);
     mChangeDiscoveryRunnables.RemoveElementAt(0);
   }
 }
 
 void
-BluetoothServiceBluedroid::PinRequestNotification(const nsAString& aRemoteBdAddr,
-                                                  const nsAString& aBdName,
-                                                  uint32_t aCod)
+BluetoothServiceBluedroid::PinRequestNotification(
+  const nsAString& aRemoteBdAddr, const nsAString& aBdName, uint32_t aCod)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   InfallibleTArray<BluetoothNamedValue> propertiesArray;
 
   // If |aBdName| is empty, get device name from |mDeviceNameMap|;
   // Otherwise update <address, name> mapping with |aBdName|
   nsString bdAddr(aRemoteBdAddr);
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -12,32 +12,27 @@
 #include "BluetoothService.h"
 #include "nsDataHashtable.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothServiceBluedroid : public BluetoothService
                                 , public BluetoothNotificationHandler
 {
-  class CancelDiscoveryResultHandler;
   class CleanupResultHandler;
-  class CreateBondResultHandler;
   class DisableResultHandler;
+  class DispatchReplyErrorResultHandler;
   class EnableResultHandler;
   class GetRemoteDevicePropertiesResultHandler;
-  class GetRemoteServicesResultHandler;
   class InitResultHandler;
   class PinReplyResultHandler;
   class ProfileDeinitResultHandler;
   class ProfileInitResultHandler;
-  class RemoveBondResultHandler;
   class SetAdapterPropertyDiscoverableResultHandler;
-  class SetAdapterPropertyResultHandler;
   class SspReplyResultHandler;
-  class StartDiscoveryResultHandler;
 
   class GetDeviceRequest;
 
 public:
   BluetoothServiceBluedroid();
   ~BluetoothServiceBluedroid();
 
   virtual nsresult StartInternal(BluetoothReplyRunnable* aRunnable);
--- a/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.cpp
@@ -789,17 +789,18 @@ BluetoothAdapter::GetConnectedDevices(ui
     aRv.Throw(rv);
     return nullptr;
   }
 
   return request.forget();
 }
 
 void
-BluetoothAdapter::GetPairedDevices(nsTArray<nsRefPtr<BluetoothDevice> >& aDevices)
+BluetoothAdapter::GetPairedDevices(
+  nsTArray<nsRefPtr<BluetoothDevice> >& aDevices)
 {
   for (uint32_t i = 0; i < mDevices.Length(); ++i) {
     if (mDevices[i]->Paired()) {
       aDevices.AppendElement(mDevices[i]);
     }
   }
 }
 
@@ -1327,17 +1328,18 @@ BluetoothAdapter::SendFile(const nsAStri
 
     bs->SendFile(aDeviceAddress, nullptr, actor, results);
   }
 
   return request.forget();
 }
 
 already_AddRefed<DOMRequest>
-BluetoothAdapter::StopSendingFile(const nsAString& aDeviceAddress, ErrorResult& aRv)
+BluetoothAdapter::StopSendingFile(
+  const nsAString& aDeviceAddress, ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> win = GetOwner();
   if (!win) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(win);
@@ -1527,17 +1529,18 @@ BluetoothAdapter::ToggleCalls(ErrorResul
   return request.forget();
 #else
   aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
   return nullptr;
 #endif // MOZ_B2G_RIL
 }
 
 already_AddRefed<DOMRequest>
-BluetoothAdapter::SendMediaMetaData(const MediaMetaData& aMediaMetaData, ErrorResult& aRv)
+BluetoothAdapter::SendMediaMetaData(
+  const MediaMetaData& aMediaMetaData, ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> win = GetOwner();
   if (!win) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(win);
@@ -1556,17 +1559,18 @@ BluetoothAdapter::SendMediaMetaData(cons
                    aMediaMetaData.mTotalMediaCount,
                    aMediaMetaData.mDuration,
                    results);
 
   return request.forget();
 }
 
 already_AddRefed<DOMRequest>
-BluetoothAdapter::SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv)
+BluetoothAdapter::SendMediaPlayStatus(
+  const MediaPlayStatus& aMediaPlayStatus, ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> win = GetOwner();
   if (!win) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<DOMRequest> request = new DOMRequest(win);
--- a/dom/bluetooth/bluetooth2/BluetoothAdapter.h
+++ b/dom/bluetooth/bluetooth2/BluetoothAdapter.h
@@ -309,33 +309,37 @@ private:
    * @param aType [in] Event type to fire
    */
   void DispatchEmptyEvent(const nsAString& aType);
 
   /**
    * Convert string to BluetoothAdapterAttribute.
    *
    * @param aString [in] String to convert
+   *
+   * @return the adapter attribute converted from |aString|
    */
   BluetoothAdapterAttribute
     ConvertStringToAdapterAttribute(const nsAString& aString);
 
   /**
    * Check whether value of given adapter property has changed.
    *
    * @param aType  [in] Adapter property to check
    * @param aValue [in] New value of the adapter property
+   *
+   * @return true if the adapter property has changed; false otherwise
    */
   bool IsAdapterAttributeChanged(BluetoothAdapterAttribute aType,
                                  const BluetoothValue& aValue);
 
   /**
-   * Check whether this adapter is owned by Bluetooth certified app.
+   * Check whether this adapter belongs to Bluetooth certified app.
    *
-   * @return a boolean value to indicate whether it's owned by Bluetooth app.
+   * @return true if this adapter belongs to Bluetooth app; false otherwise
    */
   bool IsBluetoothCertifiedApp();
 
   /****************************************************************************
    * Variables
    ***************************************************************************/
   /**
    * Current state of this adapter. Can be Disabled/Disabling/Enabled/Enabling.
--- a/dom/bluetooth/bluetooth2/BluetoothDevice.h
+++ b/dom/bluetooth/bluetooth2/BluetoothDevice.h
@@ -121,43 +121,49 @@ private:
    * @param aTypes [in] Array of changed attributes. Must be non-empty.
    */
   void DispatchAttributeEvent(const Sequence<nsString>& aTypes);
 
   /**
    * Convert uint32_t to BluetoothDeviceType.
    *
    * @param aValue [in] uint32_t to convert
+   *
+   * @return the device type converted from |aValue|
    */
   BluetoothDeviceType ConvertUint32ToDeviceType(const uint32_t aValue);
 
   /**
    * Convert string to BluetoothDeviceAttribute.
    *
    * @param aString [in] String to convert
+   *
+   * @return the device attribute converted from |aString|
    */
   BluetoothDeviceAttribute
     ConvertStringToDeviceAttribute(const nsAString& aString);
 
   /**
    * Check whether value of given device property has changed.
    *
    * @param aType  [in] Device property to check
    * @param aValue [in] New value of the device property
+   *
+   * @return true is the device attribute has changed; false otherwise
    */
   bool IsDeviceAttributeChanged(BluetoothDeviceAttribute aType,
                                 const BluetoothValue& aValue);
 
   /**
    * Parse advertising data to update device properties.
    *
    * Parse 'Advertising Data Type' from an inquiry response and set name, UUIDs
    * and COD if they exist in ADV data.
    *
-   * @param aAdvData [in] advertising data which provided by the LeScan result.
+   * @param aAdvData [in] advertising data from LeScan result.
    */
   void UpdatePropertiesFromAdvData(const nsTArray<uint8_t>& aAdvData);
 
   /****************************************************************************
    * Variables
    ***************************************************************************/
   /**
    * BD address of this device.
--- a/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothDiscoveryHandle.cpp
@@ -90,36 +90,36 @@ BluetoothDiscoveryHandle::DispatchLeDevi
 {
   MOZ_ASSERT(aLeDevice);
 
   nsTArray<nsString> remoteUuids;
   aLeDevice->GetUuids(remoteUuids);
 
   bool hasUuidsFilter = !mServiceUuids.IsEmpty();
   bool noAdvertisingUuid  = remoteUuids.IsEmpty();
-  // If a LE device doesn't advertise its service UUIDs, it can't possibly pass
+  // If an LE device doesn't advertise its service UUIDs, it can't possibly pass
   // the UUIDs filter.
   if (hasUuidsFilter && noAdvertisingUuid) {
     return;
   }
 
   // The web API startLeScan() makes the device's adapter start seeking for
   // remote LE devices advertising given service UUIDs.
   // Since current Bluetooth stack can't filter the results of LeScan by UUIDs,
-  // gecko has to filter the results and dispach what API asked for.
+  // gecko has to filter the results and dispatch what API asked for.
   bool matched = false;
   for (size_t index = 0; index < remoteUuids.Length(); ++index) {
     if (mServiceUuids.Contains(remoteUuids[index])) {
       matched = true;
       break;
     }
   }
 
-  // Dispach 'devicefound 'event only if
-  //  - the service UUIDs in the scan record matchs the given UUIDs.
+  // Dispatch 'devicefound' event only if
+  //  - the service UUID in the scan record matches one of the given UUIDs.
   //  - the given UUIDs is empty.
   if (matched || mServiceUuids.IsEmpty()) {
     nsRefPtr<BluetoothLeDeviceEvent> event =
       BluetoothLeDeviceEvent::Constructor(this,
                                           NS_LITERAL_STRING("devicefound"),
                                           aLeDevice,
                                           aRssi,
                                           aScanRecord);
--- a/dom/bluetooth/bluetooth2/BluetoothGatt.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothGatt.cpp
@@ -297,17 +297,18 @@ void
 BluetoothGatt::HandleCharacteristicsDiscovered(const BluetoothValue& aValue)
 {
   MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue);
 
   const InfallibleTArray<BluetoothNamedValue>& values =
     aValue.get_ArrayOfBluetoothNamedValue();
   MOZ_ASSERT(values.Length() == 2); // ServiceId, Characteristics
   MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId"));
-  MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId);
+  MOZ_ASSERT(values[0].value().type() ==
+             BluetoothValue::TBluetoothGattServiceId);
   MOZ_ASSERT(values[1].name().EqualsLiteral("characteristics"));
   MOZ_ASSERT(values[1].value().type() ==
              BluetoothValue::TArrayOfBluetoothGattCharAttribute);
 
   size_t index = mServices.IndexOf(
     values[0].value().get_BluetoothGattServiceId());
   NS_ENSURE_TRUE_VOID(index != mServices.NoIndex);
 
@@ -320,21 +321,23 @@ void
 BluetoothGatt::HandleDescriptorsDiscovered(const BluetoothValue& aValue)
 {
   MOZ_ASSERT(aValue.type() == BluetoothValue::TArrayOfBluetoothNamedValue);
 
   const InfallibleTArray<BluetoothNamedValue>& values =
     aValue.get_ArrayOfBluetoothNamedValue();
   MOZ_ASSERT(values.Length() == 3); // ServiceId, CharacteristicId, Descriptors
   MOZ_ASSERT(values[0].name().EqualsLiteral("serviceId"));
-  MOZ_ASSERT(values[0].value().type() == BluetoothValue::TBluetoothGattServiceId);
+  MOZ_ASSERT(values[0].value().type() ==
+             BluetoothValue::TBluetoothGattServiceId);
   MOZ_ASSERT(values[1].name().EqualsLiteral("characteristicId"));
   MOZ_ASSERT(values[1].value().type() == BluetoothValue::TBluetoothGattId);
   MOZ_ASSERT(values[2].name().EqualsLiteral("descriptors"));
-  MOZ_ASSERT(values[2].value().type() == BluetoothValue::TArrayOfBluetoothGattId);
+  MOZ_ASSERT(values[2].value().type() ==
+             BluetoothValue::TArrayOfBluetoothGattId);
 
   size_t index = mServices.IndexOf(
     values[0].value().get_BluetoothGattServiceId());
   NS_ENSURE_TRUE_VOID(index != mServices.NoIndex);
 
   nsRefPtr<BluetoothGattService> service = mServices.ElementAt(index);
   service->AssignDescriptors(values[1].value().get_BluetoothGattId(),
                              values[2].value().get_ArrayOfBluetoothGattId());
--- a/dom/bluetooth/bluetooth2/BluetoothGatt.h
+++ b/dom/bluetooth/bluetooth2/BluetoothGatt.h
@@ -137,17 +137,17 @@ private:
    *                    uses 'descriptors' as the name and uses an array of
    *                    BluetoothGattId of all discovered descriptors as the
    *                    value.
    */
   void HandleDescriptorsDiscovered(const BluetoothValue& aValue);
 
   /**
    * The value of a GATT characteristic has changed. In the mean time, the
-   * cached value of this GATT characteristic has already been updated. An
+   * cached value of this GATT characteristic has already been updated. A
    * 'characteristicchanged' event will be fired by this function.
    *
    * @param aValue [in] BluetoothValue which contains an array of
    *                    BluetoothNamedValue. There are exact two elements in
    *                    the array. The first element uses 'serviceId' as the
    *                    name and uses BluetoothGattServiceId as the value. The
    *                    second element uses 'charId' as the name and uses
    *                    BluetoothGattId as the value.
--- a/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothGattCharacteristic.cpp
@@ -183,22 +183,24 @@ BluetoothGattCharacteristic::GetValue(JS
 }
 
 void
 BluetoothGattCharacteristic::GetProperties(
   mozilla::dom::GattCharacteristicProperties& aProperties) const
 {
   aProperties.mBroadcast = mProperties & GATT_CHAR_PROP_BIT_BROADCAST;
   aProperties.mRead = mProperties & GATT_CHAR_PROP_BIT_READ;
-  aProperties.mWriteNoResponse = mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE;
+  aProperties.mWriteNoResponse =
+    mProperties & GATT_CHAR_PROP_BIT_WRITE_NO_RESPONSE;
   aProperties.mWrite = mProperties & GATT_CHAR_PROP_BIT_WRITE;
   aProperties.mNotify = mProperties & GATT_CHAR_PROP_BIT_NOTIFY;
   aProperties.mIndicate = mProperties & GATT_CHAR_PROP_BIT_INDICATE;
   aProperties.mSignedWrite = mProperties & GATT_CHAR_PROP_BIT_SIGNED_WRITE;
-  aProperties.mExtendedProps = mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES;
+  aProperties.mExtendedProps =
+    mProperties & GATT_CHAR_PROP_BIT_EXTENDED_PROPERTIES;
 }
 
 class ReadValueTask final : public BluetoothReplyRunnable
 {
 public:
   ReadValueTask(BluetoothGattCharacteristic* aCharacteristic, Promise* aPromise)
     : BluetoothReplyRunnable(nullptr, aPromise)
     , mCharacteristic(aCharacteristic)
--- a/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothLeDeviceEvent.cpp
@@ -33,17 +33,18 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(BluetoothLeDeviceEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDevice)
   tmp->mScanRecord = nullptr;
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothLeDeviceEvent)
 NS_INTERFACE_MAP_END_INHERITING(Event)
 
-BluetoothLeDeviceEvent::BluetoothLeDeviceEvent(mozilla::dom::EventTarget* aOwner)
+BluetoothLeDeviceEvent::BluetoothLeDeviceEvent(
+  mozilla::dom::EventTarget* aOwner)
   : Event(aOwner, nullptr, nullptr)
 {
   mozilla::HoldJSObjects(this);
 }
 
 BluetoothLeDeviceEvent::~BluetoothLeDeviceEvent()
 {
   mScanRecord = nullptr;
--- a/dom/bluetooth/bluetooth2/BluetoothService.cpp
+++ b/dom/bluetooth/bluetooth2/BluetoothService.cpp
@@ -296,17 +296,18 @@ BluetoothService::UnregisterBluetoothSig
   }
 }
 
 PLDHashOperator
 RemoveAllSignalHandlers(const nsAString& aKey,
                         nsAutoPtr<BluetoothSignalObserverList>& aData,
                         void* aUserArg)
 {
-  BluetoothSignalObserver* handler = static_cast<BluetoothSignalObserver*>(aUserArg);
+  BluetoothSignalObserver* handler =
+    static_cast<BluetoothSignalObserver*>(aUserArg);
   aData->RemoveObserver(handler);
   // We shouldn't have duplicate instances in the ObserverList, but there's
   // no appropriate way to do duplication check while registering, so
   // assertions are added here.
   MOZ_ASSERT(!aData->RemoveObserver(handler));
   return aData->Length() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
 }
 
@@ -315,23 +316,25 @@ BluetoothService::UnregisterAllSignalHan
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aHandler);
 
   mBluetoothSignalObserverTable.Enumerate(RemoveAllSignalHandlers, aHandler);
 }
 
 void
-BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath)
+BluetoothService::DistributeSignal(const nsAString& aName,
+                                   const nsAString& aPath)
 {
   DistributeSignal(aName, aPath, BluetoothValue(true));
 }
 
 void
-BluetoothService::DistributeSignal(const nsAString& aName, const nsAString& aPath,
+BluetoothService::DistributeSignal(const nsAString& aName,
+                                   const nsAString& aPath,
                                    const BluetoothValue& aValue)
 {
   BluetoothSignal signal(nsString(aName), nsString(aPath), aValue);
   DistributeSignal(signal);
 }
 
 void
 BluetoothService::DistributeSignal(const BluetoothSignal& aSignal)
--- a/dom/bluetooth/bluez/BluetoothA2dpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothA2dpManager.cpp
@@ -179,24 +179,26 @@ BluetoothA2dpManager::Connect(const nsAS
 }
 
 void
 BluetoothA2dpManager::Disconnect(BluetoothProfileController* aController)
 {
   BluetoothService* bs = BluetoothService::Get();
   if (!bs) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
     }
     return;
   }
 
   if (!mA2dpConnected) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
     }
     return;
   }
 
   MOZ_ASSERT(!mDeviceAddress.IsEmpty());
   MOZ_ASSERT(!mController);
 
   mController = aController;
@@ -257,17 +259,18 @@ BluetoothA2dpManager::OnDisconnect(const
  * 6. "connected" -> "disconnected"
  *    "playing" -> "disconnected"
  *    Disconnected from local or the remote device
  */
 void
 BluetoothA2dpManager::HandleSinkPropertyChanged(const BluetoothSignal& aSignal)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
+  MOZ_ASSERT(aSignal.value().type() ==
+             BluetoothValue::TArrayOfBluetoothNamedValue);
 
   const nsString& address = aSignal.path();
   /**
    * Update sink property only if
    * - mDeviceAddress is empty (A2dp is disconnected), or
    * - this property change is from the connected sink.
    */
   NS_ENSURE_TRUE_VOID(mDeviceAddress.IsEmpty() ||
--- a/dom/bluetooth/bluez/BluetoothDBusService.cpp
+++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp
@@ -373,17 +373,18 @@ static nsString sAdapterPath;
 // Disconnect all profiles before turning off Bluetooth. Please see Bug 891257
 // for more details. |sStopBluetoothMonitor| protects access to this variable.
 static int sConnectedDeviceCount = 0;
 static StaticAutoPtr<Monitor> sStopBluetoothMonitor;
 
 // Protects against bug 969447.
 static StaticAutoPtr<Monitor> sGetPropertyMonitor;
 
-typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&);
+typedef void (*UnpackFunc)(DBusMessage*, DBusError*,
+                           BluetoothValue&, nsAString&);
 typedef bool (*FilterFunc)(const BluetoothValue&);
 
 static void
 DispatchToDBusThread(Task* task)
 {
   XRE_GetIOMessageLoop()->PostTask(FROM_HERE, task);
 }
 
@@ -395,19 +396,20 @@ DispatchToBtThread(nsIRunnable* aRunnabl
    * is used for running blocking calls. The thread is not intended
    * for regular Bluetooth operations though.
    */
   static StaticRefPtr<LazyIdleThread> sBluetoothThread;
 
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sBluetoothThread) {
-    sBluetoothThread = new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
-                                          NS_LITERAL_CSTRING("BluetoothDBusService"),
-                                          LazyIdleThread::ManualShutdown);
+    sBluetoothThread =
+      new LazyIdleThread(BT_LAZY_THREAD_TIMEOUT_MS,
+                         NS_LITERAL_CSTRING("BluetoothDBusService"),
+                         LazyIdleThread::ManualShutdown);
     ClearOnShutdown(&sBluetoothThread);
   }
   return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
 }
 
 static void
 DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
                        const BluetoothValue& aValue,
@@ -584,17 +586,18 @@ public:
   {
   }
 
   NS_IMETHOD
   Run()
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(mSignal.name().EqualsLiteral("PropertyChanged"));
-    MOZ_ASSERT(mSignal.value().type() == BluetoothValue::TArrayOfBluetoothNamedValue);
+    MOZ_ASSERT(mSignal.value().type() ==
+               BluetoothValue::TArrayOfBluetoothNamedValue);
 
     // Replace object path with device address
     nsString address = GetAddressFromObjectPath(mSignal.path());
     mSignal.path() = address;
 
     BluetoothHidManager* hid = BluetoothHidManager::Get();
     NS_ENSURE_TRUE(hid, NS_ERROR_FAILURE);
     hid->HandleInputPropertyChanged(mSignal);
@@ -728,17 +731,17 @@ RunDBusCallback(DBusMessage* aMsg, void*
 #ifdef MOZ_WIDGET_GONK
   // Due to the fact that we're running two dbus loops on desktop implicitly by
   // being gtk based, sometimes we'll get signals/reply coming in on the main
   // thread. There's not a lot we can do about that for the time being and it
   // (technically) shouldn't hurt anything. However, on gonk, die.
   MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
 #endif
   nsRefPtr<BluetoothReplyRunnable> replyRunnable =
-    dont_AddRef(static_cast< BluetoothReplyRunnable* >(aBluetoothReplyRunnable));
+    dont_AddRef(static_cast<BluetoothReplyRunnable*>(aBluetoothReplyRunnable));
 
   MOZ_ASSERT(replyRunnable, "Callback reply runnable is null!");
 
   nsAutoString replyError;
   BluetoothValue v;
   aFunc(aMsg, nullptr, v, replyError);
 
   // Bug 941462. When blueZ replys 'I/O error', we treat it as 'internal error'.
@@ -1467,26 +1470,28 @@ AgentEventFilter(DBusConnection *conn, D
       goto handle_error;
     }
 
     dbus_connection_send(conn, reply, nullptr);
     dbus_message_unref(reply);
 
     // Do not send a notification to upper layer, too annoying.
     return DBUS_HANDLER_RESULT_HANDLED;
-  } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE, "RequestPairingConsent")) {
+  } else if (dbus_message_is_method_call(msg, DBUS_AGENT_IFACE,
+                                         "RequestPairingConsent")) {
     // Directly SetPairingconfirmation for RequestPairingConsent here
     if (!dbus_message_get_args(msg, nullptr,
                                DBUS_TYPE_OBJECT_PATH, &objectPath,
                                DBUS_TYPE_INVALID)) {
       errorStr.AssignLiteral("Invalid arguments: RequestPairingConsent()");
       goto handle_error;
     }
 
-    nsString address = GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath));
+    nsString address =
+      GetAddressFromObjectPath(NS_ConvertUTF8toUTF16(objectPath));
     sPairingReqTable->Put(address, msg);
     Task* task = new SetPairingConfirmationTask(address, true, nullptr);
     DispatchToDBusThread(task);
     // Increase dbus message reference counts, it will be decreased in
     // SetPairingConfirmationTask
     dbus_message_ref(msg);
     // Do not send a notification to upper layer
     return DBUS_HANDLER_RESULT_HANDLED;
@@ -2088,22 +2093,23 @@ public:
     if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
       BT_WARNING("Failed to dispatch to main thread!");
       return;
     }
 
     /* Normally we'll receive the signal 'AdapterAdded' with the adapter object
      * path from the DBus daemon during start up. So, there's no need to query
      * the object path of default adapter here. However, if we restart from a
-     * crash, the default adapter might already be available, so we ask the daemon
-     * explicitly here.
+     * crash, the default adapter might already be available, so we ask the
+     * daemon explicitly here.
      */
     if (sAdapterPath.IsEmpty()) {
-      bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply, nullptr,
-                                                    1000, BLUEZ_DBUS_BASE_IFC, "/",
+      bool success = sDBusConnection->SendWithReply(OnDefaultAdapterReply,
+                                                    nullptr, 1000,
+                                                    BLUEZ_DBUS_BASE_IFC, "/",
                                                     DBUS_MANAGER_IFACE,
                                                     "DefaultAdapter",
                                                     DBUS_TYPE_INVALID);
       if (!success) {
         BT_WARNING("Failed to query default adapter!");
       }
     }
   }
@@ -2478,17 +2484,18 @@ OnSendDiscoveryMessageReply(DBusMessage 
 
   nsAutoString errorStr;
 
   if (!aReply) {
     errorStr.AssignLiteral("SendDiscovery failed");
   }
 
   nsRefPtr<BluetoothReplyRunnable> runnable =
-    dont_AddRef<BluetoothReplyRunnable>(static_cast<BluetoothReplyRunnable*>(aData));
+    dont_AddRef<BluetoothReplyRunnable>(
+      static_cast<BluetoothReplyRunnable*>(aData));
 
   DispatchBluetoothReply(runnable.get(), BluetoothValue(true), errorStr);
 }
 
 class SendDiscoveryMessageTask : public Task
 {
 public:
   SendDiscoveryMessageTask(const char* aMessageName,
@@ -2818,18 +2825,18 @@ public:
   }
 
 private:
   nsRefPtr<BluetoothArrayOfDevicePropertiesReplyHandler> mHandler;
   nsRefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
 nsresult
-BluetoothDBusService::GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
-                                              BluetoothReplyRunnable* aRunnable)
+BluetoothDBusService::GetConnectedDevicePropertiesInternal(
+  uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoString errorStr;
   BluetoothValue values = InfallibleTArray<BluetoothNamedValue>();
   if (!IsReady()) {
     NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
     DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
@@ -3529,19 +3536,19 @@ private:
   nsString mServiceUuid;
   int mChannel;
   BluetoothProfileManagerBase* mManager;
 };
 
 class OnGetServiceChannelReplyHandler : public DBusReplyHandler
 {
 public:
-  OnGetServiceChannelReplyHandler(const nsAString& aDeviceAddress,
-                                  const nsAString& aServiceUUID,
-                                  BluetoothProfileManagerBase* aBluetoothProfileManager)
+  OnGetServiceChannelReplyHandler(
+    const nsAString& aDeviceAddress, const nsAString& aServiceUUID,
+    BluetoothProfileManagerBase* aBluetoothProfileManager)
   : mDeviceAddress(aDeviceAddress),
     mServiceUUID(aServiceUUID),
     mBluetoothProfileManager(aBluetoothProfileManager)
   {
     MOZ_ASSERT(mBluetoothProfileManager);
   }
 
   void Handle(DBusMessage* aReply)
@@ -3554,20 +3561,19 @@ public:
     // in BluetoothProfileManagerBase::OnGetServiceChannel.
 
     int channel = -1;
 
     if (aReply && (dbus_message_get_type(aReply) != DBUS_MESSAGE_TYPE_ERROR)) {
       channel = dbus_returns_int32(aReply);
     }
 
-    nsRefPtr<nsRunnable> r = new OnGetServiceChannelRunnable(mDeviceAddress,
-                                                             mServiceUUID,
-                                                             channel,
-                                                             mBluetoothProfileManager);
+    nsRefPtr<nsRunnable> r =
+      new OnGetServiceChannelRunnable(mDeviceAddress, mServiceUUID, channel,
+                                      mBluetoothProfileManager);
     nsresult rv = NS_DispatchToMainThread(r);
     NS_ENSURE_SUCCESS_VOID(rv);
   }
 
 private:
   nsString mDeviceAddress;
   nsString mServiceUUID;
   BluetoothProfileManagerBase* mBluetoothProfileManager;
@@ -3872,18 +3878,18 @@ public:
   void Run() override
   {
     MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
     MOZ_ASSERT(sDBusConnection);
     MOZ_ASSERT(!sAdapterPath.IsEmpty());
 
     // We currently don't support genre field in music player.
     // In order to send media metadata through AVRCP, we set genre to an empty
-    // string to match the BlueZ method "UpdateMetaData" with signature "sssssss",
-    // which takes genre field as the last parameter.
+    // string to match the BlueZ method "UpdateMetaData" with signature
+    // "sssssss", which takes genre field as the last parameter.
     nsCString tempGenre = EmptyCString();
     nsCString tempMediaNumber = EmptyCString();
     nsCString tempTotalMediaCount = EmptyCString();
     nsCString tempDuration = EmptyCString();
 
     if (mMediaNumber >= 0) {
       tempMediaNumber.AppendInt(mMediaNumber);
     }
--- a/dom/bluetooth/bluez/BluetoothDBusService.h
+++ b/dom/bluetooth/bluez/BluetoothDBusService.h
@@ -50,30 +50,32 @@ public:
   virtual nsresult StartInternal(BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult StopInternal(BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
   GetAdaptersInternal(BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
-  GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
-                                       BluetoothReplyRunnable* aRunnable) override;
+  GetConnectedDevicePropertiesInternal(
+    uint16_t aServiceUuid, BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
   GetPairedDevicePropertiesInternal(const nsTArray<nsString>& aDeviceAddresses,
                                     BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
   FetchUuidsInternal(const nsAString& aDeviceAddress,
                      BluetoothReplyRunnable* aRunnable) override;
 
-  virtual void StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
+  virtual void
+  StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
 
-  virtual void StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
+  virtual void
+  StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
   SetProperty(BluetoothObjectType aType,
               const BluetoothNamedValue& aValue,
               BluetoothReplyRunnable* aRunnable) override;
 
   virtual nsresult
   GetServiceChannel(const nsAString& aDeviceAddress,
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -585,17 +585,18 @@ void
 BluetoothHfpManager::HandleVolumeChanged(nsISupports* aSubject)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // The string that we're interested in will be a JSON string that looks like:
   //  {"key":"volumeup", "value":10}
   //  {"key":"volumedown", "value":2}
 
-  RootedDictionary<dom::SettingChangeNotification> setting(nsContentUtils::RootingCx());
+  RootedDictionary<dom::SettingChangeNotification>
+    setting(nsContentUtils::RootingCx());
 
   if (!WrappedJSToDictionary(aSubject, setting)) {
     return;
   }
   if (!setting.mKey.EqualsASCII(AUDIO_VOLUME_BT_SCO_ID)) {
     return;
   }
   if (!setting.mValue.isNumber()) {
@@ -838,17 +839,18 @@ BluetoothHfpManager::ReceiveSocketData(B
       BT_WARNING("Could't get the value of command [AT+COPS=]");
       goto respond_with_ok;
     }
 
     // Handsfree only support AT+COPS=3,0
     if (!atCommandValues[0].EqualsLiteral("3") ||
         !atCommandValues[1].EqualsLiteral("0")) {
       if (mCMEE) {
-        SendCommand(RESPONSE_CME_ERROR, BluetoothCmeError::OPERATION_NOT_SUPPORTED);
+        SendCommand(RESPONSE_CME_ERROR,
+                    BluetoothCmeError::OPERATION_NOT_SUPPORTED);
       } else {
         SendLine("ERROR");
       }
       return;
     }
   } else if (msg.Find("AT+COPS?") != -1) {
     nsAutoCString message("+COPS: ");
     message.AppendInt(mNetworkSelectionMode);
@@ -1220,17 +1222,18 @@ BluetoothHfpManager::Listen()
 
 void
 BluetoothHfpManager::Disconnect(BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mSocket) {
     if (aController) {
-      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
+      aController->NotifyCompletion(
+        NS_LITERAL_STRING(ERR_ALREADY_DISCONNECTED));
     }
     return;
   }
 
   MOZ_ASSERT(!mController);
 
   mController = aController;
   mSocket->Close();
@@ -1502,18 +1505,20 @@ BluetoothHfpManager::HandleCallStateChan
 
   nsRefPtr<nsRunnable> sendRingTask;
   nsString address;
 
   switch (aCallState) {
     case nsITelephonyService::CALL_STATE_HELD:
       switch (prevCallState) {
         case nsITelephonyService::CALL_STATE_CONNECTED: {
-          uint32_t numActive = GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
-          uint32_t numHeld = GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD);
+          uint32_t numActive =
+            GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
+          uint32_t numHeld =
+            GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD);
           uint32_t numConCalls = GetNumberOfConCalls();
 
           /**
            * An active call becomes a held call.
            *
            * If this call is not a conference call,
            * - callheld state = ONHOLD_NOACTIVE if no active call remains;
            * - callheld state = ONHOLD_ACTIVE otherwise.
@@ -1525,30 +1530,34 @@ BluetoothHfpManager::HandleCallStateChan
            * Note number of active calls may be 0 in-between state transition
            * (c1 has become held but c2 has not become active yet), so we regard
            * no active call remains if there is no other active/held call
            * besides this changed call/group of conference call.
            */
           if (!aIsConference) {
             if (numActive + numHeld == 1) {
               // A single active call is put on hold.
-              sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
+              sCINDItems[CINDType::CALLHELD].value =
+                CallHeldState::ONHOLD_NOACTIVE;
             } else {
               // An active call is placed on hold or active/held calls swapped.
-              sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
+              sCINDItems[CINDType::CALLHELD].value =
+                CallHeldState::ONHOLD_ACTIVE;
             }
             SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
           } else if (GetNumberOfConCalls(nsITelephonyService::CALL_STATE_HELD)
                      == numConCalls) {
             if (numActive + numHeld == numConCalls) {
               // An active conference call is put on hold.
-              sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_NOACTIVE;
+              sCINDItems[CINDType::CALLHELD].value =
+                CallHeldState::ONHOLD_NOACTIVE;
             } else {
               // Active calls are placed on hold or active/held calls swapped.
-              sCINDItems[CINDType::CALLHELD].value = CallHeldState::ONHOLD_ACTIVE;
+              sCINDItems[CINDType::CALLHELD].value =
+                CallHeldState::ONHOLD_ACTIVE;
             }
             SendCommand(RESPONSE_CIEV, CINDType::CALLHELD);
           }
           break;
         }
         case nsITelephonyService::CALL_STATE_DISCONNECTED:
           // The call state changed from DISCONNECTED to HELD. It could happen
           // when user held a call before Bluetooth got connected.