merge with master
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:12:24 +0000 (01:12 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:12:24 +0000 (01:12 +0900)
CMakeLists.txt
include/SLP_AIL_PG.h
include/ail.h
initdb/src/initdb.c
packaging/ail.spec
src/ail_convert.c
src/ail_desktop.c
src/ail_private.h
src/ail_sql.c
src/ail_sql.h

index ae99411..b45dff6 100644 (file)
@@ -46,8 +46,8 @@ SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
 
 # Install
-INSTALL(TARGETS ${LIBNAME} DESTINATION lib)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
+INSTALL(TARGETS ${LIBNAME} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/ail.h DESTINATION include)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/desktop.conf DESTINATION share/install-info)
 
index 6cb6606..a45be1d 100755 (executable)
@@ -109,7 +109,7 @@ There are three types of API's provided by AIL
 #define AIL_PROP_X_SLP_TASKMANAGE_BOOL          "AIL_PROP_X_SLP_TASKMANAGE_BOOL"
 #define AIL_PROP_X_SLP_MULTIPLE_BOOL            "AIL_PROP_X_SLP_MULTIPLE_BOOL"
 #define AIL_PROP_X_SLP_REMOVABLE_BOOL           "AIL_PROP_X_SLP_REMOVABLE_BOOL"
-#define AIL_PROP_X_SLP_INACTIVATED_BOOL         "AIL_PROP_X_SLP_INACTIVATED_BOOL"
+#define AIL_PROP_X_SLP_ENABLED_BOOL         "AIL_PROP_X_SLP_ENABLED_BOOL"
 
 
 @brief A handle for filters
index 7faaae4..04dea5c 100755 (executable)
@@ -87,7 +87,8 @@ extern "C" {
 #define        AIL_PROP_X_SLP_TASKMANAGE_BOOL          "AIL_PROP_X_SLP_TASKMANAGE_BOOL"
 #define        AIL_PROP_X_SLP_MULTIPLE_BOOL            "AIL_PROP_X_SLP_MULTIPLE_BOOL"
 #define        AIL_PROP_X_SLP_REMOVABLE_BOOL           "AIL_PROP_X_SLP_REMOVABLE_BOOL"
-#define        AIL_PROP_X_SLP_INACTIVATED_BOOL         "AIL_PROP_X_SLP_INACTIVATED_BOOL"
+#define        AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL   "AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL"
+#define        AIL_PROP_X_SLP_ENABLED_BOOL             "AIL_PROP_X_SLP_ENABLED_BOOL"
 
 
 /**
@@ -1095,6 +1096,56 @@ static ail_error_e _remove_desktop(const char *appid)
  */
 ail_error_e ail_desktop_remove(const char *appid);
 
+
+/**
+ * @fn ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast)
+ *
+ * @brief update a app information db.
+       And a notification is published to the applications who want to know about changing DB.
+ *
+ * @par Sync (or) Async : Synchronous API.
+ *
+ * @param[in] appid
+ *
+ * @return 0 if success, negative value(<0) if fail\n
+ * @retval     AIL_ERROR_OK                                    success
+ * @retval     AIL_ERROR_FAIL                                  internal error
+ * @retval     AIL_ERROR_INVALID_PARAMETER             invalid parameter
+ *
+ * @pre no pre-condition.
+ * @post app information is removed in the Application Information Database.
+ *
+ *
+ * @par Prospective Clients:
+ * External Apps.
+ *
+ * @code
+static ail_error_e _appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast)
+{
+       ail_error_e ret;
+
+       if (!appid) {
+               return AIL_ERROR_FAIL;
+       }
+       if (!property) {
+               return AIL_ERROR_FAIL;
+       }
+       if (!value) {
+               return AIL_ERROR_FAIL;
+       }
+
+       ret = ail_desktop_appinfo_modify_str(appid, property, value, broadcast);
+       if (ret != AIL_ERROR_OK) {
+               return AIL_ERROR_FAIL;
+       }
+
+       return AIL_ERROR_OK;
+}
+ * @endcode
+ */
+
+ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast);
+
 /** @} */
 
 
index 160d08b..7e644d5 100755 (executable)
@@ -199,6 +199,38 @@ static int __is_authorized()
                return 0;
 }
 
