Bug 946555 - Remove unused functions in BluetoothService classes and some warnings, r=echou
authorBen Tian <btian@mozilla.com>
Fri, 06 Dec 2013 12:20:07 +0800
changeset 159576 b51aded2e62194d4d764ee91ca288db156cc6bc0
parent 159575 180befb0718ecc0837860838f6be529735d1144b
child 159577 144cec97320a6a543a89f3f48f3d72d3690c5015
push id37356
push userryanvm@gmail.com
push dateMon, 09 Dec 2013 22:43:58 +0000
treeherdermozilla-inbound@8a28cc9db2b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs946555
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 946555 - Remove unused functions in BluetoothService classes and some warnings, r=echou
dom/bluetooth/BluetoothHidManager.h
dom/bluetooth/BluetoothProfileController.cpp
dom/bluetooth/BluetoothRilListener.h
dom/bluetooth/BluetoothService.h
dom/bluetooth/BluetoothUtils.cpp
dom/bluetooth/bluedroid/BluetoothA2dpManager.h
dom/bluetooth/bluedroid/BluetoothHfpManager.h
dom/bluetooth/bluedroid/BluetoothOppManager.cpp
dom/bluetooth/bluedroid/BluetoothOppManager.h
dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.h
dom/bluetooth/bluez/BluetoothA2dpManager.h
dom/bluetooth/bluez/BluetoothHfpManager.cpp
dom/bluetooth/bluez/BluetoothOppManager.cpp
dom/bluetooth/bluez/BluetoothOppManager.h
dom/bluetooth/bluez/linux/BluetoothDBusService.cpp
dom/bluetooth/bluez/linux/BluetoothDBusService.h
dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
dom/bluetooth/ipc/BluetoothServiceChildProcess.h
--- a/dom/bluetooth/BluetoothHidManager.h
+++ b/dom/bluetooth/BluetoothHidManager.h
@@ -20,17 +20,17 @@ public:
   NS_DECL_NSIOBSERVER
   BT_DECL_PROFILE_MGR_BASE
   virtual void GetName(nsACString& aName)
   {
     aName.AssignLiteral("HID");
   }
 
   static BluetoothHidManager* Get();
-  ~BluetoothHidManager();
+  virtual ~BluetoothHidManager();
 
   // HID-specific functions
   void HandleInputPropertyChanged(const BluetoothSignal& aSignal);
 
 private:
   BluetoothHidManager();
   bool Init();
   void Cleanup();
--- a/dom/bluetooth/BluetoothProfileController.cpp
+++ b/dom/bluetooth/BluetoothProfileController.cpp
@@ -182,19 +182,19 @@ BluetoothProfileController::Start()
   }
 }
 
 void
 BluetoothProfileController::Next()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mDeviceAddress.IsEmpty());
-  MOZ_ASSERT(mProfilesIndex < mProfiles.Length());
+  MOZ_ASSERT(mProfilesIndex < (int)mProfiles.Length());
 
-  if (++mProfilesIndex < mProfiles.Length()) {
+  if (++mProfilesIndex < (int)mProfiles.Length()) {
     BT_LOGR_PROFILE(mProfiles[mProfilesIndex], "");
 
     if (mConnect) {
       mProfiles[mProfilesIndex]->Connect(mDeviceAddress, this);
     } else {
       mProfiles[mProfilesIndex]->Disconnect(this);
     }
     return;
--- a/dom/bluetooth/BluetoothRilListener.h
+++ b/dom/bluetooth/BluetoothRilListener.h
@@ -21,46 +21,49 @@ class BluetoothRilListener;
 
 class IccListener : public nsIIccListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIICCLISTENER
 
   IccListener() { }
+  virtual ~IccListener() { }
 
   bool Listen(bool aStart);
   void SetOwner(BluetoothRilListener *aOwner);
 
 private:
   BluetoothRilListener* mOwner;
 };
 
 class MobileConnectionListener : public nsIMobileConnectionListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMOBILECONNECTIONLISTENER
 
   MobileConnectionListener(uint32_t aClientId)
   : mClientId(aClientId) { }
+  virtual ~MobileConnectionListener() { }
 
   bool Listen(bool aStart);
 
 private:
   uint32_t mClientId;
 };
 
 class TelephonyListener : public nsITelephonyListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSITELEPHONYLISTENER
 
   TelephonyListener() { }
