Backed out 10 changesets (bug 1102703) for B2G JB bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 08 Jan 2015 10:22:18 -0500
changeset 222684 b4926227268febb4e73c7c2d31710cca15a533f1
parent 222683 4c25f8d29c3292dc06beb56c423b15e80438eec9
child 222685 d5b4f81e654939c18b3766bea3ea2cf6ec30b9a1
push id28071
push userkwierso@gmail.com
push dateFri, 09 Jan 2015 00:54:55 +0000
treeherdermozilla-central@ccfafae7330f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1102703
milestone37.0a1
backs outfae7478f55e50bb8f7373014a57e8e2161f14e29
d9d1879fc90f22934dcd06f0841d98255ab9e71a
b61bf281e9910a32f2084e99aabf1f7f45438d74
f62155e4fb9c32f91e21395bab8b870b992f0388
ff47d1b9e86cd3cb2e56c5ab36011161e65de5b3
ece26b235282103462be87d39e3bdbc973c06d32
9f067e4973ebec2447d6caa7dadea196c5d2ca39
db035be5bc6ccbb71556e4fe7e9f19750daa1a58
411ab2917e49547a133d95282849eff928a59344
50eed0f4edc7036380841901920b4623c7d0f9c9
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
Backed out 10 changesets (bug 1102703) for B2G JB bustage. Backed out changeset fae7478f55e5 (bug 1102703) Backed out changeset d9d1879fc90f (bug 1102703) Backed out changeset b61bf281e991 (bug 1102703) Backed out changeset f62155e4fb9c (bug 1102703) Backed out changeset ff47d1b9e86c (bug 1102703) Backed out changeset ece26b235282 (bug 1102703) Backed out changeset 9f067e4973eb (bug 1102703) Backed out changeset db035be5bc6c (bug 1102703) Backed out changeset 411ab2917e49 (bug 1102703) Backed out changeset 50eed0f4edc7 (bug 1102703)
configure.in
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/BluetoothInterface.h
dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.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/BluetoothDaemonInterface.h
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp
dom/bluetooth/bluedroid/BluetoothHALHelpers.h
dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothHALInterface.h
dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.h
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h
--- a/configure.in
+++ b/configure.in
@@ -285,21 +285,16 @@ if test -n "$gonkdir" ; then
         ;;
     21)
         GONK_INCLUDES="-I$gonkdir/frameworks/native/include -I$gonkdir/frameworks/av/include -I$gonkdir/frameworks/av/include/media -I$gonkdir/frameworks/av/include/camera -I$gonkdir/frameworks/native/include/media/openmax -I$gonkdir/frameworks/av/media/libstagefright/include"
         MOZ_AUDIO_OFFLOAD=1
         MOZ_OMX_DECODER=1
         AC_SUBST(MOZ_AUDIO_OFFLOAD)
         AC_DEFINE(MOZ_AUDIO_OFFLOAD)
         MOZ_FMP4=
-        MOZ_B2G_BT=1
-        MOZ_B2G_BT_BLUEDROID=1
-        if test -d "$gonkdir/system/bluetoothd"; then
-            MOZ_B2G_BT_DAEMON=1
-        fi
         ;;
     *)
         AC_MSG_ERROR([Unsupported platform version: $ANDROID_VERSION])
         ;;
     esac
     CPPFLAGS="-DANDROID $TARGET_C_INCLUDES -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $GONK_INCLUDES $CPPFLAGS"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -230,32 +230,16 @@ struct BluetoothProperty {
 
   /* PROPERTY_SCAN_MODE */
   BluetoothScanMode mScanMode;
 
   /* PROPERTY_REMOTE_VERSION_INFO */
   BluetoothRemoteInfo mRemoteInfo;
 };
 
-/* Physical transport for GATT connections to remote dual-mode devices */
-enum BluetoothTransport {
-  TRANSPORT_AUTO,   /* No preference of physical transport */
-  TRANSPORT_BREDR,  /* Prefer BR/EDR transport */
-  TRANSPORT_LE      /* Prefer LE transport */
-};
-
-struct BluetoothActivityEnergyInfo {
-  uint8_t mStatus;
-  uint8_t mStackState;  /* stack reported state */
-  uint64_t mTxTime;     /* in ms */
-  uint64_t mRxTime;     /* in ms */
-  uint64_t mIdleTime;   /* in ms */
-  uint64_t mEnergyUsed; /* a product of mA, V and ms */
-};
-
 enum BluetoothSocketType {
   RFCOMM = 1,
   SCO    = 2,
   L2CAP  = 3,
   EL2CAP = 4
 };
 
 enum BluetoothHandsfreeAtResponse {
@@ -317,22 +301,16 @@ enum BluetoothHandsfreeConnectionState
   HFP_CONNECTION_STATE_DISCONNECTING
 };
 
 enum BluetoothHandsfreeNetworkState {
   HFP_NETWORK_STATE_NOT_AVAILABLE,
   HFP_NETWORK_STATE_AVAILABLE
 };
 
-enum BluetoothHandsfreeWbsConfig {
-  HFP_WBS_NONE, /* Neither CVSD nor mSBC codec, but other optional codec.*/
-  HFP_WBS_NO,   /* CVSD */
-  HFP_WBS_YES   /* mSBC */
-};
-
 enum BluetoothHandsfreeNRECState {
   HFP_NREC_STOPPED,
   HFP_NREC_STARTED
 };
 
 enum BluetoothHandsfreeServiceType {
   HFP_SERVICE_TYPE_HOME,
   HFP_SERVICE_TYPE_ROAMING
--- a/dom/bluetooth/BluetoothInterface.h
+++ b/dom/bluetooth/BluetoothInterface.h
@@ -75,82 +75,69 @@ public:
   { }
 
   virtual void
   AudioStateNotification(BluetoothHandsfreeAudioState aState,
                          const nsAString& aBdAddr)
   { }
 
   virtual void
-  VoiceRecognitionNotification(BluetoothHandsfreeVoiceRecognitionState aState,
-                               const nsAString& aBdAddr)
+  VoiceRecognitionNotification(BluetoothHandsfreeVoiceRecognitionState aState)
   { }
 
   virtual void
-  AnswerCallNotification(const nsAString& aBdAddr)
-  { }
-
-  virtual void
-  HangupCallNotification(const nsAString& aBdAddr)
+  AnswerCallNotification()
   { }
 
   virtual void
-  VolumeNotification(BluetoothHandsfreeVolumeType aType,
-                     int aVolume,
-                     const nsAString& aBdAddr)
+  HangupCallNotification()
   { }
 
   virtual void
-  DialCallNotification(const nsAString& aNumber,
-                       const nsAString& aBdAddr)
+  VolumeNotification(BluetoothHandsfreeVolumeType aType, int aVolume)
   { }
 
   virtual void
-  DtmfNotification(char aDtmf,
-                   const nsAString& aBdAddr)
+  DialCallNotification(const nsAString& aNumber)
+  { }
+
+  virtual void
+  DtmfNotification(char aDtmf)
   { }
 
   virtual void
-  NRECNotification(BluetoothHandsfreeNRECState aNrec,
-                   const nsAString& aBdAddr)
+  NRECNotification(BluetoothHandsfreeNRECState aNrec)
   { }
 
   virtual void
-  WbsNotification(BluetoothHandsfreeWbsConfig aWbs,
-                  const nsAString& aBdAddr)
+  CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
   { }
 
   virtual void
-  CallHoldNotification(BluetoothHandsfreeCallHoldType aChld,
-                       const nsAString& aBdAddr)
-  { }
-
-  virtual void
-  CnumNotification(const nsAString& aBdAddr)
+  CnumNotification()
   { }
 
   virtual void
-  CindNotification(const nsAString& aBdAddr)
+  CindNotification()
   { }
 
   virtual void
-  CopsNotification(const nsAString& aBdAddr)
+  CopsNotification()
   { }
 
   virtual void
-  ClccNotification(const nsAString& aBdAddr)
+  ClccNotification()
   { }
 
   virtual void
-  UnknownAtNotification(const nsACString& aAtString,
-                        const nsAString& aBdAddr)
+  UnknownAtNotification(const nsACString& aAtString)
   { }
 
   virtual void
-  KeyPressedNotification(const nsAString& aBdAddr)
+  KeyPressedNotification()
   { }
 
 protected:
   BluetoothHandsfreeNotificationHandler()
   { }
 };
 
 class BluetoothHandsfreeResultHandler
@@ -181,95 +168,82 @@ public:
   virtual void DeviceStatusNotification() { }
 
   virtual void CopsResponse() { }
   virtual void CindResponse() { }
   virtual void FormattedAtResponse() { }
   virtual void AtResponse() { }
   virtual void ClccResponse() { }
   virtual void PhoneStateChange() { }
