Merge b2ginbound to central, a=merge
authorWes Kocher <wkocher@mozilla.com>
Thu, 19 Nov 2015 13:36:16 -0800
changeset 273387 cc325db44f6f8a58604d60b746c140e73f3d8216
parent 273386 a76322320837ac6d0c9510c280706359a47ea309 (current diff)
parent 273384 b69c86a07756c1ff1a0b3cf14faa06968298b5b1 (diff)
child 273388 7dfba54fae74d716f9c59b68211ec236b9616fc9
child 273438 3835b568092ae3b71adc931d24928670ad7141a7
child 273515 0c351448cd9f4224bf98709d04e6623b52eef8b0
child 273587 4f4a386a6ada27f848ca782647b9e5048abb7ca5
push id68263
push userkwierso@gmail.com
push dateThu, 19 Nov 2015 21:48:11 +0000
treeherdermozilla-inbound@7dfba54fae74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone45.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 b2ginbound to central, 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="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- 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="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- 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="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cb4604d5a578efd027277059ce3e0f6e3af59bd1"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c72c9278ddc2f442d193474993d36e7f2cfb08c4"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- Stock Android things -->
--- 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="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
--- 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="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
@@ -124,17 +124,17 @@
   <project name="platform/external/icu4c" path="external/icu4c" remote="aosp" revision="b4c6379528887dc25ca9991a535a8d92a61ad6b6"/>
   <project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="2da3a2d5100f8afa1229bb50aa2a29ea0aaf8417"/>
   <project name="platform_system_core" path="system/core" remote="b2g" revision="8586f55fe4b015911b48e731b69c592ad82a0807"/>
   <default remote="caf" revision="refs/tags/android-4.4.2_r1" sync-j="4"/>
   <!-- Emulator specific things -->
   <project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="72ffdf71c68a96309212eb13d63560d66db14c9e"/>
   <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="58800ecb50e4e41cfb0a36cb43c82b73fb3612e5"/>
   <project name="platform_bionic" path="bionic" remote="b2g" revision="3e85c4683c121530c1c3a48c696a569bf5f587e2"/>
-  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5a50f96a1d7c788817abb7c57acbb75172c1f48d"/>
+  <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="b2f83825411be614e8f7ec75fc731fc9c67a7078"/>
   <project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="f37bd545063039e30a92f2550ae78c0e6e4e2d08"/>
   <project name="platform_external_wpa_supplicant_8" path="external/wpa_supplicant_8" remote="b2g" revision="0c6a6547cd1fd302fa2b0f6e375654df36bf0ec4"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="29cbaa03a380ab69d47c476dd433059f7680837c"/>
   <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="5f4b68c799927b6e078f987b12722c3a6ccd4a45"/>
   <project name="platform/development" path="development" revision="5968ff4e13e0d696ad8d972281fc27ae5a12829b"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="6a1bb59af65b6485b1090522f66fac95c3f9e22c"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="0951179277915335251c5e11d242e4e1a8c2236f"/>
   <project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
--- 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="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
--- 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="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cb4604d5a578efd027277059ce3e0f6e3af59bd1"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c72c9278ddc2f442d193474993d36e7f2cfb08c4"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- Stock Android things -->
--- 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="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf", 
+        "git_revision": "94a821b49f4dca3f9321cd80e13c44c4a6696952", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "38edf6a5a770747986828cae0e7316b90794dc19", 
+    "revision": "1f6ce210fb439cf48b7fd29dcf2e46914177aba9", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-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="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -13,17 +13,17 @@
   <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="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="f80d4c8bcb2f5a08015100048b3ae54c0d7999bd"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
--- 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="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="ffaade435bb9c3005fd6c9b7ee1cd17b90e08cbf"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="94a821b49f4dca3f9321cd80e13c44c4a6696952"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9a58f2e395da17c252f61f28900b5b09aeb813bd"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
--- a/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.cpp
@@ -12,31 +12,26 @@ BEGIN_BLUETOOTH_NAMESPACE
 using namespace mozilla::ipc;
 
 //
 // Core module
 //
 
 const int BluetoothDaemonCoreModule::MAX_NUM_CLIENTS = 1;
 
-BluetoothNotificationHandler* BluetoothDaemonCoreModule::sNotificationHandler;
+BluetoothCoreNotificationHandler*
+  BluetoothDaemonCoreModule::sNotificationHandler;
 
 void
 BluetoothDaemonCoreModule::SetNotificationHandler(
-  BluetoothNotificationHandler* aNotificationHandler)
+  BluetoothCoreNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
-BluetoothNotificationHandler*
-BluetoothDaemonCoreModule::GetNotificationHandler()
-{
-  return sNotificationHandler;
-}
-
 void
 BluetoothDaemonCoreModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
                                      DaemonSocketPDU& aPDU,
                                      DaemonSocketResultHandler* aRes)
 {
   static void (BluetoothDaemonCoreModule::* const HandleOp[])(
     const DaemonSocketPDUHeader&, DaemonSocketPDU&,
     DaemonSocketResultHandler*) = {
@@ -48,34 +43,34 @@ BluetoothDaemonCoreModule::HandleSvc(con
 
   (this->*(HandleOp[!!(aHeader.mOpcode & 0x80)]))(aHeader, aPDU, aRes);
 }
 
 // Commands
 //
 
 nsresult
-BluetoothDaemonCoreModule::EnableCmd(BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::EnableCmd(BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_ENABLE,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
-BluetoothDaemonCoreModule::DisableCmd(BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::DisableCmd(BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_DISABLE,
                         0));
 
   nsresult rv = Send(pdu, aRes);
@@ -83,35 +78,35 @@ BluetoothDaemonCoreModule::DisableCmd(Bl
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetAdapterPropertiesCmd(
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_ADAPTER_PROPERTIES,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
-BluetoothDaemonCoreModule::GetAdapterPropertyCmd(BluetoothPropertyType aType,
-                                                 BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::GetAdapterPropertyCmd(
+  BluetoothPropertyType aType, BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_ADAPTER_PROPERTY,
                         0));
 
   nsresult rv = PackPDU(aType, *pdu);
@@ -123,17 +118,17 @@ BluetoothDaemonCoreModule::GetAdapterPro
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SetAdapterPropertyCmd(
-  const BluetoothProperty& aProperty, BluetoothResultHandler* aRes)
+  const BluetoothProperty& aProperty, BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_SET_ADAPTER_PROPERTY,
                         0));
 
   nsresult rv = PackPDU(aProperty, *pdu);
@@ -145,17 +140,17 @@ BluetoothDaemonCoreModule::SetAdapterPro
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteDevicePropertiesCmd(
-  const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
+  const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_REMOTE_DEVICE_PROPERTIES,
                         0));
 
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
@@ -169,17 +164,17 @@ BluetoothDaemonCoreModule::GetRemoteDevi
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteDevicePropertyCmd(
   const BluetoothAddress& aRemoteAddr,
   BluetoothPropertyType aType,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_REMOTE_DEVICE_PROPERTY,
                         0));
 
   nsresult rv = PackPDU(aRemoteAddr, aType, *pdu);
@@ -193,17 +188,17 @@ BluetoothDaemonCoreModule::GetRemoteDevi
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SetRemoteDevicePropertyCmd(
   const BluetoothAddress& aRemoteAddr,
   const BluetoothProperty& aProperty,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_SET_REMOTE_DEVICE_PROPERTY,
                         0));
 
   nsresult rv = PackPDU(aRemoteAddr, aProperty, *pdu);
@@ -216,17 +211,17 @@ BluetoothDaemonCoreModule::SetRemoteDevi
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
   const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_REMOTE_SERVICE_RECORD,
                         0));
 
   nsresult rv = PackPDU(aRemoteAddr, aUuid, *pdu);
@@ -238,17 +233,17 @@ BluetoothDaemonCoreModule::GetRemoteServ
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteServicesCmd(
-  const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
+  const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_REMOTE_SERVICES, 0));
 
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
@@ -258,34 +253,34 @@ BluetoothDaemonCoreModule::GetRemoteServ
   if (NS_FAILED(rv)) {
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
-BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_START_DISCOVERY,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
-BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_CANCEL_DISCOVERY,
                         0));
 
   nsresult rv = Send(pdu, aRes);
@@ -294,17 +289,17 @@ BluetoothDaemonCoreModule::CancelDiscove
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::CreateBondCmd(const BluetoothAddress& aBdAddr,
                                          BluetoothTransport aTransport,
-                                         BluetoothResultHandler* aRes)
+                                         BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_CREATE_BOND,
                         0));
 
 #if ANDROID_VERSION >= 21
@@ -320,17 +315,17 @@ BluetoothDaemonCoreModule::CreateBondCmd
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::RemoveBondCmd(const BluetoothAddress& aBdAddr,
-                                         BluetoothResultHandler* aRes)
+                                         BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_REMOVE_BOND,
                         0));
 
   nsresult rv = PackPDU(aBdAddr, *pdu);
@@ -342,17 +337,17 @@ BluetoothDaemonCoreModule::RemoveBondCmd
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::CancelBondCmd(const BluetoothAddress& aBdAddr,
-                                         BluetoothResultHandler* aRes)
+                                         BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_CANCEL_BOND,
                         0));
 
   nsresult rv = PackPDU(aBdAddr, *pdu);
@@ -366,17 +361,17 @@ BluetoothDaemonCoreModule::CancelBondCmd
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::PinReplyCmd(const BluetoothAddress& aBdAddr,
                                        bool aAccept,
                                        const BluetoothPinCode& aPinCode,
-                                       BluetoothResultHandler* aRes)
+                                       BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_PIN_REPLY,
                         0));
 
   nsresult rv = PackPDU(aBdAddr, aAccept, aPinCode, *pdu);
@@ -390,17 +385,17 @@ BluetoothDaemonCoreModule::PinReplyCmd(c
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SspReplyCmd(const BluetoothAddress& aBdAddr,
                                        BluetoothSspVariant aVariant,
                                        bool aAccept, uint32_t aPasskey,
-                                       BluetoothResultHandler* aRes)
+                                       BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_SSP_REPLY,
                         0));
 
   nsresult rv = PackPDU(aBdAddr, aVariant, aAccept, aPasskey, *pdu);
