tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.034237 submit/tizen_2.4/20151028.063749 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:28:22 +0000 (16:28 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 07:28:22 +0000 (16:28 +0900)
19 files changed:
CMakeLists.txt
TC/unit/utc_ApplicationFW_ail_appinfo_get_bool_func.c
TC/unit/utc_ApplicationFW_ail_appinfo_get_int_func.c
TC/unit/utc_ApplicationFW_ail_appinfo_get_str_func.c
TC/unit/utc_ApplicationFW_ail_desktop_add_func.c
TC/unit/utc_ApplicationFW_ail_desktop_remove_func.c
TC/unit/utc_ApplicationFW_ail_desktop_update_func.c
TC/unit/utc_ApplicationFW_ail_filter_add_str_func.c
TC/unit/utc_ApplicationFW_ail_package_destroy_appinfo_func.c
TC/unit/utc_ApplicationFW_ail_package_get_appinfo_func.c
ail.manifest
include/ail.h
packaging/ail.spec
src/ail_desktop.c
src/ail_filter.c
src/ail_package.c
tool/src/ail_desktop.c
tool/src/ail_package.c
tool/src/initdb.c

index 08590a7..7cd73c6 100644 (file)
@@ -30,7 +30,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
 
-pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf)
+pkg_check_modules(LPKGS REQUIRED glib-2.0 sqlite3 dlog db-util xdgmime vconf glib-2.0)
 STRING(REPLACE ";" " " EXTRA_CFLAGS "${LPKGS_CFLAGS}")
 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
 
