Bug 1166180 - [cleanup] Remove function |EnsureBluetoothHalLoad| in BluetoothServiceBluedroid, r=shuang

This commit is contained in:
Ben Tian 2015-05-19 17:02:01 +08:00
Родитель 7d03cbd030
Коммит 2248c8f63a
2 изменённых файлов: 6 добавлений и 25 удалений

Просмотреть файл

@ -134,15 +134,6 @@ BluetoothServiceBluedroid::PlayStatusStringToControlPlayStatus(
/** /**
* Static functions * Static functions
*/ */
bool
BluetoothServiceBluedroid::EnsureBluetoothHalLoad()
{
sBtInterface = BluetoothInterface::GetInstance();
NS_ENSURE_TRUE(sBtInterface, false);
return true;
}
class BluetoothServiceBluedroid::EnableResultHandler final class BluetoothServiceBluedroid::EnableResultHandler final
: public BluetoothResultHandler : public BluetoothResultHandler
{ {
@ -293,9 +284,9 @@ BluetoothServiceBluedroid::StopGonkBluetooth()
*/ */
BluetoothServiceBluedroid::BluetoothServiceBluedroid() BluetoothServiceBluedroid::BluetoothServiceBluedroid()
{ {
if (!EnsureBluetoothHalLoad()) { sBtInterface = BluetoothInterface::GetInstance();
BT_LOGR("Error! Failed to load bluedroid library."); if (!sBtInterface) {
return; BT_LOGR("Error! Failed to get instance of bluetooth interface");
} }
} }
@ -739,15 +730,6 @@ BluetoothServiceBluedroid::PlayStatusStringToControlPlayStatus(
/** /**
* Static functions * Static functions
*/ */
bool
BluetoothServiceBluedroid::EnsureBluetoothHalLoad()
{
sBtInterface = BluetoothInterface::GetInstance();
NS_ENSURE_TRUE(sBtInterface, false);
return true;
}
class BluetoothServiceBluedroid::EnableResultHandler final class BluetoothServiceBluedroid::EnableResultHandler final
: public BluetoothResultHandler : public BluetoothResultHandler
{ {
@ -926,9 +908,9 @@ ReplyStatusError(BluetoothReplyRunnable* aBluetoothReplyRunnable,
*/ */
BluetoothServiceBluedroid::BluetoothServiceBluedroid() BluetoothServiceBluedroid::BluetoothServiceBluedroid()
{ {
if (!EnsureBluetoothHalLoad()) { sBtInterface = BluetoothInterface::GetInstance();
BT_LOGR("Error! Failed to load bluedroid library."); if (!sBtInterface) {
return; BT_LOGR("Error! Failed to get instance of bluetooth interface");
} }
} }

Просмотреть файл

@ -312,7 +312,6 @@ public:
protected: protected:
static nsresult StartGonkBluetooth(); static nsresult StartGonkBluetooth();
static nsresult StopGonkBluetooth(); static nsresult StopGonkBluetooth();
static bool EnsureBluetoothHalLoad();
static void ConnectDisconnect(bool aConnect, static void ConnectDisconnect(bool aConnect,
const nsAString& aDeviceAddress, const nsAString& aDeviceAddress,