@@ -411,18 +406,18 @@ BluetoothDaemonCoreModule::SspReplyCmd(c
   if (NS_FAILED(rv)) {
     return rv;
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
-BluetoothDaemonCoreModule::DutModeConfigureCmd(bool aEnable,
-                                               BluetoothResultHandler* aRes)
+BluetoothDaemonCoreModule::DutModeConfigureCmd(
+  bool aEnable, BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_DUT_MODE_CONFIGURE,
                         0));
 
   nsresult rv = PackPDU(aEnable, *pdu);
@@ -435,17 +430,17 @@ BluetoothDaemonCoreModule::DutModeConfig
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::DutModeSendCmd(uint16_t aOpcode,
                                           uint8_t* aBuf, uint8_t aLen,
-                                          BluetoothResultHandler* aRes)
+                                          BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_DUT_MODE_SEND,
                         0));
 
   nsresult rv = PackPDU(aOpcode, aLen, PackArray<uint8_t>(aBuf, aLen),
@@ -459,17 +454,17 @@ BluetoothDaemonCoreModule::DutModeSendCm
   }
   Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::LeTestModeCmd(uint16_t aOpcode,
                                          uint8_t* aBuf, uint8_t aLen,
-                                         BluetoothResultHandler* aRes)
+                                         BluetoothCoreResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_LE_TEST_MODE,
                         0));
 
   nsresult rv = PackPDU(aOpcode, aLen, PackArray<uint8_t>(aBuf, aLen),
@@ -486,229 +481,229 @@ BluetoothDaemonCoreModule::LeTestModeCmd
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonCoreModule::ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                                     DaemonSocketPDU& aPDU,
-                                    BluetoothResultHandler* aRes)
+                                    BluetoothCoreResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::OnError, UnpackPDUInitOp(aPDU));
+    aRes, &BluetoothCoreResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::EnableRsp(const DaemonSocketPDUHeader& aHeader,
                                      DaemonSocketPDU& aPDU,
-                                     BluetoothResultHandler* aRes)
+                                     BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::Enable, UnpackPDUInitOp(aPDU));
+    aRes, &BluetoothCoreResultHandler::Enable, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::DisableRsp(const DaemonSocketPDUHeader& aHeader,
                                       DaemonSocketPDU& aPDU,
-                                      BluetoothResultHandler* aRes)
+                                      BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::Disable, UnpackPDUInitOp(aPDU));
+    aRes, &BluetoothCoreResultHandler::Disable, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetAdapterPropertiesRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetAdapterProperties,
+    aRes, &BluetoothCoreResultHandler::GetAdapterProperties,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetAdapterPropertyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetAdapterProperty,
+    aRes, &BluetoothCoreResultHandler::GetAdapterProperty,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::SetAdapterPropertyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::SetAdapterProperty,
+    aRes, &BluetoothCoreResultHandler::SetAdapterProperty,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetRemoteDevicePropertiesRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetRemoteDeviceProperties,
+    aRes, &BluetoothCoreResultHandler::GetRemoteDeviceProperties,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetRemoteDevicePropertyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetRemoteDeviceProperty,
+    aRes, &BluetoothCoreResultHandler::GetRemoteDeviceProperty,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::SetRemoteDevicePropertyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::SetRemoteDeviceProperty,
+    aRes, &BluetoothCoreResultHandler::SetRemoteDeviceProperty,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetRemoteServiceRecordRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetRemoteServiceRecord,
+    aRes, &BluetoothCoreResultHandler::GetRemoteServiceRecord,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::GetRemoteServicesRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::GetRemoteServices,
+    aRes, &BluetoothCoreResultHandler::GetRemoteServices,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::StartDiscoveryRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::StartDiscovery,
+    aRes, &BluetoothCoreResultHandler::StartDiscovery,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::CancelDiscoveryRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::CancelDiscovery,
+    aRes, &BluetoothCoreResultHandler::CancelDiscovery,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::CreateBondRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::CreateBond,
+    aRes, &BluetoothCoreResultHandler::CreateBond,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::RemoveBondRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::RemoveBond,
+    aRes, &BluetoothCoreResultHandler::RemoveBond,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::CancelBondRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::CancelBond,
+    aRes, &BluetoothCoreResultHandler::CancelBond,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::PinReplyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::PinReply,
+    aRes, &BluetoothCoreResultHandler::PinReply,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::SspReplyRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::SspReply,
+    aRes, &BluetoothCoreResultHandler::SspReply,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::DutModeConfigureRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::DutModeConfigure,
+    aRes, &BluetoothCoreResultHandler::DutModeConfigure,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::DutModeSendRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::DutModeSend,
+    aRes, &BluetoothCoreResultHandler::DutModeSend,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::LeTestModeRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
-  BluetoothResultHandler* aRes)
+  BluetoothCoreResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
-    aRes, &BluetoothResultHandler::LeTestMode,
+    aRes, &BluetoothCoreResultHandler::LeTestMode,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::HandleRsp(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   DaemonSocketResultHandler* aRes)
 {
   static void (BluetoothDaemonCoreModule::* const HandleRsp[])(
     const DaemonSocketPDUHeader&,
     DaemonSocketPDU&,
-    BluetoothResultHandler*) = {
+    BluetoothCoreResultHandler*) = {
     [OPCODE_ERROR] =
       &BluetoothDaemonCoreModule::ErrorRsp,
     [OPCODE_ENABLE] =
       &BluetoothDaemonCoreModule::EnableRsp,
     [OPCODE_DISABLE] =
       &BluetoothDaemonCoreModule::DisableRsp,
     [OPCODE_GET_ADAPTER_PROPERTIES] =
       &BluetoothDaemonCoreModule::GetAdapterPropertiesRsp,
@@ -750,48 +745,48 @@ BluetoothDaemonCoreModule::HandleRsp(
 
   MOZ_ASSERT(!NS_IsMainThread());
 
   if (NS_WARN_IF(!(aHeader.mOpcode < MOZ_ARRAY_LENGTH(HandleRsp))) ||
       NS_WARN_IF(!HandleRsp[aHeader.mOpcode])) {
     return;
   }
 
-  RefPtr<BluetoothResultHandler> res =
-    static_cast<BluetoothResultHandler*>(aRes);
+  RefPtr<BluetoothCoreResultHandler> res =
+    static_cast<BluetoothCoreResultHandler*>(aRes);
 
   if (!res) {
     return; // Return early if no result handler has been set for response
   }
 
   (this->*(HandleRsp[aHeader.mOpcode]))(aHeader, aPDU, res);
 }
 
 // Notifications
 //
 
 class BluetoothDaemonCoreModule::NotificationHandlerWrapper final
 {
 public:
-  typedef BluetoothNotificationHandler ObjectType;
+  typedef BluetoothCoreNotificationHandler ObjectType;
 
   static ObjectType* GetInstance()
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     return sNotificationHandler;
   }
 };
 
 void
 BluetoothDaemonCoreModule::AdapterStateChangedNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AdapterStateChangedNotification::Dispatch(
-    &BluetoothNotificationHandler::AdapterStateChangedNotification,
+    &BluetoothCoreNotificationHandler::AdapterStateChangedNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for AdapterPropertiesNotification
 class BluetoothDaemonCoreModule::AdapterPropertiesInitOp final
   : private PDUInitOp
 {
 public:
@@ -830,17 +825,17 @@ public:
   }
 };
 
 void
 BluetoothDaemonCoreModule::AdapterPropertiesNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AdapterPropertiesNotification::Dispatch(
-    &BluetoothNotificationHandler::AdapterPropertiesNotification,
+    &BluetoothCoreNotificationHandler::AdapterPropertiesNotification,
     AdapterPropertiesInitOp(aPDU));
 }
 
 // Init operator class for RemoteDevicePropertiesNotification
 class BluetoothDaemonCoreModule::RemoteDevicePropertiesInitOp final
   : private PDUInitOp
 {
 public:
@@ -885,17 +880,17 @@ public:
   }
 };
 
 void
 BluetoothDaemonCoreModule::RemoteDevicePropertiesNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   RemoteDevicePropertiesNotification::Dispatch(
-    &BluetoothNotificationHandler::RemoteDevicePropertiesNotification,
+    &BluetoothCoreNotificationHandler::RemoteDevicePropertiesNotification,
     RemoteDevicePropertiesInitOp(aPDU));
 }
 
 // Init operator class for DeviceFoundNotification
 class BluetoothDaemonCoreModule::DeviceFoundInitOp final
   : private PDUInitOp
 {
 public:
@@ -927,62 +922,62 @@ public:
   }
 };
 
 void
 BluetoothDaemonCoreModule::DeviceFoundNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   DeviceFoundNotification::Dispatch(
-    &BluetoothNotificationHandler::DeviceFoundNotification,
+    &BluetoothCoreNotificationHandler::DeviceFoundNotification,
     DeviceFoundInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::DiscoveryStateChangedNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   DiscoveryStateChangedNotification::Dispatch(
-    &BluetoothNotificationHandler::DiscoveryStateChangedNotification,
+    &BluetoothCoreNotificationHandler::DiscoveryStateChangedNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::PinRequestNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   PinRequestNotification::Dispatch(
-    &BluetoothNotificationHandler::PinRequestNotification,
+    &BluetoothCoreNotificationHandler::PinRequestNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::SspRequestNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   SspRequestNotification::Dispatch(
-    &BluetoothNotificationHandler::SspRequestNotification,
+    &BluetoothCoreNotificationHandler::SspRequestNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::BondStateChangedNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   BondStateChangedNotification::Dispatch(
-    &BluetoothNotificationHandler::BondStateChangedNotification,
+    &BluetoothCoreNotificationHandler::BondStateChangedNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::AclStateChangedNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AclStateChangedNotification::Dispatch(
-    &BluetoothNotificationHandler::AclStateChangedNotification,
+    &BluetoothCoreNotificationHandler::AclStateChangedNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for DutModeRecvNotification
 class BluetoothDaemonCoreModule::DutModeRecvInitOp final
   : private PDUInitOp
 {
 public:
@@ -1018,26 +1013,26 @@ public:
   }
 };
 
 void
 BluetoothDaemonCoreModule::DutModeRecvNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   DutModeRecvNotification::Dispatch(
-    &BluetoothNotificationHandler::DutModeRecvNotification,
+    &BluetoothCoreNotificationHandler::DutModeRecvNotification,
     DutModeRecvInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::LeTestModeNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   LeTestModeNotification::Dispatch(
-    &BluetoothNotificationHandler::LeTestModeNotification,
+    &BluetoothCoreNotificationHandler::LeTestModeNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonCoreModule::HandleNtf(
   const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   DaemonSocketResultHandler* aRes)
 {
@@ -1063,9 +1058,299 @@ BluetoothDaemonCoreModule::HandleNtf(
   if (NS_WARN_IF(!(index < MOZ_ARRAY_LENGTH(HandleNtf))) ||
       NS_WARN_IF(!HandleNtf[index])) {
     return;
   }
 
     (this->*(HandleNtf[index]))(aHeader, aPDU);
 }
 
+//
+// Core interface
+//
+
+BluetoothDaemonCoreInterface::BluetoothDaemonCoreInterface(
+  BluetoothDaemonCoreModule* aModule)
+  : mModule(aModule)
+{ }
+
+BluetoothDaemonCoreInterface::~BluetoothDaemonCoreInterface()
+{ }
+
+void
+BluetoothDaemonCoreInterface::SetNotificationHandler(
+  BluetoothCoreNotificationHandler* aNotificationHandler)
+{
+  MOZ_ASSERT(mModule);
+
+  mModule->SetNotificationHandler(aNotificationHandler);
+}
+
+/* Enable / Disable */
+
+void
+BluetoothDaemonCoreInterface::Enable(BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->EnableCmd(aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::Disable(BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->DisableCmd(aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Adapter Properties */
+
+void
+BluetoothDaemonCoreInterface::GetAdapterProperties(
+  BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetAdapterPropertiesCmd(aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::GetAdapterProperty(
+  BluetoothPropertyType aType, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetAdapterPropertyCmd(aType, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::SetAdapterProperty(
+  const BluetoothProperty& aProperty, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->SetAdapterPropertyCmd(aProperty, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Remote Device Properties */
+
+void
+BluetoothDaemonCoreInterface::GetRemoteDeviceProperties(
+  const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetRemoteDevicePropertiesCmd(aRemoteAddr, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::GetRemoteDeviceProperty(
+  const BluetoothAddress& aRemoteAddr, BluetoothPropertyType aType,
+  BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetRemoteDevicePropertyCmd(aRemoteAddr, aType, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::SetRemoteDeviceProperty(
+  const BluetoothAddress& aRemoteAddr, const BluetoothProperty& aProperty,
+  BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->SetRemoteDevicePropertyCmd(aRemoteAddr,
+                                                    aProperty,
+                                                    aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Remote Services */
+
+void
+BluetoothDaemonCoreInterface::GetRemoteServiceRecord(
+  const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
+  BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::GetRemoteServices(
+  const BluetoothAddress& aRemoteAddr, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->GetRemoteServicesCmd(aRemoteAddr, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Discovery */
+
+void
+BluetoothDaemonCoreInterface::StartDiscovery(BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->StartDiscoveryCmd(aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::CancelDiscovery(BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->CancelDiscoveryCmd(aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Bonds */
+
+void
+BluetoothDaemonCoreInterface::CreateBond(const BluetoothAddress& aBdAddr,
+                                         BluetoothTransport aTransport,
+                                         BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->CreateBondCmd(aBdAddr, aTransport, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::RemoveBond(const BluetoothAddress& aBdAddr,
+                                         BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->RemoveBondCmd(aBdAddr, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::CancelBond(
+  const BluetoothAddress& aBdAddr, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->CancelBondCmd(aBdAddr, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Connection */
+
+void
+BluetoothDaemonCoreInterface::GetConnectionState(
+  const BluetoothAddress& aBdAddr, BluetoothCoreResultHandler* aRes)
+{
+  // NO-OP: no corresponding interface of current BlueZ
+}
+
+/* Authentication */
+
+void
+BluetoothDaemonCoreInterface::PinReply(const BluetoothAddress& aBdAddr,
+                                       bool aAccept,
+                                       const BluetoothPinCode& aPinCode,
+                                       BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->PinReplyCmd(aBdAddr, aAccept, aPinCode, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::SspReply(const BluetoothAddress& aBdAddr,
+                                       BluetoothSspVariant aVariant,
+                                       bool aAccept, uint32_t aPasskey,
+                                       BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->SspReplyCmd(aBdAddr, aVariant, aAccept, aPasskey,
+                                     aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* DUT Mode */
+
+void
+BluetoothDaemonCoreInterface::DutModeConfigure(
+  bool aEnable, BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->DutModeConfigureCmd(aEnable, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+void
+BluetoothDaemonCoreInterface::DutModeSend(uint16_t aOpcode,
+                                          uint8_t* aBuf,
+                                          uint8_t aLen,
+                                          BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->DutModeSendCmd(aOpcode, aBuf, aLen, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* LE Mode */
+
+void
+BluetoothDaemonCoreInterface::LeTestMode(uint16_t aOpcode,
+                                         uint8_t* aBuf,
+                                         uint8_t aLen,
+                                         BluetoothCoreResultHandler* aRes)
+{
+  nsresult rv = mModule->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
+  if (NS_FAILED(rv)) {
+    DispatchError(aRes, rv);
+  }
+}
+
+/* Energy Information */
+
+void
+BluetoothDaemonCoreInterface::ReadEnergyInfo(BluetoothCoreResultHandler* aRes)
+{
+  // NO-OP: no corresponding interface of current BlueZ
+}
+
+void
+BluetoothDaemonCoreInterface::DispatchError(BluetoothCoreResultHandler* aRes,
+                                            BluetoothStatus aStatus)
+{
+  DaemonResultRunnable1<
+    BluetoothCoreResultHandler, void,
+    BluetoothStatus, BluetoothStatus>::Dispatch(
+    aRes, &BluetoothCoreResultHandler::OnError,
+    ConstantInitOp1<BluetoothStatus>(aStatus));
+}
+
+void
+BluetoothDaemonCoreInterface::DispatchError(BluetoothCoreResultHandler* aRes,
+                                            nsresult aRv)
+{
+  BluetoothStatus status;
+
+  if (NS_WARN_IF(NS_FAILED(Convert(aRv, status)))) {
+    status = STATUS_FAIL;
+  }
+  DispatchError(aRes, status);
+}
+
 END_BLUETOOTH_NAMESPACE
--- a/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.h
@@ -60,181 +60,179 @@ public:
   };
 
   static const int MAX_NUM_CLIENTS;
 
   virtual nsresult Send(DaemonSocketPDU* aPDU,
                         DaemonSocketResultHandler* aRes) = 0;
 
   void SetNotificationHandler(
-    BluetoothNotificationHandler* aNotificationHandler);
-
-  BluetoothNotificationHandler* GetNotificationHandler();
+    BluetoothCoreNotificationHandler* aNotificationHandler);
 
   //
   // Commands
   //
 
-  nsresult EnableCmd(BluetoothResultHandler* aRes);
+  nsresult EnableCmd(BluetoothCoreResultHandler* aRes);
 
-  nsresult DisableCmd(BluetoothResultHandler* aRes);
+  nsresult DisableCmd(BluetoothCoreResultHandler* aRes);
 
-  nsresult GetAdapterPropertiesCmd(BluetoothResultHandler* aRes);
+  nsresult GetAdapterPropertiesCmd(BluetoothCoreResultHandler* aRes);
 
   nsresult GetAdapterPropertyCmd(BluetoothPropertyType aType,
-                                 BluetoothResultHandler* aRes);
+                                 BluetoothCoreResultHandler* aRes);
 
   nsresult SetAdapterPropertyCmd(const BluetoothProperty& aProperty,
-                                 BluetoothResultHandler* aRes);
+                                 BluetoothCoreResultHandler* aRes);
 
   nsresult GetRemoteDevicePropertiesCmd(const BluetoothAddress& aRemoteAddr,
-                                        BluetoothResultHandler* aRes);
+                                        BluetoothCoreResultHandler* aRes);
 
   nsresult GetRemoteDevicePropertyCmd(const BluetoothAddress& aRemoteAddr,
                                       BluetoothPropertyType aType,
-                                      BluetoothResultHandler* aRes);
+                                      BluetoothCoreResultHandler* aRes);
 
   nsresult SetRemoteDevicePropertyCmd(const BluetoothAddress& aRemoteAddr,
                                       const BluetoothProperty& aProperty,
-                                      BluetoothResultHandler* aRes);
+                                      BluetoothCoreResultHandler* aRes);
 
   nsresult GetRemoteServiceRecordCmd(const BluetoothAddress& aRemoteAddr,
                                      const BluetoothUuid& aUuid,
-                                     BluetoothResultHandler* aRes);
+                                     BluetoothCoreResultHandler* aRes);
 
   nsresult GetRemoteServicesCmd(const BluetoothAddress& aRemoteAddr,
-                                BluetoothResultHandler* aRes);
+                                BluetoothCoreResultHandler* aRes);
 
-  nsresult StartDiscoveryCmd(BluetoothResultHandler* aRes);
+  nsresult StartDiscoveryCmd(BluetoothCoreResultHandler* aRes);
 
-  nsresult CancelDiscoveryCmd(BluetoothResultHandler* aRes);
+  nsresult CancelDiscoveryCmd(BluetoothCoreResultHandler* aRes);
 
   nsresult CreateBondCmd(const BluetoothAddress& aBdAddr,
                          BluetoothTransport aTransport,
-                         BluetoothResultHandler* aRes);
+                         BluetoothCoreResultHandler* aRes);
 
   nsresult RemoveBondCmd(const BluetoothAddress& aBdAddr,
-                         BluetoothResultHandler* aRes);
+                         BluetoothCoreResultHandler* aRes);
 
   nsresult CancelBondCmd(const BluetoothAddress& aBdAddr,
-                         BluetoothResultHandler* aRes);
+                         BluetoothCoreResultHandler* aRes);
 
   nsresult PinReplyCmd(const BluetoothAddress& aBdAddr, bool aAccept,
                        const BluetoothPinCode& aPinCode,
-                       BluetoothResultHandler* aRes);
+                       BluetoothCoreResultHandler* aRes);
 
   nsresult SspReplyCmd(const BluetoothAddress& aBdAddr,
                        BluetoothSspVariant aVariant,
                        bool aAccept, uint32_t aPasskey,
-                       BluetoothResultHandler* aRes);
+                       BluetoothCoreResultHandler* aRes);
 
-  nsresult DutModeConfigureCmd(bool aEnable, BluetoothResultHandler* aRes);
+  nsresult DutModeConfigureCmd(bool aEnable,
+                               BluetoothCoreResultHandler* aRes);
 
   nsresult DutModeSendCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                          BluetoothResultHandler* aRes);
+                          BluetoothCoreResultHandler* aRes);
 
   nsresult LeTestModeCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                         BluetoothResultHandler* aRes);
+                         BluetoothCoreResultHandler* aRes);
 
 protected:
   void HandleSvc(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, DaemonSocketResultHandler* aRes);
 
 private:
 
   //
   // Responses
   //
 
   typedef mozilla::ipc::DaemonResultRunnable0<
-    BluetoothResultHandler, void>
+    BluetoothCoreResultHandler, void>
     ResultRunnable;
 
   typedef mozilla::ipc::DaemonResultRunnable1<
-    BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>
+    BluetoothCoreResultHandler, void, BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
                 DaemonSocketPDU& aPDU,
-                BluetoothResultHandler* aRes);
+                BluetoothCoreResultHandler* aRes);
 
   void EnableRsp(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU,
-                 BluetoothResultHandler* aRes);
+                 BluetoothCoreResultHandler* aRes);
 
   void DisableRsp(const DaemonSocketPDUHeader& aHeader,
                   DaemonSocketPDU& aPDU,
-                  BluetoothResultHandler* aRes);
+                  BluetoothCoreResultHandler* aRes);
 
   void GetAdapterPropertiesRsp(const DaemonSocketPDUHeader& aHeader,
                                DaemonSocketPDU& aPDU,
-                               BluetoothResultHandler* aRes);
+                               BluetoothCoreResultHandler* aRes);
 
   void GetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
                              DaemonSocketPDU& aPDU,
-                             BluetoothResultHandler* aRes);
+                             BluetoothCoreResultHandler* aRes);
 
   void SetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
                              DaemonSocketPDU& aPDU,
-                             BluetoothResultHandler* aRes);
+                             BluetoothCoreResultHandler* aRes);
 
   void GetRemoteDevicePropertiesRsp(const DaemonSocketPDUHeader& aHeader,
                                     DaemonSocketPDU& aPDU,
-                                    BluetoothResultHandler* aRes);
+                                    BluetoothCoreResultHandler* aRes);
 
-  void
-  GetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
-                             DaemonSocketPDU& aPDU,
-                             BluetoothResultHandler* aRes);
+  void GetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU,
+                                  BluetoothCoreResultHandler* aRes);
 
   void SetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
                                   DaemonSocketPDU& aPDU,
-                                  BluetoothResultHandler* aRes);
+                                  BluetoothCoreResultHandler* aRes);
   void GetRemoteServiceRecordRsp(const DaemonSocketPDUHeader& aHeader,
                                  DaemonSocketPDU& aPDU,
-                                 BluetoothResultHandler* aRes);
+                                 BluetoothCoreResultHandler* aRes);
   void GetRemoteServicesRsp(const DaemonSocketPDUHeader& aHeader,
                             DaemonSocketPDU& aPDU,
-                            BluetoothResultHandler* aRes);
+                            BluetoothCoreResultHandler* aRes);
 
   void StartDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
                          DaemonSocketPDU& aPDU,
-                         BluetoothResultHandler* aRes);
+                         BluetoothCoreResultHandler* aRes);
   void CancelDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
                           DaemonSocketPDU& aPDU,
-                          BluetoothResultHandler* aRes);
+                          BluetoothCoreResultHandler* aRes);
 
   void CreateBondRsp(const DaemonSocketPDUHeader& aHeader,
                      DaemonSocketPDU& aPDU,
-                     BluetoothResultHandler* aRes);
+                     BluetoothCoreResultHandler* aRes);
   void RemoveBondRsp(const DaemonSocketPDUHeader& aHeader,
                      DaemonSocketPDU& aPDU,
-                     BluetoothResultHandler* aRes);
+                     BluetoothCoreResultHandler* aRes);
   void CancelBondRsp(const DaemonSocketPDUHeader& aHeader,
                      DaemonSocketPDU& aPDU,
-                     BluetoothResultHandler* aRes);
+                     BluetoothCoreResultHandler* aRes);
 
   void PinReplyRsp(const DaemonSocketPDUHeader& aHeader,
                    DaemonSocketPDU& aPDU,
-                   BluetoothResultHandler* aRes);
+                   BluetoothCoreResultHandler* aRes);
   void SspReplyRsp(const DaemonSocketPDUHeader& aHeader,
                    DaemonSocketPDU& aPDU,
-                   BluetoothResultHandler* aRes);
+                   BluetoothCoreResultHandler* aRes);
 
   void DutModeConfigureRsp(const DaemonSocketPDUHeader& aHeader,
                            DaemonSocketPDU& aPDU,
-                           BluetoothResultHandler* aRes);
+                           BluetoothCoreResultHandler* aRes);
 
   void DutModeSendRsp(const DaemonSocketPDUHeader& aHeader,
                       DaemonSocketPDU& aPDU,
-                      BluetoothResultHandler* aRes);
+                      BluetoothCoreResultHandler* aRes);
 
   void LeTestModeRsp(const DaemonSocketPDUHeader& aHeader,
                      DaemonSocketPDU& aPDU,
-                     BluetoothResultHandler* aRes);
+                     BluetoothCoreResultHandler* aRes);
 
   void HandleRsp(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, DaemonSocketResultHandler* aRes);
 
   //
   // Notifications
   //
 