+int xsystem(const char *argv[])
+{
+       int status = 0;
+       pid_t pid;
+       pid = fork();
+       switch (pid) {
+       case -1:
+               perror("fork failed");
+               return -1;
+       case 0:
+               /* child */
+               execvp(argv[0], (char *const *)argv);
+               _exit(-1);
+       default:
+               /* parent */
+               break;
+       }
+       if (waitpid(pid, &status, 0) == -1) {
+               perror("waitpid failed");
+               return -1;
+       }
+       if (WIFSIGNALED(status)) {
+               perror("signal");
+               return -1;
+       }
+       if (!WIFEXITED(status)) {
+               /* shouldn't happen */
+               perror("should not happen");
+               return -1;
+       }
+       return WEXITSTATUS(status);
+}
 
 int main(int argc, char *argv[])
 {
@@ -210,6 +242,9 @@ int main(int argc, char *argv[])
                return AIL_ERROR_FAIL;
        }
 
+       const char *argv_bin[] = { "/bin/rm", APP_INFO_DB_FILE, NULL };
+       xsystem(argv_bin);
+
        ret = setenv("AIL_INITDB", "1", 1);
        _D("AIL_INITDB : %d", ret);
 
index 7dbf370..1646461 100755 (executable)
@@ -1,7 +1,7 @@
 #sbs-git:slp/pkgs/a/ail ail 0.2.22 29ac1f2c98453cad647cca6a92abc7da3dbb047b
 Name:       ail
 Summary:    Application Information Library
-Version:    0.2.55
+Version:    0.2.64
 Release:    1
 Group:      System/Libraries
 License:    Apache License, Version 2.0
@@ -33,15 +33,16 @@ Application Information Library (devel)
 
 %build
 CFLAGS+=" -fpic"
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_PKGTYPE=rpm
+%cmake .  -DBUILD_PKGTYPE=rpm
 
 make %{?jobs:-j%jobs}
 
 %install
-rm -rf %{buildroot}
 %make_install
 
 %post
+vconftool set -t string db/ail/ail_info "0" -f
+vconftool set -t string db/menuscreen/desktop "0" -f
 
 CHDBGID="6010"
 
@@ -70,12 +71,12 @@ chsmack -a 'ail::db' /opt/dbspace/.app_info.db*
 
 %files
 %manifest ail.manifest
-/usr/lib/libail.so.0
-/usr/lib/libail.so.0.1.0
+%{_libdir}/libail.so.0
+%{_libdir}/libail.so.0.1.0
 /usr/bin/ail_initdb
 /usr/share/install-info/*
 
 %files devel
 /usr/include/ail.h
-/usr/lib/libail.so
-/usr/lib/pkgconfig/ail.pc
+%{_libdir}/libail.so
+%{_libdir}/pkgconfig/ail.pc
index 08f63e7..86f7830 100755 (executable)
@@ -78,7 +78,7 @@ static struct _ail_bool_map_t bool_prop_map[] = {
        {E_AIL_PROP_X_SLP_MULTIPLE_BOOL, AIL_PROP_X_SLP_MULTIPLE_BOOL},
        {E_AIL_PROP_X_SLP_REMOVABLE_BOOL, AIL_PROP_X_SLP_REMOVABLE_BOOL},
 /*     {E_AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL, AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL}, */
-       {E_AIL_PROP_X_SLP_INACTIVATED_BOOL, AIL_PROP_X_SLP_INACTIVATED_BOOL}
+       {E_AIL_PROP_X_SLP_ENABLED_BOOL, AIL_PROP_X_SLP_ENABLED_BOOL}
 };
 
 
index ffbbcba..3bd7eda 100755 (executable)
@@ -36,6 +36,7 @@
 
 #include "ail_private.h"
 #include "ail_db.h"
+#include "ail_sql.h"
 #include "ail.h"
 
 #define OPT_DESKTOP_DIRECTORY "/opt/share/applications"
@@ -109,7 +110,7 @@ typedef struct {
        int             x_slp_multiple;
        int             x_slp_removable;
        int             x_slp_ishorizontalscale;
-       int             x_slp_inactivated;
+       int             x_slp_enabled;
        char*           desktop;
        GSList*         localname;
 } desktop_info_s;
