Merge b2g-inbound to m-c. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 14 Apr 2015 16:14:45 -0400
changeset 270449 c3e4ff7d62c61ca3c454c9acfbdb1a6c67be0abf
parent 270417 2ee2da378d1201e371f111b41af48e9486d411f8 (current diff)
parent 270448 2188c822ba8181d0f819516a1fda07c70105a1f8 (diff)
child 270462 de27ac2ab94ff46ee5ef7c7bf708bde742086944
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge b2g-inbound to m-c. a=merge
dom/bluetooth/bluetooth1/BluetoothCommon.h
dom/bluetooth/bluetooth2/BluetoothCommon.h
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1146355: Run Bluetooth APIs v1 and v2 with same backend code
+Bug 1152821: Merge BluetoothCommon.h variants into single file
--- 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="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
--- 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="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="4efd19d199ae52656604f794c5a77518400220fd">
     <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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
--- 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="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
--- 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="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="46e1877c0d88b085f7ebc5f432d5bb8f1e2d1f3b"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="4efd19d199ae52656604f794c5a77518400220fd">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="e95b4ce22c825da44d14299e1190ea39a5260bde"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="471afab478649078ad7c75ec6b252481a59e19b8"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b", 
+        "git_revision": "8e28588496f82f8f069c171c65842d622b9d8d7d", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "f9a4193e82db33f7717a939b769b0b90975231fe", 
+    "revision": "ff36a42838b338d750be214ac110c5cc4369b180", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="4efd19d199ae52656604f794c5a77518400220fd">
     <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="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="6b0721ca0e92788df30daf8f7a5fb2863544f9c8">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="c8cb0c0ebb8dd1f5c0c9037e38f8e4b237beb77b"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="8e28588496f82f8f069c171c65842d622b9d8d7d"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="42b56ff9f40a572e61b63a660daddc72a7a7ffcb"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="adb24954bf8068f21705b570450475d183336b2d"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="8a1ba73572c713e298ae53821d000fc3a5087b5f"/>
rename from dom/bluetooth/bluetooth2/BluetoothCommon.h
rename to dom/bluetooth/BluetoothCommon.h
--- a/dom/bluetooth/bluetooth2/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -1,30 +1,37 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
-#define mozilla_dom_bluetooth_bluetoothcommon_h__
+#ifndef mozilla_dom_bluetooth_bluetoothcommon_h
+#define mozilla_dom_bluetooth_bluetoothcommon_h
 
+#include "mozilla/Compiler.h"
 #include "mozilla/Observer.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
 extern bool gBluetoothDebugFlag;
 
 #define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
 
-#if MOZ_IS_GCC && MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+#if MOZ_IS_GCC
+# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
 /* use designated array initializers if supported */
-#define INIT_ARRAY_AT(in_, out_) \
-  [in_] = out_
+# define INIT_ARRAY_AT(in_, out_) \
+    [in_] = out_
+# else
+/* otherwise init array element by position */
+# define INIT_ARRAY_AT(in_, out_) \
+    out_
+# endif
 #else
 /* otherwise init array element by position */
 #define INIT_ARRAY_AT(in_, out_) \
   out_
 #endif
 
 #define CONVERT(in_, out_) \
   INIT_ARRAY_AT(in_, out_)
@@ -175,16 +182,31 @@ extern bool gBluetoothDebugFlag;
  * BluetoothPairingHandle.
  */
 #define PAIRING_REQ_TYPE_DISPLAYPASSKEY       "displaypasskeyreq"
 #define PAIRING_REQ_TYPE_ENTERPINCODE         "enterpincodereq"
 #define PAIRING_REQ_TYPE_CONFIRMATION         "pairingconfirmationreq"
 #define PAIRING_REQ_TYPE_CONSENT              "pairingconsentreq"
 
 /**
+ * When the pair status of a Bluetooth device is changed, we'll dispatch an
+ * event.
+ *
+ * TODO: remove with bluetooth1
+ */
+#define PAIRED_STATUS_CHANGED_ID             "pairedstatuschanged"
+
+/**
+ * This event would be fired when discovery procedure starts or stops.
+ *
+ * TODO: remove with bluetooth1
+ */
+#define DISCOVERY_STATE_CHANGED_ID           "discoverystatechanged"
+
+/**
  * System message to launch bluetooth app if no pairing listener is ready to
  * receive pairing requests.
  */
 #define SYS_MSG_BT_PAIRING_REQ                "bluetooth-pairing-request"
 
 /**
  * The app origin of bluetooth app, which is responsible for listening pairing
  * requests.
@@ -498,32 +520,45 @@ enum ControlPlayStatus {
   PLAYSTATUS_ERROR    = 0xFF,
 };
 
 enum {
   AVRCP_UID_SIZE = 8
 };
 
 enum BluetoothAvrcpMediaAttribute {
-  AVRCP_MEDIA_ATTRIBUTE_TITLE,
-  AVRCP_MEDIA_ATTRIBUTE_ARTIST,
-  AVRCP_MEDIA_ATTRIBUTE_ALBUM,
-  AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM,
-  AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS,
-  AVRCP_MEDIA_ATTRIBUTE_GENRE,
-  AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
+  AVRCP_MEDIA_ATTRIBUTE_TITLE = 0x01,
+  AVRCP_MEDIA_ATTRIBUTE_ARTIST = 0x02,
+  AVRCP_MEDIA_ATTRIBUTE_ALBUM = 0x03,
+  AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM = 0x04,
+  AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS = 0x05,
+  AVRCP_MEDIA_ATTRIBUTE_GENRE = 0x06,
+  AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME = 0x07
 };
 
 enum BluetoothAvrcpPlayerAttribute {
   AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
   AVRCP_PLAYER_ATTRIBUTE_REPEAT,
   AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
   AVRCP_PLAYER_ATTRIBUTE_SCAN
 };
 
+enum BluetoothAvrcpPlayerRepeatValue {
+  AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
+  AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
+  AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
+  AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04
+};
+
+enum BluetoothAvrcpPlayerShuffleValue {
+  AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
+  AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
+  AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03
+};
+
 enum BluetoothAvrcpStatus {
   AVRCP_STATUS_BAD_COMMAND,
   AVRCP_STATUS_BAD_PARAMETER,
   AVRCP_STATUS_NOT_FOUND,
   AVRCP_STATUS_INTERNAL_ERROR,
   AVRCP_STATUS_SUCCESS
 };
 
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -34,34 +34,42 @@
 #define TARGET_SUBDIR "Download/Bluetooth/"
 
 USING_BLUETOOTH_NAMESPACE
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
 namespace {
-// Sending system message "bluetooth-opp-update-progress" every 50kb
-static const uint32_t kUpdateProgressBase = 50 * 1024;
+  // Sending system message "bluetooth-opp-update-progress" every 50kb
+  static const uint32_t kUpdateProgressBase = 50 * 1024;
 
-/*
- * The format of the header of an PUT request is
- * [opcode:1][packet length:2][headerId:1][header length:2]
- */
-static const uint32_t kPutRequestHeaderSize = 6;
+  /*
+   * The format of the header of an PUT request is
+   * [opcode:1][packet length:2][headerId:1][header length:2]
+   */
+  static const uint32_t kPutRequestHeaderSize = 6;
 