@@ -334,14 +332,111 @@ private:
                       DaemonSocketPDU& aPDU);
 
   void LeTestModeNtf(const DaemonSocketPDUHeader& aHeader,
                      DaemonSocketPDU& aPDU);
 
   void HandleNtf(const DaemonSocketPDUHeader& aHeader,
                  DaemonSocketPDU& aPDU, DaemonSocketResultHandler* aRes);
 
-  static BluetoothNotificationHandler* sNotificationHandler;
+  static BluetoothCoreNotificationHandler* sNotificationHandler;
+};
+
+class BluetoothDaemonCoreInterface final
+  : public BluetoothCoreInterface
+{
+public:
+  BluetoothDaemonCoreInterface(BluetoothDaemonCoreModule* aModule);
+  ~BluetoothDaemonCoreInterface();
+
+  void SetNotificationHandler(
+    BluetoothCoreNotificationHandler* aNotificationHandler) override;
+
+  /* Enable / Disable */
+
+  void Enable(BluetoothCoreResultHandler* aRes) override;
+  void Disable(BluetoothCoreResultHandler* aRes) override;
+
+  /* Adapter Properties */
+
+  void GetAdapterProperties(BluetoothCoreResultHandler* aRes) override;
+  void GetAdapterProperty(BluetoothPropertyType aType,
+                          BluetoothCoreResultHandler* aRes) override;
+  void SetAdapterProperty(const BluetoothProperty& aProperty,
+                          BluetoothCoreResultHandler* aRes) override;
+
+  /* Remote Device Properties */
+
+  void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
+                                 BluetoothCoreResultHandler* aRes) override;
+  void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
+                               BluetoothPropertyType aType,
+                               BluetoothCoreResultHandler* aRes) override;
+  void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
+                               const BluetoothProperty& aProperty,
+                               BluetoothCoreResultHandler* aRes) override;
+
+  /* Remote Services */
+
+  void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
+                              const BluetoothUuid& aUuid,
+                              BluetoothCoreResultHandler* aRes) override;
+  void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
+                         BluetoothCoreResultHandler* aRes) override;
+
+  /* Discovery */
+
+  void StartDiscovery(BluetoothCoreResultHandler* aRes) override;
+  void CancelDiscovery(BluetoothCoreResultHandler* aRes) override;
+
+  /* Bonds */
+
+  void CreateBond(const BluetoothAddress& aBdAddr,
+                  BluetoothTransport aTransport,
+                  BluetoothCoreResultHandler* aRes) override;
+  void RemoveBond(const BluetoothAddress& aBdAddr,
+                  BluetoothCoreResultHandler* aRes) override;
+  void CancelBond(const BluetoothAddress& aBdAddr,
+                  BluetoothCoreResultHandler* aRes) override;
+
+  /* Connection */
+
+  void GetConnectionState(const BluetoothAddress& aBdAddr,
+                          BluetoothCoreResultHandler* aRes) override;
+
+  /* Authentication */
+
+  void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
+                const BluetoothPinCode& aPinCode,
+                BluetoothCoreResultHandler* aRes) override;
+
+  void SspReply(const BluetoothAddress& aBdAddr,
+                BluetoothSspVariant aVariant,
+                bool aAccept, uint32_t aPasskey,
+                BluetoothCoreResultHandler* aRes) override;
+
+  /* DUT Mode */
+
+  void DutModeConfigure(bool aEnable, BluetoothCoreResultHandler* aRes);
+  void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
+                   BluetoothCoreResultHandler* aRes) override;
+
+  /* LE Mode */
+
+  void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
+                  BluetoothCoreResultHandler* aRes) override;
+
+  /* Energy Information */
+
+  void ReadEnergyInfo(BluetoothCoreResultHandler* aRes) override;
+
+private:
+  void DispatchError(BluetoothCoreResultHandler* aRes,
+                     BluetoothStatus aStatus);
+  void DispatchError(BluetoothCoreResultHandler* aRes,
+                     nsresult aRv);
+
+  BluetoothDaemonCoreModule* mModule;
 };
 
 END_BLUETOOTH_NAMESPACE
 
 #endif // mozilla_dom_bluetooth_bluedroid_BluetoothDaemonCoreInterface_h
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -23,16 +23,19 @@
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 static const int sRetryInterval = 100; // ms
 
