Bug 1171017: Rename |BluetoothSocketPDU| to |DaemonSocketPDU|, r=shuang
authorThomas Zimmermann <tdz@users.sourceforge.net>
Mon, 15 Jun 2015 14:44:03 +0200
changeset 248813 1ad08463f06b4bad50321378e29e4857b564d378
parent 248812 529efc4064a1c7bd5b2a20626b08dbfb000e50f2
child 248814 ffbd7fb528151b87aefa0f0c4a6a1aca0cb6a7d2
push id28907
push userryanvm@gmail.com
push dateMon, 15 Jun 2015 19:30:53 +0000
treeherdermozilla-central@a975d628ae44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshuang
bugs1171017
milestone41.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
Bug 1171017: Rename |BluetoothSocketPDU| to |DaemonSocketPDU|, r=shuang
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
ipc/bluetooth/BluetoothDaemonConnection.cpp
ipc/bluetooth/BluetoothDaemonConnection.h
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
@@ -22,29 +22,29 @@ BluetoothA2dpNotificationHandler*
 void
 BluetoothDaemonA2dpModule::SetNotificationHandler(
   BluetoothA2dpNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
 nsresult
-BluetoothDaemonA2dpModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonA2dpModule::Send(DaemonSocketPDU* aPDU,
                                 BluetoothA2dpResultHandler* aRes)
 {
   aRes->AddRef(); // Keep reference for response
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 void
-BluetoothDaemonA2dpModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                                     BluetoothDaemonPDU& aPDU, void* aUserData)
+BluetoothDaemonA2dpModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                                     DaemonSocketPDU& aPDU, void* aUserData)
 {
   static void (BluetoothDaemonA2dpModule::* const HandleOp[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonA2dpModule::HandleRsp),
     INIT_ARRAY_AT(1, &BluetoothDaemonA2dpModule::HandleNtf),
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
 
   // negate twice to map bit to 0/1
   unsigned int isNtf = !!(aHeader.mOpcode & 0x80);
@@ -56,17 +56,17 @@ BluetoothDaemonA2dpModule::HandleSvc(con
 //
 
 nsresult
 BluetoothDaemonA2dpModule::ConnectCmd(
   const nsAString& aRemoteAddr, BluetoothA2dpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(SERVICE_ID,
+  nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(SERVICE_ID,
                                                            OPCODE_CONNECT,
                                                            6)); // Address
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -78,17 +78,17 @@ BluetoothDaemonA2dpModule::ConnectCmd(
 }
 
 nsresult
 BluetoothDaemonA2dpModule::DisconnectCmd(
   const nsAString& aRemoteAddr, BluetoothA2dpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(SERVICE_ID,
+  nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(SERVICE_ID,
                                                            OPCODE_DISCONNECT,
                                                            6)); // Address
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -99,49 +99,49 @@ BluetoothDaemonA2dpModule::DisconnectCmd
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonA2dpModule::ErrorRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothA2dpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothA2dpResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
     aRes, &BluetoothA2dpResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonA2dpModule::ConnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothA2dpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothA2dpResultHandler::Connect, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonA2dpModule::DisconnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothA2dpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothA2dpResultHandler::Disconnect, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonA2dpModule::HandleRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonA2dpModule::* const HandleRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothA2dpResultHandler*) = {
     INIT_ARRAY_AT(OPCODE_ERROR,
       &BluetoothDaemonA2dpModule::ErrorRsp),
     INIT_ARRAY_AT(OPCODE_CONNECT,
       &BluetoothDaemonA2dpModule::ConnectRsp),
     INIT_ARRAY_AT(OPCODE_DISCONNECT,
       &BluetoothDaemonA2dpModule::DisconnectRsp),
   };
@@ -181,24 +181,24 @@ public:
   }
 };
 
 // Init operator class for ConnectionStateNotification
 class BluetoothDaemonA2dpModule::ConnectionStateInitOp final
   : private PDUInitOp
 {
 public:
-  ConnectionStateInitOp(BluetoothDaemonPDU& aPDU)
+  ConnectionStateInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothA2dpConnectionState& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -209,37 +209,37 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonA2dpModule::ConnectionStateNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ConnectionStateNotification::Dispatch(
     &BluetoothA2dpNotificationHandler::ConnectionStateNotification,
     ConnectionStateInitOp(aPDU));
 }
 
 // Init operator class for AudioStateNotification
 class BluetoothDaemonA2dpModule::AudioStateInitOp final
   : private PDUInitOp
 {
 public:
-  AudioStateInitOp(BluetoothDaemonPDU& aPDU)
+  AudioStateInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothA2dpAudioState& aArg1,
                nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -250,36 +250,36 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonA2dpModule::AudioStateNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AudioStateNotification::Dispatch(
     &BluetoothA2dpNotificationHandler::AudioStateNotification,
     AudioStateInitOp(aPDU));
 }
 
 // Init operator class for AudioConfigNotification
 class BluetoothDaemonA2dpModule::AudioConfigInitOp final
   : private PDUInitOp
 {
 public:
-  AudioConfigInitOp(BluetoothDaemonPDU& aPDU)
+  AudioConfigInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1, uint32_t aArg2, uint8_t aArg3) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read address */
     nsresult rv = UnpackPDU(
       pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
 
@@ -296,30 +296,30 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonA2dpModule::AudioConfigNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AudioConfigNotification::Dispatch(
     &BluetoothA2dpNotificationHandler::AudioConfigNotification,
     AudioConfigInitOp(aPDU));
 }
 
 void
 BluetoothDaemonA2dpModule::HandleNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonA2dpModule::* const HandleNtf[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonA2dpModule::ConnectionStateNtf),
     INIT_ARRAY_AT(1, &BluetoothDaemonA2dpModule::AudioStateNtf),
 #if ANDROID_VERSION >= 21
     INIT_ARRAY_AT(2, &BluetoothDaemonA2dpModule::AudioConfigNtf),
 #endif
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
@@ -25,17 +25,17 @@ public:
   enum {
     OPCODE_ERROR = 0x00,
     OPCODE_CONNECT = 0x01,
     OPCODE_DISCONNECT = 0x02
   };
 
   static const int MAX_NUM_CLIENTS;
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode,
                                   uint32_t aMaxNumClients,
                                   BluetoothSetupResultHandler* aRes) = 0;
 
   virtual nsresult UnregisterModule(uint8_t aId,
                                     BluetoothSetupResultHandler* aRes) = 0;
 
@@ -47,47 +47,47 @@ public:
   //
 
   nsresult ConnectCmd(const nsAString& aBdAddr,
                       BluetoothA2dpResultHandler* aRes);
   nsresult DisconnectCmd(const nsAString& aBdAddr,
                          BluetoothA2dpResultHandler* aRes);
 
 protected:
-  nsresult Send(BluetoothDaemonPDU* aPDU,
+  nsresult Send(DaemonSocketPDU* aPDU,
                 BluetoothA2dpResultHandler* aRes);
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
   typedef BluetoothResultRunnable0<BluetoothA2dpResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothA2dpResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothA2dpResultHandler* aRes);
 
-  void ConnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                  BluetoothDaemonPDU& aPDU,
+  void ConnectRsp(const DaemonSocketPDUHeader& aHeader,
+                  DaemonSocketPDU& aPDU,
                   BluetoothA2dpResultHandler* aRes);
 
-  void DisconnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void DisconnectRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothA2dpResultHandler* aRes);
 
-  void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
@@ -109,27 +109,27 @@ protected:
                                          nsString, uint32_t, uint8_t,
                                          const nsAString&, uint32_t, uint8_t>
     AudioConfigNotification;
 
   class ConnectionStateInitOp;
   class AudioStateInitOp;
   class AudioConfigInitOp;
 
-  void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU);
+  void ConnectionStateNtf(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU);
 
-  void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU);
+  void AudioStateNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU);
 
-  void AudioConfigNtf(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU);
+  void AudioConfigNtf(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU);
 
-  void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   static BluetoothA2dpNotificationHandler* sNotificationHandler;
 };
 
 class BluetoothDaemonA2dpInterface final
   : public BluetoothA2dpInterface
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
@@ -22,31 +22,31 @@ BluetoothAvrcpNotificationHandler*
 void
 BluetoothDaemonAvrcpModule::SetNotificationHandler(
   BluetoothAvrcpNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
 nsresult
-BluetoothDaemonAvrcpModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonAvrcpModule::Send(DaemonSocketPDU* aPDU,
                                  BluetoothAvrcpResultHandler* aRes)
 {
   if (aRes) {
     aRes->AddRef(); // Keep reference for response
   }
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 void
-BluetoothDaemonAvrcpModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                                      BluetoothDaemonPDU& aPDU, void* aUserData)
+BluetoothDaemonAvrcpModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                                      DaemonSocketPDU& aPDU, void* aUserData)
 {
   static void (BluetoothDaemonAvrcpModule::* const HandleOp[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::HandleRsp),
     INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::HandleNtf),
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
 
   unsigned int isNtf = !!(aHeader.mOpcode & 0x80);
 
@@ -58,18 +58,18 @@ BluetoothDaemonAvrcpModule::HandleSvc(co
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayStatusRspCmd(
   ControlPlayStatus aPlayStatus, uint32_t aSongLen, uint32_t aSongPos,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAY_STATUS_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_PLAY_STATUS_RSP,
                            1 + // Play status
                            4 + // Duration
                            4)); // Position
 
   nsresult rv = PackPDU(aPlayStatus, aSongLen, aSongPos, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -83,18 +83,18 @@ BluetoothDaemonAvrcpModule::GetPlayStatu
 
 nsresult
 BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspCmd(
   int aNumAttr, const BluetoothAvrcpPlayerAttribute* aPAttrs,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_ATTR_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_ATTR_RSP,
                            1 + // # Attributes
                            aNumAttr)); // Player attributes
 
   nsresult rv = PackPDU(
     PackConversion<int, uint8_t>(aNumAttr),
     PackArray<BluetoothAvrcpPlayerAttribute>(aPAttrs, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -108,18 +108,18 @@ BluetoothDaemonAvrcpModule::ListPlayerAp
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::ListPlayerAppValueRspCmd(
   int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_VALUE_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_VALUE_RSP,
                            1 + // # Values
                            aNumVal)); // Player values
 
   nsresult rv = PackPDU(PackConversion<int, uint8_t>(aNumVal),
                         PackArray<uint8_t>(aPVals, aNumVal), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -133,18 +133,18 @@ BluetoothDaemonAvrcpModule::ListPlayerAp
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppValueRspCmd(
   uint8_t aNumAttrs, const uint8_t* aIds, const uint8_t* aValues,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_RSP,
                            1 + // # Pairs
                            2 * aNumAttrs)); // Attribute-value pairs
   nsresult rv = PackPDU(
     aNumAttrs,
     BluetoothAvrcpAttributeValuePairs(aIds, aValues, aNumAttrs), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -158,18 +158,18 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspCmd(
   int aNumAttr, const uint8_t* aIds, const char** aTexts,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP,
                            0)); // Dynamically allocated
   nsresult rv = PackPDU(
     PackConversion<int, uint8_t>(aNumAttr),
     BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -182,18 +182,18 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspCmd(
   int aNumVal, const uint8_t* aIds, const char** aTexts,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP,
                            0)); // Dynamically allocated
   nsresult rv = PackPDU(
     PackConversion<int, uint8_t>(aNumVal),
     BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumVal), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -206,18 +206,18 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
 
 nsresult
 BluetoothDaemonAvrcpModule::GetElementAttrRspCmd(
   uint8_t aNumAttr, const BluetoothAvrcpElementAttribute* aAttr,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_ELEMENT_ATTR_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_ELEMENT_ATTR_RSP,
                            0)); // Dynamically allocated
   nsresult rv = PackPDU(
     aNumAttr,
     PackArray<BluetoothAvrcpElementAttribute>(aAttr, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -229,18 +229,18 @@ BluetoothDaemonAvrcpModule::GetElementAt
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::SetPlayerAppValueRspCmd(
   BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_SET_PLAYER_APP_VALUE_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_SET_PLAYER_APP_VALUE_RSP,
                            1)); // Status code
 
   nsresult rv = PackPDU(aRspStatus, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
@@ -253,18 +253,18 @@ BluetoothDaemonAvrcpModule::SetPlayerApp
 nsresult
 BluetoothDaemonAvrcpModule::RegisterNotificationRspCmd(
   BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
   const BluetoothAvrcpNotificationParam& aParam,
   BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_REGISTER_NOTIFICATION_RSP,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_REGISTER_NOTIFICATION_RSP,
                            1 + // Event
                            1 + // Type
                            1 + // Data length
                            256)); // Maximum data length
 
   BluetoothAvrcpEventParamPair data(aEvent, aParam);
   nsresult rv = PackPDU(aEvent, aType, static_cast<uint8_t>(data.GetLength()),
                         data, *pdu);
@@ -280,18 +280,18 @@ BluetoothDaemonAvrcpModule::RegisterNoti
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::SetVolumeCmd(uint8_t aVolume,
                                          BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_SET_VOLUME,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_SET_VOLUME,
                            1)); // Volume
 
   nsresult rv = PackPDU(aVolume, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
@@ -301,131 +301,131 @@ BluetoothDaemonAvrcpModule::SetVolumeCmd
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonAvrcpModule::ErrorRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::GetPlayStatusRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::ListPlayerAppAttrRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::ListPlayerAppValueRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::ListPlayerAppValueRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppValueRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::GetPlayerAppAttrTextRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueTextRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetElementAttrRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::GetElementAttrRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::SetPlayerAppValueRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::SetPlayerAppValueRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::RegisterNotificationRspRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::RegisterNotificationRsp,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::SetVolumeRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothAvrcpResultHandler::SetVolume,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::HandleRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonAvrcpModule::* const HandleRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothAvrcpResultHandler*) = {
     INIT_ARRAY_AT(OPCODE_ERROR,
       &BluetoothDaemonAvrcpModule::ErrorRsp),
     INIT_ARRAY_AT(OPCODE_GET_PLAY_STATUS_RSP,
       &BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp),
     INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_ATTR_RSP,
       &BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp),
     INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_VALUE_RSP,
@@ -481,24 +481,24 @@ public:
   }
 };
 
 // Init operator class for RemoteFeatureNotification
 class BluetoothDaemonAvrcpModule::RemoteFeatureInitOp final
   : private PDUInitOp
 {
 public:
-  RemoteFeatureInitOp(BluetoothDaemonPDU& aPDU)
+  RemoteFeatureInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1, unsigned long& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read address */
     nsresult rv = UnpackPDU(
       pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
 
@@ -511,64 +511,64 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::RemoteFeatureNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   RemoteFeatureNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::RemoteFeatureNotification,
     RemoteFeatureInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::GetPlayStatusNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   GetPlayStatusNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::GetPlayStatusNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ListPlayerAppAttrNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::ListPlayerAppAttrNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ListPlayerAppValuesNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::ListPlayerAppValuesNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for GetPlayerAppValueNotification
 class BluetoothDaemonAvrcpModule::GetPlayerAppValueInitOp final
   : private PDUInitOp
 {
 public:
-  GetPlayerAppValueInitOp(BluetoothDaemonPDU& aPDU)
+  GetPlayerAppValueInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (uint8_t& aArg1,
                nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read number of attributes */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read attributes */
@@ -579,37 +579,37 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   GetPlayerAppValueNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::GetPlayerAppValueNotification,
     GetPlayerAppValueInitOp(aPDU));
 }
 
 // Init operator class for GetPlayerAppAttrsTextNotification
 class BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextInitOp final
   : private PDUInitOp
 {
 public:
-  GetPlayerAppAttrsTextInitOp(BluetoothDaemonPDU& aPDU)
+  GetPlayerAppAttrsTextInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (uint8_t& aArg1,
                nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read number of attributes */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read attributes */
@@ -620,37 +620,37 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   GetPlayerAppAttrsTextNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::GetPlayerAppAttrsTextNotification,
     GetPlayerAppAttrsTextInitOp(aPDU));
 }
 
 // Init operator class for GetPlayerAppValuesTextNotification
 class BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextInitOp final
   : private PDUInitOp
 {
 public:
-  GetPlayerAppValuesTextInitOp(BluetoothDaemonPDU& aPDU)
+  GetPlayerAppValuesTextInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (uint8_t& aArg1, uint8_t& aArg2,
                nsAutoArrayPtr<uint8_t>& aArg3) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read attribute */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read number of values */
@@ -666,46 +666,46 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   GetPlayerAppValuesTextNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::GetPlayerAppValuesTextNotification,
     GetPlayerAppValuesTextInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   SetPlayerAppValueNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::SetPlayerAppValueNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for GetElementAttrNotification
 class BluetoothDaemonAvrcpModule::GetElementAttrInitOp final
   : private PDUInitOp
 {
 public:
-  GetElementAttrInitOp(BluetoothDaemonPDU& aPDU)
+  GetElementAttrInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (uint8_t& aArg1,
                nsAutoArrayPtr<BluetoothAvrcpMediaAttribute>& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read number of attributes */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read attributes */
@@ -716,86 +716,86 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::GetElementAttrNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   GetElementAttrNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::GetElementAttrNotification,
     GetElementAttrInitOp(aPDU));
 }
 
 void
 BluetoothDaemonAvrcpModule::RegisterNotificationNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   RegisterNotificationNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::RegisterNotificationNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 #if ANDROID_VERSION >= 19
 void
 BluetoothDaemonAvrcpModule::VolumeChangeNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   VolumeChangeNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::VolumeChangeNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for PassthroughCmdNotification
 class BluetoothDaemonAvrcpModule::PassthroughCmdInitOp final
   : private PDUInitOp
 {
 public:
-  PassthroughCmdInitOp(BluetoothDaemonPDU& aPDU)
+  PassthroughCmdInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (int& aArg1, int& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg2));
     if (NS_FAILED(rv)) {
       return rv;
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonAvrcpModule::PassthroughCmdNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   PassthroughCmdNotification::Dispatch(
     &BluetoothAvrcpNotificationHandler::PassthroughCmdNotification,
     PassthroughCmdInitOp(aPDU));
 }
 #endif
 
 void
 BluetoothDaemonAvrcpModule::HandleNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonAvrcpModule::* const HandleNtf[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
 #if ANDROID_VERSION >= 19
     INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::RemoteFeatureNtf),
     INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::GetPlayStatusNtf),
     INIT_ARRAY_AT(2, &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf),
     INIT_ARRAY_AT(3, &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf),
     INIT_ARRAY_AT(4, &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf),
     INIT_ARRAY_AT(5, &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf),
     INIT_ARRAY_AT(6, &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf),
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
@@ -57,17 +57,17 @@ public:
     OPCODE_SET_PLAYER_APP_VALUE_NTF = 0x87,
     OPCODE_GET_ELEMENT_ATTR_NTF = 0x88,
     OPCODE_REGISTER_NOTIFICATION_NTF = 0x89
 #endif
   };
 
   static const int MAX_NUM_CLIENTS;
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode,
                                   uint32_t aMaxNumClients,
                                   BluetoothSetupResultHandler* aRes) = 0;
 
   virtual nsresult UnregisterModule(uint8_t aId,
                                     BluetoothSetupResultHandler* aRes) = 0;
 
@@ -111,79 +111,79 @@ public:
   nsresult RegisterNotificationRspCmd(
     BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
     const BluetoothAvrcpNotificationParam& aParam,
     BluetoothAvrcpResultHandler* aRes);
 
   nsresult SetVolumeCmd(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes);
 
 protected:
-  nsresult Send(BluetoothDaemonPDU* aPDU,
+  nsresult Send(DaemonSocketPDU* aPDU,
                 BluetoothAvrcpResultHandler* aRes);
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
   typedef BluetoothResultRunnable0<BluetoothAvrcpResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothAvrcpResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothAvrcpResultHandler* aRes);
 
