From 66a484ec9649bdb73f3f17d70b94d9fc638047c9 Mon Sep 17 00:00:00 2001 From: q30043944 Date: Wed, 10 Sep 2025 14:30:44 +0800 Subject: [PATCH] =?UTF-8?q?bindtype=20=E6=98=A0=E5=B0=84=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: q30043944 --- .../src/deviceprofile_connector.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/commondependency/src/deviceprofile_connector.cpp b/commondependency/src/deviceprofile_connector.cpp index 49ec04f9f..a1610f2ef 100644 --- a/commondependency/src/deviceprofile_connector.cpp +++ b/commondependency/src/deviceprofile_connector.cpp @@ -63,6 +63,11 @@ constexpr uint32_t AUTH_EXT_WHITE_LIST_NUM = 1; constexpr const static char* g_extWhiteList[AUTH_EXT_WHITE_LIST_NUM] = { "CastEngineService", }; +enum DmDevBindType : int32_t { + DEVICE_PEER_TO_PEER_BIND_TYPE = 3, + DEVICE_ACROSS_ACCOUNT_BIND_TYPE = 4, + IDENTICAL_ACCOUNT_BIND_TYPE = 5 +}; } DM_IMPLEMENT_SINGLE_INSTANCE(DeviceProfileConnector); void PrintProfile(const AccessControlProfile &profile) @@ -964,11 +969,11 @@ void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profile, s uint32_t bindType = profile.GetBindType(); switch (bindType) { case DM_IDENTICAL_ACCOUNT: - bindTypeVec.push_back(IDENTICAL_ACCOUNT_TYPE); + bindTypeVec.push_back(DmDevBindType::IDENTICAL_ACCOUNT_BIND_TYPE); break; case DM_POINT_TO_POINT: if (profile.GetBindLevel() == USER) { - bindTypeVec.push_back(DEVICE_PEER_TO_PEER_TYPE); + bindTypeVec.push_back(DmDevBindType::DEVICE_PEER_TO_PEER_BIND_TYPE); } if (profile.GetBindLevel() == APP) { bindTypeVec.push_back(APP_PEER_TO_PEER_TYPE); @@ -976,7 +981,7 @@ void DeviceProfileConnector::GetParamBindTypeVec(AccessControlProfile profile, s break; case DM_ACROSS_ACCOUNT: if (profile.GetBindLevel() == USER) { - bindTypeVec.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); + bindTypeVec.push_back(DmDevBindType::DEVICE_ACROSS_ACCOUNT_BIND_TYPE); } if (profile.GetBindLevel() == APP) { bindTypeVec.push_back(APP_ACROSS_ACCOUNT_TYPE); @@ -1010,12 +1015,12 @@ void DeviceProfileConnector::ProcessBindType(AccessControlProfile profiles, std: std::vector &sinkBindType, std::vector &bindTypeIndex, uint32_t index, std::string targetDeviceId) { if (profiles.GetBindType() == DM_IDENTICAL_ACCOUNT) { - sinkBindType.push_back(IDENTICAL_ACCOUNT_TYPE); + sinkBindType.push_back(DmDevBindType::IDENTICAL_ACCOUNT_BIND_TYPE); bindTypeIndex.push_back(index); } if (profiles.GetBindType() == DM_POINT_TO_POINT) { if (profiles.GetBindLevel() == USER) { - sinkBindType.push_back(DEVICE_PEER_TO_PEER_TYPE); + sinkBindType.push_back(DmDevBindType::DEVICE_PEER_TO_PEER_BIND_TYPE); bindTypeIndex.push_back(index); } if (profiles.GetBindLevel() == APP) { @@ -1033,7 +1038,7 @@ void DeviceProfileConnector::ProcessBindType(AccessControlProfile profiles, std: } if (profiles.GetBindType() == DM_ACROSS_ACCOUNT) { if (profiles.GetBindLevel() == USER) { - sinkBindType.push_back(DEVICE_ACROSS_ACCOUNT_TYPE); + sinkBindType.push_back(DmDevBindType::DEVICE_ACROSS_ACCOUNT_BIND_TYPE); bindTypeIndex.push_back(index); } if (profiles.GetBindLevel() == APP) { -- Gitee