*
*/
#define _GNU_SOURCE
-#include <dlfcn.h>
#include <string.h>
#include <unistd.h>
#include <libxml/parser.h>
#include "pkgmgr_parser_db.h"
#include "pkgmgr_parser_debug.h"
-#define LIBAPPSVC_PATH LIB_PATH "/libappsvc.so.0"
-
-static int __ps_remove_appsvc_db(manifest_x *mfx, uid_t uid)
-{
- void *lib_handle = NULL;
- int (*appsvc_operation) (const char *, uid_t);
- int ret = 0;
- GList *tmp;
- application_x *application;
-
- lib_handle = dlopen(LIBAPPSVC_PATH, RTLD_LAZY);
- if (lib_handle == NULL) {
- _LOGE("dlopen is failed LIBAPPSVC_PATH[%s]\n", LIBAPPSVC_PATH);
- goto END;
- }
-
- appsvc_operation = dlsym(lib_handle, "appsvc_unset_defapp");
- if (appsvc_operation == NULL || dlerror() != NULL) {
- _LOGE("can not find symbol \n");
- goto END;
- }
-
- for (tmp = mfx->application; tmp; tmp = tmp->next) {
- application = (application_x *)tmp->data;
- if (application == NULL)
- continue;
- ret = appsvc_operation(application->appid, uid);
- if (ret < 0)
- _LOGE("can not operation symbol \n");
- }
-
-END:
- if (lib_handle)
- dlclose(lib_handle);
-
- return ret;
-}
-
API void pkgmgr_parser_free_manifest_xml(manifest_x *mfx)
{
pkgmgrinfo_basic_free_package((package_x *)mfx);
else
_LOGD("DB Delete Success\n");
- ret = __ps_remove_appsvc_db(mfx, uid);
- if (ret == -1)
- _LOGD("Removing appsvc_db failed\n");
- else
- _LOGD("Removing appsvc_db Success\n");
-
return PMINFO_R_OK;
}