-  void GetPlayStatusRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void GetPlayStatusRspRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothAvrcpResultHandler* aRes);
 
-  void ListPlayerAppAttrRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void ListPlayerAppAttrRspRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothAvrcpResultHandler* aRes);
 
-  void ListPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU,
+  void ListPlayerAppValueRspRsp(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU,
                                 BluetoothAvrcpResultHandler* aRes);
 
-  void GetPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void GetPlayerAppValueRspRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothAvrcpResultHandler* aRes);
 
-  void GetPlayerAppAttrTextRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                  BluetoothDaemonPDU& aPDU,
+  void GetPlayerAppAttrTextRspRsp(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU,
                                   BluetoothAvrcpResultHandler* aRes);
 
-  void GetPlayerAppValueTextRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU,
+  void GetPlayerAppValueTextRspRsp(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU,
                                    BluetoothAvrcpResultHandler* aRes);
 
-  void GetElementAttrRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU,
+  void GetElementAttrRspRsp(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU,
                             BluetoothAvrcpResultHandler* aRes);
 
-  void SetPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void SetPlayerAppValueRspRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothAvrcpResultHandler* aRes);
 
-  void RegisterNotificationRspRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                  BluetoothDaemonPDU& aPDU,
+  void RegisterNotificationRspRsp(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU,
                                   BluetoothAvrcpResultHandler* aRes);
 
-  void SetVolumeRsp(const BluetoothDaemonPDUHeader& aHeader,
-                    BluetoothDaemonPDU& aPDU,
+  void SetVolumeRsp(const DaemonSocketPDUHeader& aHeader,
+                    DaemonSocketPDU& aPDU,
                     BluetoothAvrcpResultHandler* aRes);
 
-  void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
@@ -242,54 +242,54 @@ protected:
 
   class GetElementAttrInitOp;
   class GetPlayerAppAttrsTextInitOp;
   class GetPlayerAppValueInitOp;
   class GetPlayerAppValuesTextInitOp;
   class PassthroughCmdInitOp;
   class RemoteFeatureInitOp;
 
-  void RemoteFeatureNtf(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU);
+  void RemoteFeatureNtf(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU);
 
-  void GetPlayStatusNtf(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU);
+  void GetPlayStatusNtf(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU);
 
-  void ListPlayerAppAttrNtf(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU);
+  void ListPlayerAppAttrNtf(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU);
 
-  void ListPlayerAppValuesNtf(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU);
+  void ListPlayerAppValuesNtf(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU);
 
-  void GetPlayerAppValueNtf(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU);
+  void GetPlayerAppValueNtf(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU);
 
-  void GetPlayerAppAttrsTextNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU);
+  void GetPlayerAppAttrsTextNtf(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU);
 
-  void GetPlayerAppValuesTextNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                 BluetoothDaemonPDU& aPDU);
+  void GetPlayerAppValuesTextNtf(const DaemonSocketPDUHeader& aHeader,
+                                 DaemonSocketPDU& aPDU);
 
-  void SetPlayerAppValueNtf(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU);
+  void SetPlayerAppValueNtf(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU);
 
-  void GetElementAttrNtf(const BluetoothDaemonPDUHeader& aHeader,
-                         BluetoothDaemonPDU& aPDU);
+  void GetElementAttrNtf(const DaemonSocketPDUHeader& aHeader,
+                         DaemonSocketPDU& aPDU);
 
-  void RegisterNotificationNtf(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU);
+  void RegisterNotificationNtf(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU);
 
-  void VolumeChangeNtf(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU);
+  void VolumeChangeNtf(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU);
 
-  void PassthroughCmdNtf(const BluetoothDaemonPDUHeader& aHeader,
-                         BluetoothDaemonPDU& aPDU);
+  void PassthroughCmdNtf(const DaemonSocketPDUHeader& aHeader,
+                         DaemonSocketPDU& aPDU);
 
-  void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   static BluetoothAvrcpNotificationHandler* sNotificationHandler;
 };
 
 class BluetoothDaemonAvrcpInterface final
   : public BluetoothAvrcpInterface
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
@@ -22,41 +22,41 @@ BluetoothGattNotificationHandler*
 void
 BluetoothDaemonGattModule::SetNotificationHandler(
   BluetoothGattNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
 nsresult
-BluetoothDaemonGattModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonGattModule::Send(DaemonSocketPDU* aPDU,
                                 BluetoothGattResultHandler* aRes)
 {
   if (aRes) {
     aRes->AddRef(); // Keep reference for response
   }
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 nsresult
-BluetoothDaemonGattModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonGattModule::Send(DaemonSocketPDU* aPDU,
                                 BluetoothGattClientResultHandler* aRes)
 {
   if (aRes) {
     aRes->AddRef(); // Keep reference for response
   }
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 void
-BluetoothDaemonGattModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                                     BluetoothDaemonPDU& aPDU, void* aUserData)
+BluetoothDaemonGattModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                                     DaemonSocketPDU& aPDU, void* aUserData)
 {
   static void (BluetoothDaemonGattModule::* const HandleOp[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonGattModule::HandleRsp),
     INIT_ARRAY_AT(1, &BluetoothDaemonGattModule::HandleNtf),
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
 
   // Negate twice to map bit to 0/1
   unsigned long isNtf = !!(aHeader.mOpcode & 0x80);
@@ -68,18 +68,18 @@ BluetoothDaemonGattModule::HandleSvc(con
 //
 
 nsresult
 BluetoothDaemonGattModule::ClientRegisterCmd(
   const BluetoothUuid& aUuid, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_REGISTER,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_REGISTER,
                            16)); // Service UUID
 
   nsresult rv = PackPDU(aUuid, *pdu);
 
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -91,18 +91,18 @@ BluetoothDaemonGattModule::ClientRegiste
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientUnregisterCmd(
   int aClientIf, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_UNREGISTER,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_UNREGISTER,
                            4)); // Client Interface
 
   nsresult rv = PackPDU(aClientIf, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
@@ -113,18 +113,18 @@ BluetoothDaemonGattModule::ClientUnregis
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientScanCmd(
   int aClientIf, bool aStart, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_SCAN,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_SCAN,
                            4 + // Client Interface
                            1)); // Start
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                         PackConversion<bool, uint8_t>(aStart), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -138,18 +138,18 @@ BluetoothDaemonGattModule::ClientScanCmd
 
 nsresult
 BluetoothDaemonGattModule::ClientConnectCmd(
   int aClientIf, const nsAString& aBdAddr, bool aIsDirect,
   BluetoothTransport aTransport, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_CONNECT,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_CONNECT,
                            4 + // Client Interface
                            6 + // Remote Address
                            1 + // Is Direct
                            4)); // Transport
 
   nsresult rv = PackPDU(
     PackConversion<int, int32_t>(aClientIf),
     PackConversion<nsAString, BluetoothAddress>(aBdAddr),
@@ -168,18 +168,18 @@ BluetoothDaemonGattModule::ClientConnect
 
 nsresult
 BluetoothDaemonGattModule::ClientDisconnectCmd(
   int aClientIf, const nsAString& aBdAddr, int aConnId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_DISCONNECT,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_DISCONNECT,
                            4 + // Client Interface
                            6 + // Remote Address
                            4)); // Connection ID
 
   nsresult rv;
   rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                PackConversion<nsAString, BluetoothAddress>(aBdAddr),
                PackConversion<int, int32_t>(aConnId), *pdu);
@@ -195,18 +195,18 @@ BluetoothDaemonGattModule::ClientDisconn
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientListenCmd(
   int aClientIf, bool aIsStart, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_LISTEN,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_LISTEN,
                            4 + // Client Interface
                            1)); // Start
 
   nsresult rv;
   rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                PackConversion<bool, uint8_t>(aIsStart), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -221,18 +221,18 @@ BluetoothDaemonGattModule::ClientListenC
 
 nsresult
 BluetoothDaemonGattModule::ClientRefreshCmd(
   int aClientIf, const nsAString& aBdAddr,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_REFRESH,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_REFRESH,
                            4 + // Client Interface
                            6)); // Remote Address
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                         PackConversion<nsAString, BluetoothAddress>(aBdAddr),
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -247,21 +247,21 @@ BluetoothDaemonGattModule::ClientRefresh
 
 nsresult
 BluetoothDaemonGattModule::ClientSearchServiceCmd(
   int aConnId, bool aFiltered, const BluetoothUuid& aUuid,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_SEARCH_SERVICE,
-                           4 + // Connection ID
-                           1 + // Filtered
-                           16)); // UUID
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_SEARCH_SERVICE,
+                        4 + // Connection ID
+                        1 + // Filtered
+                        16)); // UUID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId),
                         PackConversion<bool, uint8_t>(aFiltered),
                         PackReversed<BluetoothUuid>(aUuid),
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -276,18 +276,18 @@ BluetoothDaemonGattModule::ClientSearchS
 nsresult
 BluetoothDaemonGattModule::ClientGetIncludedServiceCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId, bool aContinuation,
   const BluetoothGattServiceId& aStartServiceId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_GET_INCLUDED_SERVICE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_GET_INCLUDED_SERVICE,
                            4 + // Connection ID
                            18 + // Service ID
                            1 + // Continuation
                            18)); // Start Service ID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         PackConversion<bool, uint8_t>(aContinuation),
                         aStartServiceId, *pdu);
@@ -305,18 +305,18 @@ BluetoothDaemonGattModule::ClientGetIncl
 nsresult
 BluetoothDaemonGattModule::ClientGetCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId, bool aContinuation,
   const BluetoothGattId& aStartCharId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_GET_CHARACTERISTIC,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_GET_CHARACTERISTIC,
                            4 + // Connection ID
                            18 + // Service ID
                            1 + // Continuation
                            17)); // Start Characteristic ID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         PackConversion<bool, uint8_t>(aContinuation),
                         aStartCharId, *pdu);
@@ -336,18 +336,18 @@ nsresult
 BluetoothDaemonGattModule::ClientGetDescriptorCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, bool aContinuation,
   const BluetoothGattId& aStartDescriptorId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_GET_DESCRIPTOR,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_GET_DESCRIPTOR,
                            4 + // Connection ID
                            18 + // Service ID
                            17 + // Characteristic ID
                            1 + // Continuation
                            17)); // Start Descriptor ID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId),
                         aServiceId, aCharId,
@@ -367,18 +367,18 @@ BluetoothDaemonGattModule::ClientGetDesc
 nsresult
 BluetoothDaemonGattModule::ClientReadCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, BluetoothGattAuthReq aAuthReq,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_READ_CHARACTERISTIC,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_READ_CHARACTERISTIC,
                            4 + // Connection ID
                            18 + // Service ID
                            17 + // Characteristic ID
                            4)); // Authorization
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         aCharId, aAuthReq, *pdu);
   if (NS_FAILED(rv)) {
@@ -396,18 +396,18 @@ nsresult
 BluetoothDaemonGattModule::ClientWriteCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, BluetoothGattWriteType aWriteType,
   int aLength, BluetoothGattAuthReq aAuthReq, char* aValue,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_WRITE_CHARACTERISTIC, 0));
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_WRITE_CHARACTERISTIC, 0));
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         aCharId, aWriteType,
                         PackConversion<int, int32_t>(aLength), aAuthReq,
                         PackArray<char>(aValue, aLength), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -422,18 +422,18 @@ BluetoothDaemonGattModule::ClientWriteCh
 nsresult
 BluetoothDaemonGattModule::ClientReadDescriptorCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, const BluetoothGattId& aDescriptorId,
   BluetoothGattAuthReq aAuthReq, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_READ_DESCRIPTOR,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_READ_DESCRIPTOR,
                            4 + // Connection ID
                            18 + // Service ID
                            17 + // Characteristic ID
                            17 + // Descriptor ID
                            4)); // Authorization
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         aCharId, aDescriptorId, aAuthReq, *pdu);
@@ -453,18 +453,18 @@ BluetoothDaemonGattModule::ClientWriteDe
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, const BluetoothGattId& aDescriptorId,
   BluetoothGattWriteType aWriteType, int aLength,
   BluetoothGattAuthReq aAuthReq, char* aValue,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_WRITE_DESCRIPTOR, 0));
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_WRITE_DESCRIPTOR, 0));
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId), aServiceId,
                         aCharId, aDescriptorId, aWriteType,
                         PackConversion<int, int32_t>(aLength), aAuthReq,
                         PackArray<char>(aValue, aLength), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -477,18 +477,18 @@ BluetoothDaemonGattModule::ClientWriteDe
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientExecuteWriteCmd(
   int aConnId, int aIsExecute, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_EXECUTE_WRITE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_EXECUTE_WRITE,
                            4 + // Connection ID
                            4)); // Execute
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aConnId),
                         PackConversion<int, int32_t>(aIsExecute), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -503,18 +503,18 @@ BluetoothDaemonGattModule::ClientExecute
 nsresult
 BluetoothDaemonGattModule::ClientRegisterNotificationCmd(
   int aClientIf, const nsAString& aBdAddr,
   const BluetoothGattServiceId& aServiceId, const BluetoothGattId& aCharId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_REGISTER_NOTIFICATION,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_REGISTER_NOTIFICATION,
                            4 + // Client Interface
                            6 + // Remote Address
                            18 + // Service ID
                            17)); // Characteristic ID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                         PackConversion<nsAString, BluetoothAddress>(aBdAddr),
                         aServiceId, aCharId, *pdu);
@@ -532,18 +532,18 @@ BluetoothDaemonGattModule::ClientRegiste
 nsresult
 BluetoothDaemonGattModule::ClientDeregisterNotificationCmd(
   int aClientIf, const nsAString& aBdAddr,
   const BluetoothGattServiceId& aServiceId, const BluetoothGattId& aCharId,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_DEREGISTER_NOTIFICATION,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_DEREGISTER_NOTIFICATION,
                            4 + // Client Interface
                            6 + // Remote Address
                            18 + // Service ID
                            17)); // Characteristic ID
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                         PackConversion<nsAString, BluetoothAddress>(aBdAddr),
                         aServiceId, aCharId, *pdu);
@@ -560,18 +560,18 @@ BluetoothDaemonGattModule::ClientDeregis
 
 nsresult
 BluetoothDaemonGattModule::ClientReadRemoteRssiCmd(
   int aClientIf, const nsAString& aBdAddr,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_READ_REMOTE_RSSI,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_READ_REMOTE_RSSI,
                            4 + // Client Interface
                            6)); // Remote Address
 
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aClientIf),
                         PackConversion<nsAString, BluetoothAddress>(aBdAddr),
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -585,18 +585,18 @@ BluetoothDaemonGattModule::ClientReadRem
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientGetDeviceTypeCmd(
   const nsAString& aBdAddr, BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_GET_DEVICE_TYPE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_GET_DEVICE_TYPE,
                            6)); // Remote Address
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aBdAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -613,18 +613,18 @@ BluetoothDaemonGattModule::ClientSetAdvD
   bool aIsTxPowerIncluded, int aMinInterval, int aMaxInterval, int aApperance,
   uint16_t aManufacturerLen, char* aManufacturerData,
   uint16_t aServiceDataLen, char* aServiceData,
   uint16_t aServiceUuidLen, char* aServiceUuid,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_SET_ADV_DATA, 0));
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_SET_ADV_DATA, 0));
 
   nsresult rv = PackPDU(
     PackConversion<int, int32_t>(aServerIf),
     PackConversion<bool, uint8_t>(aIsScanRsp),
     PackConversion<bool, uint8_t>(aIsNameIncluded),
     PackConversion<bool, uint8_t>(aIsTxPowerIncluded),
     PackConversion<int, int32_t>(aMinInterval),
     PackConversion<int, int32_t>(aMaxInterval),
@@ -645,18 +645,18 @@ BluetoothDaemonGattModule::ClientSetAdvD
 
 nsresult
 BluetoothDaemonGattModule::ClientTestCommandCmd(
   int aCommand, const BluetoothGattTestParam& aTestParam,
   BluetoothGattClientResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLIENT_TEST_COMMAND,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLIENT_TEST_COMMAND,
                            4 + // Command
                            6 + // Address
                            16 + // UUID
                            2 + // U1
                            2 + // U2
                            2 + // U3
                            2 + // U4
                            2)); // U5