-/*
- * The format of the appended header of an PUT request is
- * [headerId:1][header length:4]
- * P.S. Length of name header is 4 since unicode is 2 bytes per char.
- */
-static const uint32_t kPutRequestAppendHeaderSize = 5;
+  /*
+   * The format of the appended header of an PUT request is
+   * [headerId:1][header length:4]
+   * P.S. Length of name header is 4 since unicode is 2 bytes per char.
+   */
+  static const uint32_t kPutRequestAppendHeaderSize = 5;
 
-StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
-static bool sInShutdown = false;
+  // UUID of OBEX Object Push
+  static const BluetoothUuid kObexObjectPush = {
+    {
+      0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
+      0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
+    }
+  };
+
+  StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
+  static bool sInShutdown = false;
 }
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothOppManager::SendFileBatch final
 {
 public:
   SendFileBatch(const nsAString& aDeviceAddress, nsIDOMBlob* aBlob)
@@ -296,17 +304,17 @@ BluetoothOppManager::ConnectInternal(con
   BluetoothService* bs = BluetoothService::Get();
   if (!bs || sInShutdown || mSocket) {
     OnSocketConnectError(mSocket);
     return;
   }
 
   mSocket =
     new BluetoothSocket(this, BluetoothSocketType::RFCOMM, false, true);
-  mSocket->ConnectSocket(aDeviceAddress, -1);
+  mSocket->ConnectSocket(aDeviceAddress, kObexObjectPush, -1);
 }
 
 void
 BluetoothOppManager::HandleShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
   sInShutdown = true;
   Disconnect(nullptr);
@@ -369,17 +377,19 @@ BluetoothOppManager::Listen()
   if (mServerSocket) {
     mServerSocket->CloseSocket();
     mServerSocket = nullptr;
   }
 
   mServerSocket =
     new BluetoothSocket(this, BluetoothSocketType::RFCOMM, false, true);
 
-  if (!mServerSocket->ListenSocket(BluetoothReservedChannels::CHANNEL_OPUSH)) {
+  if (!mServerSocket->ListenSocket(NS_LITERAL_STRING("OBEX Object Push"),
+                                   kObexObjectPush,
+                                   BluetoothReservedChannels::CHANNEL_OPUSH)) {
     BT_WARNING("[OPP] Can't listen on RFCOMM socket!");
     mServerSocket = nullptr;
     return false;
   }
 
   mIsServer = true;
 
   return true;
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -1971,16 +1971,53 @@ BluetoothServiceBluedroid::ToggleCalls(B
 uint16_t
 BluetoothServiceBluedroid::UuidToServiceClassInt(const BluetoothUuid& mUuid)
 {
   // extract short UUID 0000xxxx-0000-1000-8000-00805f9b34fb
   uint16_t shortUuid;
   memcpy(&shortUuid, mUuid.mUuid + 2, sizeof(uint16_t));
   return ntohs(shortUuid);
 }
+
+bool
+BluetoothServiceBluedroid::IsConnected(const nsAString& aRemoteBdAddr)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  nsString connectedAddress;
+
+  // Check whether HFP/HSP are connected.
+  BluetoothProfileManagerBase* profile;
+  profile = BluetoothHfpManager::Get();
+  if (profile && profile->IsConnected()) {
+    profile->GetAddress(connectedAddress);
+    if (aRemoteBdAddr.Equals(connectedAddress)) {
+      return true;
+    }
+  }
+
+  // Check whether OPP is connected.
+  profile = BluetoothOppManager::Get();
+  if (profile->IsConnected()) {
+    profile->GetAddress(connectedAddress);
+    if (aRemoteBdAddr.Equals(connectedAddress)) {
+      return true;
+    }
+  }
+
+  // Check whether A2DP is connected.
+  profile = BluetoothA2dpManager::Get();
+  if (profile->IsConnected()) {
+    profile->GetAddress(connectedAddress);
+    if (aRemoteBdAddr.Equals(connectedAddress)) {
+      return true;
+    }
+  }
+
+  return false;
+}
 #endif
 
 //
 // Bluetooth notifications
 //
 
 /* |ProfileDeinitResultHandler| collects the results of all profile
  * result handlers and calls |Proceed| after all results handlers
@@ -2480,16 +2517,20 @@ BluetoothServiceBluedroid::RemoteDeviceP
       BT_APPEND_NAMED_VALUE(props, "UUIDS", uuidsArray);
     } else if (p.mType == PROPERTY_UNKNOWN) {
       /* Bug 1065999: working around unknown properties */
     } else {
       BT_LOGD("Other non-handled device properties. Type: %d", p.mType);
     }
   }
 
+  // BlueDroid wouldn't notify the status of connection, therefore, query the
+  // connection state and append to properties array
+  BT_APPEND_NAMED_VALUE(props, "Connected", IsConnected(aBdAddr));
+
   if (sRequestedDeviceCountArray.IsEmpty()) {
     // This is possible because the callback would be called after turning
     // Bluetooth on.
     return;
   }
 
   // Use address as the index
   sRemoteDevicesPack.AppendElement(
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -500,15 +500,17 @@ protected:
   static bool EnsureBluetoothHalLoad();
 
   static void ClassToIcon(uint32_t aClass, nsAString& aRetIcon);
 
   static ControlPlayStatus PlayStatusStringToControlPlayStatus(
     const nsAString& aPlayStatus);
 
   uint16_t UuidToServiceClassInt(const BluetoothUuid& mUuid);
+
+  static bool IsConnected(const nsAString& aRemoteBdAddr);
 };
 
 END_BLUETOOTH_NAMESPACE
 
 #endif
 
 #endif
--- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp
@@ -17,20 +17,16 @@
 #include "mozilla/RefPtr.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 using namespace mozilla::ipc;
 USING_BLUETOOTH_NAMESPACE
 
 static const size_t MAX_READ_SIZE = 1 << 16;
-static const uint8_t UUID_OBEX_OBJECT_PUSH[] = {
-  0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
-  0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
-};
 static BluetoothSocketInterface* sBluetoothSocketInterface;
 
 // helper functions
 static bool
 EnsureBluetoothSocketHalLoad()
 {
   if (sBluetoothSocketInterface) {
     return true;
@@ -554,34 +550,35 @@ public:
     }
   }
 
 private:
   DroidSocketImpl* mImpl;
 };
 
 bool
