From d17021e793f2ef55a386b4d9cfb0883184381965 Mon Sep 17 00:00:00 2001 From: "junsuk77.oh" Date: Wed, 30 Jan 2013 15:42:11 +0900 Subject: [PATCH] add new api to enable on external memory using pkgid --- am_daemon/amd_appinfo.c | 6 ++++++ am_daemon/amd_appinfo.h | 1 + am_daemon/amd_launch.c | 27 +++++++-------------------- packaging/aul.spec | 2 +- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/am_daemon/amd_appinfo.c b/am_daemon/amd_appinfo.c index cc0ed86..29ab36f 100755 --- a/am_daemon/amd_appinfo.c +++ b/am_daemon/amd_appinfo.c @@ -29,6 +29,7 @@ enum _appinfo_idx { _AI_RESTART, _AI_MULTI, _AI_HWACC, + _AI_PKGID, _AI_MAX, }; #define _AI_START _AI_NAME /* start index */ @@ -47,6 +48,7 @@ static struct appinfo_t _appinfos[] = { [_AI_RESTART] = { "AutoRestart", AIT_RESTART, }, [_AI_MULTI] = { "Multiple", AIT_MULTI, }, [_AI_HWACC] = { "Hwacceleration", AIT_HWACC, }, + [_AI_PKGID] = { "PkgId", AIT_PKGID, }, }; struct appinfo { @@ -83,6 +85,7 @@ static int __app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void *d char *exec; char *type; char *appid; + char *pkgid; bool multiple; bool onboot; bool restart; @@ -154,6 +157,9 @@ static int __app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void *d r = pkgmgrinfo_appinfo_get_exec(handle, &exec); c->val[_AI_EXEC] = strdup(exec); + r = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid); + c->val[_AI_PKGID] = strdup(pkgid); + r = pkgmgrinfo_appinfo_get_apptype(handle, &type); if(strncmp(type, "capp", 4) == 0 ) { c->val[_AI_TYPE] = strdup("rpm"); diff --git a/am_daemon/amd_appinfo.h b/am_daemon/amd_appinfo.h index a5840f4..6330d91 100755 --- a/am_daemon/amd_appinfo.h +++ b/am_daemon/amd_appinfo.h @@ -13,6 +13,7 @@ enum appinfo_type { AIT_RESTART, /* auto restart: boolean */ AIT_MULTI, AIT_HWACC, + AIT_PKGID, }; int appinfo_init(struct appinfomgr **cf); diff --git a/am_daemon/amd_launch.c b/am_daemon/amd_launch.c index 7f90dc6..4111645 100755 --- a/am_daemon/amd_launch.c +++ b/am_daemon/amd_launch.c @@ -482,13 +482,11 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, int fd) char *multiple = NULL; char *app_path = NULL; char *pkg_type = NULL; + char *pkg_id = NULL; int pid = -1; char tmp_pid[MAX_PID_STR_BUFSZ]; char *hwacc; - int location = -1; - app2ext_handle *app2_handle = NULL; - if(strncmp(appid, "org.tizen.sat-ui", 18) == 0) { pid = __sat_ui_launch(appid, kb, cmd, caller_pid, fd); return pid; @@ -505,6 +503,12 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, int fd) componet = appinfo_get_value(ai, AIT_COMP); app_path = appinfo_get_value(ai, AIT_EXEC); pkg_type = appinfo_get_value(ai, AIT_TYPE); + pkg_id = appinfo_get_value(ai, AIT_PKGID); + + ret = app2ext_enable_external_pkg(pkg_id); + if (ret < 0) + _E("pass enable external pkg"); + if (componet && strncmp(componet, "ui", 2) == 0) { multiple = appinfo_get_value(ai, AIT_MULTI); if (!multiple || strncmp(multiple, "false", 5) == 0) { @@ -543,23 +547,6 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, int fd) _E("unkown application"); } - location = app2ext_get_app_location(appid); - if (location == APP2EXT_SD_CARD) - { - app2_handle = app2ext_init(APP2EXT_SD_CARD); - if (app2_handle == NULL) { - _E("app2_handle : app2ext init failed\n"); - return -1; - } - - ret = app2_handle->interface.enable(appid); - if (ret) { - _E("app2_handle : app enable API fail Reason %d", ret); - } - - app2ext_deinit(app2_handle); - } - __real_send(fd, pid); if(pid > 0) { diff --git a/packaging/aul.spec b/packaging/aul.spec index d9c80ce..baf54f7 100644 --- a/packaging/aul.spec +++ b/packaging/aul.spec @@ -1,6 +1,6 @@ Name: aul Summary: App utility library -Version: 0.0.238 +Version: 0.0.239 Release: 1 Group: System/Libraries License: Apache License, Version 2.0 -- 2.7.4