@@ -677,255 +677,255 @@ BluetoothDaemonGattModule::ClientTestCom
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonGattModule::ErrorRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothGattResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothGattResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
     aRes, &BluetoothGattResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientRegisterRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::RegisterClient,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientUnregisterRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::UnregisterClient,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientScanRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::Scan, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientConnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::Connect, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientDisconnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::Disconnect,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientListenRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::Listen, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientRefreshRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::Refresh, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientSearchServiceRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::SearchService,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetIncludedServiceRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::GetIncludedService,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetCharacteristicRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::GetCharacteristic,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetDescriptorRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::GetDescriptor,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientReadCharacteristicRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::ReadCharacteristic,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientWriteCharacteristicRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::WriteCharacteristic,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientReadDescriptorRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::ReadDescriptor,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientWriteDescriptorRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::WriteDescriptor,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientExecuteWriteRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::ExecuteWrite,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientRegisterNotificationRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::RegisterNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientDeregisterNotificationRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::DeregisterNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientReadRemoteRssiRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::ReadRemoteRssi,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetDeviceTypeRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::GetDeviceType,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientSetAdvDataRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::SetAdvData,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientTestCommandRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothGattClientResultHandler* aRes)
 {
   ClientResultRunnable::Dispatch(
     aRes, &BluetoothGattClientResultHandler::TestCommand,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::HandleRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonGattModule::* const HandleRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothGattResultHandler*) = {
     INIT_ARRAY_AT(OPCODE_ERROR,
       &BluetoothDaemonGattModule::ErrorRsp)
     };
 
   static void (BluetoothDaemonGattModule::* const HandleClientRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothGattClientResultHandler*) = {
     INIT_ARRAY_AT(0, nullptr),
     INIT_ARRAY_AT(OPCODE_CLIENT_REGISTER,
       &BluetoothDaemonGattModule::ClientRegisterRsp),
     INIT_ARRAY_AT(OPCODE_CLIENT_UNREGISTER,
       &BluetoothDaemonGattModule::ClientUnregisterRsp),
     INIT_ARRAY_AT(OPCODE_CLIENT_SCAN,
       &BluetoothDaemonGattModule::ClientScanRsp),
@@ -1027,38 +1027,38 @@ public:
     MOZ_ASSERT(NS_IsMainThread());
 
     return sNotificationHandler;
   }
 };
 
 void
 BluetoothDaemonGattModule::ClientRegisterNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientRegisterNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::RegisterClientNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for ClientScanResultNotification
 class BluetoothDaemonGattModule::ClientScanResultInitOp final
   : private PDUInitOp
 {
 public:
-  ClientScanResultInitOp(BluetoothDaemonPDU& aPDU)
+  ClientScanResultInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1,
                int& aArg2,
                BluetoothGattAdvData& aArg3) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read address */
     nsresult rv = UnpackPDU(
       pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
     /* Read RSSI */
@@ -1080,39 +1080,39 @@ public:
 
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonGattModule::ClientScanResultNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientScanResultNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ScanResultNotification,
     ClientScanResultInitOp(aPDU));
 }
 
 // Init operator class for ClientConnect/DisconnectNotification
 class BluetoothDaemonGattModule::ClientConnectDisconnectInitOp final
   : private PDUInitOp
 {
 public:
-  ClientConnectDisconnectInitOp(BluetoothDaemonPDU& aPDU)
+  ClientConnectDisconnectInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (int& aArg1,
                BluetoothGattStatus& aArg2,
                int& aArg3,
                nsString& aArg4) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read connection ID */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     /* Read status */
     rv = UnpackPDU(pdu, aArg2);
@@ -1133,156 +1133,156 @@ public:
 
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonGattModule::ClientConnectNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientConnectNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ConnectNotification,
     ClientConnectDisconnectInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientDisconnectNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientDisconnectNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::DisconnectNotification,
     ClientConnectDisconnectInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientSearchCompleteNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientSearchCompleteNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::SearchCompleteNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientSearchResultNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientSearchResultNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::SearchResultNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetCharacteristicNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientGetCharacteristicNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::GetCharacteristicNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetDescriptorNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientGetDescriptorNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::GetDescriptorNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientGetIncludedServiceNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientGetIncludedServiceNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::GetIncludedServiceNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientRegisterNotificationNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientRegisterNotificationNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::RegisterNotificationNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientNotifyNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientNotifyNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::NotifyNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientReadCharacteristicNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientReadCharacteristicNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ReadCharacteristicNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientWriteCharacteristicNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientWriteCharacteristicNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::WriteCharacteristicNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientReadDescriptorNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientReadDescriptorNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ReadDescriptorNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientWriteDescriptorNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientWriteDescriptorNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::WriteDescriptorNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientExecuteWriteNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientExecuteWriteNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ExecuteWriteNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for ClientReadRemoteRssiNotification
 class BluetoothDaemonGattModule::ClientReadRemoteRssiInitOp final
   : private PDUInitOp
 {
 public:
-  ClientReadRemoteRssiInitOp(BluetoothDaemonPDU& aPDU)
+  ClientReadRemoteRssiInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (int& aArg1,
                nsString& aArg2,
                int& aArg3,
                BluetoothGattStatus& aArg4) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read client interface */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     /* Read address */
     rv = UnpackPDU(pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
@@ -1302,39 +1302,39 @@ public:
 
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonGattModule::ClientReadRemoteRssiNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientReadRemoteRssiNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ReadRemoteRssiNotification,
     ClientReadRemoteRssiInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::ClientListenNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClientListenNotification::Dispatch(
     &BluetoothGattClientNotificationHandler::ListenNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonGattModule::HandleNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonGattModule::* const HandleNtf[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonGattModule::ClientRegisterNtf),
     INIT_ARRAY_AT(1, &BluetoothDaemonGattModule::ClientScanResultNtf),
     INIT_ARRAY_AT(2, &BluetoothDaemonGattModule::ClientConnectNtf),
     INIT_ARRAY_AT(3, &BluetoothDaemonGattModule::ClientDisconnectNtf),
     INIT_ARRAY_AT(4, &BluetoothDaemonGattModule::ClientSearchCompleteNtf),
     INIT_ARRAY_AT(5, &BluetoothDaemonGattModule::ClientSearchResultNtf),
     INIT_ARRAY_AT(6, &BluetoothDaemonGattModule::ClientGetCharacteristicNtf),
     INIT_ARRAY_AT(7, &BluetoothDaemonGattModule::ClientGetDescriptorNtf),
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.h
@@ -46,17 +46,17 @@ public:
     OPCODE_CLIENT_GET_DEVICE_TYPE = 0x14,
     OPCODE_CLIENT_SET_ADV_DATA = 0x15,
     OPCODE_CLIENT_TEST_COMMAND = 0x16
     // TODO: Add server opcodes
   };
 
   static const int MAX_NUM_CLIENTS;
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode,
                                   uint32_t aMaxNumClients,
                                   BluetoothSetupResultHandler* aRes) = 0;
 
   virtual nsresult UnregisterModule(uint8_t aId,
                                     BluetoothSetupResultHandler* aRes) = 0;
 
@@ -206,133 +206,133 @@ public:
 
   nsresult ClientTestCommandCmd(int aCommand,
                                 const BluetoothGattTestParam& aTestParam,
                                 BluetoothGattClientResultHandler* aRes);
 
   // TODO: Add server commands
 
 protected:
-  nsresult Send(BluetoothDaemonPDU* aPDU,
+  nsresult Send(DaemonSocketPDU* aPDU,
                 BluetoothGattResultHandler* aRes);
 
-  nsresult Send(BluetoothDaemonPDU* aPDU,
+  nsresult Send(DaemonSocketPDU* aPDU,
                 BluetoothGattClientResultHandler* aRes);
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
   typedef BluetoothResultRunnable0<BluetoothGattClientResultHandler, void>
     ClientResultRunnable;
 
   typedef BluetoothResultRunnable0<BluetoothGattResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothGattResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothGattResultHandler* aRes);
 
-  void ClientRegisterRsp(const BluetoothDaemonPDUHeader& aHeader,
-                         BluetoothDaemonPDU& aPDU,
+  void ClientRegisterRsp(const DaemonSocketPDUHeader& aHeader,
+                         DaemonSocketPDU& aPDU,
                          BluetoothGattClientResultHandler* aRes);
 
-  void ClientUnregisterRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void ClientUnregisterRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothGattClientResultHandler* aRes);
 
-  void ClientScanRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void ClientScanRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothGattClientResultHandler* aRes);
 
-  void ClientConnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU,
+  void ClientConnectRsp(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU,
                         BluetoothGattClientResultHandler* aRes);
 
-  void ClientDisconnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void ClientDisconnectRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothGattClientResultHandler* aRes);
 
-  void ClientListenRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void ClientListenRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothGattClientResultHandler* aRes);
 
-  void ClientRefreshRsp(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU,
+  void ClientRefreshRsp(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU,
                         BluetoothGattClientResultHandler* aRes);
 
-  void ClientSearchServiceRsp(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU,
+  void ClientSearchServiceRsp(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU,
                               BluetoothGattClientResultHandler* aRes);
 
-  void ClientGetIncludedServiceRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU,
+  void ClientGetIncludedServiceRsp(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU,
                                    BluetoothGattClientResultHandler* aRes);
 
-  void ClientGetCharacteristicRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                  BluetoothDaemonPDU& aPDU,
+  void ClientGetCharacteristicRsp(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU,
                                   BluetoothGattClientResultHandler* aRes);
 
-  void ClientGetDescriptorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU,
+  void ClientGetDescriptorRsp(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU,
                               BluetoothGattClientResultHandler* aRes);
 
-  void ClientReadCharacteristicRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU,
+  void ClientReadCharacteristicRsp(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU,
                                    BluetoothGattClientResultHandler* aRes);
 
-  void ClientWriteCharacteristicRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                    BluetoothDaemonPDU& aPDU,
+  void ClientWriteCharacteristicRsp(const DaemonSocketPDUHeader& aHeader,
+                                    DaemonSocketPDU& aPDU,
                                     BluetoothGattClientResultHandler* aRes);
 
-  void ClientReadDescriptorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void ClientReadDescriptorRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothGattClientResultHandler* aRes);
 
-  void ClientWriteDescriptorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU,
+  void ClientWriteDescriptorRsp(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU,
                                 BluetoothGattClientResultHandler* aRes);
 
-  void ClientExecuteWriteRsp(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU,
+  void ClientExecuteWriteRsp(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU,
                              BluetoothGattClientResultHandler* aRes);
 
-  void ClientRegisterNotificationRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                     BluetoothDaemonPDU& aPDU,
+  void ClientRegisterNotificationRsp(const DaemonSocketPDUHeader& aHeader,
+                                     DaemonSocketPDU& aPDU,
                                      BluetoothGattClientResultHandler* aRes);
 
-  void ClientDeregisterNotificationRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                       BluetoothDaemonPDU& aPDU,
+  void ClientDeregisterNotificationRsp(const DaemonSocketPDUHeader& aHeader,
+                                       DaemonSocketPDU& aPDU,
                                        BluetoothGattClientResultHandler* aRes);
 
-  void ClientReadRemoteRssiRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void ClientReadRemoteRssiRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothGattClientResultHandler* aRes);
 
-  void ClientGetDeviceTypeRsp(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU,
+  void ClientGetDeviceTypeRsp(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU,
                               BluetoothGattClientResultHandler* aRes);
 
-  void ClientSetAdvDataRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void ClientSetAdvDataRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothGattClientResultHandler* aRes);
 
-  void ClientTestCommandRsp(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU,
+  void ClientTestCommandRsp(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU,
                             BluetoothGattClientResultHandler* aRes);
 
-  void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   // TODO: Add Server responses
 
   //
   // Notifications
   //
 
@@ -451,72 +451,72 @@ protected:
     ClientNotificationHandlerWrapper, void,
     BluetoothGattStatus, int>
     ClientListenNotification;
 
   class ClientScanResultInitOp;
   class ClientConnectDisconnectInitOp;
   class ClientReadRemoteRssiInitOp;
 
-  void ClientRegisterNtf(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU);
+  void ClientRegisterNtf(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU);
 
-  void ClientScanResultNtf(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU);
+  void ClientScanResultNtf(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU);
 
-  void ClientConnectNtf(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU);
+  void ClientConnectNtf(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU);
 
-  void ClientDisconnectNtf(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU);
+  void ClientDisconnectNtf(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU);
 
-  void ClientSearchCompleteNtf(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU);
+  void ClientSearchCompleteNtf(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU);
 
-  void ClientSearchResultNtf(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU);
+  void ClientSearchResultNtf(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU);
 
-  void ClientGetCharacteristicNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                  BluetoothDaemonPDU& aPDU);
+  void ClientGetCharacteristicNtf(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU);
 
-  void ClientGetDescriptorNtf(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU);
+  void ClientGetDescriptorNtf(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU);
 
-  void ClientGetIncludedServiceNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU);
+  void ClientGetIncludedServiceNtf(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU);
 
-  void ClientRegisterNotificationNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                     BluetoothDaemonPDU& aPDU);
+  void ClientRegisterNotificationNtf(const DaemonSocketPDUHeader& aHeader,
+                                     DaemonSocketPDU& aPDU);
 
-  void ClientNotifyNtf(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU);
+  void ClientNotifyNtf(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU);
 
-  void ClientReadCharacteristicNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU);
+  void ClientReadCharacteristicNtf(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU);
 
-  void ClientWriteCharacteristicNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                    BluetoothDaemonPDU& aPDU);
+  void ClientWriteCharacteristicNtf(const DaemonSocketPDUHeader& aHeader,
+                                    DaemonSocketPDU& aPDU);
 
-  void ClientReadDescriptorNtf(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU);
+  void ClientReadDescriptorNtf(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU);
 
-  void ClientWriteDescriptorNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU);
+  void ClientWriteDescriptorNtf(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU);
 
-  void ClientExecuteWriteNtf(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU);
+  void ClientExecuteWriteNtf(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU);
 
-  void ClientReadRemoteRssiNtf(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU);
+  void ClientReadRemoteRssiNtf(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU);
 
-  void ClientListenNtf(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU);
+  void ClientListenNtf(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU);
 
-  void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   static BluetoothGattNotificationHandler* sNotificationHandler;
 };
 
 class BluetoothDaemonGattInterface final
   : public BluetoothGattInterface
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -25,29 +25,29 @@ nsString BluetoothDaemonHandsfreeModule:
 void
 BluetoothDaemonHandsfreeModule::SetNotificationHandler(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
 nsresult
-BluetoothDaemonHandsfreeModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonHandsfreeModule::Send(DaemonSocketPDU* aPDU,
                                      BluetoothHandsfreeResultHandler* aRes)
 {
   aRes->AddRef(); // Keep reference for response
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 void
-BluetoothDaemonHandsfreeModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                                          BluetoothDaemonPDU& aPDU, void* aUserData)
+BluetoothDaemonHandsfreeModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                                          DaemonSocketPDU& aPDU, void* aUserData)
 {
   static void (BluetoothDaemonHandsfreeModule::* const HandleOp[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::HandleRsp),
     INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::HandleNtf),
   };
 
   MOZ_ASSERT(!NS_IsMainThread());
 
   // Negate twice to map bit to 0/1
   unsigned long isNtf = !!(aHeader.mOpcode & 0x80);
@@ -59,18 +59,18 @@ BluetoothDaemonHandsfreeModule::HandleSv
 //
 
 nsresult
 BluetoothDaemonHandsfreeModule::ConnectCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CONNECT,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CONNECT,
                            6)); // Address
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -82,18 +82,18 @@ BluetoothDaemonHandsfreeModule::ConnectC
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::DisconnectCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DISCONNECT,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_DISCONNECT,
                            6)); // Address
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -105,18 +105,18 @@ BluetoothDaemonHandsfreeModule::Disconne
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::ConnectAudioCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CONNECT_AUDIO,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CONNECT_AUDIO,
                            6)); // Address
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -128,18 +128,18 @@ BluetoothDaemonHandsfreeModule::ConnectA
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::DisconnectAudioCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DISCONNECT_AUDIO,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_DISCONNECT_AUDIO,
                            6)); // Address
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
@@ -151,18 +151,18 @@ BluetoothDaemonHandsfreeModule::Disconne
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StartVoiceRecognitionCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_START_VOICE_RECOGNITION,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_START_VOICE_RECOGNITION,
                            6)); // Address (BlueZ 5.25)
 
   nsresult rv;
 #if ANDROID_VERSION >= 21
   rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -177,18 +177,18 @@ BluetoothDaemonHandsfreeModule::StartVoi
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StopVoiceRecognitionCmd(
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_STOP_VOICE_RECOGNITION,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_STOP_VOICE_RECOGNITION,
                            6)); // Address (BlueZ 5.25)
 
   nsresult rv;
 #if ANDROID_VERSION >= 21
   rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
@@ -204,18 +204,18 @@ BluetoothDaemonHandsfreeModule::StopVoic
 
 nsresult
 BluetoothDaemonHandsfreeModule::VolumeControlCmd(
   BluetoothHandsfreeVolumeType aType, int aVolume,
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_VOLUME_CONTROL,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_VOLUME_CONTROL,
                            1 + // Volume type
                            1 + // Volume
                            6)); // Address (BlueZ 5.25)
 
 #if ANDROID_VERSION >= 21
   nsresult rv = PackPDU(
     aType, PackConversion<int, uint8_t>(aVolume),
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
@@ -236,18 +236,18 @@ BluetoothDaemonHandsfreeModule::VolumeCo
 nsresult
 BluetoothDaemonHandsfreeModule::DeviceStatusNotificationCmd(
   BluetoothHandsfreeNetworkState aNtkState,
   BluetoothHandsfreeServiceType aSvcType, int aSignal, int aBattChg,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_DEVICE_STATUS_NOTIFICATION,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_DEVICE_STATUS_NOTIFICATION,
                            1 + // Network state
                            1 + // Service type
                            1 + // Signal strength
                            1)); // Battery level
 
   nsresult rv = PackPDU(aNtkState, aSvcType,
                         PackConversion<int, uint8_t>(aSignal),
                         PackConversion<int, uint8_t>(aBattChg), *pdu);
@@ -264,18 +264,18 @@ BluetoothDaemonHandsfreeModule::DeviceSt
 
 nsresult
 BluetoothDaemonHandsfreeModule::CopsResponseCmd(
   const char* aCops, const nsAString& aRemoteAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_COPS_RESPONSE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_COPS_RESPONSE,
                            0 + // Dynamically allocated
                            6)); // Address (BlueZ 5.25)
 
 #if ANDROID_VERSION >= 21
   nsresult rv = PackPDU(
     PackCString0(nsDependentCString(aCops)),
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
 #else
@@ -297,18 +297,18 @@ BluetoothDaemonHandsfreeModule::CindResp
   int aSvc, int aNumActive, int aNumHeld,
   BluetoothHandsfreeCallState aCallSetupState,
   int aSignal, int aRoam, int aBattChg,
   const nsAString& aRemoteAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CIND_RESPONSE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CIND_RESPONSE,
                            1 + // Service
                            1 + // # Active
                            1 + // # Held
                            1 + // Call state
                            1 + // Signal strength
                            1 + // Roaming
                            1 + // Battery level
                            6)); // Address (BlueZ 5.25)
@@ -345,18 +345,18 @@ BluetoothDaemonHandsfreeModule::CindResp
 
 nsresult
 BluetoothDaemonHandsfreeModule::FormattedAtResponseCmd(
   const char* aRsp, const nsAString& aRemoteAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_FORMATTED_AT_RESPONSE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_FORMATTED_AT_RESPONSE,
                            0 + // Dynamically allocated
                            6)); // Address (BlueZ 5.25)
 
 #if ANDROID_VERSION >= 21
   nsresult rv = PackPDU(
     PackCString0(nsDependentCString(aRsp)),
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
 #else
@@ -375,18 +375,18 @@ BluetoothDaemonHandsfreeModule::Formatte
 
 nsresult
 BluetoothDaemonHandsfreeModule::AtResponseCmd(
   BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_AT_RESPONSE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_AT_RESPONSE,
                            1 + // AT Response code
                            1 + // Error code
                            6)); // Address (BlueZ 5.25)
 
 #if ANDROID_VERSION >= 21
   nsresult rv = PackPDU(
     aResponseCode, PackConversion<int, uint8_t>(aErrorCode),
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
@@ -412,18 +412,18 @@ BluetoothDaemonHandsfreeModule::ClccResp
   BluetoothHandsfreeCallMode aMode, BluetoothHandsfreeCallMptyType aMpty,
   const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType,
   const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ConvertUTF16toUTF8 number(aNumber);
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CLCC_RESPONSE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CLCC_RESPONSE,
                            1 + // Call index
                            1 + // Call direction
                            1 + // Call state
                            1 + // Call mode
                            1 + // Call MPTY
                            1 + // Address type
                            number.Length() + 1 + // Number string + \0
                            6)); // Address (BlueZ 5.25)