-
-  virtual void ConfigureWbs() { }
 };
 
 class BluetoothHandsfreeInterface
 {
 public:
   virtual void Init(
     BluetoothHandsfreeNotificationHandler* aNotificationHandler,
-    int aMaxNumClients, BluetoothHandsfreeResultHandler* aRes) = 0;
+    BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void Cleanup(BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Connect / Disconnect */
 
   virtual void Connect(const nsAString& aBdAddr,
                        BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void Disconnect(const nsAString& aBdAddr,
                           BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void ConnectAudio(const nsAString& aBdAddr,
                             BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void DisconnectAudio(const nsAString& aBdAddr,
                                BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Voice Recognition */
 
-  virtual void StartVoiceRecognition(const nsAString& aBdAddr,
-                                     BluetoothHandsfreeResultHandler* aRes) = 0;
-  virtual void StopVoiceRecognition(const nsAString& aBdAddr,
-                                    BluetoothHandsfreeResultHandler* aRes) = 0;
+  virtual void StartVoiceRecognition(BluetoothHandsfreeResultHandler* aRes) = 0;
+  virtual void StopVoiceRecognition(BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Volume */
 
   virtual void VolumeControl(BluetoothHandsfreeVolumeType aType, int aVolume,
-                             const nsAString& aBdAddr,
                              BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Device status */
 
   virtual void DeviceStatusNotification(
     BluetoothHandsfreeNetworkState aNtkState,
     BluetoothHandsfreeServiceType aSvcType,
     int aSignal, int aBattChg, BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Responses */
 
-  virtual void CopsResponse(const char* aCops, const nsAString& aBdAddr,
+  virtual void CopsResponse(const char* aCops,
                             BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void CindResponse(int aSvc, int aNumActive, int aNumHeld,
                             BluetoothHandsfreeCallState aCallSetupState,
                             int aSignal, int aRoam, int aBattChg,
-                            const nsAString& aBdAddr,
                             BluetoothHandsfreeResultHandler* aRes) = 0;
-  virtual void FormattedAtResponse(const char* aRsp, const nsAString& aBdAddr,
+  virtual void FormattedAtResponse(const char* aRsp,
                                    BluetoothHandsfreeResultHandler* aRes) = 0;
-  virtual void AtResponse(BluetoothHandsfreeAtResponse aResponseCode,
-                          int aErrorCode, const nsAString& aBdAddr,
+  virtual void AtResponse(BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
                           BluetoothHandsfreeResultHandler* aRes) = 0;
   virtual void ClccResponse(int aIndex, BluetoothHandsfreeCallDirection aDir,
                             BluetoothHandsfreeCallState aState,
                             BluetoothHandsfreeCallMode aMode,
                             BluetoothHandsfreeCallMptyType aMpty,
                             const nsAString& aNumber,
                             BluetoothHandsfreeCallAddressType aType,
-                            const nsAString& aBdAddr,
                             BluetoothHandsfreeResultHandler* aRes) = 0;
 
   /* Phone State */
 
   virtual void PhoneStateChange(int aNumActive, int aNumHeld,
                                 BluetoothHandsfreeCallState aCallSetupState,
                                 const nsAString& aNumber,
                                 BluetoothHandsfreeCallAddressType aType,
                                 BluetoothHandsfreeResultHandler* aRes) = 0;
 
-  /* Wide Band Speech */
-  virtual void ConfigureWbs(const nsAString& aBdAddr,
-                            BluetoothHandsfreeWbsConfig aConfig,
-                            BluetoothHandsfreeResultHandler* aRes) = 0;
-
 protected:
   BluetoothHandsfreeInterface();
   virtual ~BluetoothHandsfreeInterface();
 };
 
 //
 // Bluetooth Advanced Audio Interface
 //
@@ -284,22 +258,16 @@ public:
                               const nsAString& aBdAddr)
   { }
 
   virtual void
   AudioStateNotification(BluetoothA2dpAudioState aState,
                          const nsAString& aBdAddr)
   { }
 
-  virtual void
-  AudioConfigNotification(const nsAString& aBdAddr,
-                          uint32_t aSampleRate,
-                          uint8_t aChannelCount)
-  { }
-
 protected:
   BluetoothA2dpNotificationHandler()
   { }
 };
 
 class BluetoothA2dpResultHandler
 {
 public:
@@ -522,19 +490,16 @@ public:
                                            const nsAString& aRemoteBdAddr,
                                            bool aState) { }
 
   virtual void DutModeRecvNotification(uint16_t aOpcode,
                                        const uint8_t* aBuf, uint8_t aLen) { }
   virtual void LeTestModeNotification(BluetoothStatus aStatus,
                                       uint16_t aNumPackets) { }
 
-  virtual void EnergyInfoNotification(const BluetoothActivityEnergyInfo& aInfo)
-  { }
-
 protected:
   BluetoothNotificationHandler()
   { }
 };
 
 class BluetoothResultHandler
 {
 public:
@@ -565,27 +530,23 @@ public:
 
   virtual void StartDiscovery() { }
   virtual void CancelDiscovery() { }
 
   virtual void CreateBond() { }
   virtual void RemoveBond() { }
   virtual void CancelBond() { }
 
-  virtual void GetConnectionState() { }
-
   virtual void PinReply() { }
   virtual void SspReply() { }
 
   virtual void DutModeConfigure() { }
   virtual void DutModeSend() { }
 
   virtual void LeTestMode() { }
-
-  virtual void ReadEnergyInfo() { }
 };
 
 class BluetoothInterface
 {
 public:
   static BluetoothInterface* GetInstance();
 
   virtual void Init(BluetoothNotificationHandler* aNotificationHandler,
@@ -625,28 +586,22 @@ public:
   /* Discovery */
 
   virtual void StartDiscovery(BluetoothResultHandler* aRes) = 0;
   virtual void CancelDiscovery(BluetoothResultHandler* aRes) = 0;
 
   /* Bonds */
 
   virtual void CreateBond(const nsAString& aBdAddr,
-                          BluetoothTransport aTransport,
                           BluetoothResultHandler* aRes) = 0;
   virtual void RemoveBond(const nsAString& aBdAddr,
                           BluetoothResultHandler* aRes) = 0;
   virtual void CancelBond(const nsAString& aBdAddr,
                           BluetoothResultHandler* aRes) = 0;
 
-  /* Connection */
-
-  virtual void GetConnectionState(const nsAString& aBdAddr,
-                                  BluetoothResultHandler* aRes) = 0;
-
   /* Authentication */
 
   virtual void PinReply(const nsAString& aBdAddr, bool aAccept,
                         const nsAString& aPinCode,
                         BluetoothResultHandler* aRes) = 0;
 
   virtual void SspReply(const nsAString& aBdAddr, const nsAString& aVariant,
                         bool aAccept, uint32_t aPasskey,
@@ -659,20 +614,16 @@ public:
   virtual void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                            BluetoothResultHandler* aRes) = 0;
 
   /* LE Mode */
 
   virtual void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                           BluetoothResultHandler* aRes) = 0;
 
-  /* Energy Info */
-
-  virtual void ReadEnergyInfo(BluetoothResultHandler* aRes) = 0;
-
   /* Profile Interfaces */
 
   virtual BluetoothSocketInterface* GetBluetoothSocketInterface() = 0;
   virtual BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() = 0;
   virtual BluetoothA2dpInterface* GetBluetoothA2dpInterface() = 0;
   virtual BluetoothAvrcpInterface* GetBluetoothAvrcpInterface() = 0;
 
 protected:
--- a/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
@@ -70,22 +70,16 @@ struct BluetoothA2dpHALCallback
     ConnectionStateNotification;
 
   typedef BluetoothNotificationHALRunnable2<
     A2dpNotificationHandlerWrapper, void,
     BluetoothA2dpAudioState, nsString,
     BluetoothA2dpAudioState, const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationHALRunnable3<
-    A2dpNotificationHandlerWrapper, void,
-    nsString, uint32_t, uint8_t,
-    const nsAString&, uint32_t, uint8_t>
-    AudioConfigNotification;
-
   // Bluedroid A2DP callbacks
 
   static void
   ConnectionState(btav_connection_state_t aState, bt_bdaddr_t* aBdAddr)
   {
     ConnectionStateNotification::Dispatch(
       &BluetoothA2dpNotificationHandler::ConnectionStateNotification,
       aState, aBdAddr);
@@ -93,26 +87,16 @@ struct BluetoothA2dpHALCallback
 
   static void
   AudioState(btav_audio_state_t aState, bt_bdaddr_t* aBdAddr)
   {
     AudioStateNotification::Dispatch(
       &BluetoothA2dpNotificationHandler::AudioStateNotification,
       aState, aBdAddr);
   }
-
-#if ANDROID_VERSION >= 21
-  static void
-  AudioConfig(bt_bdaddr_t *aBdAddr, uint32_t aSampleRate, uint8_t aChannelCount)
-  {
-    AudioConfigNotification::Dispatch(
-      &BluetoothA2dpNotificationHandler::AudioConfigNotification,
-      aBdAddr, aSampleRate, aChannelCount);
-  }
-#endif
 };
 
 // Interface
 //
 
 BluetoothA2dpHALInterface::BluetoothA2dpHALInterface(
   const btav_interface_t* aInterface)
 : mInterface(aInterface)
@@ -126,20 +110,17 @@ BluetoothA2dpHALInterface::~BluetoothA2d
 void
 BluetoothA2dpHALInterface::Init(
   BluetoothA2dpNotificationHandler* aNotificationHandler,
   BluetoothA2dpResultHandler* aRes)
 {
   static btav_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothA2dpHALCallback::ConnectionState,
-    BluetoothA2dpHALCallback::AudioState,
-#if ANDROID_VERSION >= 21
-    BluetoothA2dpHALCallback::AudioConfig
-#endif
+    BluetoothA2dpHALCallback::AudioState
   };
 
   sA2dpNotificationHandler = aNotificationHandler;
 
   bt_status_t status = mInterface->init(&sCallbacks);
 
   if (aRes) {
     DispatchBluetoothA2dpHALResult(aRes,
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
@@ -9,18 +9,16 @@
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // A2DP module
 //
 
-const int BluetoothDaemonA2dpModule::MAX_NUM_CLIENTS = 1;
-
 BluetoothA2dpNotificationHandler*
   BluetoothDaemonA2dpModule::sNotificationHandler;
 
 void
 BluetoothDaemonA2dpModule::SetNotificationHandler(
   BluetoothA2dpNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
@@ -257,74 +255,25 @@ void
 BluetoothDaemonA2dpModule::AudioStateNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   AudioStateNotification::Dispatch(
     &BluetoothA2dpNotificationHandler::AudioStateNotification,
     AudioStateInitOp(aPDU));
 }
 
-// Init operator class for AudioConfigNotification
-class BluetoothDaemonA2dpModule::AudioConfigInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  AudioConfigInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1, uint32_t aArg2, uint8_t aArg3) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read sample rate */
-    rv = UnpackPDU(pdu, aArg2);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read channel count */
-    rv = UnpackPDU(pdu, aArg3);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
-void
-BluetoothDaemonA2dpModule::AudioConfigNtf(
-  const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
-{
-  AudioConfigNotification::Dispatch(
-    &BluetoothA2dpNotificationHandler::AudioConfigNotification,
-    AudioConfigInitOp(aPDU));
-}
-
 void
 BluetoothDaemonA2dpModule::HandleNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonA2dpModule::* const HandleNtf[])(
     const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
     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());
 
   uint8_t index = aHeader.mOpcode - 0x81;
 
   if (NS_WARN_IF(!(index < MOZ_ARRAY_LENGTH(HandleNtf))) ||
       NS_WARN_IF(!HandleNtf[index])) {
@@ -388,17 +337,17 @@ BluetoothDaemonA2dpInterface::Init(
   if (aRes) {
     res = new InitResultHandler(aRes);
   } else {
     // We don't need a result handler if the caller is not interested.
     res = nullptr;
   }
 
   nsresult rv = mModule->RegisterModule(BluetoothDaemonA2dpModule::SERVICE_ID,
-    0x00, BluetoothDaemonA2dpModule::MAX_NUM_CLIENTS, res);
+                                        0x00, res);
   if (NS_FAILED(rv) && aRes) {
     DispatchError(aRes, STATUS_FAIL);
   }
 }
 
 class BluetoothDaemonA2dpInterface::CleanupResultHandler MOZ_FINAL
   : public BluetoothSetupResultHandler
 {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.h
@@ -23,22 +23,19 @@ 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 RegisterModule(uint8_t aId, uint8_t aMode,
-                                  uint32_t aMaxNumClients,
                                   BluetoothSetupResultHandler* aRes) = 0;
 
   virtual nsresult UnregisterModule(uint8_t aId,
                                     BluetoothSetupResultHandler* aRes) = 0;
 
   void SetNotificationHandler(
     BluetoothA2dpNotificationHandler* aNotificationHandler);
 
@@ -100,34 +97,25 @@ protected:
 
   typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
                                          BluetoothA2dpAudioState,
                                          nsString,
                                          BluetoothA2dpAudioState,
                                          const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-                                         nsString, uint32_t, uint8_t,
-                                         const nsAString&, uint32_t, uint8_t>
-    AudioConfigNotification;
-
+  class AudioStateInitOp;
   class ConnectionStateInitOp;
-  class AudioStateInitOp;
-  class AudioConfigInitOp;
 
   void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader,
                           BluetoothDaemonPDU& aPDU);
 
   void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader,
                      BluetoothDaemonPDU& aPDU);
 
-  void AudioConfigNtf(const BluetoothDaemonPDUHeader& aHeader,
-                      BluetoothDaemonPDU& aPDU);
-
   void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
                  BluetoothDaemonPDU& aPDU,
                  void* aUserData);
 
   static BluetoothA2dpNotificationHandler* sNotificationHandler;
 };
 
 class BluetoothDaemonA2dpInterface MOZ_FINAL
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -12,21 +12,16 @@ BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // Handsfree module
 //
 
 BluetoothHandsfreeNotificationHandler*
   BluetoothDaemonHandsfreeModule::sNotificationHandler;
 
-#if ANDROID_VERSION < 21
-nsString BluetoothDaemonHandsfreeModule::sConnectedDeviceAddress(
-  NS_ConvertUTF8toUTF16(BLUETOOTH_ADDRESS_NONE));
-#endif
-
 void
 BluetoothDaemonHandsfreeModule::SetNotificationHandler(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler)
 {
   sNotificationHandler = aNotificationHandler;
 }
 
 nsresult
@@ -147,86 +142,63 @@ BluetoothDaemonHandsfreeModule::Disconne
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StartVoiceRecognitionCmd(
-  const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_START_VOICE_RECOGNITION,
-                           6)); // Address (BlueZ 5.25)
+                           0)); // No payload
 
-  nsresult rv;
-#if ANDROID_VERSION >= 21
-  rv = PackPDU(
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-#endif
-  rv = Send(pdu, aRes);
+  nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StopVoiceRecognitionCmd(
-  const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_STOP_VOICE_RECOGNITION,
-                           6)); // Address (BlueZ 5.25)
+                           0)); // No payload
 
-  nsresult rv;
-#if ANDROID_VERSION >= 21
-  rv = PackPDU(
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-#endif
-  rv = Send(pdu, aRes);
+  nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::VolumeControlCmd(
   BluetoothHandsfreeVolumeType aType, int aVolume,
-  const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_VOLUME_CONTROL,
                            1 + // Volume type
-                           1 + // Volume
-                           6)); // Address (BlueZ 5.25)
+                           1)); // Volume
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    aType, PackConversion<int, uint8_t>(aVolume),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(aType, PackConversion<int, uint8_t>(aVolume), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
@@ -259,146 +231,109 @@ BluetoothDaemonHandsfreeModule::DeviceSt
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::CopsResponseCmd(
-  const char* aCops, const nsAString& aRemoteAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aCops, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_COPS_RESPONSE,
-                           0 + // Dynamically allocated
-                           6)); // Address (BlueZ 5.25)
+                           0)); // Dynamically allocated
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    PackCString0(nsDependentCString(aCops)),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(PackCString0(nsDependentCString(aCops)), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::CindResponseCmd(
   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,
                            1 + // Service
                            1 + // # Active
                            1 + // # Held
                            1 + // Call state
                            1 + // Signal strength
                            1 + // Roaming
-                           1 + // Battery level
-                           6)); // Address (BlueZ 5.25)
+                           1)); // Battery level
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    PackConversion<int, uint8_t>(aSvc),
-    PackConversion<int, uint8_t>(aNumActive),
-    PackConversion<int, uint8_t>(aNumHeld),
-    aCallSetupState,
-    PackConversion<int, uint8_t>(aSignal),
-    PackConversion<int, uint8_t>(aRoam),
-    PackConversion<int, uint8_t>(aBattChg),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(PackConversion<int, uint8_t>(aSvc),
                         PackConversion<int, uint8_t>(aNumActive),
                         PackConversion<int, uint8_t>(aNumHeld),
                         aCallSetupState,
                         PackConversion<int, uint8_t>(aSignal),
                         PackConversion<int, uint8_t>(aRoam),
                         PackConversion<int, uint8_t>(aBattChg), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::FormattedAtResponseCmd(
-  const char* aRsp, const nsAString& aRemoteAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aRsp, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_FORMATTED_AT_RESPONSE,
-                           0 + // Dynamically allocated
-                           6)); // Address (BlueZ 5.25)
+                           0)); // Dynamically allocated
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    PackCString0(nsDependentCString(aRsp)),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(PackCString0(nsDependentCString(aRsp)), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::AtResponseCmd(
   BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
-  const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(SERVICE_ID, OPCODE_AT_RESPONSE,
                            1 + // AT Response code
-                           1 + // Error code
-                           6)); // Address (BlueZ 5.25)
+                           1)); // Error code
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    aResponseCode, PackConversion<int, uint8_t>(aErrorCode),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(aResponseCode,
                         PackConversion<int, uint8_t>(aErrorCode), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
@@ -406,44 +341,35 @@ BluetoothDaemonHandsfreeModule::AtRespon
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::ClccResponseCmd(
   int aIndex,
   BluetoothHandsfreeCallDirection aDir, BluetoothHandsfreeCallState aState,
   BluetoothHandsfreeCallMode aMode, BluetoothHandsfreeCallMptyType aMpty,
   const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType,
-  const nsAString& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ConvertUTF16toUTF8 number(aNumber);
 
   nsAutoPtr<BluetoothDaemonPDU> pdu(
     new BluetoothDaemonPDU(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)
+                           number.Length() + 1)); // Number string + \0
 
-#if ANDROID_VERSION >= 21
-  nsresult rv = PackPDU(
-    PackConversion<int, uint8_t>(aIndex),
-    aDir, aState, aMode, aMpty, aType,
-    PackCString0(number),
-    PackConversion<nsAString, BluetoothAddress>(aRemoteAddr), *pdu);
-#else
   nsresult rv = PackPDU(PackConversion<int, uint8_t>(aIndex),
                         aDir, aState, aMode, aMpty, aType,
                         PackCString0(number), *pdu);
-#endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
@@ -478,29 +404,16 @@ BluetoothDaemonHandsfreeModule::PhoneSta
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
   unused << pdu.forget();
   return NS_OK;
 }
 