+BluetoothNotificationHandler*
+  BluetoothDaemonInterface::sNotificationHandler;
+
 //
 // Protocol handling
 //
 
 // |BluetoothDaemonProtocol| is the central class for communicating
 // with the Bluetooth daemon. It maintains both socket connections
 // to the external daemon and implements the complete HAL protocol
 // by inheriting from base-class modules.
@@ -430,28 +433,30 @@ private:
 void
 BluetoothDaemonInterface::Init(
   BluetoothNotificationHandler* aNotificationHandler,
   BluetoothResultHandler* aRes)
 {
 #define BASE_SOCKET_NAME "bluetoothd"
   static unsigned long POSTFIX_LENGTH = 16;
 
+  // First of all, we set the notification handler. Backend crashes
+  // will be reported this way.
+  sNotificationHandler = aNotificationHandler;
+
   // If we could not cleanup properly before and an old
   // instance of the daemon is still running, we kill it
   // here.
   Unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
 
   mResultHandlerQ.AppendElement(aRes);
 
   if (!mProtocol) {
     mProtocol = new BluetoothDaemonProtocol();
   }
-  static_cast<BluetoothDaemonCoreModule*>(mProtocol)->SetNotificationHandler(
-    aNotificationHandler);
 
   if (!mListenSocket) {
     mListenSocket = new ListenSocket(this, LISTEN_SOCKET);
   }
 
   // Init, step 1: Listen for command channel... */
 
   if (!mCmdChannel) {
@@ -551,289 +556,30 @@ private:
  *
  * Rolling-back half-completed cleanups is not possible. In the case of
  * an error, we simply push forward and try to recover during the next
  * initialization.
  */
 void
 BluetoothDaemonInterface::Cleanup(BluetoothResultHandler* aRes)
 {
-  static_cast<BluetoothDaemonCoreModule*>(mProtocol)->SetNotificationHandler(
-    nullptr);
+  sNotificationHandler = nullptr;
 
   // Cleanup, step 1: Unregister Socket module
   nsresult rv = mProtocol->UnregisterModuleCmd(
     SETUP_SERVICE_ID_SOCKET, new CleanupResultHandler(this));
   if (NS_FAILED(rv)) {
     DispatchError(aRes, rv);
     return;
   }
 
   mResultHandlerQ.AppendElement(aRes);
 }
 
 void
-BluetoothDaemonInterface::Enable(BluetoothResultHandler* aRes)
-{
-  nsresult rv =
-    static_cast<BluetoothDaemonCoreModule*>(mProtocol)->EnableCmd(aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::Disable(BluetoothResultHandler* aRes)
-{
-  nsresult rv =
-    static_cast<BluetoothDaemonCoreModule*>(mProtocol)->DisableCmd(aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Adapter Properties */
-
-void
-BluetoothDaemonInterface::GetAdapterProperties(BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetAdapterPropertiesCmd(aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::GetAdapterProperty(BluetoothPropertyType aType,
-                                             BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetAdapterPropertyCmd(aType, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::SetAdapterProperty(
-  const BluetoothProperty& aProperty, BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->SetAdapterPropertyCmd(aProperty, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Remote Device Properties */
-
-void
-BluetoothDaemonInterface::GetRemoteDeviceProperties(
-  const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetRemoteDevicePropertiesCmd(aRemoteAddr, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::GetRemoteDeviceProperty(
-  const BluetoothAddress& aRemoteAddr, BluetoothPropertyType aType,
-  BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetRemoteDevicePropertyCmd(aRemoteAddr, aType, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::SetRemoteDeviceProperty(
-  const BluetoothAddress& aRemoteAddr, const BluetoothProperty& aProperty,
-  BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->SetRemoteDevicePropertyCmd(aRemoteAddr, aProperty, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Remote Services */
-
-void
-BluetoothDaemonInterface::GetRemoteServiceRecord(
-  const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
-  BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetRemoteServiceRecordCmd(aRemoteAddr, aUuid, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::GetRemoteServices(
-  const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->GetRemoteServicesCmd(aRemoteAddr, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Discovery */
-
-void
-BluetoothDaemonInterface::StartDiscovery(BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->StartDiscoveryCmd(aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::CancelDiscovery(BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->CancelDiscoveryCmd(aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Bonds */
-
-void
-BluetoothDaemonInterface::CreateBond(const BluetoothAddress& aBdAddr,
-                                     BluetoothTransport aTransport,
-                                     BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->CreateBondCmd(aBdAddr, aTransport, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::RemoveBond(const BluetoothAddress& aBdAddr,
-                                     BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->RemoveBondCmd(aBdAddr, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::CancelBond(const BluetoothAddress& aBdAddr,
-                                     BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->CancelBondCmd(aBdAddr, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Connection */
-
-void
-BluetoothDaemonInterface::GetConnectionState(const BluetoothAddress& aBdAddr,
-                                             BluetoothResultHandler* aRes)
-{
-  // NO-OP: no corresponding interface of current BlueZ
-}
-
-/* Authentication */
-
-void
-BluetoothDaemonInterface::PinReply(const BluetoothAddress& aBdAddr,
-                                   bool aAccept,
-                                   const BluetoothPinCode& aPinCode,
-                                   BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->PinReplyCmd(aBdAddr, aAccept, aPinCode, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::SspReply(const BluetoothAddress& aBdAddr,
-                                   BluetoothSspVariant aVariant,
-                                   bool aAccept, uint32_t aPasskey,
-                                   BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->SspReplyCmd(aBdAddr, aVariant, aAccept, aPasskey, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* DUT Mode */
-
-void
-BluetoothDaemonInterface::DutModeConfigure(bool aEnable,
-                                           BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->DutModeConfigureCmd(aEnable, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-void
-BluetoothDaemonInterface::DutModeSend(uint16_t aOpcode, uint8_t* aBuf,
-                                      uint8_t aLen,
-                                      BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->DutModeSendCmd(aOpcode, aBuf, aLen, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* LE Mode */
-
-void
-BluetoothDaemonInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf,
-                                     uint8_t aLen,
-                                     BluetoothResultHandler* aRes)
-{
-  nsresult rv = static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
-  if (NS_FAILED(rv)) {
-    DispatchError(aRes, rv);
-  }
-}
-
-/* Energy Information */
-
-void
-BluetoothDaemonInterface::ReadEnergyInfo(BluetoothResultHandler* aRes)
-{
-  // NO-OP: no corresponding interface of current BlueZ
-}
-
-void
 BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
                                         BluetoothStatus aStatus)
 {
   DaemonResultRunnable1<
     BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
 }
@@ -860,16 +606,28 @@ BluetoothDaemonInterface::GetBluetoothSe
     return mSetupInterface;
   }
 
   mSetupInterface = new BluetoothDaemonSetupInterface(mProtocol);
 
   return mSetupInterface;
 }
 
+BluetoothCoreInterface*
+BluetoothDaemonInterface::GetBluetoothCoreInterface()
+{
+  if (mCoreInterface) {
+    return mCoreInterface;
+  }
+
+  mCoreInterface = new BluetoothDaemonCoreInterface(mProtocol);
+
+  return mCoreInterface;
+}
+
 BluetoothSocketInterface*
 BluetoothDaemonInterface::GetBluetoothSocketInterface()
 {
   if (mSocketInterface) {
     return mSocketInterface;
   }
 
   mSocketInterface = new BluetoothDaemonSocketInterface(mProtocol);
@@ -1052,29 +810,24 @@ BluetoothDaemonInterface::OnDisconnect(i
         // Cleanup, step 5: Signal success to caller
         if (res) {
           res->Cleanup();
         }
       }
       break;
   }
 
-  BluetoothNotificationHandler* notificationHandler =
-    static_cast<BluetoothDaemonCoreModule*>(mProtocol)->
-      GetNotificationHandler();
-
   /* For recovery make sure all sockets disconnected, in order to avoid
    * the remaining disconnects interfere with the restart procedure.
    */
-  if (notificationHandler && mResultHandlerQ.IsEmpty()) {
+  if (sNotificationHandler && mResultHandlerQ.IsEmpty()) {
     if (mListenSocket->GetConnectionStatus() == SOCKET_DISCONNECTED &&
         mCmdChannel->GetConnectionStatus() == SOCKET_DISCONNECTED &&
         mNtfChannel->GetConnectionStatus() == SOCKET_DISCONNECTED) {
       // Assume daemon crashed during regular service; notify
       // BluetoothServiceBluedroid to prepare restart-daemon procedure
-      notificationHandler->BackendErrorNotification(true);
-      static_cast<BluetoothDaemonCoreModule*>(mProtocol)->
-        SetNotificationHandler(nullptr);
+      sNotificationHandler->BackendErrorNotification(true);
+      sNotificationHandler = nullptr;
     }
   }
 }
 
 END_BLUETOOTH_NAMESPACE
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h
@@ -19,16 +19,17 @@ class ListenSocket;
 
 }
 }
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothDaemonA2dpInterface;
 class BluetoothDaemonAvrcpInterface;
+class BluetoothDaemonCoreInterface;
 class BluetoothDaemonGattInterface;
 class BluetoothDaemonHandsfreeInterface;
 class BluetoothDaemonProtocol;
 class BluetoothDaemonSetupInterface;
 class BluetoothDaemonSocketInterface;
 
 class BluetoothDaemonInterface final
   : public BluetoothInterface
@@ -45,95 +46,20 @@ public:
   friend class StartDaemonTask;
 
   static BluetoothDaemonInterface* GetInstance();
 
   void Init(BluetoothNotificationHandler* aNotificationHandler,
             BluetoothResultHandler* aRes) override;
   void Cleanup(BluetoothResultHandler* aRes) override;
 
-  void Enable(BluetoothResultHandler* aRes) override;
-  void Disable(BluetoothResultHandler* aRes) override;
-
-  /* Adapter Properties */
-
-  void GetAdapterProperties(BluetoothResultHandler* aRes) override;
-  void GetAdapterProperty(BluetoothPropertyType aType,
-                          BluetoothResultHandler* aRes) override;
-  void SetAdapterProperty(const BluetoothProperty& aProperty,
-                          BluetoothResultHandler* aRes) override;
-
-  /* Remote Device Properties */
-
-  void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
-                                 BluetoothResultHandler* aRes) override;
-  void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
-                               BluetoothPropertyType aType,
-                               BluetoothResultHandler* aRes) override;
-  void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
-                               const BluetoothProperty& aProperty,
-                               BluetoothResultHandler* aRes) override;
-
-  /* Remote Services */
-
-  void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
-                              const BluetoothUuid& aUuid,
-                              BluetoothResultHandler* aRes) override;
-  void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
-                         BluetoothResultHandler* aRes) override;
-
-  /* Discovery */
-
-  void StartDiscovery(BluetoothResultHandler* aRes) override;
-  void CancelDiscovery(BluetoothResultHandler* aRes) override;
-
-  /* Bonds */
-
-  void CreateBond(const BluetoothAddress& aBdAddr,
-                  BluetoothTransport aTransport,
-                  BluetoothResultHandler* aRes) override;
-  void RemoveBond(const BluetoothAddress& aBdAddr,
-                  BluetoothResultHandler* aRes) override;
-  void CancelBond(const BluetoothAddress& aBdAddr,
-                  BluetoothResultHandler* aRes) override;
-
-  /* Connection */
-
-  void GetConnectionState(const BluetoothAddress& aBdAddr,
-                          BluetoothResultHandler* aRes) override;
-
-  /* Authentication */
-
-  void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
-                const BluetoothPinCode& aPinCode,
-                BluetoothResultHandler* aRes) override;
-
-  void SspReply(const BluetoothAddress& aBdAddr,
-                BluetoothSspVariant aVariant,
-                bool aAccept, uint32_t aPasskey,
-                BluetoothResultHandler* aRes) override;
-
-  /* DUT Mode */
-
-  void DutModeConfigure(bool aEnable, BluetoothResultHandler* aRes);
-  void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                   BluetoothResultHandler* aRes) override;
-
-  /* LE Mode */
-
-  void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                  BluetoothResultHandler* aRes) override;
-
-  /* Energy Information */
-
-  void ReadEnergyInfo(BluetoothResultHandler* aRes) override;
-
   /* Service Interfaces */
 
   BluetoothSetupInterface* GetBluetoothSetupInterface() override;
+  BluetoothCoreInterface* GetBluetoothCoreInterface() override;
   BluetoothSocketInterface* GetBluetoothSocketInterface() override;
   BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() override;
   BluetoothA2dpInterface* GetBluetoothA2dpInterface() override;
   BluetoothAvrcpInterface* GetBluetoothAvrcpInterface() override;
   BluetoothGattInterface* GetBluetoothGattInterface() override;
 
 protected:
   enum Channel {
@@ -151,25 +77,28 @@ protected:
   void OnConnectSuccess(int aIndex) override;
   void OnConnectError(int aIndex) override;
   void OnDisconnect(int aIndex) override;
 
 private:
   void DispatchError(BluetoothResultHandler* aRes, BluetoothStatus aStatus);
   void DispatchError(BluetoothResultHandler* aRes, nsresult aRv);
 
+  static BluetoothNotificationHandler* sNotificationHandler;
+
   nsCString mListenSocketName;
   RefPtr<mozilla::ipc::ListenSocket> mListenSocket;
   RefPtr<mozilla::ipc::DaemonSocket> mCmdChannel;
   RefPtr<mozilla::ipc::DaemonSocket> mNtfChannel;
   nsAutoPtr<BluetoothDaemonProtocol> mProtocol;
 
   nsTArray<RefPtr<BluetoothResultHandler> > mResultHandlerQ;
 
   nsAutoPtr<BluetoothDaemonSetupInterface> mSetupInterface;
+  nsAutoPtr<BluetoothDaemonCoreInterface> mCoreInterface;
   nsAutoPtr<BluetoothDaemonSocketInterface> mSocketInterface;
   nsAutoPtr<BluetoothDaemonHandsfreeInterface> mHandsfreeInterface;
   nsAutoPtr<BluetoothDaemonA2dpInterface> mA2dpInterface;
   nsAutoPtr<BluetoothDaemonAvrcpInterface> mAvrcpInterface;
   nsAutoPtr<BluetoothDaemonGattInterface> mGattInterface;
 };
 
 END_BLUETOOTH_NAMESPACE
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -63,20 +63,21 @@
     }                                                                  \
   } while(0)
 
 using namespace mozilla;
 using namespace mozilla::ipc;
 USING_BLUETOOTH_NAMESPACE
 
 static BluetoothInterface* sBtInterface;
+static BluetoothCoreInterface* sBtCoreInterface;
 static nsTArray<RefPtr<BluetoothProfileController> > sControllerArray;
 
 class BluetoothServiceBluedroid::EnableResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) override
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     BT_LOGR("BluetoothInterface::Enable failed: %d", aStatus);
 
@@ -110,17 +111,26 @@ public:
     if (!(--mNumProfiles)) {
       Proceed();
     }
   }
 
 private:
   void Proceed() const
   {
-    sBtInterface->Enable(new EnableResultHandler());
+    BluetoothService* bs = BluetoothService::Get();
+    NS_ENSURE_TRUE_VOID(bs);
+
+    sBtCoreInterface = sBtInterface->GetBluetoothCoreInterface();
+    NS_ENSURE_TRUE_VOID(sBtCoreInterface);
+
+    sBtCoreInterface->SetNotificationHandler(
+      reinterpret_cast<BluetoothServiceBluedroid*>(bs));
+
+    sBtCoreInterface->Enable(new EnableResultHandler());
   }
 
   unsigned char mNumProfiles;
 };
 
 class BluetoothServiceBluedroid::InitResultHandler final
   : public BluetoothResultHandler
 {
@@ -177,17 +187,17 @@ BluetoothServiceBluedroid::StartGonkBlue
 
   sBtInterface->Init(reinterpret_cast<BluetoothServiceBluedroid*>(bs),
                      new InitResultHandler());
 
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::DisableResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) override
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     BT_LOGR("BluetoothInterface::Disable failed: %d", aStatus);
 
@@ -207,17 +217,17 @@ BluetoothServiceBluedroid::StopGonkBluet
   NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
 
   if (!bs->IsEnabled()) {
     // Keep current enable status
     BluetoothService::AcknowledgeToggleBt(false);
     return NS_OK;
   }
 
-  sBtInterface->Disable(new DisableResultHandler());
+  sBtCoreInterface->Disable(new DisableResultHandler());
 
   return NS_OK;
 }
 
 /*
  *  Member functions
  */
 
@@ -811,19 +821,18 @@ public:
     , mRunnable(aRunnable)
   { }
 
   int mDeviceCount;
   InfallibleTArray<BluetoothNamedValue> mDevicesPack;
   RefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
-class BluetoothServiceBluedroid::GetRemoteDevicePropertiesResultHandler
-  final
-  : public BluetoothResultHandler
+class BluetoothServiceBluedroid::GetRemoteDevicePropertiesResultHandler final
+  : public BluetoothCoreResultHandler
 {
 public:
   GetRemoteDevicePropertiesResultHandler(
     nsTArray<GetDeviceRequest>& aRequests,
     const BluetoothAddress& aDeviceAddress)
     : mRequests(aRequests)
     , mDeviceAddress(aDeviceAddress)
   { }
@@ -878,17 +887,17 @@ BluetoothServiceBluedroid::GetConnectedD
   // Get address of the connected device
   BluetoothAddress address;
   profile->GetAddress(address);
 
   // Append request of the connected device
   GetDeviceRequest request(1, aRunnable);
   mGetDeviceRequests.AppendElement(request);
 
-  sBtInterface->GetRemoteDeviceProperties(address,
+  sBtCoreInterface->GetRemoteDeviceProperties(address,
     new GetRemoteDevicePropertiesResultHandler(mGetDeviceRequests, address));
 
   return NS_OK;
 }
 
 nsresult
 BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
   const nsTArray<BluetoothAddress>& aDeviceAddress,
@@ -904,26 +913,26 @@ BluetoothServiceBluedroid::GetPairedDevi
   }
 
   // Append request of all paired devices
   GetDeviceRequest request(aDeviceAddress.Length(), aRunnable);
   mGetDeviceRequests.AppendElement(request);
 
   for (uint8_t i = 0; i < aDeviceAddress.Length(); i++) {
     // Retrieve all properties of devices
-    sBtInterface->GetRemoteDeviceProperties(aDeviceAddress[i],
+    sBtCoreInterface->GetRemoteDeviceProperties(aDeviceAddress[i],
       new GetRemoteDevicePropertiesResultHandler(mGetDeviceRequests,
                                                  aDeviceAddress[i]));
   }
 
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::DispatchReplyErrorResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   DispatchReplyErrorResultHandler(
     nsTArray<RefPtr<BluetoothReplyRunnable>>& aRunnableArray,
     BluetoothReplyRunnable* aRunnable)
     : mRunnableArray(aRunnableArray)
     , mRunnable(aRunnable)
   { }
@@ -946,17 +955,17 @@ private:
 void
 BluetoothServiceBluedroid::StartDiscoveryInternal(
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
   ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
 
   mChangeDiscoveryRunnables.AppendElement(aRunnable);
-  sBtInterface->StartDiscovery(
+  sBtCoreInterface->StartDiscovery(
     new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
 }
 
 nsresult
 BluetoothServiceBluedroid::FetchUuidsInternal(
   const BluetoothAddress& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -967,32 +976,32 @@ BluetoothServiceBluedroid::FetchUuidsInt
    * get_remote_services request will not be performed by bluedroid
    * if it is currently discovering nearby remote devices.
    */
   if (mDiscovering) {
     StopDiscoveryInternal(aRunnable);
   }
 
   mFetchUuidsRunnables.AppendElement(aRunnable);
-  sBtInterface->GetRemoteServices(aDeviceAddress,
+  sBtCoreInterface->GetRemoteServices(aDeviceAddress,
     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(
+  sBtCoreInterface->CancelDiscovery(
     new DispatchReplyErrorResultHandler(mChangeDiscoveryRunnables, aRunnable));
 }
 
 nsresult
 BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
                                        const BluetoothNamedValue& aValue,
                                        BluetoothReplyRunnable* aRunnable)
 {
@@ -1003,17 +1012,17 @@ BluetoothServiceBluedroid::SetProperty(B
   BluetoothProperty property;
   nsresult rv = NamedValueToProperty(aValue, property);
   if (NS_FAILED(rv)) {
     DispatchReplyError(aRunnable, STATUS_PARM_INVALID);
     return rv;
   }
 
   mSetAdapterPropertyRunnables.AppendElement(aRunnable);
-  sBtInterface->SetAdapterProperty(
+  sBtCoreInterface->SetAdapterProperty(
     property,
     new DispatchReplyErrorResultHandler(mSetAdapterPropertyRunnables,
                                         aRunnable));
 
   return NS_OK;
 }
 
 struct BluetoothServiceBluedroid::GetRemoteServiceRecordRequest final
@@ -1029,17 +1038,17 @@ struct BluetoothServiceBluedroid::GetRem
   }
 
   BluetoothAddress mDeviceAddress;
   BluetoothUuid mUuid;
   BluetoothProfileManagerBase* mManager;
 };
 
 class BluetoothServiceBluedroid::GetRemoteServiceRecordResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   GetRemoteServiceRecordResultHandler(
     nsTArray<GetRemoteServiceRecordRequest>& aGetRemoteServiceRecordArray,
     const BluetoothAddress& aDeviceAddress,
     const BluetoothUuid& aUuid)
     : mGetRemoteServiceRecordArray(aGetRemoteServiceRecordArray)
     , mDeviceAddress(aDeviceAddress)
@@ -1062,17 +1071,17 @@ public:
     mGetRemoteServiceRecordArray[i].mManager->OnGetServiceChannel(
       mDeviceAddress, mUuid, -1);
     mGetRemoteServiceRecordArray.RemoveElementAt(i);
   }
 
   void CancelDiscovery() override
   {
     // Disabled discovery mode, now perform SDP operation.
-    sBtInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid, this);
+    sBtCoreInterface->GetRemoteServiceRecord(mDeviceAddress, mUuid, this);
   }
 
 private:
   ssize_t FindRequest() const
   {
     for (size_t i = 0; i < mGetRemoteServiceRecordArray.Length(); ++i) {
       if ((mGetRemoteServiceRecordArray[i].mDeviceAddress == mDeviceAddress) &&
           (mGetRemoteServiceRecordArray[i].mUuid == mUuid)) {
@@ -1092,27 +1101,27 @@ nsresult
 BluetoothServiceBluedroid::GetServiceChannel(
   const BluetoothAddress& aDeviceAddress,
   const BluetoothUuid& aServiceUuid,
   BluetoothProfileManagerBase* aManager)
 {
   mGetRemoteServiceRecordArray.AppendElement(
     GetRemoteServiceRecordRequest(aDeviceAddress, aServiceUuid, aManager));
 
-  RefPtr<BluetoothResultHandler> res =
+  RefPtr<BluetoothCoreResultHandler> res =
     new GetRemoteServiceRecordResultHandler(mGetRemoteServiceRecordArray,
                                             aDeviceAddress, aServiceUuid);
 
   /* Stop discovery of remote devices here, because SDP operations
    * won't be performed while the adapter is in discovery mode.
    */
   if (mDiscovering) {
-    sBtInterface->CancelDiscovery(res);
+    sBtCoreInterface->CancelDiscovery(res);
   } else {
-    sBtInterface->GetRemoteServiceRecord(aDeviceAddress, aServiceUuid, res);
+    sBtCoreInterface->GetRemoteServiceRecord(aDeviceAddress, aServiceUuid, res);
   }
 
   return NS_OK;
 }
 
 struct BluetoothServiceBluedroid::GetRemoteServicesRequest final
 {
   GetRemoteServicesRequest(const BluetoothAddress& aDeviceAddress,
@@ -1123,17 +1132,17 @@ struct BluetoothServiceBluedroid::GetRem
     MOZ_ASSERT(mManager);
   }
 
   BluetoothAddress mDeviceAddress;
   BluetoothProfileManagerBase* mManager;
 };
 
 class BluetoothServiceBluedroid::GetRemoteServicesResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   GetRemoteServicesResultHandler(
     nsTArray<GetRemoteServicesRequest>& aGetRemoteServicesArray,
     const BluetoothAddress& aDeviceAddress,
     BluetoothProfileManagerBase* aManager)
     : mGetRemoteServicesArray(aGetRemoteServicesArray)
     , mDeviceAddress(aDeviceAddress)
@@ -1156,17 +1165,17 @@ public:
 
     // There's no error-signaling mechanism; just call manager
     mManager->OnUpdateSdpRecords(mDeviceAddress);
   }
 
   void CancelDiscovery() override
   {
     // Disabled discovery mode, now perform SDP operation.
-    sBtInterface->GetRemoteServices(mDeviceAddress, this);
+    sBtCoreInterface->GetRemoteServices(mDeviceAddress, this);
   }
 
 private:
   ssize_t FindRequest() const
   {
     for (size_t i = 0; i < mGetRemoteServicesArray.Length(); ++i) {
       if ((mGetRemoteServicesArray[i].mDeviceAddress == mDeviceAddress) &&
           (mGetRemoteServicesArray[i].mManager == mManager)) {
@@ -1185,65 +1194,65 @@ private:
 bool
 BluetoothServiceBluedroid::UpdateSdpRecords(
   const BluetoothAddress& aDeviceAddress,
   BluetoothProfileManagerBase* aManager)
 {
   mGetRemoteServicesArray.AppendElement(
     GetRemoteServicesRequest(aDeviceAddress, aManager));
 
-  RefPtr<BluetoothResultHandler> res =
+  RefPtr<BluetoothCoreResultHandler> res =
     new GetRemoteServicesResultHandler(mGetRemoteServicesArray,
                                        aDeviceAddress, aManager);
 
   /* Stop discovery of remote devices here, because SDP operations
    * won't be performed while the adapter is in discovery mode.
    */
   if (mDiscovering) {
-    sBtInterface->CancelDiscovery(res);
+    sBtCoreInterface->CancelDiscovery(res);
   } else {
-    sBtInterface->GetRemoteServices(aDeviceAddress, res);
+    sBtCoreInterface->GetRemoteServices(aDeviceAddress, res);
   }
 
   return true;
 }
 
 nsresult
 BluetoothServiceBluedroid::CreatePairedDeviceInternal(
   const BluetoothAddress& aDeviceAddress, int aTimeout,
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   mCreateBondRunnables.AppendElement(aRunnable);
-  sBtInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
+  sBtCoreInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
     new DispatchReplyErrorResultHandler(mCreateBondRunnables, aRunnable));
 
   return NS_OK;
 }
 
 nsresult
 BluetoothServiceBluedroid::RemoveDeviceInternal(
   const BluetoothAddress& aDeviceAddress, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   mRemoveBondRunnables.AppendElement(aRunnable);
-  sBtInterface->RemoveBond(aDeviceAddress,
+  sBtCoreInterface->RemoveBond(aDeviceAddress,
     new DispatchReplyErrorResultHandler(mRemoveBondRunnables, aRunnable));
 
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::PinReplyResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   PinReplyResultHandler(BluetoothReplyRunnable* aRunnable)
     : mRunnable(aRunnable)
   { }
 
   void PinReply() override
   {
@@ -1263,18 +1272,18 @@ void
 BluetoothServiceBluedroid::PinReplyInternal(
   const BluetoothAddress& aDeviceAddress, bool aAccept,
   const BluetoothPinCode& aPinCode, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
 
-  sBtInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
-                         new PinReplyResultHandler(aRunnable));
+  sBtCoreInterface->PinReply(aDeviceAddress, aAccept, aPinCode,
+                             new PinReplyResultHandler(aRunnable));
 }
 
 void
 BluetoothServiceBluedroid::SetPinCodeInternal(
   const BluetoothAddress& aDeviceAddress, const BluetoothPinCode& aPinCode,
   BluetoothReplyRunnable* aRunnable)
 {
   // Legacy method used by BlueZ only.
@@ -1284,17 +1293,17 @@ void
 BluetoothServiceBluedroid::SetPasskeyInternal(
   const BluetoothAddress& aDeviceAddress, uint32_t aPasskey,
   BluetoothReplyRunnable* aRunnable)
 {
   // Legacy method used by BlueZ only.
 }
 
 class BluetoothServiceBluedroid::SspReplyResultHandler final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   SspReplyResultHandler(BluetoothReplyRunnable* aRunnable)
     : mRunnable(aRunnable)
   { }
 
   void SspReply() override
   {
@@ -1314,18 +1323,19 @@ void
 BluetoothServiceBluedroid::SspReplyInternal(
   const BluetoothAddress& aDeviceAddress, BluetoothSspVariant aVariant,
   bool aAccept, BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY_VOID(aRunnable);
 
-  sBtInterface->SspReply(aDeviceAddress, aVariant, aAccept, 0 /* passkey */,
-                         new SspReplyResultHandler(aRunnable));
+  sBtCoreInterface->SspReply(aDeviceAddress, aVariant, aAccept,
+                             0 /* passkey */,
+                             new SspReplyResultHandler(aRunnable));
 }
 
 void
 BluetoothServiceBluedroid::SetPairingConfirmationInternal(
   const BluetoothAddress& aDeviceAddress, bool aConfirm,
   BluetoothReplyRunnable* aRunnable)
 {
   // Legacy method used by BlueZ only.
@@ -1921,26 +1931,27 @@ public:
 private:
   void Proceed() const
   {
     if (mIsRestart) {
       BT_LOGR("ProfileDeinitResultHandler::Proceed cancel cleanup() ");
       return;
     }
 
+    sBtCoreInterface = nullptr;
     sBtInterface->Cleanup(new CleanupResultHandler());
   }
 
   unsigned char mNumProfiles;
   bool mIsRestart;
 };
 
 class BluetoothServiceBluedroid::SetAdapterPropertyDiscoverableResultHandler
   final
-  : public BluetoothResultHandler
+  : public BluetoothCoreResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) override
   {
     BT_LOGR("Fail to set: BT_SCAN_MODE_CONNECTABLE");
   }
 };
 
@@ -2022,18 +2033,19 @@ BluetoothServiceBluedroid::AdapterStateC
     mSetAdapterPropertyRunnables.Clear();
     mFetchUuidsRunnables.Clear();
     mCreateBondRunnables.Clear();
     mRemoveBondRunnables.Clear();
     mDeviceNameMap.Clear();
 
     // Bluetooth scan mode is SCAN_MODE_CONNECTABLE by default, i.e., it should
     // be connectable and non-discoverable.
-    NS_ENSURE_TRUE_VOID(sBtInterface);
-    sBtInterface->SetAdapterProperty(
+    NS_ENSURE_TRUE_VOID(sBtCoreInterface);
+
+    sBtCoreInterface->SetAdapterProperty(
       BluetoothProperty(PROPERTY_ADAPTER_SCAN_MODE, SCAN_MODE_CONNECTABLE),
       new SetAdapterPropertyDiscoverableResultHandler());
 
     // Trigger OPP & PBAP managers to listen
     BluetoothOppManager* opp = BluetoothOppManager::Get();
     if (!opp || !opp->Listen()) {
       BT_LOGR("Fail to start BluetoothOppManager listening");
     }
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -10,18 +10,20 @@
 #include "BluetoothCommon.h"
 #include "BluetoothHashKeys.h"
 #include "BluetoothInterface.h"
 #include "BluetoothService.h"
 #include "nsDataHashtable.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
-class BluetoothServiceBluedroid : public BluetoothService
-                                , public BluetoothNotificationHandler
+class BluetoothServiceBluedroid
+  : public BluetoothService
+  , public BluetoothCoreNotificationHandler
+  , public BluetoothNotificationHandler
 {
   class CleanupResultHandler;
   class DisableResultHandler;
   class DispatchReplyErrorResultHandler;
   class EnableResultHandler;
   class GetRemoteDevicePropertiesResultHandler;
   class GetRemoteServiceRecordResultHandler;
   class GetRemoteServicesResultHandler;
--- a/dom/bluetooth/common/BluetoothInterface.cpp
+++ b/dom/bluetooth/common/BluetoothInterface.cpp
@@ -41,16 +41,203 @@ BluetoothSetupResultHandler::Configurati
 
 // Interface
 //
 
 BluetoothSetupInterface::~BluetoothSetupInterface()
 { }
 
 //
+// Bluetooth Core Interface
+//
+
+// Notification handling
+//
+
+BluetoothCoreNotificationHandler::BluetoothCoreNotificationHandler()
+{ }
+
+BluetoothCoreNotificationHandler::~BluetoothCoreNotificationHandler()
+{ }
+
+void
+BluetoothCoreNotificationHandler::AdapterStateChangedNotification(bool aState)
+{ }
+
+void
+BluetoothCoreNotificationHandler::AdapterPropertiesNotification(
+  BluetoothStatus aStatus,int aNumProperties,
+  const BluetoothProperty* aProperties)
+{ }
+
+void
+BluetoothCoreNotificationHandler::RemoteDevicePropertiesNotification(
+  BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
+  int aNumProperties, const BluetoothProperty* aProperties)
+{ }
+
+void
+BluetoothCoreNotificationHandler::DeviceFoundNotification(
+  int aNumProperties, const BluetoothProperty* aProperties)
+{ }
+
+void
+BluetoothCoreNotificationHandler::DiscoveryStateChangedNotification(
+  bool aState)
+{ }
+
+void
+BluetoothCoreNotificationHandler::PinRequestNotification(
+  const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
+  uint32_t aCod)
+{ }
+
+void
+BluetoothCoreNotificationHandler::SspRequestNotification(
+  const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
+  uint32_t aCod, BluetoothSspVariant aPairingVariant, uint32_t aPassKey)
+{ }
+
+void
+BluetoothCoreNotificationHandler::BondStateChangedNotification(
+  BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
+  BluetoothBondState aState)
+{ }
+
+void
+BluetoothCoreNotificationHandler::AclStateChangedNotification(
+  BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
+  BluetoothAclState aState)
+{ }
+
+void
+BluetoothCoreNotificationHandler::DutModeRecvNotification(
+  uint16_t aOpcode,
+  const uint8_t* aBuf,
+  uint8_t aLen)
+{ }
+
+void
+BluetoothCoreNotificationHandler::LeTestModeNotification(
+  BluetoothStatus aStatus,
+  uint16_t aNumPackets)
+{ }
+
+void
+BluetoothCoreNotificationHandler::EnergyInfoNotification(
+  const BluetoothActivityEnergyInfo& aInfo)
+{ }
+
+// Result handling
+//
+
+void
+BluetoothCoreResultHandler::OnError(BluetoothStatus aStatus)
+{
+  BT_LOGR("Received error code %d", aStatus);
+}
+
+void
+BluetoothCoreResultHandler::Enable()
+{ }
+
+void
+BluetoothCoreResultHandler::Disable()
+{ }
+
+void
+BluetoothCoreResultHandler::GetAdapterProperties()
+{ }
+
+void
+BluetoothCoreResultHandler::GetAdapterProperty()
+{ }
+
+void
+BluetoothCoreResultHandler::SetAdapterProperty()
+{ }
+
+void
+BluetoothCoreResultHandler::GetRemoteDeviceProperties()
+{ }
+
+void
+BluetoothCoreResultHandler::GetRemoteDeviceProperty()
+{ }
+
+void
+BluetoothCoreResultHandler::SetRemoteDeviceProperty()
+{ }
+
+void
+BluetoothCoreResultHandler::GetRemoteServiceRecord()
+{ }
+
+void
+BluetoothCoreResultHandler::GetRemoteServices()
+{ }
+
+void
+BluetoothCoreResultHandler::StartDiscovery()
+{ }
+
+void
+BluetoothCoreResultHandler::CancelDiscovery()
+{ }
+
+void
+BluetoothCoreResultHandler::CreateBond()
+{ }
+
+void
+BluetoothCoreResultHandler::RemoveBond()
+{ }
+
+void
+BluetoothCoreResultHandler::CancelBond()
+{ }
+
+void
+BluetoothCoreResultHandler::GetConnectionState()
+{ }
+
+void
+BluetoothCoreResultHandler::PinReply()
+{ }
+
+void
+BluetoothCoreResultHandler::SspReply()
+{ }
+
+void
+BluetoothCoreResultHandler::DutModeConfigure()
+{ }
+
+void
+BluetoothCoreResultHandler::DutModeSend()
+{ }
+
+void
+BluetoothCoreResultHandler::LeTestMode()
+{ }
+
+void
+BluetoothCoreResultHandler::ReadEnergyInfo()
+{ }
+
+// Interface
+//
+
+BluetoothCoreInterface::BluetoothCoreInterface()
+{ }
+
+BluetoothCoreInterface::~BluetoothCoreInterface()
+{ }
+
+//
 // Socket Interface
 //
 
 // Result handling
 //
 
 void
 BluetoothSocketResultHandler::OnError(BluetoothStatus aStatus)
@@ -806,94 +993,29 @@ BluetoothGattResultHandler::SendResponse
 
 BluetoothGattInterface::BluetoothGattInterface()
 { }
 
 BluetoothGattInterface::~BluetoothGattInterface()
 { }
 
 //
-// Bluetooth Core Interface
+// Bluetooth Interface
 //
 
 // Notification handling
 //
 
 BluetoothNotificationHandler::BluetoothNotificationHandler()
 { }
 
 BluetoothNotificationHandler::~BluetoothNotificationHandler()
 { }
 
 void
-BluetoothNotificationHandler::AdapterStateChangedNotification(bool aState)
-{ }
-
-void
-BluetoothNotificationHandler::AdapterPropertiesNotification(
-  BluetoothStatus aStatus,int aNumProperties,
-  const BluetoothProperty* aProperties)
-{ }
-
-void
-BluetoothNotificationHandler::RemoteDevicePropertiesNotification(
-  BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
-  int aNumProperties, const BluetoothProperty* aProperties)
-{ }
-
-void
-BluetoothNotificationHandler::DeviceFoundNotification(
-  int aNumProperties, const BluetoothProperty* aProperties)
-{ }
-
-void
-BluetoothNotificationHandler::DiscoveryStateChangedNotification(bool aState)
-{ }
-
-void
-BluetoothNotificationHandler::PinRequestNotification(
-  const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
-  uint32_t aCod)
-{ }
-
-void
-BluetoothNotificationHandler::SspRequestNotification(
-  const BluetoothAddress& aRemoteBdAddr, const BluetoothRemoteName& aBdName,
-  uint32_t aCod, BluetoothSspVariant aPairingVariant, uint32_t aPassKey)
-{ }
-
-void
-BluetoothNotificationHandler::BondStateChangedNotification(
-  BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
-  BluetoothBondState aState)
-{ }
-
-void
-BluetoothNotificationHandler::AclStateChangedNotification(
-  BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
-  BluetoothAclState aState)
-{ }
-
-void
-BluetoothNotificationHandler::DutModeRecvNotification(uint16_t aOpcode,
-                                                      const uint8_t* aBuf,
-                                                      uint8_t aLen)
-{ }
-
-void
-BluetoothNotificationHandler::LeTestModeNotification(BluetoothStatus aStatus,
-                                                     uint16_t aNumPackets)
-{ }
-
-void
-BluetoothNotificationHandler::EnergyInfoNotification(
-  const BluetoothActivityEnergyInfo& aInfo)
-{ }
-
-void
 BluetoothNotificationHandler::BackendErrorNotification(bool aCrashed)
 { }
 
 // Result handling
 //
 
 void
 BluetoothResultHandler::OnError(BluetoothStatus aStatus)
@@ -904,104 +1026,16 @@ BluetoothResultHandler::OnError(Bluetoot
 void
 BluetoothResultHandler::Init()
 { }
 
 void
 BluetoothResultHandler::Cleanup()
 { }
 
-void
-BluetoothResultHandler::Enable()
-{ }
-
-void
-BluetoothResultHandler::Disable()
-{ }
-
-void
-BluetoothResultHandler::GetAdapterProperties()
-{ }
-
-void
-BluetoothResultHandler::GetAdapterProperty()
-{ }
-
-void
-BluetoothResultHandler::SetAdapterProperty()
-{ }
-
-void
-BluetoothResultHandler::GetRemoteDeviceProperties()
-{ }
-
-void
-BluetoothResultHandler::GetRemoteDeviceProperty()
-{ }
-
-void
-BluetoothResultHandler::SetRemoteDeviceProperty()
-{ }
-
-void
-BluetoothResultHandler::GetRemoteServiceRecord()
-{ }
-
-void
-BluetoothResultHandler::GetRemoteServices()
-{ }
-
-void
-BluetoothResultHandler::StartDiscovery()
-{ }
-
-void
-BluetoothResultHandler::CancelDiscovery()
-{ }
-
-void
-BluetoothResultHandler::CreateBond()
-{ }
-
-void
-BluetoothResultHandler::RemoveBond()
-{ }
-
-void
-BluetoothResultHandler::CancelBond()
-{ }
-
-void
-BluetoothResultHandler::GetConnectionState()
-{ }
-
-void
-BluetoothResultHandler::PinReply()
-{ }
-
-void
-BluetoothResultHandler::SspReply()
-{ }
-
-void
-BluetoothResultHandler::DutModeConfigure()
-{ }
-
-void
-BluetoothResultHandler::DutModeSend()
-{ }
-
-void
-BluetoothResultHandler::LeTestMode()
-{ }
-
-void
-BluetoothResultHandler::ReadEnergyInfo()
-{ }
-
 // Interface
 //
 
 BluetoothInterface*
 BluetoothInterface::GetInstance()
 {
 #if ANDROID_VERSION >= 17
   /* We pick a default backend from the available ones. The options are
--- a/dom/bluetooth/common/BluetoothInterface.h
+++ b/dom/bluetooth/common/BluetoothInterface.h
@@ -45,16 +45,198 @@ public:
                              uint8_t aLen,
                              BluetoothSetupResultHandler* aRes) = 0;
 
 protected:
   virtual ~BluetoothSetupInterface();
 };
 
 //
+// Bluetooth Core Interface
+//
+
+class BluetoothCoreNotificationHandler
+{
+public:
+  virtual void AdapterStateChangedNotification(bool aState);
+  virtual void AdapterPropertiesNotification(
+    BluetoothStatus aStatus, int aNumProperties,
+    const BluetoothProperty* aProperties);
+
+  virtual void RemoteDevicePropertiesNotification(
+    BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
+    int aNumProperties, const BluetoothProperty* aProperties);
+
+  virtual void DeviceFoundNotification(
+    int aNumProperties, const BluetoothProperty* aProperties);
+
+  virtual void DiscoveryStateChangedNotification(bool aState);
+
+  virtual void PinRequestNotification(const BluetoothAddress& aRemoteBdAddr,
+                                      const BluetoothRemoteName& aBdName,
+                                      uint32_t aCod);
+  virtual void SspRequestNotification(const BluetoothAddress& aRemoteBdAddr,
+                                      const BluetoothRemoteName& aBdName,
+                                      uint32_t aCod,
+                                      BluetoothSspVariant aPairingVariant,
+                                      uint32_t aPassKey);
+
+  virtual void BondStateChangedNotification(
+    BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
+    BluetoothBondState aState);
+  virtual void AclStateChangedNotification(
+    BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
+    BluetoothAclState aState);
+
+  virtual void DutModeRecvNotification(uint16_t aOpcode,
+                                       const uint8_t* aBuf, uint8_t aLen);
+  virtual void LeTestModeNotification(BluetoothStatus aStatus,
+                                      uint16_t aNumPackets);
+
+  virtual void EnergyInfoNotification(const BluetoothActivityEnergyInfo& aInfo);
+
+protected:
+  BluetoothCoreNotificationHandler();
+  virtual ~BluetoothCoreNotificationHandler();
+};
+
+class BluetoothCoreResultHandler
+  : public mozilla::ipc::DaemonSocketResultHandler
+{
+public:
+  virtual void OnError(BluetoothStatus aStatus);
+
+  virtual void Enable();
+  virtual void Disable();
+
+  virtual void GetAdapterProperties();
+  virtual void GetAdapterProperty();
+  virtual void SetAdapterProperty();
+
+  virtual void GetRemoteDeviceProperties();
+  virtual void GetRemoteDeviceProperty();
+  virtual void SetRemoteDeviceProperty();
+
+  virtual void GetRemoteServiceRecord();
+  virtual void GetRemoteServices();
+
+  virtual void StartDiscovery();
+  virtual void CancelDiscovery();
+
+  virtual void CreateBond();
+  virtual void RemoveBond();
+  virtual void CancelBond();
+
+  virtual void GetConnectionState();
+
+  virtual void PinReply();
+  virtual void SspReply();
+
+  virtual void DutModeConfigure();
+  virtual void DutModeSend();
+
+  virtual void LeTestMode();
+
+  virtual void ReadEnergyInfo();
+
+protected:
+  virtual ~BluetoothCoreResultHandler() { }
+};
+
+class BluetoothCoreInterface
+{
+public:
+  virtual void SetNotificationHandler(
+    BluetoothCoreNotificationHandler* aNotificationHandler) = 0;
+
+  /* Enable/Disable */
+
+  virtual void Enable(BluetoothCoreResultHandler* aRes) = 0;
+  virtual void Disable(BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Adapter Properties */
+
+  virtual void GetAdapterProperties(BluetoothCoreResultHandler* aRes) = 0;
+  virtual void GetAdapterProperty(BluetoothPropertyType,
+                                  BluetoothCoreResultHandler* aRes) = 0;
+  virtual void SetAdapterProperty(const BluetoothProperty& aProperty,
+                                  BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Remote Device Properties */
+
+  virtual void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
+                                         BluetoothCoreResultHandler* aRes) = 0;
+  virtual void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
+                                       BluetoothPropertyType aType,
+                                       BluetoothCoreResultHandler* aRes) = 0;
+  virtual void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
+                                       const BluetoothProperty& aProperty,
+                                       BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Remote Services */
+
+  virtual void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
+                                      const BluetoothUuid& aUuid,
+                                      BluetoothCoreResultHandler* aRes) = 0;
+  virtual void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
+                                 BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Discovery */
+
+  virtual void StartDiscovery(BluetoothCoreResultHandler* aRes) = 0;
+  virtual void CancelDiscovery(BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Bonds */
+
+  virtual void CreateBond(const BluetoothAddress& aBdAddr,
+                          BluetoothTransport aTransport,
+                          BluetoothCoreResultHandler* aRes) = 0;
+  virtual void RemoveBond(const BluetoothAddress& aBdAddr,
+                          BluetoothCoreResultHandler* aRes) = 0;
+  virtual void CancelBond(const BluetoothAddress& aBdAddr,
+                          BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Connection */
+
+  virtual void GetConnectionState(const BluetoothAddress& aBdAddr,
+                                  BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Authentication */
+
+  virtual void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
+                        const BluetoothPinCode& aPinCode,
+                        BluetoothCoreResultHandler* aRes) = 0;
+
+  virtual void SspReply(const BluetoothAddress& aBdAddr,
+                        BluetoothSspVariant aVariant,
+                        bool aAccept, uint32_t aPasskey,
+                        BluetoothCoreResultHandler* aRes) = 0;
+
+  /* DUT Mode */
+
+  virtual void DutModeConfigure(bool aEnable,
+                                BluetoothCoreResultHandler* aRes) = 0;
+  virtual void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
+                           BluetoothCoreResultHandler* aRes) = 0;
+
+  /* LE Mode */
+
+  virtual void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
+                          BluetoothCoreResultHandler* aRes) = 0;
+
+  /* Energy Info */
+
+  virtual void ReadEnergyInfo(BluetoothCoreResultHandler* aRes) = 0;
+
+protected:
+  BluetoothCoreInterface();
+  virtual ~BluetoothCoreInterface();
+};
+
+//
 // Socket Interface
 //
 
 class BluetoothSocketResultHandler
   : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
   virtual void OnError(BluetoothStatus aStatus);
@@ -926,200 +1108,55 @@ public:
                             BluetoothGattResultHandler* aRes) = 0;
 
 protected:
   BluetoothGattInterface();
   virtual ~BluetoothGattInterface();
 };
 
 //
-// Bluetooth Core Interface
+// Bluetooth Interface
 //
 
 class BluetoothNotificationHandler
 {
 public:
-  virtual void AdapterStateChangedNotification(bool aState);
-  virtual void AdapterPropertiesNotification(
-    BluetoothStatus aStatus, int aNumProperties,
-    const BluetoothProperty* aProperties);
-
-  virtual void RemoteDevicePropertiesNotification(
-    BluetoothStatus aStatus, const BluetoothAddress& aBdAddr,
-    int aNumProperties, const BluetoothProperty* aProperties);
-
-  virtual void DeviceFoundNotification(
-    int aNumProperties, const BluetoothProperty* aProperties);
-
-  virtual void DiscoveryStateChangedNotification(bool aState);
-
-  virtual void PinRequestNotification(const BluetoothAddress& aRemoteBdAddr,
-                                      const BluetoothRemoteName& aBdName,
-                                      uint32_t aCod);
-  virtual void SspRequestNotification(const BluetoothAddress& aRemoteBdAddr,
-                                      const BluetoothRemoteName& aBdName,
-                                      uint32_t aCod,
-                                      BluetoothSspVariant aPairingVariant,
-                                      uint32_t aPassKey);
-
-  virtual void BondStateChangedNotification(
-    BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
-    BluetoothBondState aState);
-  virtual void AclStateChangedNotification(
-    BluetoothStatus aStatus, const BluetoothAddress& aRemoteBdAddr,
-    BluetoothAclState aState);
-
-  virtual void DutModeRecvNotification(uint16_t aOpcode,
-                                       const uint8_t* aBuf, uint8_t aLen);
-  virtual void LeTestModeNotification(BluetoothStatus aStatus,
-                                      uint16_t aNumPackets);
-
-  virtual void EnergyInfoNotification(const BluetoothActivityEnergyInfo& aInfo);
-
   virtual void BackendErrorNotification(bool aCrashed);
 
 protected:
   BluetoothNotificationHandler();
   virtual ~BluetoothNotificationHandler();
 };
 
 class BluetoothResultHandler
   : public mozilla::ipc::DaemonSocketResultHandler
 {
 public:
   virtual void OnError(BluetoothStatus aStatus);
 
   virtual void Init();
   virtual void Cleanup();
-  virtual void Enable();
-  virtual void Disable();
-
-  virtual void GetAdapterProperties();
-  virtual void GetAdapterProperty();
-  virtual void SetAdapterProperty();
-
-  virtual void GetRemoteDeviceProperties();
-  virtual void GetRemoteDeviceProperty();
-  virtual void SetRemoteDeviceProperty();
-
-  virtual void GetRemoteServiceRecord();
-  virtual void GetRemoteServices();
-
-  virtual void StartDiscovery();
-  virtual void CancelDiscovery();
-
-  virtual void CreateBond();
-  virtual void RemoveBond();
-  virtual void CancelBond();
-
-  virtual void GetConnectionState();
-
-  virtual void PinReply();
-  virtual void SspReply();
-
-  virtual void DutModeConfigure();
-  virtual void DutModeSend();
-
-  virtual void LeTestMode();
-
-  virtual void ReadEnergyInfo();
 
 protected:
   virtual ~BluetoothResultHandler() { }
 };
 
 class BluetoothInterface
 {
 public:
   static BluetoothInterface* GetInstance();
 
   virtual void Init(BluetoothNotificationHandler* aNotificationHandler,
                     BluetoothResultHandler* aRes) = 0;
   virtual void Cleanup(BluetoothResultHandler* aRes) = 0;
 
-  virtual void Enable(BluetoothResultHandler* aRes) = 0;
-  virtual void Disable(BluetoothResultHandler* aRes) = 0;
-
-  /* Adapter Properties */
-
-  virtual void GetAdapterProperties(BluetoothResultHandler* aRes) = 0;
-  virtual void GetAdapterProperty(BluetoothPropertyType,
-                                  BluetoothResultHandler* aRes) = 0;
-  virtual void SetAdapterProperty(const BluetoothProperty& aProperty,
-                                  BluetoothResultHandler* aRes) = 0;
-
-  /* Remote Device Properties */
-
-  virtual void GetRemoteDeviceProperties(const BluetoothAddress& aRemoteAddr,
-                                         BluetoothResultHandler* aRes) = 0;
-  virtual void GetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
-                                       BluetoothPropertyType aType,
-                                       BluetoothResultHandler* aRes) = 0;
-  virtual void SetRemoteDeviceProperty(const BluetoothAddress& aRemoteAddr,
-                                       const BluetoothProperty& aProperty,
-                                       BluetoothResultHandler* aRes) = 0;
-
-  /* Remote Services */
-
-  virtual void GetRemoteServiceRecord(const BluetoothAddress& aRemoteAddr,
-                                      const BluetoothUuid& aUuid,
-                                      BluetoothResultHandler* aRes) = 0;
-  virtual void GetRemoteServices(const BluetoothAddress& aRemoteAddr,
-                                 BluetoothResultHandler* aRes) = 0;
-
-  /* Discovery */
-
-  virtual void StartDiscovery(BluetoothResultHandler* aRes) = 0;
-  virtual void CancelDiscovery(BluetoothResultHandler* aRes) = 0;
-
-  /* Bonds */
-
-  virtual void CreateBond(const BluetoothAddress& aBdAddr,
-                          BluetoothTransport aTransport,
-                          BluetoothResultHandler* aRes) = 0;
-  virtual void RemoveBond(const BluetoothAddress& aBdAddr,
-                          BluetoothResultHandler* aRes) = 0;
-  virtual void CancelBond(const BluetoothAddress& aBdAddr,
-                          BluetoothResultHandler* aRes) = 0;
-
-  /* Connection */
-
-  virtual void GetConnectionState(const BluetoothAddress& aBdAddr,
-                                  BluetoothResultHandler* aRes) = 0;
-
-  /* Authentication */
-
-  virtual void PinReply(const BluetoothAddress& aBdAddr, bool aAccept,
-                        const BluetoothPinCode& aPinCode,
-                        BluetoothResultHandler* aRes) = 0;
-
-  virtual void SspReply(const BluetoothAddress& aBdAddr,
-                        BluetoothSspVariant aVariant,
-                        bool aAccept, uint32_t aPasskey,
-                        BluetoothResultHandler* aRes) = 0;
-
-  /* DUT Mode */
-
-  virtual void DutModeConfigure(bool aEnable,
-                                BluetoothResultHandler* aRes) = 0;
-  virtual void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                           BluetoothResultHandler* aRes) = 0;
-
-  /* LE Mode */
-
-  virtual void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
-                          BluetoothResultHandler* aRes) = 0;
-
-  /* Energy Info */
-
-  virtual void ReadEnergyInfo(BluetoothResultHandler* aRes) = 0;
-
   /* Profile Interfaces */
 
   virtual BluetoothSetupInterface* GetBluetoothSetupInterface() = 0;
+  virtual BluetoothCoreInterface* GetBluetoothCoreInterface() = 0;
   virtual BluetoothSocketInterface* GetBluetoothSocketInterface() = 0;
   virtual BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() = 0;
   virtual BluetoothA2dpInterface* GetBluetoothA2dpInterface() = 0;
   virtual BluetoothAvrcpInterface* GetBluetoothAvrcpInterface() = 0;
   virtual BluetoothGattInterface* GetBluetoothGattInterface() = 0;
 
 protected:
   BluetoothInterface();
--- a/dom/nfc/tests/marionette/test_nfc_error_messages.js
+++ b/dom/nfc/tests/marionette/test_nfc_error_messages.js
@@ -135,18 +135,17 @@ function setAndFireTechLostHandler() {
 
   // triggers tech-lost
   NCI.deactivate();
   return deferred.promise;
 }
 
 var tests = [
   testNfcNotEnabledError,
-// This testcase is temporarily removed due to Bug 1055959, will reopen when it is fixed
-//  testNfcBadSessionIdError
+  testNfcBadSessionIdError,
   testNoErrorInTechMsg
 ];
 
 /**
  * nfc-manager for mozNfc.checkP2PRegistration(manifestUrl)
  *  -> "NFC:CheckP2PRegistration" IPC
  * nfc-share to set/unset onpeerready
  *  -> "NFC:RegisterPeerTarget", "NFC:UnregisterPeerTarget" IPC
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -400,17 +400,17 @@ FINAL_LIBRARY = 'xul'
 
 if CONFIG['MOZ_DEBUG']:
     DEFINES['D3D_DEBUG_INFO'] = True
 
 if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
     DEFINES['MOZ_ENABLE_D3D10_LAYER'] = True
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
-    if CONFIG['ANDROID_VERSION'] > '17':
+    if CONFIG['ANDROID_VERSION'] >= '17':
         includes = [
             'frameworks/av/include/media/stagefright',
             'frameworks/native/include/media/openmax',
         ]
     else:
         includes = [
             'frameworks/base/include/media/stagefright',
             'frameworks/base/include/media/stagefright/openmax',