1 /*
2  * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup Bluetooth
18  * @{
19  *
20  * @brief Defines bluetooth host, including observer and common functions.
21  *
22  * @since 6
23  */
24 
25 /**
26  * @file bluetooth_host.h
27  *
28  * @brief Framework bluetooth host interface.
29  *
30  * @since 6
31  */
32 
33 #ifndef BLUETOOTH_HOST_H
34 #define BLUETOOTH_HOST_H
35 
36 #include <string>
37 
38 #include "bluetooth_battery_info.h"
39 #include "bluetooth_def.h"
40 #include "bluetooth_types.h"
41 #include "bluetooth_remote_device.h"
42 #include "bluetooth_device_class.h"
43 #include "refbase.h"
44 #include "bluetooth_no_destructor.h"
45 
46 namespace OHOS { class IRemoteObject; }
47 namespace OHOS {
48 namespace Bluetooth {
49 /**
50  * @brief Represents framework host device basic observer.
51  *
52  * @since 6
53  */
54 class BluetoothHostObserver {
55 public:
56     /**
57      * @brief A destructor used to delete the <b>BluetoothHostObserver</b> instance.
58      *
59      * @since 6
60      */
61     virtual ~BluetoothHostObserver() = default;
62 
63     // common
64     /**
65      * @brief Adapter state change function.
66      *
67      * @param transport Transport type when state change.
68      *        BTTransport::ADAPTER_BREDR : classic;
69      *        BTTransport::ADAPTER_BLE : ble.
70      * @param state Change to the new state.
71      *        BTStateID::STATE_TURNING_ON;
72      *        BTStateID::STATE_TURN_ON;
73      *        BTStateID::STATE_TURNING_OFF;
74      *        BTStateID::STATE_TURN_OFF.
75      * @since 6
76      */
77     virtual void OnStateChanged(const int transport, const int status) = 0;
78 
79     // gap
80     /**
81      * @brief Discovery state changed observer.
82      *
83      * @param status Device discovery status.
84      * @since 6
85      */
86     virtual void OnDiscoveryStateChanged(int status) = 0;
87 
88     /**
89      * @brief Discovery result observer.
90      *
91      * @param device Remote device.
92      * @param rssi Rssi of device.
93      * @param deviceName Name of device.
94      * @param deviceClass Class of device.
95      * @since 6
96      */
97     virtual void OnDiscoveryResult(
98         const BluetoothRemoteDevice &device, int rssi, const std::string deviceName, int deviceClass) = 0;
99 
100     /**
101      * @brief Pair request observer.
102      *
103      * @param device Remote device.
104      * @since 6
105      */
106     virtual void OnPairRequested(const BluetoothRemoteDevice &device) = 0;
107 
108     /**
109      * @brief Pair confirmed observer.
110      *
111      * @param device Remote device.
112      * @param reqType Pair type.
113      * @param number Paired passkey.
114      * @since 6
115      */
116     virtual void OnPairConfirmed(const BluetoothRemoteDevice &device, int reqType, int number) = 0;
117 
118     /**
119      * @brief Scan mode changed observer.
120      *
121      * @param mode Device scan mode.
122      * @since 6
123      */
124     virtual void OnScanModeChanged(int mode) = 0;
125 
126     /**
127      * @brief Device name changed observer.
128      *
129      * @param deviceName Device name.
130      * @since 6
131      */
132     virtual void OnDeviceNameChanged(const std::string &deviceName) = 0;
133 
134     /**
135      * @brief Device address changed observer.
136      *
137      * @param address Device address.
138      * @since 6
139      */
140     virtual void OnDeviceAddrChanged(const std::string &address) = 0;
141 };
142 
143 /**
144  * @brief Represents remote device observer.
145  *
146  * @since 6
147  */
148 class BluetoothRemoteDeviceObserver {
149 public:
150     /**
151      * @brief A destructor used to delete the <b>BluetoothRemoteDeviceObserver</b> instance.
152      *
153      * @since 6
154      */
155     virtual ~BluetoothRemoteDeviceObserver() = default;
156 
157     /**
158      * @brief Acl state changed observer.
159      *
160      * @param device Remote device.
161      * @param state Remote device acl state.
162      * @param reason Remote device reason.
163      * @since 6
164      */
165     virtual void OnAclStateChanged(const BluetoothRemoteDevice &device, int state, unsigned int reason) = 0;
166 
167     /**
168      * @brief Pair status changed observer.
169      *
170      * @param device Remote device.
171      * @param status Remote device pair status.
172      * @param cause Pair fail cause.
173      * @since 12
174      */
175     virtual void OnPairStatusChanged(const BluetoothRemoteDevice &device, int status, int cause) = 0;
176 
177     /**
178      * @brief Remote uuid changed observer.
179      *
180      * @param device Remote device.
181      * @param uuids Remote device uuids.
182      * @since 6
183      */
184     virtual void OnRemoteUuidChanged(const BluetoothRemoteDevice &device, const std::vector<ParcelUuid> &uuids) = 0;
185 
186     /**
187      * @brief Remote name changed observer.
188      *
189      * @param device Remote device.
190      * @param deviceName Remote device name.
191      * @since 6
192      */
193     virtual void OnRemoteNameChanged(const BluetoothRemoteDevice &device, const std::string &deviceName) = 0;
194 
195     /**
196      * @brief Remote alias changed observer.
197      *
198      * @param device Remote device.
199      * @param alias Remote device alias.
200      * @since 6
201      */
202     virtual void OnRemoteAliasChanged(const BluetoothRemoteDevice &device, const std::string &alias) = 0;
203 
204     /**
205      * @brief Remote cod changed observer.
206      *
207      * @param device Remote device.
208      * @param cod Remote device cod.
209      * @since 6
210      */
211     virtual void OnRemoteCodChanged(const BluetoothRemoteDevice &device, const BluetoothDeviceClass &cod) = 0;
212 
213     /**
214      * @brief Remote battery level changed observer.
215      *
216      * @param device Remote device.
217      * @param cod Remote device battery Level.
218      * @since 6
219      */
220     virtual void OnRemoteBatteryLevelChanged(const BluetoothRemoteDevice &device, int batteryLevel) = 0;
221 
222     /**
223      * @brief Remote rssi event observer.
224      *
225      * @param device Remote device.
226      * @param rssi Remote device rssi.
227      * @param status Read status.
228      * @since 6
229      */
230     virtual void OnReadRemoteRssiEvent(const BluetoothRemoteDevice &device, int rssi, int status) = 0;
231 
232     /**
233      * @brief Remote device battery info observer.
234      *
235      * @param device Remote device.
236      * @param batteryInfo Remote device batteryInfo
237      * @since 12
238      */
OnRemoteBatteryChanged(const BluetoothRemoteDevice &device, const DeviceBatteryInfo &batteryInfo)239     virtual void OnRemoteBatteryChanged(const BluetoothRemoteDevice &device, const DeviceBatteryInfo &batteryInfo)
240     {};
241 
242     /**
243      * @brief Remote device common value observer.
244      *
245      * @param device Remote device.
246      * @param value Remote device report info
247      * @since 12
248      */
OnRemoteDeviceCommonInfoReport(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &value)249     virtual void OnRemoteDeviceCommonInfoReport(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &value)
250     {};
251 };
252 
253 /**
254  * @brief Represents bluetooth resource manager observer.
255  *
256  * @since 12
257  */
258 class BluetoothResourceManagerObserver {
259 public:
260     /**
261      * @brief A destructor used to delete the <b>BluetoothResourceManagerObserver</b> instance.
262      *
263      * @since 12
264      */
265     virtual ~BluetoothResourceManagerObserver() = default;
266 
267     /**
268      * @brief sensing state changed observer.
269      *
270      * @param eventId bluetooth resource manager event id.
271      * @param info bluetooth sensing information.
272      * @since 12
273      */
OnSensingStateChanged(uint8_t eventId, const SensingInfo &info)274     virtual void OnSensingStateChanged(uint8_t eventId, const SensingInfo &info)
275     {};
276 
277     /**
278      * @brief bluetooth resource decision observer.
279      *
280      * @param eventId bluetooth resource manager event id.
281      * @param info bluetooth sensing information.
282      * @param result bluetooth resource decision result.
283      * @since 12
284      */
OnBluetoothResourceDecision(uint8_t eventId, const SensingInfo &info, uint32_t &result)285     virtual void OnBluetoothResourceDecision(uint8_t eventId, const SensingInfo &info, uint32_t &result)
286     {};
287 };
288 
289 /**
290  * @brief Represents framework host device.
291  *
292  * @since 6
293  */
294 class BLUETOOTH_API BluetoothHost {
295 public:
296     // common
297     /**
298      * @brief Get default host device.
299      *
300      * @return Returns the singleton instance.
301      * @since 6
302      */
303     static BluetoothHost &GetDefaultHost();
304 
305     /**
306      * @brief Get remote device instance.
307      *
308      * @param addr Remote device address.
309      * @param transport Adapter transport.
310      * @return Returns remote device instance.
311      * @since 6
312      */
313     BluetoothRemoteDevice GetRemoteDevice(const std::string &addr, int transport) const;
314 
315     /**
316      * @brief Register observer.
317      *
318      * @param observer Class BluetoothHostObserver pointer to register observer.
319      * @since 6
320      */
321     void RegisterObserver(std::shared_ptr<BluetoothHostObserver> observer);
322 
323     /**
324      * @brief Deregister observer.
325      *
326      * @param observer Class BluetoothHostObserver pointer to deregister observer.
327      * @since 6
328      */
329     void DeregisterObserver(std::shared_ptr<BluetoothHostObserver> observer);
330 
331     /**
332      * @brief Enable classic.
333      *
334      * @return Returns <b>true</b> if the operation is accepted;
335      *         returns <b>false</b> if the operation is rejected.
336      * @since 6
337      */
338     int EnableBt();
339 
340     /**
341      * @brief Disable classic.
342      *
343      * @return Returns <b>true</b> if the operation is accepted;
344      *         returns <b>false</b> if the operation is rejected.
345      * @since 6
346      */
347     int DisableBt();
348 
349     /**
350      * @brief Get classic enable/disable state.
351      *
352      * @return Returns classic enable/disable state.
353      *         BTStateID::STATE_TURNING_ON;
354      *         BTStateID::STATE_TURN_ON;
355      *         BTStateID::STATE_TURNING_OFF;
356      *         BTStateID::STATE_TURN_OFF.
357      * @since 6
358      */
359     int GetBtState() const;
360 
361     /**
362      * @brief Get classic enable/disable state.
363      *
364      * @param Returns classic enable/disable state.
365      *         BTStateID::STATE_TURNING_ON;
366      *         BTStateID::STATE_TURN_ON;
367      *         BTStateID::STATE_TURNING_OFF;
368      *         BTStateID::STATE_TURN_OFF.
369      * @since 6
370      */
371     int GetBtState(int &state) const;
372 
373     /**
374      * @brief Disable ble.
375      *
376      * @return Returns <b>true</b> if the operation is accepted;
377      *         returns <b>false</b> if the operation is rejected.
378      * @since 6
379      */
380     int DisableBle();
381 
382     /**
383      * @brief Enable ble.
384      *
385      * @return Returns <b>true</b> if the operation is accepted;
386      *         returns <b>false</b> if the operation is rejected.
387      * @since 6
388      */
389     int EnableBle();
390 
391     /**
392      * @brief Enable bluetooth to restrict mode.
393      *
394      * @return Returns BT_NO_ERROR if the operation is accepted;
395      *         returns others if the operation is rejected.
396      * @since 12
397      */
398     int EnableBluetoothToRestrictMode(void);
399 
400     /**
401      * @brief Get br/edr enable/disable state.
402      *
403      * @return Returns <b>true</b> if br is enabled;
404      *         returns <b>false</b> if br is not enabled.
405      * @since 6
406      */
407     bool IsBrEnabled() const;
408 
409     /**
410      * @brief Get ble enable/disable state.
411      *
412      * @return Returns <b>true</b> if ble is enabled;
413      *         returns <b>false</b> if ble is not enabled.
414      * @since 6
415      */
416     bool IsBleEnabled() const;
417 
418     /**
419      * @brief Factory reset bluetooth service.
420      *
421      * @return Returns <b>true</b> if the operation is successful;
422      *         returns <b>false</b> if the operation fails.
423      * @since 6
424      */
425     int BluetoothFactoryReset();
426 
427     /**
428      * @brief Get profile service ID list.
429      *
430      * @return Returns vector of enabled profile services ID.
431      * @since 6
432      */
433     std::vector<uint32_t> GetProfileList() const;
434 
435     /**
436      * @brief Get max audio connected devices number.
437      *
438      * @return Returns max device number that audio can connect.
439      * @since 6
440      */
441     int GetMaxNumConnectedAudioDevices() const;
442 
443     /**
444      * @brief Get bluetooth connects state.
445      *
446      * @return Returns bluetooth connects state.
447      *         BTConnectState::CONNECTING;
448      *         BTConnectState::CONNECTED;
449      *         BTConnectState::DISCONNECTING;
450      *         BTConnectState::DISCONNECTED.
451      * @since 6
452      */
453     int GetBtConnectionState() const;
454 
455     /**
456      * @brief Get bluetooth connects state.
457      *
458      * @return Returns bluetooth connects state.
459      *         BTConnectState::CONNECTING;
460      *         BTConnectState::CONNECTED;
461      *         BTConnectState::DISCONNECTING;
462      *         BTConnectState::DISCONNECTED.
463      * @since 6
464      */
465     int GetBtConnectionState(int &state) const;
466 
467     /**
468      * @brief Get profile service connect state.
469      *
470      * @param profileID Profile service ID.
471      * @return Returns connect state for designated profile service.
472      *         BTConnectState::CONNECTING;
473      *         BTConnectState::CONNECTED;
474      *         BTConnectState::DISCONNECTING;
475      *         BTConnectState::DISCONNECTED.
476      * @since 6
477      */
478     int GetBtProfileConnState(uint32_t profileId, int &state) const;
479 
480     /**
481      * @brief Get local device supported uuids.
482      *
483      * @param[out] Vector which use to return support uuids.
484      * @since 6
485      */
486     void GetLocalSupportedUuids(std::vector<ParcelUuid> &uuids);
487 
488     /**
489      * @brief Start adapter manager, passthrough only.
490      *
491      * @return Returns <b>true</b> if the operation is successful;
492      *         returns <b>false</b> if the operation fails.
493      * @since 6
494      */
495     bool Start();
496 
497     /**
498      * @brief Stop adapter manager, passthrough only.
499      *
500      * @since 6
501      */
502     void Stop();
503 
504     // gap
505     /**
506      * @brief Get local device class.
507      *
508      * @return Returns local device class.
509      * @since 6
510      */
511     BluetoothDeviceClass GetLocalDeviceClass() const;
512 
513     /**
514      * @brief Set local device class.
515      *
516      * @param deviceClass Device class.
517      * @return Returns <b>true</b> if the operation is successful;
518      *         returns <b>false</b> if the operation fails.
519      * @since 6
520      */
521     bool SetLocalDeviceClass(const BluetoothDeviceClass &deviceClass);
522 
523     /**
524      * @brief Get local device address.
525      *
526      * @param addr local address.
527      * @return Returns {@link BT_NO_ERROR} if the operation is successful;
528      *         returns an error code defined in {@link BtErrCode} otherwise.
529      * @since 6
530      */
531     int GetLocalAddress(std::string &addr) const;
532 
533     /**
534      * @brief Get local device name.
535      *
536      * @return Returns local device name.
537      * @since 6
538      */
539     std::string GetLocalName() const;
540 
541     /**
542      * @brief Get local device name.
543      *
544      * @return Returns local device name.
545      * @since 6
546      */
547     int GetLocalName(std::string &name) const;
548 
549     /**
550      * @brief Set local device name.
551      *
552      * @param name Device name.
553      * @return Returns <b>true</b> if the operation is successful;
554      *         returns <b>false</b> if the operation fails.
555      * @since 6
556      */
557     int SetLocalName(const std::string &name);
558 
559     /**
560      * @brief Get device scan mode.
561      *
562      * @return Returns bluetooth scan mode.
563      * @since 6
564      */
565     int GetBtScanMode(int32_t &scanMode) const;
566 
567     /**
568      * @brief Set device scan mode.
569      *
570      * @param mode Scan mode.
571      * @param duration Scan time.
572      * @return Returns <b>true</b> if the operation is successful;
573      *         returns <b>false</b> if the operation fails.
574      * @since 6
575      */
576     int SetBtScanMode(int mode, int duration);
577 
578     /**
579      * @brief Get local device bondable mode.
580      *
581      * @param transport Adapter transport.
582      * @return Returns local device bondable mode.
583      * @since 6
584      */
585     int GetBondableMode(int transport) const;
586 
587     /**
588      * @brief Set local device bondable mode.
589      *
590      * @param transport Adapter transport.
591      * @param mode Device bondable mode.
592      * @return Returns <b>true</b> if the operation is successful;
593      *         returns <b>false</b> if the operation fails.
594      * @since 6
595      */
596     bool SetBondableMode(int transport, int mode);
597 
598     /**
599      * @brief Get device address.
600      * @return Returns <b>true</b> if the operation is successful;
601      *         returns <b>false</b> if the operation fails.
602      * @since 6
603      */
604     int StartBtDiscovery();
605 
606     /**
607      * @brief Cancel device discovery.
608      *
609      * @return Returns <b>true</b> if the operation is successful;
610      *         returns <b>false</b> if the operation fails.
611      * @since 6
612      */
613     int CancelBtDiscovery();
614 
615     /**
616      * @brief Check if device is discovering.
617      *
618      * @return Returns <b>BT_NO_ERROR</b> if the operation is successful;
619      *         returns <b>false</b> if device is not discovering.
620      * @since 6
621      */
622     int IsBtDiscovering(bool &isDisCovering, int transport = BT_TRANSPORT_BREDR) const;
623 
624     /**
625      * @brief Get device discovery end time.
626      *
627      * @return Returns device discovery end time.
628      * @since 6
629      */
630     long GetBtDiscoveryEndMillis() const;
631 
632     /**
633      * @brief Get paired devices.
634      *
635      * @param transport Adapter transport.
636      * @return Returns paired devices vector.
637      * @since 6
638      */
639     int32_t GetPairedDevices(int transport, std::vector<BluetoothRemoteDevice> &pairedDevices) const;
640 
641     /**
642      * @brief Remove pair.
643      *
644      * @param device Remote device address.
645      * @return Returns <b>true</b> if the operation is successful;
646      *         returns <b>false</b> if the operation fails.
647      * @since 6
648      */
649     int32_t RemovePair(const BluetoothRemoteDevice &device);
650 
651     /**
652      * @brief Remove all pairs.
653      *
654      * @return Returns <b>true</b> if the operation is successful;
655      *         returns <b>false</b> if the operation fails.
656      * @since 6
657      */
658     bool RemoveAllPairs();
659 
660     /**
661      * @brief Check if bluetooth address is valid.
662      *
663      * @param addr Bluetooth address.
664      * @return Returns <b>true</b> if bluetooth address is valid;
665      *         returns <b>false</b> if bluetooth address is not valid.
666      * @since 6
667      */
668     static bool IsValidBluetoothAddr(const std::string &addr);
669 
670     /**
671      * @brief Register remote device observer.
672      *
673      * @param observer Class BluetoothRemoteDeviceObserver pointer to register observer.
674      * @return Returns <b>true</b> if the operation is successful;
675      *         returns <b>false</b> if the operation fails.
676      * @since 6
677      */
678     void RegisterRemoteDeviceObserver(std::shared_ptr<BluetoothRemoteDeviceObserver> observer);
679 
680     /**
681      * @brief Deregister remote device observer.
682      *
683      * @param observer Class BluetoothRemoteDeviceObserver pointer to deregister observer.
684      * @return Returns <b>true</b> if the operation is successful;
685      *         returns <b>false</b> if the operation fails.
686      * @since 6
687      */
688     void DeregisterRemoteDeviceObserver(std::shared_ptr<BluetoothRemoteDeviceObserver> observer);
689 
690     /**
691      * @brief Get max advertising data length.
692      *
693      * @return Returns max advertising data length.
694      * @since 6
695      */
696     int GetBleMaxAdvertisingDataLength() const;
697 
698     void LoadSystemAbilitySuccess(const sptr<IRemoteObject> &remoteObject);
699 
700     void LoadSystemAbilityFail();
701 
702     void OnRemoveBluetoothSystemAbility();
703 
704     /**
705      * @brief Get local profile uuids.
706      *
707      * @return Returns local profile uuids.
708      * @since 10
709      */
710     int32_t GetLocalProfileUuids(std::vector<std::string> &uuids);
711 
712     /**
713     * @brief Set fast scan enable or disable.
714     * @param isEnable set fast scan status flag.
715     * @return Returns <b>true</b> if the operation is successful;
716     *         returns <b>false</b> if the operation fails.
717     */
718     int SetFastScan(bool isEnable);
719 
720     /**
721     * @brief Get the random address of a device.
722     * If the address carried in the bluetooth interface is not obtained from the bluetooth,
723     * the interface needs to be used for address translation.
724     * @param realAddr real address.
725     * @param[out] randomAddr random address.
726     * @return Returns {@link BT_NO_ERROR} if get random address success;
727     * returns an error code defined in {@link BtErrCode} otherwise.
728     */
729     int GetRandomAddress(const std::string &realAddr, std::string &randomAddr) const;
730 
731     /**
732     * @brief Connects all allowed bluetooth profiles between the local and remote device.
733     *
734     * @param remoteAddr remote device addr.
735     * @return Returns {@link BT_NO_ERROR} if the operation is successful;
736     *         returns an error code defined in {@link BtErrCode} otherwise.
737     * @since 11
738     */
739     int ConnectAllowedProfiles(const std::string &remoteAddr) const;
740 
741     /**
742     * @brief Disconnects all allowed bluetooth profiles between the local and remote device.
743     *
744     * @param remoteAddr remote device addr.
745     * @return Returns {@link BT_NO_ERROR} if the operation is successful;
746     *         returns an error code defined in {@link BtErrCode} otherwise.
747     * @since 11
748     */
749     int DisconnectAllowedProfiles(const std::string &remoteAddr) const;
750 
751     /**
752     * @brief Restrict Bluetooth BR/EDR ability, just BLE ability available.
753     *
754     * @return Returns {@link BT_NO_ERROR} if the operation is successful;
755     *         returns an error code defined in {@link BtErrCode} otherwise.
756     * @since 12
757     */
758     int RestrictBluetooth();
759     /**
760     * @brief update virtual device
761     *
762     * @param action add or delete virtual device.
763     * @param device device need to be operator.
764     * @since 12
765     */
766     void UpdateVirtualDevice(int32_t action, const std::string &address);
767 
768     /**
769     * @brief Restrict Bluetooth BR/EDR ability, just BLE ability available.
770     *
771     * @param type satellite control type.
772     * @param state satellite state.
773     * @return Returns {@link BT_NO_ERROR} if the operation is successful;
774     *         returns an error code defined in {@link BtErrCode} otherwise.
775     * @since 12
776     */
777     int SatelliteControl(int type, int state);
778 
779     /**
780      * @brief Register bluetooth resource manager observer.
781      *
782      * @param observer Class RegisterBtResourceManagerObserver pointer to register observer.
783      * @since 12
784      */
785     void RegisterBtResourceManagerObserver(std::shared_ptr<BluetoothResourceManagerObserver> observer);
786 
787     /**
788      * @brief Deregister bluetooth resource manager observer.
789      *
790      * @param observer Class RegisterBtResourceManagerObserver pointer to deregister observer.
791      * @since 12
792      */
793     void DeregisterBtResourceManagerObserver(std::shared_ptr<BluetoothResourceManagerObserver> observer);
794 
795     /**
796      * @brief Set local adapter scan level.
797      *
798      * @param level Scan level.
799      * @return Returns <b>true</b> if the operation is successful;
800      *         returns <b>false</b> if the operation fails.
801      * @since 12
802      */
803     int SetFastScanLevel(int level);
804 
805     /**
806      * @brief Close the bluetooth host to release resources, only called before the process exits.
807      *
808      * @since 13
809      */
810     void Close(void);
811 private:
812     /**
813      * @brief A constructor used to create a <b>BluetoothHost</b> instance.
814      *
815      * @since 6
816      */
817     BluetoothHost();
818 
819     /**
820      * @brief A destructor used to delete the <b>BluetoothHost</b> instance.
821      *
822      * @since 6
823      */
824     ~BluetoothHost();
825 
826     /**
827     * @brief Check whether bluetooth is prohibited by EDM.
828     *
829     * @return Returns <b>true</b> if bluetooth is prohibited, returns <b>false</b> otherwise.
830     * @since 11
831     */
832     bool IsBtProhibitedByEdm(void);
833 
834     BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothHost);
835     BLUETOOTH_DECLARE_IMPL();
836 
837 #ifdef DTFUZZ_TEST
838     friend class BluetoothNoDestructor<BluetoothHost>;
839 #endif
840 };
841 } // namespace Bluetooth
842 } // namespace OHOS
843 
844 #endif  // BLUETOOTH_HOST_H
845