1 /*
2  * Copyright (c) 2023 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 #include "ddm_adapter.h"
17 
18 #include "ddm_adapter_impl.h"
19 #include "devicestatus_define.h"
20 
21 #undef LOG_TAG
22 #define LOG_TAG "DDMAdapter"
23 
24 namespace OHOS {
25 namespace Msdp {
26 namespace DeviceStatus {
27 
DDMAdapter()28 DDMAdapter::DDMAdapter()
29 {
30     ddm_ = std::make_shared<DDMAdapterImpl>();
31 }
32 
Enable()33 int32_t DDMAdapter::Enable()
34 {
35     CALL_DEBUG_ENTER;
36     return ddm_->Enable();
37 }
38 
Disable()39 void DDMAdapter::Disable()
40 {
41     CALL_DEBUG_ENTER;
42     ddm_->Disable();
43 }
44 
AddBoardObserver(std::shared_ptr<IBoardObserver> observer)45 void DDMAdapter::AddBoardObserver(std::shared_ptr<IBoardObserver> observer)
46 {
47     CALL_DEBUG_ENTER;
48     ddm_->AddBoardObserver(observer);
49 }
50 
RemoveBoardObserver(std::shared_ptr<IBoardObserver> observer)51 void DDMAdapter::RemoveBoardObserver(std::shared_ptr<IBoardObserver> observer)
52 {
53     CALL_DEBUG_ENTER;
54     ddm_->RemoveBoardObserver(observer);
55 }
56 
CheckSameAccountToLocal(const std::string & networkId)57 bool DDMAdapter::CheckSameAccountToLocal(const std::string &networkId)
58 {
59     CALL_DEBUG_ENTER;
60     return ddm_->CheckSameAccountToLocal(networkId);
61 }
62 } // namespace DeviceStatus
63 } // namespace Msdp
64 } // namespace OHOS
65