1  /*
2   * Copyright (c) 2022-2024 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  #ifndef OHOS_ACCESS_TOKEN_DEVICE_MANAGER_H
17  #define OHOS_ACCESS_TOKEN_DEVICE_MANAGER_H
18  
19  #include <string>
20  #include <vector>
21  
22  #include "device_manager_callback.h"
23  #include "dm_device_info.h"
24  #include "securec.h"
25  
26  namespace OHOS {
27  namespace Security {
28  namespace AccessToken {
29  namespace DistributedHardware {
30  class DeviceManager {
31  public:
GetInstance()32      static DeviceManager &GetInstance()
33      {
34          static DeviceManager instance;
35          return instance;
36      }
37  
InitDeviceManager(const std::string & pkgName,std::shared_ptr<DmInitCallback> dmInitCallback)38      int32_t InitDeviceManager(const std::string &pkgName, std::shared_ptr<DmInitCallback> dmInitCallback)
39      {
40          return 0;
41      }
42  
UnInitDeviceManager(const std::string & pkgName)43      int32_t UnInitDeviceManager(const std::string &pkgName)
44      {
45          return 0;
46      }
47  
RegisterDevStateCallback(const std::string & pkgName,const std::string & extra,std::shared_ptr<DeviceStateCallback> callback)48      int32_t RegisterDevStateCallback(const std::string &pkgName, const std::string &extra,
49          std::shared_ptr<DeviceStateCallback> callback)
50      {
51          return 0;
52      }
53  
UnRegisterDevStateCallback(const std::string & pkgName)54      int32_t UnRegisterDevStateCallback(const std::string &pkgName)
55      {
56          return 0;
57      }
58  
GetTrustedDeviceList(const std::string & pkgName,const std::string & extra,std::vector<DmDeviceInfo> & deviceList)59      int32_t GetTrustedDeviceList(const std::string &pkgName, const std::string &extra,
60          std::vector<DmDeviceInfo> &deviceList)
61      {
62          return 0;
63      }
64  
GetLocalDeviceInfo(const std::string & pkgName,DmDeviceInfo & deviceInfo)65      int32_t GetLocalDeviceInfo(const std::string &pkgName, DmDeviceInfo &deviceInfo)
66      {
67          strcpy_s(deviceInfo.networkId, DM_MAX_DEVICE_ID_LEN + 1, "deviceid-1");
68          return 0;
69      }
70  
GetUdidByNetworkId(const std::string & pkgName,const std::string & netWorkId,std::string & udid)71      int32_t GetUdidByNetworkId(const std::string &pkgName, const std::string &netWorkId, std::string &udid)
72      {
73          udid = netWorkId + ":udid-001";
74          return 0;
75      }
76  
GetUuidByNetworkId(const std::string & pkgName,const std::string & netWorkId,std::string & uuid)77      int32_t GetUuidByNetworkId(const std::string &pkgName, const std::string &netWorkId, std::string &uuid)
78      {
79          uuid = netWorkId + ":uuid-001";
80          return 0;
81      }
82  };
83  } // namespace DistributedHardware
84  } // namespace AccessToken
85  } // namespace Security
86  } // namespace OHOS
87  #endif // OHOS_ACCESS_TOKEN_DEVICE_MANAGER_H