diff --git a/services/ans/BUILD.gn b/services/ans/BUILD.gn index c76765868e2952a85a6f2e351620cfbde09ca17f..6c6e27460748daa80c54b0e55bdd6e1fae1fe751 100644 --- a/services/ans/BUILD.gn +++ b/services/ans/BUILD.gn @@ -71,6 +71,7 @@ ohos_shared_library("libans") { "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "c_utils:utils", + "device_manager:devicemanagersdk", "hitrace_native:hitrace_meter", "kv_store:distributeddata_inner", "multimedia_image_framework:image_native", diff --git a/services/ans/src/advanced_notification_service.cpp b/services/ans/src/advanced_notification_service.cpp index aef1db1735d913780c60f4d9a5010b4109d26b71..d31c04410b2ff93578e45f90f23fcbdd2bd5a072 100644 --- a/services/ans/src/advanced_notification_service.cpp +++ b/services/ans/src/advanced_notification_service.cpp @@ -2899,7 +2899,7 @@ bool AdvancedNotificationService::CheckDistributedNotificationType(const sptrGetLocalDeviceInfo(localDeviceInfo); for (auto device : deviceTypeList) { - if (device == localDeviceInfo.deviceType) { + if (atoi(device.c_str()) == localDeviceInfo.deviceTypeId) { return true; } } @@ -3058,7 +3058,7 @@ void AdvancedNotificationService::OnDistributedDelete( std::string recordDeviceId; DistributedDatabase::DeviceInfo localDeviceInfo; if (DistributedNotificationManager::GetInstance()->GetLocalDeviceInfo(localDeviceInfo) == ERR_OK && - deviceId == localDeviceInfo.deviceId) { + strcmp(deviceId.c_str(), localDeviceInfo.deviceId) == 0) { recordDeviceId = ""; } else { recordDeviceId = deviceId; diff --git a/services/ans/test/unittest/BUILD.gn b/services/ans/test/unittest/BUILD.gn index 0646309d23db1e5b3d0607aef668ff3164f55ad3..d47f82a21d06f9f79d9d6a853e24d5d5f29f0edf 100644 --- a/services/ans/test/unittest/BUILD.gn +++ b/services/ans/test/unittest/BUILD.gn @@ -91,6 +91,7 @@ ohos_unittest("ans_unit_test") { "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", + "device_manager:devicemanagersdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", "hitrace_native:libhitracechain", diff --git a/services/distributed/BUILD.gn b/services/distributed/BUILD.gn index 3af9f23998ab4c9adfa26887cdef2a612b0982be..c9a79c6a559a39b5eb39a42490a11885b80309fb 100644 --- a/services/distributed/BUILD.gn +++ b/services/distributed/BUILD.gn @@ -48,6 +48,7 @@ ohos_shared_library("libans_distributed") { "ability_base:want", "ability_base:zuri", "c_utils:utils", + "device_manager:devicemanagersdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", diff --git a/services/distributed/include/distributed_database.h b/services/distributed/include/distributed_database.h index dca37c7b152ef52522c85b8d2a23a139c27f86b0..ba46d5f62d139e7d911a832d8310ebeb25cd2282 100644 --- a/services/distributed/include/distributed_database.h +++ b/services/distributed/include/distributed_database.h @@ -21,6 +21,7 @@ #include #include +#include "device_manager_callback.h" #include "distributed_kv_data_manager.h" #include "singleton.h" @@ -33,7 +34,7 @@ namespace Notification { class DistributedDatabase : private DistributedFlowControl { public: using Entry = DistributedKv::Entry; - using DeviceInfo = DistributedKv::DeviceInfo; + using DeviceInfo = DistributedHardware::DmDeviceInfo; /** * @brief The constructor. @@ -137,6 +138,7 @@ private: std::shared_ptr kvStore_; std::shared_ptr databaseCb_; std::shared_ptr deviceCb_; + std::shared_ptr initCallback_; std::string localDeviceId_; diff --git a/services/distributed/include/distributed_device_callback.h b/services/distributed/include/distributed_device_callback.h index cdb837e45fa10835c572fad141bd33f4712b5602..aaad14a23afd470cf2597f808b942972a46884d8 100644 --- a/services/distributed/include/distributed_device_callback.h +++ b/services/distributed/include/distributed_device_callback.h @@ -18,11 +18,12 @@ #include -#include "device_status_change_listener.h" +#include "device_manager_callback.h" +#include "dm_device_info.h" namespace OHOS { namespace Notification { -class DistributedDeviceCallback : public DistributedKv::DeviceStatusChangeListener { +class DistributedDeviceCallback : public DistributedHardware::DeviceStateCallback { public: /** * @brief Device connection status changed callback function structure. @@ -45,9 +46,10 @@ public: ~DistributedDeviceCallback(); private: - void OnDeviceChanged( - const DistributedKv::DeviceInfo &info, const DistributedKv::DeviceChangeType &type) const override; - DistributedKv::DeviceFilterStrategy GetFilterStrategy() const override; + void OnDeviceOnline(const DistributedHardware::DmDeviceInfo &deviceInfo) override; + void OnDeviceOffline(const DistributedHardware::DmDeviceInfo &deviceInfo) override; + void OnDeviceChanged(const DistributedHardware::DmDeviceInfo &deviceInfo) override; + void OnDeviceReady(const DistributedHardware::DmDeviceInfo &deviceInfo) override; private: IDeviceChange callback_; diff --git a/services/distributed/include/distributed_screen_status_manager.h b/services/distributed/include/distributed_screen_status_manager.h index 7d2c81be6dbf0973678593819fedd56d10a4343e..09351e875c290b3661ddc970f648c60f6b925ce0 100644 --- a/services/distributed/include/distributed_screen_status_manager.h +++ b/services/distributed/include/distributed_screen_status_manager.h @@ -18,6 +18,7 @@ #include +#include "device_manager_callback.h" #include "distributed_kv_data_manager.h" #include "event_handler.h" #include "event_runner.h" @@ -65,6 +66,7 @@ private: std::unique_ptr kvDataManager_ = nullptr; std::shared_ptr kvStore_ = nullptr; std::shared_ptr deviceCb_ = nullptr; + std::shared_ptr initCallback_; bool localScreenOn_ = false; diff --git a/services/distributed/src/distributed_database.cpp b/services/distributed/src/distributed_database.cpp index 8beb201103a6cf102f3ea22e3b9c48feb315e511..24befdb8864f6440a086b7235afa518388dbde51 100644 --- a/services/distributed/src/distributed_database.cpp +++ b/services/distributed/src/distributed_database.cpp @@ -16,6 +16,7 @@ #include "distributed_database.h" #include "ans_log_wrapper.h" +#include "device_manager.h" namespace OHOS { namespace Notification { @@ -38,12 +39,16 @@ DistributedDatabase::~DistributedDatabase() void DistributedDatabase::GetKvDataManager(void) { kvDataManager_ = std::make_unique(); - if (kvDataManager_ != nullptr) { - DistributedKv::Status status = kvDataManager_->StartWatchDeviceChange(deviceCb_); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGW("kvDataManager StartWatchDeviceChange failed ret = 0x%{public}x", status); - kvDataManager_.reset(); - } + + int32_t ret = DistributedHardware::DeviceManager::GetInstance().InitDeviceManager(APP_ID, initCallback_); + if (ret != ERR_OK) { + ANS_LOGE("init device manager failed, ret:%{public}d", ret); + return; + } + ret = DistributedHardware::DeviceManager::GetInstance().RegisterDevStateCallback(APP_ID, "", deviceCb_); + if (ret != ERR_OK) { + ANS_LOGE("register devStateCallback failed, ret:%{public}d", ret); + return; } KvManagerFlowControlClear(); @@ -81,7 +86,7 @@ void DistributedDatabase::GetKvStore(void) if (status != DistributedKv::Status::SUCCESS) { ANS_LOGE("kvDataManager GetSingleKvStore failed ret = 0x%{public}x", status); kvStore_.reset(); - kvDataManager_->StopWatchDeviceChange(deviceCb_); + DistributedHardware::DeviceManager::GetInstance().UnRegisterDevStateCallback(APP_ID); kvDataManager_.reset(); return; } @@ -246,13 +251,12 @@ bool DistributedDatabase::GetLocalDeviceId(std::string &deviceId) } if (KvManagerFlowControl()) { - DistributedKv::DeviceInfo deviceInfo; - DistributedKv::Status status = kvDataManager_->GetLocalDevice(deviceInfo); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetLocalDevice() failed ret = 0x%{public}x", status); + DistributedHardware::DmDeviceInfo deviceInfo; + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetLocalDeviceInfo(APP_ID, deviceInfo); + if (ret != ERR_OK) { + ANS_LOGE("Get trust local device info failed ret = %{public}d", ret); return false; } - localDeviceId_ = deviceInfo.deviceId; } @@ -277,9 +281,9 @@ bool DistributedDatabase::GetLocalDeviceInfo(DeviceInfo &localInfo) return false; } - DistributedKv::Status status = kvDataManager_->GetLocalDevice(localInfo); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetLocalDevice() failed ret = 0x%{public}x", status); + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetLocalDeviceInfo(APP_ID, localInfo); + if (ret != ERR_OK) { + ANS_LOGE("Get trust local device info failed ret = %{public}d", ret); return false; } @@ -298,10 +302,9 @@ bool DistributedDatabase::GetDeviceInfoList(std::vector &deviceList) return false; } - DistributedKv::Status status = - kvDataManager_->GetDeviceList(deviceList, DistributedKv::DeviceFilterStrategy::NO_FILTER); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetDeviceList() failed ret = 0x%{public}x", status); + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetTrustedDeviceList(APP_ID, "", deviceList); + if (ret != ERR_OK) { + ANS_LOGE("Get trust device list failed ret = %{public}d", ret); return false; } diff --git a/services/distributed/src/distributed_device_callback.cpp b/services/distributed/src/distributed_device_callback.cpp index 92a910f0caa0b888b214cada1f83e1c320e8bf57..b762e2b7ad9d1539f8dcb8391e6dd6810aee016f 100644 --- a/services/distributed/src/distributed_device_callback.cpp +++ b/services/distributed/src/distributed_device_callback.cpp @@ -24,26 +24,32 @@ DistributedDeviceCallback::DistributedDeviceCallback(const IDeviceChange &callba DistributedDeviceCallback::~DistributedDeviceCallback() {} -void DistributedDeviceCallback::OnDeviceChanged( - const DistributedKv::DeviceInfo &info, const DistributedKv::DeviceChangeType &type) const +void DistributedDeviceCallback::OnDeviceOnline(const DistributedHardware::DmDeviceInfo &deviceInfo) { - ANS_LOGI("%{public}s start", __FUNCTION__); - if (type == DistributedKv::DeviceChangeType::DEVICE_ONLINE) { - ANS_LOGD("device %{public}s is ONLINE", info.deviceId.c_str()); - if (callback_.OnConnected) { - callback_.OnConnected(info.deviceId); - } + ANS_LOGI("start"); + if (callback_.OnConnected) { + ANS_LOGD("device %{public}s is online", deviceInfo.deviceId); + callback_.OnConnected(deviceInfo.deviceId); } +} - if (type == DistributedKv::DeviceChangeType::DEVICE_OFFLINE) { - if (callback_.OnDisconnected) { - callback_.OnDisconnected(info.deviceId); - } +void DistributedDeviceCallback::OnDeviceOffline(const DistributedHardware::DmDeviceInfo &deviceInfo) +{ + ANS_LOGI("start"); + if (callback_.OnConnected) { + ANS_LOGD("device %{public}s is offline", deviceInfo.deviceId); + callback_.OnDisconnected(deviceInfo.deviceId); } } -DistributedKv::DeviceFilterStrategy DistributedDeviceCallback::GetFilterStrategy() const + +void DistributedDeviceCallback::OnDeviceChanged(const DistributedHardware::DmDeviceInfo &deviceInfo) +{ + ANS_LOGD("device %{public}s is changed", deviceInfo.deviceId); +} + +void DistributedDeviceCallback::OnDeviceReady(const DistributedHardware::DmDeviceInfo &deviceInfo) { - return DistributedKv::DeviceFilterStrategy::NO_FILTER; + ANS_LOGD("device %{public}s is ready", deviceInfo.deviceId); } } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/distributed/src/distributed_screen_status_manager.cpp b/services/distributed/src/distributed_screen_status_manager.cpp index 695348a50dd017046bb555be6ca59e7d432e35d7..da55ccff1e074394ca160b89893af07cadc85824 100644 --- a/services/distributed/src/distributed_screen_status_manager.cpp +++ b/services/distributed/src/distributed_screen_status_manager.cpp @@ -17,6 +17,7 @@ #include "ans_inner_errors.h" #include "ans_log_wrapper.h" +#include "device_manager.h" namespace OHOS { namespace Notification { @@ -57,11 +58,10 @@ void DistributedScreenStatusManager::OnDeviceDisconnected(const std::string &dev return; } - std::vector devInfoList; - DistributedKv::Status status = - kvDataManager_->GetDeviceList(devInfoList, DistributedKv::DeviceFilterStrategy::NO_FILTER); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetDeviceList() failed ret = 0x%{public}x", status); + std::vector devInfoList; + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetTrustedDeviceList(APP_ID, "", devInfoList); + if (ret != ERR_OK) { + ANS_LOGE("Get trust device list failed ret = %{public}d", ret); kvDataManager_.reset(); return; } @@ -86,12 +86,15 @@ void DistributedScreenStatusManager::OnDeviceDisconnected(const std::string &dev void DistributedScreenStatusManager::GetKvDataManager(void) { kvDataManager_ = std::make_unique(); - if (kvDataManager_ != nullptr) { - DistributedKv::Status status = kvDataManager_->StartWatchDeviceChange(deviceCb_); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGW("kvDataManager StartWatchDeviceChange failed ret = 0x%{public}x", status); - kvDataManager_.reset(); - } + int32_t ret = DistributedHardware::DeviceManager::GetInstance().InitDeviceManager(APP_ID, initCallback_); + if (ret != 0) { + ANS_LOGE("init device manager failed, ret:%{public}d", ret); + return; + } + ret = DistributedHardware::DeviceManager::GetInstance().RegisterDevStateCallback(APP_ID, "", deviceCb_); + if (ret != 0) { + ANS_LOGE("register devStateCallback failed, ret:%{public}d", ret); + return; } KvManagerFlowControlClear(); @@ -127,7 +130,7 @@ void DistributedScreenStatusManager::GetKvStore(void) if (status != DistributedKv::Status::SUCCESS) { ANS_LOGE("kvDataManager GetSingleKvStore failed ret = 0x%{public}x", status); kvStore_.reset(); - kvDataManager_->StopWatchDeviceChange(deviceCb_); + DistributedHardware::DeviceManager::GetInstance().UnRegisterDevStateCallback(APP_ID); kvDataManager_.reset(); return; } @@ -164,18 +167,17 @@ ErrCode DistributedScreenStatusManager::CheckRemoteDevicesIsUsing(bool &isUsing) return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; } - std::vector devInfoList; - DistributedKv::Status status = - kvDataManager_->GetDeviceList(devInfoList, DistributedKv::DeviceFilterStrategy::NO_FILTER); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetDeviceList() failed ret = 0x%{public}x", status); + std::vector devInfoList; + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetTrustedDeviceList(APP_ID, "", devInfoList); + if (ret != ERR_OK) { + ANS_LOGE("Get trust device list failed ret = %{public}d", ret); kvDataManager_.reset(); return ERR_ANS_DISTRIBUTED_GET_INFO_FAILED; } DistributedKv::Key prefixKey(""); std::vector entries; - status = kvStore_->GetEntries(prefixKey, entries); + DistributedKv::Status status = kvStore_->GetEntries(prefixKey, entries); if (status != DistributedKv::Status::SUCCESS) { ANS_LOGE("kvStore GetEntries() failed ret = 0x%{public}x", status); kvStore_.reset(); @@ -187,7 +189,7 @@ ErrCode DistributedScreenStatusManager::CheckRemoteDevicesIsUsing(bool &isUsing) std::string deviceId = key.substr(0, key.find_first_of(DELIMITER)); ANS_LOGD("value:%{public}s", entry.value.ToString().c_str()); for (auto devInfo : devInfoList) { - if (devInfo.deviceId == deviceId) { + if (strcmp(devInfo.deviceId, deviceId.c_str()) == 0) { isUsing = isUsing || (entry.value.ToString() == SCREEN_STATUS_VALUE_ON); break; } @@ -215,16 +217,16 @@ ErrCode DistributedScreenStatusManager::SetLocalScreenStatus(bool screenOn) return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; } - DistributedKv::DeviceInfo localDevice; - DistributedKv::Status status = kvDataManager_->GetLocalDevice(localDevice); - if (status != DistributedKv::Status::SUCCESS) { - ANS_LOGE("kvDataManager GetLocalDevice() failed ret = 0x%{public}x", status); + DistributedHardware::DmDeviceInfo localDevice; + int32_t ret = DistributedHardware::DeviceManager::GetInstance().GetLocalDeviceInfo(APP_ID, localDevice); + if (ret != ERR_OK) { + ANS_LOGE("Get trust local device info failed ret = %{public}d", ret); return ERR_ANS_DISTRIBUTED_GET_INFO_FAILED; } DistributedKv::Key kvStoreKey = GenerateDistributedKey(localDevice.deviceId); DistributedKv::Value kvStoreValue = screenOn ? SCREEN_STATUS_VALUE_ON : SCREEN_STATUS_VALUE_OFF; - status = kvStore_->Put(kvStoreKey, kvStoreValue); + DistributedKv::Status status = kvStore_->Put(kvStoreKey, kvStoreValue); if (status != DistributedKv::Status::SUCCESS) { ANS_LOGE("kvStore Put() failed ret = 0x%{public}x", status); return ERR_ANS_DISTRIBUTED_OPERATION_FAILED; diff --git a/services/distributed/test/unittest/BUILD.gn b/services/distributed/test/unittest/BUILD.gn index df46a8bfba8abad3ce43f79816d2a14cea44c007..16407cb8b3128107d241f30cb921bb051c8b7251 100644 --- a/services/distributed/test/unittest/BUILD.gn +++ b/services/distributed/test/unittest/BUILD.gn @@ -47,7 +47,7 @@ ohos_unittest("ans_distributed_unit_test") { "${services_path}/distributed/test/unittest/distributed_screen_status_manager_test.cpp", "${services_path}/distributed/test/unittest/mock/mock_blob.cpp", "${services_path}/distributed/test/unittest/mock/mock_change_notification.cpp", - "${services_path}/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp", + "${services_path}/distributed/test/unittest/mock/mock_device_manager_impl.cpp", "${services_path}/distributed/test/unittest/mock/mock_event_handler.cpp", "${services_path}/distributed/test/unittest/mock/mock_single_kv_store.cpp", ] @@ -69,6 +69,7 @@ ohos_unittest("ans_distributed_unit_test") { "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", + "device_manager:devicemanagersdk", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", "hitrace_native:libhitracechain", diff --git a/services/distributed/test/unittest/distributed_database_test.cpp b/services/distributed/test/unittest/distributed_database_test.cpp index c7fb639989e1782b9c11d873f49c9dd3fc2d4e85..7deb7e37ced9eaa9e8d2076dc394024dee4d8511 100644 --- a/services/distributed/test/unittest/distributed_database_test.cpp +++ b/services/distributed/test/unittest/distributed_database_test.cpp @@ -108,10 +108,10 @@ HWTEST_F(DistributedDatabaseTest, PutToDistributedDB_00100, Function | SmallTest std::move(insertEntries), std::move(updateEntries), std::move(deleteEntries), "", false); databaseCallback_->OnChange(change); - // text OnDeviceChanged function DeviceChangeType is DEVICE_ONLINE and DEVICE_OFFLINE - DistributedKv::DeviceInfo deviceInfo; - deviceCallback_->OnDeviceChanged(deviceInfo, DistributedKv::DeviceChangeType::DEVICE_ONLINE); - deviceCallback_->OnDeviceChanged(deviceInfo, DistributedKv::DeviceChangeType::DEVICE_OFFLINE); + // text OnDeviceOnline态OnDeviceOffline function + DistributedHardware::DmDeviceInfo deviceInfo; + deviceCallback_->OnDeviceOnline(deviceInfo); + deviceCallback_->OnDeviceOffline(deviceInfo); // text PutToDistributedDB function std::string key(""); diff --git a/services/distributed/test/unittest/mock/mock_device_manager_impl.cpp b/services/distributed/test/unittest/mock/mock_device_manager_impl.cpp new file mode 100644 index 0000000000000000000000000000000000000000..57eec8c9862fa9cebaa05d6adfe8897b20348c0c --- /dev/null +++ b/services/distributed/test/unittest/mock/mock_device_manager_impl.cpp @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "device_manager_impl.h" + +namespace OHOS { +namespace DistributedHardware { + +DeviceManagerImpl &DeviceManagerImpl::GetInstance() +{ + static DeviceManagerImpl instance; + return instance; +} + +int32_t DeviceManagerImpl::InitDeviceManager(const std::string &pkgName, std::shared_ptr dmInitCallback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnInitDeviceManager(const std::string &pkgName) +{ + return 0; +} + +int32_t DeviceManagerImpl::GetTrustedDeviceList(const std::string &pkgName, const std::string &extra, + std::vector &deviceList) +{ + DmDeviceInfo localDevice; + memset_s(&localDevice, sizeof(localDevice), 0, sizeof(localDevice)); + strcpy_s(localDevice.deviceId, sizeof(localDevice.deviceId) - 1, ""); + strcpy_s(localDevice.deviceName, sizeof(localDevice.deviceName) - 1, ""); + + DmDeviceInfo remoteDevice; + memset_s(&remoteDevice, sizeof(remoteDevice), 0, sizeof(remoteDevice)); + strcpy_s(remoteDevice.deviceId, sizeof(remoteDevice.deviceId) - 1, ""); + strcpy_s(remoteDevice.deviceName, sizeof(remoteDevice.deviceName) - 1, ""); + + deviceList.clear(); + deviceList.push_back(localDevice); + deviceList.push_back(remoteDevice); + return 0; +} + +int32_t DeviceManagerImpl::GetLocalDeviceInfo(const std::string &pkgName, DmDeviceInfo &info) +{ + memset_s(&info, sizeof(info), 0, sizeof(info)); + strcpy_s(info.deviceId, sizeof(info.deviceId) - 1, ""); + strcpy_s(info.deviceName, sizeof(info.deviceName) - 1, ""); + info.deviceTypeId = 0; + return 0; +} + +int32_t DeviceManagerImpl::RegisterDevStateCallback(const std::string &pkgName, const std::string &extra, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnRegisterDevStateCallback(const std::string &pkgName) +{ + return 0; +} + +int32_t DeviceManagerImpl::StartDeviceDiscovery(const std::string &pkgName, const DmSubscribeInfo &subscribeInfo, + const std::string &extra, std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::StopDeviceDiscovery(const std::string &pkgName, uint16_t subscribeId) +{ + return 0; +} + +int32_t DeviceManagerImpl::PublishDeviceDiscovery(const std::string &pkgName, const DmPublishInfo &publishInfo, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnPublishDeviceDiscovery(const std::string &pkgName, int32_t publishId) +{ + return 0; +} + +int32_t DeviceManagerImpl::AuthenticateDevice(const std::string &pkgName, int32_t authType, + const DmDeviceInfo &deviceInfo, const std::string &extra, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnAuthenticateDevice(const std::string &pkgName, const DmDeviceInfo &deviceInfo) +{ + return 0; +} + +int32_t DeviceManagerImpl::RegisterDeviceManagerFaCallback(const std::string &pkgName, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnRegisterDeviceManagerFaCallback(const std::string &pkgName) +{ + return 0; +} + +int32_t DeviceManagerImpl::VerifyAuthentication(const std::string &pkgName, const std::string &authPara, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::GetFaParam(const std::string &pkgName, DmAuthParam &dmFaParam) +{ + return 0; +} + +int32_t DeviceManagerImpl::SetUserOperation(const std::string &pkgName, int32_t action, const std::string ¶ms) +{ + return 0; +} + +int32_t DeviceManagerImpl::GetUdidByNetworkId(const std::string &pkgName, const std::string &netWorkId, + std::string &udid) +{ + return 0; +} + +int32_t DeviceManagerImpl::GetUuidByNetworkId(const std::string &pkgName, const std::string &netWorkId, + std::string &uuid) +{ + return 0; +} + +int32_t DeviceManagerImpl::RegisterDevStateCallback(const std::string &pkgName, const std::string &extra) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnRegisterDevStateCallback(const std::string &pkgName, const std::string &extra) +{ + return 0; +} + +int32_t DeviceManagerImpl::RequestCredential(const std::string &pkgName, const std::string &reqJsonStr, + std::string &returnJsonStr) +{ + return 0; +} + +int32_t DeviceManagerImpl::ImportCredential(const std::string &pkgName, const std::string &credentialInfo) +{ + return 0; +} + +int32_t DeviceManagerImpl::DeleteCredential(const std::string &pkgName, const std::string &deleteInfo) +{ + return 0; +} + +int32_t DeviceManagerImpl::RegisterCredentialCallback(const std::string &pkgName, + std::shared_ptr callback) +{ + return 0; +} + +int32_t DeviceManagerImpl::UnRegisterCredentialCallback(const std::string &pkgName) +{ + return 0; +} + +int32_t DeviceManagerImpl::NotifyEvent(const std::string &pkgName, const int32_t eventId, const std::string &event) +{ + return 0; +} + +int32_t DeviceManagerImpl::OnDmServiceDied() +{ + return 0; +} +} // namespace DistributedHardware +} // namespace OHOS