#include "common/installer_context.h"
#include "common/pkgmgr_interface.h"
#include "common/pkgmgr_signal.h"
+#include "common/step/configuration/step_fail.h"
namespace {
AppInstaller::~AppInstaller() {
}
+void AppInstaller::Init() {
+ switch (pkgmgr_->GetRequestType()) {
+ case RequestType::Install:
+ InstallSteps();
+ break;
+ case RequestType::Update:
+ UpdateSteps();
+ break;
+ case RequestType::Uninstall:
+ UninstallSteps();
+ break;
+ case RequestType::Reinstall:
+ ReinstallSteps();
+ break;
+ case RequestType::Delta:
+ DeltaSteps();
+ break;
+ case RequestType::Move:
+ MoveSteps();
+ break;
+ case RequestType::Recovery:
+ RecoverySteps();
+ break;
+ case RequestType::MountInstall:
+ MountInstallSteps();
+ break;
+ case RequestType::MountUpdate:
+ MountUpdateSteps();
+ break;
+ case RequestType::ManifestDirectInstall:
+ ManifestDirectInstallSteps();
+ break;
+ case RequestType::ManifestDirectUpdate:
+ ManifestDirectUpdateSteps();
+ break;
+ case RequestType::ManifestPartialInstall:
+ ManifestPartialInstallSteps();
+ break;
+ case RequestType::ManifestPartialUpdate:
+ ManifestPartialUpdateSteps();
+ break;
+ case RequestType::PartialUninstall:
+ PartialUninstallSteps();
+ break;
+ case RequestType::ReadonlyUpdateInstall:
+ ReadonlyUpdateInstallSteps();
+ break;
+ case RequestType::ReadonlyUpdateUninstall:
+ ReadonlyUpdateUninstallSteps();
+ break;
+ case RequestType::EnablePkg:
+ EnablePkgSteps();
+ break;
+ case RequestType::DisablePkg:
+ DisablePkgSteps();
+ break;
+ case RequestType::MigrateExtImg:
+ MigrateExtImgSteps();
+ break;
+ default:
+ UnknownSteps();
+ break;
+ }
+}
+
AppInstaller::Result AppInstaller::Run() {
std::list<std::unique_ptr<Step>>::iterator it(steps_.begin());
std::list<std::unique_ptr<Step>>::iterator itStart(steps_.begin());
return ret;
}
+void AppInstaller::InstallSteps() { UnknownSteps(); }
+void AppInstaller::UpdateSteps() { UnknownSteps(); }
+void AppInstaller::UninstallSteps() { UnknownSteps(); }
+void AppInstaller::ReinstallSteps() { UnknownSteps(); }
+void AppInstaller::DeltaSteps() { UnknownSteps(); }
+void AppInstaller::MoveSteps() { UnknownSteps(); }
+void AppInstaller::RecoverySteps() { UnknownSteps(); }
+void AppInstaller::MountInstallSteps() { UnknownSteps(); }
+void AppInstaller::MountUpdateSteps() { UnknownSteps(); }
+void AppInstaller::ManifestDirectInstallSteps() { UnknownSteps(); }
+void AppInstaller::ManifestDirectUpdateSteps() { UnknownSteps(); }
+void AppInstaller::ManifestPartialInstallSteps() { UnknownSteps(); }
+void AppInstaller::ManifestPartialUpdateSteps() { UnknownSteps(); }
+void AppInstaller::PartialUninstallSteps() { UnknownSteps(); }
+void AppInstaller::ReadonlyUpdateInstallSteps() { UnknownSteps(); }
+void AppInstaller::ReadonlyUpdateUninstallSteps() { UnknownSteps(); }
+void AppInstaller::DisablePkgSteps() { UnknownSteps(); }
+void AppInstaller::EnablePkgSteps() { UnknownSteps(); }
+void AppInstaller::MigrateExtImgSteps() { UnknownSteps(); }
+void AppInstaller::UnknownSteps() {
+ AddStep<configuration::StepFail>();
+}
+
void AppInstaller::HandleStepError(Step::Status result,
const std::string& error) {
if (pi_)
PkgMgrPtr pkgmgr_;
std::unique_ptr<InstallerContext> context_;
+ void Init();
+
private:
std::list<std::unique_ptr<Step>> steps_;
+ virtual void InstallSteps();
+ virtual void UpdateSteps();
+ virtual void UninstallSteps();
+ virtual void ReinstallSteps();
+ virtual void DeltaSteps();
+ virtual void MoveSteps();
+ virtual void RecoverySteps();
+ virtual void MountInstallSteps();
+ virtual void MountUpdateSteps();
+ virtual void ManifestDirectInstallSteps();
+ virtual void ManifestDirectUpdateSteps();
+ virtual void ManifestPartialInstallSteps();
+ virtual void ManifestPartialUpdateSteps();
+ virtual void PartialUninstallSteps();
+ virtual void ReadonlyUpdateInstallSteps();
+ virtual void ReadonlyUpdateUninstallSteps();
+ virtual void DisablePkgSteps();
+ virtual void EnablePkgSteps();
+ virtual void MigrateExtImgSteps();
+ virtual void UnknownSteps();
+
// data used to send signal
std::unique_ptr<PkgmgrSignal> pi_;