2012-07-17 20:41:54 -07:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
2012-08-16 19:53:45 -07:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-07-17 20:41:54 -07:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_bluetooth_bluetootheventservice_h__
|
|
|
|
#define mozilla_dom_bluetooth_bluetootheventservice_h__
|
|
|
|
|
2012-09-06 07:15:36 -07:00
|
|
|
#include "BluetoothCommon.h"
|
2013-05-09 23:39:12 -07:00
|
|
|
#include "BluetoothProfileManagerBase.h"
|
2012-09-28 03:59:12 -07:00
|
|
|
#include "mozilla/dom/ipc/Blob.h"
|
2012-09-06 07:15:36 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2012-07-17 20:41:54 -07:00
|
|
|
#include "nsClassHashtable.h"
|
|
|
|
#include "nsIObserver.h"
|
2012-09-06 07:15:36 -07:00
|
|
|
#include "nsIThread.h"
|
|
|
|
#include "nsTObserverArray.h"
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2012-09-25 13:13:15 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
class UnixSocketConsumer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-17 20:41:54 -07:00
|
|
|
BEGIN_BLUETOOTH_NAMESPACE
|
|
|
|
|
2012-09-06 07:15:36 -07:00
|
|
|
class BluetoothManager;
|
2012-09-06 01:11:11 -07:00
|
|
|
class BluetoothNamedValue;
|
2012-09-06 07:15:36 -07:00
|
|
|
class BluetoothReplyRunnable;
|
|
|
|
class BluetoothSignal;
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
typedef mozilla::ObserverList<BluetoothSignal> BluetoothSignalObserverList;
|
|
|
|
|
2012-07-17 20:41:54 -07:00
|
|
|
class BluetoothService : public nsIObserver
|
2012-09-12 07:03:42 -07:00
|
|
|
, public BluetoothSignalObserver
|
2012-07-17 20:41:54 -07:00
|
|
|
{
|
2012-09-06 07:15:36 -07:00
|
|
|
class ToggleBtAck;
|
|
|
|
friend class ToggleBtAck;
|
|
|
|
|
|
|
|
class ToggleBtTask;
|
|
|
|
friend class ToggleBtTask;
|
|
|
|
|
|
|
|
class StartupTask;
|
|
|
|
friend class StartupTask;
|
|
|
|
|
2012-07-17 20:41:54 -07:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Add a message handler object from message distribution observer.
|
|
|
|
* Must be called from the main thread.
|
|
|
|
*
|
|
|
|
* @param aNodeName Node name of the object
|
|
|
|
* @param aMsgHandler Weak pointer to the object
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual void
|
|
|
|
RegisterBluetoothSignalHandler(const nsAString& aNodeName,
|
|
|
|
BluetoothSignalObserver* aMsgHandler);
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Remove a message handler object from message distribution observer.
|
|
|
|
* Must be called from the main thread.
|
|
|
|
*
|
|
|
|
* @param aNodeName Node name of the object
|
|
|
|
* @param aMsgHandler Weak pointer to the object
|
2012-09-13 09:37:14 -07:00
|
|
|
*/
|
|
|
|
virtual void
|
|
|
|
UnregisterBluetoothSignalHandler(const nsAString& aNodeName,
|
|
|
|
BluetoothSignalObserver* aMsgHandler);
|
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-09-13 09:37:14 -07:00
|
|
|
* Remove a message handlers for the given observer.
|
|
|
|
* Must be called from the main thread.
|
2012-07-17 20:41:54 -07:00
|
|
|
*
|
2012-09-13 09:37:14 -07:00
|
|
|
* @param aMsgHandler Weak pointer to the object
|
2012-07-17 20:41:54 -07:00
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
void
|
|
|
|
UnregisterAllSignalHandlers(BluetoothSignalObserver* aMsgHandler);
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Distribute a signal to the observer list
|
|
|
|
*
|
|
|
|
* @param aSignal Signal object to distribute
|
|
|
|
*
|
|
|
|
* @return NS_OK if signal distributed, NS_ERROR_FAILURE on error
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
void
|
|
|
|
DistributeSignal(const BluetoothSignal& aEvent);
|
2012-09-06 07:15:36 -07:00
|
|
|
|
2012-09-12 07:03:42 -07:00
|
|
|
/**
|
|
|
|
* Called when get a Bluetooth Signal from BluetoothDBusService
|
|
|
|
*
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
void
|
|
|
|
Notify(const BluetoothSignal& aParam);
|
2012-09-12 07:03:42 -07:00
|
|
|
|
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Returns the BluetoothService singleton. Only to be called from main thread.
|
|
|
|
*
|
2012-09-12 07:03:42 -07:00
|
|
|
* @param aService Pointer to return singleton into.
|
2012-07-17 20:41:54 -07:00
|
|
|
*
|
|
|
|
* @return NS_OK on proper assignment, NS_ERROR_FAILURE otherwise (if service
|
|
|
|
* has not yet been started, for instance)
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
static BluetoothService*
|
|
|
|
Get();
|
2012-09-06 07:15:36 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
static already_AddRefed<BluetoothService>
|
|
|
|
FactoryCreate()
|
2012-09-06 07:15:36 -07:00
|
|
|
{
|
|
|
|
nsRefPtr<BluetoothService> service = Get();
|
|
|
|
return service.forget();
|
|
|
|
}
|
|
|
|
|
2012-07-17 20:41:54 -07:00
|
|
|
/**
|
|
|
|
* Returns the path of the default adapter, implemented via a platform
|
|
|
|
* specific method.
|
|
|
|
*
|
2013-10-28 07:04:12 -07:00
|
|
|
* @return NS_OK on success, NS_ERROR_FAILURE otherwise
|
2012-07-17 20:41:54 -07:00
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual nsresult
|
|
|
|
GetDefaultAdapterPathInternal(BluetoothReplyRunnable* aRunnable) = 0;
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2012-08-16 19:53:45 -07:00
|
|
|
/**
|
|
|
|
* Returns the properties of paired devices, implemented via a platform
|
|
|
|
* specific method.
|
|
|
|
*
|
|
|
|
* @return NS_OK on success, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual nsresult
|
|
|
|
GetPairedDevicePropertiesInternal(const nsTArray<nsString>& aDeviceAddresses,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-08-16 19:53:45 -07:00
|
|
|
|
2013-04-26 03:48:21 -07:00
|
|
|
/**
|
|
|
|
* Returns the properties of connected devices regarding to specific profile,
|
|
|
|
* implemented via a platform specific methood.
|
|
|
|
*
|
|
|
|
* @return NS_OK on success, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
2013-09-06 04:19:46 -07:00
|
|
|
GetConnectedDevicePropertiesInternal(uint16_t aServiceUuid,
|
2013-04-26 03:48:21 -07:00
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Stop device discovery (platform specific implementation)
|
|
|
|
*
|
|
|
|
* @return NS_OK if discovery stopped correctly, false otherwise
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual nsresult
|
2013-03-15 00:15:47 -07:00
|
|
|
StopDiscoveryInternal(BluetoothReplyRunnable* aRunnable) = 0;
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-07-17 20:41:54 -07:00
|
|
|
* Start device discovery (platform specific implementation)
|
|
|
|
*
|
|
|
|
* @return NS_OK if discovery stopped correctly, false otherwise
|
|
|
|
*/
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual nsresult
|
2013-03-15 00:15:47 -07:00
|
|
|
StartDiscoveryInternal(BluetoothReplyRunnable* aRunnable) = 0;
|
2012-07-17 20:41:54 -07:00
|
|
|
|
2012-09-16 23:39:47 -07:00
|
|
|
/**
|
2012-07-31 21:49:59 -07:00
|
|
|
* Set a property for the specified object
|
|
|
|
*
|
|
|
|
* @param aPropName Name of the property
|
|
|
|
* @param aValue Boolean value
|
|
|
|
* @param aRunnable Runnable to run on async reply
|
|
|
|
*
|
|
|
|
* @return NS_OK if property is set correctly, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
|
|
|
SetProperty(BluetoothObjectType aType,
|
|
|
|
const BluetoothNamedValue& aValue,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2013-05-09 23:39:12 -07:00
|
|
|
/**
|
2012-07-31 21:49:59 -07:00
|
|
|
* 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;
|
|
|
|
|
2012-08-17 03:35:59 -07:00
|
|
|
virtual nsresult
|
2013-03-15 00:15:47 -07:00
|
|
|
CreatePairedDeviceInternal(const nsAString& aAddress,
|
2012-08-17 03:35:59 -07:00
|
|
|
int aTimeout,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual nsresult
|
2013-03-15 00:15:47 -07:00
|
|
|
RemoveDeviceInternal(const nsAString& aObjectPath,
|
2012-08-17 03:35:59 -07:00
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2012-09-29 02:39:05 -07:00
|
|
|
virtual nsresult
|
|
|
|
GetScoSocket(const nsAString& aObjectPath,
|
|
|
|
bool aAuth,
|
|
|
|
bool aEncrypt,
|
|
|
|
mozilla::ipc::UnixSocketConsumer* aConsumer) = 0;
|
|
|
|
|
2013-05-09 23:39:12 -07:00
|
|
|
/**
|
|
|
|
* 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()
|
|
|
|
*
|
|
|
|
* @return NS_OK if the task begins, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
2012-09-05 20:06:20 -07:00
|
|
|
virtual nsresult
|
2013-05-22 04:08:17 -07:00
|
|
|
GetServiceChannel(const nsAString& aDeviceAddress,
|
2013-05-09 23:39:12 -07:00
|
|
|
const nsAString& aServiceUuid,
|
|
|
|
BluetoothProfileManagerBase* aManager) = 0;
|
2012-09-05 20:06:20 -07:00
|
|
|
|
2013-05-22 04:08:17 -07:00
|
|
|
virtual bool
|
|
|
|
UpdateSdpRecords(const nsAString& aDeviceAddress,
|
|
|
|
BluetoothProfileManagerBase* aManager) = 0;
|
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual bool
|
2012-09-19 16:37:42 -07:00
|
|
|
SetPinCodeInternal(const nsAString& aDeviceAddress, const nsAString& aPinCode,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-09-13 09:37:14 -07:00
|
|
|
|
|
|
|
virtual bool
|
2012-09-19 16:37:42 -07:00
|
|
|
SetPasskeyInternal(const nsAString& aDeviceAddress, uint32_t aPasskey,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-09-06 07:15:36 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual bool
|
2012-09-19 16:37:42 -07:00
|
|
|
SetPairingConfirmationInternal(const nsAString& aDeviceAddress, bool aConfirm,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-09-13 09:37:14 -07:00
|
|
|
|
2012-11-16 02:46:08 -08:00
|
|
|
virtual void
|
2013-09-06 04:19:46 -07:00
|
|
|
Connect(const nsAString& aDeviceAddress, uint32_t aCod, uint16_t aServiceUuid,
|
2012-10-05 03:48:05 -07:00
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-09-29 03:26:46 -07:00
|
|
|
|
|
|
|
virtual void
|
2013-09-06 04:19:46 -07:00
|
|
|
Disconnect(const nsAString& aDeviceAddress, uint16_t aServiceUuid,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
2012-09-29 03:26:46 -07:00
|
|
|
|
2012-11-07 10:12:41 -08:00
|
|
|
virtual bool
|
2013-09-06 04:19:46 -07:00
|
|
|
IsConnected(uint16_t aServiceUuid) = 0;
|
2012-11-07 10:12:41 -08:00
|
|
|
|
2012-11-02 18:36:43 -07:00
|
|
|
virtual void
|
2012-09-28 03:59:12 -07:00
|
|
|
SendFile(const nsAString& aDeviceAddress,
|
|
|
|
BlobParent* aBlobParent,
|
|
|
|
BlobChild* aBlobChild,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2012-11-02 18:36:43 -07:00
|
|
|
virtual void
|
2012-10-03 00:09:27 -07:00
|
|
|
StopSendingFile(const nsAString& aDeviceAddress,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2012-10-18 23:16:13 -07:00
|
|
|
virtual void
|
|
|
|
ConfirmReceivingFile(const nsAString& aDeviceAddress, bool aConfirm,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2013-05-10 03:58:59 -07:00
|
|
|
virtual void
|
|
|
|
ConnectSco(BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
DisconnectSco(BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
IsScoConnected(BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2013-10-29 01:12:46 -07:00
|
|
|
#ifdef MOZ_B2G_RIL
|
2013-10-15 19:38:13 -07:00
|
|
|
virtual void
|
|
|
|
AnswerWaitingCall(BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
IgnoreWaitingCall(BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
ToggleCalls(BluetoothReplyRunnable* aRunnable) = 0;
|
2013-10-29 01:12:46 -07:00
|
|
|
#endif
|
2013-10-15 19:38:13 -07:00
|
|
|
|
2013-07-29 02:32:34 -07:00
|
|
|
virtual void
|
|
|
|
SendMetaData(const nsAString& aTitle,
|
|
|
|
const nsAString& aArtist,
|
|
|
|
const nsAString& aAlbum,
|
2013-07-29 02:32:35 -07:00
|
|
|
int64_t aMediaNumber,
|
|
|
|
int64_t aTotalMediaCount,
|
|
|
|
int64_t aDuration,
|
2013-07-29 02:32:34 -07:00
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
|
|
|
virtual void
|
2013-07-29 02:32:35 -07:00
|
|
|
SendPlayStatus(int64_t aDuration,
|
|
|
|
int64_t aPosition,
|
2013-07-29 02:32:34 -07:00
|
|
|
const nsAString& aPlayStatus,
|
|
|
|
BluetoothReplyRunnable* aRunnable) = 0;
|
|
|
|
|
2013-07-29 02:32:34 -07:00
|
|
|
virtual void
|
|
|
|
UpdatePlayStatus(uint32_t aDuration,
|
|
|
|
uint32_t aPosition,
|
|
|
|
ControlPlayStatus aPlayStatus) = 0;
|
|
|
|
|
2013-06-08 08:25:18 -07:00
|
|
|
virtual nsresult
|
|
|
|
SendSinkMessage(const nsAString& aDeviceAddresses,
|
|
|
|
const nsAString& aMessage) = 0;
|
|
|
|
|
2013-08-12 02:32:25 -07:00
|
|
|
virtual nsresult
|
|
|
|
SendInputMessage(const nsAString& aDeviceAddresses,
|
2013-09-06 04:20:27 -07:00
|
|
|
const nsAString& aMessage) = 0;
|
2013-08-12 02:32:25 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
bool
|
|
|
|
IsEnabled() const
|
2012-09-06 07:15:36 -07:00
|
|
|
{
|
|
|
|
return mEnabled;
|
|
|
|
}
|
|
|
|
|
2012-11-30 01:46:55 -08:00
|
|
|
bool
|
|
|
|
IsToggling() const;
|
|
|
|
|
2013-01-09 07:51:53 -08:00
|
|
|
void
|
|
|
|
RemoveObserverFromTable(const nsAString& key);
|
|
|
|
|
2012-09-06 07:15:36 -07:00
|
|
|
protected:
|
|
|
|
BluetoothService()
|
2012-11-20 23:33:07 -08:00
|
|
|
: mEnabled(false)
|
2012-09-06 07:15:36 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
virtual ~BluetoothService();
|
|
|
|
|
|
|
|
bool
|
|
|
|
Init();
|
|
|
|
|
|
|
|
void
|
|
|
|
Cleanup();
|
2012-09-06 07:15:36 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
nsresult
|
2013-08-01 20:58:01 -07:00
|
|
|
StartStopBluetooth(bool aStart, bool aIsStartup);
|
2012-09-13 09:37:14 -07:00
|
|
|
|
2013-08-28 16:21:52 -07:00
|
|
|
/**
|
2012-09-13 09:37:14 -07:00
|
|
|
* Platform specific startup functions go here. Usually deals with member
|
|
|
|
* variables, so not static. Guaranteed to be called outside of main thread.
|
|
|
|
*
|
|
|
|
* @return NS_OK on correct startup, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
|
|
|
StartInternal() = 0;
|
|
|
|
|
2013-04-15 20:02:23 -07:00
|
|
|
/**
|
2012-09-13 09:37:14 -07:00
|
|
|
* Platform specific startup functions go here. Usually deals with member
|
|
|
|
* variables, so not static. Guaranteed to be called outside of main thread.
|
|
|
|
*
|
|
|
|
* @return NS_OK on correct startup, NS_ERROR_FAILURE otherwise
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
|
|
|
StopInternal() = 0;
|
|
|
|
|
2013-04-15 20:02:23 -07:00
|
|
|
/**
|
|
|
|
* Platform specific startup functions go here. Usually deals with member
|
|
|
|
* variables, so not static. Guaranteed to be called outside of main thread.
|
|
|
|
*
|
|
|
|
* @return true if Bluetooth is enabled, false otherwise
|
|
|
|
*/
|
|
|
|
virtual bool
|
|
|
|
IsEnabledInternal() = 0;
|
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
/**
|
|
|
|
* Called when XPCOM first creates this service.
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
|
|
|
HandleStartup();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the startup settings check has completed.
|
|
|
|
*/
|
|
|
|
nsresult
|
|
|
|
HandleStartupSettingsCheck(bool aEnable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when "mozsettings-changed" observer topic fires.
|
|
|
|
*/
|
|
|
|
nsresult
|
|
|
|
HandleSettingsChanged(const nsAString& aData);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when XPCOM is shutting down.
|
|
|
|
*/
|
|
|
|
virtual nsresult
|
|
|
|
HandleShutdown();
|
2012-09-06 07:15:36 -07:00
|
|
|
|
|
|
|
// Called by ToggleBtAck.
|
2012-09-13 09:37:14 -07:00
|
|
|
void
|
|
|
|
SetEnabled(bool aEnabled);
|
2012-09-06 07:15:36 -07:00
|
|
|
|
2012-09-13 09:37:14 -07:00
|
|
|
// Called by Get().
|
|
|
|
static BluetoothService*
|
|
|
|
Create();
|
2012-08-17 03:35:59 -07:00
|
|
|
|
2012-07-17 20:41:54 -07:00
|
|
|
typedef nsClassHashtable<nsStringHashKey, BluetoothSignalObserverList >
|
|
|
|
BluetoothSignalObserverTable;
|
|
|
|
|
|
|
|
BluetoothSignalObserverTable mBluetoothSignalObserverTable;
|
2012-09-06 07:15:36 -07:00
|
|
|
|
|
|
|
bool mEnabled;
|
2013-08-30 11:18:43 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Due to the fact that the startup and shutdown of the Bluetooth system
|
|
|
|
* can take an indefinite amount of time, a command thread is created
|
|
|
|
* that can run blocking calls. The thread is not intended for regular
|
|
|
|
* Bluetooth operations though.
|
|
|
|
*/
|
|
|
|
nsCOMPtr<nsIThread> mBluetoothThread;
|
2012-07-17 20:41:54 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
END_BLUETOOTH_NAMESPACE
|
|
|
|
|
|
|
|
#endif
|