index 41f5189..c652038 100755 (executable)
@@ -81,7 +81,7 @@ static void utc_ApplicationFW_ail_appinfo_get_bool_func_01(void)
        ail_appinfo_h handle;
        ail_error_e r;
        bool value = 0;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -106,7 +106,7 @@ static void utc_ApplicationFW_ail_appinfo_get_bool_func_02(void)
        ail_error_e r;
        ail_prop_bool_e prop = AIL_PROP_BOOL_MIN - 1;
        bool value = 0;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -131,7 +131,7 @@ static void utc_ApplicationFW_ail_appinfo_get_bool_func_03(void)
        ail_error_e r;
        ail_prop_bool_e prop = AIL_PROP_BOOL_MAX + 1;
        bool value = 0;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -154,7 +154,7 @@ static void utc_ApplicationFW_ail_appinfo_get_bool_func_04(void)
 {
        ail_appinfo_h handle;
        ail_error_e r;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
index 78b17b7..b81c595 100755 (executable)
@@ -81,7 +81,7 @@ static void utc_ApplicationFW_ail_appinfo_get_int_func_01(void)
        ail_appinfo_h handle;
        ail_error_e r;
        int value = -1;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -107,7 +107,7 @@ static void utc_ApplicationFW_ail_appinfo_get_int_func_02(void)
        ail_error_e r;
        ail_prop_int_e prop = AIL_PROP_INT_MIN - 1;
        int value = -1;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -132,7 +132,7 @@ static void utc_ApplicationFW_ail_appinfo_get_int_func_03(void)
        ail_error_e r;
        ail_prop_int_e prop = AIL_PROP_INT_MAX + 1;
        int value = -1;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -155,7 +155,7 @@ static void utc_ApplicationFW_ail_appinfo_get_int_func_04(void)
 {
        ail_appinfo_h handle;
        ail_error_e r;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
index dc729aa..1388626 100755 (executable)
@@ -84,7 +84,7 @@ static void utc_ApplicationFW_ail_appinfo_get_str_func_01(void)
        ail_appinfo_h handle;
        ail_error_e r;
        char *value;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -109,7 +109,7 @@ static void utc_ApplicationFW_ail_appinfo_get_str_func_02(void)
        ail_error_e r;
        ail_prop_str_e prop = AIL_PROP_STR_MIN - 1;
        char *value;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -134,7 +134,7 @@ static void utc_ApplicationFW_ail_appinfo_get_str_func_03(void)
        ail_error_e r;
        ail_prop_str_e prop = AIL_PROP_STR_MAX + 1;
        char *value;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
@@ -157,7 +157,7 @@ static void utc_ApplicationFW_ail_appinfo_get_str_func_04(void)
 {
        ail_appinfo_h handle;
        ail_error_e r;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
index 887d85c..d3928bb 100755 (executable)
@@ -68,7 +68,7 @@ static void cleanup(void)
 static void utc_ApplicationFW_ail_desktop_add_func_01(void)
 {
        ail_error_e r;
-       r = ail_desktop_add("com.samsung.calculator");
+       r = ail_desktop_add("org.tizen.calculator");
        if (r != AIL_ERROR_OK) {
                tet_infoline("ail_desktop_add() failed in positive test case");
                tet_result(TET_FAIL);
index e6e79c0..8ae3f16 100755 (executable)
@@ -68,7 +68,7 @@ static void cleanup(void)
 static void utc_ApplicationFW_ail_desktop_remove_func_01(void)
 {
        ail_error_e r;
-       r = ail_desktop_remove("com.samsung.calculator");
+       r = ail_desktop_remove("org.tizen.calculator");
        if (r != AIL_ERROR_OK) {
                tet_infoline
                    ("ail_desktop_remove() failed in positive test case");
index 235b3eb..4226c35 100755 (executable)
@@ -68,7 +68,7 @@ static void cleanup(void)
 static void utc_ApplicationFW_ail_desktop_update_func_01(void)
 {
        ail_error_e r;
-       r = ail_desktop_update("com.samsung.calculator");
+       r = ail_desktop_update("org.tizen.calculator");
        if (r != AIL_ERROR_OK) {
                tet_infoline
                    ("ail_desktop_update() failed in positive test case");
index 669ab0f..f901a8f 100755 (executable)
@@ -83,7 +83,7 @@ static void utc_ApplicationFW_ail_filter_add_str_func_01(void)
                return;
        }
        r = ail_filter_add_str(filter, AIL_PROP_PACKAGE_STR,
-                              "com.samsung.memo");
+                              "org.tizen.memo");
        if (r != AIL_ERROR_OK) {
                tet_infoline
                    ("ail_filter_add_str() failed in positive test case");
@@ -107,7 +107,7 @@ static void utc_ApplicationFW_ail_filter_add_str_func_02(void)
                tet_result(TET_UNINITIATED);
                return;
        }
-       r = ail_filter_add_str(filter, prop, "com.samsung.memo");
+       r = ail_filter_add_str(filter, prop, "org.tizen.memo");
        if (r != AIL_ERROR_INVALID_PARAMETER) {
                tet_infoline
                    ("ail_filter_add_str() failed in negative test case");
@@ -131,7 +131,7 @@ static void utc_ApplicationFW_ail_filter_add_str_func_03(void)
                tet_result(TET_UNINITIATED);
                return;
        }
-       r = ail_filter_add_str(filter, prop, "com.samsung.memo");
+       r = ail_filter_add_str(filter, prop, "org.tizen.memo");
        if (r != AIL_ERROR_INVALID_PARAMETER) {
                tet_infoline
                    ("ail_filter_add_str() failed in negative test case");
@@ -154,7 +154,7 @@ static void utc_ApplicationFW_ail_filter_add_str_func_04(void)
                tet_result(TET_UNINITIATED);
                return;
        }
-       r = ail_filter_add_str(NULL, AIL_PROP_PACKAGE_STR, "com.samsung.memo");
+       r = ail_filter_add_str(NULL, AIL_PROP_PACKAGE_STR, "org.tizen.memo");
        if (r != AIL_ERROR_INVALID_PARAMETER) {
                tet_infoline
                    ("ail_filter_add_str() failed in negative test case");
index a1adc8f..024691b 100755 (executable)
@@ -73,7 +73,7 @@ static void utc_ApplicationFW_ail_package_destroy_appinfo_func_01(void)
 {
        ail_error_e r;
        ail_appinfo_h handle;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_result(TET_UNINITIATED);
                return;
index cda4f7d..f25ff1c 100755 (executable)
@@ -80,7 +80,7 @@ static void utc_ApplicationFW_ail_package_get_appinfo_func_01(void)
 {
        ail_error_e r;
        ail_appinfo_h handle;
-       r = ail_package_get_appinfo("com.samsung.calculator", &handle);
+       r = ail_package_get_appinfo("org.tizen.calculator", &handle);
        if (r != AIL_ERROR_OK) {
                tet_infoline
                    ("ail_package_get_appinfo() failed in positive test case");
@@ -114,7 +114,7 @@ static void utc_ApplicationFW_ail_package_get_appinfo_func_02(void)
 static void utc_ApplicationFW_ail_package_get_appinfo_func_03(void)
 {
        ail_error_e r;
-       r = ail_package_get_appinfo("com.samsung.calculator", NULL);
+       r = ail_package_get_appinfo("org.tizen.calculator", NULL);
        if (r != AIL_ERROR_INVALID_PARAMETER) {
                tet_infoline
                    ("ail_package_get_appinfo() failed in negative test case");
index 29c687a..4dfdc8a 100644 (file)
@@ -13,5 +13,6 @@
                <filesystem path="/usr/bin/ail_filter" label="_" exec_label="none"/>
                <filesystem path="/usr/bin/ail_initdb" label="_" exec_label="none"/>
                <filesystem path="/usr/bin/ail_package" label="_" exec_label="none"/>
+               <filesystem path="/usr/bin/ail_test" label="_" exec_label="none"/>
        </assign>
 </manifest>
index f08d7e0..8186512 100755 (executable)
@@ -319,7 +319,7 @@ int count_apps()
                return -1;
        }
 
-       ret = ail_filter_add_str(filter, AIL_PROP_PACKAGE_STR, "com.samsung.memo");
+       ret = ail_filter_add_str(filter, AIL_PROP_PACKAGE_STR, "org.tizen.memo";
        if (ret != AIL_ERROR_OK) {
                return -1;
        }
index 47c010c..45e8039 100755 (executable)
@@ -4,7 +4,7 @@ Summary:    Application Information Library
 Version:    0.2.95
 Release:    1
 Group:      System/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -15,6 +15,7 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(db-util)
 BuildRequires:  pkgconfig(xdgmime)
+BuildRequires:  pkgconfig(glib-2.0)
 
 %description
 Application Information Library
@@ -50,8 +51,6 @@ mkdir -p %{buildroot}/usr/share/license
 cp LICENSE %{buildroot}/usr/share/license/%{name}
 
 %post
-vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
-vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
 
 CHDBGID="6010"
 
index dd9157a..14db8f7 100755 (executable)
@@ -39,6 +39,7 @@
 #include "ail_sql.h"
 #include "ail.h"
 #include "ail_convert.h"
+#include "db-util.h"
 
 #define OPT_DESKTOP_DIRECTORY "/opt/share/applications"
 #define USR_DESKTOP_DIRECTORY "/usr/share/applications"
@@ -141,14 +142,13 @@ static ail_error_e _read_exec(void *data, char *tag, char *value)
        }
 
        token_exe_path = strtok_r(temp_exec, argsdelimiter, &save_ptr);
-       if (token_exe_path) {
-               info->x_slp_exe_path = strdup(token_exe_path);
-               if(!info->x_slp_exe_path) {
-                       free(info->exec);
-                       info->exec = NULL;
-                       free(temp_exec);
-                       return AIL_ERROR_OUT_OF_MEMORY;
-               }
+
+       info->x_slp_exe_path = strdup(token_exe_path);
+       if(!info->x_slp_exe_path) {
+               free(info->exec);
+               info->exec = NULL;
+               free(temp_exec);
+               return AIL_ERROR_OUT_OF_MEMORY;
        }
 
        free(temp_exec);
@@ -821,8 +821,6 @@ char *_pkgname_to_desktop(const char *package)
        return desktop;
 }
 
-
-
 static inline int _strlen_desktop_info(desktop_info_s* info)
 {
        int len = 0;
@@ -852,16 +850,20 @@ static inline int _strlen_desktop_info(desktop_info_s* info)
        return len;
 }
 
-
 int __is_ail_initdb(void)
 {
-       if( getenv("AIL_INITDB") || getenv("INITDB") )
-               return 1;
-       else
-               return 0;
-}
+       int ret = 0;
+       gchar **envp = g_get_environ();
 
+       if (envp) {
+               if (g_environ_getenv(envp, "AIL_INITDB") || g_environ_getenv(envp, "INITDB"))
+                       ret = 1;
 
+               g_strfreev(envp);
+       }
+
+       return ret;
+}
 
 /* Manipulating desktop_info functions */
 static ail_error_e _init_desktop_info(desktop_info_s *info, const char *package)
@@ -1109,7 +1111,7 @@ static ail_error_e _modify_desktop_info_bool(desktop_info_s* info,
        return AIL_ERROR_OK;
 }
 
-
+#if 0
 static ail_error_e _modify_desktop_info_str(desktop_info_s* info,
                                                  const char *property,
                                                  const char *value)
@@ -1144,9 +1146,7 @@ static ail_error_e _modify_desktop_info_str(desktop_info_s* info,
 
        return AIL_ERROR_OK;
 }
-
-
-
+#endif
 
 static ail_error_e _create_table(void)
 {
@@ -1513,8 +1513,6 @@ static ail_error_e _send_db_done_noti(noti_type type, const char *package)
        retv_if(!noti_string, AIL_ERROR_OUT_OF_MEMORY);
 
        snprintf(noti_string, size, "%s:%s", type_string, package);
-       vconf_set_str(VCONFKEY_AIL_INFO_STATE, noti_string);
-       vconf_set_str(VCONFKEY_MENUSCREEN_DESKTOP, noti_string); // duplicate, will be removed
        _D("Noti : %s", noti_string);
 
        free(noti_string);
@@ -1801,7 +1799,6 @@ EXPORT_API ail_error_e ail_desktop_appinfo_modify_str(const char *appid,
        retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
 
        ail_error_e ret = 0;
-       sqlite3_stmt *stmt = NULL;
        sqlite3 *appinfo_db = NULL;
 
        _D("appinfo_modify_str : %s,  %s", appid, value);
@@ -1813,7 +1810,7 @@ EXPORT_API ail_error_e ail_desktop_appinfo_modify_str(const char *appid,
        ret = sqlite3_exec(appinfo_db, query, NULL, NULL, NULL);
        sqlite3_free(query);
 
-       query = sqlite3_mprintf("insert into package_app_app_control(app_id, app_control) values('%s', '%s')", appid, value);
+       query = sqlite3_mprintf("insert into package_app_app_control(app_id, app_control) values('%q', '%q')", appid, value);
        ret = sqlite3_exec(appinfo_db, query, NULL, NULL, NULL);
        sqlite3_free(query);
        retv_if(ret != AIL_ERROR_OK, AIL_ERROR_DB_FAILED);
index da593b8..1df4b0f 100755 (executable)
@@ -238,9 +238,9 @@ char *_get_where_clause(ail_filter_h filter)
 
                strncat(w, c, sizeof(w)-strlen(w)-1);
                w[sizeof(w)-1] = '\0';
-               if (c) {
-                       free(c);
-                       c = NULL;
+               if(c) {
+                        free(c);
+                        c = NULL;
                }
 
                if (g_slist_next(l)) {
@@ -393,8 +393,6 @@ EXPORT_API ail_error_e ail_filter_list_appinfo_foreach(ail_filter_h filter, ail_
        }
 
        ai = appinfo_create();
-       if (ai == NULL)
-               return AIL_ERROR_OUT_OF_MEMORY;
 
        appinfo_set_stmt(ai, stmt);
        while (db_step(stmt) == AIL_ERROR_OK) {
index 5f86276..c3843ef 100755 (executable)
@@ -153,21 +153,21 @@ char* _get_mimetype_from_package_app_app_svc(const char *appid)
        char *mime = NULL;
 
        char *query = sqlite3_mprintf("select package_app_app_svc.mime_type from package_app_app_svc where package_app_app_svc.app_id=%Q", appid);
-       if (NULL == query){
+       if (NULL == query) {
                _E("Memory allocation failed");
                return NULL;
        }
        retv_if (db_prepare(query, &stmt) < 0, NULL);
 
-       while (db_step(stmt) == AIL_ERROR_OK){
+       while (db_step(stmt) == AIL_ERROR_OK) {
                val = (char*)sqlite3_column_text(stmt, col);
 
                if (!strlen(val) )
                        continue;
 
-               strcat(tmp_mime, val);
-               if(strlen(tmp_mime))
-                       strcat(tmp_mime, del);
+               strncat(tmp_mime, val, MAX_SIZE - strlen(tmp_mime));
+               if (strlen(tmp_mime))
+                       strncat(tmp_mime, del, MAX_SIZE - strlen(tmp_mime));
        }
 
        len = strlen(tmp_mime);
@@ -176,17 +176,17 @@ char* _get_mimetype_from_package_app_app_svc(const char *appid)
 
        db_finalize(stmt);
        sqlite3_free(query);
-       if(len >0){
+       if (len > 0) {
                mime = strdup(tmp_mime);
-               if(NULL == mime){
+               if (mime == NULL) {
                        _E("Memory Allocation Failed");
                        return NULL;
-               }else{
+               } else {
                        return mime;
                }
-       }else{
-               return NULL;
        }
+
+       return NULL;
 }
 
 
@@ -281,7 +281,7 @@ static char* __convert_syslocale_to_manifest_locale(char *syslocale)
                return NULL;
        }
 
-       sprintf(locale, "%c%c-%c%c", syslocale[0], syslocale[1], tolower(syslocale[3]), tolower(syslocale[4]));
+       snprintf(locale, 6, "%c%c-%c%c", syslocale[0], syslocale[1], tolower(syslocale[3]), tolower(syslocale[4]));
        return locale;
 }
 
@@ -409,6 +409,9 @@ int _appinfo_check_installed_storage(ail_appinfo_h ai)
 
 void appinfo_set_stmt(ail_appinfo_h ai, sqlite3_stmt *stmt)
 {
+       if (ai == NULL)
+               return;
+
        ai->stmt = stmt;
 }
 
@@ -599,29 +602,31 @@ static ail_error_e __ail_get_appinfo_new_mimetype(const char *appid, ail_appinfo
 
        appinfo_set_stmt(ai, stmt);
 
-       if(ai->values[E_AIL_PROP_MIMETYPE_STR]){
+       if (ai->values[E_AIL_PROP_MIMETYPE_STR]){
                free((void*)ai->values[E_AIL_PROP_MIMETYPE_STR]);
                ai->values[E_AIL_PROP_MIMETYPE_STR] = NULL;
        }
-       ai->values[E_AIL_PROP_MIMETYPE_STR] = (char*) calloc(MAX_SIZE,1);
-       if (NULL == ai->values[E_AIL_PROP_MIMETYPE_STR]){
+
+       ai->values[E_AIL_PROP_MIMETYPE_STR] = (char*) calloc(MAX_SIZE, 1);
+       if (NULL == ai->values[E_AIL_PROP_MIMETYPE_STR]) {
                _E("Memory allocation failed");
                ret = AIL_ERROR_OUT_OF_MEMORY;
                goto end;
        }
 
-       while (db_step(stmt) == AIL_ERROR_OK){
+       while (db_step(stmt) == AIL_ERROR_OK) {
                val = (char*)sqlite3_column_text(stmt, col);
 
-               if (!strlen(val) )
+               if (!strlen(val))
                        continue;
 
-               strcat(ai->values[E_AIL_PROP_MIMETYPE_STR], val);
-               if(strlen(ai->values[E_AIL_PROP_MIMETYPE_STR]))
-               strcat(ai->values[E_AIL_PROP_MIMETYPE_STR], del);
+               strncat(ai->values[E_AIL_PROP_MIMETYPE_STR], val, MAX_SIZE - strlen(ai->values[E_AIL_PROP_MIMETYPE_STR]));
+
+               if (strlen(ai->values[E_AIL_PROP_MIMETYPE_STR]))
+                       strncat(ai->values[E_AIL_PROP_MIMETYPE_STR], del, MAX_SIZE - strlen(ai->values[E_AIL_PROP_MIMETYPE_STR]));
        }
 
-       if (db_finalize(ai->stmt) != AIL_ERROR_OK){
+       if (db_finalize(ai->stmt) != AIL_ERROR_OK) {
                ret =  AIL_ERROR_DB_FAILED;
                goto end;
        }
@@ -629,6 +634,7 @@ static ail_error_e __ail_get_appinfo_new_mimetype(const char *appid, ail_appinfo
 end:
        (ai)->stmt = NULL;
        sqlite3_free(w);
+
        return ret;
 }
 
@@ -696,18 +702,13 @@ EXPORT_API ail_error_e ail_get_appinfo(const char *appid, ail_appinfo_h *ai)
        }else{
                if (!(strcmp((*ai)->values[E_AIL_PROP_ICON_STR], "(NULL)"))){
                        ret = __ail_get_appinfo_new_icon(appid, *ai);
-                       if (ret != AIL_ERROR_OK) {
+                       if(ret != AIL_ERROR_OK)
                                _E("icon not retrieved");
-                               appinfo_destroy(*ai);
-                               return ret;
-                       }
                }
 
                ret = __ail_get_appinfo_new_mimetype(appid, *ai);
-               if (ret != AIL_ERROR_OK) {
+               if(ret != AIL_ERROR_OK)
                        _E("Mimetype not retrieved");
-                       appinfo_destroy(*ai);
-               }
        }
 
        return ret;
index 9d7ed84..a081f67 100644 (file)
@@ -33,17 +33,17 @@ static void _print_help(const char *cmd)
        fprintf(stderr, "[Add a desktop]\n");
        fprintf(stderr, "       %s add <PACKAGE NAME>\n", cmd);
        fprintf(stderr, "\n");
-       fprintf(stderr, "       Ex) %s add com.samsung.menu-screen\n", cmd);
+       fprintf(stderr, "       Ex) %s add org.tizen.menu-screen\n", cmd);
        fprintf(stderr, "\n");
        fprintf(stderr, "[Update a desktop]\n");
        fprintf(stderr, "       %s update <PACKAGE NAME>\n", cmd);
        fprintf(stderr, "\n");
-       fprintf(stderr, "       Ex) %s update com.samsung.menu-screen\n", cmd);
+       fprintf(stderr, "       Ex) %s update org.tizen.menu-screen\n", cmd);
        fprintf(stderr, "\n");
        fprintf(stderr, "[Remove a desktop]\n");
        fprintf(stderr, "       %s remove <PACKAGE NAME>\n", cmd);
        fprintf(stderr, "\n");
-       fprintf(stderr, "       Ex) %s remove com.samsung.menu-screen\n", cmd);
+       fprintf(stderr, "       Ex) %s remove org.tizen.menu-screen\n", cmd);
        fprintf(stderr, "\n");
 }
 
index b0fdf18..481bc14 100644 (file)
@@ -71,7 +71,7 @@ static void _print_help(const char *cmd)
        }
 
        fprintf(stderr, "\n");
-       fprintf(stderr, "       Ex) %s get com.samsung.menu-screen X_SLP_SERVICE\n", cmd);
+       fprintf(stderr, "       Ex) %s get org.tizen.menu-screen X_SLP_SERVICE\n", cmd);
        fprintf(stderr, "\n");
 }
 
index 94805ef..19393d9 100755 (executable)
@@ -30,6 +30,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
+#include <glib.h>
 
 #include "ail.h"
 #include "ail_private.h"
@@ -254,8 +255,12 @@ int main(int argc, char *argv[])
        const char *argv_rmjn[] = { "/bin/rm", APP_INFO_DB_FILE_JOURNAL, NULL };
        xsystem(argv_rmjn);
 
-       ret = setenv("AIL_INITDB", "1", 1);
-       _D("AIL_INITDB : %d", ret);
+       gchar **envp = g_get_environ();
+       if (envp) {
+               envp = g_environ_setenv(envp, "AIL_INITDB", "1", TRUE);
+               _D("AIL_INITDB : %s", g_environ_getenv(envp, "AIL_INITDB"));
+               g_strfreev(envp);
+       }
 
        ret = initdb_count_app();
        if (ret > 0) {