mirror of
https://gitee.com/openharmony/deviceprofile_device_info_manager
synced 2024-11-27 09:40:28 +00:00
修改函数名称
Signed-off-by: guoyi <guoyi39@huawei.com>
This commit is contained in:
parent
607a0f1e4c
commit
6d6fca07a1
@ -101,7 +101,7 @@ void DpDeviceManager::DpDeviceStateCallback::OnDeviceOnline(const DmDeviceInfo &
|
||||
DistributedDeviceProfileService::GetInstance().DeviceOnline();
|
||||
std::string networkId = deviceInfo.networkId;
|
||||
DistributedDeviceProfile::ProfileCache::GetInstance().OnNodeOnline(networkId);
|
||||
DistributedDeviceProfile::DeviceProfileManager::GetInstance().ClearDataOnDeviceOnline(
|
||||
DistributedDeviceProfile::DeviceProfileManager::GetInstance().FixDataOnDeviceOnline(
|
||||
deviceInfo.networkId, deviceInfo.extraData);
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
int32_t SavePutTempCache(std::map<std::string, std::string>& entries);
|
||||
bool IsFirstInitDB();
|
||||
void ResetFirst();
|
||||
void ClearDataOnDeviceOnline(const std::string& networkId, const std::string& extraData);
|
||||
void FixDataOnDeviceOnline(const std::string& networkId, const std::string& extraData);
|
||||
|
||||
private:
|
||||
bool LoadDpSyncAdapter();
|
||||
|
@ -608,7 +608,7 @@ void DeviceProfileManager::ResetFirst()
|
||||
isFirst_.store(false);
|
||||
}
|
||||
|
||||
void DeviceProfileManager::ClearDataOnDeviceOnline(const std::string& networkId, const std::string& extraData)
|
||||
void DeviceProfileManager::FixDataOnDeviceOnline(const std::string& networkId, const std::string& extraData)
|
||||
{
|
||||
HILOGI("networkId:%{public}s", ProfileUtils::GetAnonyString(networkId).c_str());
|
||||
if (networkId.empty() || extraData.empty()) {
|
||||
@ -623,9 +623,12 @@ void DeviceProfileManager::ClearDataOnDeviceOnline(const std::string& networkId,
|
||||
}
|
||||
int32_t osType = DEFAULT_OS_TYPE;
|
||||
cJSON* osTypeJson = cJSON_GetObjectItem(extraDataJson, DistributedHardware::PARAM_KEY_OS_TYPE);
|
||||
if (cJSON_IsNumber(osTypeJson)) {
|
||||
osType = static_cast<int32_t>(osTypeJson->valueint);
|
||||
if (!cJSON_IsNumber(osTypeJson)) {
|
||||
HILOGE("osTypeJson is not a number");
|
||||
cJSON_Delete(extraDataJson);
|
||||
return;
|
||||
}
|
||||
osType = static_cast<int32_t>(osTypeJson->valueint);
|
||||
cJSON_Delete(extraDataJson);
|
||||
if (osType != DEFAULT_OS_TYPE) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user