add appinfo db close api
authorjunsuk77.oh <junsuk77.oh@samsung.com>
Thu, 28 Mar 2013 08:36:48 +0000 (17:36 +0900)
committerjunsuk77.oh <junsuk77.oh@samsung.com>
Thu, 28 Mar 2013 08:36:48 +0000 (17:36 +0900)
Change-Id: I87e7a86a14bfff38af44319e43c10908e594d7ca
Signed-off-by: junsuk77.oh <junsuk77.oh@samsung.com>
include/ail.h
packaging/ail.spec
src/ail_desktop.c
src/ail_package.c

index 04dea5c..161033c 100755 (executable)
@@ -958,6 +958,60 @@ static ail_error_e _get_name(const char *appid)
  */
 ail_error_e ail_destroy_appinfo(const ail_appinfo_h handle);
 
+/**
+ * @fn ail_error_e ail_close_appinfo_db(void)
+ *
+ * @brief close appinfo db.
+ *
+ * @par Sync (or) Async : Synchronous API.
+ *
+ * @return 0 if success, negative value(<0) if fail\n
+ * @retval     AIL_ERROR_OK                                    success
+ * @retval     AIL_ERROR_DB_FAILED                             database error
+ * @retval     AIL_ERROR_INVALID_PARAMETER             invalid parameter
+ *
+ * @pre need a handle that you don't need anymore.
+ * @post cannot use the handle after destroying.
+ *
+ * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
+ *
+ * @par Prospective Clients:
+ * External Apps.
+ *
+ * @code
+static ail_error_e _get_name(const char *appid)
+{
+       ail_appinfo_h handle;
+       ail_error_e ret;
+       char *str;
+
+       ret = ail_get_appinfo(appid, &handle);
+       if (ret != AIL_ERROR_OK) {
+               return AIL_ERROR_FAIL;
+       }
+
+       ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
+       if (ret != AIL_ERROR_OK) {
+               return AIL_ERROR_FAIL;
+       }
+       fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
+
+       ret = ail_destroy_appinfo(handle);
+       if (ret != AIL_ERROR_OK) {
+               return AIL_ERROR_FAIL;
+       }
+
+       ret = ail_close_appinfo_db();
+       if (ret != AIL_ERROR_OK) {
+               return AIL_ERROR_FAIL;
+       }
+
+       return AIL_ERROR_OK;
+}
+ * @endcode
+ */
+ail_error_e ail_close_appinfo_db(void);
+
 
 /**
  * @fn ail_error_e ail_desktop_add(const char *appid)
index 1646461..e633635 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.64
+Version:    0.2.67
 Release:    1
 Group:      System/Libraries
 License:    Apache License, Version 2.0
index 3bd7eda..a1d19c5 100755 (executable)
@@ -1052,6 +1052,10 @@ static ail_error_e _modify_desktop_info_str(desktop_info_s* info,
                        SAFE_FREE_AND_STRDUP(value, info->name);
                        retv_if (!info->name, AIL_ERROR_OUT_OF_MEMORY);
                        break;
+               case E_AIL_PROP_X_SLP_SVC_STR:
+                       SAFE_FREE_AND_STRDUP(value, info->x_slp_svc);
+                       retv_if (!info->x_slp_svc, AIL_ERROR_OUT_OF_MEMORY);
+                       break;
                default:
                        return AIL_ERROR_FAIL;
        }
@@ -1576,9 +1580,6 @@ EXPORT_API ail_error_e ail_desktop_appinfo_modify_str(const char *appid,
 
        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);
 
index 82af08d..250e371 100755 (executable)
@@ -491,5 +491,9 @@ EXPORT_API ail_error_e ail_appinfo_get_str(const ail_appinfo_h ai, const char *p
        return AIL_ERROR_OK;
 }
 
+EXPORT_API ail_error_e ail_close_appinfo_db(void)
+{
+       return db_close();
+}
 
 // End of file