2 * Copyright (c) 2016 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.
17 #include "ni_common.h"
24 #define LOG_TAG "NETCORE_INSTALLER_PLUGIN"
31 typedef struct Metadata {
36 const std::string valueType = "true";
37 const std::string mdKey = "http://tizen.org/metadata/prefer_dotnet_aot";
38 extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *appId, GList *list)
42 Metadata *mdInfo = NULL;
43 tag = g_list_first(list);
45 mdInfo = (Metadata*)tag->data;
46 if (mdInfo->key == mdKey && mdInfo->value == valueType) {
47 _DBG("Prefer dotnet application AOT set TRUE");
50 tag = g_list_next(tag);
54 NiCommonOption option = {std::string(), std::string(), std::string()};
55 if (initNICommon(&option) < 0) {
56 _ERR("Fail to initialize NI Common");
60 if (createNiUnderPkgRoot(pkgId, false) != 0) {
61 _ERR("Failed to get root path from [%s]", pkgId);
64 _INFO("Complete make application to native image");
70 extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *appId, GList *list)
72 return PKGMGR_MDPARSER_PLUGIN_INSTALL(pkgId, appId, list);
75 extern "C" int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char *pkgId, const char *appId, GList *list)
80 extern "C" int PKGMGR_MDPARSER_PLUGIN_REMOVED(const char *pkgId, const char *appId, GList *list)
82 return PKGMGR_MDPARSER_PLUGIN_UPGRADE(pkgId, appId, list);
85 extern "C" int PKGMGR_MDPARSER_PLUGIN_CLEAN(const char *pkgId, const char *appId, GList *list)
90 extern "C" int PKGMGR_MDPARSER_PLUGIN_UNDO(const char *pkgId, const char *appId, GList *list)