-nsresult
-BluetoothDaemonHandsfreeModule::ConfigureWbsCmd(
-  const nsAString& aBdAddr,
-  BluetoothHandsfreeWbsConfig aConfig,
-  BluetoothHandsfreeResultHandler* aRes)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  // TODO: to be implemented
-
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 // Responses
 //
 
 void
 BluetoothDaemonHandsfreeModule::ErrorRsp(
   const BluetoothDaemonPDUHeader& aHeader,
   BluetoothDaemonPDU& aPDU, BluetoothHandsfreeResultHandler* aRes)
 {
@@ -744,24 +657,16 @@ public:
     }
 
     /* Read address */
     rv = UnpackPDU(
       pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
     if (NS_FAILED(rv)) {
       return rv;
     }
-
-#if ANDROID_VERSION < 21
-    if (aArg1 == HFP_CONNECTION_STATE_CONNECTED) {
-      sConnectedDeviceAddress = aArg2;
-    } else if (aArg1 == HFP_CONNECTION_STATE_DISCONNECTED) {
-      sConnectedDeviceAddress.AssignLiteral(BLUETOOTH_ADDRESS_NONE);
-    }
-#endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::ConnectionStateNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
@@ -776,17 +681,18 @@ class BluetoothDaemonHandsfreeModule::Au
   : private PDUInitOp
 {
 public:
   AudioStateInitOp(BluetoothDaemonPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
-  operator () (BluetoothHandsfreeAudioState& aArg1, nsString& aArg2) const
+  operator () (BluetoothHandsfreeAudioState& aArg1,
+               nsString& aArg2) const
   {
     BluetoothDaemonPDU& pdu = GetPDU();
 
     /* Read state */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -806,174 +712,68 @@ void
 BluetoothDaemonHandsfreeModule::AudioStateNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   AudioStateNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::AudioStateNotification,
     AudioStateInitOp(aPDU));
 }
 
-// Init operator class for VoiceRecognitionNotification
-class BluetoothDaemonHandsfreeModule::VoiceRecognitionInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  VoiceRecognitionInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (BluetoothHandsfreeVoiceRecognitionState& aArg1,
-               nsString& aArg2) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read state */
-    nsresult rv = UnpackPDU(pdu, aArg1);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::VoiceRecognitionNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   VoiceRecognitionNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification,
-    VoiceRecognitionInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for AnswerCallNotification
-class BluetoothDaemonHandsfreeModule::AnswerCallInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  AnswerCallInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::AnswerCallNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   AnswerCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::AnswerCallNotification,
-    AnswerCallInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for HangupCallNotification
-class BluetoothDaemonHandsfreeModule::HangupCallInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  HangupCallInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::HangupCallNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   HangupCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::HangupCallNotification,
-    HangupCallInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for VolumeNotification
 class BluetoothDaemonHandsfreeModule::VolumeInitOp MOZ_FINAL
   : private PDUInitOp
 {
 public:
   VolumeInitOp(BluetoothDaemonPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
-  operator () (BluetoothHandsfreeVolumeType& aArg1, int& aArg2,
-               nsString& aArg3) const
+  operator () (BluetoothHandsfreeVolumeType& aArg1, int& aArg2) const
   {
     BluetoothDaemonPDU& pdu = GetPDU();
 
     /* Read volume type */
     nsresult rv = UnpackPDU(pdu, aArg1);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     /* Read volume */
     rv = UnpackPDU(pdu, UnpackConversion<uint8_t, int>(aArg2));
     if (NS_FAILED(rv)) {
       return rv;
     }
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg3));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg3 = sConnectedDeviceAddress;
-#endif
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
 void
 BluetoothDaemonHandsfreeModule::VolumeNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
@@ -988,37 +788,20 @@ class BluetoothDaemonHandsfreeModule::Di
   : private PDUInitOp
 {
 public:
   DialCallInitOp(BluetoothDaemonPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
-  operator () (nsString& aArg1, nsString& aArg2) const
+  operator () (nsString& aArg1) const
   {
-    BluetoothDaemonPDU& 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(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-
     /* Read number */
-    rv = UnpackPDU(pdu, UnpackString0(aArg1));
+    nsresult rv = UnpackPDU(GetPDU(), UnpackString0(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
@@ -1026,331 +809,93 @@ void
 BluetoothDaemonHandsfreeModule::DialCallNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   DialCallNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::DialCallNotification,
     DialCallInitOp(aPDU));
 }
 
-// Init operator class for DtmfNotification
-class BluetoothDaemonHandsfreeModule::DtmfInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  DtmfInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (char& aArg1, nsString& aArg2) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read tone */
-    nsresult rv = UnpackPDU(pdu, aArg1);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::DtmfNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   DtmfNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::DtmfNotification,
-    DtmfInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for NRECNotification
-class BluetoothDaemonHandsfreeModule::NRECInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  NRECInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (BluetoothHandsfreeNRECState& aArg1, nsString& aArg2) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read state */
-    nsresult rv = UnpackPDU(pdu, aArg1);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::NRECNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   NRECNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::NRECNotification,
-    NRECInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for CallHoldNotification
-class BluetoothDaemonHandsfreeModule::CallHoldInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  CallHoldInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (BluetoothHandsfreeCallHoldType& aArg1, nsString& aArg2) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read type */
-    nsresult rv = UnpackPDU(pdu, aArg1);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::CallHoldNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   CallHoldNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CallHoldNotification,
-    CallHoldInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for CnumNotification
-class BluetoothDaemonHandsfreeModule::CnumInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  CnumInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::CnumNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   CnumNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CnumNotification,
-    CnumInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for CindNotification
-class BluetoothDaemonHandsfreeModule::CindInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  CindInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::CindNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   CindNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CindNotification,
-    CindInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for CopsNotification
-class BluetoothDaemonHandsfreeModule::CopsInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  CopsInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::CopsNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   CopsNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::CopsNotification,
-    CopsInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
-// Init operator class for ClccNotification
-class BluetoothDaemonHandsfreeModule::ClccInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  ClccInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::ClccNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   ClccNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::ClccNotification,
-    ClccInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
 // Init operator class for UnknownAtNotification
 class BluetoothDaemonHandsfreeModule::UnknownAtInitOp MOZ_FINAL
   : private PDUInitOp
 {
 public:
   UnknownAtInitOp(BluetoothDaemonPDU& aPDU)
     : PDUInitOp(aPDU)
   { }
 
   nsresult
-  operator () (nsCString& aArg1, nsString& aArg2) const
+  operator () (nsCString& aArg1) const
   {
-    BluetoothDaemonPDU& 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(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg2));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg2 = sConnectedDeviceAddress;
-#endif
-
     /* Read string */
-    rv = UnpackPDU(pdu, UnpackCString0(aArg1));
+    nsresult rv = UnpackPDU(GetPDU(), UnpackCString0(aArg1));
     if (NS_FAILED(rv)) {
       return rv;
     }
     WarnAboutTrailingData();
     return NS_OK;
   }
 };
 
@@ -1358,52 +903,23 @@ void
 BluetoothDaemonHandsfreeModule::UnknownAtNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   UnknownAtNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::UnknownAtNotification,
     UnknownAtInitOp(aPDU));
 }
 
-// Init operator class for KeyPressedNotification
-class BluetoothDaemonHandsfreeModule::KeyPressedInitOp MOZ_FINAL
-  : private PDUInitOp
-{
-public:
-  KeyPressedInitOp(BluetoothDaemonPDU& aPDU)
-    : PDUInitOp(aPDU)
-  { }
-
-  nsresult
-  operator () (nsString& aArg1) const
-  {
-    BluetoothDaemonPDU& pdu = GetPDU();
-
-    /* Read address */
-#if ANDROID_VERSION >= 21
-    nsresult rv = UnpackPDU(
-      pdu, UnpackConversion<BluetoothAddress, nsAString>(aArg1));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-#else
-    aArg1 = sConnectedDeviceAddress;
-#endif
-    WarnAboutTrailingData();
-    return NS_OK;
-  }
-};
-
 void
 BluetoothDaemonHandsfreeModule::KeyPressedNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
 {
   KeyPressedNotification::Dispatch(
     &BluetoothHandsfreeNotificationHandler::KeyPressedNotification,
-    KeyPressedInitOp(aPDU));
+    UnpackPDUInitOp(aPDU));
 }
 
 void
 BluetoothDaemonHandsfreeModule::HandleNtf(
   const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
   void* aUserData)
 {
   static void (BluetoothDaemonHandsfreeModule::* const HandleNtf[])(
@@ -1476,34 +992,33 @@ public:
 
 private:
   nsRefPtr<BluetoothHandsfreeResultHandler> mRes;
 };
 
 void
 BluetoothDaemonHandsfreeInterface::Init(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler,
-  int aMaxNumClients, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   // Set notification handler _before_ registering the module. It could
   // happen that we receive notifications, before the result handler runs.
   mModule->SetNotificationHandler(aNotificationHandler);
 
   InitResultHandler* res;
 
   if (aRes) {
     res = new InitResultHandler(aRes);
   } else {
     // We don't need a result handler if the caller is not interested.
     res = nullptr;
   }
 
   nsresult rv = mModule->RegisterModule(
-    BluetoothDaemonHandsfreeModule::SERVICE_ID, MODE_NARROWBAND_SPEECH,
-    aMaxNumClients, res);
+    BluetoothDaemonHandsfreeModule::SERVICE_ID, MODE_NARROWBAND_SPEECH, res);
 
   if (NS_FAILED(rv) && aRes) {
     DispatchError(aRes, STATUS_FAIL);
   }
 }
 
 class BluetoothDaemonHandsfreeInterface::CleanupResultHandler MOZ_FINAL
   : public BluetoothSetupResultHandler
@@ -1590,42 +1105,42 @@ BluetoothDaemonHandsfreeInterface::Disco
 
   mModule->DisconnectAudioCmd(aBdAddr, aRes);
 }
 
 /* Voice Recognition */
 
 void
 BluetoothDaemonHandsfreeInterface::StartVoiceRecognition(
-  const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->StartVoiceRecognitionCmd(aBdAddr, aRes);
+  mModule->StartVoiceRecognitionCmd(aRes);
 }
 
 void
 BluetoothDaemonHandsfreeInterface::StopVoiceRecognition(
-  const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->StopVoiceRecognitionCmd(aBdAddr, aRes);
+  mModule->StopVoiceRecognitionCmd(aRes);
 }
 
 /* Volume */
 
 void
 BluetoothDaemonHandsfreeInterface::VolumeControl(
-  BluetoothHandsfreeVolumeType aType, int aVolume, const nsAString& aBdAddr,
+  BluetoothHandsfreeVolumeType aType, int aVolume,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->VolumeControlCmd(aType, aVolume, aBdAddr, aRes);
+  mModule->VolumeControlCmd(aType, aVolume, aRes);
 }
 
 /* Device status */
 
 void
 BluetoothDaemonHandsfreeInterface::DeviceStatusNotification(
   BluetoothHandsfreeNetworkState aNtkState,
   BluetoothHandsfreeServiceType aSvcType, int aSignal, int aBattChg,
@@ -1636,72 +1151,69 @@ BluetoothDaemonHandsfreeInterface::Devic
   mModule->DeviceStatusNotificationCmd(aNtkState, aSvcType, aSignal,
                                        aBattChg, aRes);
 }
 
 /* Responses */
 
 void
 BluetoothDaemonHandsfreeInterface::CopsResponse(
-  const char* aCops, const nsAString& aBdAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aCops, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->CopsResponseCmd(aCops, aBdAddr, aRes);
+  mModule->CopsResponseCmd(aCops, aRes);
 }
 
 void
 BluetoothDaemonHandsfreeInterface::CindResponse(
   int aSvc, int aNumActive, int aNumHeld,
   BluetoothHandsfreeCallState aCallSetupState,
   int aSignal, int aRoam, int aBattChg,
-  const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
   mModule->CindResponseCmd(aSvc, aNumActive, aNumHeld, aCallSetupState,
-                           aSignal, aRoam, aBattChg, aBdAddr, aRes);
+                           aSignal, aRoam, aBattChg, aRes);
 }
 
 void
 BluetoothDaemonHandsfreeInterface::FormattedAtResponse(
-  const char* aRsp, const nsAString& aBdAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aRsp, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->FormattedAtResponseCmd(aRsp, aBdAddr, aRes);
+  mModule->FormattedAtResponseCmd(aRsp, aRes);
 }
 
 void
 BluetoothDaemonHandsfreeInterface::AtResponse(
   BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
-  const nsAString& aBdAddr, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
-  mModule->AtResponseCmd(aResponseCode, aErrorCode, aBdAddr, aRes);
+  mModule->AtResponseCmd(aResponseCode, aErrorCode, aRes);
 }
 
 void
 BluetoothDaemonHandsfreeInterface::ClccResponse(
   int aIndex, BluetoothHandsfreeCallDirection aDir,
   BluetoothHandsfreeCallState aState,
   BluetoothHandsfreeCallMode aMode,
   BluetoothHandsfreeCallMptyType aMpty,
   const nsAString& aNumber,
   BluetoothHandsfreeCallAddressType aType,
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
   mModule->ClccResponseCmd(aIndex, aDir, aState, aMode, aMpty, aNumber,
-                           aType, aBdAddr, aRes);
+                           aType, aRes);
 }
 
 /* Phone State */
 
 void
 BluetoothDaemonHandsfreeInterface::PhoneStateChange(
   int aNumActive, int aNumHeld,
   BluetoothHandsfreeCallState aCallSetupState,
@@ -1710,28 +1222,16 @@ BluetoothDaemonHandsfreeInterface::Phone
   BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(mModule);
 
   mModule->PhoneStateChangeCmd(aNumActive, aNumHeld, aCallSetupState, aNumber,
                                aType, aRes);
 }
 
-/* Wide Band Speech */
-
-void
-BluetoothDaemonHandsfreeInterface::ConfigureWbs(
-  const nsAString& aBdAddr, BluetoothHandsfreeWbsConfig aConfig,
-  BluetoothHandsfreeResultHandler* aRes)
-{
-  MOZ_ASSERT(mModule);
-
-  mModule->ConfigureWbsCmd(aBdAddr, aConfig, aRes);
-}
-
 void
 BluetoothDaemonHandsfreeInterface::DispatchError(
   BluetoothHandsfreeResultHandler* aRes, BluetoothStatus aStatus)
 {
   BluetoothResultRunnable1<BluetoothHandsfreeResultHandler, void,
                            BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothHandsfreeResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.h
@@ -38,17 +38,16 @@ public:
     OPCODE_AT_RESPONSE = 0x0c,
     OPCODE_CLCC_RESPONSE = 0x0d,
     OPCODE_PHONE_STATE_CHANGE = 0x0e
   };
 
   virtual nsresult Send(BluetoothDaemonPDU* 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;
 
   void SetNotificationHandler(
     BluetoothHandsfreeNotificationHandler* aNotificationHandler);
 
@@ -62,72 +61,61 @@ public:
                          BluetoothHandsfreeResultHandler* aRes);
   nsresult ConnectAudioCmd(const nsAString& aBdAddr,
                            BluetoothHandsfreeResultHandler* aRes);
   nsresult DisconnectAudioCmd(const nsAString& aBdAddr,
                               BluetoothHandsfreeResultHandler* aRes);
 
   /* Voice Recognition */
 
-  nsresult StartVoiceRecognitionCmd(const nsAString& aBdAddr,
-                                    BluetoothHandsfreeResultHandler* aRes);
-  nsresult StopVoiceRecognitionCmd(const nsAString& aBdAddr,
-                                   BluetoothHandsfreeResultHandler* aRes);
+  nsresult StartVoiceRecognitionCmd(BluetoothHandsfreeResultHandler* aRes);
+  nsresult StopVoiceRecognitionCmd(BluetoothHandsfreeResultHandler* aRes);
 
   /* Volume */
 
   nsresult VolumeControlCmd(BluetoothHandsfreeVolumeType aType, int aVolume,
-                            const nsAString& aBdAddr,
                             BluetoothHandsfreeResultHandler* aRes);
 
   /* Device status */
 
   nsresult DeviceStatusNotificationCmd(
     BluetoothHandsfreeNetworkState aNtkState,
     BluetoothHandsfreeServiceType aSvcType,
     int aSignal, int aBattChg,
     BluetoothHandsfreeResultHandler* aRes);
 
   /* Responses */
 
