Skip to content

Commit

Permalink
Bug 1061489: Move Bluedroid code out of BluetoothInterface.{cpp,h}, r…
Browse files Browse the repository at this point in the history
…=shuang

This patch moves BluetoothInterface.{cpp,h} to the generic section
of Gecko's Bluetooth code, and the Bluedroid implementation into
the new files BluetoothHalImplementation.{cpp,h}.

BluetoothHalImplementation.{cpp,h} contains all Bluedroid-specific
code. The classes in BluetoothInterface.{cpp,h} are now interfaces
for Gecko.
  • Loading branch information
tdz committed Sep 11, 2014
1 parent 286403f commit c50def1
Show file tree
Hide file tree
Showing 5 changed files with 963 additions and 582 deletions.
109 changes: 109 additions & 0 deletions dom/bluetooth/BluetoothInterface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "BluetoothInterface.h"
#ifdef MOZ_B2G_BT_BLUEDROID
#include "BluetoothHALInterface.h"
#endif

BEGIN_BLUETOOTH_NAMESPACE

//
// Socket Interface
//

BluetoothSocketInterface::~BluetoothSocketInterface()
{ }

//
// Handsfree Interface
//

// Notification handling
//

BluetoothHandsfreeNotificationHandler::
~BluetoothHandsfreeNotificationHandler()
{ }

// Interface
//

BluetoothHandsfreeInterface::BluetoothHandsfreeInterface()
{ }

BluetoothHandsfreeInterface::~BluetoothHandsfreeInterface()
{ }

//
// Bluetooth Advanced Audio Interface
//

// Notification handling
//

BluetoothA2dpNotificationHandler::~BluetoothA2dpNotificationHandler()
{ }

// Interface
//

BluetoothA2dpInterface::BluetoothA2dpInterface()
{ }

BluetoothA2dpInterface::~BluetoothA2dpInterface()
{ }

//
// Bluetooth AVRCP Interface
//

// Notification handling
//

BluetoothAvrcpNotificationHandler::~BluetoothAvrcpNotificationHandler()
{ }

// Interface
//

BluetoothAvrcpInterface::BluetoothAvrcpInterface()
{ }

BluetoothAvrcpInterface::~BluetoothAvrcpInterface()
{ }

// Notification handling
//

BluetoothNotificationHandler::~BluetoothNotificationHandler()
{ }

// Interface
//

BluetoothInterface*
BluetoothInterface::GetInstance()
{
/* Here's where we decide which implementation to use. Currently
* there is only Bluedroid, but others are possible. Having multiple
* interfaces built-in and selecting the correct one at runtime could
* also be an option.
*/
#ifdef MOZ_B2G_BT_BLUEDROID
return BluetoothHALInterface::GetInstance();
#else
return nullptr;
#endif
}

BluetoothInterface::BluetoothInterface()
{ }

BluetoothInterface::~BluetoothInterface()
{ }

END_BLUETOOTH_NAMESPACE
Loading

0 comments on commit c50def1

Please sign in to comment.