@@ -455,18 +455,18 @@ BluetoothDaemonHandsfreeModule::PhoneSta
   int aNumActive, int aNumHeld, BluetoothHandsfreeCallState aCallSetupState,
   const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ConvertUTF16toUTF8 number(aNumber);
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_PHONE_STATE_CHANGE,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_PHONE_STATE_CHANGE,
                            1 + // # Active
                            1 + // # Held
                            1 + // Call state
                            1 + // Address type
                            number.Length() + 1)); // Number string + \0
 
   nsresult rv = PackPDU(PackConversion<int, uint8_t>(aNumActive),
                         PackConversion<int, uint8_t>(aNumHeld),
@@ -486,18 +486,18 @@ BluetoothDaemonHandsfreeModule::PhoneSta
 nsresult
 BluetoothDaemonHandsfreeModule::ConfigureWbsCmd(
   const nsAString& aRemoteAddr,
   BluetoothHandsfreeWbsConfig aConfig,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(
-    new BluetoothDaemonPDU(SERVICE_ID, OPCODE_CONFIGURE_WBS,
+  nsAutoPtr<DaemonSocketPDU> pdu(
+    new DaemonSocketPDU(SERVICE_ID, OPCODE_CONFIGURE_WBS,
                            6 + // Address
                            1)); // Config
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), aConfig, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -509,179 +509,179 @@ BluetoothDaemonHandsfreeModule::Configur
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonHandsfreeModule::ErrorRsp(
-  const BluetoothDaemonPDUHeader& aHeader,
-  BluetoothDaemonPDU& aPDU, BluetoothHandsfreeResultHandler* aRes)
+  const DaemonSocketPDUHeader& aHeader,
+  DaemonSocketPDU& aPDU, BluetoothHandsfreeResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::ConnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::Connect, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::DisconnectRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::Disconnect, UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::ConnectAudioRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::ConnectAudio,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::DisconnectAudioRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::DisconnectAudio,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::StartVoiceRecognitionRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::StartVoiceRecognition,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::StopVoiceRecognitionRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::StopVoiceRecognition,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::VolumeControlRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::VolumeControl,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::DeviceStatusNotificationRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::DeviceStatusNotification,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::CopsResponseRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::CopsResponse,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::CindResponseRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::CindResponse,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::FormattedAtResponseRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::FormattedAtResponse,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::AtResponseRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::AtResponse,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::ClccResponseRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::ClccResponse,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::PhoneStateChangeRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::PhoneStateChange,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::ConfigureWbsRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   BluetoothHandsfreeResultHandler* aRes)
 {
   ResultRunnable::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::ConfigureWbs,
     UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::HandleRsp(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonHandsfreeModule::* const HandleRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothHandsfreeResultHandler*) = {
     INIT_ARRAY_AT(OPCODE_ERROR,
       &BluetoothDaemonHandsfreeModule::ErrorRsp),
     INIT_ARRAY_AT(OPCODE_CONNECT,
       &BluetoothDaemonHandsfreeModule::ConnectRsp),
     INIT_ARRAY_AT(OPCODE_DISCONNECT,
       &BluetoothDaemonHandsfreeModule::DisconnectRsp),
     INIT_ARRAY_AT(OPCODE_CONNECT_AUDIO,
@@ -747,25 +747,25 @@ public:
   }
 };
 
 // Init operator class for ConnectionStateNotification
 class BluetoothDaemonHandsfreeModule::ConnectionStateInitOp final
   : private PDUInitOp
 {
 public:
-  ConnectionStateInitOp(BluetoothDaemonPDU& aPDU)
+  ConnectionStateInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeConnectionState& aArg1,
                nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -784,36 +784,36 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::ConnectionStateNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ConnectionStateNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::ConnectionStateNotification,
     ConnectionStateInitOp(aPDU));
 }
 
 // Init operator class for AudioStateNotification
 class BluetoothDaemonHandsfreeModule::AudioStateInitOp final
   : private PDUInitOp
 {
 public:
-  AudioStateInitOp(BluetoothDaemonPDU& aPDU)
+  AudioStateInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeAudioState& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -824,37 +824,37 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::AudioStateNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AudioStateNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::AudioStateNotification,
     AudioStateInitOp(aPDU));
 }
 
 // Init operator class for VoiceRecognitionNotification
 class BluetoothDaemonHandsfreeModule::VoiceRecognitionInitOp final
   : private PDUInitOp
 {
 public:
-  VoiceRecognitionInitOp(BluetoothDaemonPDU& aPDU)
+  VoiceRecognitionInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeVoiceRecognitionState& aArg1,
                nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -869,29 +869,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   VoiceRecognitionNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification,
     VoiceRecognitionInitOp(aPDU));
 }
 
 // Init operator class for AnswerCallNotification
 class BluetoothDaemonHandsfreeModule::AnswerCallInitOp final
   : private PDUInitOp
 {
 public:
-  AnswerCallInitOp(BluetoothDaemonPDU& aPDU)
+  AnswerCallInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -905,29 +905,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::AnswerCallNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   AnswerCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::AnswerCallNotification,
     AnswerCallInitOp(aPDU));
 }
 
 // Init operator class for HangupCallNotification
 class BluetoothDaemonHandsfreeModule::HangupCallInitOp final
   : private PDUInitOp
 {
 public:
-  HangupCallInitOp(BluetoothDaemonPDU& aPDU)
+  HangupCallInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -941,37 +941,37 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::HangupCallNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   HangupCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::HangupCallNotification,
     HangupCallInitOp(aPDU));
 }
 
 // Init operator class for VolumeNotification
 class BluetoothDaemonHandsfreeModule::VolumeInitOp final
   : private PDUInitOp
 {
 public:
-  VolumeInitOp(BluetoothDaemonPDU& aPDU)
+  VolumeInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeVolumeType& aArg1, int& aArg2,
                nsString& aArg3) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read volume type */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read volume */
@@ -992,36 +992,36 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::VolumeNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   VolumeNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::VolumeNotification,
     VolumeInitOp(aPDU));
 }
 
 // Init operator class for DialCallNotification
 class BluetoothDaemonHandsfreeModule::DialCallInitOp final
   : private PDUInitOp
 {
 public:
-  DialCallInitOp(BluetoothDaemonPDU& aPDU)
+  DialCallInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv;
     /* Read address
      * It's a little weird to parse aArg2(aBdAddr) before parsing
      * aArg1(aNumber), but this order is defined in BlueZ 5.25 anyway.
      */
 #if ANDROID_VERSION >= 21
     rv = UnpackPDU(
@@ -1040,36 +1040,36 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::DialCallNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   DialCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::DialCallNotification,
     DialCallInitOp(aPDU));
 }
 
 // Init operator class for DtmfNotification
 class BluetoothDaemonHandsfreeModule::DtmfInitOp final
   : private PDUInitOp
 {
 public:
-  DtmfInitOp(BluetoothDaemonPDU& aPDU)
+  DtmfInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (char& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read tone */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -1084,36 +1084,36 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::DtmfNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   DtmfNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::DtmfNotification,
     DtmfInitOp(aPDU));
 }
 
 // Init operator class for NRECNotification
 class BluetoothDaemonHandsfreeModule::NRECInitOp final
   : private PDUInitOp
 {
 public:
-  NRECInitOp(BluetoothDaemonPDU& aPDU)
+  NRECInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeNRECState& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -1128,36 +1128,36 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::NRECNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   NRECNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::NRECNotification,
     NRECInitOp(aPDU));
 }
 
 // Init operator class for CallHoldNotification
 class BluetoothDaemonHandsfreeModule::CallHoldInitOp final
   : private PDUInitOp
 {
 public:
-  CallHoldInitOp(BluetoothDaemonPDU& aPDU)
+  CallHoldInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (BluetoothHandsfreeCallHoldType& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     /* Read type */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read address */
@@ -1172,29 +1172,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::CallHoldNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   CallHoldNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CallHoldNotification,
     CallHoldInitOp(aPDU));
 }
 
 // Init operator class for CnumNotification
 class BluetoothDaemonHandsfreeModule::CnumInitOp final
   : private PDUInitOp
 {
 public:
-  CnumInitOp(BluetoothDaemonPDU& aPDU)
+  CnumInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -1208,29 +1208,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::CnumNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   CnumNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CnumNotification,
     CnumInitOp(aPDU));
 }
 
 // Init operator class for CindNotification
 class BluetoothDaemonHandsfreeModule::CindInitOp final
   : private PDUInitOp
 {
 public:
-  CindInitOp(BluetoothDaemonPDU& aPDU)
+  CindInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -1244,29 +1244,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::CindNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   CindNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CindNotification,
     CindInitOp(aPDU));
 }
 
 // Init operator class for CopsNotification
 class BluetoothDaemonHandsfreeModule::CopsInitOp final
   : private PDUInitOp
 {
 public:
-  CopsInitOp(BluetoothDaemonPDU& aPDU)
+  CopsInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -1280,29 +1280,29 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::CopsNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   CopsNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CopsNotification,
     CopsInitOp(aPDU));
 }
 
 // Init operator class for ClccNotification
 class BluetoothDaemonHandsfreeModule::ClccInitOp final
   : private PDUInitOp
 {
 public:
-  ClccInitOp(BluetoothDaemonPDU& aPDU)
+  ClccInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -1316,36 +1316,36 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::ClccNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   ClccNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::ClccNotification,
     ClccInitOp(aPDU));
 }
 
 // Init operator class for UnknownAtNotification
 class BluetoothDaemonHandsfreeModule::UnknownAtInitOp final
   : private PDUInitOp
 {
 public:
-  UnknownAtInitOp(BluetoothDaemonPDU& aPDU)
+  UnknownAtInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsCString& aArg1, nsString& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv;
     /* Read address
      * It's a little weird to parse aArg2(aBdAddr) before parsing
      * aArg1(aAtString), but this order is defined in BlueZ 5.25 anyway.
      */
 #if ANDROID_VERSION >= 21
     rv = UnpackPDU(
@@ -1364,29 +1364,29 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::UnknownAtNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   UnknownAtNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::UnknownAtNotification,
     UnknownAtInitOp(aPDU));
 }
 
 // Init operator class for KeyPressedNotification
 class BluetoothDaemonHandsfreeModule::KeyPressedInitOp final
   : private PDUInitOp
 {
 public:
-  KeyPressedInitOp(BluetoothDaemonPDU& aPDU)
+  KeyPressedInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (nsString& aArg1) const
   {
     /* Read address */
 #if ANDROID_VERSION >= 21
@@ -1400,30 +1400,30 @@ public:
 #endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::KeyPressedNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU)
 {
   KeyPressedNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::KeyPressedNotification,
     KeyPressedInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::HandleNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonHandsfreeModule::* const HandleNtf[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
     INIT_ARRAY_AT(0, &BluetoothDaemonHandsfreeModule::ConnectionStateNtf),
     INIT_ARRAY_AT(1, &BluetoothDaemonHandsfreeModule::AudioStateNtf),
     INIT_ARRAY_AT(2, &BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf),
     INIT_ARRAY_AT(3, &BluetoothDaemonHandsfreeModule::AnswerCallNtf),
     INIT_ARRAY_AT(4, &BluetoothDaemonHandsfreeModule::HangupCallNtf),
     INIT_ARRAY_AT(5, &BluetoothDaemonHandsfreeModule::VolumeNtf),
     INIT_ARRAY_AT(6, &BluetoothDaemonHandsfreeModule::DialCallNtf),
     INIT_ARRAY_AT(7, &BluetoothDaemonHandsfreeModule::DtmfNtf),
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
@@ -36,17 +36,17 @@ public:
     OPCODE_CIND_RESPONSE = 0x0a,
     OPCODE_FORMATTED_AT_RESPONSE = 0x0b,
     OPCODE_AT_RESPONSE = 0x0c,
     OPCODE_CLCC_RESPONSE = 0x0d,
     OPCODE_PHONE_STATE_CHANGE = 0x0e,
     OPCODE_CONFIGURE_WBS = 0x0f
   };
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode,
                                   uint32_t aMaxNumClients,
                                   BluetoothSetupResultHandler* aRes) = 0;
 
   virtual nsresult UnregisterModule(uint8_t aId,
                                     BluetoothSetupResultHandler* aRes) = 0;
 
@@ -120,99 +120,99 @@ public:
 
   /* Wide Band Speech */
 
   nsresult ConfigureWbsCmd(const nsAString& aBdAddr,
                            BluetoothHandsfreeWbsConfig aConfig,
                            BluetoothHandsfreeResultHandler* aRes);
 
 protected:
-  nsresult Send(BluetoothDaemonPDU* aPDU,
+  nsresult Send(DaemonSocketPDU* aPDU,
                 BluetoothHandsfreeResultHandler* aRes);
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData);
 
   //
   // Responses
   //
 
   typedef BluetoothResultRunnable0<BluetoothHandsfreeResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothHandsfreeResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothHandsfreeResultHandler* aRes);
 
-  void ConnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                  BluetoothDaemonPDU& aPDU,
+  void ConnectRsp(const DaemonSocketPDUHeader& aHeader,
+                  DaemonSocketPDU& aPDU,
                   BluetoothHandsfreeResultHandler* aRes);
 
-  void DisconnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void DisconnectRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothHandsfreeResultHandler* aRes);
 
-  void ConnectAudioRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void ConnectAudioRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothHandsfreeResultHandler* aRes);
 
-  void DisconnectAudioRsp(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU,
+  void DisconnectAudioRsp(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU,
                           BluetoothHandsfreeResultHandler* aRes);
 
-  void StartVoiceRecognitionRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU,
+  void StartVoiceRecognitionRsp(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU,
                                 BluetoothHandsfreeResultHandler* aRes);
 
-  void StopVoiceRecognitionRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void StopVoiceRecognitionRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothHandsfreeResultHandler* aRes);
 
-  void VolumeControlRsp(const BluetoothDaemonPDUHeader& aHeader,
-                        BluetoothDaemonPDU& aPDU,
+  void VolumeControlRsp(const DaemonSocketPDUHeader& aHeader,
+                        DaemonSocketPDU& aPDU,
                         BluetoothHandsfreeResultHandler* aRes);
 
-  void DeviceStatusNotificationRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                   BluetoothDaemonPDU& aPDU,
+  void DeviceStatusNotificationRsp(const DaemonSocketPDUHeader& aHeader,
+                                   DaemonSocketPDU& aPDU,
                                    BluetoothHandsfreeResultHandler* aRes);
 
-  void CopsResponseRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void CopsResponseRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothHandsfreeResultHandler* aRes);
 
-  void CindResponseRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void CindResponseRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothHandsfreeResultHandler* aRes);
 
-  void FormattedAtResponseRsp(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU,
+  void FormattedAtResponseRsp(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU,
                               BluetoothHandsfreeResultHandler* aRes);
 
-  void AtResponseRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void AtResponseRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothHandsfreeResultHandler* aRes);
 
-  void ClccResponseRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void ClccResponseRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothHandsfreeResultHandler* aRes);
 
-  void PhoneStateChangeRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void PhoneStateChangeRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothHandsfreeResultHandler* aRes);
 
-  void ConfigureWbsRsp(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU,
+  void ConfigureWbsRsp(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU,
                        BluetoothHandsfreeResultHandler* aRes);
 
-  void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   //
   // Notifications
   //
 
   class NotificationHandlerWrapper;
 
@@ -313,66 +313,66 @@ protected:
   class CnumInitOp;
   class CindInitOp;
   class CopsInitOp;
   class ClccInitOp;
   class VolumeInitOp;
   class UnknownAtInitOp;
   class KeyPressedInitOp;
 
-  void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU);
+  void ConnectionStateNtf(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU);
 
-  void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU);
+  void AudioStateNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU);
 
-  void VoiceRecognitionNtf(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU);
+  void VoiceRecognitionNtf(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU);
 
-  void AnswerCallNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU);
+  void AnswerCallNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU);
 
-  void HangupCallNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU);
+  void HangupCallNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU);
 
-  void VolumeNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU);
+  void VolumeNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU);
 
-  void DialCallNtf(const BluetoothDaemonPDUHeader& aHeader,
-                   BluetoothDaemonPDU& aPDU);
+  void DialCallNtf(const DaemonSocketPDUHeader& aHeader,
+                   DaemonSocketPDU& aPDU);
 
-  void DtmfNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void DtmfNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void NRECNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void NRECNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void CallHoldNtf(const BluetoothDaemonPDUHeader& aHeader,
-                   BluetoothDaemonPDU& aPDU);
+  void CallHoldNtf(const DaemonSocketPDUHeader& aHeader,
+                   DaemonSocketPDU& aPDU);
 
-  void CnumNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void CnumNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void CindNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void CindNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void CopsNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void CopsNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void ClccNtf(const BluetoothDaemonPDUHeader& aHeader,
-               BluetoothDaemonPDU& aPDU);
+  void ClccNtf(const DaemonSocketPDUHeader& aHeader,
+               DaemonSocketPDU& aPDU);
 
-  void UnknownAtNtf(const BluetoothDaemonPDUHeader& aHeader,
-                    BluetoothDaemonPDU& aPDU);
+  void UnknownAtNtf(const DaemonSocketPDUHeader& aHeader,
+                    DaemonSocketPDU& aPDU);
 
-  void KeyPressedNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU);
+  void KeyPressedNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU);
 