+  virtual ~TelephonyListener() { }
 
   bool Listen(bool aStart);
 };
 
 class BluetoothRilListener
 {
 public:
   BluetoothRilListener();
--- a/dom/bluetooth/BluetoothService.h
+++ b/dom/bluetooth/BluetoothService.h
@@ -167,45 +167,25 @@ public:
    *
    * @return NS_OK if property is set correctly, NS_ERROR_FAILURE otherwise
    */
   virtual nsresult
   SetProperty(BluetoothObjectType aType,
               const BluetoothNamedValue& aValue,
               BluetoothReplyRunnable* aRunnable) = 0;
 
-  /**
-   * Get the path of a device
-   *
-   * @param aAdapterPath Path to the Adapter that's communicating with the device
-   * @param aDeviceAddress Device address (XX:XX:XX:XX:XX:XX format)
-   * @param aDevicePath Return value of path
-   *
-   * @return True if path set correctly, false otherwise
-   */
-  virtual bool
-  GetDevicePath(const nsAString& aAdapterPath,
-                const nsAString& aDeviceAddress,
-                nsAString& aDevicePath) = 0;
-
   virtual nsresult
   CreatePairedDeviceInternal(const nsAString& aAddress,
                              int aTimeout,
                              BluetoothReplyRunnable* aRunnable) = 0;
 
   virtual nsresult
   RemoveDeviceInternal(const nsAString& aObjectPath,
                        BluetoothReplyRunnable* aRunnable) = 0;
 
-  virtual nsresult
-  GetScoSocket(const nsAString& aObjectPath,
-               bool aAuth,
-               bool aEncrypt,
-               mozilla::ipc::UnixSocketConsumer* aConsumer) = 0;
-
   /**
    * Get corresponding service channel of specific service on remote device.
    * It's usually the very first step of establishing an outbound connection.
    *
    * @param aObjectPath Object path of remote device
    * @param aServiceUuid UUID of the target service
    * @param aManager Instance which has callback function OnGetServiceChannel()
    *
--- a/dom/bluetooth/BluetoothUtils.cpp
+++ b/dom/bluetooth/BluetoothUtils.cpp
@@ -90,17 +90,17 @@ nsString
 GetAddressFromObjectPath(const nsAString& aObjectPath)
 {
   // The object path would be like /org/bluez/2906/hci0/dev_00_23_7F_CB_B4_F1,
   // and the adapter path would be the first part of the object path, according
   // to the example above, it's /org/bluez/2906/hci0.
   nsString address(aObjectPath);
   int addressHead = address.RFind("/") + 5;
 
-  MOZ_ASSERT(addressHead + BLUETOOTH_ADDRESS_LENGTH == address.Length());
+  MOZ_ASSERT(addressHead + BLUETOOTH_ADDRESS_LENGTH == (int)address.Length());
 
   address.Cut(0, addressHead);
   address.ReplaceChar('_', ':');
 
   return address;
 }
 
 bool
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.h
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.h
@@ -27,17 +27,17 @@ public:
     SINK_UNKNOWN,
     SINK_DISCONNECTED,
     SINK_CONNECTING,
     SINK_CONNECTED,
     SINK_PLAYING,
   };
 
   static BluetoothA2dpManager* Get();
-  ~BluetoothA2dpManager();
+  virtual ~BluetoothA2dpManager();
   void ResetA2dp();
   void ResetAvrcp();
 
   // A2DP-specific functions
   void HandleSinkPropertyChanged(const BluetoothSignal& aSignal);
 
   // AVRCP-specific functions
   void SetAvrcpConnected(bool aConnected);
--- a/dom/bluetooth/bluedroid/BluetoothHfpManager.h
+++ b/dom/bluetooth/bluedroid/BluetoothHfpManager.h
@@ -79,17 +79,17 @@ public:
   NS_DECL_NSIOBSERVER
   BT_DECL_PROFILE_MGR_BASE
   virtual void GetName(nsACString& aName)
   {
     aName.AssignLiteral("HFP/HSP");
   }
 
   static BluetoothHfpManager* Get();
-  ~BluetoothHfpManager();
+  virtual ~BluetoothHfpManager();
 
   bool ConnectSco();
   bool DisconnectSco();
   bool IsScoConnected();
 
   /**
    * @param aSend A boolean indicates whether we need to notify headset or not
    */
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp
@@ -310,17 +310,17 @@ BluetoothOppManager::Listen()
 
 void
 BluetoothOppManager::StartSendingNextFile()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   MOZ_ASSERT(!IsConnected());
   MOZ_ASSERT(!mBatches.IsEmpty());
-  MOZ_ASSERT(mBatches[0].mBlobs.Length() > mCurrentBlobIndex + 1);
+  MOZ_ASSERT((int)mBatches[0].mBlobs.Length() > mCurrentBlobIndex + 1);
 
   mBlob = mBatches[0].mBlobs[++mCurrentBlobIndex];
 
   // Before sending content, we have to send a header including
   // information such as file name, file length and content type.
   ExtractBlobHeaders();
   StartFileTransfer();
 
--- a/dom/bluetooth/bluedroid/BluetoothOppManager.h
+++ b/dom/bluetooth/bluedroid/BluetoothOppManager.h
@@ -40,17 +40,17 @@ public:
   /*
    * Channel of reserved services are fixed values, please check
    * function add_reserved_service_records() in
    * external/bluetooth/bluez/src/adapter.c for more information.
    */
   static const int DEFAULT_OPP_CHANNEL = 10;
   static const int MAX_PACKET_LENGTH = 0xFFFE;
 
-  ~BluetoothOppManager();
+  virtual ~BluetoothOppManager();
   static BluetoothOppManager* Get();
   void ClientDataHandler(mozilla::ipc::UnixSocketRawData* aMessage);
   void ServerDataHandler(mozilla::ipc::UnixSocketRawData* aMessage);
 
   bool Listen();
 
   bool SendFile(const nsAString& aDeviceAddress, BlobParent* aActor);
   bool StopSendingFile();
--- a/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
@@ -961,23 +961,16 @@ BluetoothServiceBluedroid::StopDiscovery
   }
 
   DispatchBluetoothReply(aRunnable, true, EmptyString());
 
   return NS_OK;
 }
 
 nsresult
