step/configuration/step_configure.cc
step/configuration/step_fail.cc
step/configuration/step_parse_manifest.cc
+ step/configuration/step_parse_preload.cc
step/filesystem/step_acquire_external_storage.cc
step/filesystem/step_clear_data.cc
step/filesystem/step_copy.cc
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "common/step/configuration/step_parse_preload.h"
+
+#include <pkgmgr-info.h>
+#include <unistd.h>
+
+#include <boost/filesystem.hpp>
+
+#include <cstring>
+#include <cstdio>
+#include <string>
+
+#include "common/pkgmgr_interface.h"
+#include "common/utils/file_util.h"
+
+namespace bf = boost::filesystem;
+namespace ci = common_installer;
+
+namespace common_installer {
+namespace configuration {
+
+ci::Step::Status StepParsePreload::process() {
+ const char* preload_manifest_val = context_->manifest_data.get()->preload;
+
+ if (strcmp(preload_manifest_val, "true") != 0) {
+ bool is_preload = context_->is_preload_request.get();
+
+ LOG(INFO) << "is_preload : (" << is_preload << ")";
+ if (is_preload) {
+ context_->manifest_data.get()->preload = strdup("true");
+
+ if (getuid() != 0) {
+ LOG(ERROR) << "You're not authorized to install preload app: "
+ << context_->pkgid.get().c_str();
+ return Status::OPERATION_NOT_ALLOWED;
+ }
+ } else {
+ context_->manifest_data.get()->preload = strdup("false");
+ }
+ }
+
+ return Status::OK;
+}
+
+} // namespace configuration
+} // namespace common_installer
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_STEP_CONFIGURATION_STEP_PARSE_PRELOAD_H_
+#define COMMON_STEP_CONFIGURATION_STEP_PARSE_PRELOAD_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "common/installer_context.h"
+#include "common/step/step.h"
+
+namespace common_installer {
+namespace configuration {
+
+class StepParsePreload : public common_installer::Step {
+ public:
+ using Step::Step;
+
+ Status process() override;
+ Status clean() override { return Status::OK; }
+ Status undo() override { return Status::OK; }
+ Status precheck() override { return Status::OK; }
+
+ STEP_NAME(ParsePreload)
+};
+
+} // namespace configuration
+} // namespace common_installer
+
+#endif // COMMON_STEP_CONFIGURATION_STEP_PARSE_PRELOAD_H_