From 577f51d2b7ed6bf6de6dfaaac345f83502a6b6ad Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Fri, 18 Nov 2022 21:51:55 +0800 Subject: [PATCH] replace distributed interface Signed-off-by: fangJinliang1 Change-Id: Ib3dcad2bca8226a718fb880e282d258539119a34 --- services/ans/BUILD.gn | 1 + .../ans/src/advanced_notification_service.cpp | 4 +- services/ans/test/unittest/BUILD.gn | 1 + services/distributed/BUILD.gn | 1 + .../include/distributed_database.h | 4 +- .../include/distributed_device_callback.h | 12 +- .../distributed_screen_status_manager.h | 2 + .../distributed/src/distributed_database.cpp | 41 ++-- .../src/distributed_device_callback.cpp | 34 +-- .../src/distributed_screen_status_manager.cpp | 50 ++--- services/distributed/test/unittest/BUILD.gn | 3 +- .../unittest/distributed_database_test.cpp | 8 +- .../mock/mock_device_manager_impl.cpp | 196 ++++++++++++++++++ 13 files changed, 287 insertions(+), 70 deletions(-) create mode 100644 services/distributed/test/unittest/mock/mock_device_manager_impl.cpp diff --git a/services/ans/BUILD.gn b/services/ans/BUILD.gn index c76765868..6c6e27460 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 aef1db173..d31c04410 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 0646309d2..d47f82a21 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 3af9f2399..c9a79c6a5 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 dca37c7b1..ba46d5f62 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 cdb837e45..aaad14a23 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 7d2c81be6..09351e875 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 8beb20110..24befdb88 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 92a910f0c..b762e2b7a 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 695348a50..da55ccff1 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 df46a8bfb..16407cb8b 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 c7fb63998..7deb7e37c 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 000000000..57eec8c98 --- /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 -- Gitee