|
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ |
|
2 /* vim: set ts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef mozilla_dom_bluetooth_bluetoothhfpmanager_h__ |
|
8 #define mozilla_dom_bluetooth_bluetoothhfpmanager_h__ |
|
9 |
|
10 #include "BluetoothHfpManagerBase.h" |
|
11 |
|
12 /** |
|
13 * Fallback BluetoothHfpManager is built for non-phone devices (e.g., tablets). |
|
14 * These devices has no radio interface and the build flag MOZ_B2G_RIL is |
|
15 * disabled. To prevent build breaks of accessing radio interface, we implement |
|
16 * fallback BluetoothHfpManager with empty functions to keep original |
|
17 * BluetoothHfpManager away from numerous #ifdef/#endif statements. |
|
18 */ |
|
19 |
|
20 BEGIN_BLUETOOTH_NAMESPACE |
|
21 |
|
22 class BluetoothHfpManager : public BluetoothHfpManagerBase |
|
23 { |
|
24 public: |
|
25 BT_DECL_HFP_MGR_BASE |
|
26 virtual void GetName(nsACString& aName) |
|
27 { |
|
28 aName.AssignLiteral("Fallback HFP/HSP"); |
|
29 } |
|
30 |
|
31 static BluetoothHfpManager* Get(); |
|
32 virtual ~BluetoothHfpManager() { } |
|
33 |
|
34 bool ConnectSco(); |
|
35 bool DisconnectSco(); |
|
36 |
|
37 private: |
|
38 BluetoothHfpManager() { } |
|
39 bool Init(); |
|
40 void HandleShutdown(); |
|
41 }; |
|
42 |
|
43 END_BLUETOOTH_NAMESPACE |
|
44 |
|
45 #endif |