From 7017eaea1ac76918a0b14a8f1f9b451b7d208dd8 Mon Sep 17 00:00:00 2001 From: wangzhaohao Date: Fri, 7 Mar 2025 17:44:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BA=91=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangzhaohao --- .../distributed_device_profile_constants.h | 3 +- common/include/interfaces/device_icon_info.h | 4 + .../device_icon_info_filter_options.h | 5 +- common/include/interfaces/device_profile.h | 12 ++- .../utils/content_sensor_manager_utils.h | 10 ++ .../distributed_device_profile_constants.cpp | 2 +- common/src/interfaces/device_icon_info.cpp | 17 +++- .../device_icon_info_filter_options.cpp | 13 +++ common/src/interfaces/device_profile.cpp | 31 ++++-- .../utils/content_sensor_manager_utils.cpp | 98 +++++++++++++++++++ .../include/common/dp_services_constants.h | 3 + .../system_info_collector.h | 2 + .../rdbadapter/profile_data_rdb_adapter.h | 2 + .../core/src/common/dp_services_constants.cpp | 11 ++- .../content_sensor_manager.cpp | 2 +- .../system_info_collector.cpp | 16 ++- .../multiusermanager/multi_user_manager.cpp | 3 +- .../rdbadapter/profile_data_rdb_adapter.cpp | 27 ++++- .../device_icon_info_dao.cpp | 9 ++ .../profiledatamanager/device_profile_dao.cpp | 10 +- .../profile_data_manager.cpp | 33 +++++-- 21 files changed, 275 insertions(+), 38 deletions(-) diff --git a/common/include/constants/distributed_device_profile_constants.h b/common/include/constants/distributed_device_profile_constants.h index 6c219ebb..593b7415 100644 --- a/common/include/constants/distributed_device_profile_constants.h +++ b/common/include/constants/distributed_device_profile_constants.h @@ -49,6 +49,7 @@ extern const std::string DEV_TYPE; extern const std::string MANU; extern const std::string SN; extern const std::string PRODUCT_ID; +extern const std::string PRODUCT_NAME; extern const std::string SUB_PRODUCT_ID; extern const std::string HIV; extern const std::string MAC; @@ -67,7 +68,7 @@ extern const std::string REGISTER_TIME; extern const std::string MODIFY_TIME; extern const std::string SHARE_TIME; extern const std::string PRODUCTOR_INFO_VERSION; -extern const std::string INNER_MODEL; +extern const std::string INTERNAL_MODEL; extern const std::string DEVICE_PROFILE_TABLE; extern const std::string DEVICE_ICON_INFO_TABLE; extern const std::string PRODUCT_INFO_TABLE; diff --git a/common/include/interfaces/device_icon_info.h b/common/include/interfaces/device_icon_info.h index 2f8f3bd6..302f67d6 100644 --- a/common/include/interfaces/device_icon_info.h +++ b/common/include/interfaces/device_icon_info.h @@ -28,6 +28,7 @@ public: DeviceIconInfo() : id_(0), productId_(""), + internalModel_(""), subProductId_(""), imageType_(""), specName_("") @@ -39,6 +40,8 @@ public: void SetProductId(const std::string& productId); std::string GetSubProductId() const; void SetSubProductId(const std::string& subProductId); + std::string GetInternalModel() const; + void SetInternalModel(const std::string& internalModel); std::string GetImageType() const; void SetImageType(const std::string& imageType); std::string GetSpecName() const; @@ -59,6 +62,7 @@ public: private: int32_t id_; std::string productId_; + std::string internalModel_; std::string subProductId_; std::string imageType_; std::string specName_; diff --git a/common/include/interfaces/device_icon_info_filter_options.h b/common/include/interfaces/device_icon_info_filter_options.h index ae56034b..7f5be396 100644 --- a/common/include/interfaces/device_icon_info_filter_options.h +++ b/common/include/interfaces/device_icon_info_filter_options.h @@ -25,12 +25,14 @@ namespace OHOS { namespace DistributedDeviceProfile { class DeviceIconInfoFilterOptions : public DpParcel { public: - DeviceIconInfoFilterOptions() : subProductId_(""), imageType_(""), specName_("") + DeviceIconInfoFilterOptions() : internalModel_(""), subProductId_(""), imageType_(""), specName_("") {} ~DeviceIconInfoFilterOptions() = default; std::vector GetProductIds() const; void SetProductIds(const std::vector& productIds); + std::string GetInternalModel() const; + void SetInternalModel(const std::string& internalModel); std::string GetSubProductId() const; void SetSubProductId(const std::string& subProductId); std::string GetImageType() const; @@ -44,6 +46,7 @@ public: private: std::vector productIds_; + std::string internalModel_; std::string subProductId_; std::string imageType_; std::string specName_; diff --git a/common/include/interfaces/device_profile.h b/common/include/interfaces/device_profile.h index bc67b567..7072a39d 100644 --- a/common/include/interfaces/device_profile.h +++ b/common/include/interfaces/device_profile.h @@ -42,6 +42,7 @@ public: manu_(""), sn_(""), productId_(""), + productName_(""), subProductId_(""), hiv_(""), mac_(""), @@ -59,7 +60,7 @@ public: brMac_(""), sleMac_(""), setupType_(0), - innerModel_("") + internalModel_("") {} ~DeviceProfile() = default; @@ -95,6 +96,8 @@ public: void SetSn(const std::string& sn); std::string GetProductId() const; void SetProductId(const std::string& productId); + std::string GetProductName() const; + void SetProductName(const std::string& productName); std::string GetSubProductId() const; void SetSubProductId(const std::string& subProductId); std::string GetHiv() const; @@ -121,8 +124,8 @@ public: void SetShareTime(const std::string& shareTime); std::string GetAccountId() const; void SetAccountId(const std::string& accountId); - std::string GetInnerModel() const; - void SetInnerModel(const std::string& innerModel); + std::string GetInternalModel() const; + void SetInternalModel(const std::string& internalModel); bool Marshalling(MessageParcel& parcel) const override; bool UnMarshalling(MessageParcel& parcel) override; bool operator!=(const DeviceProfile& deviceProfile) const; @@ -153,6 +156,7 @@ private: std::string manu_; std::string sn_; std::string productId_; + std::string productName_ = ""; std::string subProductId_; std::string hiv_; std::string mac_; @@ -170,7 +174,7 @@ private: std::string brMac_; std::string sleMac_; int32_t setupType_; - std::string innerModel_; + std::string internalModel_; }; } // namespace DistributedDeviceProfile } // namespace OHOS diff --git a/common/include/utils/content_sensor_manager_utils.h b/common/include/utils/content_sensor_manager_utils.h index dcbbc159..070d9d9e 100644 --- a/common/include/utils/content_sensor_manager_utils.h +++ b/common/include/utils/content_sensor_manager_utils.h @@ -17,6 +17,7 @@ #define OHOS_DP_CONTENT_SENSOR_MANAGER_UTILS_H #include +#include #include #include #include "single_instance.h" @@ -38,8 +39,14 @@ public: std::string ObtainProductId(); void ObtainDeviceDataSyncMode(); bool IsDeviceE2ESync(); + int32_t GetProtType(); + std::string GetSubProductId(); private: + bool IsWifiOnly(); + std::string GetBackcolor(); + std::map GetSubProdIdMap(); + std::string deviceModel_ = ""; std::string deviceType_ = ""; std::string manufacture_ = ""; @@ -51,6 +58,9 @@ private: std::string productId_ = ""; std::string deviceTypeId_ = ""; std::atomic isDeviceE2ESync_ {false}; + int32_t protType_ = 0; + std::string backcolor_ = ""; + std::map subProdIdMap_ = {}; std::mutex csMutex_; }; } diff --git a/common/src/constants/distributed_device_profile_constants.cpp b/common/src/constants/distributed_device_profile_constants.cpp index 380f7eaa..f78f4237 100644 --- a/common/src/constants/distributed_device_profile_constants.cpp +++ b/common/src/constants/distributed_device_profile_constants.cpp @@ -57,7 +57,7 @@ const std::string REGISTER_TIME = "registerTime"; const std::string MODIFY_TIME = "modifyTime"; const std::string SHARE_TIME = "shareTime"; const std::string PRODUCTOR_INFO_VERSION = "productorInfoVersion"; -const std::string INNER_MODEL = "innerModel"; +const std::string INTERNAL_MODEL = "internalModel"; const std::string DEVICE_PROFILE_TABLE = "device_profile"; const std::string DEVICE_ICON_INFO_TABLE = "device_icon_info"; const std::string PRODUCT_INFO_TABLE = "product_info"; diff --git a/common/src/interfaces/device_icon_info.cpp b/common/src/interfaces/device_icon_info.cpp index 5560395a..75bfeb11 100644 --- a/common/src/interfaces/device_icon_info.cpp +++ b/common/src/interfaces/device_icon_info.cpp @@ -48,6 +48,16 @@ void DeviceIconInfo::SetProductId(const std::string& productId) this->productId_ = productId; } +std::string DeviceIconInfo::GetInternalModel() const +{ + return internalModel_; +} + +void DeviceIconInfo::SetInternalModel(const std::string& internalModel) +{ + internalModel_ = internalModel; +} + std::string DeviceIconInfo::GetSubProductId() const { return subProductId_; @@ -121,6 +131,7 @@ void DeviceIconInfo::SetIcon(const std::vector& icon) bool DeviceIconInfo::Marshalling(MessageParcel& parcel) const { WRITE_HELPER_RET(parcel, String, productId_, false); + WRITE_HELPER_RET(parcel, String, internalModel_, false); WRITE_HELPER_RET(parcel, String, subProductId_, false); WRITE_HELPER_RET(parcel, String, imageType_, false); WRITE_HELPER_RET(parcel, String, specName_, false); @@ -134,6 +145,7 @@ bool DeviceIconInfo::Marshalling(MessageParcel& parcel) const bool DeviceIconInfo::UnMarshalling(MessageParcel& parcel) { READ_HELPER_RET(parcel, String, productId_, false); + READ_HELPER_RET(parcel, String, internalModel_, false); READ_HELPER_RET(parcel, String, subProductId_, false); READ_HELPER_RET(parcel, String, imageType_, false); READ_HELPER_RET(parcel, String, specName_, false); @@ -147,6 +159,7 @@ bool DeviceIconInfo::UnMarshalling(MessageParcel& parcel) bool DeviceIconInfo::operator!=(const DeviceIconInfo& other) const { bool isNotEqual = (id_ != other.GetId() || productId_ != other.GetProductId() || + internalModel_ != other.GetInternalModel() || subProductId_ != other.GetSubProductId() || imageType_ != other.GetImageType() || specName_ != other.GetSpecName() || version_ != other.GetVersion() || wiseVersion_ != other.GetWiseVersion() || url_ != other.GetUrl() || icon_ != other.GetIcon()); @@ -165,6 +178,7 @@ std::string DeviceIconInfo::dump() const } cJSON_AddNumberToObject(json, ID.c_str(), id_); cJSON_AddStringToObject(json, PRODUCT_ID.c_str(), productId_.c_str()); + cJSON_AddStringToObject(json, INTERNAL_MODEL.c_str(), internalModel_.c_str()); cJSON_AddStringToObject(json, SUB_PRODUCT_ID.c_str(), subProductId_.c_str()); cJSON_AddStringToObject(json, IMAGE_TYPE.c_str(), imageType_.c_str()); cJSON_AddStringToObject(json, SPEC_NAME.c_str(), specName_.c_str()); @@ -174,13 +188,12 @@ std::string DeviceIconInfo::dump() const cJSON_AddStringToObject(json, DEVICE_ICON_URL.c_str(), url_.c_str()); cJSON_AddNumberToObject(json, DEVICE_ICON_SIZE.c_str(), icon_.size()); char* jsonChars = cJSON_PrintUnformatted(json); + cJSON_Delete(json); if (jsonChars == NULL) { - cJSON_Delete(json); HILOGE("cJSON formatted to string failed!"); return EMPTY_STRING; } std::string jsonStr = jsonChars; - cJSON_Delete(json); cJSON_free(jsonChars); return jsonStr; } diff --git a/common/src/interfaces/device_icon_info_filter_options.cpp b/common/src/interfaces/device_icon_info_filter_options.cpp index 2fbcf1a8..2426a342 100644 --- a/common/src/interfaces/device_icon_info_filter_options.cpp +++ b/common/src/interfaces/device_icon_info_filter_options.cpp @@ -38,6 +38,16 @@ void DeviceIconInfoFilterOptions::SetProductIds(const std::vector& productIds_ = productIds; } +std::string DeviceIconInfoFilterOptions::GetInternalModel() const +{ + return internalModel_; +} + +void DeviceIconInfoFilterOptions::SetInternalModel(const std::string& internalModel) +{ + internalModel_ = internalModel; +} + std::string DeviceIconInfoFilterOptions::GetSubProductId() const { return subProductId_; @@ -71,6 +81,7 @@ void DeviceIconInfoFilterOptions::SetSpecName(const std::string& specName) bool DeviceIconInfoFilterOptions::Marshalling(MessageParcel& parcel) const { IpcUtils::Marshalling(parcel, productIds_); + WRITE_HELPER_RET(parcel, String, internalModel_, false); WRITE_HELPER_RET(parcel, String, subProductId_, false); WRITE_HELPER_RET(parcel, String, imageType_, false); WRITE_HELPER_RET(parcel, String, specName_, false); @@ -80,6 +91,7 @@ bool DeviceIconInfoFilterOptions::Marshalling(MessageParcel& parcel) const bool DeviceIconInfoFilterOptions::UnMarshalling(MessageParcel& parcel) { IpcUtils::UnMarshalling(parcel, productIds_); + READ_HELPER_RET(parcel, String, internalModel_, false); READ_HELPER_RET(parcel, String, subProductId_, false); READ_HELPER_RET(parcel, String, imageType_, false); READ_HELPER_RET(parcel, String, specName_, false); @@ -115,6 +127,7 @@ std::string DeviceIconInfoFilterOptions::dump() const cJSON_Delete(prodIdsJson); HILOGW("Add json array to Object failed!"); } + cJSON_AddStringToObject(json, INTERNAL_MODEL.c_str(), internalModel_.c_str()); cJSON_AddStringToObject(json, SUB_PRODUCT_ID.c_str(), subProductId_.c_str()); cJSON_AddStringToObject(json, IMAGE_TYPE.c_str(), imageType_.c_str()); cJSON_AddStringToObject(json, SPEC_NAME.c_str(), specName_.c_str()); diff --git a/common/src/interfaces/device_profile.cpp b/common/src/interfaces/device_profile.cpp index 319a9516..c2d49df6 100644 --- a/common/src/interfaces/device_profile.cpp +++ b/common/src/interfaces/device_profile.cpp @@ -184,6 +184,16 @@ void DeviceProfile::SetProductId(const std::string& productId) productId_ = productId; } +std::string DeviceProfile::GetProductName() const +{ + return productName_; +} + +void DeviceProfile::SetProductName(const std::string& productName) +{ + productName_ = productName; +} + std::string DeviceProfile::GetSubProductId() const { return subProductId_; @@ -354,14 +364,14 @@ void DeviceProfile::SetSetupType(int32_t setupType) setupType_ = setupType; } -std::string DeviceProfile::GetInnerModel() const +std::string DeviceProfile::GetInternalModel() const { - return innerModel_; + return internalModel_; } -void DeviceProfile::SetInnerModel(const std::string& innerModel) +void DeviceProfile::SetInternalModel(const std::string& internalModel) { - innerModel_ = innerModel; + internalModel_ = internalModel; } bool DeviceProfile::Marshalling(MessageParcel& parcel) const @@ -381,6 +391,7 @@ bool DeviceProfile::Marshalling(MessageParcel& parcel) const WRITE_HELPER_RET(parcel, String, manu_, false); WRITE_HELPER_RET(parcel, String, sn_, false); WRITE_HELPER_RET(parcel, String, productId_, false); + WRITE_HELPER_RET(parcel, String, productName_, false); WRITE_HELPER_RET(parcel, String, subProductId_, false); WRITE_HELPER_RET(parcel, String, hiv_, false); WRITE_HELPER_RET(parcel, String, mac_, false); @@ -394,7 +405,7 @@ bool DeviceProfile::Marshalling(MessageParcel& parcel) const WRITE_HELPER_RET(parcel, String, modifyTime_, false); WRITE_HELPER_RET(parcel, String, shareTime_, false); WRITE_HELPER_RET(parcel, String, accountId_, false); - WRITE_HELPER_RET(parcel, String, innerModel_, false); + WRITE_HELPER_RET(parcel, String, internalModel_, false); WRITE_HELPER_RET(parcel, String, bleMac_, false); WRITE_HELPER_RET(parcel, String, brMac_, false); WRITE_HELPER_RET(parcel, String, sleMac_, false); @@ -419,6 +430,7 @@ bool DeviceProfile::UnMarshalling(MessageParcel& parcel) READ_HELPER_RET(parcel, String, manu_, false); READ_HELPER_RET(parcel, String, sn_, false); READ_HELPER_RET(parcel, String, productId_, false); + READ_HELPER_RET(parcel, String, productName_, false); READ_HELPER_RET(parcel, String, subProductId_, false); READ_HELPER_RET(parcel, String, hiv_, false); READ_HELPER_RET(parcel, String, mac_, false); @@ -432,7 +444,7 @@ bool DeviceProfile::UnMarshalling(MessageParcel& parcel) READ_HELPER_RET(parcel, String, modifyTime_, false); READ_HELPER_RET(parcel, String, shareTime_, false); READ_HELPER_RET(parcel, String, accountId_, false); - READ_HELPER_RET(parcel, String, innerModel_, false); + READ_HELPER_RET(parcel, String, internalModel_, false); READ_HELPER_RET(parcel, String, bleMac_, false); READ_HELPER_RET(parcel, String, brMac_, false); READ_HELPER_RET(parcel, String, sleMac_, false); @@ -449,12 +461,13 @@ bool DeviceProfile::operator!=(const DeviceProfile& deviceProfile) const osType_ != deviceProfile.GetOsType() || isMultiUser_ != deviceProfile.IsMultiUser() || userId_ != deviceProfile.GetUserId() || devType_ != deviceProfile.GetDevType() || manu_ != deviceProfile.GetManu() || sn_ != deviceProfile.GetSn() || - productId_ != deviceProfile.GetProductId() || subProductId_ != deviceProfile.GetSubProductId() || + productId_ != deviceProfile.GetProductId() || + productName_ != deviceProfile.GetProductName() || subProductId_ != deviceProfile.GetSubProductId() || hiv_ != deviceProfile.GetHiv() || mac_ != deviceProfile.GetMac() || fwv_ != deviceProfile.GetFwv() || hwv_ != deviceProfile.GetHwv() || swv_ != deviceProfile.GetSwv() || protType_ != deviceProfile.GetProtType() || wiseUserId_ != deviceProfile.GetWiseUserId() || wiseDeviceId_ != deviceProfile.GetWiseDeviceId() || - registerTime_ != deviceProfile.GetRegisterTime() || innerModel_ != deviceProfile.GetInnerModel() || + registerTime_ != deviceProfile.GetRegisterTime() || internalModel_ != deviceProfile.GetInternalModel() || modifyTime_ != deviceProfile.GetModifyTime() || shareTime_ != deviceProfile.GetShareTime() || accountId_ != deviceProfile.GetAccountId() || id_ != deviceProfile.GetId() || bleMac_ != deviceProfile.bleMac_ || brMac_ != deviceProfile.brMac_ || sleMac_ != deviceProfile.sleMac_ || @@ -481,7 +494,7 @@ std::string DeviceProfile::dump() const cJSON_AddStringToObject(json, OS_SYS_CAPACITY.c_str(), osSysCap_.c_str()); cJSON_AddNumberToObject(json, OS_API_LEVEL.c_str(), osApiLevel_); cJSON_AddStringToObject(json, OS_VERSION.c_str(), osVersion_.c_str()); - cJSON_AddStringToObject(json, INNER_MODEL.c_str(), innerModel_.c_str()); + cJSON_AddStringToObject(json, INTERNAL_MODEL.c_str(), internalModel_.c_str()); cJSON_AddNumberToObject(json, OS_TYPE.c_str(), osType_); cJSON_AddBoolToObject(json, IS_MULTI_USER.c_str(), isMultiUser_); cJSON_AddNumberToObject(json, USER_ID.c_str(), userId_); diff --git a/common/src/utils/content_sensor_manager_utils.cpp b/common/src/utils/content_sensor_manager_utils.cpp index d9667c49..7ddf601f 100644 --- a/common/src/utils/content_sensor_manager_utils.cpp +++ b/common/src/utils/content_sensor_manager_utils.cpp @@ -19,6 +19,7 @@ #include #include +#include "cJSON.h" #include "parameter.h" #include "parameters.h" #include "softbus_bus_center.h" @@ -38,6 +39,13 @@ namespace { const char* MANUFACTURER_KEY = "const.product.manufacturer"; constexpr int32_t DEVICE_UUID_LENGTH = 65; constexpr int32_t SYS_SETTINGS_DATA_SYNC_PARAM_LEN = 128; + constexpr int32_t PROT_TYPE_WIFI_ONLY = 1; + constexpr int32_t PROT_TYPE_MOBILIE_NETWORK_AND_WIFI = 18; + constexpr const char* WIFI_ONLY_DEVICE_TREE_PROC_NODE_NAME = "/proc/device-tree/singleap_wifionly/is_wifionly"; + constexpr const char* WIFI_ONLY_FLAG_VALUE = "1"; + constexpr int32_t WIFI_ONLY_FLAG_VALUE_MAX_LEN = 8; + const char* OHOS_BOOT_BACKCOLOR = "ohos.boot.backcolor"; + const char* SUB_PROD_ID_MAP = "const.distributed_collaboration.subProdIdMap"; } IMPLEMENT_SINGLE_INSTANCE(ContentSensorManagerUtils); std::string ContentSensorManagerUtils::ObtainProductModel() @@ -229,5 +237,95 @@ bool ContentSensorManagerUtils::IsDeviceE2ESync() { return isDeviceE2ESync_.load(); } + +int32_t ContentSensorManagerUtils::GetProtType() +{ + std::lock_guard lock(csMutex_); + if (protType_ > 0) { + return protType_; + } + if (IsWifiOnly()) { + protType_ = PROT_TYPE_WIFI_ONLY; + } else { + protType_ = PROT_TYPE_MOBILIE_NETWORK_AND_WIFI; + } + HILOGI("protType:%{public}d", protType_); + return protType_; +} + +bool ContentSensorManagerUtils::IsWifiOnly() +{ + char buf[WIFI_ONLY_FLAG_VALUE_MAX_LEN] = {0}; + FILE *fp = nullptr; + if ((fp = fopen(WIFI_ONLY_DEVICE_TREE_PROC_NODE_NAME, "r")) == nullptr) { + HILOGE("open wifi only device tree proc node fail"); + return false; + } + if (fgets(buf, WIFI_ONLY_FLAG_VALUE_MAX_LEN, fp) == nullptr) { + HILOGE("fgets return nullptr"); + fclose(fp); + return false; + } + if (strcmp(buf, WIFI_ONLY_FLAG_VALUE)) { + HILOGE("buf not equal WIFI_ONLY_FLAG_VALUE"); + fclose(fp); + return false; + } + fclose(fp); + return true; +} + +std::string ContentSensorManagerUtils::GetSubProductId() +{ + std::string backcolor = GetBackcolor(); + std::map subProdIdMap = GetSubProdIdMap(); + if (backcolor.empty() || subProdIdMap.empty() || subProdIdMap.find(backcolor) == subProdIdMap.end()) { + return EMPTY_STRING; + } + return subProdIdMap[backcolor]; +} + +std::string ContentSensorManagerUtils::GetBackcolor() +{ + std::lock_guard lock(csMutex_); + if (!backcolor_.empty()) { + return backcolor_; + } + std::string temp = system::GetParameter(OHOS_BOOT_BACKCOLOR, ""); + if (temp.empty()) { + HILOGE("get backcolor failed!"); + return ""; + } + backcolor_ = temp; + return backcolor_; +} + +std::map ContentSensorManagerUtils::GetSubProdIdMap() +{ + std::lock_guard lock(csMutex_); + if (!subProdIdMap_.empty()) { + return subProdIdMap_; + } + std::string temp = system::GetParameter(SUB_PROD_ID_MAP, ""); + if (temp.empty()) { + HILOGE("get subProdIdMap failed!"); + return {}; + } + cJSON* json = cJSON_Parse(temp.c_str()); + if (!cJSON_IsObject(json)) { + HILOGW("cJSON_Parse productName fail!"); + cJSON_Delete(json); + return {}; + } + cJSON* item = json->child; + while (item != NULL) { + if (cJSON_IsString(item)) { + subProdIdMap_[item->string] = item->valuestring; + } + item = item->next; + } + cJSON_Delete(json); + return subProdIdMap_; +} } // namespace DistributedDeviceProfile } // namespace OHOS diff --git a/services/core/include/common/dp_services_constants.h b/services/core/include/common/dp_services_constants.h index 53136eaa..a861f216 100644 --- a/services/core/include/common/dp_services_constants.h +++ b/services/core/include/common/dp_services_constants.h @@ -35,10 +35,13 @@ extern const std::string SELECT_DEVICE_PROFILE_TABLE_WHERE_DEVID_USERID; extern const std::string CREATE_DEVICE_PROFILE_TABLE_SQL; extern const std::string CREATE_DEVICE_PROFILE_TABLE_UNIQUE_INDEX_SQL; extern const std::string CREATE_DEVICE_PROFILE_WISE_DEVICEID_INDEX_SQL; +extern const std::string ALTER_TABLE_DP_ADD_COLUMN_PRODUCT_NAME_SQL; +extern const std::string ALTER_TABLE_DP_RENAME_COLUMN_INTERNAL_MODEL_SQL; // DeviceIconInfoDao extern const std::string CREATE_DEVICE_ICON_INFO_TABLE_SQL ; extern const std::string CREATE_DEVICE_ICON_INFO_TABLE_UNIQUE_INDEX_SQL; extern const std::string SELECT_DEVICE_ICON_INFO_TABLE; +extern const std::string ALTER_TABLE_DEVICE_ICON_INFO_ADD_COLUMN_INTENAL_MODEL_SQL; // ProductInfoDao extern const std::string CREATE_PRODUCT_INFO_TABLE_SQL; extern const std::string SELECT_PRODUCT_INFO_TABLE; diff --git a/services/core/include/contentsensormanager/system_info_collector.h b/services/core/include/contentsensormanager/system_info_collector.h index feb2e124..0b6819bc 100644 --- a/services/core/include/contentsensormanager/system_info_collector.h +++ b/services/core/include/contentsensormanager/system_info_collector.h @@ -44,11 +44,13 @@ private: std::string GetOsVersion(); std::string GetDeviceName(); std::string GetProductId(); + std::string GetProductName(); std::string GetSn(); std::string GetDeviceModel(); std::string GetDevType(); std::string GetDeviceManufacturer(); std::string GetDeviceTypeId(); + std::string GetSubProductId(); }; } // namespace DeviceProfile } // namespace OHOS diff --git a/services/core/include/persistenceadapter/rdbadapter/profile_data_rdb_adapter.h b/services/core/include/persistenceadapter/rdbadapter/profile_data_rdb_adapter.h index ebabbf68..7565b828 100644 --- a/services/core/include/persistenceadapter/rdbadapter/profile_data_rdb_adapter.h +++ b/services/core/include/persistenceadapter/rdbadapter/profile_data_rdb_adapter.h @@ -48,6 +48,8 @@ class ProfileDataOpenCallback : public NativeRdb::RdbOpenCallback { public: int32_t OnCreate(RdbStore& store) override; int32_t OnUpgrade(RdbStore& store, int oldVersion, int newVersion) override; +private: + int32_t UpdateFromVer1To2(RdbStore& store); }; } // namespace DistributedDeviceProfile } // namespace OHOS diff --git a/services/core/src/common/dp_services_constants.cpp b/services/core/src/common/dp_services_constants.cpp index 714304d1..0dce43d0 100644 --- a/services/core/src/common/dp_services_constants.cpp +++ b/services/core/src/common/dp_services_constants.cpp @@ -58,12 +58,16 @@ const std::string CREATE_DEVICE_PROFILE_TABLE_SQL = " registerTime TEXT,\n" " modifyTime TEXT,\n" " shareTime TEXT,\n" - " innerModel TEXT\n" + " internalModel TEXT,\n" + " productName TEXT\n" ")"; const std::string CREATE_DEVICE_PROFILE_TABLE_UNIQUE_INDEX_SQL = "CREATE UNIQUE INDEX IF NOT EXISTS unique_device_profile ON device_profile (deviceId, userId)"; const std::string CREATE_DEVICE_PROFILE_WISE_DEVICEID_INDEX_SQL = "CREATE INDEX IF NOT EXISTS index_wiseDeviceId ON device_profile (wiseDeviceId)"; +const std::string ALTER_TABLE_DP_RENAME_COLUMN_INTERNAL_MODEL_SQL = +"ALTER TABLE device_profile RENAME COLUMN innerModel TO internalModel"; +const std::string ALTER_TABLE_DP_ADD_COLUMN_PRODUCT_NAME_SQL = "ALTER TABLE device_profile ADD COLUMN productName TEXT"; // DeviceIconInfoDao const std::string CREATE_DEVICE_ICON_INFO_TABLE_SQL = "CREATE TABLE IF NOT EXISTS device_icon_info\ (id INTEGER PRIMARY KEY AUTOINCREMENT,\ @@ -73,9 +77,12 @@ const std::string CREATE_DEVICE_ICON_INFO_TABLE_SQL = "CREATE TABLE IF NOT EXIST specName TEXT,\ version TEXT,\ url TEXT,\ - icon blob);"; + icon blob,\ + internalModel TEXT);"; const std::string CREATE_DEVICE_ICON_INFO_TABLE_UNIQUE_INDEX_SQL = "CREATE UNIQUE INDEX if not exists \ unique_device_icon_info ON device_icon_info (productId, subProductId, imageType, specName);"; +const std::string ALTER_TABLE_DEVICE_ICON_INFO_ADD_COLUMN_INTENAL_MODEL_SQL = +"ALTER TABLE device_icon_info ADD COLUMN internalModel TEXT"; const std::string SELECT_DEVICE_ICON_INFO_TABLE = "SELECT a.*,b.imageVersion FROM device_icon_info a \ LEFT JOIN product_info b ON a.productId = b.productId \ WHERE "; diff --git a/services/core/src/contentsensormanager/content_sensor_manager.cpp b/services/core/src/contentsensormanager/content_sensor_manager.cpp index e1ad24c4..16d1df08 100644 --- a/services/core/src/contentsensormanager/content_sensor_manager.cpp +++ b/services/core/src/contentsensormanager/content_sensor_manager.cpp @@ -118,7 +118,7 @@ int32_t ContentSensorManager::CollectInfoToProfileData(DeviceProfile& collectPro collectProfile.SetRegisterTime(oldDeviceProfile.GetRegisterTime()); collectProfile.SetModifyTime(oldDeviceProfile.GetModifyTime()); collectProfile.SetShareTime(oldDeviceProfile.GetShareTime()); - collectProfile.SetInnerModel(oldDeviceProfile.GetInnerModel()); + collectProfile.SetInternalModel(oldDeviceProfile.GetInternalModel()); } ret = ProfileDataManager::GetInstance().PutDeviceProfile(collectProfile); if (ret != DP_SUCCESS) { diff --git a/services/core/src/contentsensormanager/system_info_collector.cpp b/services/core/src/contentsensormanager/system_info_collector.cpp index fa216184..b2c71bc6 100644 --- a/services/core/src/contentsensormanager/system_info_collector.cpp +++ b/services/core/src/contentsensormanager/system_info_collector.cpp @@ -49,12 +49,14 @@ bool SystemInfoCollector::ConvertToProfile(DeviceProfile& profile) profile.SetOsVersion(GetOsVersion()); profile.SetDeviceName(GetDeviceName()); profile.SetProductId(GetProductId()); + profile.SetSubProductId(GetSubProductId()); profile.SetSn(GetSn()); profile.SetDeviceModel(GetDeviceModel()); profile.SetDevType(GetDeviceTypeId()); profile.SetManu(GetDeviceManufacturer()); profile.SetHiv(HIV_VERSION); profile.SetProtType(GetProtType()); + profile.SetProductName(GetProductName()); return true; } @@ -105,6 +107,18 @@ std::string SystemInfoCollector::GetProductId() return DistributedDeviceProfile::ContentSensorManagerUtils::GetInstance().ObtainProductId(); } +std::string SystemInfoCollector::GetProductName() +{ + std::string productName = ""; + SettingsDataManager::GetInstance().GetDeviceName(productName); + return productName; +} + +std::string SystemInfoCollector::GetSubProductId() +{ + return DistributedDeviceProfile::ContentSensorManagerUtils::GetInstance().GetSubProductId(); +} + std::string SystemInfoCollector::GetSn() { return DistributedDeviceProfile::ContentSensorManagerUtils::GetInstance().ObtainSerial(); @@ -127,7 +141,7 @@ std::string SystemInfoCollector::GetDeviceManufacturer() int32_t SystemInfoCollector::GetProtType() { - return 0; + return DistributedDeviceProfile::ContentSensorManagerUtils::GetInstance().GetProtType(); } std::string SystemInfoCollector::GetDeviceTypeId() diff --git a/services/core/src/multiusermanager/multi_user_manager.cpp b/services/core/src/multiusermanager/multi_user_manager.cpp index 89d48223..4b6bfd08 100644 --- a/services/core/src/multiusermanager/multi_user_manager.cpp +++ b/services/core/src/multiusermanager/multi_user_manager.cpp @@ -31,6 +31,7 @@ IMPLEMENT_SINGLE_INSTANCE(MultiUserManager); namespace { const std::string TAG = "MultiUserManager"; + const std::string OHOS_ANONYMOUS_UID = "ohosAnonymousUid"; } int32_t MultiUserManager::Init() @@ -105,7 +106,7 @@ std::string MultiUserManager::GetOhosAccountIdByUserId(int32_t userId) #elif DP_OS_ACCOUNT_PART_EXISTS AccountSA::OhosAccountInfo accountInfo; ErrCode ret = OHOS::AccountSA::OhosAccountKits::GetInstance().GetOsAccountDistributedInfo(userId, accountInfo); - if (ret != 0 || accountInfo.uid_ == "") { + if (ret != 0 || accountInfo.uid_ == "" || accountInfo.uid_ == OHOS_ANONYMOUS_UID) { HILOGE("error ret: %{public}d", ret); return ""; } diff --git a/services/core/src/persistenceadapter/rdbadapter/profile_data_rdb_adapter.cpp b/services/core/src/persistenceadapter/rdbadapter/profile_data_rdb_adapter.cpp index 68df1a32..3e09ed5b 100644 --- a/services/core/src/persistenceadapter/rdbadapter/profile_data_rdb_adapter.cpp +++ b/services/core/src/persistenceadapter/rdbadapter/profile_data_rdb_adapter.cpp @@ -189,7 +189,7 @@ std::shared_ptr ProfileDataRdbAdapter::Get(const std::string& sql, co int32_t ProfileDataRdbAdapter::GetRDBPtr() { - int32_t version = RDB_VERSION; + int32_t version = RDB_VERSION_5_1; ProfileDataOpenCallback helper; RdbStoreConfig config(PROFILE_DATA_RDB_PATH + PROFILE_DATA_DATABASE_NAME); config.SetSecurityLevel(SecurityLevel::S2); @@ -256,7 +256,30 @@ int32_t ProfileDataOpenCallback::OnCreate(RdbStore& store) int32_t ProfileDataOpenCallback::OnUpgrade(RdbStore& store, int oldVersion, int newVersion) { - HILOGI("rdbStore upgrade"); + HILOGI("rdbStore upgrade : %{public}d -> %{public}d", oldVersion, newVersion); + if (oldVersion == RDB_VERSION && newVersion == RDB_VERSION_5_1) { + return UpdateFromVer1To2(store); + } + return NativeRdb::E_OK; +} + +int32_t ProfileDataOpenCallback::UpdateFromVer1To2(RdbStore& store) +{ + int32_t ret = store.ExecuteSql(ALTER_TABLE_DP_ADD_COLUMN_PRODUCT_NAME_SQL); + if (ret != NativeRdb::E_OK) { + HILOGE("add column to device_profile table failed, ret:%{public}d", ret); + return ret; + } + ret = store.ExecuteSql(ALTER_TABLE_DP_RENAME_COLUMN_INTERNAL_MODEL_SQL); + if (ret != NativeRdb::E_OK) { + HILOGE("add column to device_icon_info table failed, ret:%{public}d", ret); + return ret; + } + ret = store.ExecuteSql(ALTER_TABLE_DEVICE_ICON_INFO_ADD_COLUMN_INTENAL_MODEL_SQL); + if (ret != NativeRdb::E_OK) { + HILOGE("add column to device_icon_info table failed, ret:%{public}d", ret); + return ret; + } return NativeRdb::E_OK; } } // namespace DistributedDeviceProfile diff --git a/services/core/src/profiledatamanager/device_icon_info_dao.cpp b/services/core/src/profiledatamanager/device_icon_info_dao.cpp index 6f22024c..96377a56 100644 --- a/services/core/src/profiledatamanager/device_icon_info_dao.cpp +++ b/services/core/src/profiledatamanager/device_icon_info_dao.cpp @@ -63,6 +63,7 @@ int32_t DeviceIconInfoDao::UnInit() int32_t DeviceIconInfoDao::PutDeviceIconInfo(const DeviceIconInfo& deviceIconInfo) { + HILOGI("deviceIconInfo:%{public}s", deviceIconInfo.dump().c_str()); ValuesBucket values; DeviceIconInfoToEntries(deviceIconInfo, values); int64_t rowId = ROWID_INIT; @@ -131,6 +132,7 @@ int32_t DeviceIconInfoDao::DeleteDeviceIconInfo(const DeviceIconInfo& deviceIcon int32_t DeviceIconInfoDao::UpdateDeviceIconInfo(const DeviceIconInfo& deviceIconInfo) { + HILOGI("deviceIconInfo:%{public}s", deviceIconInfo.dump().c_str()); ValuesBucket values; DeviceIconInfoToEntries(deviceIconInfo, values); int32_t changeRowCnt = CHANGEROWCNT_INIT; @@ -187,6 +189,11 @@ bool DeviceIconInfoDao::CreateQuerySqlAndCondition(const DeviceIconInfoFilterOpt condition.emplace_back(ValueObject(filterOptions.GetSubProductId())); flag = true; } + if (!filterOptions.GetInternalModel().empty()) { + sql += "a." + INTERNAL_MODEL + " = ? AND "; + condition.emplace_back(ValueObject(filterOptions.GetInternalModel())); + flag = true; + } if (!filterOptions.GetImageType().empty()) { sql += "a." + IMAGE_TYPE + " = ? AND "; condition.emplace_back(ValueObject(filterOptions.GetImageType())); @@ -207,6 +214,7 @@ bool DeviceIconInfoDao::CreateQuerySqlAndCondition(const DeviceIconInfoFilterOpt int32_t DeviceIconInfoDao::DeviceIconInfoToEntries(const DeviceIconInfo& deviceIconInfo, ValuesBucket& values) { values.PutString(PRODUCT_ID, deviceIconInfo.GetProductId()); + values.PutString(INTERNAL_MODEL, deviceIconInfo.GetInternalModel()); values.PutString(SUB_PRODUCT_ID, deviceIconInfo.GetSubProductId()); values.PutString(IMAGE_TYPE, deviceIconInfo.GetImageType()); values.PutString(SPEC_NAME, deviceIconInfo.GetSpecName()); @@ -231,6 +239,7 @@ int32_t DeviceIconInfoDao::ConvertToDeviceIconInfo(std::shared_ptr re } deviceIconInfo.SetId(rowEntity.Get(ID)); deviceIconInfo.SetProductId(rowEntity.Get(PRODUCT_ID)); + deviceIconInfo.SetInternalModel(rowEntity.Get(INTERNAL_MODEL)); deviceIconInfo.SetSubProductId(rowEntity.Get(SUB_PRODUCT_ID)); deviceIconInfo.SetImageType(rowEntity.Get(IMAGE_TYPE)); deviceIconInfo.SetSpecName(rowEntity.Get(SPEC_NAME)); diff --git a/services/core/src/profiledatamanager/device_profile_dao.cpp b/services/core/src/profiledatamanager/device_profile_dao.cpp index 34293244..30f8b772 100644 --- a/services/core/src/profiledatamanager/device_profile_dao.cpp +++ b/services/core/src/profiledatamanager/device_profile_dao.cpp @@ -137,7 +137,7 @@ int32_t DeviceProfileDao::DeleteDeviceProfile(const DeviceProfile &deviceProfile int32_t ret = ProfileDataRdbAdapter::GetInstance().Delete(deleteRows, DEVICE_PROFILE_TABLE, ID_EQUAL_CONDITION, std::vector{ ValueObject(deviceProfile.GetId()) }); if (ret != DP_SUCCESS) { - HILOGE("delete device_profile data failed"); + HILOGE("delete device_profile data failed, ret=%{public}d", ret); return DP_DELETE_TRUST_DEVICE_PROFILE_FAIL; } } @@ -195,7 +195,7 @@ void DeviceProfileDao::CreateQuerySqlAndCondition(const DeviceProfileFilterOptio sql = SELECT_DEVICE_PROFILE_TABLE; bool matchCondition = false; if (!filterOptions.GetDeviceProfileIds().empty()) { - sql += "deviceProfileId IN("; + sql += "id IN("; GenerateSqlAndCondition(filterOptions.GetDeviceProfileIds(), sql, condition); matchCondition = true; } @@ -235,6 +235,7 @@ int32_t DeviceProfileDao::DeviceProfileToEntries(const DeviceProfile &deviceProf values.PutString(MANU, deviceProfile.GetManu()); values.PutString(SN, deviceProfile.GetSn()); values.PutString(PRODUCT_ID, deviceProfile.GetProductId()); + values.PutString(PRODUCT_NAME, deviceProfile.GetProductName()); values.PutString(SUB_PRODUCT_ID, deviceProfile.GetSubProductId()); values.PutString(HIV, deviceProfile.GetHiv()); values.PutString(MAC, deviceProfile.GetMac()); @@ -246,7 +247,7 @@ int32_t DeviceProfileDao::DeviceProfileToEntries(const DeviceProfile &deviceProf values.PutString(WISE_USER_ID, deviceProfile.GetWiseUserId()); values.PutString(WISE_DEVICE_ID, deviceProfile.GetWiseDeviceId()); values.PutString(REGISTER_TIME, deviceProfile.GetRegisterTime()); - values.PutString(INNER_MODEL, deviceProfile.GetInnerModel()); + values.PutString(INTERNAL_MODEL, deviceProfile.GetInternalModel()); values.PutString(MODIFY_TIME, deviceProfile.GetModifyTime()); values.PutString(SHARE_TIME, deviceProfile.GetShareTime()); values.PutInt(USERID, deviceProfile.GetUserId()); @@ -277,6 +278,7 @@ int32_t DeviceProfileDao::ConvertToDeviceProfile( deviceProfile.SetManu(rowEntity.Get(MANU)); deviceProfile.SetSn(rowEntity.Get(SN)); deviceProfile.SetProductId(rowEntity.Get(PRODUCT_ID)); + deviceProfile.SetProductName(rowEntity.Get(PRODUCT_NAME)); deviceProfile.SetSubProductId(rowEntity.Get(SUB_PRODUCT_ID)); deviceProfile.SetHiv(rowEntity.Get(HIV)); deviceProfile.SetMac(rowEntity.Get(MAC)); @@ -288,7 +290,7 @@ int32_t DeviceProfileDao::ConvertToDeviceProfile( deviceProfile.SetWiseUserId(rowEntity.Get(WISE_USER_ID)); deviceProfile.SetWiseDeviceId(rowEntity.Get(WISE_DEVICE_ID)); deviceProfile.SetRegisterTime(rowEntity.Get(REGISTER_TIME)); - deviceProfile.SetInnerModel(rowEntity.Get(INNER_MODEL)); + deviceProfile.SetInternalModel(rowEntity.Get(INTERNAL_MODEL)); deviceProfile.SetModifyTime(rowEntity.Get(MODIFY_TIME)); deviceProfile.SetShareTime(rowEntity.Get(SHARE_TIME)); deviceProfile.SetUserId(rowEntity.Get(USERID)); diff --git a/services/core/src/profiledatamanager/profile_data_manager.cpp b/services/core/src/profiledatamanager/profile_data_manager.cpp index 60bc4e71..945cc745 100644 --- a/services/core/src/profiledatamanager/profile_data_manager.cpp +++ b/services/core/src/profiledatamanager/profile_data_manager.cpp @@ -84,8 +84,9 @@ int32_t ProfileDataManager::PutDeviceProfile(DeviceProfile deviceProfile) ProfileUtils::GetAnonyString(deviceProfile.GetDeviceId()).c_str()); return DP_INVALID_PARAMS; } - deviceProfile.SetUserId(MultiUserManager::GetInstance().GetCurrentForegroundUserID()); - deviceProfile.SetAccountId(ProfileCache::GetInstance().GetLocalAccountId()); + if (deviceProfile.GetUserId() == DEFAULT_USER_ID) { + deviceProfile.SetUserId(MultiUserManager::GetInstance().GetCurrentForegroundUserID()); + } DeviceProfileFilterOptions filterOptions; filterOptions.AddDeviceIds(deviceProfile.GetDeviceId()); filterOptions.SetUserId(deviceProfile.GetUserId()); @@ -117,19 +118,32 @@ int32_t ProfileDataManager::PutDeviceProfile(DeviceProfile deviceProfile) int32_t ProfileDataManager::DeleteDeviceProfileBatch(std::vector& deviceProfiles) { + HILOGI("deviceProfiles.size:%{public}zu", deviceProfiles.size()); if (deviceProfiles.empty()) { HILOGE("deviceProfiles is empty"); return DP_INVALID_PARAM; } - int32_t ret = RET_INIT; - for (auto deviceProfile : deviceProfiles) { - int32_t delRet = DeviceProfileDao::GetInstance().DeleteDeviceProfile(deviceProfile); - if (ret != DP_SUCCESS) { + DeviceProfileFilterOptions filterOptions; + filterOptions.SetUserId(deviceProfiles[0].GetUserId()); + for (auto const &item : deviceProfiles) { + filterOptions.AddDeviceIds(item.GetDeviceId()); + } + std::vector oldDeviceProfiles; + int32_t ret = GetDeviceProfiles(filterOptions, oldDeviceProfiles); + if (ret != DP_SUCCESS) { + HILOGE("DeleteDeviceProfile failed,ret=%{public}d", ret); + return ret; + } + HILOGE("oldDeviceProfiles.size:%{public}zu", oldDeviceProfiles.size()); + for (auto dp : oldDeviceProfiles) { + int32_t delRet = DeviceProfileDao::GetInstance().DeleteDeviceProfile(dp); + if (delRet != DP_SUCCESS) { + HILOGE("DeleteDeviceProfile failed, delRet=%{public}d, dp:%{public}s", delRet, dp.dump().c_str()); ret = delRet; } } if (ret != DP_SUCCESS) { - HILOGE("DeleteDeviceProfile failed,ret=%{public}d", ret); + HILOGE("DeleteDeviceProfile failed, ret=%{public}d", ret); return ret; } return DP_SUCCESS; @@ -174,8 +188,9 @@ int32_t ProfileDataManager::PutDeviceProfileBatch(std::vector& de int32_t ProfileDataManager::GetDeviceProfiles(DeviceProfileFilterOptions& options, std::vector& deviceProfiles) { - int32_t localUserId = MultiUserManager::GetInstance().GetCurrentForegroundUserID(); - options.SetUserId(localUserId); + if (options.GetUserId() == DEFAULT_USER_ID) { + options.SetUserId(MultiUserManager::GetInstance().GetCurrentForegroundUserID()); + } int32_t ret = DeviceProfileDao::GetInstance().GetDeviceProfiles(options, deviceProfiles); if (ret != DP_SUCCESS) { HILOGE("GetDeviceProfile failed,ret=%{public}d", ret); -- Gitee From aea9f169c8581257f05e87dc2a2236fd1b6fa9df Mon Sep 17 00:00:00 2001 From: wangzhaohao Date: Fri, 7 Mar 2025 17:46:57 +0800 Subject: [PATCH 2/2] fix codecheck Signed-off-by: wangzhaohao --- common/src/interfaces/device_icon_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/interfaces/device_icon_info.cpp b/common/src/interfaces/device_icon_info.cpp index 75bfeb11..bf26187a 100644 --- a/common/src/interfaces/device_icon_info.cpp +++ b/common/src/interfaces/device_icon_info.cpp @@ -159,7 +159,7 @@ bool DeviceIconInfo::UnMarshalling(MessageParcel& parcel) bool DeviceIconInfo::operator!=(const DeviceIconInfo& other) const { bool isNotEqual = (id_ != other.GetId() || productId_ != other.GetProductId() || - internalModel_ != other.GetInternalModel() || + internalModel_ != other.GetInternalModel() || subProductId_ != other.GetSubProductId() || imageType_ != other.GetImageType() || specName_ != other.GetSpecName() || version_ != other.GetVersion() || wiseVersion_ != other.GetWiseVersion() || url_ != other.GetUrl() || icon_ != other.GetIcon()); -- Gitee