-  void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void HandleNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  void* aUserData);
 
   static BluetoothHandsfreeNotificationHandler* sNotificationHandler;
 #if ANDROID_VERSION < 21
   /* |sConnectedDeviceAddress| stores Bluetooth device address of the
    * connected device. Before BlueZ 5.25, we maintain this address by ourselves
    * through ConnectionStateNtf(); after BlueZ 5.25, every callback carries
    * this address directly so we don't have to keep it.
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
@@ -1065,30 +1065,30 @@ Convert(const ConvertArray<Tin>& aIn, To
   return NS_OK;
 }
 
 //
 // Packing
 //
 
 nsresult
-PackPDU(bool aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(bool aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<bool, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothAddress& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothAddress& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackArray<uint8_t>(aIn.mAddr, sizeof(aIn.mAddr)), aPDU);
 }
 
 nsresult
 PackPDU(const BluetoothAvrcpAttributeTextPairs& aIn,
-        BluetoothDaemonPDU& aPDU)
+        DaemonSocketPDU& aPDU)
 {
   size_t i;
 
   for (i = 0; i < aIn.mLength; ++i) {
     nsresult rv = PackPDU(aIn.mAttr[i], aPDU);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -1114,17 +1114,17 @@ PackPDU(const BluetoothAvrcpAttributeTex
       return rv;
     }
   }
   return NS_OK;
 }
 
 nsresult
 PackPDU(const BluetoothAvrcpAttributeValuePairs& aIn,
-        BluetoothDaemonPDU& aPDU)
+        DaemonSocketPDU& aPDU)
 {
   size_t i;
 
   for (i = 0; i < aIn.mLength; ++i) {
     nsresult rv = PackPDU(aIn.mAttr[i], aPDU);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -1132,17 +1132,17 @@ PackPDU(const BluetoothAvrcpAttributeVal
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 nsresult
-PackPDU(const BluetoothAvrcpElementAttribute& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothAvrcpElementAttribute& aIn, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(PackConversion<uint32_t, uint8_t>(aIn.mId), aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   const NS_ConvertUTF16toUTF8 cstr(aIn.mValue);
 
@@ -1158,23 +1158,23 @@ PackPDU(const BluetoothAvrcpElementAttri
   }
 
   return PackPDU(
     PackArray<uint8_t>(reinterpret_cast<const uint8_t*>(cstr.get()), clen),
     aPDU);
 }
 
 nsresult
-PackPDU(BluetoothAvrcpEvent aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothAvrcpEvent aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothAvrcpEvent, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothAvrcpEventParamPair& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothAvrcpEventParamPair& aIn, DaemonSocketPDU& aPDU)
 {
   nsresult rv;
 
   switch (aIn.mEvent) {
     case AVRCP_EVENT_PLAY_STATUS_CHANGED:
       rv = PackPDU(aIn.mParam.mPlayStatus, aPDU);
       break;
     case AVRCP_EVENT_TRACK_CHANGE:
@@ -1206,120 +1206,120 @@ PackPDU(const BluetoothAvrcpEventParamPa
     default:
       rv = NS_ERROR_ILLEGAL_VALUE;
       break;
   }
   return rv;
 }
 
 nsresult
-PackPDU(BluetoothAvrcpNotification aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothAvrcpNotification aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothAvrcpNotification, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothAvrcpPlayerAttribute aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothAvrcpPlayerAttribute aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothAvrcpPlayerAttribute, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothAvrcpStatus aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothAvrcpStatus aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothAvrcpStatus, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothConfigurationParameter& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothConfigurationParameter& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(aIn.mType, aIn.mLength,
                  PackArray<uint8_t>(aIn.mValue.get(), aIn.mLength), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothDaemonPDUHeader& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const DaemonSocketPDUHeader& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(aIn.mService, aIn.mOpcode, aIn.mLength, aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeAtResponse& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeAtResponse& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeAtResponse, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallAddressType& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeCallAddressType& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeCallAddressType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallDirection& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeCallDirection& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeCallDirection, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallMode& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeCallMode& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeCallMode, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallMptyType& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeCallMptyType& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeCallMptyType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallState& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeCallState& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeCallState, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeNetworkState& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeNetworkState& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeNetworkState, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeServiceType& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeServiceType& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeServiceType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeVolumeType& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeVolumeType& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeVolumeType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothHandsfreeWbsConfig& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothHandsfreeWbsConfig& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackConversion<BluetoothHandsfreeWbsConfig, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothNamedValue& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothNamedValue& aIn, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(
     PackConversion<nsString, BluetoothPropertyType>(aIn.name()), aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   if (aIn.value().type() == BluetoothValue::Tuint32_t) {
@@ -1345,163 +1345,163 @@ PackPDU(const BluetoothNamedValue& aIn, 
   } else {
     BT_LOGR("Invalid property value type");
     rv = NS_ERROR_ILLEGAL_VALUE;
   }
   return rv;
 }
 
 nsresult
-PackPDU(const BluetoothPinCode& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothPinCode& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(aIn.mLength,
                  PackArray<uint8_t>(aIn.mPinCode, sizeof(aIn.mPinCode)),
                  aPDU);
 }
 
 nsresult
-PackPDU(BluetoothPropertyType aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothPropertyType aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothPropertyType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothSspVariant aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothSspVariant, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothScanMode aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothScanMode, int32_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothServiceName& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothServiceName& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackArray<uint8_t>(aIn.mName, sizeof(aIn.mName)), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothSocketType aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothSocketType aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothSocketType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(ControlPlayStatus aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<ControlPlayStatus, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothTransport aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothTransport aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothTransport, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothUuid& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothUuid& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackArray<uint8_t>(aIn.mUuid, sizeof(aIn.mUuid)), aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothGattId& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothGattId& aIn, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(PackReversed<BluetoothUuid>(aIn.mUuid), aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(aIn.mInstanceId, aPDU);
 }
 
 nsresult
-PackPDU(const BluetoothGattServiceId& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const BluetoothGattServiceId& aIn, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn.mId, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(aIn.mIsPrimary, aPDU);
 }
 
 nsresult
-PackPDU(BluetoothGattAuthReq aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothGattAuthReq aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothGattAuthReq, int32_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothGattWriteType aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(BluetoothGattWriteType aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothGattWriteType, int32_t>(aIn), aPDU);
 }
 
 //
 // Unpacking
 //
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, bool& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, bool& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, bool>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, char& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, char& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, char>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothA2dpAudioState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothA2dpAudioState& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothA2dpAudioState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothA2dpConnectionState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothA2dpConnectionState& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothA2dpConnectionState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAclState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAclState& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, BluetoothAclState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpEvent& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpEvent& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothAvrcpEvent>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothAvrcpMediaAttribute>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothAvrcpPlayerAttribute>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut)
 {
   /* Read number of attribute-value pairs */
   nsresult rv = UnpackPDU(aPDU, aOut.mNumAttr);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* Read attribute-value pairs */
   for (uint8_t i = 0; i < aOut.mNumAttr; ++i) {
@@ -1513,81 +1513,81 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothAvrcpRemoteFeature>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothBondState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothBondState& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, BluetoothBondState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothTypeOfDevice& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothTypeOfDevice& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<int32_t, BluetoothTypeOfDevice>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeAudioState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeAudioState& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothHandsfreeAudioState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothHandsfreeCallHoldType>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeConnectionState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeConnectionState& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothHandsfreeConnectionState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeNRECState& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeNRECState& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothHandsfreeNRECState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU,
+UnpackPDU(DaemonSocketPDU& aPDU,
           BluetoothHandsfreeVoiceRecognitionState& aOut)
 {
   return UnpackPDU(
     aPDU,
     UnpackConversion<uint8_t, BluetoothHandsfreeVoiceRecognitionState>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeVolumeType& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeVolumeType& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothHandsfreeVolumeType>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothProperty& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothProperty& aOut)
 {
   nsresult rv = UnpackPDU(aPDU, aOut.mType);
   if (NS_FAILED(rv)) {
     return rv;
   }
   uint16_t len;
   rv = UnpackPDU(aPDU, len);
   if (NS_FAILED(rv)) {
@@ -1662,105 +1662,105 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
       break;
     default:
       break;
   }
   return rv;
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothPropertyType& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothPropertyType& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothPropertyType>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothRemoteInfo& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothRemoteInfo& aOut)
 {
   nsresult rv = UnpackPDU(aPDU,
                           UnpackConversion<uint32_t, int>(aOut.mVerMajor));
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = UnpackPDU(aPDU, UnpackConversion<uint32_t, int>(aOut.mVerMinor));
   if (NS_FAILED(rv)) {
     return rv;
   }
   return UnpackPDU(aPDU, UnpackConversion<uint32_t, int>(aOut.mManufacturer));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothScanMode& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothScanMode& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<int32_t, BluetoothScanMode>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothServiceRecord& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothServiceRecord& aOut)
 {
   /* unpack UUID */
   nsresult rv = UnpackPDU(aPDU, aOut.mUuid);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack channel */
   rv = UnpackPDU(aPDU, aOut.mChannel);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack name */
   return aPDU.Read(aOut.mName, sizeof(aOut.mName));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothSspVariant& aOut)
 {
   return UnpackPDU(
     aPDU, UnpackConversion<uint8_t, BluetoothSspVariant>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothStatus& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<uint8_t, BluetoothStatus>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattStatus& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattStatus& aOut)
 {
   return UnpackPDU(aPDU, UnpackConversion<int32_t, BluetoothGattStatus>(aOut));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattId& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattId& aOut)
 {
   /* unpack UUID */
   nsresult rv = UnpackPDU(aPDU, UnpackReversed<BluetoothUuid>(aOut.mUuid));
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack instance id */
   return UnpackPDU(aPDU, aOut.mInstanceId);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattServiceId& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattServiceId& aOut)
 {
   /* unpack id */
   nsresult rv = UnpackPDU(aPDU, aOut.mId);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack isPrimary */
   return UnpackPDU(aPDU, aOut.mIsPrimary);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattReadParam& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattReadParam& aOut)
 {
   /* unpack service id */
   nsresult rv = UnpackPDU(aPDU, aOut.mServiceId);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack characteristic id */
   rv = UnpackPDU(aPDU, aOut.mCharId);
@@ -1787,17 +1787,17 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack value */
   return aPDU.Read(aOut.mValue, aOut.mValueLength);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattWriteParam& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattWriteParam& aOut)
 {
   /* unpack service id */
   nsresult rv = UnpackPDU(aPDU, aOut.mServiceId);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack characteristic id */
   rv = UnpackPDU(aPDU, aOut.mCharId);
@@ -1809,17 +1809,17 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack status */
   return UnpackPDU(aPDU, aOut.mStatus);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattNotifyParam& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattNotifyParam& aOut)
 {
 
   /* unpack address and convert to nsString */
   BluetoothAddress address;
   nsresult rv = UnpackPDU(aPDU, address);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -1846,17 +1846,17 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, Blue
   rv = UnpackPDU(aPDU, aOut.mLength);
   if (NS_FAILED(rv)) {
     return rv;
   }
   /* unpack value */
   return aPDU.Read(aOut.mValue, aOut.mLength);
 }
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, nsDependentCString& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, nsDependentCString& aOut)
 {
   // We get a pointer to the first character in the PDU, a length
   // of 1 ensures we consume the \0 byte. With 'str' pointing to
   // the string in the PDU, we can copy the actual bytes.
 
   const char* str = reinterpret_cast<const char*>(aPDU.Consume(1));
   if (NS_WARN_IF(!str)) {
     return NS_ERROR_ILLEGAL_VALUE; // end of PDU
@@ -1876,32 +1876,32 @@ UnpackPDU(BluetoothDaemonPDU& aPDU, nsDe
   }
 
   aOut.Rebind(str, len);
 
   return NS_OK;
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackCString0& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackCString0& aOut)
 {
   nsDependentCString cstring;
 
   nsresult rv = UnpackPDU(aPDU, cstring);
   if (NS_FAILED(rv)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   aOut.mString->AssignASCII(cstring.get(), cstring.Length());
 
   return NS_OK;
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackString0& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackString0& aOut)
 {
   nsDependentCString cstring;
 
   nsresult rv = UnpackPDU(aPDU, cstring);
   if (NS_FAILED(rv)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
@@ -101,24 +101,24 @@ struct BluetoothAvrcpEventParamPair {
 };
 
 struct BluetoothConfigurationParameter {
   uint8_t mType;
   uint16_t mLength;
   nsAutoArrayPtr<uint8_t> mValue;
 };
 
-struct BluetoothDaemonPDUHeader {
-  BluetoothDaemonPDUHeader()
+struct DaemonSocketPDUHeader {
+  DaemonSocketPDUHeader()
   : mService(0x00)
   , mOpcode(0x00)
   , mLength(0x00)
   { }
 
-  BluetoothDaemonPDUHeader(uint8_t aService, uint8_t aOpcode, uint8_t aLength)
+  DaemonSocketPDUHeader(uint8_t aService, uint8_t aOpcode, uint8_t aLength)
   : mService(aService)
   , mOpcode(aOpcode)
   , mLength(aLength)
   { }
 
   uint8_t mService;
   uint8_t mOpcode;
   uint16_t mLength;
@@ -341,168 +341,168 @@ Convert(BluetoothGattWriteType aIn, int3
 
 //
 // Packing
 //
 
 // introduce link errors on non-handled data types
 template <typename T>
 nsresult
-PackPDU(T aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(T aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(bool aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(bool aIn, DaemonSocketPDU& aPDU);
 
 inline nsresult
-PackPDU(uint8_t aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(uint8_t aIn, DaemonSocketPDU& aPDU)
 {
   return aPDU.Write(aIn);
 }
 
 inline nsresult
-PackPDU(uint16_t aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(uint16_t aIn, DaemonSocketPDU& aPDU)
 {
   return aPDU.Write(aIn);
 }
 
 inline nsresult
-PackPDU(int32_t aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(int32_t aIn, DaemonSocketPDU& aPDU)
 {
   return aPDU.Write(aIn);
 }
 
 inline nsresult
-PackPDU(uint32_t aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(uint32_t aIn, DaemonSocketPDU& aPDU)
 {
   return aPDU.Write(aIn);
 }
 
 nsresult
-PackPDU(const BluetoothAddress& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothAddress& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
 PackPDU(const BluetoothAvrcpAttributeTextPairs& aIn,
-        BluetoothDaemonPDU& aPDU);
+        DaemonSocketPDU& aPDU);
 
 nsresult
 PackPDU(const BluetoothAvrcpAttributeValuePairs& aIn,
-        BluetoothDaemonPDU& aPDU);
+        DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothAvrcpElementAttribute& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothAvrcpElementAttribute& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothAvrcpEvent aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothAvrcpEvent aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothAvrcpEventParamPair& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothAvrcpEventParamPair& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothAvrcpNotification aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothAvrcpNotification aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothAvrcpPlayerAttribute aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothAvrcpPlayerAttribute aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothAvrcpStatus aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothAvrcpStatus aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothConfigurationParameter& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothConfigurationParameter& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothDaemonPDUHeader& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const DaemonSocketPDUHeader& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeAtResponse& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeAtResponse& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallAddressType& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeCallAddressType& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallDirection& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeCallDirection& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallMode& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeCallMode& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallMptyType& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeCallMptyType& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeCallState& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeCallState& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeNetworkState& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeNetworkState& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeServiceType& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeServiceType& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeVolumeType& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeVolumeType& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothHandsfreeWbsConfig& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothHandsfreeWbsConfig& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothNamedValue& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothNamedValue& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothPinCode& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothPinCode& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothPropertyType aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothPropertyType aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothServiceName& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothServiceName& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothSocketType aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothSocketType aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothSspVariant aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothSspVariant aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothScanMode aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(ControlPlayStatus aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothUuid& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothUuid& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothGattId& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothGattId& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(const BluetoothGattServiceId& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const BluetoothGattServiceId& aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothGattAuthReq aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothGattAuthReq aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothGattWriteType aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothGattWriteType aIn, DaemonSocketPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothTransport aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(BluetoothTransport aIn, DaemonSocketPDU& aPDU);
 
 /* |PackConversion| is a helper for packing converted values. Pass
  * an instance of this structure to |PackPDU| to convert a value from
  * the input type to the output type and and write it to the PDU.
  */
 template<typename Tin, typename Tout>
 struct PackConversion {
   PackConversion(const Tin& aIn)
   : mIn(aIn)
   { }
 
   const Tin& mIn;
 };
 
 template<typename Tin, typename Tout>
 inline nsresult
-PackPDU(const PackConversion<Tin, Tout>& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const PackConversion<Tin, Tout>& aIn, DaemonSocketPDU& aPDU)
 {
   Tout out;
 
   nsresult rv = Convert(aIn.mIn, out);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(out, aPDU);
@@ -524,38 +524,38 @@ struct PackArray
   size_t mLength;
 };
 
 /* This implementation of |PackPDU| packs the length of an array
  * and the elements of the array one-by-one.
  */
 template<typename T>
 inline nsresult
-PackPDU(const PackArray<T>& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const PackArray<T>& aIn, DaemonSocketPDU& aPDU)
 {
   for (size_t i = 0; i < aIn.mLength; ++i) {
     nsresult rv = PackPDU(aIn.mData[i], aPDU);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 template<>
 inline nsresult
-PackPDU<uint8_t>(const PackArray<uint8_t>& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU<uint8_t>(const PackArray<uint8_t>& aIn, DaemonSocketPDU& aPDU)
 {
   /* Write raw bytes in one pass */
   return aPDU.Write(aIn.mData, aIn.mLength);
 }
 
 template<>
 inline nsresult
-PackPDU<char>(const PackArray<char>& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU<char>(const PackArray<char>& aIn, DaemonSocketPDU& aPDU)
 {
   /* Write raw bytes in one pass */
   return aPDU.Write(aIn.mData, aIn.mLength);
 }
 
 /* |PackCString0| is a helper for packing 0-terminated C string,
  * including the \0 character. Pass an instance of this structure
  * as the first argument to |PackPDU| to pack a string.
@@ -567,17 +567,17 @@ struct PackCString0
   { }
 
   const nsCString& mString;
 };
 
 /* This implementation of |PackPDU| packs a 0-terminated C string.
  */
 inline nsresult
-PackPDU(const PackCString0& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const PackCString0& aIn, DaemonSocketPDU& aPDU)
 {
   return PackPDU(
     PackArray<uint8_t>(reinterpret_cast<const uint8_t*>(aIn.mString.get()),
                        aIn.mString.Length() + 1), aPDU);
 }
 
 /* |PackReversed| is a helper for packing data in reversed order. Pass an
  * instance of this structure as the first argument to |PackPDU| to pack data
@@ -593,79 +593,79 @@ struct PackReversed
   const T& mValue;
 };
 
 /* No general rules to pack data in reversed order. Signal a link error if the
  * type |T| of |PackReversed| is not defined explicitly.
  */
 template<typename T>
 nsresult
-PackPDU(const PackReversed<T>& aIn, BluetoothDaemonPDU& aPDU);
+PackPDU(const PackReversed<T>& aIn, DaemonSocketPDU& aPDU);
 
 /* This implementation of |PackPDU| packs elements in |PackArray| in reversed
  * order. (ex. reversed GATT UUID, see bug 1171866)
  */
 template<typename U>
 inline nsresult
-PackPDU(const PackReversed<PackArray<U>>& aIn, BluetoothDaemonPDU& aPDU)
+PackPDU(const PackReversed<PackArray<U>>& aIn, DaemonSocketPDU& aPDU)
 {
   for (size_t i = 0; i < aIn.mValue.mLength; ++i) {
     nsresult rv = PackPDU(aIn.mValue.mData[aIn.mValue.mLength - i - 1], aPDU);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 /* This implementation of |PackPDU| packs |BluetoothUuid| in reversed order.
  * (ex. reversed GATT UUID, see bug 1171866)
  */
 template <>
 inline nsresult
 PackPDU<BluetoothUuid>(const PackReversed<BluetoothUuid>& aIn,
-                       BluetoothDaemonPDU& aPDU)
+                       DaemonSocketPDU& aPDU)
 {
  return PackPDU(
    PackReversed<PackArray<uint8_t>>(
      PackArray<uint8_t>(aIn.mValue.mUuid, sizeof(aIn.mValue.mUuid))),
    aPDU);
 }
 
 template <typename T1, typename T2>
 inline nsresult
-PackPDU(const T1& aIn1, const T2& aIn2, BluetoothDaemonPDU& aPDU)
+PackPDU(const T1& aIn1, const T2& aIn2, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(aIn2, aPDU);
 }
 
 template <typename T1, typename T2, typename T3>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3,
-        BluetoothDaemonPDU& aPDU)
+        DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(aIn3, aPDU);
 }
 
 template <typename T1, typename T2, typename T3, typename T4>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3, const T4& aIn4,
-        BluetoothDaemonPDU& aPDU)
+        DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -677,17 +677,17 @@ PackPDU(const T1& aIn1, const T2& aIn2, 
   return PackPDU(aIn4, aPDU);
 }
 
 template <typename T1, typename T2, typename T3,
           typename T4, typename T5>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3,
         const T4& aIn4, const T5& aIn5,
-        BluetoothDaemonPDU& aPDU)
+        DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -704,17 +704,17 @@ PackPDU(const T1& aIn1, const T2& aIn2, 
 }
 
 template <typename T1, typename T2, typename T3,
           typename T4, typename T5, typename T6,
           typename T7>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3,
         const T4& aIn4, const T5& aIn5, const T6& aIn6,
-        const T7& aIn7, BluetoothDaemonPDU& aPDU)
+        const T7& aIn7, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -739,17 +739,17 @@ PackPDU(const T1& aIn1, const T2& aIn2, 
 }
 
 template <typename T1, typename T2, typename T3,
           typename T4, typename T5, typename T6,
           typename T7, typename T8>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3,
         const T4& aIn4, const T5& aIn5, const T6& aIn6,
-        const T7& aIn7, const T8& aIn8, BluetoothDaemonPDU& aPDU)
+        const T7& aIn7, const T8& aIn8, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -782,17 +782,17 @@ template <typename T1, typename T2, type
           typename T7, typename T8, typename T9,
           typename T10, typename T11, typename T12,
           typename T13>
 inline nsresult
 PackPDU(const T1& aIn1, const T2& aIn2, const T3& aIn3,
         const T4& aIn4, const T5& aIn5, const T6& aIn6,
         const T7& aIn7, const T8& aIn8, const T9& aIn9,
         const T10& aIn10, const T11& aIn11, const T12& aIn12,
-        const T13& aIn13, BluetoothDaemonPDU& aPDU)
+        const T13& aIn13, DaemonSocketPDU& aPDU)
 {
   nsresult rv = PackPDU(aIn1, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = PackPDU(aIn2, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -842,193 +842,193 @@ PackPDU(const T1& aIn1, const T2& aIn2, 
 
 //
 // Unpacking
 //
 
 // introduce link errors on non-handled data types
 template <typename T>
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, T& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, T& aOut);
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, int8_t& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, int8_t& aOut)
 {
   return aPDU.Read(aOut);
 }
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, uint8_t& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, uint8_t& aOut)
 {
   return aPDU.Read(aOut);
 }
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, uint16_t& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, uint16_t& aOut)
 {
   return aPDU.Read(aOut);
 }
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, int32_t& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, int32_t& aOut)
 {
   return aPDU.Read(aOut);
 }
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, uint32_t& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, uint32_t& aOut)
 {
   return aPDU.Read(aOut);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, bool& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, bool& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, char& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, char& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothA2dpAudioState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothA2dpAudioState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothA2dpConnectionState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothA2dpConnectionState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAclState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAclState& aOut);
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAddress& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAddress& aOut)
 {
   return aPDU.Read(aOut.mAddr, sizeof(aOut.mAddr));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpEvent& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpEvent& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothBondState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothBondState& aOut);
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothDaemonPDUHeader& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, DaemonSocketPDUHeader& aOut)
 {
   nsresult rv = UnpackPDU(aPDU, aOut.mService);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = UnpackPDU(aPDU, aOut.mOpcode);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return UnpackPDU(aPDU, aOut.mLength);
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothTypeOfDevice& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothTypeOfDevice& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeAudioState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeAudioState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeCallHoldType& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeConnectionState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeConnectionState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeNRECState& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeNRECState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU,
+UnpackPDU(DaemonSocketPDU& aPDU,
           BluetoothHandsfreeVoiceRecognitionState& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothHandsfreeVolumeType& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothHandsfreeVolumeType& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothRemoteInfo& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothRemoteInfo& aOut);
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothRemoteName& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothRemoteName& aOut)
 {
   return aPDU.Read(aOut.mName, sizeof(aOut.mName));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothProperty& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothProperty& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothPropertyType& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothPropertyType& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothScanMode& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothScanMode& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothServiceRecord& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothServiceRecord& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothSspVariant& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothSspVariant& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothStatus& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothStatus& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattStatus& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattStatus& aOut);
 
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothUuid& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothUuid& aOut)
 {
   return aPDU.Read(aOut.mUuid, sizeof(aOut.mUuid));
 }
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattId& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattId& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattServiceId& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattServiceId& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattReadParam& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattReadParam& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattWriteParam& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattWriteParam& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothGattNotifyParam& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, BluetoothGattNotifyParam& aOut);
 
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, nsDependentCString& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, nsDependentCString& aOut);
 
 /* |UnpackConversion| is a helper for convering unpacked values. Pass
  * an instance of this structure to |UnpackPDU| to read a value from
  * the PDU in the input type and convert it to the output type.
  */
 template<typename Tin, typename Tout>
 struct UnpackConversion {
   UnpackConversion(Tout& aOut)
   : mOut(aOut)
   { }
 
   Tout& mOut;
 };
 
 template<typename Tin, typename Tout>
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackConversion<Tin, Tout>& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackConversion<Tin, Tout>& aOut)
 {
   Tin in;
   nsresult rv = UnpackPDU(aPDU, in);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return Convert(in, aOut.mOut);
 }
@@ -1062,51 +1062,51 @@ struct UnpackArray
   }
 
   T* mData;
   size_t mLength;
 };
 
 template<typename T>
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackArray<T>& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackArray<T>& aOut)
 {
   for (size_t i = 0; i < aOut.mLength; ++i) {
     nsresult rv = UnpackPDU(aPDU, aOut.mData[i]);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 template<typename T>
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, UnpackArray<T>& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, UnpackArray<T>& aOut)
 {
   for (size_t i = 0; i < aOut.mLength; ++i) {
     nsresult rv = UnpackPDU(aPDU, aOut.mData[i]);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 template<>
 inline nsresult
-UnpackPDU<uint8_t>(BluetoothDaemonPDU& aPDU, const UnpackArray<uint8_t>& aOut)
+UnpackPDU<uint8_t>(DaemonSocketPDU& aPDU, const UnpackArray<uint8_t>& aOut)
 {
   /* Read raw bytes in one pass */
   return aPDU.Read(aOut.mData, aOut.mLength);
 }
 
 template<typename T>
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, nsTArray<T>& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, nsTArray<T>& aOut)
 {
   for (typename nsTArray<T>::size_type i = 0; i < aOut.Length(); ++i) {
     nsresult rv = UnpackPDU(aPDU, aOut[i]);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
@@ -1123,17 +1123,17 @@ struct UnpackCString0
   { }
 
   nsCString* mString; // non-null by construction
 };
 
 /* This implementation of |UnpackPDU| unpacks a 0-terminated C string.
  */
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackCString0& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackCString0& aOut);
 
 /* |UnpackString0| is a helper for unpacking 0-terminated C string,
  * including the \0 character. Pass an instance of this structure
  * as the first argument to |UnpackPDU| to unpack a C string and convert
  * it to wide-character encoding.
  */
 struct UnpackString0
 {
@@ -1143,17 +1143,17 @@ struct UnpackString0
 
   nsString* mString; // non-null by construction
 };
 
 /* This implementation of |UnpackPDU| unpacks a 0-terminated C string
  * and converts it to wide-character encoding.
  */
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackString0& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackString0& aOut);
 
 /* |UnpackReversed| is a helper for unpacking data in reversed order. Pass an
  * instance of this structure as the second argument to |UnpackPDU| to unpack
  * data in reversed order.
  */
 template<typename T>
 struct UnpackReversed
 {
@@ -1168,59 +1168,59 @@ struct UnpackReversed
   T* mValue;
 };
 
 /* No general rules to unpack data in reversed order. Signal a link error if
  * the type |T| of |UnpackReversed| is not defined explicitly.
  */
 template<typename T>
 nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackReversed<T>& aOut);
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackReversed<T>& aOut);
 
 template<typename U>
 inline nsresult
-UnpackPDU(BluetoothDaemonPDU& aPDU, const UnpackReversed<UnpackArray<U>>& aOut)
+UnpackPDU(DaemonSocketPDU& aPDU, const UnpackReversed<UnpackArray<U>>& aOut)
 {
   for (size_t i = 0; i < aOut.mValue->mLength; ++i) {
     nsresult rv = UnpackPDU(aPDU,
                             aOut.mValue->mData[aOut.mValue->mLength - i - 1]);
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
   return NS_OK;
 }
 
 /* This implementation of |UnpackPDU| unpacks |BluetoothUuid| in reversed
  * order. (ex. reversed GATT UUID, see bug 1171866)
  */
 template<>
 inline nsresult
-UnpackPDU<BluetoothUuid>(BluetoothDaemonPDU& aPDU,
+UnpackPDU<BluetoothUuid>(DaemonSocketPDU& aPDU,
                          const UnpackReversed<BluetoothUuid>& aOut)
 {
   return UnpackPDU(
     aPDU,
     UnpackReversed<UnpackArray<uint8_t>>(
       UnpackArray<uint8_t>(aOut.mValue->mUuid, sizeof(aOut.mValue->mUuid))));
 }
 
 //
 // Init operators
 //
 
 // |PDUInitOP| provides functionality for init operators that unpack PDUs.
 class PDUInitOp
 {
 protected:
-  PDUInitOp(BluetoothDaemonPDU& aPDU)
+  PDUInitOp(DaemonSocketPDU& aPDU)
   : mPDU(&aPDU)
   { }
 
-  BluetoothDaemonPDU& GetPDU() const
+  DaemonSocketPDU& GetPDU() const
   {
     return *mPDU; // cannot be nullptr
   }
 
   void WarnAboutTrailingData() const
   {
     size_t size = mPDU->GetSize();
 
@@ -1232,27 +1232,27 @@ protected:
     uint16_t payloadSize;
     mPDU->GetHeader(service, opcode, payloadSize);
 
     BT_LOGR("Unpacked PDU of type (%x,%x) still contains %zu Bytes of data.",
             service, opcode, size);
   }
 
 private:
-  BluetoothDaemonPDU* mPDU; // Hold pointer to allow for constant instances
+  DaemonSocketPDU* mPDU; // Hold pointer to allow for constant instances
 };
 
 // |UnpackPDUInitOp| is a general-purpose init operator for all variants
 // of |BluetoothResultRunnable| and |BluetoothNotificationRunnable|. The
 // call operators of |UnpackPDUInitOp| unpack a PDU into the supplied
 // arguments.
 class UnpackPDUInitOp final : private PDUInitOp
 {
 public:
-  UnpackPDUInitOp(BluetoothDaemonPDU& aPDU)
+  UnpackPDUInitOp(DaemonSocketPDU& aPDU)
   : PDUInitOp(aPDU)
   { }
 
   nsresult operator () () const
   {
     WarnAboutTrailingData();
     return NS_OK;
   }
@@ -1266,34 +1266,34 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 
   template<typename T1, typename T2>
   nsresult operator () (T1& aArg1, T2& aArg2) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = UnpackPDU(pdu, aArg2);
     if (NS_FAILED(rv)) {
       return rv;
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 
   template<typename T1, typename T2, typename T3>
   nsresult operator () (T1& aArg1, T2& aArg2, T3& aArg3) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = UnpackPDU(pdu, aArg2);
     if (NS_FAILED(rv)) {
       return rv;
@@ -1304,17 +1304,17 @@ public:
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 
   template<typename T1, typename T2, typename T3, typename T4>
   nsresult operator () (T1& aArg1, T2& aArg2, T3& aArg3, T4& aArg4) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = UnpackPDU(pdu, aArg2);
     if (NS_FAILED(rv)) {
       return rv;
@@ -1330,17 +1330,17 @@ public:
     WarnAboutTrailingData();
     return NS_OK;
   }
 
   template<typename T1, typename T2, typename T3, typename T4, typename T5>
   nsresult operator () (T1& aArg1, T2& aArg2, T3& aArg3, T4& aArg4,
                         T5& aArg5) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = UnpackPDU(pdu, aArg2);
     if (NS_FAILED(rv)) {
       return rv;
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -29,28 +29,28 @@ static const int sRetryInterval = 100; /
 
 //
 // Protocol initialization and setup
 //
 
 class BluetoothDaemonSetupModule
 {
 public:
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   // Commands
   //
 
   nsresult RegisterModuleCmd(uint8_t aId, uint8_t aMode,
                              uint32_t aMaxNumClients,
                              BluetoothSetupResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x00, 0x01, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x00, 0x01, 0));
 
 #if ANDROID_VERSION >= 21
     nsresult rv = PackPDU(aId, aMode, aMaxNumClients, *pdu);
 #else
     nsresult rv = PackPDU(aId, aMode, *pdu);
 #endif
     if (NS_FAILED(rv)) {
       return rv;
@@ -63,17 +63,17 @@ public:
     return rv;
   }
 
   nsresult UnregisterModuleCmd(uint8_t aId,
                                BluetoothSetupResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x00, 0x02, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x00, 0x02, 0));
 
     nsresult rv = PackPDU(aId, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
@@ -82,17 +82,17 @@ public:
     return rv;
   }
 
   nsresult ConfigurationCmd(const BluetoothConfigurationParameter* aParam,
                             uint8_t aLen, BluetoothSetupResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x00, 0x03, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x00, 0x03, 0));
 
     nsresult rv = PackPDU(
       aLen, PackArray<BluetoothConfigurationParameter>(aParam, aLen), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -101,22 +101,22 @@ public:
     unused << pdu.forget();
     return rv;
   }
 
 protected:
 
   // Called to handle PDUs with Service field equal to 0x00, which
   // contains internal operations for setup and configuration.
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData)
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData)
   {
     static void (BluetoothDaemonSetupModule::* const HandleRsp[])(
-      const BluetoothDaemonPDUHeader&,
-      BluetoothDaemonPDU&,
+      const DaemonSocketPDUHeader&,
+      DaemonSocketPDU&,
       BluetoothSetupResultHandler*) = {
       INIT_ARRAY_AT(0x00, &BluetoothDaemonSetupModule::ErrorRsp),
       INIT_ARRAY_AT(0x01, &BluetoothDaemonSetupModule::RegisterModuleRsp),
       INIT_ARRAY_AT(0x02, &BluetoothDaemonSetupModule::UnregisterModuleRsp),
       INIT_ARRAY_AT(0x03, &BluetoothDaemonSetupModule::ConfigurationRsp)
     };
 
     if (NS_WARN_IF(aHeader.mOpcode >= MOZ_ARRAY_LENGTH(HandleRsp)) ||
@@ -130,17 +130,17 @@ protected:
 
     if (!res) {
       return; // Return early if no result handler has been set
     }
 
     (this->*(HandleRsp[aHeader.mOpcode]))(aHeader, aPDU, res);
   }
 
-  nsresult Send(BluetoothDaemonPDU* aPDU, BluetoothSetupResultHandler* aRes)
+  nsresult Send(DaemonSocketPDU* aPDU, BluetoothSetupResultHandler* aRes)
   {
     aRes->AddRef(); // Keep reference for response
     return Send(aPDU, static_cast<void*>(aRes));
   }
 
 private:
 
   // Responses
@@ -149,47 +149,47 @@ private:
   typedef BluetoothResultRunnable0<BluetoothSetupResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothSetupResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   void
-  ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-           BluetoothDaemonPDU& aPDU,
+  ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+           DaemonSocketPDU& aPDU,
            BluetoothSetupResultHandler* aRes)
   {
     ErrorRunnable::Dispatch(
       aRes, &BluetoothSetupResultHandler::OnError, UnpackPDUInitOp(aPDU));
   }
 
   void
-  RegisterModuleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                    BluetoothDaemonPDU& aPDU,
+  RegisterModuleRsp(const DaemonSocketPDUHeader& aHeader,
+                    DaemonSocketPDU& aPDU,
                     BluetoothSetupResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothSetupResultHandler::RegisterModule,
       UnpackPDUInitOp(aPDU));
   }
 
   void
-  UnregisterModuleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU,
+  UnregisterModuleRsp(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU,
                       BluetoothSetupResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothSetupResultHandler::UnregisterModule,
       UnpackPDUInitOp(aPDU));
   }
 
   void
-  ConfigurationRsp(const BluetoothDaemonPDUHeader& aHeader,
-                   BluetoothDaemonPDU& aPDU,
+  ConfigurationRsp(const DaemonSocketPDUHeader& aHeader,
+                   DaemonSocketPDU& aPDU,
                    BluetoothSetupResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothSetupResultHandler::Configuration,
       UnpackPDUInitOp(aPDU));
   }
 };
 
@@ -200,66 +200,66 @@ private:
 static BluetoothNotificationHandler* sNotificationHandler;
 
 class BluetoothDaemonCoreModule
 {
 public:
 
   static const int MAX_NUM_CLIENTS;
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   nsresult EnableCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x01, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x01, 0));
 
     nsresult rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
   nsresult DisableCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x02, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x02, 0));
 
     nsresult rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
   nsresult GetAdapterPropertiesCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x03, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x03, 0));
 
     nsresult rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
   nsresult GetAdapterPropertyCmd(const nsAString& aName,
                                  BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x04, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x04, 0));
 
     nsresult rv = PackPDU(
       PackConversion<const nsAString, BluetoothPropertyType>(aName), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -269,17 +269,17 @@ public:
     return rv;
   }
 
   nsresult SetAdapterPropertyCmd(const BluetoothNamedValue& aProperty,
                                  BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x05, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x05, 0));
 
     nsresult rv = PackPDU(aProperty, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
@@ -288,17 +288,17 @@ public:
     return rv;
   }
 
   nsresult GetRemoteDevicePropertiesCmd(const nsAString& aRemoteAddr,
                                         BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x06, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x06, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -309,17 +309,17 @@ public:
   }
 
   nsresult GetRemoteDevicePropertyCmd(const nsAString& aRemoteAddr,
                                       const nsAString& aName,
                                       BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x07, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x07, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aRemoteAddr),
       PackConversion<nsAString, BluetoothPropertyType>(aName), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
