Lines Matching refs:upParams
153 static UpdaterStatus VerifyPackages(const UpdaterParams &upParams) in VerifyPackages() argument
160 for (unsigned int i = upParams.pkgLocation; i < upParams.updatePackage.size(); i++) { in VerifyPackages()
161 LOG(INFO) << "Verify package:" << upParams.updatePackage[i]; in VerifyPackages()
163 int32_t verifyret = OtaUpdatePreCheck(manager, upParams.updatePackage[i]); in VerifyPackages()
209 UpdaterParams upParams { in UpdaterFromSdcard() local
213 if (VerifyPackages(upParams) != UPDATE_SUCCESS) { in UpdaterFromSdcard()
217 upParams.initialProgress += VERIFY_PERCENT; in UpdaterFromSdcard()
220 …INFO) << "UpdaterFromSdcard start, sdcard updaterPath : " << upParams.updatePackage[upParams.pkgLo… in UpdaterFromSdcard()
222 UpdaterStatus updateRet = DoInstallUpdaterPackage(pkgManager, upParams, SDCARD_UPDATE); in UpdaterFromSdcard()
288 static UpdaterStatus InstallUpdaterPackage(UpdaterParams &upParams, PkgManager::PkgManagerPtr manag… in InstallUpdaterPackage() argument
293 if (upParams.retryCount == 0) { in InstallUpdaterPackage()
299 SetMessageToMisc(upParams.retryCount + 1, "retry_count"); in InstallUpdaterPackage()
301 status = DoInstallUpdaterPackage(manager, upParams, HOTA_UPDATE); in InstallUpdaterPackage()
306 if (status == UPDATE_RETRY && upParams.retryCount < MAX_RETRY_COUNT) { in InstallUpdaterPackage()
307 upParams.retryCount += 1; in InstallUpdaterPackage()
309 SetMessageToMisc(upParams.retryCount, "retry_count"); in InstallUpdaterPackage()
319 static UpdaterStatus CalcProgress(const UpdaterParams &upParams, in CalcProgress() argument
324 for (const auto &path : upParams.updatePackage) { in CalcProgress()
351 updateStartPosition = pkgStartPosition[upParams.pkgLocation]; in CalcProgress()
355 static UpdaterStatus PreUpdatePackages(UpdaterParams &upParams) in PreUpdatePackages() argument
357 LOG(INFO) << "start to update packages, start index:" << upParams.pkgLocation; in PreUpdatePackages()
358 for (unsigned int i = 0; i < upParams.updatePackage.size(); i++) { in PreUpdatePackages()
359 LOG(INFO) << "package " << i << ":" << upParams.updatePackage[i] << in PreUpdatePackages()
360 " precent:" << upParams.currentPercentage; in PreUpdatePackages()
374 if (VerifyPackages(upParams) != UPDATE_SUCCESS) { in PreUpdatePackages()
379 if (IsSpaceCapacitySufficient(upParams.updatePackage) == UPDATE_ERROR) { in PreUpdatePackages()
382 if (upParams.retryCount == 0 && !IsBatteryCapacitySufficient()) { in PreUpdatePackages()
392 static UpdaterStatus DoUpdatePackages(UpdaterParams &upParams) in DoUpdatePackages() argument
397 status = CalcProgress(upParams, pkgStartPosition, updateStartPosition); in DoUpdatePackages()
402 for (; upParams.pkgLocation < upParams.updatePackage.size(); upParams.pkgLocation++) { in DoUpdatePackages()
404 upParams.currentPercentage = pkgStartPosition[upParams.pkgLocation + 1] - in DoUpdatePackages()
405 pkgStartPosition[upParams.pkgLocation]; in DoUpdatePackages()
406 upParams.initialProgress = pkgStartPosition[upParams.pkgLocation]; in DoUpdatePackages()
407 … LOG(INFO) << "InstallUpdaterPackage pkg is " << upParams.updatePackage[upParams.pkgLocation] << in DoUpdatePackages()
408 … " percent:" << upParams.initialProgress << "~" << pkgStartPosition[upParams.pkgLocation + 1]; in DoUpdatePackages()
410 status = InstallUpdaterPackage(upParams, manager); in DoUpdatePackages()
411 SetMessageToMisc(upParams.pkgLocation + 1, "upgraded_pkg_num"); in DoUpdatePackages()
413 static_cast<int>(upParams.initialProgress * FULL_PERCENT_PROGRESS + in DoUpdatePackages()
414 upParams.currentPercentage * GetTmpProgressValue()), in DoUpdatePackages()
415 static_cast<int>(pkgStartPosition[upParams.pkgLocation + 1] * FULL_PERCENT_PROGRESS)); in DoUpdatePackages()
417 …LOG(ERROR) << "InstallUpdaterPackage failed! Pkg is " << upParams.updatePackage[upParams.pkgLocati… in DoUpdatePackages()
429 static void PostUpdatePackages(UpdaterParams &upParams, bool updateResult) in PostUpdatePackages() argument
442 …upParams.pkgLocation = upParams.pkgLocation == 0 ? upParams.pkgLocation : (upParams.pkgLocation - … in PostUpdatePackages()
445 for (unsigned int i = 0; i < upParams.pkgLocation; i++) { in PostUpdatePackages()
446 writeBuffer += upParams.updatePackage[i] + "|pass\n"; in PostUpdatePackages()
448 writeBuffer += upParams.updatePackage[upParams.pkgLocation] + "|" + buf + "\n"; in PostUpdatePackages()
449 for (unsigned int i = upParams.pkgLocation + 1; i < upParams.updatePackage.size(); i++) { in PostUpdatePackages()
450 writeBuffer += upParams.updatePackage[i] + "\n"; in PostUpdatePackages()
459 static UpdaterStatus InstallUpdaterPackages(UpdaterParams &upParams) in InstallUpdaterPackages() argument
461 UpdaterStatus status = PreUpdatePackages(upParams); in InstallUpdaterPackages()
463 status = DoUpdatePackages(upParams); in InstallUpdaterPackages()
465 PostUpdatePackages(upParams, status == UPDATE_SUCCESS); in InstallUpdaterPackages()
469 static UpdaterStatus StartUpdaterEntry(UpdaterParams &upParams) in StartUpdaterEntry() argument
472 if (upParams.updatePackage.size() > 0) { in StartUpdaterEntry()
474 status = InstallUpdaterPackages(upParams); in StartUpdaterEntry()
475 } else if (upParams.factoryWipeData) { in StartUpdaterEntry()
488 } else if (upParams.userWipeData) { in StartUpdaterEntry()
514 UpdaterParams upParams { in StartUpdater() local
531 upParams.updatePackage.push_back(optarg); in StartUpdater()
535 upParams.retryCount = atoi(optarg); in StartUpdater()
540 upParams.factoryWipeData = true; in StartUpdater()
543 upParams.userWipeData = true; in StartUpdater()
545 upParams.pkgLocation = static_cast<unsigned int>(atoi(optarg)); in StartUpdater()
559 if (upParams.factoryWipeData && upParams.userWipeData) { in StartUpdater()
561 upParams.factoryWipeData = false; in StartUpdater()
563 return StartUpdaterEntry(upParams); in StartUpdater()