-BluetoothServiceBluedroid::GetDevicePropertiesInternal(
-  const BluetoothSignal& aSignal)
-{
-  return NS_OK;
-}
-
-nsresult
 BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
                                        const BluetoothNamedValue& aValue,
                                        BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsReady()) {
     NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
@@ -1028,66 +1021,16 @@ BluetoothServiceBluedroid::SetProperty(B
   int ret = sBtInterface->set_adapter_property(&prop);
   if (ret != BT_STATUS_SUCCESS) {
     ReplyStatusError(aRunnable, ret, NS_LITERAL_STRING("SetProperty"));
   }
 
   return NS_OK;
 }
 
-bool
-BluetoothServiceBluedroid::GetDevicePath(const nsAString& aAdapterPath,
-                                         const nsAString& aDeviceAddress,
-                                         nsAString& aDevicePath)
-{
-  return true;
-}
-
-bool
-BluetoothServiceBluedroid::AddServiceRecords(const char* serviceName,
-                                             unsigned long long uuidMsb,
-                                             unsigned long long uuidLsb,
-                                             int channel)
-{
-  return true;
-}
-
-bool
-BluetoothServiceBluedroid::RemoveServiceRecords(const char* serviceName,
-                                                unsigned long long uuidMsb,
-                                                unsigned long long uuidLsb,
-                                                int channel)
-{
-  return true;
-}
-
-bool
-BluetoothServiceBluedroid::AddReservedServicesInternal(
-  const nsTArray<uint32_t>& aServices,
-  nsTArray<uint32_t>& aServiceHandlesContainer)
-{
-  return true;
-
-}
-
-bool
-BluetoothServiceBluedroid::RemoveReservedServicesInternal(
-  const nsTArray<uint32_t>& aServiceHandles)
-{
-  return true;
-}
-
-nsresult
-BluetoothServiceBluedroid::GetScoSocket(
-  const nsAString& aObjectPath, bool aAuth, bool aEncrypt,
-  mozilla::ipc::UnixSocketConsumer* aConsumer)
-{
-  return NS_OK;
-}
-
 nsresult
 BluetoothServiceBluedroid::GetServiceChannel(
   const nsAString& aDeviceAddress,
   const nsAString& aServiceUuid,
   BluetoothProfileManagerBase* aManager)
 {
   return NS_OK;
 }
--- a/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.h
+++ b/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.h
@@ -45,53 +45,20 @@ public:
   virtual nsresult GetPairedDevicePropertiesInternal(
                                      const nsTArray<nsString>& aDeviceAddress,
                                      BluetoothReplyRunnable* aRunnable);
 
   virtual nsresult StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
   virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable);
 
   virtual nsresult
