def402747e08a71d2ea6f30818063f14cae527f5
[platform/core/appfw/ail.git] / include / ail.h
1 /*
2  * ail
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23
24
25 #ifndef __AIL_H__
26 #define __AIL_H__
27
28 #include <stdbool.h>
29 #include <unistd.h>
30 #include <sys/types.h>
31 #include <pwd.h>
32 #include <tzplatform_config.h>
33
34 #define OWNER_ROOT 0
35 #define GROUP_MENU 6010
36 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
37 #define BUFSZE 1024
38 #define OPT_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RW_DESKTOP_APP)
39 #define USR_DESKTOP_DIRECTORY tzplatform_getenv(TZ_SYS_RO_DESKTOP_APP)
40 #define APP_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
41 #define APP_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB,".app_info.db-journal")
42 #define APP_INFO_DB_LABEL "_"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
47
48
49
50 /**
51  * @open
52  * @ingroup APPLICATION_FRAMEWORK
53  * @defgroup ail Application Information Library
54  */
55
56 /**
57  * @file       ail.h
58  * @brief      Application Information Library header
59  * @author     Sunghyuk Lee (sunghyuk.lee@samsung.com), Jin Yoon (jinny.yoon@samsung.com)
60  * @date       2011-07-30
61  * @version    0.1
62  */
63
64 /**
65  * @addtogroup ail
66  * @{
67  */
68
69 /**
70  * @brief string type properties
71  */
72 #define AIL_PROP_PACKAGE_STR                    "AIL_PROP_PACKAGE_STR"
73 #define AIL_PROP_EXEC_STR                       "AIL_PROP_EXEC_STR"
74 #define AIL_PROP_NAME_STR                       "AIL_PROP_NAME_STR"
75 #define AIL_PROP_TYPE_STR                       "AIL_PROP_TYPE_STR"
76 #define AIL_PROP_ICON_STR                       "AIL_PROP_ICON_STR"
77 #define AIL_PROP_CATEGORIES_STR                 "AIL_PROP_CATEGORIES_STR"
78 #define AIL_PROP_VERSION_STR                    "AIL_PROP_VERSION_STR"
79 #define AIL_PROP_MIMETYPE_STR                   "AIL_PROP_MIMETYPE_STR"
80 #define AIL_PROP_X_SLP_SERVICE_STR              "AIL_PROP_X_SLP_SERVICE_STR"
81 #define AIL_PROP_X_SLP_PACKAGETYPE_STR          "AIL_PROP_X_SLP_PACKAGETYPE_STR"
82 #define AIL_PROP_X_SLP_PACKAGECATEGORIES_STR    "AIL_PROP_X_SLP_PACKAGECATEGORIES_STR"
83 #define AIL_PROP_X_SLP_PACKAGEID_STR            "AIL_PROP_X_SLP_PACKAGEID_STR"
84 #define AIL_PROP_X_SLP_SVC_STR                  "AIL_PROP_X_SLP_SVC_STR"
85 #define AIL_PROP_X_SLP_EXE_PATH                 "AIL_PROP_X_SLP_EXE_PATH"
86 #define AIL_PROP_X_SLP_APPID_STR                "AIL_PROP_X_SLP_APPID_STR"
87 #define AIL_PROP_X_SLP_PKGID_STR                "AIL_PROP_X_SLP_PKGID_STR"
88 #define AIL_PROP_X_SLP_DOMAIN_STR               "AIL_PROP_X_SLP_DOMAIN_STR"
89 #define AIL_PROP_X_SLP_SUBMODEMAINID_STR                "AIL_PROP_X_SLP_SUBMODEMAINID_STR"
90 #define AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR             "AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR"
91
92 /**
93  * @brief integer type properties
94  */
95 #define AIL_PROP_X_SLP_TEMP_INT                 "AIL_PROP_X_SLP_TEMP_INT"
96 #define AIL_PROP_X_SLP_INSTALLEDTIME_INT        "AIL_PROP_X_SLP_INSTALLEDTIME_INT"
97
98 /**
99  * @brief boolean type properties
100  */
101 #define AIL_PROP_NODISPLAY_BOOL                 "AIL_PROP_NODISPLAY_BOOL"
102 #define AIL_PROP_X_SLP_TASKMANAGE_BOOL          "AIL_PROP_X_SLP_TASKMANAGE_BOOL"
103 #define AIL_PROP_X_SLP_MULTIPLE_BOOL            "AIL_PROP_X_SLP_MULTIPLE_BOOL"
104 #define AIL_PROP_X_SLP_REMOVABLE_BOOL           "AIL_PROP_X_SLP_REMOVABLE_BOOL"
105 #define AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL   "AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL"
106 #define AIL_PROP_X_SLP_ENABLED_BOOL             "AIL_PROP_X_SLP_ENABLED_BOOL"
107 #define AIL_PROP_X_SLP_SUBMODE_BOOL             "AIL_PROP_X_SLP_SUBMODE_BOOL"
108
109 /**
110  * @brief A handle for filters
111  */
112 typedef struct ail_filter *ail_filter_h;
113
114 /**
115  * @brief A handle for appinfos
116  */
117 typedef struct ail_appinfo *ail_appinfo_h;
118
119 /**
120  * @brief return values 
121  */
122 typedef enum {
123         AIL_ERROR_OK = 0,                                               /**< General success */
124         AIL_ERROR_FAIL = -1,                                    /**< General error */
125         AIL_ERROR_DB_FAILED = -2,                               /**< Database error */
126         AIL_ERROR_OUT_OF_MEMORY = -3,                   /**< Out of memory */
127         AIL_ERROR_INVALID_PARAMETER = -4,               /**< Invalid parameter */
128         AIL_ERROR_NO_DATA = -5,                                 /**< Success, but no data */
129 } ail_error_e;
130
131 /**
132  * @fn ail_error_e ail_filter_new(ail_filter_h *filter)
133  *
134  * @brief  Create a new filter handle which is used to filter records from Application Information Database. You can add filtering conditions to filter with ail_filter_add_xxx functions. All conditions are ANDed.
135  *
136  * @par Sync (or) Async : Synchronous API.
137  *
138  * @param[out] filter a pointer to a filter which is newly created
139  *
140  * @return 0 if success, negative value(<0) if fail\n
141  * @retval      AIL_ERROR_OK                                    success
142  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
143  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
144  *
145  * @pre None
146  * @post If the filter is no longer used, it should be freed with ail_filter_destroy()
147  *
148  * @see  ail_filter_destroy()
149  *
150  * @par Prospective Clients:
151  * External Apps.
152  *
153  * @code
154 int count_apps()
155 {
156         ail_filter_h filter;
157         ail_error_e ret;
158         int n;
159
160         ret = ail_filter_new(&filter);
161         if (ret != AIL_ERROR_OK) {
162                 return -1;
163         }
164
165         ret = ail_filter_add_bool(filter, AIL_PROP_NODISPLAY_BOOL, false);
166         if (ret != AIL_ERROR_OK) {
167                 return -1;
168         }
169
170         ret = ail_filter_add_str(filter, AIL_PROP_MIMETYPE_STR, "audio/wav");
171         if (ret != AIL_ERROR_OK) {
172                 return -1;
173         }
174
175         ret = ail_filter_count_appinfo(filter, &n);
176         if (ret != AIL_ERROR_OK) {
177                 return -1;
178         }
179         ret = ail_filter_destroy(filter);
180
181         printf("N of apps not to be displayed and supporting 'audo/wav' mime type = %d\n", n);
182
183         return n;
184 }
185  * @endcode
186  */
187 ail_error_e ail_filter_new(ail_filter_h *filter);
188
189
190
191 /**
192  * @fn ail_error_e ail_error_e ail_filter_add_int(ail_filter_h filter, const char *property, const int value)
193  *
194  * @brief Add integer condition to filter
195  *
196  * @par Sync (or) Async : Synchronous API
197  *
198  * @param[in] filter    a filter handle which can be create with ail_filter_new()
199  * @param[in] property          a property type of integer
200  * @param[in] value             the value to filter by
201  *
202  * @return 0 if success, negative value(<0) if fail\n
203  * @retval      AIL_ERROR_OK                                    success
204  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
205  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
206  *
207  * @pre The filter should be valid handle which was created by ail_filter_new()
208  *
209  * @see  ail_filter_new()
210  *
211  * @par Prospective Clients:
212  * External Apps.
213  *
214  * @code
215 int count_apps()
216 {
217         ail_filter_h filter;
218         ail_error_e ret;
219         int n;
220
221         ret = ail_filter_new(&filter);
222         if (ret != AIL_ERROR_OK) {
223                 return -1;
224         }
225
226         ret = ail_filter_add_int(filter, AIL_PROP_X_SLP_BASELAYOUTWIDTH_INT, 480);
227         if (ret != AIL_ERROR_OK) {
228                 return -1;
229         }
230
231         ret = ail_filter_count_appinfo(filter, &n);
232         if (ret != AIL_ERROR_OK) {
233                 return -1;
234         }
235
236         printf("N of apps = %d\n", n);
237
238         return n;
239 }
240  * @endcode
241  */
242 ail_error_e ail_filter_add_int(ail_filter_h filter, const char *property, const int value);
243
244
245 /**
246  * @fn ail_error_e ail_error_e ail_filter_add_bool(ail_filter_h filter, const char *property, const bool value)
247  *
248  * @brief Add boolean condition to filter by. The value can be true/false only
249  *
250  * @par Sync (or) Async : Synchronous API
251  *
252  * @param[in] filter     a filter handle which can be create with ail_filter_new()
253  * @param[in] property   a property type of boolean
254  * @param[in] value      the value to filter by
255  *
256  * @return 0 if success, negative value(<0) if fail\n
257  * @retval      AIL_ERROR_OK                                    success
258  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
259  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
260  *
261  * @pre The filter should be valid handle which was created by ail_filter_new()
262  *
263  * @see  ail_filter_new()
264  *
265  * @par Prospective Clients:
266  * External Apps.
267  *
268  * @code
269 int count_apps()
270 {
271         ail_filter_h filter;
272         ail_error_e ret;
273         int n;
274
275         ret = ail_filter_new(&filter);
276         if (ret != AIL_ERROR_OK) {
277                 return -1;
278         }
279
280         ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
281         if (ret != AIL_ERROR_OK) {
282                 return -1;
283         }
284
285         ret = ail_filter_count_appinfo(filter, &n);
286         if (ret != AIL_ERROR_OK) {
287                 return -1;
288         }
289
290         fprintf(stderr, "N of apps = %d\n", n);
291
292         return n;
293 }
294  * @endcode
295  */
296 ail_error_e ail_filter_add_bool(ail_filter_h filter, const char *property, bool value);
297
298
299
300 /**
301  * @fn ail_error_e ail_error_e ail_filter_add_str(ail_filter_h filter, const char *property, const char *value)
302  *
303  * @brief Add string condition to filter by. The string is case-sensitive.
304  *
305  * @par Sync (or) Async : Synchronous API
306  *
307  * @param[in] filter     a filter handle which can be create with ail_filter_new()
308  * @param[in] property   a property type of string
309  * @param[in] value      the value to filter by
310  *
311  * @return 0 if success, negative value(<0) if fail\n
312  * @retval      AIL_ERROR_OK                                    success
313  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
314  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
315  *
316  * @pre The filter should be valid handle which was created by ail_filter_new()
317  *
318  * @see  ail_filter_new()
319  *
320  * @par Prospective Clients:
321  * External Apps.
322  *
323  * @code
324 int count_apps()
325 {
326         ail_filter_h filter;
327         ail_error_e ret;
328         int n;
329
330         ret = ail_filter_new(&filter);
331         if (ret != AIL_ERROR_OK) {
332                 return -1;
333         }
334
335         ret = ail_filter_add_str(filter, AIL_PROP_PACKAGE_STR, "com.samsung.memo");
336         if (ret != AIL_ERROR_OK) {
337                 return -1;
338         }
339
340         ret = ail_filter_count_appinfo(filter, &n);
341         if (ret != AIL_ERROR_OK) {
342                 return -1;
343         }
344
345         fprintf(stderr, "N of apps = %d\n", n);
346
347         return n;
348 }
349  * @endcode
350  */
351 ail_error_e ail_filter_add_str(ail_filter_h filter, const char *property, const char *value);
352
353
354
355 /**
356  * @fn ail_error_e ail_filter_destroy(ail_filter_h filter)
357  *
358  * @brief Destroy a filter which is not used any longer.
359  *
360  * @par Sync (or) Async : Synchronous API
361  *
362  * @param[in] filter    filter handle
363  *
364  * @return 0 if success, negative value(<0) if fail\n
365  * @retval      AIL_ERROR_OK    success
366  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
367  *
368  * @post If the filter is no longer used, it should be freed with ail_filter_destroy()
369  *
370  * @see  ail_filter_new()
371  *
372  * @par Prospective Clients:
373  * External Apps.
374  *
375  * @code
376 int count_apps()
377 {
378         ail_filter_h filter;
379         ail_error_e ret;
380         int n;
381
382         ret = ail_filter_new(&filter);
383         if (ret != AIL_ERROR_OK) {
384                 return -1;
385         }
386
387         ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
388         if (ret != AIL_ERROR_OK) {
389                 return -1;
390         }
391
392         ret = ail_filter_count_appinfo(filter, &n);
393         if (ret != AIL_ERROR_OK) {
394                 return -1;
395         }
396
397         printf("N of removable apps = %d\n", n);
398
399         ret = ail_filter_add_str(filter, AIL_PROP_MIMETYPE_STR, "audio/wav");
400         if (ret != AIL_ERROR_OK) {
401                 return -1;
402         }
403
404         ret = ail_filter_count_appinfo(filter, &n);
405         if (ret != AIL_ERROR_OK) {
406                 return -1;
407         }
408
409         printf("N of apps removable and supporting 'audo/wav' mime type = %d\n", n);
410
411         ret = ail_filter_destroy(filter);
412
413         return n;
414 }
415  * @endcode
416  */
417 ail_error_e ail_filter_destroy(ail_filter_h filter);
418
419
420
421 /**
422  * @brief return value type of ail_list_appinfo_cb
423  */
424 typedef enum {
425         AIL_CB_RET_CONTINUE = 1,                /**< continue */
426         AIL_CB_RET_CANCEL = 0,                  /**< cancel */
427 } ail_cb_ret_e;
428
429 /**
430  * @fn ail_cb_ret_e (*ail_list_appinfo_cb) (const ail_appinfo_h appinfo_h, void *user_data)
431  *
432  * @breif Specifies the type of functions passed to ail_filter_list_appinfo_foreach().
433  *
434  * @param[in] appinfo_h the appinfo's handle
435  * @param[in] user_data user data passed to ail_filtet_list_appinfo_foreach()
436  *
437  * @return 0 if success, negative value(<0) if fail\n
438  * @retval      AIL_CB_RET_CONTINUE                             return if you continue iteration
439  * @retval      AIL_CB_RET_CANCEL                               return if you cancel iteration
440  *
441  * @see  ail_filter_list_appinfo_foreach()
442  */
443 typedef ail_cb_ret_e (*ail_list_appinfo_cb) (const ail_appinfo_h appinfo_h, void *user_data);
444
445 /**
446  * @fn ail_error_e ail_error_e ail_filter_list_appinfo_foreach(ail_filter_h filter, ail_list_appinfo_cb func, void *user_data)
447  * @fn ail_error_e ail_error_e ail_filter_list_usr_appinfo_foreach(ail_filter_h filter, ail_list_appinfo_cb func, void *user_data, uid_t uid)
448  * @brief Calls the callback function for each app filtered by given filter. If the filter is not given (i.e filter handle is NULL), it is invoked for all apps.
449  *
450  * @par Sync (or) Async : Synchronous API
451  *
452  * @param[in] filter            a filter handle
453  * @param[in] func                      the function to call with each app's appinfo
454  * @param[in] user_data         user_data to pass to the function
455  * @param[in] uid       ID of the owner of the application
456  *
457  * @return  0 if success, negative value(<0) if fail\n
458  * @retval AIL_ERROR_OK                                 success
459  * @retval AIL_ERROR_DB_FAILED                          database error
460  * @retval AIL_ERROR_INVALID_PARAMETER          invalid parameter
461  *
462  * @see  ail_list_appinfo_cb
463  * @see ail_filter_add_bool()
464  * @see ail_filter_add_int()
465  * @see ail_filter_add_str()
466  *
467  * @par Prospective Clients:
468  * External Apps.
469  *
470  * @code
471
472 ail_cb_ret_e appinfo_func(const ail_appinfo_h appinfo, void *user_data)
473 {
474         int *i = (int *)user_data;
475         char *appid;
476
477         ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &appid);
478         printf("i=%d %s\n", (*i)++, appid);
479
480         if (*i > 30)
481                 return AIL_CB_RET_CANCEL;
482
483         return AIL_CB_RET_CONTINUE;
484 }
485
486 int list_apps()
487 {
488         ail_filter_h filter;
489         ail_error_e ret;
490         int i=0;
491
492         ret = ail_filter_new(&filter);
493         if (ret != AIL_ERROR_OK) {
494                 return -1;
495         }
496
497         ret = ail_filter_add_bool(filter, AIL_PROP_X_SLP_REMOVABLE_BOOL, true);
498         if (ret != AIL_ERROR_OK) {
499                 return -1;
500         }
501
502         ret = ail_filter_add_str(filter, AIL_PROP_TYPE_STR, "Application");
503         if (ret != AIL_ERROR_OK) {
504                 return -1;
505         }
506
507         printf("List apps which are removable and 'Application' typed\n");
508         ail_filter_list_appinfo_foreach(filter, appinfo_func, (void *)&i);
509
510         ail_filter_destroy(filter);
511         
512         return 0;
513 }
514  * @endcode
515  */
516 ail_error_e ail_filter_list_appinfo_foreach(ail_filter_h filter,
517                                             ail_list_appinfo_cb appinfo_func,
518                                             void *user_data);
519 ail_error_e ail_filter_list_usr_appinfo_foreach(ail_filter_h filter,
520                                             ail_list_appinfo_cb appinfo_func,
521                                             void *user_data, uid_t uid);
522 /**
523  * @fn ail_error_e ail_error_e ail_filter_count_appinfo(ail_filter_h filter, int *count, uid_t uid)
524  * @fn ail_error_e ail_error_e ail_filter_count_usr_appinfo(ail_filter_h filter, int *count)
525  * @brief Gets the number of app which is filtered by the given filter. If the filter is not given (i.e filter handle is NULL), all app are counted.
526  *
527  * @par Sync (or) Async : Synchronous API
528  *
529  * @param[in] filter    a filter handle
530  * @param[in] count             the number of appinfo which is filtered
531  * @param[in] uid       ID of the owner of the application
532  *
533  * @return 0 if success, negative value(<0) if fail\n
534  * @retval      AIL_ERROR_OK                                    success
535  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
536  * @retval      AIL_ERROR_OUT_OF_MEMORY                 out of memory
537  *
538  * @pre None
539  * @post None
540  *
541  * @see ail_filter_new()
542  * @see ail_filter_add_bool()
543  * @see ail_filter_add_int()
544  * @see ail_filter_add_str()
545  *
546  * @par Prospective Clients:
547  * External Apps.
548  *
549  * @code
550 int count_apps()
551 {
552         ail_filter_h filter;
553         ail_error_e ret;
554         int n;
555
556         ret = ail_filter_new(&filter);
557         if (ret != AIL_ERROR_OK) {
558                 return -1;
559         }
560
561         ret = ail_filter_add_bool(filter, AIL_PROP_NODISPLAY_BOOL, true);
562         if (ret != AIL_ERROR_OK) {
563                 return -1;
564         }
565
566         ret = ail_filter_count_appinfo(filter, &n);
567         if (ret != AIL_ERROR_OK) {
568                 return -1;
569         }
570
571         printf("N of app not to be displayed = %d", n);
572
573         ret = ail_filter_count_appinfo(NULL, &n);
574         if (ret != AIL_ERROR_OK) {
575                 return -1;
576         }
577
578         printf("N of all app = %d\n", n);
579
580         return n;
581 }
582  * @endcode
583  */
584 ail_error_e ail_filter_count_appinfo(ail_filter_h filter, int *count);
585 ail_error_e ail_filter_count_usr_appinfo(ail_filter_h filter, int *count, uid_t uid);
586
587 /**
588  * @fn ail_error_e ail_package_get_appinfo(const char *package, ail_appinfo_h *handle)
589  * @fn ail_error_e ail_package_get_appinfo(const char *package, uid_t uid, ail_appinfo_h *handle)
590  * @brief get an application information related to a package. 
591         This API just retrieves all the information of the package from Application Information Database.
592         All data related to the package are loaded in the memory after calling this function. 
593         If you want to read a value from the retrieving data, you have to use the functions of ail_appinfo_get_xxx.
594
595  * @par Sync (or) Async : Synchronous API.
596  *
597  * @param[in] package package name what you want to know about.
598  * @param[in] uid       ID of the owner of the application
599  * @param[out] handle handle will be used with the functions of ail_appinfo_get_xxx. If no data, it will be NULL.
600  *
601  * @return 0 if success, negative value(<0) if fail\n
602  * @retval      AIL_ERROR_OK                                    success
603  * @retval      AIL_ERROR_FAIL                                  internal error
604  * @retval      AIL_ERROR_DB_FAILED                             database error
605  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
606  * @retval      AIL_ERROR_NO_DATA                               no data. cannot find the package.
607  *
608  * @pre declare a handle before calling this function. The handle is used as a second argument of this API.
609  * @post destroy the handle with the function of ail_package_destroy_appinfo after using it all.
610  *
611  * @see  ail_package_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
612  *
613  * @par Prospective Clients:
614  * External Apps.
615  *
616  * @code
617 static ail_error_e _get_name(const char *package)
618 {
619         ail_appinfo_h handle;
620         ail_error_e ret;
621         char *str;
622
623         ret = ail_package_get_appinfo(package, &handle);
624         if (ret != AIL_ERROR_OK) {
625                 return AIL_ERROR_FAIL;
626         }
627
628         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
629         if (ret != AIL_ERROR_OK) {
630                 return AIL_ERROR_FAIL;
631         }
632         fprintf(stderr, "Package[%s], Property[%s] : %s\n", package, property, str);
633
634         ret = ail_package_destroy_appinfo(handle);
635         if (ret != AIL_ERROR_OK) {
636                 return AIL_ERROR_FAIL;
637         }
638
639         return AIL_ERROR_OK;
640 }
641  * @endcode
642  */
643 ail_error_e ail_package_get_appinfo(const char *package, ail_appinfo_h *handle) __attribute__((deprecated));
644 ail_error_e ail_package_get_usr_appinfo(const char *package, uid_t uid, ail_appinfo_h *handle) __attribute__((deprecated));
645 /**
646  * @fn ail_error_e ail_get_appinfo(const char *appid, ail_appinfo_h *handle)
647  * @fn ail_error_e ail_get_usr_appinfo(const char *appid, uid_t uid, ail_appinfo_h *handle)
648  * @brief get an application information related to a appid.
649         This API just retrieves all the information of the application from Application Information Database.
650         All data related to the appid are loaded in the memory after calling this function.
651         If you want to read a value from the retrieving data, you have to use the functions of ail_appinfo_get_xxx.
652
653  * @par Sync (or) Async : Synchronous API.
654  *
655  * @param[in] appid appid what you want to know about.
656  * @param[out] handle handle will be used with the functions of ail_appinfo_get_xxx. If no data, it will be NULL.
657  *
658  * @return 0 if success, negative value(<0) if fail\n
659  * @retval      AIL_ERROR_OK                                    success
660  * @retval      AIL_ERROR_FAIL                                  internal error
661  * @retval      AIL_ERROR_DB_FAILED                             database error
662  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
663  * @retval      AIL_ERROR_NO_DATA                               no data. cannot find the app.
664  *
665  * @pre declare a handle before calling this function. The handle is used as a second argument of this API.
666  * @post destroy the handle with the function of ail_get_appinfo after using it all.
667  *
668  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
669  *
670  * @par Prospective Clients:
671  * External Apps.
672  *
673  * @code
674 static ail_error_e _get_name(const char *appid)
675 {
676         ail_appinfo_h handle;
677         ail_error_e ret;
678         char *str;
679
680         ret = ail_get_appinfo(appid, &handle);
681         if (ret != AIL_ERROR_OK) {
682                 return AIL_ERROR_FAIL;
683         }
684
685         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
686         if (ret != AIL_ERROR_OK) {
687                 return AIL_ERROR_FAIL;
688         }
689         fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
690
691         ret = ail_destroy_appinfo(handle);
692         if (ret != AIL_ERROR_OK) {
693                 return AIL_ERROR_FAIL;
694         }
695
696         return AIL_ERROR_OK;
697 }
698  * @endcode
699  */
700 ail_error_e ail_get_appinfo(const char *appid, ail_appinfo_h *handle);
701 ail_error_e ail_get_usr_appinfo(const char *appid, uid_t uid, ail_appinfo_h *handle);
702
703 /**
704  * @fn ail_error_e ail_appinfo_get_bool(const ail_appinfo_h handle, const char *property, bool *value)
705  *
706  * @brief get a boolean value related to the property. 
707         Before using this API, the handle is defined by calling ail_get_appinfo.
708         This function needs a out-parameter for the value.
709  *
710  * @par Sync (or) Async : Synchronous API.
711  *
712  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
713  * @param[in] property   a property type of boolean
714  * @param[out] value    a out-parameter value that is mapped with the property.
715  *
716  * @return 0 if success, negative value(<0) if fail\n
717  * @retval      AIL_ERROR_OK                                    success
718  * @retval      AIL_ERROR_DB_FAILED                             database error
719  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
720  *
721  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
722  * @post destroy the handle with the function of ail_destroy_appinfo after using it all.
723  *
724  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_int(), ail_appinfo_get_str()
725  *
726  * @par Prospective Clients:
727  * External Apps.
728  *
729  * @code
730 static ail_error_e _get_nodisplay(const char *appid)
731 {
732         ail_appinfo_h handle;
733         ail_error_e ret;
734         bool value;
735
736         ret = ail_get_appinfo(appid, &handle);
737         if (ret != AIL_ERROR_OK) {
738                 return AIL_ERROR_FAIL;
739         }
740
741         ret = ail_appinfo_get_bool(handle, AIL_PROP_NODISPLAY_BOOL, &value);
742         if (ret != AIL_ERROR_OK) {
743                 return AIL_ERROR_FAIL;
744         }
745         fprintf(stderr, "appid[%s] : %d\n", appid, value);
746
747         ret = ail_destroy_appinfo(handle);
748         if (ret != AIL_ERROR_OK) {
749                 return AIL_ERROR_FAIL;
750         }
751
752         return AIL_ERROR_OK;
753 }
754  * @endcode
755  */
756 ail_error_e ail_appinfo_get_bool(const ail_appinfo_h handle, const char *property, bool *value);
757
758
759
760 /**
761  * @fn ail_error_e ail_appinfo_get_int(const ail_appinfo_h handle, const char *property, int *value)
762  *
763  * @brief get a integer value related to the property. 
764         Before using this API, the handle is defined by calling ail_get_appinfo.
765         This function needs a out-parameter for the value.
766  *
767  * @par Sync (or) Async : Synchronous API.
768  *
769  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
770  * @param[in] property  a property type of integer.
771  * @param[out] value    a out-parameter value that is mapped with the property.
772  *
773  * @return 0 if success, negative value(<0) if fail\n
774  * @retval      AIL_ERROR_OK                                    success
775  * @retval      AIL_ERROR_DB_FAILED                             database error
776  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
777  *
778  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
779  * @post destroy the handle with the function of ail_destroy_appinfo after using it all.
780  *
781  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_str()
782  *
783  * @par Prospective Clients:
784  * External Apps.
785  *
786  * @code
787 static ail_error_e _get_x_slp_baselayoutwidth(const char *appid)
788 {
789         ail_appinfo_h handle;
790         ail_error_e ret;
791         int value;
792
793         ret = ail_get_appinfo(appid, &handle);
794         if (ret != AIL_ERROR_OK) {
795                 return AIL_ERROR_FAIL;
796         }
797
798         ret = ail_appinfo_get_int(handle, AIL_PROP_X_SLP_BASELAYOUTWIDTH_INT, &value);
799         if (ret != AIL_ERROR_OK) {
800                 return AIL_ERROR_FAIL;
801         }
802         fprintf(stderr, "Package[%s] : %d\n", appid, value);
803
804         ret = ail_destroy_appinfo(handle);
805         if (ret != AIL_ERROR_OK) {
806                 return AIL_ERROR_FAIL;
807         }
808
809         return AIL_ERROR_OK;
810 }
811  * @endcode
812  */
813 ail_error_e ail_appinfo_get_int(const ail_appinfo_h handle, const char *property, int *value);
814
815 /**
816  * @fn ail_error_e ail_appinfo_get_str(const ail_appinfo_h handle, const char *property, uid_t uid, char **str)
817  * @fn ail_error_e ail_appinfo_get_usr_str(const ail_appinfo_h handle, const char *property, char **str)
818  * @brief get a string related to the property. 
819         Before using this API, the handle is defined by calling ail_get_appinfo.
820         This function needs a out-parameter for the value.
821  *
822  * @par Sync (or) Async : Synchronous API.
823  *
824  * @param[in] handle    the handle is defined by calling ail_get_appinfo.
825  * @param[in] property  a property type of string.
826  * @param[in]   uid     the addressee user id of the instruction
827  * @param[out] str              a out-parameter string that is mapped with the property. The icon property contains the absolute file path. If there is no data, the value of str is NULL.
828  *
829  * @return 0 if success, negative value(<0) if fail\n
830  * @retval      AIL_ERROR_OK                                    success
831  * @retval      AIL_ERROR_DB_FAILED                             database error
832  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
833  *
834  * @pre define a handle using ail_get_appinfo. The handle is used as a first argument of this API.
835  * @post str doesn't need to be freed. It will be freed by calling ail_destroy_appinfo.
836  *
837  * @see  ail_get_appinfo(), ail_destroy_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int()
838  *
839  * @par Prospective Clients:
840  * External Apps.
841  *
842  * @code
843 static ail_error_e _get_nodisplay(const char *appid)
844 {
845         ail_appinfo_h handle;
846         ail_error_e ret;
847         char* value;
848
849         ret = ail_get_appinfo(appid, &handle);
850         if (ret != AIL_ERROR_OK) {
851                 return AIL_ERROR_FAIL;
852         }
853
854         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &value);
855         if (ret != AIL_ERROR_OK) {
856                 return AIL_ERROR_FAIL;
857         }
858         fprintf(stderr, "Package[%s] : %d\n", appid, value);
859
860         ret = ail_destroy_appinfo(handle);
861         if (ret != AIL_ERROR_OK) {
862                 return AIL_ERROR_FAIL;
863         }
864
865         return AIL_ERROR_OK;
866 }
867  * @endcode
868  */
869 ail_error_e ail_appinfo_get_str(const ail_appinfo_h handle, const char *property, char **str);
870 ail_error_e ail_appinfo_get_usr_str(const ail_appinfo_h handle, const char *property, uid_t uid, char **str);
871
872
873 /**
874  * @fn ail_error_e ail_package_destroy_appinfo(const ail_appinfo_h handle)
875  *
876  * @brief destroy a handle what you get with the function of ail_package_get_appinfo.
877  *
878  * @par Sync (or) Async : Synchronous API.
879  *
880  * @param[in] handle destroy all resources related to the handle.
881  *
882  * @return 0 if success, negative value(<0) if fail\n
883  * @retval      AIL_ERROR_OK                                    success
884  * @retval      AIL_ERROR_DB_FAILED                             database error
885  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
886  *
887  * @pre need a handle that you don't need anymore.
888  * @post cannot use the handle after destroying.
889  *
890  * @see  ail_package_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
891  *
892  * @par Prospective Clients:
893  * External Apps.
894  *
895  * @code
896 static ail_error_e _get_name(const char *package)
897 {
898         ail_appinfo_h handle;
899         ail_error_e ret;
900         char *str;
901
902         ret = ail_package_get_appinfo(package, &handle);
903         if (ret != AIL_ERROR_OK) {
904                 return AIL_ERROR_FAIL;
905         }
906
907         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
908         if (ret != AIL_ERROR_OK) {
909                 return AIL_ERROR_FAIL;
910         }
911         fprintf(stderr, "Package[%s], Property[%s] : %s\n", package, property, str);
912
913         ret = ail_package_destroy_appinfo(handle);
914         if (ret != AIL_ERROR_OK) {
915                 return AIL_ERROR_FAIL;
916         }
917
918         return AIL_ERROR_OK;
919 }
920  * @endcode
921  */
922 ail_error_e ail_package_destroy_appinfo(const ail_appinfo_h handle) __attribute__((deprecated));
923
924
925 /**
926  * @fn ail_error_e ail_destroy_appinfo(const ail_appinfo_h handle)
927  *
928  * @brief destroy a handle what you get with the function of ail_get_appinfo.
929  *
930  * @par Sync (or) Async : Synchronous API.
931  *
932  * @param[in] handle destroy all resources related to the handle.
933  *
934  * @return 0 if success, negative value(<0) if fail\n
935  * @retval      AIL_ERROR_OK                                    success
936  * @retval      AIL_ERROR_DB_FAILED                             database error
937  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
938  *
939  * @pre need a handle that you don't need anymore.
940  * @post cannot use the handle after destroying.
941  *
942  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
943  *
944  * @par Prospective Clients:
945  * External Apps.
946  *
947  * @code
948 static ail_error_e _get_name(const char *appid)
949 {
950         ail_appinfo_h handle;
951         ail_error_e ret;
952         char *str;
953
954         ret = ail_get_appinfo(appid, &handle);
955         if (ret != AIL_ERROR_OK) {
956                 return AIL_ERROR_FAIL;
957         }
958
959         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
960         if (ret != AIL_ERROR_OK) {
961                 return AIL_ERROR_FAIL;
962         }
963         fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
964
965         ret = ail_destroy_appinfo(handle);
966         if (ret != AIL_ERROR_OK) {
967                 return AIL_ERROR_FAIL;
968         }
969
970         return AIL_ERROR_OK;
971 }
972  * @endcode
973  */
974 ail_error_e ail_destroy_appinfo(const ail_appinfo_h handle);
975
976 /**
977  * @fn ail_error_e ail_close_appinfo_db(void)
978  *
979  * @brief close appinfo db.
980  *
981  * @par Sync (or) Async : Synchronous API.
982  *
983  * @return 0 if success, negative value(<0) if fail\n
984  * @retval      AIL_ERROR_OK                                    success
985  * @retval      AIL_ERROR_DB_FAILED                             database error
986  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
987  *
988  * @pre need a handle that you don't need anymore.
989  * @post cannot use the handle after destroying.
990  *
991  * @see  ail_get_appinfo(), ail_appinfo_get_bool(), ail_appinfo_get_int(), ail_appinfo_get_str()
992  *
993  * @par Prospective Clients:
994  * External Apps.
995  *
996  * @code
997 static ail_error_e _get_name(const char *appid)
998 {
999         ail_appinfo_h handle;
1000         ail_error_e ret;
1001         char *str;
1002
1003         ret = ail_get_appinfo(appid, &handle);
1004         if (ret != AIL_ERROR_OK) {
1005                 return AIL_ERROR_FAIL;
1006         }
1007
1008         ret = ail_appinfo_get_str(handle, AIL_PROP_NAME_STR, &str);
1009         if (ret != AIL_ERROR_OK) {
1010                 return AIL_ERROR_FAIL;
1011         }
1012         fprintf(stderr, "Package[%s], Property[%s] : %s\n", appid, property, str);
1013
1014         ret = ail_destroy_appinfo(handle);
1015         if (ret != AIL_ERROR_OK) {
1016                 return AIL_ERROR_FAIL;
1017         }
1018
1019         ret = ail_close_appinfo_db();
1020         if (ret != AIL_ERROR_OK) {
1021                 return AIL_ERROR_FAIL;
1022         }
1023
1024         return AIL_ERROR_OK;
1025 }
1026  * @endcode
1027  */
1028 ail_error_e ail_close_appinfo_db(void);
1029
1030
1031 /**
1032  * @fn ail_error_e ail_desktop_add(const char *appid, )
1033  * @fn ail_error_e ail_usr_desktop_add(const char *appid, uid_t uid)
1034  * @brief add a app information into Application Information Database.
1035         A desktop file for this app has to be installed in the desktop directory before using this API.
1036         If there is no database for Application Information Database, this API will create the DB.
1037         If there is a DB, this function adds information for the app into the DB.
1038         And a notification is published to the applications who want to know about changing DB. 
1039  *
1040  * @par Sync (or) Async : Synchronous API.
1041  *
1042  * @param[in] appid
1043  * @param[in]   uid     the addressee user id of the instruction
1044  *
1045  * @return 0 if success, negative value(<0) if fail\n
1046  * @retval      AIL_ERROR_OK                                    success
1047  * @retval      AIL_ERROR_FAIL                                  internal error
1048  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1049  *
1050  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
1051  * @post app information is added into the Application Information Database.
1052  *
1053  * @see  ail_desktop_update(), ail_desktop_remove()
1054  *
1055  * @par Prospective Clients:
1056  * External Apps.
1057  *
1058  * @code
1059 static ail_error_e _add_desktop(const char *appid)
1060 {
1061         ail_error_e ret;
1062
1063         if (!appid) {
1064                 return AIL_ERROR_FAIL;
1065         }
1066
1067         ret = ail_desktop_add(appid);
1068         if (ret != AIL_ERROR_OK) {
1069                 return AIL_ERROR_FAIL;
1070         }
1071
1072         return AIL_ERROR_OK;
1073 }
1074  * @endcode
1075  */
1076 ail_error_e ail_desktop_add(const char *appid);
1077 ail_error_e ail_usr_desktop_add(const char *appid, uid_t uid);
1078
1079
1080 /**
1081  * @fn ail_error_e ail_desktop_update(const char *appid)
1082  * @fn ail_error_e ail_usr_desktop_update(const char *appid,  uid_t uid)
1083  * @brief update a app information in the Application Information Database.
1084         A desktop file for this app has to be installed in the desktop directory before using this API.
1085         And a notification is published to the applications who want to know about changing DB. 
1086  *
1087  * @par Sync (or) Async : Synchronous API.
1088  *
1089  * @param[in] appid
1090  * @param[in] uid       ID of the owner of the application
1091  *
1092  * @return 0 if success, negative value(<0) if fail\n
1093  * @retval      AIL_ERROR_OK                                    success
1094  * @retval      AIL_ERROR_FAIL                                  internal error
1095  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1096  *
1097  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
1098  * @post update a app information in the Application Information Database.
1099  *
1100  * @see  ail_desktop_add(), ail_desktop_remove()
1101  *
1102  * @par Prospective Clients:
1103  * External Apps.
1104  *
1105  * @code
1106 static ail_error_e _update_desktop(const char *appid)
1107 {
1108         ail_error_e ret;
1109
1110         if (!appid) {
1111                 return AIL_ERROR_FAIL;
1112         }
1113
1114         ret = ail_desktop_update(appid);
1115         if (ret != AIL_ERROR_OK) {
1116                 return AIL_ERROR_FAIL;
1117         }
1118
1119         return AIL_ERROR_OK;
1120 }
1121  * @endcode
1122  */
1123 ail_error_e ail_desktop_update(const char *appid);
1124 ail_error_e ail_usr_desktop_update(const char *appid, uid_t uid);
1125
1126
1127 /**
1128  * @fn ail_error_e ail_desktop_remove(const char *appid)
1129  * @fn ail_error_e ail_usr_desktop_remove(const char *appid, uid_t uid)
1130  * @brief remove a app information in the Application Information Database.
1131         And a notification is published to the applications who want to know about changing DB. 
1132  *
1133  * @par Sync (or) Async : Synchronous API.
1134  *
1135  * @param[in] appid
1136  * @param[in]   uid     the addressee user id of the instruction
1137  *
1138  * @return 0 if success, negative value(<0) if fail\n
1139  * @retval      AIL_ERROR_OK                                    success
1140  * @retval      AIL_ERROR_FAIL                                  internal error
1141  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1142  *
1143  * @pre no pre-condition.
1144  * @post app information is removed in the Application Information Database.
1145  *
1146  * @see  ail_desktop_add(), ail_desktop_update()
1147  *
1148  * @par Prospective Clients:
1149  * External Apps.
1150  *
1151  * @code
1152 static ail_error_e _remove_desktop(const char *appid)
1153 {
1154         ail_error_e ret;
1155
1156         if (!appid) {
1157                 return AIL_ERROR_FAIL;
1158         }
1159
1160         ret = ail_desktop_remove(appid);
1161         if (ret != AIL_ERROR_OK) {
1162                 return AIL_ERROR_FAIL;
1163         }
1164
1165         return AIL_ERROR_OK;
1166 }
1167  * @endcode
1168  */
1169 ail_error_e ail_desktop_remove(const char *appid);
1170 ail_error_e ail_usr_desktop_remove(const char *appid, uid_t uid);
1171
1172 /**
1173  * @fn ail_error_e ail_desktop_clean(const char *pkgid)
1174  * @fn ail_error_e ail_usr_desktop_clean(const char *pkgid, uid_t uid))
1175  * @brief clean a pkg information in the Application Information Database.
1176  *
1177  * @par Sync (or) Async : Synchronous API.
1178  *
1179  * @param[in] pkgid
1180  * @param[in] uid       ID of the owner of the application
1181  *
1182  * @return 0 if success, negative value(<0) if fail\n
1183  * @retval      AIL_ERROR_OK                                    success
1184  * @retval      AIL_ERROR_FAIL                                  internal error
1185  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1186  *
1187  * @pre no pre-condition.
1188  * @post app information is removed in the Application Information Database.
1189  *
1190  * @see  ail_desktop_add(), ail_desktop_update()
1191  *
1192  * @par Prospective Clients:
1193  * External Apps.
1194  *
1195  * @code
1196 static ail_error_e _clean_desktop(const char *pkgid)
1197 {
1198         ail_error_e ret;
1199
1200         if (!appid) {
1201                 return AIL_ERROR_FAIL;
1202         }
1203
1204         ret = ail_desktop_clean(pkgid);
1205         if (ret != AIL_ERROR_OK) {
1206                 return AIL_ERROR_FAIL;
1207         }
1208
1209         return AIL_ERROR_OK;
1210 }
1211  * @endcode
1212  */
1213 ail_error_e ail_desktop_clean(const char *pkgid);
1214 ail_error_e ail_usr_desktop_clean(const char *pkgid, uid_t uid);
1215
1216 /**
1217  * @fn ail_error_e ail_desktop_fota(const char *appid)
1218  * @fn ail_error_e ail_usr_desktop_fota(const char *appid, uid_t uid)
1219  * @brief add a app information into Application Information Database.
1220         A desktop file for this app has to be installed in the desktop directory before using this API.
1221         If there is no database for Application Information Database, this API will create the DB.
1222         If there is a DB, this function adds information for the app into the DB.
1223         And a notification is not published to the applications who want to know about changing DB.
1224  *
1225  * @par Sync (or) Async : Synchronous API.
1226  *
1227  * @param[in] appid
1228  * @param[in]   uid     the addressee user id of the instruction
1229  *
1230  * @return 0 if success, negative value(<0) if fail\n
1231  * @retval      AIL_ERROR_OK                                    success
1232  * @retval      AIL_ERROR_FAIL                                  internal error
1233  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1234  *
1235  * @pre a desktop file for the app has to be installed in the desktop directory before using this API.
1236  * @post app information is added into the Application Information Database.
1237  *
1238  * @see  ail_desktop_update(), ail_desktop_remove()
1239  *
1240  * @par Prospective Clients:
1241  * External Apps.
1242  *
1243  * @code
1244 static ail_error_e _add_desktop_fota(const char *appid)
1245 {
1246         ail_error_e ret;
1247
1248         if (!appid) {
1249                 return AIL_ERROR_FAIL;
1250         }
1251
1252         ret = ail_desktop_fota(appid);
1253         if (ret != AIL_ERROR_OK) {
1254                 return AIL_ERROR_FAIL;
1255         }
1256
1257         return AIL_ERROR_OK;
1258 }
1259  * @endcode
1260  */
1261 ail_error_e ail_desktop_fota(const char *appid);
1262 ail_error_e ail_usr_desktop_fota(const char *appid, uid_t uid);
1263 /**
1264  *@fn ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast)
1265  * @fn ail_error_e ail_desktop_appinfo_modify_usr_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast)
1266  * @brief update a app information db.
1267         And a notification is published to the applications who want to know about changing DB.
1268  *
1269  * @par Sync (or) Async : Synchronous API.
1270  *
1271  * @param[in] appid
1272  * @param[in] uid       ID of the owner of the application
1273  *
1274  * @return 0 if success, negative value(<0) if fail\n
1275  * @retval      AIL_ERROR_OK                                    success
1276  * @retval      AIL_ERROR_FAIL                                  internal error
1277  * @retval      AIL_ERROR_INVALID_PARAMETER             invalid parameter
1278  *
1279  * @pre no pre-condition.
1280  * @post app information is removed in the Application Information Database.
1281  *
1282  *
1283  * @par Prospective Clients:
1284  * External Apps.
1285  *
1286  * @code
1287 static ail_error_e _appinfo_modify_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast)
1288 {
1289         ail_error_e ret;
1290
1291         if (!appid) {
1292                 return AIL_ERROR_FAIL;
1293         }
1294         if (!property) {
1295                 return AIL_ERROR_FAIL;
1296         }
1297         if (!value) {
1298                 return AIL_ERROR_FAIL;
1299         }
1300
1301         ret = ail_desktop_appinfo_modify_str(appid, property, value, broadcast);
1302         if (ret != AIL_ERROR_OK) {
1303                 return AIL_ERROR_FAIL;
1304         }
1305
1306         return AIL_ERROR_OK;
1307 }
1308  * @endcode
1309  */
1310
1311 ail_error_e ail_desktop_appinfo_modify_str(const char *appid, const char *property, const char *value, bool broadcast);
1312 ail_error_e ail_desktop_appinfo_modify_usr_str(const char *appid, uid_t uid, const char *property, const char *value, bool broadcast);
1313 /** @} */
1314
1315
1316 #ifdef __cplusplus
1317 }
1318 #endif /* __cplusplus */
1319
1320 #endif /* __AIL_H__ */
1321 // End of a file