@@ -331,17 +331,17 @@ public:
   }
 
   nsresult SetRemoteDevicePropertyCmd(const nsAString& aRemoteAddr,
                                       const BluetoothNamedValue& aProperty,
                                       BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x08, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x08, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aRemoteAddr),
       aProperty, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
@@ -353,17 +353,17 @@ public:
   }
 
   nsresult GetRemoteServiceRecordCmd(const nsAString& aRemoteAddr,
                                      const uint8_t aUuid[16],
                                      BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x09, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x09, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aRemoteAddr),
       PackArray<uint8_t>(aUuid, 16), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
@@ -374,17 +374,17 @@ public:
     return rv;
   }
 
   nsresult GetRemoteServicesCmd(const nsAString& aRemoteAddr,
                                 BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0a, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0a, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -393,47 +393,47 @@ public:
     unused << pdu.forget();
     return rv;
   }
 
   nsresult StartDiscoveryCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0b, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0b, 0));
 
     nsresult rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
   nsresult CancelDiscoveryCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0c, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0c, 0));
 
     nsresult rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
   nsresult CreateBondCmd(const nsAString& aBdAddr,
                          BluetoothTransport aTransport,
                          BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0d, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0d, 0));
 
 #if ANDROID_VERSION >= 21
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr), aTransport, *pdu);
 #else
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr), *pdu);
 #endif
@@ -448,17 +448,17 @@ public:
     return rv;
   }
 
   nsresult RemoveBondCmd(const nsAString& aBdAddr,
                          BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0e, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0e, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -468,17 +468,17 @@ public:
     return rv;
   }
 
   nsresult CancelBondCmd(const nsAString& aBdAddr,
                          BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x0f, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x0f, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -489,17 +489,17 @@ public:
   }
 
   nsresult PinReplyCmd(const nsAString& aBdAddr, bool aAccept,
                        const nsAString& aPinCode,
                        BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x10, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x10, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr),
       aAccept,
       PackConversion<nsAString, BluetoothPinCode>(aPinCode), *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -512,17 +512,17 @@ public:
   }
 
   nsresult SspReplyCmd(const nsAString& aBdAddr, BluetoothSspVariant aVariant,
                        bool aAccept, uint32_t aPasskey,
                        BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x11, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x11, 0));
 
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr),
       aVariant, aAccept, aPasskey, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
@@ -532,17 +532,17 @@ public:
     unused << pdu.forget();
     return rv;
   }
 
   nsresult DutModeConfigureCmd(bool aEnable, BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x12, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x12, 0));
 
     nsresult rv = PackPDU(aEnable, *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
@@ -551,17 +551,17 @@ public:
     return rv;
   }
 
   nsresult DutModeSendCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                           BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x13, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x13, 0));
 
     nsresult rv = PackPDU(aOpcode, aLen, PackArray<uint8_t>(aBuf, aLen),
                           *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
@@ -571,48 +571,48 @@ public:
     return rv;
   }
 
   nsresult LeTestModeCmd(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                          BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x14, 0));
+    nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x01, 0x14, 0));
 
     nsresult rv = PackPDU(aOpcode, aLen, PackArray<uint8_t>(aBuf, aLen),
                           *pdu);
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
     return rv;
   }
 
 protected:
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData)
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData)
   {
     static void (BluetoothDaemonCoreModule::* const HandleOp[])(
-      const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+      const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
       INIT_ARRAY_AT(0, &BluetoothDaemonCoreModule::HandleRsp),
       INIT_ARRAY_AT(1, &BluetoothDaemonCoreModule::HandleNtf),
     };
 
     MOZ_ASSERT(!NS_IsMainThread());
 
     (this->*(HandleOp[!!(aHeader.mOpcode & 0x80)]))(aHeader, aPDU, aUserData);
   }
 
-  nsresult Send(BluetoothDaemonPDU* aPDU, BluetoothResultHandler* aRes)
+  nsresult Send(DaemonSocketPDU* aPDU, BluetoothResultHandler* aRes)
   {
     aRes->AddRef(); // Keep reference for response
     return Send(aPDU, static_cast<void*>(aRes));
   }
 
 private:
 
   // Responses
@@ -620,209 +620,209 @@ private:
 
   typedef BluetoothResultRunnable0<BluetoothResultHandler, void>
     ResultRunnable;
 
   typedef BluetoothResultRunnable1<BluetoothResultHandler, void,
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothResultHandler* aRes)
   {
     ErrorRunnable::Dispatch(
       aRes, &BluetoothResultHandler::OnError, UnpackPDUInitOp(aPDU));
   }
 
-  void EnableRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void EnableRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::Enable, UnpackPDUInitOp(aPDU));
   }
 
-  void DisableRsp(const BluetoothDaemonPDUHeader& aHeader,
-                  BluetoothDaemonPDU& aPDU,
+  void DisableRsp(const DaemonSocketPDUHeader& aHeader,
+                  DaemonSocketPDU& aPDU,
                   BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::Disable, UnpackPDUInitOp(aPDU));
   }
 
-  void GetAdapterPropertiesRsp(const BluetoothDaemonPDUHeader& aHeader,
-                               BluetoothDaemonPDU& aPDU,
+  void GetAdapterPropertiesRsp(const DaemonSocketPDUHeader& aHeader,
+                               DaemonSocketPDU& aPDU,
                                BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetAdapterProperties,
       UnpackPDUInitOp(aPDU));
   }
 
-  void GetAdapterPropertyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU,
+  void GetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU,
                              BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetAdapterProperty,
       UnpackPDUInitOp(aPDU));
   }
 