-  nsresult CopsResponseCmd(const char* aCops, const nsAString& aBdAddr,
+  nsresult CopsResponseCmd(const char* aCops,
                            BluetoothHandsfreeResultHandler* aRes);
   nsresult CindResponseCmd(int aSvc, int aNumActive, int aNumHeld,
                            BluetoothHandsfreeCallState aCallSetupState,
                            int aSignal, int aRoam, int aBattChg,
-                           const nsAString& aBdAddr,
                            BluetoothHandsfreeResultHandler* aRes);
-  nsresult FormattedAtResponseCmd(const char* aRsp, const nsAString& aBdAddr,
+  nsresult FormattedAtResponseCmd(const char* aRsp,
                                   BluetoothHandsfreeResultHandler* aRes);
   nsresult AtResponseCmd(BluetoothHandsfreeAtResponse aResponseCode,
-                         int aErrorCode, const nsAString& aBdAddr,
+                         int aErrorCode,
                          BluetoothHandsfreeResultHandler* aRes);
   nsresult ClccResponseCmd(int aIndex, BluetoothHandsfreeCallDirection aDir,
                            BluetoothHandsfreeCallState aState,
                            BluetoothHandsfreeCallMode aMode,
                            BluetoothHandsfreeCallMptyType aMpty,
                            const nsAString& aNumber,
                            BluetoothHandsfreeCallAddressType aType,
-                           const nsAString& aBdAddr,
                            BluetoothHandsfreeResultHandler* aRes);
 
   /* Phone State */
 
   nsresult PhoneStateChangeCmd(int aNumActive, int aNumHeld,
                                BluetoothHandsfreeCallState aCallSetupState,
                                const nsAString& aNumber,
                                BluetoothHandsfreeCallAddressType aType,
                                BluetoothHandsfreeResultHandler* aRes);
 
-  /* Wide Band Speech */
-
-  nsresult ConfigureWbsCmd(const nsAString& aBdAddr,
-                           BluetoothHandsfreeWbsConfig aConfig,
-                           BluetoothHandsfreeResultHandler* aRes);
-
 protected:
   nsresult Send(BluetoothDaemonPDU* aPDU,
                 BluetoothHandsfreeResultHandler* aRes);
 
   void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
                  BluetoothDaemonPDU& aPDU, void* aUserData);
 
   //
@@ -220,103 +208,70 @@ protected:
 
   typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
                                          BluetoothHandsfreeAudioState,
                                          nsString,
                                          BluetoothHandsfreeAudioState,
                                          const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeVoiceRecognitionState, nsString,
-    BluetoothHandsfreeVoiceRecognitionState, const nsAString&>
+  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
+    BluetoothHandsfreeVoiceRecognitionState>
     VoiceRecognitionNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     AnswerCallNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     HangupCallNotification;
 
-  typedef BluetoothNotificationRunnable3<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeVolumeType, int, nsString,
-    BluetoothHandsfreeVolumeType, int, const nsAString&>
+  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
+                                         BluetoothHandsfreeVolumeType, int>
     VolumeNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    nsString, nsString,
-    const nsAString&, const nsAString&>
+  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
+                                         nsString, const nsAString&>
     DialCallNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    char, nsString,
-    char, const nsAString&>
+  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
+                                         char>
     DtmfNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeNRECState, nsString,
-    BluetoothHandsfreeNRECState, const nsAString&>
+  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
+                                         BluetoothHandsfreeNRECState>
     NRECNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    BluetoothHandsfreeCallHoldType, nsString,
-    BluetoothHandsfreeCallHoldType, const nsAString&>
-    CallHoldNotification;
-
   typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+                                         BluetoothHandsfreeCallHoldType>
+    CallHoldNotification;
+
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     CnumNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     CindNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     CopsNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     ClccNotification;
 
-  typedef BluetoothNotificationRunnable2<NotificationHandlerWrapper, void,
-    nsCString, nsString,
-    const nsACString&, const nsAString&>
+  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
+                                         nsCString, const nsACString&>
     UnknownAtNotification;
 
-  typedef BluetoothNotificationRunnable1<NotificationHandlerWrapper, void,
-    nsString,
-    const nsAString&>
+  typedef BluetoothNotificationRunnable0<NotificationHandlerWrapper, void>
     KeyPressedNotification;
 
+  class AudioStateInitOp;
   class ConnectionStateInitOp;
-  class AudioStateInitOp;
-  class VoiceRecognitionInitOp;
-  class AnswerCallInitOp;
-  class HangupCallInitOp;
-  class VolumeInitOp;
   class DialCallInitOp;
-  class DtmfInitOp;
-  class NRECInitOp;
-  class CallHoldInitOp;
-  class CnumInitOp;
-  class CindInitOp;
-  class CopsInitOp;
-  class ClccInitOp;
   class VolumeInitOp;
   class UnknownAtInitOp;
-  class KeyPressedInitOp;
 
   void ConnectionStateNtf(const BluetoothDaemonPDUHeader& aHeader,
                           BluetoothDaemonPDU& aPDU);
 
   void AudioStateNtf(const BluetoothDaemonPDUHeader& aHeader,
                      BluetoothDaemonPDU& aPDU);
 
   void VoiceRecognitionNtf(const BluetoothDaemonPDUHeader& aHeader,
@@ -361,24 +316,16 @@ protected:
   void KeyPressedNtf(const BluetoothDaemonPDUHeader& aHeader,
                      BluetoothDaemonPDU& aPDU);
 
   void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
                  BluetoothDaemonPDU& 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.
-   */
-  static nsString sConnectedDeviceAddress;
-#endif
 };
 
 class BluetoothDaemonHandsfreeInterface MOZ_FINAL
   : public BluetoothHandsfreeInterface
 {
   class CleanupResultHandler;
   class InitResultHandler;
 
@@ -389,86 +336,75 @@ class BluetoothDaemonHandsfreeInterface 
   };
 
 public:
   BluetoothDaemonHandsfreeInterface(BluetoothDaemonHandsfreeModule* aModule);
   ~BluetoothDaemonHandsfreeInterface();
 
   void Init(
     BluetoothHandsfreeNotificationHandler* aNotificationHandler,
-    int aMaxNumClients, BluetoothHandsfreeResultHandler* aRes);
+    BluetoothHandsfreeResultHandler* aRes);
   void Cleanup(BluetoothHandsfreeResultHandler* aRes);
 
   /* Connect / Disconnect */
 
   void Connect(const nsAString& aBdAddr,
                BluetoothHandsfreeResultHandler* aRes);
   void Disconnect(const nsAString& aBdAddr,
                   BluetoothHandsfreeResultHandler* aRes);
   void ConnectAudio(const nsAString& aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
   void DisconnectAudio(const nsAString& aBdAddr,
                        BluetoothHandsfreeResultHandler* aRes);
 
   /* Voice Recognition */
 
-  void StartVoiceRecognition(const nsAString& aBdAddr,
-                             BluetoothHandsfreeResultHandler* aRes);
-  void StopVoiceRecognition(const nsAString& aBdAddr,
-                            BluetoothHandsfreeResultHandler* aRes);
+  void StartVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
+  void StopVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
 
   /* Volume */
 
   void VolumeControl(BluetoothHandsfreeVolumeType aType, int aVolume,
-                     const nsAString& aBdAddr,
                      BluetoothHandsfreeResultHandler* aRes);
 
   /* Device status */
 
   void DeviceStatusNotification(BluetoothHandsfreeNetworkState aNtkState,
                                 BluetoothHandsfreeServiceType aSvcType,
                                 int aSignal, int aBattChg,
                                 BluetoothHandsfreeResultHandler* aRes);
 
   /* Responses */
 
-  void CopsResponse(const char* aCops, const nsAString& aBdAddr,
+  void CopsResponse(const char* aCops,
                     BluetoothHandsfreeResultHandler* aRes);
   void CindResponse(int aSvc, int aNumActive, int aNumHeld,
                     BluetoothHandsfreeCallState aCallSetupState,
                     int aSignal, int aRoam, int aBattChg,
-                    const nsAString& aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
-  void FormattedAtResponse(const char* aRsp, const nsAString& aBdAddr,
+  void FormattedAtResponse(const char* aRsp,
                            BluetoothHandsfreeResultHandler* aRes);
   void AtResponse(BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
-                  const nsAString& aBdAddr,
                   BluetoothHandsfreeResultHandler* aRes);
   void ClccResponse(int aIndex, BluetoothHandsfreeCallDirection aDir,
                     BluetoothHandsfreeCallState aState,
                     BluetoothHandsfreeCallMode aMode,
                     BluetoothHandsfreeCallMptyType aMpty,
                     const nsAString& aNumber,
                     BluetoothHandsfreeCallAddressType aType,
-                    const nsAString& aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
 
   /* Phone State */
 
   void PhoneStateChange(int aNumActive, int aNumHeld,
                         BluetoothHandsfreeCallState aCallSetupState,
                         const nsAString& aNumber,
                         BluetoothHandsfreeCallAddressType aType,
                         BluetoothHandsfreeResultHandler* aRes);
 
-  /* Wide Band Speech */
-  void ConfigureWbs(const nsAString& aBdAddr,
-                    BluetoothHandsfreeWbsConfig aConfig,
-                    BluetoothHandsfreeResultHandler* aRes);
-
 private:
   void DispatchError(BluetoothHandsfreeResultHandler* aRes,
                      BluetoothStatus aStatus);
 
   BluetoothDaemonHandsfreeModule* mModule;
 };
 
 END_BLUETOOTH_NAMESPACE
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
@@ -1255,22 +1255,16 @@ PackPDU(const BluetoothServiceName& aIn,
 
 nsresult
 PackPDU(BluetoothSocketType aIn, BluetoothDaemonPDU& aPDU)
 {
   return PackPDU(PackConversion<BluetoothSocketType, uint8_t>(aIn), aPDU);
 }
 
 nsresult
-PackPDU(BluetoothTransport aIn, BluetoothDaemonPDU& aPDU)
-{
-  return PackPDU(PackConversion<BluetoothTransport, uint8_t>(aIn), aPDU);
-}
-
-nsresult
 PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU)
 {
   return PackPDU(PackConversion<ControlPlayStatus, uint8_t>(aIn), aPDU);
 }
 
 //
 // Unpacking
 //
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
@@ -414,19 +414,16 @@ PackPDU(BluetoothSocketType aIn, Bluetoo
 
 nsresult
 PackPDU(BluetoothSspPairingVariant aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
 PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU);
 
 nsresult
-PackPDU(BluetoothTransport aIn, BluetoothDaemonPDU& aPDU);
-
-nsresult
 PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& 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 {
@@ -616,55 +613,16 @@ PackPDU(const T1& aIn1, const T2& aIn2, 
   }
   rv = PackPDU(aIn6, aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
   return PackPDU(aIn7, aPDU);
 }
 
-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)
-{
-  nsresult rv = PackPDU(aIn1, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn2, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn3, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn4, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn5, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn6, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = PackPDU(aIn7, aPDU);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  return PackPDU(aIn8, aPDU);
-}
-
 //
 // Unpacking
 //
 
 inline nsresult
 UnpackPDU(BluetoothDaemonPDU& aPDU, int8_t& aOut)
 {
   return aPDU.Read(aOut);
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -26,28 +26,23 @@ class BluetoothDaemonSetupModule
 {
 public:
   virtual nsresult Send(BluetoothDaemonPDU* 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));
 
-#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;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
@@ -188,19 +183,16 @@ private:
 // Core module
 //
 
 static BluetoothNotificationHandler* sNotificationHandler;
 
 class BluetoothDaemonCoreModule
 {
 public:
-
-  static const int MAX_NUM_CLIENTS;
-
   virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
 
   nsresult EnableCmd(BluetoothResultHandler* aRes)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     nsAutoPtr<BluetoothDaemonPDU> pdu(new BluetoothDaemonPDU(0x01, 0x01, 0));
 
@@ -409,30 +401,24 @@ public:
     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));
 
-#if ANDROID_VERSION >= 21
-    nsresult rv = PackPDU(
-      PackConversion<nsAString, BluetoothAddress>(aBdAddr), aTransport, *pdu);
-#else
     nsresult rv = PackPDU(
       PackConversion<nsAString, BluetoothAddress>(aBdAddr), *pdu);
-#endif
     if (NS_FAILED(rv)) {
       return rv;
     }
     rv = Send(pdu, aRes);
     if (NS_FAILED(rv)) {
       return rv;
     }
     unused << pdu.forget();
@@ -1362,18 +1348,16 @@ private:
       return;
     }
 
     (this->*(HandleNtf[index]))(aHeader, aPDU);
   }
 
 };
 
-const int BluetoothDaemonCoreModule::MAX_NUM_CLIENTS = 1;
-
 //
 // Protocol handling
 //
 
 // |BluetoothDaemonProtocol| is the central class for communicating
 // with the Bluetooth daemon. It maintains both socket connections
 // to the external daemon and implements the complete HAL protocol
 // by inheriting from base-class modules.
@@ -1428,17 +1412,17 @@ class BluetoothDaemonProtocol MOZ_FINAL
   , public BluetoothDaemonSocketModule
   , public BluetoothDaemonHandsfreeModule
   , public BluetoothDaemonA2dpModule
   , public BluetoothDaemonAvrcpModule
 {
 public:
   BluetoothDaemonProtocol(BluetoothDaemonConnection* aConnection);
 
-  nsresult RegisterModule(uint8_t aId, uint8_t aMode, uint32_t aMaxNumClients,
+  nsresult RegisterModule(uint8_t aId, uint8_t aMode,
                           BluetoothSetupResultHandler* aRes) MOZ_OVERRIDE;
 
   nsresult UnregisterModule(uint8_t aId,
                             BluetoothSetupResultHandler* aRes) MOZ_OVERRIDE;
 
   // Outgoing PDUs
   //
 
@@ -1475,21 +1459,19 @@ BluetoothDaemonProtocol::BluetoothDaemon
   BluetoothDaemonConnection* aConnection)
   : mConnection(aConnection)
 {
   MOZ_ASSERT(mConnection);
 }
 
 nsresult
 BluetoothDaemonProtocol::RegisterModule(uint8_t aId, uint8_t aMode,
-                                        uint32_t aMaxNumClients,
                                         BluetoothSetupResultHandler* aRes)
 {
-  return BluetoothDaemonSetupModule::RegisterModuleCmd(aId, aMode,
-                                                       aMaxNumClients, aRes);
+  return BluetoothDaemonSetupModule::RegisterModuleCmd(aId, aMode, aRes);
 }
 
 nsresult
 BluetoothDaemonProtocol::UnregisterModule(uint8_t aId,
                                           BluetoothSetupResultHandler* aRes)
 {
   return BluetoothDaemonSetupModule::UnregisterModuleCmd(aId, aRes);
 }
@@ -1759,18 +1741,17 @@ public:
   void RegisterModule() MOZ_OVERRIDE
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(mInterface->mProtocol);
 
     if (!mRegisteredSocketModule) {
       mRegisteredSocketModule = true;
       // Init, step 4: Register Socket module
-      mInterface->mProtocol->RegisterModuleCmd(0x02, 0x00,
-        BluetoothDaemonSocketModule::MAX_NUM_CLIENTS, this);
+      mInterface->mProtocol->RegisterModuleCmd(0x02, 0x00, this);
     } else if (mRes) {
       // Init, step 5: Signal success to caller
       mRes->Init();
     }
   }
 
 private:
   BluetoothDaemonInterface* mInterface;
@@ -1799,18 +1780,17 @@ BluetoothDaemonInterface::OnConnectSucce
       break;
 
     case NTF_CHANNEL: {
         nsRefPtr<BluetoothResultHandler> res = mResultHandlerQ.ElementAt(0);
         mResultHandlerQ.RemoveElementAt(0);
 
         // Init, step 3: Register Core module
         nsresult rv = mProtocol->RegisterModuleCmd(
-          0x01, 0x00, BluetoothDaemonCoreModule::MAX_NUM_CLIENTS,
-          new InitResultHandler(this, res));
+          0x01, 0x00, new InitResultHandler(this, res));
         if (NS_FAILED(rv) && res) {
           DispatchError(res, STATUS_FAIL);
         }
       }
       break;
   }
 }
 