-  GetDevicePropertiesInternal(const BluetoothSignal& aSignal);
-
-  virtual nsresult
   SetProperty(BluetoothObjectType aType,
               const BluetoothNamedValue& aValue,
               BluetoothReplyRunnable* aRunnable);
 
-  virtual bool
-  GetDevicePath(const nsAString& aAdapterPath,
-                const nsAString& aDeviceAddress,
-                nsAString& aDevicePath);
-
-  static bool
-  AddServiceRecords(const char* serviceName,
-                    unsigned long long uuidMsb,
-                    unsigned long long uuidLsb,
-                    int channel);
-
-  static bool
-  RemoveServiceRecords(const char* serviceName,
-                       unsigned long long uuidMsb,
-                       unsigned long long uuidLsb,
-                       int channel);
-
-  static bool
-  AddReservedServicesInternal(const nsTArray<uint32_t>& aServices,
-                              nsTArray<uint32_t>& aServiceHandlesContainer);
-
-  static bool
-  RemoveReservedServicesInternal(const nsTArray<uint32_t>& aServiceHandles);
-
-  virtual nsresult
-  GetScoSocket(const nsAString& aObjectPath,
-               bool aAuth,
-               bool aEncrypt,
-               mozilla::ipc::UnixSocketConsumer* aConsumer);
-
   virtual nsresult
   GetServiceChannel(const nsAString& aDeviceAddress,
                     const nsAString& aServiceUuid,
                     BluetoothProfileManagerBase* aManager);
 
   virtual bool
   UpdateSdpRecords(const nsAString& aDeviceAddress,
                    BluetoothProfileManagerBase* aManager);
--- a/dom/bluetooth/bluez/BluetoothA2dpManager.h
+++ b/dom/bluetooth/bluez/BluetoothA2dpManager.h
@@ -28,17 +28,17 @@ public:
     SINK_UNKNOWN,
     SINK_DISCONNECTED,
     SINK_CONNECTING,
     SINK_CONNECTED,
     SINK_PLAYING,
   };
 
   static BluetoothA2dpManager* Get();