-BluetoothSocket::ConnectSocket(const nsAString& aDeviceAddress, int aChannel)
+BluetoothSocket::ConnectSocket(const nsAString& aDeviceAddress,
+                               const BluetoothUuid& aServiceUuid,
+                               int aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_FALSE(mImpl, false);
 
   SetConnectionStatus(SOCKET_CONNECTING);
 
   mImpl = new DroidSocketImpl(XRE_GetIOMessageLoop(), this);
 
   BluetoothSocketResultHandler* res = new ConnectSocketResultHandler(mImpl);
   SetCurrentResultHandler(res);
 
-  // TODO: uuid as argument
   sBluetoothSocketInterface->Connect(
     aDeviceAddress,
     BluetoothSocketType::RFCOMM,
-    UUID_OBEX_OBJECT_PUSH,
-    aChannel, mEncrypt, mAuth, res);
+    aServiceUuid.mUuid, aChannel,
+    mEncrypt, mAuth, res);
 
   return true;
 }
 
 class ListenResultHandler final : public BluetoothSocketResultHandler
 {
 public:
   ListenResultHandler(DroidSocketImpl* aImpl)
@@ -605,33 +602,34 @@ public:
     BT_WARNING("Listen failed: %d", (int)aStatus);
   }
 
 private:
   DroidSocketImpl* mImpl;
 };
 
 bool