@@ -2032,21 +2012,20 @@ BluetoothDaemonInterface::CancelDiscover
   static_cast<BluetoothDaemonCoreModule*>
     (mProtocol)->CancelDiscoveryCmd(aRes);
 }
 
 /* Bonds */
 
 void
 BluetoothDaemonInterface::CreateBond(const nsAString& aBdAddr,
-                                     BluetoothTransport aTransport,
                                      BluetoothResultHandler* aRes)
 {
   static_cast<BluetoothDaemonCoreModule*>
-    (mProtocol)->CreateBondCmd(aBdAddr, aTransport, aRes);
+    (mProtocol)->CreateBondCmd(aBdAddr, aRes);
 }
 
 void
 BluetoothDaemonInterface::RemoveBond(const nsAString& aBdAddr,
                                      BluetoothResultHandler* aRes)
 {
   static_cast<BluetoothDaemonCoreModule*>
     (mProtocol)->RemoveBondCmd(aBdAddr, aRes);
@@ -2055,25 +2034,16 @@ BluetoothDaemonInterface::RemoveBond(con
 void
 BluetoothDaemonInterface::CancelBond(const nsAString& aBdAddr,
                                      BluetoothResultHandler* aRes)
 {
   static_cast<BluetoothDaemonCoreModule*>
     (mProtocol)->CancelBondCmd(aBdAddr, aRes);
 }
 
-/* Connection */
-
-void
-BluetoothDaemonInterface::GetConnectionState(const nsAString& aBdAddr,
-                                             BluetoothResultHandler* aRes)
-{
-  // NO-OP: no corresponding interface of current BlueZ
-}
-
 /* Authentication */
 
 void
 BluetoothDaemonInterface::PinReply(const nsAString& aBdAddr, bool aAccept,
                                    const nsAString& aPinCode,
                                    BluetoothResultHandler* aRes)
 {
   static_cast<BluetoothDaemonCoreModule*>
@@ -2115,24 +2085,16 @@ void
 BluetoothDaemonInterface::LeTestMode(uint16_t aOpcode, uint8_t* aBuf,
                                      uint8_t aLen,
                                      BluetoothResultHandler* aRes)
 {
   static_cast<BluetoothDaemonCoreModule*>
     (mProtocol)->LeTestModeCmd(aOpcode, aBuf, aLen, aRes);
 }
 
-/* Energy Information */
-
-void
-BluetoothDaemonInterface::ReadEnergyInfo(BluetoothResultHandler* aRes)
-{
-  // NO-OP: no corresponding interface of current BlueZ
-}
-
 void
 BluetoothDaemonInterface::DispatchError(BluetoothResultHandler* aRes,
                                         BluetoothStatus aStatus)
 {
   BluetoothResultRunnable1<
     BluetoothResultHandler, void, BluetoothStatus, BluetoothStatus>::Dispatch(
     aRes, &BluetoothResultHandler::OnError,
     ConstantInitOp1<BluetoothStatus>(aStatus));
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h
@@ -66,26 +66,20 @@ public:
 
   /* Discovery */
 
   void StartDiscovery(BluetoothResultHandler* aRes);
   void CancelDiscovery(BluetoothResultHandler* aRes);
 
   /* Bonds */
 
-  void CreateBond(const nsAString& aBdAddr, BluetoothTransport aTransport,
-                  BluetoothResultHandler* aRes);
+  void CreateBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
   void RemoveBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
   void CancelBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
 
-  /* Connection */
-
-  void GetConnectionState(const nsAString& aBdAddr,
-                          BluetoothResultHandler* aRes);
-
   /* Authentication */
 
   void PinReply(const nsAString& aBdAddr, bool aAccept,
                 const nsAString& aPinCode,
                 BluetoothResultHandler* aRes);
 
   void SspReply(const nsAString& aBdAddr, const nsAString& aVariant,
                 bool aAccept, uint32_t aPasskey,
@@ -97,20 +91,16 @@ public:
   void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                    BluetoothResultHandler* aRes);
 
   /* LE Mode */
 
   void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                   BluetoothResultHandler* aRes);
 
-  /* Energy Information */
-
-  void ReadEnergyInfo(BluetoothResultHandler* aRes);
-
   /* Profile Interfaces */
 
   BluetoothSocketInterface* GetBluetoothSocketInterface() MOZ_OVERRIDE;
   BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface() MOZ_OVERRIDE;
   BluetoothA2dpInterface* GetBluetoothA2dpInterface() MOZ_OVERRIDE;
   BluetoothAvrcpInterface* GetBluetoothAvrcpInterface() MOZ_OVERRIDE;
 
 protected:
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
@@ -10,18 +10,16 @@
 #include "mozilla/unused.h"
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // Socket module
 //
 
-const int BluetoothDaemonSocketModule::MAX_NUM_CLIENTS = 1;
-
 // Commands
 //
 
 nsresult
 BluetoothDaemonSocketModule::ListenCmd(BluetoothSocketType aType,
                                        const nsAString& aServiceName,
                                        const uint8_t aServiceUuid[16],
                                        int aChannel, bool aEncrypt,
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h
@@ -15,18 +15,16 @@ BEGIN_BLUETOOTH_NAMESPACE
 
 using namespace mozilla::ipc;
 
 class BlutoothDaemonInterface;
 
 class BluetoothDaemonSocketModule
 {
 public:
-  static const int MAX_NUM_CLIENTS;
-
   virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
 
   // Commands
   //
 
   nsresult ListenCmd(BluetoothSocketType aType,
                      const nsAString& aServiceName,
                      const uint8_t aServiceUuid[16],
--- a/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHALHelpers.cpp
@@ -206,49 +206,16 @@ Convert(const btrc_player_settings_t& aI
   aOut.mNumAttr = aIn.num_attr;
   memcpy(aOut.mIds, aIn.attr_ids, aIn.num_attr);
   memcpy(aOut.mValues, aIn.attr_values, aIn.num_attr);
 
   return NS_OK;
 }
 #endif // ANDROID_VERSION >= 18
 
-#if ANDROID_VERSION >= 21
-nsresult
-Convert(const bt_activity_energy_info& aIn, BluetoothActivityEnergyInfo& aOut)
-{
-  nsresult rv = Convert(aIn.status, aOut.mStatus);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = Convert(aIn.ctrl_state, aOut.mStackState);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = Convert(aIn.tx_time, aOut.mTxTime);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = Convert(aIn.rx_time, aOut.mRxTime);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = Convert(aIn.idle_time, aOut.mIdleTime);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  rv = Convert(aIn.energy_used, aOut.mEnergyUsed);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  return NS_OK;
-}
-#endif // ANDROID_VERSION >= 21
-
 nsresult
 Convert(const bt_property_t& aIn, BluetoothProperty& aOut)
 {
   /* type conversion */
 
   nsresult rv = Convert(aIn.type, aOut.mType);
   if (NS_FAILED(rv)) {
     return rv;
--- a/dom/bluetooth/bluedroid/BluetoothHALHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothHALHelpers.h
@@ -760,66 +760,16 @@ Convert(btrc_remote_features_t aIn, unsi
   /* The input type's name is misleading. The converted value is
    * actually a bitmask.
    */
   aOut = static_cast<unsigned long>(aIn);
   return NS_OK;
 }
 #endif // ANDROID_VERSION >= 19
 
-#if ANDROID_VERSION >= 21
-inline nsresult
-Convert(BluetoothTransport aIn, int& aOut)
-{
-  static const int sTransport[] = {
-    CONVERT(TRANSPORT_AUTO, 0),
-    CONVERT(TRANSPORT_BREDR, 1),
-    CONVERT(TRANSPORT_LE, 2)
-  };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sTransport))) {
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  aOut = sTransport[aIn];
-  return NS_OK;
-}
-
-nsresult
-Convert(const bt_activity_energy_info& aIn, BluetoothActivityEnergyInfo& aOut);
-
-inline nsresult
-Convert(bthf_wbs_config_t aIn, BluetoothHandsfreeWbsConfig& aOut)
-{
-  static const BluetoothHandsfreeWbsConfig sWbsConfig[] = {
-    CONVERT(BTHF_WBS_NONE, HFP_WBS_NONE),
-    CONVERT(BTHF_WBS_NO, HFP_WBS_NO),
-    CONVERT(BTHF_WBS_YES, HFP_WBS_YES)
-  };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  aOut = sWbsConfig[aIn];
-  return NS_OK;
-}
-
-inline nsresult
-Convert(BluetoothHandsfreeWbsConfig aIn, bthf_wbs_config_t& aOut)
-{
-  static const bthf_wbs_config_t sWbsConfig[] = {
-    CONVERT(HFP_WBS_NONE, BTHF_WBS_NONE),
-    CONVERT(HFP_WBS_NO, BTHF_WBS_NO),
-    CONVERT(HFP_WBS_YES, BTHF_WBS_YES)
-  };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
-    return NS_ERROR_ILLEGAL_VALUE;
-  }
-  aOut = sWbsConfig[aIn];
-  return NS_OK;
-}
-#endif // ANDROID_VERSION >= 21
-
 /* |ConvertArray| is a helper for converting arrays. Pass an
  * instance of this structure as the first argument to |Convert|
  * to convert an array. The output type has to support the array
  * subscript operator.
  */
 template <typename T>
 struct ConvertArray
 {
--- a/dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
@@ -171,21 +171,16 @@ struct BluetoothCallback
                                             uint16_t, nsAutoArrayPtr<uint8_t>,
                                             uint8_t, uint16_t, const uint8_t*>
     DutModeRecvNotification;
 
   typedef BluetoothNotificationHALRunnable2<NotificationHandlerWrapper, void,
                                             BluetoothStatus, uint16_t>
     LeTestModeNotification;
 
-  typedef BluetoothNotificationHALRunnable1<NotificationHandlerWrapper, void,
-                                            BluetoothActivityEnergyInfo,
-                                            const BluetoothActivityEnergyInfo&>
-    EnergyInfoNotification;
-
   // Bluedroid callbacks
 
   static const bt_property_t*
   AlignedProperties(bt_property_t* aProperties, size_t aNumProperties,
                     nsAutoArrayPtr<bt_property_t>& aPropertiesArray)
   {
     // See Bug 989976: consider aProperties address is not aligned. If
     // it is aligned, we return the pointer directly; otherwise we make
@@ -313,67 +308,18 @@ struct BluetoothCallback
 
   static void
   LeTestMode(bt_status_t aStatus, uint16_t aNumPackets)
   {
     LeTestModeNotification::Dispatch(
       &BluetoothNotificationHandler::LeTestModeNotification,
       aStatus, aNumPackets);
   }
-
-#if ANDROID_VERSION >= 21
-  static void
-  EnergyInfo(bt_activity_energy_info* aEnergyInfo)
-  {
-    if (NS_WARN_IF(!aEnergyInfo)) {
-      return;
-    }
-
-    EnergyInfoNotification::Dispatch(
-      &BluetoothNotificationHandler::EnergyInfoNotification,
-      *aEnergyInfo);
-  }
-#endif
 };
 
-#if ANDROID_VERSION >= 21
-struct BluetoothOsCallout
-{
-  static bool
-  SetWakeAlarm(uint64_t aDelayMilliseconds,
-               bool aShouldWake,
-               void (* aAlarmCallback)(void*),
-               void* aData)
-  {
-    // FIXME: need to be implemented in later patches
-    // HAL wants to manage an wake_alarm but Gecko cannot fulfill it for now.
-    // Simply pass the request until a proper implementation has been added.
-    return true;
-  }
-
-  static int
-  AcquireWakeLock(const char* aLockName)
-  {
-    // FIXME: need to be implemented in later patches
-    // HAL wants to manage an wake_lock but Gecko cannot fulfill it for now.
-    // Simply pass the request until a proper implementation has been added.
-    return BT_STATUS_SUCCESS;
-  }
-
-  static int
-  ReleaseWakeLock(const char* aLockName)
-  {
-    // FIXME: need to be implemented in later patches
-    // HAL wants to manage an wake_lock but Gecko cannot fulfill it for now.
-    // Simply pass the request until a proper implementation has been added.
-    return BT_STATUS_SUCCESS;
-  }
-};
-#endif
-
 // Interface
 //
 
 /* returns the container structure of a variable; _t is the container's
  * type, _v the name of the variable, and _m is _v's field within _t
  */
 #define container(_t, _v, _m) \
   ( (_t*)( ((const unsigned char*)(_v)) - offsetof(_t, _m) ) )
@@ -458,45 +404,24 @@ BluetoothHALInterface::Init(
     BluetoothCallback::DiscoveryStateChanged,
     BluetoothCallback::PinRequest,
     BluetoothCallback::SspRequest,
     BluetoothCallback::BondStateChanged,
     BluetoothCallback::AclStateChanged,
     BluetoothCallback::ThreadEvt,
     BluetoothCallback::DutModeRecv,
 #if ANDROID_VERSION >= 18
-    BluetoothCallback::LeTestMode,
-#endif
-#if ANDROID_VERSION >= 21
-    BluetoothCallback::EnergyInfo
+    BluetoothCallback::LeTestMode
 #endif
   };
 
-#if ANDROID_VERSION >= 21
-  static bt_os_callouts_t sBluetoothOsCallouts = {
-    sizeof(sBluetoothOsCallouts),
-    BluetoothOsCallout::SetWakeAlarm,
-    BluetoothOsCallout::AcquireWakeLock,
-    BluetoothOsCallout::ReleaseWakeLock
-  };
-#endif
-
   sNotificationHandler = aNotificationHandler;
 
   int status = mInterface->init(&sBluetoothCallbacks);
 
-#if ANDROID_VERSION >= 21
-  if (status == BT_STATUS_SUCCESS) {
-    status = mInterface->set_os_callouts(&sBluetoothOsCallouts);
-    if (status != BT_STATUS_SUCCESS) {
-      mInterface->cleanup();
-    }
-  }
-#endif
-
   if (aRes) {
     DispatchBluetoothHALResult(aRes, &BluetoothResultHandler::Init,
                                ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 void
 BluetoothHALInterface::Cleanup(BluetoothResultHandler* aRes)
@@ -735,32 +660,23 @@ BluetoothHALInterface::CancelDiscovery(B
                                ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 /* Bonds */
 
 void
 BluetoothHALInterface::CreateBond(const nsAString& aBdAddr,
-                                  BluetoothTransport aTransport,
                                   BluetoothResultHandler* aRes)
 {
   bt_bdaddr_t bdAddr;
   int status;
 
-#if ANDROID_VERSION >= 21
-  int transport = 0; /* TRANSPORT_AUTO */
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr)) &&
-      NS_SUCCEEDED(Convert(aTransport, transport))) {
-    status = mInterface->create_bond(&bdAddr, transport);
-#else
   if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
     status = mInterface->create_bond(&bdAddr);
-#endif
   } else {
     status = BT_STATUS_PARM_INVALID;
   }
 
   if (aRes) {
     DispatchBluetoothHALResult(aRes,
                                &BluetoothResultHandler::CreateBond,
                                ConvertDefault(status, STATUS_FAIL));
@@ -802,43 +718,16 @@ BluetoothHALInterface::CancelBond(const 
 
   if (aRes) {
     DispatchBluetoothHALResult(aRes,
                                &BluetoothResultHandler::CancelBond,
                                ConvertDefault(status, STATUS_FAIL));
   }
 }
 
-/* Connection */
-
-void
-BluetoothHALInterface::GetConnectionState(const nsAString& aBdAddr,
-                                          BluetoothResultHandler* aRes)
-{
-  int status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->get_connection_state(&bdAddr);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = BT_STATUS_UNSUPPORTED;
-#endif
-
-  if (aRes) {
-    DispatchBluetoothHALResult(aRes,
-                               &BluetoothResultHandler::GetConnectionState,
-                               ConvertDefault(status, STATUS_FAIL));
-  }
-}
-
 /* Authentication */
 
 void
 BluetoothHALInterface::PinReply(const nsAString& aBdAddr, bool aAccept,
                                 const nsAString& aPinCode,
                                 BluetoothResultHandler* aRes)
 {
   int status;
@@ -937,33 +826,16 @@ BluetoothHALInterface::LeTestMode(uint16
 
   if (aRes) {
     DispatchBluetoothHALResult(aRes,
                                &BluetoothResultHandler::LeTestMode,
                                ConvertDefault(status, STATUS_FAIL));
   }
 }
 
-/* Energy Information */
-void
-BluetoothHALInterface::ReadEnergyInfo(BluetoothResultHandler* aRes)
-{
-#if ANDROID_VERSION >= 21
-  int status = mInterface->read_energy_info();
-#else
-  int status = BT_STATUS_UNSUPPORTED;
-#endif
-
-  if (aRes) {
-    DispatchBluetoothHALResult(aRes,
-                               &BluetoothResultHandler::ReadEnergyInfo,
-                               ConvertDefault(status, STATUS_FAIL));
-  }
-}
-
 /* Profile Interfaces */
 
 template <class T>
 T*
 BluetoothHALInterface::CreateProfileInterface()
 {
   typename interface_traits<T>::const_interface_type* interface =
     reinterpret_cast<typename interface_traits<T>::const_interface_type*>(
--- a/dom/bluetooth/bluedroid/BluetoothHALInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothHALInterface.h
@@ -54,26 +54,20 @@ public:
 
   /* Discovery */
 
   void StartDiscovery(BluetoothResultHandler* aRes);
   void CancelDiscovery(BluetoothResultHandler* aRes);
 
   /* Bonds */
 
-  void CreateBond(const nsAString& aBdAddr, BluetoothTransport aTransport,
-                  BluetoothResultHandler* aRes);
+  void CreateBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
   void RemoveBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
   void CancelBond(const nsAString& aBdAddr, BluetoothResultHandler* aRes);
 
-  /* Connection */
-
-  void GetConnectionState(const nsAString& aBdAddr,
-                          BluetoothResultHandler* aRes);
-
   /* Authentication */
 
   void PinReply(const nsAString& aBdAddr, bool aAccept,
                 const nsAString& aPinCode,
                 BluetoothResultHandler* aRes);
 
   void SspReply(const nsAString& aBdAddr, const nsAString& aVariant,
                 bool aAccept, uint32_t aPasskey,
@@ -85,20 +79,16 @@ public:
   void DutModeSend(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                    BluetoothResultHandler* aRes);
 
   /* LE Mode */
 
   void LeTestMode(uint16_t aOpcode, uint8_t* aBuf, uint8_t aLen,
                   BluetoothResultHandler* aRes);
 
-  /* Energy Information */
-
-  void ReadEnergyInfo(BluetoothResultHandler* aRes);
-
   /* Profile Interfaces */
 
   BluetoothSocketInterface* GetBluetoothSocketInterface();
   BluetoothHandsfreeInterface* GetBluetoothHandsfreeInterface();
   BluetoothA2dpInterface* GetBluetoothA2dpInterface();
   BluetoothAvrcpInterface* GetBluetoothAvrcpInterface();
 
 protected:
--- a/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
@@ -70,450 +70,235 @@ struct BluetoothHandsfreeHALCallback
     ConnectionStateNotification;
 
   typedef BluetoothNotificationHALRunnable2<
     HandsfreeNotificationHandlerWrapper, void,
     BluetoothHandsfreeAudioState, nsString,
     BluetoothHandsfreeAudioState, const nsAString&>
     AudioStateNotification;
 
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    BluetoothHandsfreeVoiceRecognitionState, nsString,
-    BluetoothHandsfreeVoiceRecognitionState, const nsAString&>
-    VoiceRecognitionNotification;
-
-  typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
-    AnswerCallNotification;
-
   typedef BluetoothNotificationHALRunnable1<
     HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
-    HangupCallNotification;
-
-  typedef BluetoothNotificationHALRunnable3<
-    HandsfreeNotificationHandlerWrapper, void,
-    BluetoothHandsfreeVolumeType, int, nsString,
-    BluetoothHandsfreeVolumeType, int, const nsAString&>
-    VolumeNotification;
+    BluetoothHandsfreeVoiceRecognitionState>
+    VoiceRecognitionNotification;
 
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, nsString, const nsAString&, const nsAString&>
-    DialCallNotification;
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
+    AnswerCallNotification;
 
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    char, nsString, char, const nsAString&>
-    DtmfNotification;
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
+    HangupCallNotification;
 
   typedef BluetoothNotificationHALRunnable2<
     HandsfreeNotificationHandlerWrapper, void,
-    BluetoothHandsfreeNRECState, nsString,
-    BluetoothHandsfreeNRECState, const nsAString&>
-    NRECNotification;
-
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    BluetoothHandsfreeWbsConfig, nsString,
-    BluetoothHandsfreeWbsConfig, const nsAString&>
-    WbsNotification;
-
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    BluetoothHandsfreeCallHoldType, nsString,
-    BluetoothHandsfreeCallHoldType, const nsAString&>
-    CallHoldNotification;
+    BluetoothHandsfreeVolumeType, int>
+    VolumeNotification;
 
   typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
-    CnumNotification;
+    HandsfreeNotificationHandlerWrapper, void, nsString, const nsAString&>
+    DialCallNotification;
+
+  typedef BluetoothNotificationHALRunnable1<
+    HandsfreeNotificationHandlerWrapper, void, char>
+    DtmfNotification;
+
+  typedef BluetoothNotificationHALRunnable1<
+    HandsfreeNotificationHandlerWrapper, void, BluetoothHandsfreeNRECState>
+    NRECNotification;
 
   typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
+    HandsfreeNotificationHandlerWrapper, void, BluetoothHandsfreeCallHoldType>
+    CallHoldNotification;
+
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
+    CnumNotification;
+
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
     CindNotification;
 
-  typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
     CopsNotification;
 
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
+    ClccNotification;
+
   typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
-    ClccNotification;
-
-  typedef BluetoothNotificationHALRunnable2<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsCString, nsString, const nsACString&, const nsAString&>
+    HandsfreeNotificationHandlerWrapper, void, nsCString, const nsACString&>
     UnknownAtNotification;
 
-  typedef BluetoothNotificationHALRunnable1<
-    HandsfreeNotificationHandlerWrapper, void,
-    nsString, const nsAString&>
+  typedef BluetoothNotificationHALRunnable0<
+    HandsfreeNotificationHandlerWrapper, void>
     KeyPressedNotification;
 
   // Bluedroid Handsfree callbacks
 
   static void
   ConnectionState(bthf_connection_state_t aState, bt_bdaddr_t* aBdAddr)
   {
-#if ANDROID_VERSION < 21
-    if (aState == BTHF_CONNECTION_STATE_CONNECTED && aBdAddr) {
-      memcpy(&sConnectedDeviceAddress, aBdAddr,
-             sizeof(sConnectedDeviceAddress));
-    } else if (aState == BTHF_CONNECTION_STATE_DISCONNECTED) {
-      memset(&sConnectedDeviceAddress, 0,
-             sizeof(sConnectedDeviceAddress));
-    }
-#endif
-
     ConnectionStateNotification::Dispatch(
       &BluetoothHandsfreeNotificationHandler::ConnectionStateNotification,
       aState, aBdAddr);
   }
 
   static void
   AudioState(bthf_audio_state_t aState, bt_bdaddr_t* aBdAddr)
   {
     AudioStateNotification::Dispatch(
       &BluetoothHandsfreeNotificationHandler::AudioStateNotification,
       aState, aBdAddr);
   }
 
-#if ANDROID_VERSION >= 21
-  static void
-  VoiceRecognition(bthf_vr_state_t aState, bt_bdaddr_t* aBdAddr)
-  {
-    VoiceRecognitionNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification,
-      aState, aBdAddr);
-  }
-#else
   static void
   VoiceRecognition(bthf_vr_state_t aState)
   {
     VoiceRecognitionNotification::Dispatch(
       &BluetoothHandsfreeNotificationHandler::VoiceRecognitionNotification,
-      aState, &sConnectedDeviceAddress);
+      aState);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  AnswerCall(bt_bdaddr_t* aBdAddr)
-  {
-    AnswerCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::AnswerCallNotification,
-      aBdAddr);
-  }
-#else
   static void
   AnswerCall()
   {
     AnswerCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::AnswerCallNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::AnswerCallNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  HangupCall(bt_bdaddr_t* aBdAddr)
-  {
-    HangupCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::HangupCallNotification,
-      aBdAddr);
-  }
-#else
   static void
   HangupCall()
   {
     HangupCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::HangupCallNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::HangupCallNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Volume(bthf_volume_type_t aType, int aVolume, bt_bdaddr_t* aBdAddr)
-  {
-    VolumeNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::VolumeNotification,
-      aType, aVolume, aBdAddr);
-  }
-#else
   static void
   Volume(bthf_volume_type_t aType, int aVolume)
   {
     VolumeNotification::Dispatch(
       &BluetoothHandsfreeNotificationHandler::VolumeNotification,
-      aType, aVolume, &sConnectedDeviceAddress);
+      aType, aVolume);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  DialCall(char* aNumber, bt_bdaddr_t* aBdAddr)
-  {
-    DialCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::DialCallNotification,
-      aNumber, aBdAddr);
-  }
-#else
   static void
   DialCall(char* aNumber)
   {
     DialCallNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::DialCallNotification,
-      aNumber, &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::DialCallNotification, aNumber);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Dtmf(char aDtmf, bt_bdaddr_t* aBdAddr)
-  {
-    DtmfNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::DtmfNotification,
-      aDtmf, aBdAddr);
-  }
-#else
   static void
   Dtmf(char aDtmf)
   {
     DtmfNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::DtmfNotification,
-      aDtmf, &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::DtmfNotification, aDtmf);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  NoiseReductionEchoCancellation(bthf_nrec_t aNrec, bt_bdaddr_t* aBdAddr)
-  {
-    NRECNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::NRECNotification,
-      aNrec, aBdAddr);
-  }
-#else
   static void
   NoiseReductionEchoCancellation(bthf_nrec_t aNrec)
   {
     NRECNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::NRECNotification,
-      aNrec, &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::NRECNotification, aNrec);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  WideBandSpeech(bthf_wbs_config_t aWbs, bt_bdaddr_t* aBdAddr)
-  {
-    WbsNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::WbsNotification,
-      aWbs, aBdAddr);
-  }
-#endif
-
-#if ANDROID_VERSION >= 21
-  static void
-  CallHold(bthf_chld_type_t aChld, bt_bdaddr_t* aBdAddr)
-  {
-    CallHoldNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CallHoldNotification,
-      aChld, aBdAddr);
-  }
-#else
   static void
   CallHold(bthf_chld_type_t aChld)
   {
     CallHoldNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CallHoldNotification,
-      aChld, &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::CallHoldNotification, aChld);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Cnum(bt_bdaddr_t* aBdAddr)
-  {
-    CnumNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CnumNotification,
-      aBdAddr);
-  }
-#else
   static void
   Cnum()
   {
     CnumNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CnumNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::CnumNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Cind(bt_bdaddr_t* aBdAddr)
-  {
-    CindNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CindNotification,
-      aBdAddr);
-  }
-#else
   static void
   Cind()
   {
     CindNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CindNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::CindNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Cops(bt_bdaddr_t* aBdAddr)
-  {
-    CopsNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CopsNotification,
-      aBdAddr);
-  }
-#else
   static void
   Cops()
   {
     CopsNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::CopsNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::CopsNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  Clcc(bt_bdaddr_t* aBdAddr)
-  {
-    ClccNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::ClccNotification,
-      aBdAddr);
-  }
-#else
   static void
   Clcc()
   {
     ClccNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::ClccNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::ClccNotification);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  UnknownAt(char* aAtString, bt_bdaddr_t* aBdAddr)
-  {
-    UnknownAtNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::UnknownAtNotification,
-      aAtString, aBdAddr);
-  }
-#else
   static void
   UnknownAt(char* aAtString)
   {
     UnknownAtNotification::Dispatch(
       &BluetoothHandsfreeNotificationHandler::UnknownAtNotification,
-      aAtString, &sConnectedDeviceAddress);
+      aAtString);
   }
-#endif
 
-#if ANDROID_VERSION >= 21
-  static void
-  KeyPressed(bt_bdaddr_t* aBdAddr)
-  {
-    KeyPressedNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::KeyPressedNotification,
-      aBdAddr);
-  }
-#else
   static void
   KeyPressed()
   {
     KeyPressedNotification::Dispatch(
-      &BluetoothHandsfreeNotificationHandler::KeyPressedNotification,
-      &sConnectedDeviceAddress);
+      &BluetoothHandsfreeNotificationHandler::KeyPressedNotification);
   }
