Skip the security registration if it is unnecessary
[platform/core/appfw/app-installers.git] / src / common / step / security / step_register_security.cc
index 917be13..8c655f1 100644 (file)
@@ -38,6 +38,8 @@ Step::Status StepRegisterSecurity::precheck() {
 }
 
 Step::Status StepRegisterSecurity::process() {
+  AddRecoveryInfo();
+
   std::string error_message;
   if (context_->request_type.get() != RequestType::Move &&
       !RegisterSecurityContextForManifest(context_, &error_message)) {
@@ -62,5 +64,12 @@ Step::Status StepRegisterSecurity::process() {
   return Status::OK;
 }
 
+void StepRegisterSecurity::AddRecoveryInfo() {
+  recovery::RecoveryFile* recovery_file =
+      context_->recovery_info.get().recovery_file.get();
+  recovery_file->set_security_operation_done(true);
+  recovery_file->WriteAndCommitFileContent();
+}
+
 }  // namespace security
 }  // namespace common_installer