#include <unistd.h>
+#include <algorithm>
+#include <cmath>
#include <cstdio>
#include <fstream>
#include <TTraceWrapper.h>
#include "common/step/filesystem/step_migrate_legacy_external_image.h"
#include "common/step/filesystem/step_move_installed_storage.h"
#include "common/step/filesystem/step_optional_acquire_external_storage.h"
-#include "common/step/filesystem/step_recover_change_owner.h"
#include "common/step/filesystem/step_recover_external_storage.h"
#include "common/step/filesystem/step_recover_files.h"
#include "common/step/filesystem/step_recover_globalapp_symlinks.h"
const char kHistoryFileName[] = LOGDIR"/installation-history.log";
const int kLogRotationSize = 1024 * 256; // 256KB
const int kLogMaximumRotation = 3;
+const int kSignalCount = 10;
}
unsigned total_steps = steps_.size();
unsigned current_step = 1;
+ double div = total_steps / static_cast<double>(kSignalCount);
+ int interval = std::max(1, static_cast<int>(std::round(div)));
for (it_ = steps_.begin(); it_ != steps_.end(); ++it_, ++current_step) {
status_ = SafeExecute(*it_, &Step::precheck, "precheck");
if (!context_->pkgid.get().empty())
history_logger_.LogHistoryStart(context_->pkgid.get(),
GetPackageVersion(), context_->request_type.get());
- SendProgress(current_step * kProgressRange / total_steps);
+
+ if (current_step == total_steps || current_step % interval == 0)
+ SendProgress(current_step * kProgressRange / total_steps);
}
+ if (!context_->pkgid.get().empty())
+ pkgmgr_parser_update_pending_cache(context_->pkgid.get().c_str());
+
return result_;
}
AddStep<ci::filesystem::StepRecoverFiles>();
AddStep<ci::pkgmgr::StepRecoverPrivSharedres>();
AddStep<ci::mount::StepMountRecover>();
- AddStep<ci::filesystem::StepRecoverChangeOwner>();
AddStep<ci::pkgmgr::StepRecoverApplication>();
AddStep<ci::security::StepRecoverTrustAnchor>();
AddStep<ci::security::StepRecoverSecurity>();
}
void AppInstaller::SendFinished(Step::Status process_status) {
- pkgmgr_parser_clear_cache_memory_db();
+ pkgmgr_parser_update_pending_cache(context_->pkgid.get().c_str());
if (!SendStartIfNotSent(false))
return;
Step::Status process_status = Step::Status::OK;
try {
TTRACE(TTRACE_TAG_APP, "%s_%s", step_ptr->name(), name.c_str());
+ LOG(DEBUG) << step_ptr->name() << "_" << name.c_str();
process_status = ((*step_ptr).*method)();
} catch (const std::exception& err) {
LOG(ERROR) << "Exception occurred in " << name.c_str() << "(): "