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")
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;
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;
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;
{
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;
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;
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;
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;
{
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;
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;
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;
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;
{
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;
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);
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");
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");
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");
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");
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");
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");
{
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;
{
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");
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");
<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>
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;
}
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
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(db-util)
BuildRequires: pkgconfig(xdgmime)
+BuildRequires: pkgconfig(glib-2.0)
%description
Application Information Library
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"
#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"
}
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);
return desktop;
}
-
-
static inline int _strlen_desktop_info(desktop_info_s* info)
{
int len = 0;
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)
return AIL_ERROR_OK;
}
-
+#if 0
static ail_error_e _modify_desktop_info_str(desktop_info_s* info,
const char *property,
const char *value)
return AIL_ERROR_OK;
}
-
-
-
+#endif
static ail_error_e _create_table(void)
{
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);
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);
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);
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)) {
}
ai = appinfo_create();
- if (ai == NULL)
- return AIL_ERROR_OUT_OF_MEMORY;
appinfo_set_stmt(ai, stmt);
while (db_step(stmt) == AIL_ERROR_OK) {
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);
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;
}
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;
}
void appinfo_set_stmt(ail_appinfo_h ai, sqlite3_stmt *stmt)
{
+ if (ai == NULL)
+ return;
+
ai->stmt = stmt;
}
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;
}
end:
(ai)->stmt = NULL;
sqlite3_free(w);
+
return ret;
}
}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;
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");
}
}
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");
}
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
+#include <glib.h>
#include "ail.h"
#include "ail_private.h"
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) {