2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "allowed-appid/plugin_manager.hh"
20 #include "common/log_private.hh"
23 #define API __attribute__ ((visibility("default")))
25 using namespace plugin;
27 extern "C" API int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char* pkgid,
28 const char* appid, GList* list)
30 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
31 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
32 EventType::Install, list);
33 PluginManager::GetInst().Do();
37 extern "C" API int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char* pkgid,
38 const char* appid, GList* list)
40 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
41 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
42 EventType::Uninstall, list);
43 PluginManager::GetInst().Do();
47 extern "C" API int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char* pkgid,
48 const char* appid, GList* list)
50 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
51 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
52 EventType::Upgrade, list);
53 PluginManager::GetInst().Do();
57 extern "C" API int PKGMGR_MDPARSER_PLUGIN_RECOVERINSTALL(const char* pkgid,
58 const char* appid, GList* list)
60 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
61 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
62 EventType::Uninstall, list);
63 PluginManager::GetInst().Do();
67 extern "C" API int PKGMGR_MDPARSER_PLUGIN_RECOVERUNINSTALL(const char* pkgid,
68 const char* appid, GList* list)
70 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
71 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
72 EventType::Uninstall, list);
73 PluginManager::GetInst().Do();
77 extern "C" API int PKGMGR_MDPARSER_PLUGIN_RECOVERUPGRADE(const char* pkgid,
78 const char* appid, GList* list)
80 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
81 PluginManager::GetInst().AddAppEventArgs(pkgid, appid,
82 EventType::Upgrade, list);
83 PluginManager::GetInst().Do();
87 extern "C" API int PKGMGR_MDPARSER_PLUGIN_CLEAN(const char* pkgid,
88 const char* appid, GList* list)
90 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
91 PluginManager::GetInst().Clean();
95 extern "C" API int PKGMGR_MDPARSER_PLUGIN_UNDO(const char* pkgid,
96 const char* appid, GList* list)
98 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);
99 PluginManager::GetInst().Undo();
103 extern "C" API int PKGMGR_MDPARSER_PLUGIN_REMOVED(const char* pkgid,
104 const char* appid, GList* list)
106 _W("[__ALLOWED_APPID__] pkgid(%s), appid(%s)", pkgid, appid);