diff --git a/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js b/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js index 9d36936ef8483d37882b3a98ff7026a41025aeb6..82d40b46a5137f7e0ce9d4651b0248937b5b4d44 100644 --- a/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js +++ b/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js @@ -17,7 +17,7 @@ export default { var input= this.$element('input').value; console.info('click confirm end'); console.info('input: ' + input); - callNativeHandler(input, "0"); + callNativeHandler("EVENT_INPUT", "0"); }, onCancel() { console.info('click cancel'); diff --git a/ext/profile/src/profile_connector.cpp b/ext/profile/src/profile_connector.cpp index 4a709238e404ab155ff1e7d537371a2366b1fa5e..13078a3cda62618b0f814451997588f19d727fe5 100644 --- a/ext/profile/src/profile_connector.cpp +++ b/ext/profile/src/profile_connector.cpp @@ -15,11 +15,14 @@ #include "profile_connector.h" +#include + #include "dm_constants.h" #include "dm_log.h" namespace OHOS { namespace DistributedHardware { +static std::mutex callbackMutex_; std::map> ProfileEventCallback::profileConnectorCallback_ = {}; std::shared_ptr ProfileConnector::profileEventCallback_ = std::make_shared(); @@ -75,6 +78,7 @@ int32_t ProfileEventCallback::RegisterProfileCallback(const std::string &pkgName std::shared_ptr callback) { LOGI("ProfileEventCallback::RegisterProfileCallback"); + std::lock_guard locker(callbackMutex_); profileConnectorCallback_.emplace(pkgName, callback); return DM_OK; } @@ -82,6 +86,7 @@ int32_t ProfileEventCallback::RegisterProfileCallback(const std::string &pkgName int32_t ProfileEventCallback::UnRegisterProfileCallback(const std::string &pkgName) { LOGI("ProfileEventCallback::UnRegisterProfileCallback"); + std::lock_guard locker(callbackMutex_); profileConnectorCallback_.erase(pkgName); return DM_OK; } @@ -95,6 +100,7 @@ void ProfileEventCallback::OnSyncCompleted(const SyncResult &syncResults) SyncStatus = iterResult.second; } LOGI("ProfileEventCallback::OnSyncCompleted, deviceId = %s", deviceId.c_str()); + std::lock_guard locker(callbackMutex_); for (auto &iter : profileConnectorCallback_) { iter.second->OnProfileComplete(iter.first, deviceId); } diff --git a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp index 6bc37f975d2210bcb424465ee10d747b8acf10fd..21fca1e946c3005451b649861dfeb4a566ab2cce 100644 --- a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp +++ b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp @@ -325,6 +325,7 @@ void DmAuthManager::OnGroupCreated(int64_t requestId, const std::string &groupId softbusConnector_->GetSoftbusSession()->SendData(authResponseContext_->sessionId, message); return; } + authResponseContext_->code = GeneratePincode(); authResponseContext_->groupId = groupId; authMessageProcessor_->SetResponseContext(authResponseContext_); std::string message = authMessageProcessor_->CreateSimpleMessage(MSG_TYPE_RESP_AUTH); @@ -680,7 +681,6 @@ void DmAuthManager::ShowConfigDialog() void DmAuthManager::ShowAuthInfoDialog() { LOGI("DmAuthManager::ShowAuthInfoDialog start"); - authResponseContext_->code = GeneratePincode(); std::shared_ptr ptr; if (authenticationMap_.find(1) == authenticationMap_.end()) { LOGE("DmAuthManager::authenticationMap_ is null"); diff --git a/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp b/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp index ab7b0d162d404beea13aaf17cb4f78039144950d..fc6fed38b42b22e0d114599824be46f0a3561919 100644 --- a/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp +++ b/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp @@ -196,6 +196,7 @@ int32_t HiChainConnector::AddMember(std::string deviceId, std::string &connectIn std::string tmpStr = jsonObj.dump(); int64_t requestId = jsonObject[TAG_REQUEST_ID]; int32_t ret = deviceGroupManager_->addMemberToGroup(requestId, DM_PKG_NAME.c_str(), tmpStr.c_str()); + LOGI("HiChainConnector::tmpStr:%s", tmpStr.c_str()); LOGI("HiChainConnector::AddMember completed"); return ret; } diff --git a/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp b/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp index 5cf62a06223dbc9accae992ce4c86c808c23287e..b5288ccb0f4516c927880d7fa1f25525344e3a8b 100644 --- a/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp +++ b/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp @@ -55,7 +55,6 @@ void DmDeviceStateManager::OnDeviceOnline(const std::string &pkgName, const DmDe remoteDeviceInfos_[uuid] = saveInfo; LOGI("RegisterProfileListener in, deviceId = %s, deviceUdid = %s, uuid = %s", info.deviceId, deviceUdid.c_str(), uuid.c_str()); - profileAdapter->RegisterProfileListener(pkgName, deviceUdid, shared_from_this()); LOGI("RegisterProfileListener out"); } } @@ -72,7 +71,6 @@ void DmDeviceStateManager::OnDeviceOffline(const std::string &pkgName, const DmD if (profileAdapter == nullptr) { LOGE("OnDeviceOffline profile adapter is null"); } else { - profileAdapter->UnRegisterProfileListener(pkgName); std::string uuid; SoftbusConnector::GetUuidByNetworkId(info.deviceId, uuid); auto iter = remoteDeviceInfos_.find(std::string(info.deviceId));