From: Sangyoon Jang Date: Thu, 19 Oct 2017 12:09:14 +0000 (+0900) Subject: Set install location to internal when external storage is not available X-Git-Tag: accepted/tizen/4.0/unified/20171020.092832~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8917dcc9625efd2fcb4f314ae4e53c02eedceb5e;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Set install location to internal when external storage is not available Change-Id: If10270f36776d1151c99e0ff87bff217f776175f Signed-off-by: Sangyoon Jang --- diff --git a/src/common/step/filesystem/step_acquire_external_storage.cc b/src/common/step/filesystem/step_acquire_external_storage.cc index 519ca72..3aa4f2b 100644 --- a/src/common/step/filesystem/step_acquire_external_storage.cc +++ b/src/common/step/filesystem/step_acquire_external_storage.cc @@ -15,6 +15,7 @@ namespace { +const char kInstalledInternally[] = "installed_internal"; const char kInstalledExternally[] = "installed_external"; const char kInternalOnly[] = "internal-only"; const char kPreferExternal[] = "prefer-external"; @@ -54,14 +55,20 @@ Step::Status StepAcquireExternalStorage::process() { context_->unpacked_dir_path.get(), context_->uid.get()); + // TODO(jeremy.jang): This checking should be moved to + // StepCheckInstallLocation if (storage == Storage::EXTERNAL && !context_->external_storage) { if (!installed_) { LOG(WARNING) << "Cannot initialize external storage " << "for installed package"; - storage = Storage::INTERNAL; + context_->storage.set(Storage::INTERNAL); + free(manifest->installed_storage); + manifest->installed_storage = strdup(kInstalledInternally); } else { LOG(ERROR) << "Cannot initialize external storage for updated package"; - storage = Storage::INTERNAL; + context_->storage.set(Storage::INTERNAL); + free(manifest->installed_storage); + manifest->installed_storage = strdup(kInstalledInternally); } }