From: Ilho Kim Date: Wed, 21 Sep 2022 10:35:03 +0000 (+0900) Subject: Fix Recovery of ReadonlyUpdateInstall package's update X-Git-Tag: accepted/tizen/7.0/unified/20221110.060011~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fappfw%2Fapp-installers.git;a=commitdiff_plain;h=68bf3d4069fb9bd6f139e2e0e993264541076636 Fix Recovery of ReadonlyUpdateInstall package's update Fix that the package system attribute is changed when recovery is performed becuase the installer is terminated during the update of the ReadonlyUpdateInstalled package Change-Id: I23d2afb9a73864f0da286bdb430cd792f583b833 Signed-off-by: Ilho Kim --- diff --git a/src/common/step/pkgmgr/step_recover_application.cc b/src/common/step/pkgmgr/step_recover_application.cc index ff51359..e33090d 100644 --- a/src/common/step/pkgmgr/step_recover_application.cc +++ b/src/common/step/pkgmgr/step_recover_application.cc @@ -30,7 +30,7 @@ Step::Status StepRecoverApplication::RecoveryUpdate() { PkgQueryInterface pkg_query(context_->pkgid.get(), context_->uid.get()); if (pkg_query.IsPreloadPackage()) SetExtAttrForPreloadPackage(pkg_query.IsUpdatedPackage(), - pkg_query.IsRemovablePackage()); + pkg_query.IsRemovablePackage(), pkg_query.IsSystemPackage()); UnregisterApplication(); if (!RegisterApplication()) { LOG(ERROR) << "Unsuccessful app registration"; @@ -44,7 +44,7 @@ Step::Status StepRecoverApplication::RecoveryReadonlyUpdateInstall() { LOG(ERROR) << "Some parameters are lacking"; return Status::ERROR; } - SetExtAttrForPreloadPackage(false, false); + SetExtAttrForPreloadPackage(false, false, true); UnregisterApplication(); if (!RegisterApplication()) { LOG(ERROR) << "Unsuccessful app registration"; @@ -67,14 +67,14 @@ bool StepRecoverApplication::SetXmlPaths() { } void StepRecoverApplication::SetExtAttrForPreloadPackage( - bool is_updated, bool is_removable) { + bool is_updated, bool is_removable, bool is_system) { manifest_x* manifest_data = context_->manifest_data.get(); free(manifest_data->preload); manifest_data->preload = strdup("true"); free(manifest_data->update); manifest_data->update = strdup(is_updated ? "true" : "false"); free(manifest_data->system); - manifest_data->system = strdup(is_removable ? "false" : "true"); + manifest_data->system = strdup(is_system ? "true" : "false"); free(manifest_data->readonly); manifest_data->readonly = strdup(is_removable ? "false" : "true"); free(manifest_data->removable); diff --git a/src/common/step/pkgmgr/step_recover_application.h b/src/common/step/pkgmgr/step_recover_application.h index 6cd40e6..b4fadd1 100644 --- a/src/common/step/pkgmgr/step_recover_application.h +++ b/src/common/step/pkgmgr/step_recover_application.h @@ -29,7 +29,8 @@ class StepRecoverApplication : public recovery::StepRecovery { private: bool SetXmlPaths(); - void SetExtAttrForPreloadPackage(bool is_updated, bool is_removable); + void SetExtAttrForPreloadPackage(bool is_updated, bool is_removable, + bool is_system); bool UnregisterApplication(); bool RegisterApplication();