修改变量初始化

Signed-off-by: 邹友松 <zouyousong1@h-partners.com>
This commit is contained in:
邹友松
2023-09-06 10:37:02 +08:00
parent 694c535b58
commit 6bc241539e
13 changed files with 20 additions and 23 deletions
@@ -165,8 +165,8 @@ private:
}
RequestType requestType_ = RequestType::CHECK;
Duration duration_ {};
CheckAndAuthInfo checkAndAuthInfo_ {};
Duration duration_;
CheckAndAuthInfo checkAndAuthInfo_;
std::vector<FirmwareComponent> checkResultList_;
};
} // namespace UpdateEngine
@@ -57,7 +57,7 @@ private:
private:
std::vector<FirmwareComponent> componentList_;
Duration duration_ {};
Duration duration_;
bool isSameWithDb_ = true;
CheckStatus status_ = CheckStatus::CHECK_FAIL;
};
@@ -37,8 +37,8 @@ private:
void GetTask();
private:
FirmwareTask tasks_ {};
Progress downloadProgress_ {};
FirmwareTask tasks_;
Progress downloadProgress_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -36,7 +36,7 @@ private:
void GetTask();
private:
FirmwareTask tasks_ {};
FirmwareTask tasks_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -36,9 +36,9 @@ private:
void Complete();
private:
FirmwareCheckComponentCallback checkComponentCallback_ {};
Duration duration_ {};
CheckAndAuthInfo checkAndAuthInfo_ {};
FirmwareCheckComponentCallback checkComponentCallback_;
Duration duration_;
CheckAndAuthInfo checkAndAuthInfo_;
std::vector<FirmwareComponent> componentList_;
CheckStatus status_ = CheckStatus::CHECK_SUCCESS;
};
@@ -39,10 +39,10 @@ private:
bool VerifyDownloadPkg(const std::string &pkgName, Progress &progress);
private:
DownloadOptions downloadOptions_ {};
DownloadOptions downloadOptions_;
std::vector<FirmwareComponent> components_;
FirmwareProgressCallback firmwareProgressCallback_ {};
FirmwareTask tasks_ {};
FirmwareProgressCallback firmwareProgressCallback_;
FirmwareTask tasks_;
UpgradeStatus upgradeStatus_;
std::shared_ptr<DownloadThread> downloadThread_ = nullptr;
};
@@ -43,8 +43,8 @@ private:
FirmwareInstallExecutorCallback installCallback_;
InstallCallbackInfo installCallbackInfo_;
std::vector<FirmwareComponent> components_;
FirmwareTask tasks_ {};
Progress taskProgress_ {};
FirmwareTask tasks_;
Progress taskProgress_;
std::shared_ptr<FirmwarePreferencesUtil> preferencesUtil_ =
DelayedSingleton<FirmwarePreferencesUtil>::GetInstance();
};
@@ -40,7 +40,7 @@ private:
int32_t WaitInstallResult();
private:
Progress sysInstallProgress_ {};
Progress sysInstallProgress_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -52,10 +52,10 @@ private:
private:
FirmwareDownloadDataProcessor downloadDataProcessor_;
DownloadOptions downloadOptions_ {};
DownloadOptions downloadOptions_;
BusinessError &businessError_;
OnExecuteFinishCallback onExecuteFinishCallback_;
FirmwareTask tasks_ {};
FirmwareTask tasks_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -60,7 +60,7 @@ private:
BusinessError &businessError_;
InstallType installType_;
OnExecuteFinishCallback onExecuteFinishCallback_;
FirmwareTask tasks_ {};
FirmwareTask tasks_;
std::shared_ptr<FirmwarePreferencesUtil> preferencesUtil_ =
DelayedSingleton<FirmwarePreferencesUtil>::GetInstance();
};
@@ -40,7 +40,7 @@ private:
private:
OnCheckComplete onCheckComplete_;
FirmwareCheckDataProcessor checkDataProcessor_;
BusinessError businessError_ {};
BusinessError businessError_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -39,7 +39,7 @@ private:
private:
std::shared_ptr<IAccessManager> accessManager_ = nullptr;
std::shared_ptr<IStartupSchedule> startupSchedule_ = nullptr;
ScheduleTask scheduleTask_ {};
ScheduleTask scheduleTask_;
};
} // namespace UpdateEngine
} // namespace OHOS
@@ -44,9 +44,6 @@ void NetObserver::StartObserver()
netSpecifier.ident_ = "";
netSpecifier.netCapabilities_ = netAllCapabilities;
sptr<NetSpecifier> specifier = new NetSpecifier(netSpecifier);
if (specifier == nullptr) {
return;
}
constexpr int32_t RETRY_MAX_TIMES = 10;
int32_t retryCount = 0;
int32_t ret = NetConnResultCode::NET_CONN_SUCCESS;