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_PKGMGR_REGISTRATION_H_
6 #define COMMON_PKGMGR_REGISTRATION_H_
8 #include <pkgmgr-info.h>
14 #include "common/installer_context.h"
16 namespace common_installer {
19 * \brief Adapter interface for external PkgMgr module used for registering
22 * \param manifest parsed manifest information
23 * \param pkgid package pkgid
25 * \param storage install storage
26 * \param request_mode current request mode
28 * \return true if success
30 bool RegisterAppInPkgmgr(manifest_x* manifest,
31 const std::string& pkgid,
32 const CertificateInfo& cert_info,
35 RequestMode request_mode,
36 const std::filesystem::path& tep_path);
39 * \brief Adapter interface for external PkgMgr module used for upgrading
40 * package within pkgmgr
42 * \param manifest parsed manifest information
43 * \param pkgid package pkgid
44 * \param cert_info certifciate info
46 * \param storage install storage
47 * \param request_mode current request mode
49 * \return true if success
51 bool UpgradeAppInPkgmgr(manifest_x* manifest,
52 const std::string& pkgid,
53 const CertificateInfo& cert_info,
56 RequestMode request_mode);
59 * \brief Adapter interface for external PkgMgr module used for deregistering
60 * package into pkgmgr for pkgid
62 * \param pkgid unregistered package pkgid
64 * \param request_mode current request mode
66 * \return true if success
68 bool UnregisterAppInPkgmgrForPkgId(const std::string& pkgid, uid_t uid,
69 RequestMode request_mode);
72 * \brief Adapter interface for external PkgMgr module used for deregistering
75 * \param manifest parsed manifest information
76 * \param pkgid package pkgid
78 * \param request_mode current request mode
80 * \return true if success
82 bool UnregisterAppInPkgmgr(manifest_x* manifest,
83 const std::string& pkgid,
85 RequestMode request_mode);
88 * \brief Adapter interface for external PkgMgr module used for updating
89 * tep info about package within pkgmgr
91 * \param tep_path path of tep file
92 * \param pkgid package pkgid
94 * \param request_mode current request mode
96 * \return true if success
98 bool UpdateTepInfoInPkgmgr(const std::filesystem::path& tep_path,
99 const std::string& pkgid,
101 RequestMode request_mode);
104 * \brief Adapter interface for external PkgMgr module used for updating
105 * installed storage info about package within pkgmgr
107 * \param storage installed storage of package
108 * \param ext_path external/extended path of package
109 * \param pkgid package pkgid
112 * \return true if success
114 bool UpdateInstalledStorageInPkgmgr(Storage storage,
115 const std::filesystem::path& ext_path,
116 const std::string& pkgid,
120 * \brief Adapter interface for external PkgMgr module used for updating
121 * pkg disable info about package within pkgmgr
123 * \param pkgid package pkgid
125 * \param request_mode current request mode
127 * \return true if success
129 bool DisablePkgInPkgmgr(const std::string& pkgid, uid_t uid,
130 RequestMode request_mode);
133 * \brief Adapter interface for external PkgMgr module used for updating
134 * pkg enable info about package within pkgmgr
136 * \param pkgid package pkgid
138 * \param request_mode current request mode
140 * \return true if success
142 bool EnablePkgInPkgmgr(const std::string& pkgid, uid_t uid,
143 RequestMode request_mode);
146 * \brief Adapter interface for inserting pkg plugin execution info
148 * \param manifest parsed manifest information
150 * \param request_mode current request mode
152 * \return true if success
154 bool RegisterPluginInfo(manifest_x* manifest,
156 RequestMode request_mode);
159 * \brief Adapter interface for updating pkg plugin execution info
161 * \param manifest parsed manifest information
163 * \param request_mode current request mode
165 * \return true if success
167 bool UpdatePluginInfo(manifest_x* manifest,
169 RequestMode request_mode);
172 * \brief Adapter interface for deleting pkg plugin execution info
174 * \param pkgid package ID
176 * \param request_mode current request mode
178 * \return true if success
180 bool UnregisterPluginInfo(const std::string& pkgid,
182 RequestMode request_mode);
183 } // namespace common_installer
185 #endif // COMMON_PKGMGR_REGISTRATION_H_