@@ -598,6 +599,19 @@ static ail_error_e _read_x_slp_domain(void *data, char *tag, char *value)
 }
 
 
+static ail_error_e _read_x_slp_enabled(void *data, char *tag, char *value)
+{
+       desktop_info_s *info = data;
+
+       retv_if(!data, AIL_ERROR_INVALID_PARAMETER);
+       retv_if(!value, AIL_ERROR_INVALID_PARAMETER);
+
+       info->x_slp_enabled = !strcasecmp(value, "true");
+
+       return AIL_ERROR_OK;
+}
+
+
 static struct entry_parser entry_parsers[] = {
        {
                .field = "exec",
@@ -660,6 +674,10 @@ static struct entry_parser entry_parsers[] = {
                .value_cb = _read_x_slp_taskmanage,
        },
        {
+               .field = "x-tizen-enabled",
+               .value_cb = _read_x_slp_enabled,
+       },
+       {
                .field = "x-tizen-multiple",
                .value_cb = _read_x_slp_multiple,
        },
@@ -680,6 +698,10 @@ static struct entry_parser entry_parsers[] = {
                .value_cb = _read_x_slp_domain,
        },
        {
+               .field = "x-tizen-enabled",
+               .value_cb = _read_x_slp_domain,
+       },
+       {
                .field = NULL,
                .value_cb = NULL,
        },
@@ -801,6 +823,8 @@ static ail_error_e _init_desktop_info(desktop_info_s *info, const char *package)
        info->x_slp_appid = strdup(package);
        retv_if(!info->x_slp_appid, AIL_ERROR_OUT_OF_MEMORY);
 
+       info->x_slp_enabled = 1;
+
        info->desktop = _pkgname_to_desktop(package);
        retv_if(!info->desktop, AIL_ERROR_FAIL);
 
@@ -872,6 +896,114 @@ NEXT:
 }
 
 
+static ail_error_e _retrieve_all_column_to_desktop_info(desktop_info_s* info, sqlite3_stmt *stmt)
+{
+       int i, j;
+       ail_error_e err;
+       char **values;
+       char *col;
+
+       retv_if(!info, AIL_ERROR_INVALID_PARAMETER);
+
+       values = calloc(NUM_OF_PROP, sizeof(char *));
+       retv_if(!values, AIL_ERROR_OUT_OF_MEMORY);
+
+       for (i = 0; i < NUM_OF_PROP; i++) {
+               err = db_column_str(stmt, i, &col);
+               if (AIL_ERROR_OK != err)
+                       break;
+
+               if (!col) {
+                       values[i] = NULL;
+               } else {
+                       values[i] = strdup(col);
+                       if (!values[i]) {
+                               err = AIL_ERROR_OUT_OF_MEMORY;
+                               goto NEXT;
+                       }
+               }
+       }
+
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_EXEC_STR], info->exec);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_NAME_STR], info->name);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_TYPE_STR], info->type);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_ICON_STR], info->icon);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_CATEGORIES_STR], info->categories);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_VERSION_STR], info->version);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_MIMETYPE_STR], info->mimetype);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_SERVICE_STR], info->x_slp_service);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_PACKAGETYPE_STR], info->x_slp_packagetype);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_PACKAGECATEGORIES_STR], info->x_slp_packagecategories);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_PACKAGEID_STR], info->x_slp_packageid);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_URI_STR], info->x_slp_uri);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_SVC_STR], info->x_slp_svc);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_EXE_PATH], info->x_slp_exe_path);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_APPID_STR], info->x_slp_appid);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_PKGID_STR], info->x_slp_pkgid);
+       SAFE_FREE_AND_STRDUP(values[E_AIL_PROP_X_SLP_DOMAIN_STR], info->x_slp_domain);
+
+       info->x_slp_installedtime = atoi(values[E_AIL_PROP_X_SLP_INSTALLEDTIME_INT]);
+
+       info->nodisplay = atoi(values[E_AIL_PROP_NODISPLAY_BOOL]);
+       info->x_slp_taskmanage = atoi(values[E_AIL_PROP_X_SLP_TASKMANAGE_BOOL]);
+       info->x_slp_multiple = atoi(values[E_AIL_PROP_X_SLP_MULTIPLE_BOOL]);
+       info->x_slp_removable = atoi(values[E_AIL_PROP_X_SLP_REMOVABLE_BOOL]);
+       info->x_slp_ishorizontalscale = atoi(values[E_AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL]);
+       info->x_slp_enabled = atoi(values[E_AIL_PROP_X_SLP_ENABLED_BOOL]);
+
+       err = AIL_ERROR_OK;
+
+NEXT:
+       for (j = 0; j < i; ++j) {
+               if (values[j])
+                       free(values[j]);
+       }
+       if (values)
+               free(values);
+       return err;
+}
+
+
+static ail_error_e _load_desktop_info(desktop_info_s* info)
+{
+       ail_error_e ret;
+       char query[AIL_SQL_QUERY_MAX_LEN];
+       sqlite3_stmt *stmt = NULL;
+       char w[AIL_SQL_QUERY_MAX_LEN];
+
+       retv_if(!info, AIL_ERROR_INVALID_PARAMETER);
+
+       snprintf(w, sizeof(w), sql_get_filter(E_AIL_PROP_X_SLP_APPID_STR), info->package);
+
+       snprintf(query, sizeof(query), "SELECT %s FROM %s WHERE %s",SQL_FLD_APP_INFO, SQL_TBL_APP_INFO, w);
+
+       do {
+               ret = db_open(DB_OPEN_RO);
+               if (ret < 0) break;
+
+               ret = db_prepare(query, &stmt);
+               if (ret < 0) break;
+
+               ret = db_step(stmt);
+               if (ret < 0) {
+                       db_finalize(stmt);
+                       break;
+               }
+
+               ret = _retrieve_all_column_to_desktop_info(info, stmt);
+               if (ret < 0) {
+                       db_finalize(stmt);
+                       break;
+               }
+
+               ret = db_finalize(stmt);
+               if (ret < 0) break;
+
+               return AIL_ERROR_OK;
+       } while(0);
+
+       return ret;
+}
 
 static ail_error_e _modify_desktop_info_bool(desktop_info_s* info,
                                                  const char *property,
@@ -889,8 +1021,8 @@ static ail_error_e _modify_desktop_info_bool(desktop_info_s* info,
                return AIL_ERROR_INVALID_PARAMETER;
 
        switch (prop) {
-               case E_AIL_PROP_X_SLP_INACTIVATED_BOOL:
-                       info->x_slp_inactivated = (int)value;
+               case E_AIL_PROP_X_SLP_ENABLED_BOOL:
+                       info->x_slp_enabled = (int)value;
                        break;
                default:
                        return AIL_ERROR_FAIL;
@@ -900,6 +1032,35 @@ static ail_error_e _modify_desktop_info_bool(desktop_info_s* info,
 }
 
 
+static ail_error_e _modify_desktop_info_str(desktop_info_s* info,
+                                                 const char *property,
+                                                 const char *value)
+{
+       ail_prop_bool_e prop;
+       int val;
+
+       retv_if(!info, AIL_ERROR_INVALID_PARAMETER);
+       retv_if(!property, AIL_ERROR_INVALID_PARAMETER);
+
+       prop = _ail_convert_to_prop_str(property);
+
+       if (prop < E_AIL_PROP_STR_MIN || prop > E_AIL_PROP_STR_MAX)
+               return AIL_ERROR_INVALID_PARAMETER;
+
+       switch (prop) {
+               case E_AIL_PROP_NAME_STR:
+                       SAFE_FREE_AND_STRDUP(value, info->name);
+                       retv_if (!info->name, AIL_ERROR_OUT_OF_MEMORY);
+                       break;
+               default:
+                       return AIL_ERROR_FAIL;
+       }
+
+       return AIL_ERROR_OK;
+}
+
+
+
 
 static ail_error_e _create_table(void)
 {
@@ -932,7 +1093,7 @@ static ail_error_e _create_table(void)
                "x_slp_multiple INTEGER DEFAULT 0, "
                "x_slp_removable INTEGER DEFAULT 1, "
                "x_slp_ishorizontalscale INTEGER DEFAULT 0, "
-               "x_slp_inactivated INTEGER DEFAULT 0, "
+               "x_slp_enabled INTEGER DEFAULT 1, "
                "desktop TEXT UNIQUE NOT NULL);",
                "CREATE TABLE localname (package TEXT NOT NULL, "
                "locale TEXT NOT NULL, "
@@ -1001,7 +1162,7 @@ static ail_error_e _insert_desktop_info(desktop_info_s *info)
                "x_slp_multiple, "
                "x_slp_removable, "
                "x_slp_ishorizontalscale, "
-               "x_slp_inactivated, "
+               "x_slp_enabled, "
                "desktop) "
                "values "
                "('%q', '%q', '%q', '%q', '%q', "
@@ -1036,7 +1197,7 @@ static ail_error_e _insert_desktop_info(desktop_info_s *info)
                info->x_slp_multiple,
                info->x_slp_removable,
                info->x_slp_ishorizontalscale,
-               info->x_slp_inactivated,
+               info->x_slp_enabled,
                info->desktop
                );
 
@@ -1100,7 +1261,7 @@ static ail_error_e _update_desktop_info(desktop_info_s *info)
                "x_slp_multiple=%d, "
                "x_slp_removable=%d, "
                "x_slp_ishorizontalscale=%d, "
-               "x_slp_inactivated=%d, "
+               "x_slp_enabled=%d, "
                "desktop='%q'"
                "where package='%q'",
                info->exec,
@@ -1127,7 +1288,7 @@ static ail_error_e _update_desktop_info(desktop_info_s *info)
                info->x_slp_multiple,
                info->x_slp_removable,
                info->x_slp_ishorizontalscale,
-               info->x_slp_inactivated,
+               info->x_slp_enabled,
                info->desktop,
                info->package);
 
@@ -1219,7 +1380,8 @@ 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("memory/menuscreen/desktop", noti_string);
+       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);
@@ -1257,6 +1419,8 @@ static void _fini_desktop_info(desktop_info_s *info)
        SAFE_FREE(info->x_slp_svc);
        SAFE_FREE(info->x_slp_exe_path);
        SAFE_FREE(info->x_slp_appid);
+       SAFE_FREE(info->x_slp_pkgid);
+       SAFE_FREE(info->x_slp_domain);
        SAFE_FREE(info->desktop);
        if (info->localname) {
                g_slist_free_full(info->localname, _name_item_free_func);
@@ -1266,6 +1430,14 @@ static void _fini_desktop_info(desktop_info_s *info)
        return;
 }
 
+static int __is_authorized()
+{
+       uid_t uid = getuid();
+       if ((uid_t) 0 == uid )
+               return 1;
+       else
+               return 0;
+}
 
 
 /* Public functions */
@@ -1276,6 +1448,10 @@ EXPORT_API ail_error_e ail_desktop_add(const char *appid)
        int count;
 
        retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
+       if (!__is_authorized()) {
+               _E("You are not an authorized user on adding!\n");
+               return -1;
+       }
 
        count = _count_all();
        if (count <= 0) {
@@ -1310,6 +1486,10 @@ EXPORT_API ail_error_e ail_desktop_update(const char *appid)
        ail_error_e ret;
 
        retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
+       if (!__is_authorized()) {
+               _E("You are not an authorized user on updating!\n");
+               return -1;
+       }
 
        ret = _init_desktop_info(&info, appid);
        retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
@@ -1335,6 +1515,10 @@ EXPORT_API ail_error_e ail_desktop_remove(const char *appid)
        ail_error_e ret;
 
        retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
+       if (!__is_authorized()) {
+               _E("You are not an authorized user on removing!\n");
+               return -1;
+       }
 
        ret = _remove_package(appid);
        retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
@@ -1346,20 +1530,23 @@ EXPORT_API ail_error_e ail_desktop_remove(const char *appid)
 }
 
 
-EXPORT_API ail_error_e ail_desktop_appinfo_modify_bool(const char *package,
+EXPORT_API ail_error_e ail_desktop_appinfo_modify_bool(const char *appid,
                                                             const char *property,
-                                                            bool value)
+                                                            bool value,
+                                                            bool broadcast)
 {
        desktop_info_s info = {0,};
        ail_error_e ret;
-       ail_prop_bool_e prop;
 
-       retv_if(!package, AIL_ERROR_INVALID_PARAMETER);
+       retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
 
-       retv_if(strcmp(property, AIL_PROP_X_SLP_INACTIVATED_BOOL),
+       retv_if(strcmp(property, AIL_PROP_X_SLP_ENABLED_BOOL),
                AIL_ERROR_INVALID_PARAMETER);
 
-       ret = _init_desktop_info(&info, package);
+       ret = _init_desktop_info(&info, appid);
+       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+
+       ret = _load_desktop_info(&info);
        retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
 
        ret = _modify_desktop_info_bool(&info, property, value);
@@ -1368,8 +1555,10 @@ EXPORT_API ail_error_e ail_desktop_appinfo_modify_bool(const char *package,
        ret = _update_desktop_info(&info);
        retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
 
-       ret = _send_db_done_noti(NOTI_UPDATE, package);
-       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+       if (broadcast) {
+               ret = _send_db_done_noti(NOTI_UPDATE, appid);
+               retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+       }
 
        _fini_desktop_info(&info);
 
@@ -1377,6 +1566,41 @@ EXPORT_API ail_error_e ail_desktop_appinfo_modify_bool(const char *package,
 }
 
 
+EXPORT_API ail_error_e ail_desktop_appinfo_modify_str(const char *appid,
+                                                            const char *property,
+                                                            const char *value,
+                                                            bool broadcast)
+{
+       desktop_info_s info = {0,};
+       ail_error_e ret;
+
+       retv_if(!appid, AIL_ERROR_INVALID_PARAMETER);
+
+       retv_if(strcmp(property, AIL_PROP_NAME_STR),
+               AIL_ERROR_INVALID_PARAMETER);
+
+       ret = _init_desktop_info(&info, appid);
+       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+
+       ret = _load_desktop_info(&info);
+       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+
+       _D("info.name [%s], value [%s]", info.name, value);
+       ret = _modify_desktop_info_str(&info, property, value);
+       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+       _D("info.name [%s], value [%s]", info.name, value);
+
+       ret = _update_desktop_info(&info);
+       retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+
+       if (broadcast) {
+               ret = _send_db_done_noti(NOTI_UPDATE, appid);
+               retv_if(ret != AIL_ERROR_OK, AIL_ERROR_FAIL);
+       }
 
+       _fini_desktop_info(&info);
+
+       return AIL_ERROR_OK;
+}
 
 // End of File
index c7d1130..60b45f7 100755 (executable)
@@ -157,8 +157,8 @@ typedef enum {
        E_AIL_PROP_X_SLP_MULTIPLE_BOOL,
        E_AIL_PROP_X_SLP_REMOVABLE_BOOL,
        E_AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL,
-       E_AIL_PROP_X_SLP_INACTIVATED_BOOL,
-       E_AIL_PROP_BOOL_MAX = E_AIL_PROP_X_SLP_INACTIVATED_BOOL,
+       E_AIL_PROP_X_SLP_ENABLED_BOOL,
+       E_AIL_PROP_BOOL_MAX = E_AIL_PROP_X_SLP_ENABLED_BOOL,
 } ail_prop_bool_e;
 
 #define NUM_OF_PROP E_AIL_PROP_BOOL_MAX + 1
index 3b01254..db0c901 100755 (executable)
@@ -56,7 +56,7 @@ static const char *filter[] = {
        "app_info.X_SLP_MULTIPLE=%d",
        "app_info.X_SLP_REMOVABLE=%d",
        "app_info.X_SLP_ISHORIZONTALSCALE=%d",
-       "app_info.X_SLP_INACTIVATED=%d",
+       "app_info.X_SLP_ENABLED=%d",
        NULL,
 };
 
index 8ec0a40..bf06671 100755 (executable)
@@ -56,7 +56,7 @@
                        "app_info.X_SLP_MULTIPLE," \
                        "app_info.X_SLP_REMOVABLE," \
                        "app_info.X_SLP_ISHORIZONTALSCALE," \
-                       "app_info.X_SLP_INACTIVATED" \
+                       "app_info.X_SLP_ENABLED" \
 
 
 #define SQL_FLD_APP_INFO_WITH_LOCALNAME SQL_FLD_APP_INFO",""localname.name"