-  ~BluetoothA2dpManager();
+  virtual ~BluetoothA2dpManager();
   void ResetA2dp();
   void ResetAvrcp();
 
   // A2DP-specific functions
   void HandleSinkPropertyChanged(const BluetoothSignal& aSignal);
 
   // AVRCP-specific functions
   void SetAvrcpConnected(bool aConnected);
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -1013,17 +1013,17 @@ BluetoothHfpManager::ReceiveSocketData(B
       message.AppendLiteral(",,4");
       SendLine(message.get());
     }
   } else if (msg.Find("AT+BIA=") != -1) {
     ParseAtCommand(msg, 7, atCommandValues);
 
     for (uint8_t i = 0; i < atCommandValues.Length(); i++) {
       CINDType indicatorType = (CINDType) (i + 1);
-      if (indicatorType >= ArrayLength(sCINDItems)) {
+      if (indicatorType >= (int)ArrayLength(sCINDItems)) {
         // Ignore excess parameters at the end
         break;
       }
 
       if (!IsMandatoryIndicator(indicatorType)) {
         /**
          * Accept only following indicator states:
          * - "1": activate
@@ -1797,25 +1797,18 @@ BluetoothHfpManager::GetAddress(nsAStrin
   return mSocket->GetAddress(aDeviceAddress);
 }
 
 bool
 BluetoothHfpManager::ConnectSco(BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (sInShutdown) {
-    BT_WARNING("ConnecteSco called while in shutdown!");
-    return false;
-  }
-
-  if (!IsConnected()) {
-    BT_WARNING("BluetoothHfpManager is not connected");
-    return false;
-  }
+  NS_ENSURE_TRUE(!sInShutdown, false);
+  NS_ENSURE_TRUE(IsConnected(), false);
 
   SocketConnectionStatus status = mScoSocket->GetConnectionStatus();
   if (status == SocketConnectionStatus::SOCKET_CONNECTED ||
       status == SocketConnectionStatus::SOCKET_CONNECTING ||
       (mScoRunnable && (mScoRunnable != aRunnable))) {
     BT_WARNING("SCO connection exists or is being established");
     return false;
   }
@@ -1823,26 +1816,24 @@ BluetoothHfpManager::ConnectSco(Bluetoot
   // If we are not using HSP, we have to make sure Service Level Connection
   // established before we start to set up SCO (synchronous connection).
   if (!mSlcConnected && !mHspConnected) {
     mConnectScoRequest = true;
     BT_WARNING("ConnectSco called before Service Level Connection established");
     return false;
   }
 
+  // Stop listening
   mScoSocket->Disconnect();
 
+  mScoSocket->Connect(NS_ConvertUTF16toUTF8(mDeviceAddress), -1);
+  mScoSocketStatus = mScoSocket->GetConnectionStatus();
+
   mScoRunnable = aRunnable;
-
-  BluetoothService* bs = BluetoothService::Get();
-  NS_ENSURE_TRUE(bs, false);
-  nsresult rv = bs->GetScoSocket(mDeviceAddress, true, false, mScoSocket);
-
-  mScoSocketStatus = mScoSocket->GetConnectionStatus();
-  return NS_SUCCEEDED(rv);
+  return true;
 }
 
 bool
 BluetoothHfpManager::DisconnectSco()
 {
   if (!IsScoConnected()) {
     BT_WARNING("SCO has been already disconnected.");
     return false;
--- a/dom/bluetooth/bluez/BluetoothOppManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp
@@ -326,17 +326,17 @@ BluetoothOppManager::Listen()
 
 void
 BluetoothOppManager::StartSendingNextFile()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   MOZ_ASSERT(!IsConnected());
   MOZ_ASSERT(!mBatches.IsEmpty());
-  MOZ_ASSERT(mBatches[0].mBlobs.Length() > mCurrentBlobIndex + 1);
+  MOZ_ASSERT((int)mBatches[0].mBlobs.Length() > mCurrentBlobIndex + 1);
 
   mBlob = mBatches[0].mBlobs[++mCurrentBlobIndex];
 
   // Before sending content, we have to send a header including
   // information such as file name, file length and content type.
   ExtractBlobHeaders();
   StartFileTransfer();
 
--- a/dom/bluetooth/bluez/BluetoothOppManager.h
+++ b/dom/bluetooth/bluez/BluetoothOppManager.h
@@ -40,17 +40,17 @@ public:
   /*
    * Channel of reserved services are fixed values, please check
    * function add_reserved_service_records() in
    * external/bluetooth/bluez/src/adapter.c for more information.
    */
   static const int DEFAULT_OPP_CHANNEL = 10;
   static const int MAX_PACKET_LENGTH = 0xFFFE;
 
-  ~BluetoothOppManager();
+  virtual ~BluetoothOppManager();
   static BluetoothOppManager* Get();
   void ClientDataHandler(mozilla::ipc::UnixSocketRawData* aMessage);
   void ServerDataHandler(mozilla::ipc::UnixSocketRawData* aMessage);
 
   bool Listen();
 
   bool SendFile(const nsAString& aDeviceAddress, BlobParent* aActor);
   bool StopSendingFile();
--- a/dom/bluetooth/bluez/linux/BluetoothDBusService.cpp
+++ b/dom/bluetooth/bluez/linux/BluetoothDBusService.cpp
@@ -169,17 +169,17 @@ static const char* sBluetoothDBusSignals
 
 /**
  * DBus Connection held for the BluetoothCommandThread to use. Should never be
  * used by any other thread.
  */
 static nsRefPtr<RawDBusConnection> gThreadConnection;
 
 // Only A2DP and HID are authorized.
-static nsTArray<uint32_t> sAuthorizedServiceClass;
+static nsTArray<BluetoothServiceClass> sAuthorizedServiceClass;
 
 // The object path of adpater which should be updated after switching Bluetooth.
 static nsString sAdapterPath;
 
 /**
  * The adapter name may not be ready whenever event 'AdapterAdded' is received,
  * so we'd like to wait for a bit.
  */
@@ -2361,17 +2361,17 @@ BluetoothDBusService::SetProperty(Blueto
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsReady()) {
     NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
     DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
     return NS_OK;
   }
 
-  MOZ_ASSERT(aType < ArrayLength(sBluetoothDBusIfaces));
+  MOZ_ASSERT(aType < (int)ArrayLength(sBluetoothDBusIfaces));
   MOZ_ASSERT(!sAdapterPath.IsEmpty());
   const char* interface = sBluetoothDBusIfaces[aType];
 
   /* Compose the command */
   DBusMessage* msg = dbus_message_new_method_call(
                                       "org.bluez",
                                       NS_ConvertUTF16toUTF8(sAdapterPath).get(),
                                       interface,
@@ -2434,25 +2434,16 @@ BluetoothDBusService::SetProperty(Blueto
   if (!success) {
     BT_WARNING("SendWithReply failed");
     return NS_ERROR_FAILURE;
   }
   runnable.forget();
   return NS_OK;
 }
 
-bool
-BluetoothDBusService::GetDevicePath(const nsAString& aAdapterPath,
-                                    const nsAString& aDeviceAddress,
-                                    nsAString& aDevicePath)
-{
-  aDevicePath = GetObjectPathFromAddress(aAdapterPath, aDeviceAddress);
-  return true;
-}
-
 nsresult
 BluetoothDBusService::CreatePairedDeviceInternal(
                                               const nsAString& aDeviceAddress,
                                               int aTimeout,
                                               BluetoothReplyRunnable* aRunnable)
 {
   const char *capabilities = B2G_AGENT_CAPABILITIES;
   const char *deviceAgentPath = KEY_REMOTE_AGENT;
@@ -2974,42 +2965,16 @@ BluetoothDBusService::UpdateSdpRecords(c
                                     (void*)callbackRunnable, -1,
                                     NS_ConvertUTF16toUTF8(objectPath).get(),
                                     DBUS_DEVICE_IFACE,
                                     "DiscoverServices",
                                     DBUS_TYPE_STRING, &EmptyCString(),
                                     DBUS_TYPE_INVALID);
 }
 
-nsresult
-BluetoothDBusService::GetScoSocket(const nsAString& aAddress,
-                                   bool aAuth,
-                                   bool aEncrypt,
-                                   mozilla::ipc::UnixSocketConsumer* aConsumer)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (!mConnection || !gThreadConnection) {
-    NS_ERROR("Bluetooth service not started yet!");
-    return NS_ERROR_FAILURE;
-  }
-
-  BluetoothUnixSocketConnector* c =
-    new BluetoothUnixSocketConnector(BluetoothSocketType::SCO, -1,
-                                     aAuth, aEncrypt);
-
-  if (!aConsumer->ConnectSocket(c, NS_ConvertUTF16toUTF8(aAddress).get())) {
-    nsAutoString replyError;
-    replyError.AssignLiteral("SocketConnectionError");
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
 void
 BluetoothDBusService::SendFile(const nsAString& aDeviceAddress,
                                BlobParent* aBlobParent,
                                BlobChild* aBlobChild,
                                BluetoothReplyRunnable* aRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
--- a/dom/bluetooth/bluez/linux/BluetoothDBusService.h
+++ b/dom/bluetooth/bluez/linux/BluetoothDBusService.h
@@ -49,31 +49,16 @@ public:
 
   virtual nsresult StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
   virtual nsresult
   SetProperty(BluetoothObjectType aType,
               const BluetoothNamedValue& aValue,
               BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
-  virtual bool
-  GetDevicePath(const nsAString& aAdapterPath,
-                const nsAString& aDeviceAddress,
-                nsAString& aDevicePath) MOZ_OVERRIDE;
-
-  static bool
-  AddReservedServicesInternal(const nsTArray<uint32_t>& aServices,
-                              nsTArray<uint32_t>& aServiceHandlesContainer);
-
-  virtual nsresult
-  GetScoSocket(const nsAString& aObjectPath,
-               bool aAuth,
-               bool aEncrypt,
-               mozilla::ipc::UnixSocketConsumer* aConsumer) MOZ_OVERRIDE;
-
   virtual nsresult
   GetServiceChannel(const nsAString& aDeviceAddress,
                     const nsAString& aServiceUuid,
                     BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
 
   virtual bool
   UpdateSdpRecords(const nsAString& aDeviceAddress,
                    BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
--- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
+++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.cpp
@@ -143,35 +143,16 @@ nsresult
 BluetoothServiceChildProcess::SetProperty(BluetoothObjectType aType,
                                           const BluetoothNamedValue& aValue,
                                           BluetoothReplyRunnable* aRunnable)
 {
   SendRequest(aRunnable, SetPropertyRequest(aType, aValue));
   return NS_OK;
 }
 
-bool
-BluetoothServiceChildProcess::GetDevicePath(const nsAString& aAdapterPath,
-                                            const nsAString& aDeviceAddress,
-                                            nsAString& aDevicePath)
-{
-  // XXXbent Right now this is adapted from BluetoothDBusService's
-  //         GetObjectPathFromAddress. This is basically a sync call that cannot
-  //         be forwarded to the parent process without blocking. Hopefully this
-  //         can be reworked.
-  nsAutoString path(aAdapterPath);
-  path.AppendLiteral("/dev_");
-  path.Append(aDeviceAddress);
-  path.ReplaceChar(':', '_');
-
-  aDevicePath = path;
-
-  return true;
-}
-
 nsresult
 BluetoothServiceChildProcess::CreatePairedDeviceInternal(
                                               const nsAString& aAddress,
                                               int aTimeout,
                                               BluetoothReplyRunnable* aRunnable)
 {
   SendRequest(aRunnable,
               PairRequest(nsString(aAddress), aTimeout));
@@ -184,26 +165,16 @@ BluetoothServiceChildProcess::RemoveDevi
                                               BluetoothReplyRunnable* aRunnable)
 {
   SendRequest(aRunnable,
               UnpairRequest(nsString(aObjectPath)));
   return NS_OK;
 }
 
 nsresult
-BluetoothServiceChildProcess::GetScoSocket(
-                                    const nsAString& aObjectPath,
-                                    bool aAuth,
-                                    bool aEncrypt,
-                                    mozilla::ipc::UnixSocketConsumer* aConsumer)
-{
-  MOZ_CRASH("This should never be called!");
-}
-
-nsresult
 BluetoothServiceChildProcess::GetServiceChannel(const nsAString& aDeviceAddress,
                                                 const nsAString& aServiceUuid,
                                                 BluetoothProfileManagerBase* aManager)
 {
   MOZ_CRASH("This should never be called!");
 }
 
 bool
--- a/dom/bluetooth/ipc/BluetoothServiceChildProcess.h
+++ b/dom/bluetooth/ipc/BluetoothServiceChildProcess.h
@@ -61,37 +61,26 @@ public:
   virtual nsresult
   StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
   virtual nsresult
   SetProperty(BluetoothObjectType aType,
               const BluetoothNamedValue& aValue,
               BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
-  virtual bool
-  GetDevicePath(const nsAString& aAdapterPath,
-                const nsAString& aDeviceAddress,
-                nsAString& aDevicePath) MOZ_OVERRIDE;
-
   virtual nsresult
   CreatePairedDeviceInternal(const nsAString& aAddress,
                              int aTimeout,
                              BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
   virtual nsresult
   RemoveDeviceInternal(const nsAString& aObjectPath,
                        BluetoothReplyRunnable* aRunnable) MOZ_OVERRIDE;
 
   virtual nsresult
-  GetScoSocket(const nsAString& aObjectPath,
-               bool aAuth,
-               bool aEncrypt,
-               mozilla::ipc::UnixSocketConsumer* aConsumer) MOZ_OVERRIDE;
-
-  virtual nsresult
   GetServiceChannel(const nsAString& aDeviceAddress,
                     const nsAString& aServiceUuid,
                     BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;
 
   virtual bool
   UpdateSdpRecords(const nsAString& aDeviceAddress,
                    BluetoothProfileManagerBase* aManager) MOZ_OVERRIDE;