-#endif
-
-#if ANDROID_VERSION < 21
-  /* |sConnectedDeviceAddress| stores Bluetooth device address of the
-  * connected device. Before Android Lollipop, we maintain this address by
-  * ourselves through ConnectionState(); after Android Lollipop, every callback
-  * carries this address directly so we don't have to keep it.
-  */
-  static bt_bdaddr_t sConnectedDeviceAddress;
-#endif
 };
 
-#if ANDROID_VERSION < 21
-bt_bdaddr_t BluetoothHandsfreeHALCallback::sConnectedDeviceAddress = {
-  {0, 0, 0, 0, 0, 0}
-};
-#endif
-
 // Interface
 //
 
 BluetoothHandsfreeHALInterface::BluetoothHandsfreeHALInterface(
   const bthf_interface_t* aInterface)
 : mInterface(aInterface)
 {
   MOZ_ASSERT(mInterface);
 }
 
 BluetoothHandsfreeHALInterface::~BluetoothHandsfreeHALInterface()
 { }
 
 void
 BluetoothHandsfreeHALInterface::Init(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler,
-  int aMaxNumClients, BluetoothHandsfreeResultHandler* aRes)
+  BluetoothHandsfreeResultHandler* aRes)
 {
   static bthf_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothHandsfreeHALCallback::ConnectionState,
     BluetoothHandsfreeHALCallback::AudioState,
     BluetoothHandsfreeHALCallback::VoiceRecognition,
     BluetoothHandsfreeHALCallback::AnswerCall,
     BluetoothHandsfreeHALCallback::HangupCall,
     BluetoothHandsfreeHALCallback::Volume,
     BluetoothHandsfreeHALCallback::DialCall,
     BluetoothHandsfreeHALCallback::Dtmf,
     BluetoothHandsfreeHALCallback::NoiseReductionEchoCancellation,
-#if ANDROID_VERSION >= 21
-    BluetoothHandsfreeHALCallback::WideBandSpeech,
-#endif
     BluetoothHandsfreeHALCallback::CallHold,
     BluetoothHandsfreeHALCallback::Cnum,
     BluetoothHandsfreeHALCallback::Cind,
     BluetoothHandsfreeHALCallback::Cops,
     BluetoothHandsfreeHALCallback::Clcc,
     BluetoothHandsfreeHALCallback::UnknownAt,
     BluetoothHandsfreeHALCallback::KeyPressed
   };
 
   sHandsfreeNotificationHandler = aNotificationHandler;
 