-  void SetAdapterPropertyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU,
+  void SetAdapterPropertyRsp(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU,
                              BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::SetAdapterProperty,
       UnpackPDUInitOp(aPDU));
   }
 
-  void GetRemoteDevicePropertiesRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                    BluetoothDaemonPDU& aPDU,
+  void GetRemoteDevicePropertiesRsp(const DaemonSocketPDUHeader& aHeader,
+                                    DaemonSocketPDU& aPDU,
                                     BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetRemoteDeviceProperties,
       UnpackPDUInitOp(aPDU));
   }
 
   void
-  GetRemoteDevicePropertyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                             BluetoothDaemonPDU& aPDU,
+  GetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
+                             DaemonSocketPDU& aPDU,
                              BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetRemoteDeviceProperty,
       UnpackPDUInitOp(aPDU));
   }
 
-  void SetRemoteDevicePropertyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                  BluetoothDaemonPDU& aPDU,
+  void SetRemoteDevicePropertyRsp(const DaemonSocketPDUHeader& aHeader,
+                                  DaemonSocketPDU& aPDU,
                                   BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::SetRemoteDeviceProperty,
       UnpackPDUInitOp(aPDU));
   }
 
-  void GetRemoteServiceRecordRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                 BluetoothDaemonPDU& aPDU,
+  void GetRemoteServiceRecordRsp(const DaemonSocketPDUHeader& aHeader,
+                                 DaemonSocketPDU& aPDU,
                                  BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetRemoteServiceRecord,
       UnpackPDUInitOp(aPDU));
   }
 
-  void GetRemoteServicesRsp(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU,
+  void GetRemoteServicesRsp(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU,
                             BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::GetRemoteServices,
       UnpackPDUInitOp(aPDU));
   }
 
-  void StartDiscoveryRsp(const BluetoothDaemonPDUHeader& aHeader,
-                         BluetoothDaemonPDU& aPDU,
+  void StartDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
+                         DaemonSocketPDU& aPDU,
                          BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::StartDiscovery,
       UnpackPDUInitOp(aPDU));
   }
 
-  void CancelDiscoveryRsp(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU,
+  void CancelDiscoveryRsp(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU,
                           BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::CancelDiscovery,
       UnpackPDUInitOp(aPDU));
   }
 
-  void CreateBondRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void CreateBondRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::CreateBond,
       UnpackPDUInitOp(aPDU));
   }
 
-  void RemoveBondRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void RemoveBondRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::RemoveBond,
       UnpackPDUInitOp(aPDU));
   }
 
-  void CancelBondRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void CancelBondRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::CancelBond,
       UnpackPDUInitOp(aPDU));
   }
 
-  void PinReplyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                   BluetoothDaemonPDU& aPDU,
+  void PinReplyRsp(const DaemonSocketPDUHeader& aHeader,
+                   DaemonSocketPDU& aPDU,
                    BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::PinReply,
       UnpackPDUInitOp(aPDU));
   }
 
-  void SspReplyRsp(const BluetoothDaemonPDUHeader& aHeader,
-                   BluetoothDaemonPDU& aPDU,
+  void SspReplyRsp(const DaemonSocketPDUHeader& aHeader,
+                   DaemonSocketPDU& aPDU,
                    BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::SspReply,
       UnpackPDUInitOp(aPDU));
   }
 
-  void DutModeConfigureRsp(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU,
+  void DutModeConfigureRsp(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU,
                            BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::DutModeConfigure,
       UnpackPDUInitOp(aPDU));
   }
 
-  void DutModeSendRsp(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU,
+  void DutModeSendRsp(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU,
                       BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::DutModeSend,
       UnpackPDUInitOp(aPDU));
   }
 
