add new api to enable on external memory using pkgid
authorjunsuk77.oh <junsuk77.oh@samsung.com>
Wed, 30 Jan 2013 06:42:11 +0000 (15:42 +0900)
committerjunsuk77.oh <junsuk77.oh@samsung.com>
Wed, 30 Jan 2013 06:42:11 +0000 (15:42 +0900)
am_daemon/amd_appinfo.c
am_daemon/amd_appinfo.h
am_daemon/amd_launch.c
packaging/aul.spec

index cc0ed86..29ab36f 100755 (executable)
@@ -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");
index a5840f4..6330d91 100755 (executable)
@@ -13,6 +13,7 @@ enum appinfo_type {
        AIT_RESTART, /* auto restart: boolean */
        AIT_MULTI,
        AIT_HWACC,
+       AIT_PKGID,
 };
 
 int appinfo_init(struct appinfomgr **cf);
index 7f90dc6..4111645 100755 (executable)
@@ -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) {
index d9c80ce..baf54f7 100644 (file)
@@ -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