-BluetoothSocket::ListenSocket(int aChannel)
+BluetoothSocket::ListenSocket(const nsAString& aServiceName,
+                              const BluetoothUuid& aServiceUuid,
+                              int aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_FALSE(mImpl, false);
 
   SetConnectionStatus(SOCKET_LISTENING);
 
   mImpl = new DroidSocketImpl(XRE_GetIOMessageLoop(), this);
 
   BluetoothSocketResultHandler* res = new ListenResultHandler(mImpl);
   SetCurrentResultHandler(res);
 
   sBluetoothSocketInterface->Listen(
     BluetoothSocketType::RFCOMM,
-    NS_LITERAL_STRING("OBEX Object Push"),
-    UUID_OBEX_OBJECT_PUSH,
-    aChannel, mEncrypt, mAuth, res);
+    aServiceName, aServiceUuid.mUuid, aChannel,
+    mEncrypt, mAuth, res);
 
   return true;
 }
 
 void
 BluetoothSocket::CloseSocket()
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/bluetooth/bluedroid/BluetoothSocket.h
+++ b/dom/bluetooth/bluedroid/BluetoothSocket.h
@@ -19,19 +19,23 @@ class DroidSocketImpl;
 class BluetoothSocket : public mozilla::ipc::SocketConsumerBase
 {
 public:
   BluetoothSocket(BluetoothSocketObserver* aObserver,
                   BluetoothSocketType aType,
                   bool aAuth,
                   bool aEncrypt);
 
-  bool ConnectSocket(const nsAString& aDeviceAddress, int aChannel);
+  bool ConnectSocket(const nsAString& aDeviceAddress,
+                     const BluetoothUuid& aServiceUuid,
+                     int aChannel);
 
-  bool ListenSocket(int aChannel);
+  bool ListenSocket(const nsAString& aServiceName,
+                    const BluetoothUuid& aServiceUuid,
+                    int aChannel);
 
   void CloseSocket();
 
   bool SendSocketData(mozilla::ipc::UnixSocketRawData* aData);
 
   virtual void OnConnectSuccess() override;
   virtual void OnConnectError() override;
   virtual void OnDisconnect() override;
deleted file mode 100644
--- a/dom/bluetooth/bluetooth1/BluetoothCommon.h
+++ /dev/null
@@ -1,500 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
-#define mozilla_dom_bluetooth_bluetoothcommon_h__
-
-#include "mozilla/Compiler.h"
-#include "mozilla/Observer.h"
-#include "nsPrintfCString.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-#if MOZ_IS_GCC
-# if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-/* use designated array initializers if supported */
-# define INIT_ARRAY_AT(in_, out_) \
-    [in_] = out_
-# else
-/* otherwise init array element by position */
-# define INIT_ARRAY_AT(in_, out_) \
-    out_
-# endif
-#else
-/* otherwise init array element by position */
-#define INIT_ARRAY_AT(in_, out_) \
-  out_
-#endif
-
-#define CONVERT(in_, out_) \
-  INIT_ARRAY_AT(in_, out_)
-
-extern bool gBluetoothDebugFlag;
-
-#define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
-
-#undef BT_LOG
-#if defined(MOZ_WIDGET_GONK)
-#include <android/log.h>
-
-/**
- * Prints 'D'EBUG build logs, which show in DEBUG build only when
- * developer setting 'Bluetooth output in adb' is enabled.
- */
-#define BT_LOGD(msg, ...)                                            \
-  do {                                                               \
-    if (gBluetoothDebugFlag) {                                       \
-      __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth",        \
-                          "%s: " msg, __FUNCTION__, ##__VA_ARGS__);  \
-    }                                                                \
-  } while(0)
-
-/**
- * Prints 'R'ELEASE build logs, which show in both RELEASE and DEBUG builds.
- */
-#define BT_LOGR(msg, ...)                                            \
-  __android_log_print(ANDROID_LOG_INFO, "GeckoBluetooth",            \
-                      "%s: " msg, __FUNCTION__, ##__VA_ARGS__)       \
-
-/**
- * Prints DEBUG build warnings, which show in DEBUG build only.
- */
-#define BT_WARNING(args...)                                          \
-  NS_WARNING(nsPrintfCString(args).get())                            \
-
-#else
-#define BT_LOGD(msg, ...)                                            \
-  do {                                                               \
-    if (gBluetoothDebugFlag) {                                       \
-      printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__);               \
-    }                                                                \
-  } while(0)
-
-#define BT_LOGR(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
-#define BT_WARNING(msg, ...) printf("%s: " msg, __FUNCTION__, ##__VA_ARGS__)
-#endif
-
-/**
- * Wrap literal name and value into a BluetoothNamedValue
- * and append it to the array.
- */
-#define BT_APPEND_NAMED_VALUE(array, name, value)                    \
-  array.AppendElement(BluetoothNamedValue(NS_LITERAL_STRING(name), value))
-
-/**
- * Ensure success of system message broadcast with void return.
- */
-#define BT_ENSURE_TRUE_VOID_BROADCAST_SYSMSG(type, parameters)       \
-  do {                                                               \
-    if (!BroadcastSystemMessage(type, parameters)) {                 \
-      BT_WARNING("Failed to broadcast [%s]",                         \
-                 NS_ConvertUTF16toUTF8(type).get());                 \
-      return;                                                        \
-    }                                                                \
-  } while(0)
-
-#define BEGIN_BLUETOOTH_NAMESPACE \
-  namespace mozilla { namespace dom { namespace bluetooth {
-#define END_BLUETOOTH_NAMESPACE \
-  } /* namespace bluetooth */ } /* namespace dom */ } /* namespace mozilla */
-#define USING_BLUETOOTH_NAMESPACE \
-  using namespace mozilla::dom::bluetooth;
-
-#define KEY_LOCAL_AGENT  "/B2G/bluetooth/agent"
-#define KEY_REMOTE_AGENT "/B2G/bluetooth/remote_device_agent"
-#define KEY_MANAGER      "/B2G/bluetooth/manager"
-#define KEY_ADAPTER      "/B2G/bluetooth/adapter"
-
-/**
- * When the connection status of a Bluetooth profile is changed, we'll notify
- * observers which register the following topics.
- */
-#define BLUETOOTH_A2DP_STATUS_CHANGED_ID "bluetooth-a2dp-status-changed"
-#define BLUETOOTH_HFP_STATUS_CHANGED_ID  "bluetooth-hfp-status-changed"
-#define BLUETOOTH_HID_STATUS_CHANGED_ID  "bluetooth-hid-status-changed"
-#define BLUETOOTH_SCO_STATUS_CHANGED_ID  "bluetooth-sco-status-changed"
-
-/**
- * When the connection status of a Bluetooth profile is changed, we'll
- * dispatch one of the following events.
- */
-#define A2DP_STATUS_CHANGED_ID               "a2dpstatuschanged"
-#define HFP_STATUS_CHANGED_ID                "hfpstatuschanged"
-#define SCO_STATUS_CHANGED_ID                "scostatuschanged"
-
-/**
- * When the pair status of a Bluetooth device is changed, we'll dispatch an
- * event.
- */
-#define PAIRED_STATUS_CHANGED_ID             "pairedstatuschanged"
-
-/**
- * This event would be fired when discovery procedure starts or stops.
- */
-#define DISCOVERY_STATE_CHANGED_ID           "discoverystatechanged"
-
-/**
- * When receiving a query about current play status from remote device, we'll
- * dispatch an event.
- */
-#define REQUEST_MEDIA_PLAYSTATUS_ID          "requestmediaplaystatus"
-
-// Bluetooth address format: xx:xx:xx:xx:xx:xx (or xx_xx_xx_xx_xx_xx)
-#define BLUETOOTH_ADDRESS_LENGTH 17
-#define BLUETOOTH_ADDRESS_NONE   "00:00:00:00:00:00"
-#define BLUETOOTH_ADDRESS_BYTES  6
-
-// Bluetooth stack internal error, such as I/O error
-#define ERR_INTERNAL_ERROR "InternalError"
-
-BEGIN_BLUETOOTH_NAMESPACE
-
-enum BluetoothStatus {
-  STATUS_SUCCESS,
-  STATUS_FAIL,
-  STATUS_NOT_READY,
-  STATUS_NOMEM,
-  STATUS_BUSY,
-  STATUS_DONE,
-  STATUS_UNSUPPORTED,
-  STATUS_PARM_INVALID,
-  STATUS_UNHANDLED,
-  STATUS_AUTH_FAILURE,
-  STATUS_RMT_DEV_DOWN
-};
-
-enum BluetoothBondState {
-  BOND_STATE_NONE,
-  BOND_STATE_BONDING,
-  BOND_STATE_BONDED
-};
-
-enum BluetoothTypeOfDevice {
-  TYPE_OF_DEVICE_BREDR,
-  TYPE_OF_DEVICE_BLE,
-  TYPE_OF_DEVICE_DUAL
-};
-
-enum BluetoothPropertyType {
-  PROPERTY_UNKNOWN,
-  PROPERTY_BDNAME,
-  PROPERTY_BDADDR,
-  PROPERTY_UUIDS,
-  PROPERTY_CLASS_OF_DEVICE,
-  PROPERTY_TYPE_OF_DEVICE,
-  PROPERTY_SERVICE_RECORD,
-  PROPERTY_ADAPTER_SCAN_MODE,
-  PROPERTY_ADAPTER_BONDED_DEVICES,
-  PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
-  PROPERTY_REMOTE_FRIENDLY_NAME,
-  PROPERTY_REMOTE_RSSI,
-  PROPERTY_REMOTE_VERSION_INFO,
-  PROPERTY_REMOTE_DEVICE_TIMESTAMP
-};
-
-enum BluetoothScanMode {
-  SCAN_MODE_NONE,
-  SCAN_MODE_CONNECTABLE,
-  SCAN_MODE_CONNECTABLE_DISCOVERABLE
-};
-
-enum BluetoothSspVariant {
-  SSP_VARIANT_PASSKEY_CONFIRMATION,
-  SSP_VARIANT_PASSKEY_ENTRY,
-  SSP_VARIANT_CONSENT,
-  SSP_VARIANT_PASSKEY_NOTIFICATION
-};
-
-struct BluetoothUuid {
-  uint8_t mUuid[16];
-};
-
-struct BluetoothServiceRecord {
-  BluetoothUuid mUuid;
-  uint16_t mChannel;
-  char mName[256];
-};
-
-struct BluetoothRemoteInfo {
-  int mVerMajor;
-  int mVerMinor;
-  int mManufacturer;
-};
-
-struct BluetoothProperty {
-  /* Type */
-  BluetoothPropertyType mType;
-
-  /* Value
-   */
-
-  /* PROPERTY_BDNAME
-     PROPERTY_BDADDR
-     PROPERTY_REMOTE_FRIENDLY_NAME */
-  nsString mString;
-
-  /* PROPERTY_UUIDS */
-  nsTArray<BluetoothUuid> mUuidArray;
-
-  /* PROPERTY_ADAPTER_BONDED_DEVICES */
-  nsTArray<nsString> mStringArray;
-
-  /* PROPERTY_CLASS_OF_DEVICE
-     PROPERTY_ADAPTER_DISCOVERY_TIMEOUT */
-  uint32_t mUint32;
-
-  /* PROPERTY_RSSI_VALUE */
-  int32_t mInt32;
-
-  /* PROPERTY_TYPE_OF_DEVICE */
-  BluetoothTypeOfDevice mTypeOfDevice;
-
-  /* PROPERTY_SERVICE_RECORD */
-  BluetoothServiceRecord mServiceRecord;
-
-  /* PROPERTY_SCAN_MODE */
-  BluetoothScanMode mScanMode;
-
-  /* PROPERTY_REMOTE_VERSION_INFO */
-  BluetoothRemoteInfo mRemoteInfo;
-};
-
-/* Physical transport for GATT connections to remote dual-mode devices */
-enum BluetoothTransport {
-  TRANSPORT_AUTO,   /* No preference of physical transport */
-  TRANSPORT_BREDR,  /* Prefer BR/EDR transport */
-  TRANSPORT_LE      /* Prefer LE transport */
-};
-
-struct BluetoothActivityEnergyInfo {
-  uint8_t mStatus;
-  uint8_t mStackState;  /* stack reported state */
-  uint64_t mTxTime;     /* in ms */
-  uint64_t mRxTime;     /* in ms */
-  uint64_t mIdleTime;   /* in ms */
-  uint64_t mEnergyUsed; /* a product of mA, V and ms */
-};
-
-enum BluetoothSocketType {
-  RFCOMM = 1,
-  SCO    = 2,
-  L2CAP  = 3,
-  EL2CAP = 4
-};
-
-enum BluetoothHandsfreeAtResponse {
-  HFP_AT_RESPONSE_ERROR,
-  HFP_AT_RESPONSE_OK
-};
-
-enum BluetoothHandsfreeAudioState {
-  HFP_AUDIO_STATE_DISCONNECTED,
-  HFP_AUDIO_STATE_CONNECTING,
-  HFP_AUDIO_STATE_CONNECTED,
-  HFP_AUDIO_STATE_DISCONNECTING,
-};
-
-enum BluetoothHandsfreeCallAddressType {
-  HFP_CALL_ADDRESS_TYPE_UNKNOWN,
-  HFP_CALL_ADDRESS_TYPE_INTERNATIONAL
-};
-
-enum BluetoothHandsfreeCallDirection {
-  HFP_CALL_DIRECTION_OUTGOING,
-  HFP_CALL_DIRECTION_INCOMING
-};
-
-enum BluetoothHandsfreeCallHoldType {
-  HFP_CALL_HOLD_RELEASEHELD,
-  HFP_CALL_HOLD_RELEASEACTIVE_ACCEPTHELD,
-  HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD,
-  HFP_CALL_HOLD_ADDHELDTOCONF
-};
-
-enum BluetoothHandsfreeCallMode {
-  HFP_CALL_MODE_VOICE,
-  HFP_CALL_MODE_DATA,
-  HFP_CALL_MODE_FAX
-};
-
-enum BluetoothHandsfreeCallMptyType {
-  HFP_CALL_MPTY_TYPE_SINGLE,
-  HFP_CALL_MPTY_TYPE_MULTI
-};
-
-enum BluetoothHandsfreeCallState {
-  HFP_CALL_STATE_ACTIVE,
-  HFP_CALL_STATE_HELD,
-  HFP_CALL_STATE_DIALING,
-  HFP_CALL_STATE_ALERTING,
-  HFP_CALL_STATE_INCOMING,
-  HFP_CALL_STATE_WAITING,
-  HFP_CALL_STATE_IDLE
-};
-
-enum BluetoothHandsfreeConnectionState
-{
-  HFP_CONNECTION_STATE_DISCONNECTED,
-  HFP_CONNECTION_STATE_CONNECTING,
-  HFP_CONNECTION_STATE_CONNECTED,
-  HFP_CONNECTION_STATE_SLC_CONNECTED,
-  HFP_CONNECTION_STATE_DISCONNECTING
-};
-
-enum BluetoothHandsfreeNetworkState {
-  HFP_NETWORK_STATE_NOT_AVAILABLE,
-  HFP_NETWORK_STATE_AVAILABLE
-};
-
-enum BluetoothHandsfreeWbsConfig {
-  HFP_WBS_NONE, /* Neither CVSD nor mSBC codec, but other optional codec.*/
-  HFP_WBS_NO,   /* CVSD */
-  HFP_WBS_YES   /* mSBC */
-};
-
-enum BluetoothHandsfreeNRECState {
-  HFP_NREC_STOPPED,
-  HFP_NREC_STARTED
-};
-
-enum BluetoothHandsfreeServiceType {
-  HFP_SERVICE_TYPE_HOME,
-  HFP_SERVICE_TYPE_ROAMING
-};
-
-enum BluetoothHandsfreeVoiceRecognitionState {
-  HFP_VOICE_RECOGNITION_STOPPED,
-  HFP_VOICE_RECOGNITION_STARTED
-};
-
-enum BluetoothHandsfreeVolumeType {
-  HFP_VOLUME_TYPE_SPEAKER,
-  HFP_VOLUME_TYPE_MICROPHONE
-};
-
-class BluetoothSignal;
-typedef mozilla::Observer<BluetoothSignal> BluetoothSignalObserver;
-
-// Enums for object types, currently used for shared function lookups
-// (get/setproperty, etc...). Possibly discernable via dbus paths, but this
-// method is future-proofed for platform independence.
-enum BluetoothObjectType {
-  TYPE_MANAGER = 0,
-  TYPE_ADAPTER = 1,
-  TYPE_DEVICE = 2,
-
-  TYPE_INVALID
-};
-
-enum BluetoothA2dpAudioState {
-  A2DP_AUDIO_STATE_REMOTE_SUSPEND,
-  A2DP_AUDIO_STATE_STOPPED,
-  A2DP_AUDIO_STATE_STARTED,
-};
-
-enum BluetoothA2dpConnectionState {
-  A2DP_CONNECTION_STATE_DISCONNECTED,
-  A2DP_CONNECTION_STATE_CONNECTING,
-  A2DP_CONNECTION_STATE_CONNECTED,
-  A2DP_CONNECTION_STATE_DISCONNECTING
-};
-
-enum ControlPlayStatus {
-  PLAYSTATUS_STOPPED  = 0x00,
-  PLAYSTATUS_PLAYING  = 0x01,
-  PLAYSTATUS_PAUSED   = 0x02,
-  PLAYSTATUS_FWD_SEEK = 0x03,
-  PLAYSTATUS_REV_SEEK = 0x04,
-  PLAYSTATUS_UNKNOWN,
-  PLAYSTATUS_ERROR    = 0xFF,
-};
-
-enum {
-  AVRCP_UID_SIZE = 8
-};
-
-enum BluetoothAvrcpMediaAttribute {
-  AVRCP_MEDIA_ATTRIBUTE_TITLE = 0x01,
-  AVRCP_MEDIA_ATTRIBUTE_ARTIST = 0x02,
-  AVRCP_MEDIA_ATTRIBUTE_ALBUM = 0x03,
-  AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM = 0x04,
-  AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS = 0x05,
-  AVRCP_MEDIA_ATTRIBUTE_GENRE = 0x6,
-  AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME = 0x7
-};
-
-enum BluetoothAvrcpPlayerAttribute {
-  AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
-  AVRCP_PLAYER_ATTRIBUTE_REPEAT,
-  AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
-  AVRCP_PLAYER_ATTRIBUTE_SCAN
-};
-
-enum BluetoothAvrcpPlayerRepeatValue {
-  AVRCP_PLAYER_VAL_OFF_REPEAT = 0x01,
-  AVRCP_PLAYER_VAL_SINGLE_REPEAT = 0x02,
-  AVRCP_PLAYER_VAL_ALL_REPEAT = 0x03,
-  AVRCP_PLAYER_VAL_GROUP_REPEAT = 0x04,
-};
-
-enum BluetoothAvrcpPlayerShuffleValue {
-  AVRCP_PLAYER_VAL_OFF_SHUFFLE = 0x01,
-  AVRCP_PLAYER_VAL_ALL_SHUFFLE = 0x02,
-  AVRCP_PLAYER_VAL_GROUP_SHUFFLE = 0x03,
-};
-
-enum BluetoothAvrcpStatus {
-  AVRCP_STATUS_BAD_COMMAND,
-  AVRCP_STATUS_BAD_PARAMETER,
-  AVRCP_STATUS_NOT_FOUND,
-  AVRCP_STATUS_INTERNAL_ERROR,
-  AVRCP_STATUS_SUCCESS
-};
-
-enum BluetoothAvrcpEvent {
-  AVRCP_EVENT_PLAY_STATUS_CHANGED,
-  AVRCP_EVENT_TRACK_CHANGE,
-  AVRCP_EVENT_TRACK_REACHED_END,
-  AVRCP_EVENT_TRACK_REACHED_START,
-  AVRCP_EVENT_PLAY_POS_CHANGED,
-  AVRCP_EVENT_APP_SETTINGS_CHANGED
-};
-
-enum BluetoothAvrcpNotification {
-  AVRCP_NTF_INTERIM,
-  AVRCP_NTF_CHANGED
-};
-
-enum BluetoothAvrcpRemoteFeature {
-  AVRCP_REMOTE_FEATURE_NONE,
-  AVRCP_REMOTE_FEATURE_METADATA,
-  AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME,
-  AVRCP_REMOTE_FEATURE_BROWSE
-};
-
-struct BluetoothAvrcpElementAttribute {
-  uint32_t mId;
-  nsString mValue;
-};
-
-struct BluetoothAvrcpNotificationParam {
-  ControlPlayStatus mPlayStatus;
-  uint8_t mTrack[8];
-  uint32_t mSongPos;
-  uint8_t mNumAttr;
-  uint8_t mIds[256];
-  uint8_t mValues[256];
-};
-
-struct BluetoothAvrcpPlayerSettings {
-  uint8_t mNumAttr;
-  uint8_t mIds[256];
-  uint8_t mValues[256];
-};
-
-END_BLUETOOTH_NAMESPACE
-
-#endif // mozilla_dom_bluetooth_bluetoothcommon_h__
--- a/dom/bluetooth/bluetooth1/BluetoothDevice.cpp
+++ b/dom/bluetooth/bluetooth1/BluetoothDevice.cpp
@@ -45,16 +45,18 @@ NS_IMPL_RELEASE_INHERITED(BluetoothDevic
 BluetoothDevice::BluetoothDevice(nsPIDOMWindow* aWindow,
                                  const nsAString& aAdapterPath,
                                  const BluetoothValue& aValue)
   : DOMEventTargetHelper(aWindow)
   , BluetoothPropertyContainer(BluetoothObjectType::TYPE_DEVICE)
   , mJsUuids(nullptr)
   , mJsServices(nullptr)
   , mAdapterPath(aAdapterPath)
+  , mConnected(false)
+  , mPaired(false)
   , mIsRooted(false)
 {
   MOZ_ASSERT(aWindow);
 
   const InfallibleTArray<BluetoothNamedValue>& values =
     aValue.get_ArrayOfBluetoothNamedValue();
   for (uint32_t i = 0; i < values.Length(); ++i) {
     SetPropertyByValue(values[i]);
--- a/dom/bluetooth/bluetooth1/ipc/BluetoothMessageUtils.h
+++ b/dom/bluetooth/bluetooth1/ipc/BluetoothMessageUtils.h
@@ -12,14 +12,14 @@
 
 namespace IPC {
 
 template <>
 struct ParamTraits<mozilla::dom::bluetooth::BluetoothObjectType>
   : public ContiguousEnumSerializer<
              mozilla::dom::bluetooth::BluetoothObjectType,
              mozilla::dom::bluetooth::TYPE_MANAGER,
-             mozilla::dom::bluetooth::TYPE_INVALID>
+             mozilla::dom::bluetooth::NUM_TYPE>
 { };
 
 } // namespace IPC
 
 #endif // mozilla_dom_bluetooth_ipc_bluetoothmessageutils_h__
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -76,16 +76,40 @@ using namespace mozilla;
 using namespace mozilla::ipc;
 USING_BLUETOOTH_NAMESPACE
 
 namespace {
   StaticRefPtr<BluetoothHfpManager> sBluetoothHfpManager;
   bool sInShutdown = false;
   static const char kHfpCrlf[] = "\xd\xa";
 
+  // UUID of Handsfree Audio Gateway
+  static const BluetoothUuid kHandsfreeAG = {
+    {
+      0x00, 0x00, 0x11, 0x1F, 0x00, 0x00, 0x10, 0x00,
+      0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
+    }
+  };
+
+  // UUID of Headset Audio Gateway
+  static const BluetoothUuid kHeadsetAG = {
+    {
+      0x00, 0x00, 0x11, 0x12, 0x00, 0x00, 0x10, 0x00,
+      0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
+    }
+  };
+
+  // Unknown service UUID (for SCO socket)
+  static const BluetoothUuid kUnknownService = {
+    {
+      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
+      0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
+    }
+  };
+
 #ifdef MOZ_B2G_RIL
   // Sending ringtone related
   static bool sStopSendingRingFlag = true;
   static int sRingInterval = 3000; //unit: ms
 
   // Wait for 2 seconds for Dialer processing event 'BLDN'. '2' seconds is a
   // magic number. The mechanism should be revised once we can get call history.
   static int sWaitingForDialingInterval = 2000; //unit: ms
@@ -1175,28 +1199,32 @@ BluetoothHfpManager::Listen()
     return false;
   }
 
   if (!mHandsfreeSocket) {
     mHandsfreeSocket =
       new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
 
     if (!mHandsfreeSocket->Listen(
+          NS_LITERAL_STRING("Handsfree Audio Gateway"),
+          kHandsfreeAG,
           BluetoothReservedChannels::CHANNEL_HANDSFREE_AG)) {
       BT_WARNING("[HFP] Can't listen on RFCOMM socket!");
       mHandsfreeSocket = nullptr;
       return false;
     }
   }
 
   if (!mHeadsetSocket) {
     mHeadsetSocket =
       new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
 
     if (!mHeadsetSocket->Listen(
+          NS_LITERAL_STRING("Headset Audio Gateway"),
+          kHeadsetAG,
           BluetoothReservedChannels::CHANNEL_HEADSET_AG)) {
       BT_WARNING("[HSP] Can't listen on RFCOMM socket!");
       mHandsfreeSocket->Disconnect();
       mHandsfreeSocket = nullptr;
       mHeadsetSocket = nullptr;
       return false;
     }
   }
@@ -1895,17 +1923,19 @@ BluetoothHfpManager::OnGetServiceChannel
       mIsHsp = true;
     }
 
     return;
   }
 
   MOZ_ASSERT(mSocket);
 
-  if (!mSocket->Connect(NS_ConvertUTF16toUTF8(aDeviceAddress), aChannel)) {
+  if (!mSocket->Connect(aDeviceAddress,
+                        mIsHsp? kHeadsetAG : kHandsfreeAG,
+                        aChannel)) {
     OnConnect(NS_LITERAL_STRING(ERR_CONNECTION_FAILED));
   }
 }
 
 void
 BluetoothHfpManager::OnScoConnectSuccess()
 {
   // For active connection request, we need to reply the DOMRequest
@@ -1991,17 +2021,17 @@ BluetoothHfpManager::ConnectSco(Bluetoot
     mConnectScoRequest = true;
     BT_WARNING("ConnectSco called before Service Level Connection established");
     return false;
   }
 
   // Stop listening
   mScoSocket->Disconnect();
 
-  mScoSocket->Connect(NS_ConvertUTF16toUTF8(mDeviceAddress), -1);
+  mScoSocket->Connect(mDeviceAddress, kUnknownService, -1);
   mScoSocketStatus = mScoSocket->GetConnectionStatus();
 
   mScoRunnable = aRunnable;
   return true;
 }
 
 bool
 BluetoothHfpManager::DisconnectSco()
@@ -2028,17 +2058,18 @@ BluetoothHfpManager::ListenSco()
   if (mScoSocket->GetConnectionStatus() ==
       SocketConnectionStatus::SOCKET_LISTENING) {
     BT_WARNING("SCO socket has been already listening");
     return false;
   }
 
   mScoSocket->Disconnect();
 
-  if (!mScoSocket->Listen(-1)) {
+  if (!mScoSocket->Listen(NS_LITERAL_STRING("Handsfree Audio Gateway SCO"),
+                          kUnknownService, -1)) {
     BT_WARNING("Can't listen on SCO socket!");
     return false;
   }
 
   mScoSocketStatus = mScoSocket->GetConnectionStatus();
   return true;
 }
 
--- a/dom/bluetooth/bluez/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp
@@ -36,38 +36,46 @@
 USING_BLUETOOTH_NAMESPACE
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 
 namespace {
-// Sending system message "bluetooth-opp-update-progress" every 50kb
-static const uint32_t kUpdateProgressBase = 50 * 1024;
+  // Sending system message "bluetooth-opp-update-progress" every 50kb
+  static const uint32_t kUpdateProgressBase = 50 * 1024;
 
-/*
- * The format of the header of an PUT request is
- * [opcode:1][packet length:2][headerId:1][header length:2]
- */
-static const uint32_t kPutRequestHeaderSize = 6;
+  /*
+   * The format of the header of an PUT request is
+   * [opcode:1][packet length:2][headerId:1][header length:2]
+   */
+  static const uint32_t kPutRequestHeaderSize = 6;
 
-/*
- * The format of the appended header of an PUT request is
- * [headerId:1][header length:4]
- * P.S. Length of name header is 4 since unicode is 2 bytes per char.
- */
-static const uint32_t kPutRequestAppendHeaderSize = 5;
+  /*
+   * The format of the appended header of an PUT request is
+   * [headerId:1][header length:4]
+   * P.S. Length of name header is 4 since unicode is 2 bytes per char.
+   */
+  static const uint32_t kPutRequestAppendHeaderSize = 5;
+
+  // The default timeout we permit to wait for SDP updating if we can't get
+  // service channel.
+  static const double kSdpUpdatingTimeoutMs = 3000.0;
 
-// The default timeout we permit to wait for SDP updating if we can't get
-// service channel.
-static const double kSdpUpdatingTimeoutMs = 3000.0;
+  // UUID of OBEX Object Push
+  static const BluetoothUuid kObexObjectPush = {
+    {
+      0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x10, 0x00,
+      0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB
+    }
+  };
 
-StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
-static bool sInShutdown = false;
+  StaticRefPtr<BluetoothOppManager> sBluetoothOppManager;
+  static bool sInShutdown = false;
 }
 
 class mozilla::dom::bluetooth::SendFileBatch {
 public:
   SendFileBatch(const nsAString& aDeviceAddress, nsIDOMBlob* aBlob)
     : mDeviceAddress(aDeviceAddress)
   {
     mBlobs.AppendElement(aBlob);
@@ -309,28 +317,32 @@ BluetoothOppManager::Listen()
     BT_WARNING("mSocket exists. Failed to listen.");
     return false;
   }
 
   if (!mRfcommSocket) {
     mRfcommSocket =
       new BluetoothSocket(this, BluetoothSocketType::RFCOMM, true, true);
 
-    if (!mRfcommSocket->Listen(BluetoothReservedChannels::CHANNEL_OPUSH)) {
+    if (!mRfcommSocket->Listen(NS_LITERAL_STRING("OBEX Object Push"),
+                               kObexObjectPush,
+                               BluetoothReservedChannels::CHANNEL_OPUSH)) {
       BT_WARNING("[OPP] Can't listen on RFCOMM socket!");
       mRfcommSocket = nullptr;
       return false;
     }
   }
 
   if (!mL2capSocket) {
     mL2capSocket =
       new BluetoothSocket(this, BluetoothSocketType::EL2CAP, true, true);
 
-    if (!mL2capSocket->Listen(BluetoothReservedChannels::CHANNEL_OPUSH_L2CAP)) {
+    if (!mL2capSocket->Listen(NS_LITERAL_STRING("OBEX Object Push"),
+                              kObexObjectPush,
+                              BluetoothReservedChannels::CHANNEL_OPUSH_L2CAP)) {
       BT_WARNING("[OPP] Can't listen on L2CAP socket!");
       mRfcommSocket->Disconnect();
       mRfcommSocket = nullptr;
       mL2capSocket = nullptr;
       return false;
     }
   }
 
@@ -1619,17 +1631,17 @@ BluetoothOppManager::OnGetServiceChannel
       } else {
         OnSocketConnectError(mSocket);
       }
     }
 
     return;
   }
 
-  if (!mSocket->Connect(NS_ConvertUTF16toUTF8(aDeviceAddress), aChannel)) {
+  if (!mSocket->Connect(aDeviceAddress, kObexObjectPush, aChannel)) {
     OnSocketConnectError(mSocket);
   }
 }
 
 void
 BluetoothOppManager::OnUpdateSdpRecords(const nsAString& aDeviceAddress)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/bluetooth/bluez/BluetoothSocket.cpp
+++ b/dom/bluetooth/bluez/BluetoothSocket.cpp
@@ -21,37 +21,42 @@ BluetoothSocket::BluetoothSocket(Bluetoo
   , mType(aType)
   , mAuth(aAuth)
   , mEncrypt(aEncrypt)
 {
   MOZ_ASSERT(aObserver);
 }
 
 bool
-BluetoothSocket::Connect(const nsACString& aDeviceAddress, int aChannel)
+BluetoothSocket::Connect(const nsAString& aDeviceAddress,
+                         const BluetoothUuid& aServiceUuid,
+                         int aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!aDeviceAddress.IsEmpty());
 
   nsAutoPtr<BluetoothUnixSocketConnector> c(
     new BluetoothUnixSocketConnector(mType, aChannel, mAuth, mEncrypt));
 
-  if (!ConnectSocket(c.forget(), aDeviceAddress.BeginReading())) {
+  if (!ConnectSocket(c.forget(),
+                     NS_ConvertUTF16toUTF8(aDeviceAddress).BeginReading())) {
     nsAutoString addr;
     GetAddress(addr);
     BT_LOGD("%s failed. Current connected device address: %s",
            __FUNCTION__, NS_ConvertUTF16toUTF8(addr).get());
     return false;
   }
 
   return true;
 }
 
 bool
-BluetoothSocket::Listen(int aChannel)
+BluetoothSocket::Listen(const nsAString& aServiceName,
+                        const BluetoothUuid& aServiceUuid,
+                        int aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothUnixSocketConnector> c(
     new BluetoothUnixSocketConnector(mType, aChannel, mAuth, mEncrypt));
 
   if (!ListenSocket(c.forget())) {
     nsAutoString addr;
--- a/dom/bluetooth/bluez/BluetoothSocket.h
+++ b/dom/bluetooth/bluez/BluetoothSocket.h
@@ -17,18 +17,22 @@ class BluetoothSocketObserver;
 class BluetoothSocket : public mozilla::ipc::UnixSocketConsumer
 {
 public:
   BluetoothSocket(BluetoothSocketObserver* aObserver,
                   BluetoothSocketType aType,
                   bool aAuth,
                   bool aEncrypt);
 
-  bool Connect(const nsACString& aDeviceAddress, int aChannel);
-  bool Listen(int aChannel);
+  bool Connect(const nsAString& aDeviceAddress,
+               const BluetoothUuid& aServiceUuid,
+               int aChannel);
+  bool Listen(const nsAString& aServiceName,
+              const BluetoothUuid& aServiceUuid,
+              int aChannel);
   inline void Disconnect()
   {
     CloseSocket();
   }
 
   virtual void OnConnectSuccess() override;
   virtual void OnConnectError() override;
   virtual void OnDisconnect() override;
--- a/dom/bluetooth/moz.build
+++ b/dom/bluetooth/moz.build
@@ -155,24 +155,27 @@ if CONFIG['MOZ_B2G_BT']:
         DEFINES['HAVE_PTHREADS'] = True
 
     FINAL_LIBRARY = 'xul'
 
 #
 # Exported interfaces
 #
 
+EXPORTS.mozilla.dom.bluetooth += [
+  'BluetoothCommon.h'
+]
+
 if CONFIG['MOZ_B2G_BT_API_V2']:
     EXPORTS.mozilla.dom.bluetooth.ipc += [
         'bluetooth2/ipc/BluetoothMessageUtils.h',
     ]
     EXPORTS.mozilla.dom.bluetooth += [
         'bluetooth2/BluetoothAdapter.h',
         'bluetooth2/BluetoothClassOfDevice.h',
-        'bluetooth2/BluetoothCommon.h',
         'bluetooth2/BluetoothDevice.h',
         'bluetooth2/BluetoothDiscoveryHandle.h',
         'bluetooth2/BluetoothGatt.h',
         'bluetooth2/BluetoothGattCharacteristic.h',
         'bluetooth2/BluetoothGattDescriptor.h',
         'bluetooth2/BluetoothGattService.h',
         'bluetooth2/BluetoothManager.h',
         'bluetooth2/BluetoothPairingHandle.h',
@@ -184,17 +187,16 @@ if CONFIG['MOZ_B2G_BT_API_V2']:
         'bluetooth2/ipc/PBluetoothRequest.ipdl',
     ]
 else:
     EXPORTS.mozilla.dom.bluetooth.ipc += [
         'bluetooth1/ipc/BluetoothMessageUtils.h',
     ]
     EXPORTS.mozilla.dom.bluetooth += [
         'bluetooth1/BluetoothAdapter.h',
-        'bluetooth1/BluetoothCommon.h',
         'bluetooth1/BluetoothDevice.h',
         'bluetooth1/BluetoothManager.h',
     ]
     IPDL_SOURCES += [
         'bluetooth1/ipc/BluetoothTypes.ipdlh',
         'bluetooth1/ipc/PBluetooth.ipdl',
         'bluetooth1/ipc/PBluetoothRequest.ipdl',
     ]
--- a/dom/icc/tests/marionette/test_icc_contact.js
+++ b/dom/icc/tests/marionette/test_icc_contact.js
@@ -36,24 +36,28 @@ function testAddContact(aIcc, aType, aPi
   let contact = new mozContact({
     name: ["add"],
     tel: [{value: "0912345678"}],
     email:[]
   });
 
   return aIcc.updateContact(aType, contact, aPin2)
     .then((aResult) => {
+      is(aResult.id, aIcc.iccInfo.iccid + "5");
+      is(aResult.name[0], "add");
+      is(aResult.tel[0].value, "0912345678");
       // Get ICC contact for checking new contact
       return aIcc.readContacts(aType)
         .then((aResult) => {
           // There are 4 SIM contacts which are harded in emulator
           is(aResult.length, 5);
 
           is(aResult[4].name[0], "add");
           is(aResult[4].tel[0].value, "0912345678");
+          is(aResult[4].id, aIcc.iccInfo.iccid + "5");
         }, (aError) => {
           ok(false, "Cannot get " + aType + " contacts: " + aError.name);
         })
     }, (aError) => {
       if (aType === "fdn" && aPin2 === undefined) {
         ok(aError.name === "SimPin2",
            "expected error when pin2 is not provided");
       } else {
--- a/testing/taskcluster/tasks/branches/mozilla-central/job_flags.yml
+++ b/testing/taskcluster/tasks/branches/mozilla-central/job_flags.yml
@@ -119,16 +119,18 @@ tests:
       tasks/builds/mulet_linux.yml:
         task: tasks/tests/mulet_mochitests.yml
   mochitest-oop:
     allowed_build_tasks:
       tasks/builds/b2g_desktop_opt.yml:
         task: tasks/tests/b2g_mochitest_oop.yml
   reftest:
     allowed_build_tasks:
+      tasks/builds/mulet_linux.yml:
+        task: tasks/tests/mulet_reftests.yml
       tasks/builds/b2g_emulator_ics_opt.yml:
         task: tasks/tests/b2g_emulator_reftest.yml
   reftest-sanity-oop:
     allowed_build_tasks:
       tasks/builds/b2g_desktop_opt.yml:
         task: tasks/tests/b2g_reftests_sanity_oop.yml
   xpcshell:
     allowed_build_tasks:
--- a/testing/taskcluster/tasks/tests/mulet_reftests.yml
+++ b/testing/taskcluster/tasks/tests/mulet_reftests.yml
@@ -29,15 +29,18 @@ task:
         --gaia-dir /home/worker/gaia
     artifacts:
       'public/build':
         type: directory
         path: '/home/worker/artifacts/'
         expires: '{{#from_now}}1 year{{/from_now}}'
 
   extra:
+    treeherderEnv:
+      - production
+      - staging
     chunks:
       total: 6
     treeherder:
-      groupName: Reftest
-      groupSymbol: tc-R
+      groupSymbol: R
+      groupName: Mulet Reftest
       symbol: 'R{{chunk}}'
       productName: b2g