-  void LeTestModeRsp(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU,
+  void LeTestModeRsp(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU,
                      BluetoothResultHandler* aRes)
   {
     ResultRunnable::Dispatch(
       aRes, &BluetoothResultHandler::LeTestMode,
       UnpackPDUInitOp(aPDU));
   }
 
-  void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData)
+  void HandleRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData)
   {
     static void (BluetoothDaemonCoreModule::* const HandleRsp[])(
-      const BluetoothDaemonPDUHeader&,
-      BluetoothDaemonPDU&,
+      const DaemonSocketPDUHeader&,
+      DaemonSocketPDU&,
       BluetoothResultHandler*) = {
       INIT_ARRAY_AT(0x00, &BluetoothDaemonCoreModule::ErrorRsp),
       INIT_ARRAY_AT(0x01, &BluetoothDaemonCoreModule::EnableRsp),
       INIT_ARRAY_AT(0x02, &BluetoothDaemonCoreModule::DisableRsp),
       INIT_ARRAY_AT(0x03, &BluetoothDaemonCoreModule::GetAdapterPropertiesRsp),
       INIT_ARRAY_AT(0x04, &BluetoothDaemonCoreModule::GetAdapterPropertyRsp),
       INIT_ARRAY_AT(0x05, &BluetoothDaemonCoreModule::SetAdapterPropertyRsp),
       INIT_ARRAY_AT(0x06,
@@ -934,37 +934,37 @@ private:
                                          uint16_t, nsAutoArrayPtr<uint8_t>,
                                          uint8_t, uint16_t, const uint8_t*>
     DutModeRecvNotification;
 
   typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
                                          BluetoothStatus, uint16_t>
     LeTestModeNotification;
 
-  void AdapterStateChangedNtf(const BluetoothDaemonPDUHeader& aHeader,
-                              BluetoothDaemonPDU& aPDU)
+  void AdapterStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
+                              DaemonSocketPDU& aPDU)
   {
     AdapterStateChangedNotification::Dispatch(
       &BluetoothNotificationHandler::AdapterStateChangedNotification,
       UnpackPDUInitOp(aPDU));
   }
 
   // Init operator class for AdapterPropertiesNotification
   class AdapterPropertiesInitOp final : private PDUInitOp
   {
   public:
-    AdapterPropertiesInitOp(BluetoothDaemonPDU& aPDU)
+    AdapterPropertiesInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (BluetoothStatus& aArg1, int& aArg2,
                  nsAutoArrayPtr<BluetoothProperty>& aArg3) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read status */
       nsresult rv = UnpackPDU(pdu, aArg1);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read number of properties */
@@ -981,37 +981,37 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void AdapterPropertiesNtf(const BluetoothDaemonPDUHeader& aHeader,
-                            BluetoothDaemonPDU& aPDU)
+  void AdapterPropertiesNtf(const DaemonSocketPDUHeader& aHeader,
+                            DaemonSocketPDU& aPDU)
   {
     AdapterPropertiesNotification::Dispatch(
       &BluetoothNotificationHandler::AdapterPropertiesNotification,
       AdapterPropertiesInitOp(aPDU));
   }
 
   // Init operator class for RemoteDevicePropertiesNotification
   class RemoteDevicePropertiesInitOp final : private PDUInitOp
   {
   public:
-    RemoteDevicePropertiesInitOp(BluetoothDaemonPDU& aPDU)
+    RemoteDevicePropertiesInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (BluetoothStatus& aArg1, nsString& aArg2, int& aArg3,
                  nsAutoArrayPtr<BluetoothProperty>& aArg4) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read status */
       nsresult rv = UnpackPDU(pdu, aArg1);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read address */
@@ -1035,36 +1035,36 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void RemoteDevicePropertiesNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                 BluetoothDaemonPDU& aPDU)
+  void RemoteDevicePropertiesNtf(const DaemonSocketPDUHeader& aHeader,
+                                 DaemonSocketPDU& aPDU)
   {
     RemoteDevicePropertiesNotification::Dispatch(
       &BluetoothNotificationHandler::RemoteDevicePropertiesNotification,
       RemoteDevicePropertiesInitOp(aPDU));
   }
 
   // Init operator class for DeviceFoundNotification
   class DeviceFoundInitOp final : private PDUInitOp
   {
   public:
-    DeviceFoundInitOp(BluetoothDaemonPDU& aPDU)
+    DeviceFoundInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (int& aArg1, nsAutoArrayPtr<BluetoothProperty>& aArg2) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read number of properties */
       uint8_t numProperties;
       nsresult rv = UnpackPDU(pdu, numProperties);
       if (NS_FAILED(rv)) {
         return rv;
       }
       aArg1 = numProperties;
@@ -1075,44 +1075,44 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void DeviceFoundNtf(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU)
+  void DeviceFoundNtf(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU)
   {
     DeviceFoundNotification::Dispatch(
       &BluetoothNotificationHandler::DeviceFoundNotification,
       DeviceFoundInitOp(aPDU));
   }
 
-  void DiscoveryStateChangedNtf(const BluetoothDaemonPDUHeader& aHeader,
-                                BluetoothDaemonPDU& aPDU)
+  void DiscoveryStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
+                                DaemonSocketPDU& aPDU)
   {
     DiscoveryStateChangedNotification::Dispatch(
       &BluetoothNotificationHandler::DiscoveryStateChangedNotification,
       UnpackPDUInitOp(aPDU));
   }
 
   // Init operator class for PinRequestNotification
   class PinRequestInitOp final : private PDUInitOp
   {
   public:
-    PinRequestInitOp(BluetoothDaemonPDU& aPDU)
+    PinRequestInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (nsString& aArg1, nsString& aArg2, uint32_t& aArg3) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read remote address */
       nsresult rv = UnpackPDU(
         pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
       if (NS_FAILED(rv)) {
         return rv;
       }
 
@@ -1128,37 +1128,37 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void PinRequestNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU)
+  void PinRequestNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU)
   {
     PinRequestNotification::Dispatch(
       &BluetoothNotificationHandler::PinRequestNotification,
       PinRequestInitOp(aPDU));
   }
 
   // Init operator class for SspRequestNotification
   class SspRequestInitOp final : private PDUInitOp
   {
   public:
-    SspRequestInitOp(BluetoothDaemonPDU& aPDU)
+    SspRequestInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (nsString& aArg1, nsString& aArg2, uint32_t& aArg3,
                  BluetoothSspVariant& aArg4, uint32_t& aArg5) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read remote address */
       nsresult rv = UnpackPDU(
         pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
       if (NS_FAILED(rv)) {
         return rv;
       }
 
@@ -1186,37 +1186,37 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void SspRequestNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU)
+  void SspRequestNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU)
   {
     SspRequestNotification::Dispatch(
       &BluetoothNotificationHandler::SspRequestNotification,
       SspRequestInitOp(aPDU));
   }
 
   // Init operator class for BondStateChangedNotification
   class BondStateChangedInitOp final : private PDUInitOp
   {
   public:
-    BondStateChangedInitOp(BluetoothDaemonPDU& aPDU)
+    BondStateChangedInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (BluetoothStatus& aArg1, nsString& aArg2,
                  BluetoothBondState& aArg3) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read status */
       nsresult rv = UnpackPDU(pdu, aArg1);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read remote address */
@@ -1231,36 +1231,36 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void BondStateChangedNtf(const BluetoothDaemonPDUHeader& aHeader,
-                           BluetoothDaemonPDU& aPDU)
+  void BondStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
+                           DaemonSocketPDU& aPDU)
   {
     BondStateChangedNotification::Dispatch(
       &BluetoothNotificationHandler::BondStateChangedNotification,
       BondStateChangedInitOp(aPDU));
   }
 
   // Init operator class for AclStateChangedNotification
   class AclStateChangedInitOp final : private PDUInitOp
   {
   public:
-    AclStateChangedInitOp(BluetoothDaemonPDU& aPDU)
+    AclStateChangedInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (BluetoothStatus& aArg1, nsString& aArg2, bool& aArg3) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read status */
       nsresult rv = UnpackPDU(pdu, aArg1);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read remote address */
@@ -1276,37 +1276,37 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void AclStateChangedNtf(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU)
+  void AclStateChangedNtf(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU)
   {
     AclStateChangedNotification::Dispatch(
       &BluetoothNotificationHandler::AclStateChangedNotification,
       AclStateChangedInitOp(aPDU));
   }
 
   // Init operator class for DutModeRecvNotification
   class DutModeRecvInitOp final : private PDUInitOp
   {
   public:
-    DutModeRecvInitOp(BluetoothDaemonPDU& aPDU)
+    DutModeRecvInitOp(DaemonSocketPDU& aPDU)
     : PDUInitOp(aPDU)
     { }
 
     nsresult
     operator () (uint16_t& aArg1, nsAutoArrayPtr<uint8_t>& aArg2,
                  uint8_t& aArg3) const
     {
-      BluetoothDaemonPDU& pdu = GetPDU();
+      DaemonSocketPDU& pdu = GetPDU();
 
       /* Read opcode */
       nsresult rv = UnpackPDU(pdu, aArg1);
       if (NS_FAILED(rv)) {
         return rv;
       }
 
       /* Read length */
@@ -1320,37 +1320,37 @@ private:
       if (NS_FAILED(rv)) {
         return rv;
       }
       WarnAboutTrailingData();
       return NS_OK;
     }
   };
 
-  void DutModeRecvNtf(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU)
+  void DutModeRecvNtf(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU)
   {
     DutModeRecvNotification::Dispatch(
       &BluetoothNotificationHandler::DutModeRecvNotification,
       DutModeRecvInitOp(aPDU));
   }
 
-  void LeTestModeNtf(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU)
+  void LeTestModeNtf(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU)
   {
     LeTestModeNotification::Dispatch(
       &BluetoothNotificationHandler::LeTestModeNotification,
       UnpackPDUInitOp(aPDU));
   }
 
-  void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData)
+  void HandleNtf(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData)
   {
     static void (BluetoothDaemonCoreModule::* const HandleNtf[])(
-      const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+      const DaemonSocketPDUHeader&, DaemonSocketPDU&) = {
       INIT_ARRAY_AT(0, &BluetoothDaemonCoreModule::AdapterStateChangedNtf),
       INIT_ARRAY_AT(1, &BluetoothDaemonCoreModule::AdapterPropertiesNtf),
       INIT_ARRAY_AT(2, &BluetoothDaemonCoreModule::RemoteDevicePropertiesNtf),
       INIT_ARRAY_AT(3, &BluetoothDaemonCoreModule::DeviceFoundNtf),
       INIT_ARRAY_AT(4, &BluetoothDaemonCoreModule::DiscoveryStateChangedNtf),
       INIT_ARRAY_AT(5, &BluetoothDaemonCoreModule::PinRequestNtf),
       INIT_ARRAY_AT(6, &BluetoothDaemonCoreModule::SspRequestNtf),
       INIT_ARRAY_AT(7, &BluetoothDaemonCoreModule::BondStateChangedNtf),
@@ -1445,42 +1445,42 @@ public:
                           BluetoothSetupResultHandler* aRes) override;
 
   nsresult UnregisterModule(uint8_t aId,
                             BluetoothSetupResultHandler* aRes) override;
 
   // Outgoing PDUs
   //
 
-  nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) override;
+  nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) override;
 
-  void StoreUserData(const BluetoothDaemonPDU& aPDU) override;
+  void StoreUserData(const DaemonSocketPDU& aPDU) override;
 
   // Incoming PUDs
   //
 
-  void Handle(BluetoothDaemonPDU& aPDU) override;
+  void Handle(DaemonSocketPDU& aPDU) override;
 
-  void* FetchUserData(const BluetoothDaemonPDUHeader& aHeader);
+  void* FetchUserData(const DaemonSocketPDUHeader& aHeader);
 
 private:
-  void HandleSetupSvc(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleCoreSvc(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleSocketSvc(const BluetoothDaemonPDUHeader& aHeader,
-                       BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleHandsfreeSvc(const BluetoothDaemonPDUHeader& aHeader,
-                          BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleA2dpSvc(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleAvrcpSvc(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU, void* aUserData);
-  void HandleGattSvc(const BluetoothDaemonPDUHeader& aHeader,
-                     BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSetupSvc(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleCoreSvc(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleSocketSvc(const DaemonSocketPDUHeader& aHeader,
+                       DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleHandsfreeSvc(const DaemonSocketPDUHeader& aHeader,
+                          DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleA2dpSvc(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleAvrcpSvc(const DaemonSocketPDUHeader& aHeader,
+                      DaemonSocketPDU& aPDU, void* aUserData);
+  void HandleGattSvc(const DaemonSocketPDUHeader& aHeader,
+                     DaemonSocketPDU& aPDU, void* aUserData);
 
   BluetoothDaemonConnection* mConnection;
   nsTArray<void*> mUserDataQ;
 };
 
 BluetoothDaemonProtocol::BluetoothDaemonProtocol()
 { }
 
@@ -1502,17 +1502,17 @@ BluetoothDaemonProtocol::RegisterModule(
 nsresult
 BluetoothDaemonProtocol::UnregisterModule(uint8_t aId,
                                           BluetoothSetupResultHandler* aRes)
 {
   return BluetoothDaemonSetupModule::UnregisterModuleCmd(aId, aRes);
 }
 
 nsresult
-BluetoothDaemonProtocol::Send(BluetoothDaemonPDU* aPDU, void* aUserData)
+BluetoothDaemonProtocol::Send(DaemonSocketPDU* aPDU, void* aUserData)
 {
   MOZ_ASSERT(mConnection);
   MOZ_ASSERT(aPDU);
 
   aPDU->SetConsumer(this);
   aPDU->SetUserData(aUserData);
   aPDU->UpdateHeader();
 
@@ -1523,112 +1523,112 @@ BluetoothDaemonProtocol::Send(BluetoothD
 
   mConnection->SendSocketData(aPDU); // Forward PDU to command channel
 
   return NS_OK;
 }
 
 void
 BluetoothDaemonProtocol::HandleSetupSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonSetupModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleCoreSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonCoreModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleSocketSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonSocketModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleHandsfreeSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonHandsfreeModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleA2dpSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonA2dpModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleAvrcpSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonAvrcpModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
 BluetoothDaemonProtocol::HandleGattSvc(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+  const DaemonSocketPDUHeader& aHeader, DaemonSocketPDU& aPDU,
   void* aUserData)
 {
   BluetoothDaemonGattModule::HandleSvc(aHeader, aPDU, aUserData);
 }
 
 void
-BluetoothDaemonProtocol::Handle(BluetoothDaemonPDU& aPDU)
+BluetoothDaemonProtocol::Handle(DaemonSocketPDU& aPDU)
 {
   static void (BluetoothDaemonProtocol::* const HandleSvc[])(
-    const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+    const DaemonSocketPDUHeader&, DaemonSocketPDU&, void*) = {
     INIT_ARRAY_AT(0x00, &BluetoothDaemonProtocol::HandleSetupSvc),
     INIT_ARRAY_AT(0x01, &BluetoothDaemonProtocol::HandleCoreSvc),
     INIT_ARRAY_AT(0x02, &BluetoothDaemonProtocol::HandleSocketSvc),
     INIT_ARRAY_AT(0x03, nullptr), // HID host
     INIT_ARRAY_AT(0x04, nullptr), // PAN
     INIT_ARRAY_AT(BluetoothDaemonHandsfreeModule::SERVICE_ID,
       &BluetoothDaemonProtocol::HandleHandsfreeSvc),
     INIT_ARRAY_AT(BluetoothDaemonA2dpModule::SERVICE_ID,
       &BluetoothDaemonProtocol::HandleA2dpSvc),
     INIT_ARRAY_AT(0x07, nullptr), // Health
     INIT_ARRAY_AT(BluetoothDaemonAvrcpModule::SERVICE_ID,
       &BluetoothDaemonProtocol::HandleAvrcpSvc),
     INIT_ARRAY_AT(BluetoothDaemonGattModule::SERVICE_ID,
       &BluetoothDaemonProtocol::HandleGattSvc)
   };
 
-  BluetoothDaemonPDUHeader header;
+  DaemonSocketPDUHeader header;
 
   if (NS_FAILED(UnpackPDU(aPDU, header)) ||
       NS_WARN_IF(!(header.mService < MOZ_ARRAY_LENGTH(HandleSvc))) ||
       NS_WARN_IF(!(HandleSvc[header.mService]))) {
     return;
   }
 
   (this->*(HandleSvc[header.mService]))(header, aPDU, FetchUserData(header));
 }
 
 void
-BluetoothDaemonProtocol::StoreUserData(const BluetoothDaemonPDU& aPDU)
+BluetoothDaemonProtocol::StoreUserData(const DaemonSocketPDU& aPDU)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   mUserDataQ.AppendElement(aPDU.GetUserData());
 }
 
 void*
-BluetoothDaemonProtocol::FetchUserData(const BluetoothDaemonPDUHeader& aHeader)
+BluetoothDaemonProtocol::FetchUserData(const DaemonSocketPDUHeader& aHeader)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   if (aHeader.mOpcode & 0x80) {
     return nullptr; // Ignore notifications
   }
 
   void* userData = mUserDataQ.ElementAt(0);
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
@@ -25,17 +25,17 @@ BluetoothDaemonSocketModule::ListenCmd(B
                                        const nsAString& aServiceName,
                                        const uint8_t aServiceUuid[16],
                                        int aChannel, bool aEncrypt,
                                        bool aAuth,
                                        BluetoothSocketResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x02, 0x01, 0));
+  nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x02, 0x01, 0));
 
   nsresult rv = PackPDU(
     aType,
     PackConversion<nsAString, BluetoothServiceName>(aServiceName),
     PackArray<uint8_t>(aServiceUuid, 16),
     PackConversion<int, int32_t>(aChannel),
     SocketFlags(aEncrypt, aAuth), *pdu);
   if (NS_FAILED(rv)) {
@@ -54,17 +54,17 @@ BluetoothDaemonSocketModule::ConnectCmd(
                                         BluetoothSocketType aType,
                                         const uint8_t aUuid[16],
                                         int aChannel, bool aEncrypt,
                                         bool aAuth,
                                         BluetoothSocketResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x02, 0x02, 0));
+  nsAutoPtr<DaemonSocketPDU> pdu(new DaemonSocketPDU(0x02, 0x02, 0));
 
   nsresult rv = PackPDU(
     PackConversion<nsAString, BluetoothAddress>(aBdAddr),
     aType,
     PackArray<uint8_t>(aUuid, 16),
     PackConversion<int, int32_t>(aChannel),
     SocketFlags(aEncrypt, aAuth), *pdu);
   if (NS_FAILED(rv)) {
@@ -151,23 +151,23 @@ BluetoothDaemonSocketModule::CloseCmd(Bl
   /* stop the watcher corresponding to |aRes| */
   Task* t = new DeleteSocketMessageWatcherTask(aRes);
   XRE_GetIOMessageLoop()->PostTask(FROM_HERE, t);
 
   return NS_OK;
 }
 
 void
-BluetoothDaemonSocketModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                                       BluetoothDaemonPDU& aPDU,
+BluetoothDaemonSocketModule::HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                                       DaemonSocketPDU& aPDU,
                                        void* aUserData)
 {
   static void (BluetoothDaemonSocketModule::* const HandleRsp[])(
-    const BluetoothDaemonPDUHeader&,
-    BluetoothDaemonPDU&,
+    const DaemonSocketPDUHeader&,
+    DaemonSocketPDU&,
     BluetoothSocketResultHandler*) = {
     INIT_ARRAY_AT(0x00, &BluetoothDaemonSocketModule::ErrorRsp),
     INIT_ARRAY_AT(0x01, &BluetoothDaemonSocketModule::ListenRsp),
     INIT_ARRAY_AT(0x02, &BluetoothDaemonSocketModule::ConnectRsp),
   };
 
   if (NS_WARN_IF(MOZ_ARRAY_LENGTH(HandleRsp) <= aHeader.mOpcode) ||
       NS_WARN_IF(!HandleRsp[aHeader.mOpcode])) {
@@ -181,66 +181,66 @@ BluetoothDaemonSocketModule::HandleSvc(c
   if (!res) {
     return; // Return early if no result handler has been set
   }
 
   (this->*(HandleRsp[aHeader.mOpcode]))(aHeader, aPDU, res);
 }
 
 nsresult
-BluetoothDaemonSocketModule::Send(BluetoothDaemonPDU* aPDU,
+BluetoothDaemonSocketModule::Send(DaemonSocketPDU* aPDU,
                                   BluetoothSocketResultHandler* aRes)
 {
   aRes->AddRef(); // Keep reference for response
   return Send(aPDU, static_cast<void*>(aRes));
 }
 
 uint8_t
 BluetoothDaemonSocketModule::SocketFlags(bool aEncrypt, bool aAuth)
 {
   return (0x01 * aEncrypt) | (0x02 * aAuth);
 }
 
 // Responses
 //
 
 void
-BluetoothDaemonSocketModule::ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                      BluetoothDaemonPDU& aPDU,
+BluetoothDaemonSocketModule::ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                                      DaemonSocketPDU& aPDU,
                                       BluetoothSocketResultHandler* aRes)
 {
   ErrorRunnable::Dispatch(
     aRes, &BluetoothSocketResultHandler::OnError, UnpackPDUInitOp(aPDU));
 }
 
 class BluetoothDaemonSocketModule::ListenInitOp final : private PDUInitOp
 {
 public:
-  ListenInitOp(BluetoothDaemonPDU& aPDU)
+  ListenInitOp(DaemonSocketPDU& aPDU)
   : PDUInitOp(aPDU)
   { }
 
   nsresult
   operator () (int& aArg1) const
   {
-    BluetoothDaemonPDU& pdu = GetPDU();
+    DaemonSocketPDU& pdu = GetPDU();
 
     aArg1 = pdu.AcquireFd();
 
     if (NS_WARN_IF(aArg1 < 0)) {
       return NS_ERROR_ILLEGAL_VALUE;
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
-BluetoothDaemonSocketModule::ListenRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                       BluetoothDaemonPDU& aPDU,
+BluetoothDaemonSocketModule::ListenRsp(const DaemonSocketPDUHeader& aHeader,
+                                       DaemonSocketPDU& aPDU,
                                        BluetoothSocketResultHandler* aRes)
 {
   IntResultRunnable::Dispatch(
     aRes, &BluetoothSocketResultHandler::Listen, ListenInitOp(aPDU));
 }
 
 /* |ConnectWatcher| specializes SocketMessageWatcher for
  * connect operations by reading the socket messages from
@@ -269,18 +269,18 @@ public:
     }
 
     MessageLoopForIO::current()->PostTask(
       FROM_HERE, new DeleteTask<ConnectWatcher>(this));
   }
 };
 
 void
-BluetoothDaemonSocketModule::ConnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                                        BluetoothDaemonPDU& aPDU,
+BluetoothDaemonSocketModule::ConnectRsp(const DaemonSocketPDUHeader& aHeader,
+                                        DaemonSocketPDU& aPDU,
                                         BluetoothSocketResultHandler* aRes)
 {
   /* the file descriptor is attached in the PDU's ancillary data */
   int fd = aPDU.AcquireFd();
   if (fd < 0) {
     ErrorRunnable::Dispatch(aRes, &BluetoothSocketResultHandler::OnError,
                             ConstantInitOp1<BluetoothStatus>(STATUS_FAIL));
     return;
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
@@ -15,17 +15,17 @@ BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 class BluetoothDaemonSocketModule
 {
 public:
   static const int MAX_NUM_CLIENTS;
 
-  virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+  virtual nsresult Send(DaemonSocketPDU* aPDU, void* aUserData) = 0;
 
   // Commands
   //
 
   nsresult ListenCmd(BluetoothSocketType aType,
                      const nsAString& aServiceName,
                      const uint8_t aServiceUuid[16],
                      int aChannel, bool aEncrypt, bool aAuth,
@@ -38,20 +38,20 @@ public:
                       BluetoothSocketResultHandler* aRes);
 
   nsresult AcceptCmd(int aFd, BluetoothSocketResultHandler* aRes);
 
   nsresult CloseCmd(BluetoothSocketResultHandler* aRes);
 
 protected:
 
-  void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU, void* aUserData);
+  void HandleSvc(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU, void* aUserData);
 
-  nsresult Send(BluetoothDaemonPDU* aPDU, BluetoothSocketResultHandler* aRes);
+  nsresult Send(DaemonSocketPDU* aPDU, BluetoothSocketResultHandler* aRes);
 
 private:
   class AcceptWatcher;
   class ConnectWatcher;
   class ListenInitOp;
 
   uint8_t SocketFlags(bool aEncrypt, bool aAuth);
 
@@ -69,26 +69,26 @@ private:
                                    BluetoothStatus, BluetoothStatus>
     ErrorRunnable;
 
   typedef BluetoothResultRunnable3<BluetoothSocketResultHandler, void,
                                    int, nsString, int,
                                    int, const nsAString_internal&, int>
     IntStringIntResultRunnable;
 
-  void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
-                BluetoothDaemonPDU& aPDU,
+  void ErrorRsp(const DaemonSocketPDUHeader& aHeader,
+                DaemonSocketPDU& aPDU,
                 BluetoothSocketResultHandler* aRes);
 
-  void ListenRsp(const BluetoothDaemonPDUHeader& aHeader,
-                 BluetoothDaemonPDU& aPDU,
+  void ListenRsp(const DaemonSocketPDUHeader& aHeader,
+                 DaemonSocketPDU& aPDU,
                  BluetoothSocketResultHandler* aRes);
 
-  void ConnectRsp(const BluetoothDaemonPDUHeader& aHeader,
-                  BluetoothDaemonPDU& aPDU,
+  void ConnectRsp(const DaemonSocketPDUHeader& aHeader,
+                  DaemonSocketPDU& aPDU,
                   BluetoothSocketResultHandler* aRes);
 };
 
 class BluetoothDaemonSocketInterface final
   : public BluetoothSocketInterface
 {
 public:
   BluetoothDaemonSocketInterface(BluetoothDaemonSocketModule* aModule);
--- a/ipc/bluetooth/BluetoothDaemonConnection.cpp
+++ b/ipc/bluetooth/BluetoothDaemonConnection.cpp
@@ -32,20 +32,20 @@ namespace mozilla {
 namespace ipc {
 
 // The connection to the Bluetooth daemon is established
 // using an abstract socket name. The \0 prefix will be added
 // by the |Connect| method.
 static const char sBluetoothdSocketName[] = "bluez_hal_socket";
 
 //
-// BluetoothDaemonPDU
+// DaemonSocketPDU
 //
 
-BluetoothDaemonPDU::BluetoothDaemonPDU(uint8_t aService, uint8_t aOpcode,
+DaemonSocketPDU::DaemonSocketPDU(uint8_t aService, uint8_t aOpcode,
                                        uint16_t aPayloadSize)
   : mConsumer(nullptr)
   , mUserData(nullptr)
 {
   // Allocate memory
   size_t availableSpace = HEADER_SIZE + aPayloadSize;
   ResetBuffer(new uint8_t[availableSpace], 0, 0, availableSpace);
 
@@ -54,41 +54,41 @@ BluetoothDaemonPDU::BluetoothDaemonPDU(u
   MOZ_ASSERT(data);
 
   // Setup PDU header
   data[OFF_SERVICE] = aService;
   data[OFF_OPCODE] = aOpcode;
   memcpy(data + OFF_LENGTH, &aPayloadSize, sizeof(aPayloadSize));
 }
 
-BluetoothDaemonPDU::BluetoothDaemonPDU(size_t aPayloadSize)
+DaemonSocketPDU::DaemonSocketPDU(size_t aPayloadSize)
   : mConsumer(nullptr)
   , mUserData(nullptr)
 {
   size_t availableSpace = HEADER_SIZE + aPayloadSize;
   ResetBuffer(new uint8_t[availableSpace], 0, 0, availableSpace);
 }
 
-BluetoothDaemonPDU::~BluetoothDaemonPDU()
+DaemonSocketPDU::~DaemonSocketPDU()
 {
   nsAutoArrayPtr<uint8_t> data(GetBuffer());
   ResetBuffer(nullptr, 0, 0, 0);
 }
 
 void
-BluetoothDaemonPDU::GetHeader(uint8_t& aService, uint8_t& aOpcode,
+DaemonSocketPDU::GetHeader(uint8_t& aService, uint8_t& aOpcode,
                               uint16_t& aPayloadSize)
 {
   memcpy(&aService, GetData(OFF_SERVICE), sizeof(aService));
   memcpy(&aOpcode, GetData(OFF_OPCODE), sizeof(aOpcode));
   memcpy(&aPayloadSize, GetData(OFF_LENGTH), sizeof(aPayloadSize));
 }
 
 ssize_t
-BluetoothDaemonPDU::Send(int aFd)
+DaemonSocketPDU::Send(int aFd)
 {
   struct iovec iv;
   memset(&iv, 0, sizeof(iv));
   iv.iov_base = GetData(GetLeadingSpace());
   iv.iov_len = GetSize();
 
   struct msghdr msg;
   memset(&msg, 0, sizeof(msg));
@@ -115,17 +115,17 @@ BluetoothDaemonPDU::Send(int aFd)
   return res;
 }
 
 #define CMSGHDR_CONTAINS_FD(_cmsghdr) \
     ( ((_cmsghdr)->cmsg_level == SOL_SOCKET) && \
       ((_cmsghdr)->cmsg_type == SCM_RIGHTS) )
 
 ssize_t
-BluetoothDaemonPDU::Receive(int aFd)
+DaemonSocketPDU::Receive(int aFd)
 {
   struct iovec iv;
   memset(&iv, 0, sizeof(iv));
   iv.iov_base = GetData(0);
   iv.iov_len = GetAvailableSpace();
 
   uint8_t cmsgbuf[CMSG_SPACE(sizeof(int))];
 
@@ -158,45 +158,45 @@ BluetoothDaemonPDU::Receive(int aFd)
     // have been sent, we close all but the final one.
     mReceivedFd = *(static_cast<int*>(CMSG_DATA(chdr)));
   }
 
   return res;
 }
 
 int
-BluetoothDaemonPDU::AcquireFd()
+DaemonSocketPDU::AcquireFd()
 {
   return mReceivedFd.forget();
 }
 
 nsresult
-BluetoothDaemonPDU::UpdateHeader()
+DaemonSocketPDU::UpdateHeader()
 {
   size_t len = GetPayloadSize();
   if (len >= MAX_PAYLOAD_LENGTH) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   uint16_t len16 = static_cast<uint16_t>(len);
 
   memcpy(GetData(OFF_LENGTH), &len16, sizeof(len16));
 
   return NS_OK;
 }
 
 size_t
-BluetoothDaemonPDU::GetPayloadSize() const
+DaemonSocketPDU::GetPayloadSize() const
 {
   MOZ_ASSERT(GetSize() >= HEADER_SIZE);
 
   return GetSize() - HEADER_SIZE;
 }
 
 void
-BluetoothDaemonPDU::OnError(const char* aFunction, int aErrno)
+DaemonSocketPDU::OnError(const char* aFunction, int aErrno)
 {
   CHROMIUM_LOG("%s failed with error %d (%s)",
                aFunction, aErrno, strerror(aErrno));
 }
 
 //
 // DaemonSocketIOConsumer
 //
@@ -237,17 +237,17 @@ public:
   bool IsShutdownOnIOThread() const override;
 
   void ShutdownOnConsumerThread() override;
   void ShutdownOnIOThread() override;
 
 private:
   BluetoothDaemonConnection* mConnection;
   DaemonSocketIOConsumer* mConsumer;
-  nsAutoPtr<BluetoothDaemonPDU> mPDU;
+  nsAutoPtr<DaemonSocketPDU> mPDU;
   bool mShuttingDownOnIOThread;
 };
 
 BluetoothDaemonConnectionIO::BluetoothDaemonConnectionIO(
   MessageLoop* aConsumerLoop,
   MessageLoop* aIOLoop,
   int aFd,
   ConnectionStatus aConnectionStatus,
@@ -271,17 +271,17 @@ BluetoothDaemonConnectionIO::BluetoothDa
 
 nsresult
 BluetoothDaemonConnectionIO::QueryReceiveBuffer(UnixSocketIOBuffer** aBuffer)
 {
   MOZ_ASSERT(aBuffer);
 
   if (!mPDU) {
     /* There's only one PDU for receiving. We reuse it every time. */
-    mPDU = new BluetoothDaemonPDU(BluetoothDaemonPDU::MAX_PAYLOAD_LENGTH);
+    mPDU = new DaemonSocketPDU(DaemonSocketPDU::MAX_PAYLOAD_LENGTH);
   }
   *aBuffer = mPDU.get();
 
   return NS_OK;
 }
 
 void
 BluetoothDaemonConnectionIO::ConsumeBuffer()
--- a/ipc/bluetooth/BluetoothDaemonConnection.h
+++ b/ipc/bluetooth/BluetoothDaemonConnection.h
@@ -17,17 +17,17 @@ class MessageLoop;
 namespace mozilla {
 namespace ipc {
 
 class DaemonSocketConsumer;
 class BluetoothDaemonConnectionIO;
 class DaemonSocketIOConsumer;
 
 /*
- * |BlutoothDaemonPDU| represents a single PDU that is transfered from or to
+ * |DaemonSocketPDU| represents a single PDU that is transfered from or to
  * the Bluetooth daemon. Each PDU contains exactly one command.
  *
  * A PDU as the following format
  *
  *    |    1    |    1    |        2       |    n    |
  *    | service |  opcode | payload length | payload |
  *
  * Service and Opcode each require 1 byte, the payload length requires 2
@@ -36,32 +36,32 @@ class DaemonSocketIOConsumer;
  *
  * Each service and opcode can have a different payload with individual
  * length. For the exact details of the Bluetooth protocol, please refer
  * to
  *
  *    https://git.kernel.org/cgit/bluetooth/bluez.git/tree/android/hal-ipc-api.txt?id=5.24
  *
  */
-class BluetoothDaemonPDU final : public UnixSocketIOBuffer
+class DaemonSocketPDU final : public UnixSocketIOBuffer
 {
 public:
   enum {
     OFF_SERVICE = 0,
     OFF_OPCODE = 1,
     OFF_LENGTH = 2,
     OFF_PAYLOAD = 4,
     HEADER_SIZE = OFF_PAYLOAD,
     MAX_PAYLOAD_LENGTH = 1 << 16
   };
 
-  BluetoothDaemonPDU(uint8_t aService, uint8_t aOpcode,
+  DaemonSocketPDU(uint8_t aService, uint8_t aOpcode,
                      uint16_t aPayloadSize);
-  BluetoothDaemonPDU(size_t aPayloadSize);
-  ~BluetoothDaemonPDU();
+  DaemonSocketPDU(size_t aPayloadSize);
+  ~DaemonSocketPDU();
 
   void SetConsumer(DaemonSocketIOConsumer* aConsumer)
   {
     mConsumer = aConsumer;
   }
 
   void SetUserData(void* aUserData)
   {
@@ -97,18 +97,18 @@ private:
  * daemon. Please note that its method |Handle| runs on a different than the
  * consumer thread.
  */
 class DaemonSocketIOConsumer
 {
 public:
   virtual ~DaemonSocketIOConsumer();
 
-  virtual void Handle(BluetoothDaemonPDU& aPDU) = 0;
-  virtual void StoreUserData(const BluetoothDaemonPDU& aPDU) = 0;
+  virtual void Handle(DaemonSocketPDU& aPDU) = 0;
+  virtual void StoreUserData(const DaemonSocketPDU& aPDU) = 0;
 
 protected:
   DaemonSocketIOConsumer();
 };
 
 /*
  * |BluetoothDaemonConnection| represents the socket to connect to the
  * Bluetooth daemon. It offers connection establishment and sending