From ee17f16df4b4246cc5cac5e405cd9a9f793ed3eb Mon Sep 17 00:00:00 2001 From: BrainL Date: Mon, 12 May 2025 10:13:05 +0800 Subject: [PATCH 1/2] add Signed-off-by: BrainL --- commondependency/src/deviceprofile_connector.cpp | 8 ++++---- interfaces/inner_kits/native_cpp/include/dm_device_info.h | 4 ++++ .../implementation/src/device_manager_service_impl.cpp | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 111b38c12..67c2797a8 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -676,10 +676,10 @@ std::unordered_map DeviceProfileConnector::GetAuthFormM deviceIdMap[trustDeviceId] = DmAuthForm::IDENTICAL_ACCOUNT; continue; } else if (highestBindType == SHARE_TYPE) { - if (CheckSinkShareType(item, userId, deviceId, trustDeviceId, DmAuthForm::ACROSS_ACCOUNT)) { + if (CheckSinkShareType(item, userId, deviceId, trustDeviceId, DmAuthForm::SHARE)) { continue; } - deviceIdMap[trustDeviceId] = DmAuthForm::ACROSS_ACCOUNT; + deviceIdMap[trustDeviceId] = DmAuthForm::SHARE; continue; } else if (highestBindType == DEVICE_PEER_TO_PEER_TYPE || highestBindType == APP_PEER_TO_PEER_TYPE || highestBindType == SERVICE_PEER_TO_PEER_TYPE) { @@ -703,7 +703,7 @@ bool DeviceProfileConnector::CheckSinkShareType(const DistributedDeviceProfile:: if (profile.GetAccessee().GetAccesseeUserId() == userId && profile.GetAccessee().GetAccesseeDeviceId() == deviceId && profile.GetAccesser().GetAccesserDeviceId() == trustDeviceId && - bindType == DmAuthForm::ACROSS_ACCOUNT) { + bindType == DmAuthForm::SHARE) { return true; } return false; @@ -789,7 +789,7 @@ int32_t DeviceProfileConnector::HandleDmAuthForm(AccessControlProfile profiles, return CheckAuthForm(DmAuthForm::PEER_TO_PEER, profiles, discoveryInfo); } if (profiles.GetBindType() == DM_SHARE) { - return CheckAuthForm(DmAuthForm::ACROSS_ACCOUNT, profiles, discoveryInfo); + return CheckAuthForm(DmAuthForm::SHARE, profiles, discoveryInfo); } return DmAuthForm::INVALID_TYPE; } diff --git a/interfaces/inner_kits/native_cpp/include/dm_device_info.h b/interfaces/inner_kits/native_cpp/include/dm_device_info.h index f4d1ea3d6..a9d610c33 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_device_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_device_info.h @@ -149,6 +149,10 @@ typedef enum DmAuthForm { * Across Account Device auth. */ ACROSS_ACCOUNT = 2, + /** + * Share + */ + SHARE = 3; } DmAuthForm; /** diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp index 844e3e3d1..11f5a8a69 100644 --- a/services/implementation/src/device_manager_service_impl.cpp +++ b/services/implementation/src/device_manager_service_impl.cpp @@ -640,7 +640,7 @@ void DeviceManagerServiceImpl::HandleOffline(DmDeviceState devState, DmDeviceInf softbusConnector_->SetProcessInfo(processInfo); } else if (static_cast(item.second) == USER && bindType == SHARE_TYPE) { LOGI("The offline device is device bind level and share bind type."); - devInfo.authForm = DmAuthForm::ACROSS_ACCOUNT; + devInfo.authForm = DmAuthForm::SHARE; processInfo.userId = item.first; softbusConnector_->SetProcessInfo(processInfo); } else if (static_cast(item.second) == USER && bindType != SHARE_TYPE) { @@ -713,7 +713,7 @@ void DeviceManagerServiceImpl::SetOnlineProcessInfo(const uint32_t &bindType, Pr LOGI("ProcessDeviceStateChange authForm is share, peer is src."); return; } - devInfo.authForm = DmAuthForm::ACROSS_ACCOUNT; + devInfo.authForm = DmAuthForm::SHARE; softbusConnector_->SetProcessInfo(processInfo); } LOGI("DeviceManagerServiceImpl::HandleOnline success devInfo authForm is %{public}d.", devInfo.authForm); -- Gitee From 23de79708672f6689f08b4492ad9c4106581ceeb Mon Sep 17 00:00:00 2001 From: BrainL Date: Mon, 12 May 2025 11:18:54 +0800 Subject: [PATCH 2/2] modify Signed-off-by: BrainL --- interfaces/inner_kits/native_cpp/include/dm_device_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/inner_kits/native_cpp/include/dm_device_info.h b/interfaces/inner_kits/native_cpp/include/dm_device_info.h index a9d610c33..8db197757 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_device_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_device_info.h @@ -152,7 +152,7 @@ typedef enum DmAuthForm { /** * Share */ - SHARE = 3; + SHARE = 3, } DmAuthForm; /** -- Gitee