diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 111b38c1243c23de640e54327a3d9d196eb7b2bd..67c2797a80c980947b4c164a01fb43efd90fa701 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 f4d1ea3d6dbc5a8b7b104d186cc23a0406bf9920..8db1977579e0ac4cd65cef75cc3fb54f2cd48da2 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 844e3e3d1853ba78a1ece0766a711681cc88036c..11f5a8a69c68662b630cee32ccf1b1db060d7469 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);