-#if ANDROID_VERSION >= 21
-  bt_status_t status = mInterface->init(&sCallbacks, aMaxNumClients);
-#else
   bt_status_t status = mInterface->init(&sCallbacks);
-#endif
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::Init,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
@@ -610,86 +395,52 @@ BluetoothHandsfreeHALInterface::Disconne
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 /* Voice Recognition */
 
 void
 BluetoothHandsfreeHALInterface::StartVoiceRecognition(
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
-  bt_status_t status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->start_voice_recognition(&bdAddr);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = mInterface->start_voice_recognition();
-#endif
+  bt_status_t status = mInterface->start_voice_recognition();
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::StartVoiceRecognition,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 void
 BluetoothHandsfreeHALInterface::StopVoiceRecognition(
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
-  bt_status_t status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->stop_voice_recognition(&bdAddr);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = mInterface->stop_voice_recognition();
-#endif
+  bt_status_t status = mInterface->stop_voice_recognition();
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::StopVoiceRecognition,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 /* Volume */
 
 void
 BluetoothHandsfreeHALInterface::VolumeControl(
-  BluetoothHandsfreeVolumeType aType, int aVolume, const nsAString& aBdAddr,
+  BluetoothHandsfreeVolumeType aType, int aVolume,
   BluetoothHandsfreeResultHandler* aRes)
 {
   bt_status_t status;
   bthf_volume_type_t type = BTHF_VOLUME_TYPE_SPK;
 
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aType, type)) &&
-      NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->volume_control(type, aVolume, &bdAddr);
-#else
   if (NS_SUCCEEDED(Convert(aType, type))) {
     status = mInterface->volume_control(type, aVolume);
-#endif
   } else {
     status = BT_STATUS_PARM_INVALID;
   }
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::VolumeControl,
       ConvertDefault(status, STATUS_FAIL));
@@ -722,121 +473,75 @@ BluetoothHandsfreeHALInterface::DeviceSt
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 /* Responses */
 
 void
 BluetoothHandsfreeHALInterface::CopsResponse(
-  const char* aCops, const nsAString& aBdAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aCops, BluetoothHandsfreeResultHandler* aRes)
 {
-  bt_status_t status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->cops_response(aCops, &bdAddr);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = mInterface->cops_response(aCops);
-#endif
+  bt_status_t status = mInterface->cops_response(aCops);
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::CopsResponse,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 void
 BluetoothHandsfreeHALInterface::CindResponse(
   int aSvc, int aNumActive, int aNumHeld,
   BluetoothHandsfreeCallState aCallSetupState,
   int aSignal, int aRoam, int aBattChg,
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   bt_status_t status;
   bthf_call_state_t callSetupState = BTHF_CALL_STATE_ACTIVE;
 
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aCallSetupState, callSetupState)) &&
-      NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->cind_response(aSvc, aNumActive, aNumHeld,
-                                       callSetupState, aSignal,
-                                       aRoam, aBattChg, &bdAddr);
-#else
   if (NS_SUCCEEDED(Convert(aCallSetupState, callSetupState))) {
     status = mInterface->cind_response(aSvc, aNumActive, aNumHeld,
                                        callSetupState, aSignal,
                                        aRoam, aBattChg);
-#endif
   } else {
     status = BT_STATUS_PARM_INVALID;
   }
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::CindResponse,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 void
 BluetoothHandsfreeHALInterface::FormattedAtResponse(
-  const char* aRsp, const nsAString& aBdAddr,
-  BluetoothHandsfreeResultHandler* aRes)
+  const char* aRsp, BluetoothHandsfreeResultHandler* aRes)
 {
-  bt_status_t status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->formatted_at_response(aRsp, &bdAddr);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = mInterface->formatted_at_response(aRsp);
-#endif
+  bt_status_t status = mInterface->formatted_at_response(aRsp);
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::FormattedAtResponse,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
 void
 BluetoothHandsfreeHALInterface::AtResponse(
   BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   bt_status_t status;
   bthf_at_response_t responseCode = BTHF_AT_RESPONSE_ERROR;
 
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aResponseCode, responseCode)) &&
-      NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->at_response(responseCode, aErrorCode, &bdAddr);
-#else
   if (NS_SUCCEEDED(Convert(aResponseCode, responseCode))) {
     status = mInterface->at_response(responseCode, aErrorCode);
-#endif
   } else {
     status = BT_STATUS_PARM_INVALID;
   }
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::AtResponse,
       ConvertDefault(status, STATUS_FAIL));
@@ -847,48 +552,33 @@ void
 BluetoothHandsfreeHALInterface::ClccResponse(
   int aIndex,
   BluetoothHandsfreeCallDirection aDir,
   BluetoothHandsfreeCallState aState,
   BluetoothHandsfreeCallMode aMode,
   BluetoothHandsfreeCallMptyType aMpty,
   const nsAString& aNumber,
   BluetoothHandsfreeCallAddressType aType,
-  const nsAString& aBdAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
   bt_status_t status;
   bthf_call_direction_t dir = BTHF_CALL_DIRECTION_OUTGOING;
   bthf_call_state_t state = BTHF_CALL_STATE_ACTIVE;
   bthf_call_mode_t mode = BTHF_CALL_TYPE_VOICE;
   bthf_call_mpty_type_t mpty = BTHF_CALL_MPTY_TYPE_SINGLE;
   bthf_call_addrtype_t type = BTHF_CALL_ADDRTYPE_UNKNOWN;
 
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-
-  if (NS_SUCCEEDED(Convert(aDir, dir)) &&
-      NS_SUCCEEDED(Convert(aState, state)) &&
-      NS_SUCCEEDED(Convert(aMode, mode)) &&
-      NS_SUCCEEDED(Convert(aMpty, mpty)) &&
-      NS_SUCCEEDED(Convert(aType, type)) &&
-      NS_SUCCEEDED(Convert(aBdAddr, bdAddr))) {
-    status = mInterface->clcc_response(aIndex, dir, state, mode, mpty,
-                                       NS_ConvertUTF16toUTF8(aNumber).get(),
-                                       type, &bdAddr);
-#else
   if (NS_SUCCEEDED(Convert(aDir, dir)) &&
       NS_SUCCEEDED(Convert(aState, state)) &&
       NS_SUCCEEDED(Convert(aMode, mode)) &&
       NS_SUCCEEDED(Convert(aMpty, mpty)) &&
       NS_SUCCEEDED(Convert(aType, type))) {
     status = mInterface->clcc_response(aIndex, dir, state, mode, mpty,
                                        NS_ConvertUTF16toUTF8(aNumber).get(),
                                        type);
-#endif
   } else {
     status = BT_STATUS_PARM_INVALID;
   }
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::ClccResponse,
       ConvertDefault(status, STATUS_FAIL));
@@ -918,40 +608,9 @@ BluetoothHandsfreeHALInterface::PhoneSta
 
   if (aRes) {
     DispatchBluetoothHandsfreeHALResult(
       aRes, &BluetoothHandsfreeResultHandler::PhoneStateChange,
       ConvertDefault(status, STATUS_FAIL));
   }
 }
 
-/* Wide Band Speech */
-
-void
-BluetoothHandsfreeHALInterface::ConfigureWbs(
-  const nsAString& aBdAddr,
-  BluetoothHandsfreeWbsConfig aConfig,
-  BluetoothHandsfreeResultHandler* aRes)
-{
-  bt_status_t status;
-
-#if ANDROID_VERSION >= 21
-  bt_bdaddr_t bdAddr;
-  bthf_wbs_config_t wbsConfig;
-
-  if (NS_SUCCEEDED(Convert(aBdAddr, bdAddr)) &&
-      NS_SUCCEEDED(Convert(aConfig, wbsConfig))) {
-    status = mInterface->configure_wbs(&bdAddr, wbsConfig);
-  } else {
-    status = BT_STATUS_PARM_INVALID;
-  }
-#else
-  status = BT_STATUS_UNSUPPORTED;
-#endif
-
-  if (aRes) {
-    DispatchBluetoothHandsfreeHALResult(
-      aRes, &BluetoothHandsfreeResultHandler::ConfigureWbs,
-      ConvertDefault(status, STATUS_FAIL));
-  }
-}
-
 END_BLUETOOTH_NAMESPACE
--- a/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.h
+++ b/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.h
@@ -18,87 +18,75 @@ class BluetoothHALInterface;
 
 class BluetoothHandsfreeHALInterface MOZ_FINAL
   : public BluetoothHandsfreeInterface
 {
 public:
   friend class BluetoothHALInterface;
 
   void Init(BluetoothHandsfreeNotificationHandler* aNotificationHandler,
-            int aMaxNumClients,
             BluetoothHandsfreeResultHandler* aRes);
   void Cleanup(BluetoothHandsfreeResultHandler* aRes);
 
   /* Connect / Disconnect */
 
   void Connect(const nsAString& aBdAddr,
                BluetoothHandsfreeResultHandler* aRes);
   void Disconnect(const nsAString& aBdAddr,
                   BluetoothHandsfreeResultHandler* aRes);
   void ConnectAudio(const nsAString& aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
   void DisconnectAudio(const nsAString& aBdAddr,
                        BluetoothHandsfreeResultHandler* aRes);
 
   /* Voice Recognition */
 
-  void StartVoiceRecognition(const nsAString& aBdAddr,
-                             BluetoothHandsfreeResultHandler* aRes);
-  void StopVoiceRecognition(const nsAString& aBdAddr,
-                            BluetoothHandsfreeResultHandler* aRes);
+  void StartVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
+  void StopVoiceRecognition(BluetoothHandsfreeResultHandler* aRes);
 
   /* Volume */
 
   void VolumeControl(BluetoothHandsfreeVolumeType aType, int aVolume,
-                     const nsAString& aBdAddr,
                      BluetoothHandsfreeResultHandler* aRes);
 
   /* Device status */
 
   void DeviceStatusNotification(BluetoothHandsfreeNetworkState aNtkState,
                                 BluetoothHandsfreeServiceType aSvcType,
                                 int aSignal, int aBattChg,
                                 BluetoothHandsfreeResultHandler* aRes);
 
   /* Responses */
 
-  void CopsResponse(const char* aCops, const nsAString& aBdAddr,
+  void CopsResponse(const char* aCops,
                     BluetoothHandsfreeResultHandler* aRes);
   void CindResponse(int aSvc, int aNumActive, int aNumHeld,
                     BluetoothHandsfreeCallState aCallSetupState, int aSignal,
-                    int aRoam, int aBattChg, const nsAString& aBdAddr,
+                    int aRoam, int aBattChg,
                     BluetoothHandsfreeResultHandler* aRes);
-  void FormattedAtResponse(const char* aRsp, const nsAString& aBdAddr,
+  void FormattedAtResponse(const char* aRsp,
                            BluetoothHandsfreeResultHandler* aRes);
   void AtResponse(BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
-                  const nsAString& aBdAddr,
                   BluetoothHandsfreeResultHandler* aRes);
   void ClccResponse(int aIndex, BluetoothHandsfreeCallDirection aDir,
                     BluetoothHandsfreeCallState aState,
                     BluetoothHandsfreeCallMode aMode,
                     BluetoothHandsfreeCallMptyType aMpty,
                     const nsAString& aNumber,
                     BluetoothHandsfreeCallAddressType aType,
-                    const nsAString& aBdAddr,
                     BluetoothHandsfreeResultHandler* aRes);
 
   /* Phone State */
 
   void PhoneStateChange(int aNumActive, int aNumHeld,
                         BluetoothHandsfreeCallState aCallSetupState,
                         const nsAString& aNumber,
                         BluetoothHandsfreeCallAddressType aType,
                         BluetoothHandsfreeResultHandler* aRes);
 
-  /* Wide Band Speech */
-
-  void ConfigureWbs(const nsAString& aBdAddr,
-                    BluetoothHandsfreeWbsConfig aConfig,
-                    BluetoothHandsfreeResultHandler* aRes);
-
 protected:
   BluetoothHandsfreeHALInterface(const bthf_interface_t* aInterface);
   ~BluetoothHandsfreeHALInterface();
 
 private:
   const bthf_interface_t* mInterface;
 };
 
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -688,17 +688,17 @@ BluetoothServiceBluedroid::CreatePairedD
   BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
 
   sBondingRunnableArray.AppendElement(aRunnable);
 
-  sBtInterface->CreateBond(aDeviceAddress, TRANSPORT_AUTO,
+  sBtInterface->CreateBond(aDeviceAddress,
                            new CreateBondResultHandler(aRunnable));
 
   return NS_OK;
 }
 
 class BluetoothServiceBluedroid::RemoveBondResultHandler MOZ_FINAL
   : public BluetoothResultHandler
 {
@@ -1618,17 +1618,8 @@ BluetoothServiceBluedroid::DutModeRecvNo
 void
 BluetoothServiceBluedroid::LeTestModeNotification(BluetoothStatus aStatus,
                                                   uint16_t aNumPackets)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // FIXME: This will be implemented in the later patchset
 }
-
-void
-BluetoothServiceBluedroid::EnergyInfoNotification(
-  const BluetoothActivityEnergyInfo& aInfo)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  // FIXME: This will be implemented in the later patchset
-}
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.h
@@ -207,19 +207,16 @@ public:
                                            bool aState) MOZ_OVERRIDE;
 
   virtual void DutModeRecvNotification(uint16_t aOpcode,
                                        const uint8_t* aBuf,
                                        uint8_t aLen) MOZ_OVERRIDE;
   virtual void LeTestModeNotification(BluetoothStatus aStatus,
                                       uint16_t aNumPackets) MOZ_OVERRIDE;
 
-  virtual void EnergyInfoNotification(
-    const BluetoothActivityEnergyInfo& aInfo) MOZ_OVERRIDE;
-
 protected:
   static nsresult StartGonkBluetooth();
   static nsresult StopGonkBluetooth();
   static bool EnsureBluetoothHalLoad();
 
   static void ClassToIcon(uint32_t aClass, nsAString& aRetIcon);
 
   static ControlPlayStatus PlayStatusStringToControlPlayStatus(
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -52,18 +52,16 @@ namespace {
 
   // Wait 3.7 seconds until Dialer stops playing busy tone. '3' seconds is the
   // time window set in Dialer and the extra '0.7' second is a magic number.
   // The mechanism should be revised once we know the exact time at which
   // Dialer stops playing.
   static int sBusyToneInterval = 3700; //unit: ms
 } // anonymous namespace
 
-const int BluetoothHfpManager::MAX_NUM_CLIENTS = 1;
-
 static bool
 IsValidDtmf(const char aChar) {
   // Valid DTMF: [*#0-9ABCD]
   return (aChar == '*' || aChar == '#') ||
          (aChar >= '0' && aChar <= '9') ||
          (aChar >= 'A' && aChar <= 'D');
 }
 
@@ -305,17 +303,17 @@ public:
      */
     RunInit();
   }
 
   void RunInit()
   {
     BluetoothHfpManager* hfpManager = BluetoothHfpManager::Get();
 
-    mInterface->Init(hfpManager, BluetoothHfpManager::MAX_NUM_CLIENTS, this);
+    mInterface->Init(hfpManager, this);
   }
 
 private:
   BluetoothHandsfreeInterface* mInterface;
   nsRefPtr<BluetoothProfileResultHandler> mRes;
 };
 
 class InitResultHandlerRunnable MOZ_FINAL : public nsRunnable
