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.
24 #include "launchpad_plugin.h"
25 #include "log_private.h"
27 #define PATH_LAUNCHPAD_PLUGIN "/usr/share/aul/plugin/liblaunchpad-plugin.so"
28 #define TAG_LAUNCHPAD_PLUGIN_PREPARE_APP "LAUNCHPAD_PLUGIN_PREPARE_APP"
30 int _launchpad_plugin_prepare_app(const char *app_id, bundle *kb)
33 int (*prepare_app)(const char *, bundle *);
36 ret = access(PATH_LAUNCHPAD_PLUGIN, F_OK);
39 _W("plugin module does not exist. errno(%d)", errno);
43 handle = dlopen(PATH_LAUNCHPAD_PLUGIN, RTLD_LAZY | RTLD_LOCAL);
45 _W("Failed to open plugin so. error(%s)", dlerror());
49 prepare_app = dlsym(handle, TAG_LAUNCHPAD_PLUGIN_PREPARE_APP);
51 _W("Failed to load %s", TAG_LAUNCHPAD_PLUGIN_PREPARE_APP);
56 _W("LAUNCHPAD_PLUGIN_PREPARE_APP ++");
57 ret = prepare_app(app_id, kb);
58 _W("LAUNCHPAD_PLUGIN_PREPARE_APP --");