1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef COMMON_STEP_CONFIGURATION_STEP_CONFIGURE_H_
6 #define COMMON_STEP_CONFIGURATION_STEP_CONFIGURE_H_
8 #include <manifest_parser/utils/logging.h>
10 #include "common/installer_context.h"
12 #include "common/pkgmgr_interface.h"
13 #include "common/step/step.h"
15 namespace common_installer {
16 namespace configuration {
19 * \brief Installation,Update, Deinstallation, RDS.
20 * Responsible for filling InstallerContext based on the request type.
22 * Based on started request, process fills InstallerContext with proper data.
24 class StepConfigure : public Step {
29 * \param context pointer to InstallerContext structure
30 * \param pkgmgr pointer to Pkgmgr interface
32 StepConfigure(InstallerContext* context, PkgMgrPtr pkgmgr);
35 * \brief configuration based on pacakge typ, request mode, user
37 * \return Status::OK if success, Status::ERROR otherwise
39 Status process() override;
42 * \brief Recovery file reset
46 Status clean() override { return Status::OK; }
48 Status undo() override { return Status::OK; }
51 * \brief checks, if backend not launched with root uid
53 * \return Status::OK if normal user, Status::ERROR if root
55 Status precheck() override;
58 bool SetupRootAppDirectory();
59 void SetupRequestMode(uid_t uid);
60 void SetupRequestType();
61 void SetupFileCreationMask();
62 void SetupIsPreloadRequest();
63 void SetupIsPreloadRWRequest();
64 void SetupIsForceRemoval();
65 void SetupIsNoRemoval();
66 void SetupIsKeepRWData();
67 void SetupIsPartialRW();
68 void SetupDebugMode();
69 void SetupSkipCheckReference();
70 void SetupSkipOptimization();
72 std::string GetPkgIdFromFile();
73 bool CheckInvalidBackendUsage();
80 } // namespace configuration
81 } // namespace common_installer
83 #endif // COMMON_STEP_CONFIGURATION_STEP_CONFIGURE_H_