@@ -635,19 +633,18 @@ BluetoothHfpManager::HandleVolumeChanged
   if (mReceiveVgsFlag) {
     mReceiveVgsFlag = false;
     return;
   }
 
   // Only send volume back when there's a connected headset
   if (IsConnected()) {
     NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
-    sBluetoothHfpInterface->VolumeControl(
-      HFP_VOLUME_TYPE_SPEAKER, mCurrentVgs, mDeviceAddress,
-      new VolumeControlResultHandler());
+    sBluetoothHfpInterface->VolumeControl(HFP_VOLUME_TYPE_SPEAKER, mCurrentVgs,
+                                          new VolumeControlResultHandler());
   }
 }
 
 void
 BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
 {
   nsCOMPtr<nsIMobileConnectionService> mcService =
     do_GetService(NS_MOBILE_CONNECTION_SERVICE_CONTRACTID);
@@ -765,17 +762,17 @@ BluetoothHfpManager::SendCLCC(Call& aCal
   if (callState == HFP_CALL_STATE_INCOMING &&
       FindFirstCall(nsITelephonyService::CALL_STATE_CONNECTED)) {
     callState = HFP_CALL_STATE_WAITING;
   }
 
   sBluetoothHfpInterface->ClccResponse(
     aIndex, aCall.mDirection, callState, HFP_CALL_MODE_VOICE,
     HFP_CALL_MPTY_TYPE_SINGLE, aCall.mNumber,
-    aCall.mType, mDeviceAddress, new ClccResponseResultHandler());
+    aCall.mType, new ClccResponseResultHandler());
 }
 
 class FormattedAtResponseResultHandler MOZ_FINAL
 : public BluetoothHandsfreeResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
   {
@@ -785,17 +782,17 @@ public:
 };
 
 void
 BluetoothHfpManager::SendLine(const char* aMessage)
 {
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   sBluetoothHfpInterface->FormattedAtResponse(
-    aMessage, mDeviceAddress, new FormattedAtResponseResultHandler());
+    aMessage, new FormattedAtResponseResultHandler());
 }
 
 class AtResponseResultHandler MOZ_FINAL
 : public BluetoothHandsfreeResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
   {
@@ -805,17 +802,17 @@ public:
 };
 
 void
 BluetoothHfpManager::SendResponse(BluetoothHandsfreeAtResponse aResponseCode)
 {
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   sBluetoothHfpInterface->AtResponse(
-    aResponseCode, 0, mDeviceAddress, new AtResponseResultHandler());
+    aResponseCode, 0, new AtResponseResultHandler());
 }
 
 class PhoneStateChangeResultHandler MOZ_FINAL
 : public BluetoothHandsfreeResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
   {
@@ -1359,34 +1356,34 @@ BluetoothHfpManager::AudioStateNotificat
   if (aState == HFP_AUDIO_STATE_CONNECTED ||
       aState == HFP_AUDIO_STATE_DISCONNECTED) {
     NotifyConnectionStateChanged(
       NS_LITERAL_STRING(BLUETOOTH_SCO_STATUS_CHANGED_ID));
   }
 }
 
 void
-BluetoothHfpManager::AnswerCallNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::AnswerCallNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NotifyDialer(NS_LITERAL_STRING("ATA"));
 }
 
 void
-BluetoothHfpManager::HangupCallNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::HangupCallNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NotifyDialer(NS_LITERAL_STRING("CHUP"));
 }
 
 void
 BluetoothHfpManager::VolumeNotification(
-  BluetoothHandsfreeVolumeType aType, int aVolume, const nsAString& aBdAddress)
+  BluetoothHandsfreeVolumeType aType, int aVolume)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE_VOID(aVolume >= 0 && aVolume <= 15);
 
   if (aType == HFP_VOLUME_TYPE_MICROPHONE) {
     mCurrentVgm = aVolume;
   } else if (aType == HFP_VOLUME_TYPE_SPEAKER) {
@@ -1403,30 +1400,29 @@ BluetoothHfpManager::VolumeNotification(
     nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
     NS_ENSURE_TRUE_VOID(os);
 
     os->NotifyObservers(nullptr, "bluetooth-volume-change", data.get());
   }
 }
 
 void
-BluetoothHfpManager::DtmfNotification(char aDtmf, const nsAString& aBdAddress)
+BluetoothHfpManager::DtmfNotification(char aDtmf)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE_VOID(IsValidDtmf(aDtmf));
 
   nsAutoCString message("VTS=");
   message += aDtmf;
   NotifyDialer(NS_ConvertUTF8toUTF16(message));
 }
 
 void
-BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld,
-                                          const nsAString& aBdAddress)
+BluetoothHfpManager::CallHoldNotification(BluetoothHandsfreeCallHoldType aChld)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsSupportedChld((int)aChld)) {
     // We currently don't support Enhanced Call Control.
     // AT+CHLD=1x and AT+CHLD=2x will be ignored
     SendResponse(HFP_AT_RESPONSE_ERROR);
     return;
@@ -1434,18 +1430,17 @@ BluetoothHfpManager::CallHoldNotificatio
 
   SendResponse(HFP_AT_RESPONSE_OK);
 
   nsAutoCString message("CHLD=");
   message.AppendInt((int)aChld);
   NotifyDialer(NS_ConvertUTF8toUTF16(message));
 }
 
-void BluetoothHfpManager::DialCallNotification(const nsAString& aNumber,
-                                               const nsAString& aBdAddress)
+void BluetoothHfpManager::DialCallNotification(const nsAString& aNumber)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCString message = NS_ConvertUTF16toUTF8(aNumber);
 
   // There are three cases based on aNumber,
   // 1) Empty value:    Redial, BLDN
   // 2) >xxx:           Memory dial, ATD>xxx
@@ -1476,17 +1471,17 @@ void BluetoothHfpManager::DialCallNotifi
 
     nsAutoCString newMsg("ATD");
     newMsg += StringHead(message, message.Length() - 1);
     NotifyDialer(NS_ConvertUTF8toUTF16(newMsg));
   }
 }
 
 void
-BluetoothHfpManager::CnumNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::CnumNotification()
 {
   static const uint8_t sAddressType[] {
     [HFP_CALL_ADDRESS_TYPE_UNKNOWN] = 0x81,
     [HFP_CALL_ADDRESS_TYPE_INTERNATIONAL] = 0x91 // for completeness
   };
 
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -1510,59 +1505,57 @@ public:
   void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
   {
     BT_WARNING("BluetoothHandsfreeInterface::CindResponse failed: %d",
                (int)aStatus);
   }
 };
 
 void
-BluetoothHfpManager::CindNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::CindNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   int numActive = GetNumberOfCalls(nsITelephonyService::CALL_STATE_CONNECTED);
   int numHeld = GetNumberOfCalls(nsITelephonyService::CALL_STATE_HELD);
   BluetoothHandsfreeCallState callState =
     ConvertToBluetoothHandsfreeCallState(GetCallSetupState());
 
-  sBluetoothHfpInterface->CindResponse(
-    mService, numActive, numHeld,
-    callState, mSignal, mRoam, mBattChg,
-    aBdAddress,
-    new CindResponseResultHandler());
+  sBluetoothHfpInterface->CindResponse(mService, numActive, numHeld,
+                                       callState, mSignal, mRoam, mBattChg,
+                                       new CindResponseResultHandler());
 }
 
 class CopsResponseResultHandler MOZ_FINAL
 : public BluetoothHandsfreeResultHandler
 {
 public:
   void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
   {
     BT_WARNING("BluetoothHandsfreeInterface::CopsResponse failed: %d",
                (int)aStatus);
   }
 };
 
 void
-BluetoothHfpManager::CopsNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::CopsNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE_VOID(sBluetoothHfpInterface);
 
   sBluetoothHfpInterface->CopsResponse(
     NS_ConvertUTF16toUTF8(mOperatorName).get(),
-    aBdAddress, new CopsResponseResultHandler());
+    new CopsResponseResultHandler());
 }
 
 void
-BluetoothHfpManager::ClccNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::ClccNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   uint32_t callNumbers = mCurrentCallArray.Length();
   uint32_t i;
   for (i = 1; i < callNumbers; i++) {
     SendCLCC(mCurrentCallArray[i], i);
   }
@@ -1573,28 +1566,27 @@ BluetoothHfpManager::ClccNotification(co
 
     SendCLCC(mCdmaSecondCall, 2);
   }
 
   SendResponse(HFP_AT_RESPONSE_OK);
 }
 
 void
-BluetoothHfpManager::UnknownAtNotification(const nsACString& aAtString,
-                                           const nsAString& aBdAddress)
+BluetoothHfpManager::UnknownAtNotification(const nsACString& aAtString)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   BT_LOGR("[%s]", nsCString(aAtString).get());
 
   SendResponse(HFP_AT_RESPONSE_ERROR);
 }
 
 void
-BluetoothHfpManager::KeyPressedNotification(const nsAString& aBdAddress)
+BluetoothHfpManager::KeyPressedNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   bool hasActiveCall =
     (FindFirstCall(nsITelephonyService::CALL_STATE_CONNECTED) > 0);
 
   // Refer to AOSP HeadsetStateMachine.processKeyPressed
   if (FindFirstCall(nsITelephonyService::CALL_STATE_INCOMING)
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h
@@ -72,18 +72,16 @@ public:
 
 class BluetoothHfpManager : public BluetoothHfpManagerBase
                           , public BluetoothHandsfreeNotificationHandler
                           , public BatteryObserver
 {
 public:
   BT_DECL_HFP_MGR_BASE
 
-  static const int MAX_NUM_CLIENTS;
-
   void OnConnectError();
   void OnDisconnectError();
 
   virtual void GetName(nsACString& aName)
   {
     aName.AssignLiteral("HFP/HSP");
   }
 
@@ -114,34 +112,29 @@ public:
   //
   // Bluetooth notifications
   //
 
   void ConnectionStateNotification(BluetoothHandsfreeConnectionState aState,
                                    const nsAString& aBdAddress) MOZ_OVERRIDE;
   void AudioStateNotification(BluetoothHandsfreeAudioState aState,
                               const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void AnswerCallNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void HangupCallNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
+  void AnswerCallNotification() MOZ_OVERRIDE;
+  void HangupCallNotification() MOZ_OVERRIDE;
   void VolumeNotification(BluetoothHandsfreeVolumeType aType,
-                          int aVolume,
-                          const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void DtmfNotification(char aDtmf,
-                        const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void CallHoldNotification(BluetoothHandsfreeCallHoldType aChld,
-                            const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void DialCallNotification(const nsAString& aNumber,
-                            const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void CnumNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void CindNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void CopsNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void ClccNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void UnknownAtNotification(const nsACString& aAtString,
-                             const nsAString& aBdAddress) MOZ_OVERRIDE;
-  void KeyPressedNotification(const nsAString& aBdAddress) MOZ_OVERRIDE;
+                          int aVolume) MOZ_OVERRIDE;
+  void DtmfNotification(char aDtmf) MOZ_OVERRIDE;
+  void CallHoldNotification(BluetoothHandsfreeCallHoldType aChld) MOZ_OVERRIDE;
+  void DialCallNotification(const nsAString& aNumber) MOZ_OVERRIDE;
+  void CnumNotification() MOZ_OVERRIDE;
+  void CindNotification() MOZ_OVERRIDE;
+  void CopsNotification() MOZ_OVERRIDE;
+  void ClccNotification() MOZ_OVERRIDE;
+  void UnknownAtNotification(const nsACString& aAtString) MOZ_OVERRIDE;
+  void KeyPressedNotification() MOZ_OVERRIDE;
 
 private:
   class GetVolumeTask;
   class CloseScoTask;
   class CloseScoRunnable;
   class RespondToBLDNTask;
   class MainThreadTask;