71247de42ad6711d17ce0c9286b58c9d0e986825
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.h
1 /*
2  * pkgmgr-info
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>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 /**
24  * @file                pkgmgr-info.h
25  * @author              Sewook Park <sewook7.park@samsung.com>
26  * @author              Shobhit Srivastava <shobhit.s@samsung.com>
27  * @version             0.1
28  * @brief               This file declares API of pkgmgr-info library
29  *
30  * @addtogroup          APPLICATION_FRAMEWORK
31  * @{
32  *
33  * @defgroup            PackageManagerInfo
34  * @section             Header Header file to include:
35  * @code
36  * #include             <pkgmgr-info.h>
37  * @endcode
38  *
39  * @}
40  */
41
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
44
45 #include <errno.h>
46 #include <stdbool.h>
47 #include <unistd.h>
48 #include <sys/types.h>
49
50 #include "pkgmgrinfo_type.h"
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56
57 /**
58  * @mainpage
59  *
60  * This is package information library
61  *
62  * Package Information Library is used to get package related information.\n
63  * It uses the package manifest information database to get any package related information\n
64  * It also provides API to set information in the package info database\n
65  *
66  */
67
68 /**
69  * @file        pkgmgr-info.h
70  * @brief       Package Information Library Header File
71  *
72  * Generated by    Sewook Park <sewook7.park@samsung.com>
73  */
74
75
76
77  /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID          "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79  /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE        "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81  /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION     "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83  /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION            "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85   /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE           "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87  /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89  /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL                "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91  /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93  /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE           "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
95
96  /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE           "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98  /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD             "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100  /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY            "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102    /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM              "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104   /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE              "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106   /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING          "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108    /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING           "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110    /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE             "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112    /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE             "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114    /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE               "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
116
117  /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE                "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
119
120  /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID              "PMINFO_APPINFO_PROP_APP_ID"
122  /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT               "PMINFO_APPINFO_PROP_APP_COMPONENT"
124  /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC            "PMINFO_APPINFO_PROP_APP_EXEC"
126  /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON            "PMINFO_APPINFO_PROP_APP_ICON"
128  /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE            "PMINFO_APPINFO_PROP_APP_TYPE"
130  /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION       "PMINFO_APPINFO_PROP_APP_OPERATION"
132  /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI                     "PMINFO_APPINFO_PROP_APP_URI"
134  /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME            "PMINFO_APPINFO_PROP_APP_MIME"
136  /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY        "PMINFO_APPINFO_PROP_APP_CATEGORY"
138  /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION  "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140  /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER    "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142  /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE         "PMINFO_APPINFO_PROP_APP_PACKAGE"
144  /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE               "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
146  /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_PRIVILEGE   "PMINFO_APPINFO_PROP_PRIVILEGE"
148
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE            "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
151
152  /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY               "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154  /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE                "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156  /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT                  "PMINFO_APPINFO_PROP_APP_ONBOOT"
158  /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART     "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160  /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE      "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162  /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164  /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET       "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166  /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168  /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170  /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE   "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
174
175  /** will be updated*/
176  /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
178
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 char *getUserPkgCertDBPathUID(uid_t uid);
185 const char *getUserManifestPath(uid_t uid, bool readonly);
186
187 /**
188  * @fn  int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
189  * @fn  int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
190  * @brief       This API gets list of installed packages
191  *
192  * @par         This API is for package-manager client application
193  * @par Sync (or) Async : Synchronous API
194  * @param[in]   pkg_list_cb     iteration function for list
195  * @param[in]   user_data       user data to be passed to callback function
196  * @param[in]   uid     the addressee user id of the instruction
197  * @return      0 if success, error code(<0) if fail
198  * @retval      PMINFO_R_OK     success
199  * @retval      PMINFO_R_EINVAL invalid argument
200  * @retval      PMINFO_R_ERROR  internal error
201  * @pre         None
202  * @post        None
203  * @code
204 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
205 {
206         char *pkgid1 = NULL;
207         char *pkgid2 = NULL;
208         pkgid1 = (char *)user_data;
209         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
210         if (strcmp(pkgid1, pkgid2) == 0) {
211                 return -1;
212         } else {
213                 return 0;
214         }
215 }
216
217 static int list_pkgs()
218 {
219         int ret = 0;
220         char *name = "helloworld";
221         ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
222         if (ret != PMINFO_R_OK) {
223                 return -1;
224         }
225         return 0;
226 }
227  * @endcode
228  */
229 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
230 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
231
232 /**
233  * @fn  int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
234  * @fn  int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
235  * @brief       This API gets list of disabled packages
236  *
237  * @par         This API is for package-manager client application
238  * @par Sync (or) Async : Synchronous API
239  * @param[in]   pkg_list_cb     iteration function for list
240  * @param[in]   user_data       user data to be passed to callback function
241  * @param[in]   uid     the addressee user id of the instruction
242  * @return      0 if success, error code(<0) if fail
243  * @retval      PMINFO_R_OK     success
244  * @retval      PMINFO_R_EINVAL invalid argument
245  * @retval      PMINFO_R_ERROR  internal error
246  * @pre         None
247  * @post        None
248  */
249 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
250 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
251
252 /**
253  * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
254  * @brief       This API creates the package information handle from db which is not disabled
255  *
256  * @par         This API is for package-manager client application
257  * @par Sync (or) Async : Synchronous API
258  *
259  * @param[in]   pkgid   pointer to package ID
260  * @param[in]   uid     the addressee user id of the instruction
261  * @param[out] handle           pointer to the package info handle.
262  * @return      0 if success, error code(<0) if fail
263  * @retval      PMINFO_R_OK     success
264  * @retval      PMINFO_R_EINVAL invalid argument
265  * @retval      PMINFO_R_ERROR  internal error
266  * @pre         None
267  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
268  * @see         pkgmgrinfo_pkginfo_get_pkgid()
269  * @see         pkgmgrinfo_pkginfo_is_removable()
270  * @code
271 static int get_pkg_type(const char *pkgid)
272 {
273         int ret = 0;
274         char *type = NULL;
275         pkgmgrinfo_pkginfo_h handle;
276         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
277         if (ret != PMINFO_R_OK)
278                 return -1;
279         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
280         if (ret != PMINFO_R_OK) {
281                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
282                 return -1;
283         }
284         printf("pkgtype: %s\n", type);
285         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
286         return 0;
287 }
288  * @endcode
289  */
290 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
291 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
292
293 /**
294  * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
295  * @brief       This API creates the disabled package information handle from db
296  *
297  * @par         This API is for package-manager client application
298  * @par Sync (or) Async : Synchronous API
299  *
300  * @param[in]   pkgid   pointer to package ID
301  * @param[in]   uid     the addressee user id of the instruction
302  * @param[out] handle           pointer to the package info handle.
303  * @return      0 if success, error code(<0) if fail
304  * @retval      PMINFO_R_OK     success
305  * @retval      PMINFO_R_EINVAL invalid argument
306  * @retval      PMINFO_R_ERROR  internal error
307  * @pre         None
308  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
309  * @see         pkgmgrinfo_pkginfo_get_pkginfo()
310  */
311 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
312 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
313
314 /**
315  * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
316  * @brief       This API creates the package information handle from db regardless of its disable or storage status
317  *
318  * @par         This API is for package-manager client application
319  * @par Sync (or) Async : Synchronous API
320  *
321  * @param[in]   pkgid   pointer to package ID
322  * @param[in]   uid     the addressee user id of the instruction
323  * @param[out] handle           pointer to the package info handle.
324  * @return      0 if success, error code(<0) if fail
325  * @retval      PMINFO_R_OK     success
326  * @retval      PMINFO_R_EINVAL invalid argument
327  * @retval      PMINFO_R_ERROR  internal error
328  * @pre         None
329  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
330  * @see         pkgmgrinfo_pkginfo_get_pkgid()
331  * @see         pkgmgrinfo_pkginfo_is_removable()
332  * @code
333 static int get_pkg_type(const char *pkgid)
334 {
335         int ret = 0;
336         char *type = NULL;
337         pkgmgrinfo_pkginfo_h handle;
338         ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
339         if (ret != PMINFO_R_OK)
340                 return -1;
341         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
342         if (ret != PMINFO_R_OK) {
343                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
344                 return -1;
345         }
346         printf("pkgtype: %s\n", type);
347         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
348         return 0;
349 }
350  * @endcode
351  */
352 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
353 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
354
355 /**
356  * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
357  * @brief       This API gets the package name from the package ID
358  *
359  * @par         This API is for package-manager client application
360  * @par Sync (or) Async : Synchronous API
361  *
362  * @param[in]   handle  pointer to package info handle
363  * @param[out]  pkg_name        pointer to hold package name
364  * @return      0 if success, error code(<0) if fail
365  * @retval      PMINFO_R_OK     success
366  * @retval      PMINFO_R_EINVAL invalid argument
367  * @retval      PMINFO_R_ERROR  internal error
368  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
369  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
370  * @see         pkgmgrinfo_pkginfo_get_type()
371  * @see         pkgmgrinfo_pkginfo_is_removable()
372  * @code
373 static int get_pkg_name(const char *pkgid)
374 {
375         int ret = 0;
376         char *pkgname = NULL;
377         pkgmgrinfo_pkginfo_h handle;
378         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
379         if (ret != PMINFO_R_OK)
380                 return -1;
381         ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
382         if (ret != PMINFO_R_OK) {
383                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
384                 return -1;
385         }
386         printf("pkgname: %s\n", pkgname);
387         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
388         return 0;
389 }
390  * @endcode
391  */
392 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
393
394 /**
395  * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
396  * @brief       This API gets the package id from the package ID
397  *
398  * @par         This API is for package-manager client application
399  * @par Sync (or) Async : Synchronous API
400  *
401  * @param[in]   handle  pointer to package info handle
402  * @param[out]  pkgid   pointer to hold package id
403  * @return      0 if success, error code(<0) if fail
404  * @retval      PMINFO_R_OK     success
405  * @retval      PMINFO_R_EINVAL invalid argument
406  * @retval      PMINFO_R_ERROR  internal error
407  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
408  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
409  * @see         pkgmgrinfo_pkginfo_get_type()
410  * @see         pkgmgrinfo_pkginfo_is_removable()
411  * @code
412 static int get_pkgid(const char *pkgid)
413 {
414         int ret = 0;
415         char *pkg_id = NULL;
416         pkgmgrinfo_pkginfo_h handle;
417         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
418         if (ret != PMINFO_R_OK)
419                 return -1;
420         ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
421         if (ret != PMINFO_R_OK) {
422                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
423                 return -1;
424         }
425         printf("pkg id: %s\n", pkg_id);
426         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
427         return 0;
428 }
429  * @endcode
430  */
431 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
432
433 /**
434  * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
435  * @brief       This API gets the package type from the package ID
436  *
437  * @par         This API is for package-manager client application
438  * @par Sync (or) Async : Synchronous API
439  *
440  * @param[in]   handle  pointer to package info handle
441  * @param[out] type             pointer to hold package type
442  * @return      0 if success, error code(<0) if fail
443  * @retval      PMINFO_R_OK     success
444  * @retval      PMINFO_R_EINVAL invalid argument
445  * @retval      PMINFO_R_ERROR  internal error
446  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
447  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
448  * @see         pkgmgrinfo_pkginfo_get_pkgid()
449  * @see         pkgmgrinfo_pkginfo_is_removable()
450  * @code
451 static int get_pkg_type(const char *pkgid)
452 {
453         int ret = 0;
454         char *type = NULL;
455         pkgmgrinfo_pkginfo_h handle;
456         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
457         if (ret != PMINFO_R_OK)
458                 return -1;
459         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
460         if (ret != PMINFO_R_OK) {
461                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
462                 return -1;
463         }
464         printf("pkgtype: %s\n", type);
465         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
466         return 0;
467 }
468  * @endcode
469  */
470 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
471
472 /**
473  * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
474  * @brief       This API gets the package version from the package ID
475  *
476  * @par         This API is for package-manager client application
477  * @par Sync (or) Async : Synchronous API
478  *
479  * @param[in]   handle  pointer to package info handle
480  * @param[out] version          pointer to hold package version
481  * @return      0 if success, error code(<0) if fail
482  * @retval      PMINFO_R_OK     success
483  * @retval      PMINFO_R_EINVAL invalid argument
484  * @retval      PMINFO_R_ERROR  internal error
485  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
486  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
487  * @see         pkgmgrinfo_pkginfo_get_pkgid()
488  * @see         pkgmgrinfo_pkginfo_is_removable()
489  * @code
490 static int get_pkg_version(const char *pkgid)
491 {
492         int ret = 0;
493         char *version = NULL;
494         pkgmgrinfo_pkginfo_h handle;
495         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
496         if (ret != PMINFO_R_OK)
497                 return -1;
498         ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
499         if (ret != PMINFO_R_OK) {
500                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
501                 return -1;
502         }
503         printf("pkg version: %s\n", version);
504         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
505         return 0;
506 }
507  * @endcode
508  */
509 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
510
511 /**
512  * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
513  * @brief       This API gets the package api_version from the package ID
514  *
515  * @par         This API is for package-manager client application
516  * @par Sync (or) Async : Synchronous API
517  *
518  * @param[in]   handle  pointer to package info handle
519  * @param[out] api_version              pointer to hold package api_version
520  * @return      0 if success, error code(<0) if fail
521  * @retval      PMINFO_R_OK     success
522  * @retval      PMINFO_R_EINVAL invalid argument
523  * @retval      PMINFO_R_ERROR  internal error
524  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
525  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
526  * @see         pkgmgrinfo_pkginfo_get_pkgid()
527  * @see         pkgmgrinfo_pkginfo_is_removable()
528  * @code
529 static int get_pkg_api_version(const char *pkgid)
530 {
531         int ret = 0;
532         char *api_version = NULL;
533         pkgmgrinfo_pkginfo_h handle = NULL;
534         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
535         if (ret != PMINFO_R_OK)
536                 return -1;
537         ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
538         if (ret != PMINFO_R_OK) {
539                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
540                 return -1;
541         }
542         printf("pkg api_version: %s\n", api_version);
543         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
544         return 0;
545 }
546  * @endcode
547  */
548 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
549
550 /**
551  * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
552  * @brief       This API gets tep(tizen expansion package) file name associated with the package
553  *
554  * @par This API is for package-manager client application
555  * @par Sync (or) Async : Synchronous API
556  *
557  * @param[in] handle    pointer to the pkginfo handle.
558  * @param[out] tep_name pointer to hold tep name
559  * @return      0 if success, error code(<0) if fail
560  * @retval      PMINFO_R_OK success
561  * @retval      PMINFO_R_EINVAL invalid argument
562  * @retval      PMINFO_R_ERROR  internal error
563  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
564  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
565  * @see pkgmgrinfo_pkginfo_get_pkgid()
566  * @code
567 static int get_tep_name(const char *pkgid)
568 {
569         int ret = 0;
570         char *tep_name = NULL;
571         pkgmgrinfo_pkginfo_h handle = NULL;
572         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
573         if (ret != PMINFO_R_OK)
574                 return -1;
575         ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
576         if (ret != PMINFO_R_OK) {
577                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
578                 return -1;
579         }
580         printf("TEP name is: %s\n", tep_name);
581         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
582         return 0;
583 }
584  * @endcode
585  */
586 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
587
588 /**
589  * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
590  * @brief       This API gets package mount point path associated with the package
591  *                      if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
592  *
593  * @par This API is for package-manager client application
594  * @par Sync (or) Async : Synchronous API
595  *
596  * @param[in] handle    pointer to the pkginfo handle.
597  * @param[out] zip_mount_file   pointer to hold zip mount file
598  * @return      0 if success, error code(<0) if fail
599  * @retval      PMINFO_R_OK success
600  * @retval      PMINFO_R_EINVAL invalid argument
601  * @retval      PMINFO_R_ERROR  internal error
602  * @pre pkgmgrinfo_pkginfo_get_pkginfo()
603  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
604  * @see pkgmgrinfo_pkginfo_get_pkgid()
605  * @code
606 static int get_zip_mount_file(const char *pkgid)
607 {
608         int ret = 0;
609         char *zip_mount_file = NULL;
610         pkgmgrinfo_pkginfo_h handle = NULL;
611         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
612         if (ret != PMINFO_R_OK)
613                 return -1;
614         ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
615         if (ret != PMINFO_R_OK) {
616                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
617                 return -1;
618         }
619         if (zip_mount_file != NULL)
620                 printf("Zip mount path is: %s\n", zip_mount_file);
621         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
622         return 0;
623 }
624  * @endcode
625  */
626 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
627
628 /**
629  * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
630  * @brief       This API gets package external image path associated with the package
631  *                      if package is installed in external storage.
632  *                      Otherwise, the return value will be PMINFO_R_ENOENT.
633  *
634  * @par This API is for package-manager client application
635  * @par Sync (or) Async : Synchronous API
636  *
637  * @param[in] handle    pointer to the pkginfo handle.
638  * @param[out] ext_image_path   pointer to hold external image path
639  * @return      0 if success, error code(<0) if fail
640  * @retval      PMINFO_R_OK success
641  * @retval      PMINFO_R_EINVAL invalid argument
642  * @retval      PMINFO_R_ERROR  internal error
643  * @revall      PMINFO_R_ENOENT no valid data
644  * @pre pkgmgrinfo_pkginfo_get_pkginfo()
645  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
646  * @see pkgmgrinfo_pkginfo_get_pkgid()
647  * @code
648 static int get_external_image_path(const char *pkgid)
649 {
650         int ret = 0;
651         char *ext_image_path = NULL;
652         pkgmgrinfo_pkginfo_h handle = NULL;
653         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
654         if (ret != PMINFO_R_OK)
655                 return -1;
656         ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
657         if (ret != PMINFO_R_OK) {
658                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659                 return -1;
660         }
661         printf("external image path is: %s\n", ext_image_path);
662         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
663         return 0;
664 }
665  * @endcode
666  */
667 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
668
669 /**
670  * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
671  * @brief       This API gets the package install location from the package ID
672  *
673  * @par         This API is for package-manager client application
674  * @par Sync (or) Async : Synchronous API
675  *
676  * @param[in] handle    pointer to package info handle
677  * @param[out] location         pointer to hold package install location
678  * @return      0 if success, error code(<0) if fail
679  * @retval      PMINFO_R_OK     success
680  * @retval      PMINFO_R_EINVAL invalid argument
681  * @retval      PMINFO_R_ERROR  internal error
682  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
683  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
684  * @see         pkgmgrinfo_pkginfo_get_pkgid()
685  * @see         pkgmgrinfo_pkginfo_is_removable()
686  * @code
687 static int get_pkg_install_location(const char *pkgid)
688 {
689         int ret = 0;
690         pkgmgrinfo_install_location location;
691         pkgmgrinfo_pkginfo_h handle;
692         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
693         if (ret != PMINFO_R_OK)
694                 return -1;
695         ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
696         if (ret != PMINFO_R_OK) {
697                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
698                 return -1;
699         }
700         printf("pkg install location: %d\n", location);
701         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
702         return 0;
703 }
704  * @endcode
705  */
706 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
707
708 /**
709  * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
710  * @brief       This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
711  size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
712  the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
713  *
714  * @par         This API is for package-manager client application
715  * @par Sync (or) Async : Synchronous API
716  *
717  * @param[in]   handle  pointer to package info handle
718  * @param[out] size             pointer to hold package size
719  * @return      0 if success, error code(<0) if fail
720  * @retval      PMINFO_R_OK     success
721  * @retval      PMINFO_R_EINVAL invalid argument
722  * @retval      PMINFO_R_ERROR  internal error
723  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
724  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
725  * @see         pkgmgrinfo_pkginfo_get_pkgid()
726  * @see         pkgmgrinfo_pkginfo_is_removable()
727  * @code
728 static int get_pkg_size(const char *pkgid)
729 {
730         int ret = 0;
731         int size = 0;
732         pkgmgrinfo_pkginfo_h handle;
733         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
734         if (ret != PMINFO_R_OK)
735                 return -1;
736         ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
737         if (ret != PMINFO_R_OK) {
738                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739                 return -1;
740         }
741         printf("pkgsize: %d\n", size);
742         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
743         return 0;
744 }
745  * @endcode
746  */
747 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
748
749 /**
750  * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
751  * @brief       This API gets the package icon from the package ID
752  *
753  * @par         This API is for package-manager client application
754  * @par Sync (or) Async : Synchronous API
755  *
756  * @param[in]   handle  pointer to package info handle
757  * @param[out] icon             pointer to hold package icon
758  * @return      0 if success, error code(<0) if fail
759  * @retval      PMINFO_R_OK     success
760  * @retval      PMINFO_R_EINVAL invalid argument
761  * @retval      PMINFO_R_ERROR  internal error
762  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
763  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
764  * @see         pkgmgrinfo_pkginfo_get_pkgid()
765  * @see         pkgmgrinfo_pkginfo_is_removable()
766  * @code
767 static int get_pkg_icon(const char *pkgid)
768 {
769         int ret = 0;
770         char *icon = NULL;
771         pkgmgrinfo_pkginfo_h handle;
772         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
773         if (ret != PMINFO_R_OK)
774                 return -1;
775         ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
776         if (ret != PMINFO_R_OK) {
777                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
778                 return -1;
779         }
780         printf("pkg icon: %s\n", icon);
781         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782         return 0;
783 }
784  * @endcode
785  */
786 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
787
788 /**
789  * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
790  * @brief       This API gets the package label from the package ID
791  *
792  * @par         This API is for package-manager client application
793  * @par Sync (or) Async : Synchronous API
794  *
795  * @param[in]   handle  pointer to package info handle
796  * @param[out] label            pointer to hold package label
797  * @return      0 if success, error code(<0) if fail
798  * @retval      PMINFO_R_OK     success
799  * @retval      PMINFO_R_EINVAL invalid argument
800  * @retval      PMINFO_R_ERROR  internal error
801  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
802  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
803  * @see         pkgmgrinfo_pkginfo_get_pkgid()
804  * @see         pkgmgrinfo_pkginfo_is_removable()
805  * @code
806 static int get_pkg_label(const char *pkgid)
807 {
808         int ret = 0;
809         char *label = NULL;
810         pkgmgrinfo_pkginfo_h handle;
811         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
812         if (ret != PMINFO_R_OK)
813                 return -1;
814         ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
815         if (ret != PMINFO_R_OK) {
816                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
817                 return -1;
818         }
819         printf("pkg label: %s\n", label);
820         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
821         return 0;
822 }
823  * @endcode
824  */
825 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
826
827 /**
828  * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
829  * @brief       This API gets the package description from the package ID
830  *
831  * @par         This API is for package-manager client application
832  * @par Sync (or) Async : Synchronous API
833  *
834  * @param[in]   handle  pointer to package info handle
835  * @param[out] description              pointer to hold package description
836  * @return      0 if success, error code(<0) if fail
837  * @retval      PMINFO_R_OK     success
838  * @retval      PMINFO_R_EINVAL invalid argument
839  * @retval      PMINFO_R_ERROR  internal error
840  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
841  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
842  * @see         pkgmgrinfo_pkginfo_get_pkgid()
843  * @see         pkgmgrinfo_pkginfo_is_removable()
844  * @code
845 static int get_pkg_description(const char *pkgid)
846 {
847         int ret = 0;
848         char *description = NULL;
849         pkgmgrinfo_pkginfo_h handle;
850         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
851         if (ret != PMINFO_R_OK)
852                 return -1;
853         ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
854         if (ret != PMINFO_R_OK) {
855                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
856                 return -1;
857         }
858         printf("pkg description: %s\n", description);
859         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
860         return 0;
861 }
862  * @endcode
863  */
864 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
865
866 /**
867  * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
868  * @brief       This API gets the package's author name from the package ID
869  *
870  * @par         This API is for package-manager client application
871  * @par Sync (or) Async : Synchronous API
872  *
873  * @param[in]   handle  pointer to package info handle
874  * @param[out] author_name              pointer to hold package author name
875  * @return      0 if success, error code(<0) if fail
876  * @retval      PMINFO_R_OK     success
877  * @retval      PMINFO_R_EINVAL invalid argument
878  * @retval      PMINFO_R_ERROR  internal error
879  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
880  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
881  * @see         pkgmgrinfo_pkginfo_get_pkgid()
882  * @see         pkgmgrinfo_pkginfo_is_removable()
883  * @code
884 static int get_pkg_author_name(const char *pkgid)
885 {
886         int ret = 0;
887         char *author_name = NULL;
888         pkgmgrinfo_pkginfo_h handle;
889         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
890         if (ret != PMINFO_R_OK)
891                 return -1;
892         ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
893         if (ret != PMINFO_R_OK) {
894                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
895                 return -1;
896         }
897         printf("pkg author name: %s\n", author_name);
898         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
899         return 0;
900 }
901  * @endcode
902  */
903 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
904
905 /**
906  * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
907  * @brief       This API gets the package's author email from the package ID
908  *
909  * @par         This API is for package-manager client application
910  * @par Sync (or) Async : Synchronous API
911  *
912  * @param[in]   handle  pointer to package info handle
913  * @param[out] author_email             pointer to hold package author email
914  * @return      0 if success, error code(<0) if fail
915  * @retval      PMINFO_R_OK     success
916  * @retval      PMINFO_R_EINVAL invalid argument
917  * @retval      PMINFO_R_ERROR  internal error
918  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
919  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
920  * @see         pkgmgrinfo_pkginfo_get_pkgid()
921  * @see         pkgmgrinfo_pkginfo_is_removable()
922  * @code
923 static int get_pkg_author_email(const char *pkgid)
924 {
925         int ret = 0;
926         char *author_email = NULL;
927         pkgmgrinfo_pkginfo_h handle;
928         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
929         if (ret != PMINFO_R_OK)
930                 return -1;
931         ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
932         if (ret != PMINFO_R_OK) {
933                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
934                 return -1;
935         }
936         printf("pkg author email: %s\n", author_email);
937         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
938         return 0;
939 }
940  * @endcode
941  */
942 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
943
944 /**
945  * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
946  * @brief       This API gets the package's author href from the package ID
947  *
948  * @par         This API is for package-manager client application
949  * @par Sync (or) Async : Synchronous API
950  *
951  * @param[in]   handle  pointer to package info handle
952  * @param[out] author_href              pointer to hold package author href
953  * @return      0 if success, error code(<0) if fail
954  * @retval      PMINFO_R_OK     success
955  * @retval      PMINFO_R_EINVAL invalid argument
956  * @retval      PMINFO_R_ERROR  internal error
957  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
958  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
959  * @see         pkgmgrinfo_pkginfo_get_pkgid()
960  * @see         pkgmgrinfo_pkginfo_is_removable()
961  * @code
962 static int get_pkg_author_href(const char *pkgid)
963 {
964         int ret = 0;
965         char *author_href = NULL;
966         pkgmgrinfo_pkginfo_h handle;
967         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
968         if (ret != PMINFO_R_OK)
969                 return -1;
970         ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
971         if (ret != PMINFO_R_OK) {
972                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
973                 return -1;
974         }
975         printf("pkg author href: %s\n", author_href);
976         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
977         return 0;
978 }
979  * @endcode
980  */
981 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
982
983 /**
984  * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
985  * @brief       This API gets the package installed storagae value from the package ID
986  *
987  * @par         This API is for package-manager client application
988  * @par Sync (or) Async : Synchronous API
989  *
990  * @param[in]   handle  pointer to package info handle
991  * @param[out] storage          pointer to hold package installed storage
992  * @return      0 if success, error code(<0) if fail
993  * @retval      PMINFO_R_OK     success
994  * @retval      PMINFO_R_EINVAL invalid argument
995  * @retval      PMINFO_R_ERROR  internal error
996  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
997  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
998  * @see         pkgmgrinfo_pkginfo_get_pkgid()
999  * @see         pkgmgrinfo_pkginfo_is_removable()
1000  * @code
1001 static int get_pkg_installed_storage(const char *pkgid)
1002 {
1003         int ret = 0;
1004         pkgmgrinfo_installed_storage storage;
1005         pkgmgrinfo_pkginfo_h handle;
1006         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1007         if (ret != PMINFO_R_OK)
1008                 return -1;
1009         ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1010         if (ret != PMINFO_R_OK) {
1011                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1012                 return -1;
1013         }
1014         printf("pkg installed storage: %d\n", storage);
1015         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1016         return 0;
1017 }
1018  * @endcode
1019  */
1020 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1021
1022 /**
1023  * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1024  * @brief       This API gets the installed time of package from the package ID
1025  *
1026  * @par         This API is for package-manager client application
1027  * @par Sync (or) Async : Synchronous API
1028  *
1029  * @param[in]   handle  pointer to package info handle
1030  * @param[out] installed_time           pointer to hold installed time of package
1031  * @return      0 if success, error code(<0) if fail
1032  * @retval      PMINFO_R_OK     success
1033  * @retval      PMINFO_R_EINVAL invalid argument
1034  * @retval      PMINFO_R_ERROR  internal error
1035  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1036  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1037  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1038  * @see         pkgmgrinfo_pkginfo_is_removable()
1039  * @code
1040 static int get_pkg_installed_time(const char *pkgid)
1041 {
1042         int ret = 0;
1043         int installed_time = 0;
1044         pkgmgrinfo_pkginfo_h handle;
1045         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1046         if (ret != PMINFO_R_OK)
1047                 return -1;
1048         ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1049         if (ret != PMINFO_R_OK) {
1050                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1051                 return -1;
1052         }
1053         printf("installed_time: %d\n", installed_time);
1054         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1055         return 0;
1056 }
1057  * @endcode
1058  */
1059 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1060
1061 /**
1062  * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1063  * @brief       This API creates the update info handle
1064  *
1065  * @par         This API is for package-manager client application
1066  * @par Sync (or) Async : Synchronous API
1067  *
1068  * @param[out]  handle  pointer to package update info handle
1069  * @return      0 if success, error code(<0) if fail
1070  * @retval      PMINFO_R_OK     success
1071  * @retval      PMINFO_R_EINVAL invalid argument
1072  * @retval      PMINFO_R_ERROR  internal error
1073  * @post        pkgmgrinfo_updateinfo_destroy()
1074  * @see         pkgmgrinfo_updateinfo_set_pkgid()
1075  * @see         pkgmgrinfo_updateinfo_set_version()
1076  * @see         pkgmgrinfo_updateinfo_set_type()
1077  * @see         pkgmgr_client_register_pkg_updateinfo()
1078  * @code
1079 static int updateinfo_handle_create()
1080 {
1081         int ret = 0;
1082
1083         pkgmgrinfo_updateinfo_h handle;
1084         ret = pkgmgrinfo_updateinfo_create(&handle);
1085         if (ret != PMINFO_R_OK)
1086                 return -1;
1087         pkgmgrinfo_update_infodestroy(handle);
1088         return 0;
1089 }
1090  * @endcode
1091  */
1092 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1093
1094 /**
1095  * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1096  * @brief       This API destroy the update info handle
1097  *
1098  * @par         This API is for package-manager client application
1099  * @par Sync (or) Async : Synchronous API
1100  *
1101  * @param[in]   handle  pointer to package update info handle
1102  * @return      0 if success, error code(<0) if fail
1103  * @retval      PMINFO_R_OK     success
1104  * @retval      PMINFO_R_EINVAL invalid argument
1105  * @pre         pkgmgrinfo_updateinfo_create()
1106  * @see         pkgmgr_client_register_pkg_updateinfo()
1107  * @code
1108 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1109 {
1110         int ret = 0;
1111
1112         ret = pkgmgrinfo_updateinfo_destroy(handle);
1113         if (ret != PMINFO_R_OK)
1114                 return -1;
1115         return 0;
1116 }
1117  * @endcode
1118  */
1119 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1120
1121 /**
1122  * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1123  * @brief       This API creates the package update information handle from db
1124  *
1125  * @par         This API is for package-manager client application
1126  * @par Sync (or) Async : Synchronous API
1127  *
1128  * @param[in]   pkgid   pointer to package ID
1129  * @param[in]   uid     the addressee user id of the instruction
1130  * @param[out] update_handle            pointer to the package update info handle.
1131  * @return      0 if success, error code(<0) if fail
1132  * @retval      PMINFO_R_OK     success
1133  * @retval      PMINFO_R_EINVAL invalid argument
1134  * @retval      PMINFO_R_ERROR  internal error
1135  * @pre         None
1136  * @post                pkgmgrinfo_updateinfo_destroy()
1137  * @see         pkgmgrinfo_updateinfo_get_pkgid()
1138  * @see         pkgmgrinfo_updateinfo_get_version()
1139  * @see         pkgmgrinfo_updateinfo_get_update_type()
1140  * @code
1141 static int get_pkg_update_info(const char *pkgid)
1142 {
1143         int ret = 0;
1144         char *version;
1145         pkgmgrinfo_updateinfo_h handle;
1146         ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1147         if (ret != PMINFO_R_OK)
1148                 return -1;
1149         ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1150         if (ret != PMINFO_R_OK) {
1151                 pkgmgrinfo_updateinfo_destroy(handle);
1152                 return -1;
1153         }
1154         printf("pkg update version: %s\n", version
1155         pkgmgrinfo_updateinfo_destroy(handle);
1156         return 0;
1157 }
1158  * @endcode
1159  */
1160 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1161 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1162
1163 /**
1164  * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1165  * @brief       This API sets given pkgid into handle
1166  *
1167  * @par         This API is for package-manager client application
1168  * @par Sync (or) Async : Synchronous API
1169  *
1170  * @param[in]   handle  pointer to package update info handle
1171  * @param[in]   pkgid   package id
1172  * @return      0 if success, error code(<0) if fail
1173  * @retval      PMINFO_R_OK     success
1174  * @retval      PMINFO_R_EINVAL invalid argument
1175  * @retval      PMINFO_R_ERROR  internal error
1176  * @code
1177 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1178 {
1179         int ret = 0;
1180
1181         ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1182         if (ret != PMINFO_R_OK)
1183                 return -1;
1184         return 0;
1185 }
1186  * @endcode
1187  */
1188 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1189
1190 /**
1191  * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1192  * @brief       This API sets given version into handle
1193  *
1194  * @par         This API is for package-manager client application
1195  * @par Sync (or) Async : Synchronous API
1196  *
1197  * @param[in]   handle  pointer to package update info handle
1198  * @param[in]   version update version
1199  * @return      0 if success, error code(<0) if fail
1200  * @retval      PMINFO_R_OK     success
1201  * @retval      PMINFO_R_EINVAL invalid argument
1202  * @retval      PMINFO_R_ERROR  internal error
1203  * @code
1204 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1205 {
1206         int ret = 0;
1207
1208         ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1209         if (ret != PMINFO_R_OK)
1210                 return -1;
1211         return 0;
1212 }
1213  * @endcode
1214  */
1215 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1216
1217 /**
1218  * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1219  * @brief       This API sets given update type into handle
1220  *
1221  * @par         This API is for package-manager client application
1222  * @par Sync (or) Async : Synchronous API
1223  *
1224  * @param[in]   handle  pointer to package update info handle
1225  * @param[in]   type    update type
1226  * @return      0 if success, error code(<0) if fail
1227  * @retval      PMINFO_R_OK     success
1228  * @retval      PMINFO_R_EINVAL invalid argument
1229  * @retval      PMINFO_R_ERROR  internal error
1230  * @code
1231 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1232 {
1233         int ret = 0;
1234
1235         ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1236         if (ret != PMINFO_R_OK)
1237                 return -1;
1238         return 0;
1239 }
1240  * @endcode
1241  */
1242 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1243
1244 /**
1245  * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1246  * @brief       This API retrieves the pkgid from given update info
1247  *
1248  * @par         This API is for package-manager client application
1249  * @par Sync (or) Async : Synchronous API
1250  *
1251  * @param[in]   handle  pointer to package update info handle
1252  * @param[out]  pkgid   package id
1253  * @return      0 if success, error code(<0) if fail
1254  * @retval      PMINFO_R_OK     success
1255  * @retval      PMINFO_R_EINVAL invalid argument
1256  * @retval      PMINFO_R_ERROR  internal error
1257  * @code
1258 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1259 {
1260         int ret = 0;
1261         char *pkgid;
1262
1263         ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1264         if (ret != PMINFO_R_OK)
1265                 return -1;
1266         return 0;
1267 }
1268  * @endcode
1269  */
1270 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1271
1272 /**
1273  * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1274  * @brief       This API retrieves the version from given update info
1275  *
1276  * @par         This API is for package-manager client application
1277  * @par Sync (or) Async : Synchronous API
1278  *
1279  * @param[in]   handle  pointer to package update info handle
1280  * @param[out]  version update version
1281  * @return      0 if success, error code(<0) if fail
1282  * @retval      PMINFO_R_OK     success
1283  * @retval      PMINFO_R_EINVAL invalid argument
1284  * @retval      PMINFO_R_ERROR  internal error
1285  * @code
1286 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1287 {
1288         int ret = 0;
1289         char *version;
1290
1291         ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1292         if (ret != PMINFO_R_OK)
1293                 return -1;
1294         return 0;
1295 }
1296  * @endcode
1297  */
1298 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1299
1300 /**
1301  * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1302  * @brief       This API retrieves the update type from given update info
1303  *
1304  * @par         This API is for package-manager client application
1305  * @par Sync (or) Async : Synchronous API
1306  *
1307  * @param[in]   handle  pointer to package update info handle
1308  * @param[out]  type    update type
1309  * @return      0 if success, error code(<0) if fail
1310  * @retval      PMINFO_R_OK     success
1311  * @retval      PMINFO_R_EINVAL invalid argument
1312  * @retval      PMINFO_R_ERROR  internal error
1313  * @code
1314 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1315 {
1316         int ret = 0;
1317         pkgmgrinfo_updateinfo_update_type *type;
1318
1319         ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1320         if (ret != PMINFO_R_OK)
1321                 return -1;
1322         return 0;
1323 }
1324  * @endcode
1325  */
1326 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1327
1328
1329 /**
1330  * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1331  * @brief       This API retrieve the update informations and invoke given callback for it.
1332  *
1333  * @par         This API is for package-manager client application
1334  * @par Sync (or) Async : Synchronous API
1335  *
1336  * @param[in]   callback        callback to be invoked for each retrieved informations
1337  * @param[in]   user_data       user data to be passed to callback
1338  * @return      0 if success, error code(<0) if fail
1339  * @retval      PMINFO_R_OK     success
1340  * @retval      PMINFO_R_EINVAL invalid argument
1341  * @retval      PMINFO_R_ERROR  internal error
1342  * @code
1343 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1344 {
1345         int ret = 0;
1346
1347         ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1348         if (ret != PMINFO_R_OK)
1349                 return -1;
1350         return 0;
1351 }
1352  * @endcode
1353  */
1354 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1355 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356
1357 /**
1358  * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1359  * @brief       This API gets the launch mode of package from the package ID
1360  *
1361  * @par         This API is for package-manager client application
1362  * @par Sync (or) Async : Synchronous API
1363  *
1364  * @param[in]   handle  pointer to package info handle
1365  * @param[out] mode             pointer to hold launch mode of package
1366  * @return      0 if success, error code(<0) if fail
1367  * @retval      PMINFO_R_OK     success
1368  * @retval      PMINFO_R_EINVAL invalid argument
1369  * @retval      PMINFO_R_ERROR  internal error
1370  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1371  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1372  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1373  * @see         pkgmgrinfo_pkginfo_is_removable()
1374  * @code
1375 static int get_pkg_launch_mode(const char *pkgid)
1376 {
1377         int ret = 0;
1378         char *launch_mode = NULL;
1379         pkgmgrinfo_pkginfo_h handle;
1380         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1381         if (ret != PMINFO_R_OK)
1382                 return -1;
1383         ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1384         if (ret != PMINFO_R_OK) {
1385                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1386                 return -1;
1387         }
1388         printf("launch mode: %s\n", mode);
1389         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1390         return 0;
1391 }
1392  * @endcode
1393  */
1394 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1395
1396 /**
1397  * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1398  * @brief       This API gets the store client id of package from the package ID
1399  *
1400  * @par         This API is for package-manager client application
1401  * @par Sync (or) Async : Synchronous API
1402  *
1403  * @param[in]   handle  pointer to package info handle
1404  * @param[out] storeclientid            pointer to hold store client id of package
1405  * @return      0 if success, error code(<0) if fail
1406  * @retval      PMINFO_R_OK     success
1407  * @retval      PMINFO_R_EINVAL invalid argument
1408  * @retval      PMINFO_R_ERROR  internal error
1409  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1410  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1411  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1412  * @see         pkgmgrinfo_pkginfo_is_removable()
1413  * @code
1414 static int get_pkg_storeclientid(const char *pkgid)
1415 {
1416         int ret = 0;
1417         char *storeclientid = 0;
1418         pkgmgrinfo_pkginfo_h handle;
1419         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1420         if (ret != PMINFO_R_OK)
1421                 return -1;
1422         ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1423         if (ret != PMINFO_R_OK) {
1424                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1425                 return -1;
1426         }
1427         printf(store client id: %s\n", storeclientid);
1428         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1429         return 0;
1430 }
1431  * @endcode
1432  */
1433 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1434
1435 /**
1436  * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1437  * @brief       This API gets the main app id of package from the package ID
1438  *
1439  * @par         This API is for package-manager client application
1440  * @par Sync (or) Async : Synchronous API
1441  *
1442  * @param[in]   handle  pointer to package info handle
1443  * @param[out] mainappid                pointer to hold main app id of package
1444  * @return      0 if success, error code(<0) if fail
1445  * @retval      PMINFO_R_OK     success
1446  * @retval      PMINFO_R_EINVAL invalid argument
1447  * @retval      PMINFO_R_ERROR  internal error
1448  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1449  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1450  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1451  * @see         pkgmgrinfo_pkginfo_is_removable()
1452  * @code
1453 static int get_pkg_mainappid(const char *pkgid)
1454 {
1455         int ret = 0;
1456         char *mainappid = 0;
1457         pkgmgrinfo_pkginfo_h handle;
1458         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1459         if (ret != PMINFO_R_OK)
1460                 return -1;
1461         ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1462         if (ret != PMINFO_R_OK) {
1463                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1464                 return -1;
1465         }
1466         printf(main app id: %s\n", mainappid);
1467         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1468         return 0;
1469 }
1470  * @endcode
1471  */
1472 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1473
1474 /**
1475  * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1476  * @brief       This API gets the url of package from the package ID
1477  *
1478  * @par         This API is for package-manager client application
1479  * @par Sync (or) Async : Synchronous API
1480  *
1481  * @param[in]   handle  pointer to package info handle
1482  * @param[out] url              pointer to hold url of package
1483  * @return      0 if success, error code(<0) if fail
1484  * @retval      PMINFO_R_OK     success
1485  * @retval      PMINFO_R_EINVAL invalid argument
1486  * @retval      PMINFO_R_ERROR  internal error
1487  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1488  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1489  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1490  * @see         pkgmgrinfo_pkginfo_is_removable()
1491  * @code
1492 static int get_pkg_url(const char *pkgid)
1493 {
1494         int ret = 0;
1495         char *url = 0;
1496         pkgmgrinfo_pkginfo_h handle;
1497         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1498         if (ret != PMINFO_R_OK)
1499                 return -1;
1500         ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1501         if (ret != PMINFO_R_OK) {
1502                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1503                 return -1;
1504         }
1505         printf("url : %s\n", url);
1506         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1507         return 0;
1508 }
1509  * @endcode
1510  */
1511 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1512
1513 /**
1514  * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1515  * @brief       This API gets the root path of package
1516  *
1517  * @par Sync (or) Async : Synchronous API
1518  *
1519  * @param[in] handle            pointer to package info handle
1520  * @param[out] path             pointer to hold root path of package
1521  * @return      0 if success, error code(<0) if fail
1522  * @retval      PMINFO_R_OK     success
1523  * @retval      PMINFO_R_EINVAL invalid argument
1524  * @retval      PMINFO_R_ERROR  internal error
1525  * @code
1526 static int get_root_path(const char *pkgid)
1527 {
1528         int ret = 0;
1529         char *path = 0;
1530         pkgmgrinfo_pkginfo_h handle;
1531         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1532         if (ret != PMINFO_R_OK)
1533                 return -1;
1534
1535         ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1536         if (ret != PMINFO_R_OK) {
1537                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538                 return -1;
1539         }
1540         printf("path : %s\n", path);
1541         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1542
1543         return 0;
1544 }
1545  * @endcode
1546  */
1547 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1548
1549
1550 /**
1551  * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1552  * @brief       This API gets the csc path of package
1553  *
1554  * @par Sync (or) Async : Synchronous API
1555  *
1556  * @param[in] handle            pointer to package info handle
1557  * @param[out] path             pointer to hold csc path of package
1558  * @return      0 if success, error code(<0) if fail
1559  * @retval      PMINFO_R_OK     success
1560  * @retval      PMINFO_R_EINVAL invalid argument
1561  * @retval      PMINFO_R_ERROR  internal error
1562  * @code
1563 static int get_csc_path(const char *pkgid)
1564 {
1565         int ret = 0;
1566         char *path = 0;
1567         pkgmgrinfo_pkginfo_h handle;
1568         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1569         if (ret != PMINFO_R_OK)
1570                 return -1;
1571
1572         ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1573         if (ret != PMINFO_R_OK) {
1574                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1575                 return -1;
1576         }
1577         printf("path : %s\n", path);
1578         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1579
1580         return 0;
1581 }
1582  * @endcode
1583  */
1584 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1585
1586 /**
1587  * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1588  * @brief       This API gets the support_mode of package
1589  *
1590  * @par Sync (or) Async : Synchronous API
1591  *
1592  * @param[in] handle            pointer to package info handle
1593  * @param[out] support_mode             pointer to hold support_mode of package
1594  * @return      0 if success, error code(<0) if fail
1595  * @retval      PMINFO_R_OK     success
1596  * @retval      PMINFO_R_EINVAL invalid argument
1597  * @retval      PMINFO_R_ERROR  internal error
1598  * @code
1599 static int get_support_mode(const char *pkgid)
1600 {
1601         int ret = 0;
1602         int support_mode = 0;
1603         pkgmgrinfo_pkginfo_h handle = NULL;
1604         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1605         if (ret != PMINFO_R_OK)
1606                 return -1;
1607
1608         ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1609         if (ret != PMINFO_R_OK) {
1610                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611                 return -1;
1612         }
1613         printf("support_mode : %s\n", support_mode);
1614         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1615
1616         return 0;
1617 }
1618  * @endcode
1619  */
1620 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1621
1622 /**
1623  * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1624  * @brief       This API compare the cert information from given package id
1625  *
1626  * @par         This API is for package-manager client application
1627  * @par Sync (or) Async : Synchronous API
1628  *
1629  * @param[in]   lhs_package_id  pointer to first package ID
1630  * @param[in]   rhs_package_id  pointer to second package ID
1631  * @param[out] compare_result           pointer to the compare result.
1632  * @return      0 if success, error code(<0) if fail
1633  * @retval      PMINFO_R_OK     success
1634  * @retval      PMINFO_R_EINVAL invalid argument
1635  * @retval      PMINFO_R_ERROR  internal error
1636  * @pre         None
1637  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1638  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1639  * @see         pkgmgrinfo_pkginfo_is_removable()
1640  * @code
1641 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1642 {
1643         int ret = 0;
1644         pkgmgrinfo_cert_compare_result_type_e result;
1645
1646         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1647         if (ret != PMINFO_R_OK) {
1648                 return -1;
1649         }
1650         printf("result: %d\n", result);
1651         return 0;
1652 }
1653  * @endcode
1654  */
1655 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1656 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1657 /**
1658  * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1659  * @brief       This API compare the cert information from given app id
1660  *
1661  * @par         This API is for package-manager client application
1662  * @par Sync (or) Async : Synchronous API
1663  *
1664  * @param[in]   lhs_app_id      pointer to first app ID
1665  * @param[in]   rhs_app_id      pointer to second app ID
1666  * @param[out] compare_result           pointer to the compare result.
1667  * @return      0 if success, error code(<0) if fail
1668  * @retval      PMINFO_R_OK     success
1669  * @retval      PMINFO_R_EINVAL invalid argument
1670  * @retval      PMINFO_R_ERROR  internal error
1671  * @pre         None
1672  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1673  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1674  * @see         pkgmgrinfo_pkginfo_is_removable()
1675  * @code
1676 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1677 {
1678         int ret = 0;
1679         pkgmgrinfo_cert_compare_result_type_e result;
1680
1681         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1682         if (ret != PMINFO_R_OK) {
1683                 return -1;
1684         }
1685         printf("result: %d\n", result);
1686         return 0;
1687 }
1688  * @endcode
1689  */
1690 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1691 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1692 /**
1693  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1694  * @brief       This API gets the package 'removable' value from the package ID
1695  *
1696  * @par         This API is for package-manager client application
1697  * @par Sync (or) Async : Synchronous API
1698  *
1699  * @param[in]   handle  pointer to package info handle
1700  * @param[out] removable                pointer to hold package removable value
1701  * @return      0 if success, error code(<0) if fail
1702  * @retval      PMINFO_R_OK     success
1703  * @retval      PMINFO_R_EINVAL invalid argument
1704  * @retval      PMINFO_R_ERROR  internal error
1705  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1706  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1707  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1708  * @see         pkgmgrinfo_pkginfo_is_readonly()
1709  * @code
1710 static int get_pkg_removable(const char *pkgid)
1711 {
1712         int ret = 0;
1713         bool removable;
1714         pkgmgrinfo_pkginfo_h handle;
1715         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1716         if (ret != PMINFO_R_OK)
1717                 return -1;
1718         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1719         if (ret != PMINFO_R_OK) {
1720                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1721                 return -1;
1722         }
1723         printf("pkg removable: %d\n", removable);
1724         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1725         return 0;
1726 }
1727  * @endcode
1728  */
1729 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1730
1731 /**
1732  * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1733  * @brief       This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1734  *
1735  * @par         This API is for package-manager client application
1736  * @par Sync (or) Async : Synchronous API
1737  *
1738  * @param[in]   handle  pointer to package info handle
1739  * @param[out] movable          pointer to hold package movable state
1740  * @return      0 if success, error code(<0) if fail
1741  * @retval      PMINFO_R_OK     success
1742  * @retval      PMINFO_R_EINVAL invalid argument
1743  * @retval      PMINFO_R_ERROR  internal error
1744  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1745  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1746  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1747  * @code
1748 static int get_pkg_movable(const char *pkgid)
1749 {
1750         int ret = 0;
1751         bool movable;
1752         pkgmgrinfo_pkginfo_h handle;
1753         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1754         if (ret != PMINFO_R_OK)
1755                 return -1;
1756         ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1757         if (ret != PMINFO_R_OK) {
1758                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1759                 return -1;
1760         }
1761         printf("pkg movable: %d\n", movable);
1762         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1763         return 0;
1764 }
1765  * @endcode
1766  */
1767 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1768
1769 /**
1770  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1771  * @brief       This API gets the package 'preload' value from the package ID
1772  *
1773  * @par         This API is for package-manager client application
1774  * @par Sync (or) Async : Synchronous API
1775  *
1776  * @param[in]   handle  pointer to package info handle
1777  * @param[out] preload          pointer to hold package preload value
1778  * @return      0 if success, error code(<0) if fail
1779  * @retval      PMINFO_R_OK     success
1780  * @retval      PMINFO_R_EINVAL invalid argument
1781  * @retval      PMINFO_R_ERROR  internal error
1782  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1783  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1784  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1785  * @see         pkgmgrinfo_pkginfo_is_readonly()
1786  * @code
1787 static int get_pkg_preload(const char *pkgid)
1788 {
1789         int ret = 0;
1790         bool preload;
1791         pkgmgrinfo_pkginfo_h handle;
1792         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1793         if (ret != PMINFO_R_OK)
1794                 return -1;
1795         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1796         if (ret != PMINFO_R_OK) {
1797                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1798                 return -1;
1799         }
1800         printf("pkg preload: %d\n", preload);
1801         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1802         return 0;
1803 }
1804  * @endcode
1805  */
1806 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1807
1808 /**
1809  * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1810  * @brief       This API gets the value for given handle is system or not
1811  *
1812  * @par         This API is for package-manager client application
1813  * @par Sync (or) Async : Synchronous API
1814  *
1815  * @param[in]   handle  pointer to package info handle
1816  * @param[out] system           pointer to hold  system is or not
1817  * @return      0 if success, error code(<0) if fail
1818  * @retval      PMINFO_R_OK     success
1819  * @retval      PMINFO_R_EINVAL invalid argument
1820  * @retval      PMINFO_R_ERROR  internal error
1821  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1822  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1823  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1824  * @see         pkgmgrinfo_pkginfo_is_readonly()
1825  * @code
1826 static int get_pkg_system(const char *pkgid)
1827 {
1828         int ret = 0;
1829         bool system = false;
1830         pkgmgrinfo_pkginfo_h handle = NULL;
1831         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1832         if (ret != PMINFO_R_OK)
1833                 return -1;
1834         ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1835         if (ret != PMINFO_R_OK) {
1836                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1837                 return -1;
1838         }
1839         printf("pkg system: %d\n", system);
1840         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1841         return 0;
1842 }
1843  * @endcode
1844  */
1845 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1846
1847 /**
1848  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1849  * @brief       This API gets the package 'readonly' value from the package ID
1850  *
1851  * @par         This API is for package-manager client application
1852  * @par Sync (or) Async : Synchronous API
1853  *
1854  * @param[in]   handle  pointer to package info handle
1855  * @param[out] readonly pointer to hold package readonly value
1856  * @return      0 if success, error code(<0) if fail
1857  * @retval      PMINFO_R_OK     success
1858  * @retval      PMINFO_R_EINVAL invalid argument
1859  * @retval      PMINFO_R_ERROR  internal error
1860  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1861  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1862  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1863  * @see         pkgmgrinfo_pkginfo_is_removable()
1864  * @code
1865 static int get_pkg_readonly(const char *pkgid)
1866 {
1867         int ret = 0;
1868         bool readonly;
1869         pkgmgrinfo_pkginfo_h handle;
1870         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1871         if (ret != PMINFO_R_OK)
1872                 return -1;
1873         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1874         if (ret != PMINFO_R_OK) {
1875                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1876                 return -1;
1877         }
1878         printf("pkg readonly: %d\n", readonly);
1879         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1880         return 0;
1881 }
1882  * @endcode
1883  */
1884 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1885
1886
1887 /**
1888  * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1889  * @brief       This API gets the package 'upate' value from the package ID
1890  *
1891  * @par         This API is for package-manager client application
1892  * @par Sync (or) Async : Synchronous API
1893  *
1894  * @param[in]   handle  pointer to package info handle
1895  * @param[out] update   pointer to hold package update value
1896  * @return      0 if success, error code(<0) if fail
1897  * @retval      PMINFO_R_OK     success
1898  * @retval      PMINFO_R_EINVAL invalid argument
1899  * @retval      PMINFO_R_ERROR  internal error
1900  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1901  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1902  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1903  * @code
1904 static int get_pkg_update(const char *pkgid)
1905 {
1906         int ret = 0;
1907         bool update;
1908         pkgmgrinfo_pkginfo_h handle;
1909         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1910         if (ret != PMINFO_R_OK)
1911                 return -1;
1912         ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1913         if (ret != PMINFO_R_OK) {
1914                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1915                 return -1;
1916         }
1917         printf("pkg update: %d\n", update);
1918         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1919         return 0;
1920 }
1921  * @endcode
1922  */
1923 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1924
1925 /**
1926  * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1927  * @brief       This API gets the package 'support_disable' value from the package ID
1928  *
1929  * @par         This API is for package-manager client application
1930  * @par Sync (or) Async : Synchronous API
1931  *
1932  * @param[in]   handle  pointer to package info handle
1933  * @param[out]  support_disable pointer to hold package support_disable value
1934  * @return      0 if success, error code(<0) if fail
1935  * @retval      PMINFO_R_OK     success
1936  * @retval      PMINFO_R_EINVAL invalid argument
1937  * @retval      PMINFO_R_ERROR  internal error
1938  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1939  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1940  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1941  * @code
1942 static int get_pkg_support_disable(const char *pkgid)
1943 {
1944         int ret = 0;
1945         bool support_disable;
1946         pkgmgrinfo_pkginfo_h handle = NULL;
1947         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1948         if (ret != PMINFO_R_OK)
1949                 return -1;
1950         ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1951         if (ret != PMINFO_R_OK) {
1952                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1953                 return -1;
1954         }
1955         printf("pkg support_disable: %d\n", support_disable);
1956         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1957         return 0;
1958 }
1959  * @endcode
1960  */
1961 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1962
1963 /**
1964  * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1965  * @brief       This API gets whethere the given package is global package or user package
1966  *
1967  * @par         This API is for package-manager client application
1968  * @par Sync (or) Async : Synchronous API
1969  *
1970  * @param[in]   handle  pointer to package info handle
1971  * @param[in]   global  pointer to hold package global value
1972  * @return      0 if success, error code(<0) if fail
1973  * @retval      PMINFO_R_OK     success
1974  * @retval      PMINFO_R_EINVAL invalid argument
1975  * @retval      PMINFO_R_ERROR  internal error
1976  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1977  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1978  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1979  static int get_pkg_support_disable(const char *pkgid)
1980  {
1981          int ret = 0;
1982          bool global;
1983          pkgmgrinfo_pkginfo_h handle = NULL;
1984          ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1985          if (ret != PMINFO_R_OK)
1986                  return -1;
1987          ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1988          if (ret != PMINFO_R_OK) {
1989                  pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1990                  return -1;
1991          }
1992          printf("pkg is_global: %d\n", global);
1993          pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1994          return 0;
1995  }
1996   * @endcode
1997   */
1998 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1999
2000 /**
2001  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2002  * @brief       This API gets the package 'accessible' value from the package ID
2003  *
2004  * @par         This API is for package-manager client application
2005  * @par Sync (or) Async : Synchronous API
2006  *
2007  * @param[in]   handle  pointer to package info handle
2008  * @param[out] accessible       pointer to hold package accessible value
2009  * @return      0 if success, error code(<0) if fail
2010  * @retval      PMINFO_R_OK     success
2011  * @retval      PMINFO_R_EINVAL invalid argument
2012  * @retval      PMINFO_R_ERROR  internal error
2013  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2014  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2015  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2016  * @see         pkgmgrinfo_pkginfo_is_readonly()
2017  * @code
2018 static int get_pkg_accessible(const char *pkgid)
2019 {
2020         int ret = 0;
2021         bool accessible;
2022         pkgmgrinfo_pkginfo_h handle;
2023         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2024         if (ret != PMINFO_R_OK)
2025                 return -1;
2026         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2027         if (ret != PMINFO_R_OK) {
2028                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2029                 return -1;
2030         }
2031         printf("pkg accessible: %d\n", accessible);
2032         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2033         return 0;
2034 }
2035  * @endcode
2036  */
2037 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2038
2039 /**
2040  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2041  * @brief       This API destroys the package information handle freeing up all the resources
2042  *
2043  * @par         This API is for package-manager client application
2044  * @par Sync (or) Async : Synchronous API
2045  *
2046  * @param[in]   handle  pointer to the package info handle
2047  * @return      0 if success, error code(<0) if fail
2048  * @retval      PMINFO_R_OK     success
2049  * @retval      PMINFO_R_EINVAL invalid argument
2050  * @retval      PMINFO_R_ERROR  internal error
2051  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2052  * @post                None
2053  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2054  * @see         pkgmgrinfo_pkginfo_is_removable()
2055  * @code
2056 static int get_pkg_type(const char *pkgid)
2057 {
2058         int ret = 0;
2059         char *type = NULL;
2060         pkgmgrinfo_pkginfo_h handle;
2061         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2062         if (ret != PMINFO_R_OK)
2063                 return -1;
2064         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2065         if (ret != PMINFO_R_OK) {
2066                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2067                 return -1;
2068         }
2069         printf("pkgtype: %s\n", type);
2070         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2071         return 0;
2072 }
2073  * @endcode
2074  */
2075 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2076
2077 /**
2078  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2079  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
2080  The query will search the entire package information collected from the manifest file of all the installed packages
2081  *
2082  * @par         This API is for package-manager client application
2083  * @par Sync (or) Async : Synchronous API
2084  *
2085  * @param[out] handle           pointer to the package info filter handle.
2086  * @return      0 if success, error code(<0) if fail
2087  * @retval      PMINFO_R_OK     success
2088  * @retval      PMINFO_R_EINVAL invalid argument
2089  * @retval      PMINFO_R_ERROR  internal error
2090  * @pre         None
2091  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2092  * @see         pkgmgrinfo_pkginfo_filter_count()
2093  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2094  * @code
2095 static int get_tpk_pkg_count()
2096 {
2097         int ret = 0;
2098         int count = 0;
2099         pkgmgrinfo_pkginfo_filter_h handle;
2100         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2101         if (ret != PMINFO_R_OK)
2102                 return -1;
2103         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2104         if (ret != PMINFO_R_OK) {
2105                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2106                 return -1;
2107         }
2108         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2109         if (ret != PMINFO_R_OK) {
2110                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2111                 return -1;
2112         }
2113         printf("No of tpk pkgs: %d\n", count);
2114         pkgmgrinfo_pkginfo_filter_destroy(handle);
2115         return 0;
2116 }
2117  * @endcode
2118  */
2119 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2120
2121 /**
2122  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2123  * @brief       This API destroys the package information filter handle freeing up all the resources
2124  *
2125  * @par         This API is for package-manager client application
2126  * @par Sync (or) Async : Synchronous API
2127  *
2128  * @param[in] handle            pointer to the package info filter handle.
2129  * @return      0 if success, error code(<0) if fail
2130  * @retval      PMINFO_R_OK     success
2131  * @retval      PMINFO_R_EINVAL invalid argument
2132  * @retval      PMINFO_R_ERROR  internal error
2133  * @pre         pkgmgrinfo_pkginfo_filter_create()
2134  * @post                None
2135  * @see         pkgmgrinfo_pkginfo_filter_count()
2136  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2137  * @code
2138 static int get_tpk_pkg_count()
2139 {
2140         int ret = 0;
2141         int count = 0;
2142         pkgmgrinfo_pkginfo_filter_h handle;
2143         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2144         if (ret != PMINFO_R_OK)
2145                 return -1;
2146         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2147         if (ret != PMINFO_R_OK) {
2148                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2149                 return -1;
2150         }
2151         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2152         if (ret != PMINFO_R_OK) {
2153                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2154                 return -1;
2155         }
2156         printf("No of tpk pkgs: %d\n", count);
2157         pkgmgrinfo_pkginfo_filter_destroy(handle);
2158         return 0;
2159 }
2160  * @endcode
2161  */
2162 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2163
2164 /**
2165  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2166  * @brief       This API adds a boolean filter property to the filter handle
2167  *
2168  * @par         This API is for package-manager client application
2169  * @par Sync (or) Async : Synchronous API
2170  *
2171  * @param[in] handle            pointer to the package info filter handle.
2172  * @param[in] property          boolean property name.
2173  * @param[in] value             value corresponding to the property.
2174  * @return      0 if success, error code(<0) if fail
2175  * @retval      PMINFO_R_OK     success
2176  * @retval      PMINFO_R_EINVAL invalid argument
2177  * @retval      PMINFO_R_ERROR  internal error
2178  * @pre         pkgmgrinfo_pkginfo_filter_create()
2179  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2180  * @see         pkgmgrinfo_pkginfo_filter_count()
2181  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2182  * @code
2183 static int get_preload_pkg_count()
2184 {
2185         int ret = 0;
2186         int count = 0;
2187         pkgmgrinfo_pkginfo_filter_h handle;
2188         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2189         if (ret != PMINFO_R_OK)
2190                 return -1;
2191         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2192         if (ret != PMINFO_R_OK) {
2193                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2194                 return -1;
2195         }
2196         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2197         if (ret != PMINFO_R_OK) {
2198                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2199                 return -1;
2200         }
2201         printf("No of preload pkgs: %d\n", count);
2202         pkgmgrinfo_pkginfo_filter_destroy(handle);
2203         return 0;
2204 }
2205  * @endcode
2206  */
2207 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2208                 const char *property, const bool value);
2209
2210 /**
2211  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2212  * @brief       This API adds an integer filter property to the filter handle
2213  *
2214  * @par         This API is for package-manager client application
2215  * @par Sync (or) Async : Synchronous API
2216  *
2217  * @param[in] handle            pointer to the package info filter handle.
2218  * @param[in] property          integer property name.
2219  * @param[in] value             value corresponding to the property.
2220  * @return      0 if success, error code(<0) if fail
2221  * @retval      PMINFO_R_OK     success
2222  * @retval      PMINFO_R_EINVAL invalid argument
2223  * @retval      PMINFO_R_ERROR  internal error
2224  * @pre         pkgmgrinfo_pkginfo_filter_create()
2225  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2226  * @see         pkgmgrinfo_pkginfo_filter_count()
2227  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2228  * @code
2229 static int get_pkg_count()
2230 {
2231         int ret = 0;
2232         int count = 0;
2233         pkgmgrinfo_pkginfo_filter_h handle;
2234         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2235         if (ret != PMINFO_R_OK)
2236                 return -1;
2237         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2238         if (ret != PMINFO_R_OK) {
2239                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2240                 return -1;
2241         }
2242         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2243         if (ret != PMINFO_R_OK) {
2244                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2245                 return -1;
2246         }
2247         printf("No of preload pkgs: %d\n", count);
2248         pkgmgrinfo_pkginfo_filter_destroy(handle);
2249         return 0;
2250 }
2251  * @endcode
2252  */
2253 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2254                 const char *property, const int value);
2255
2256 /**
2257  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2258  * @brief       This API adds a string filter property to the filter handle
2259  *
2260  * @par         This API is for package-manager client application
2261  * @par Sync (or) Async : Synchronous API
2262  *
2263  * @param[in] handle            pointer to the package info filter handle.
2264  * @param[in] property          string property name.
2265  * @param[in] value             value corresponding to the property.
2266  * @return      0 if success, error code(<0) if fail
2267  * @retval      PMINFO_R_OK     success
2268  * @retval      PMINFO_R_EINVAL invalid argument
2269  * @retval      PMINFO_R_ERROR  internal error
2270  * @pre         pkgmgrinfo_pkginfo_filter_create()
2271  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2272  * @see         pkgmgrinfo_pkginfo_filter_count()
2273  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2274  * @code
2275 static int get_tpk_pkg_count()
2276 {
2277         int ret = 0;
2278         int count = 0;
2279         pkgmgrinfo_pkginfo_filter_h handle;
2280         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2281         if (ret != PMINFO_R_OK)
2282                 return -1;
2283         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2284         if (ret != PMINFO_R_OK) {
2285                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2286                 return -1;
2287         }
2288         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2289         if (ret != PMINFO_R_OK) {
2290                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2291                 return -1;
2292         }
2293         printf("No of tpk pkgs: %d\n", count);
2294         pkgmgrinfo_pkginfo_filter_destroy(handle);
2295         return 0;
2296 }
2297  * @endcode
2298  */
2299 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2300                 const char *property, const char *value);
2301
2302 /**
2303  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2304  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
2305  *
2306  * @par         This API is for package-manager client application
2307  * @par Sync (or) Async : Synchronous API
2308  *
2309  * @param[in] handle            pointer to the package info filter handle.
2310  * @param[in] pkg_cb            callback function.
2311  * @param[in] user_data         user data to be passed to the callback function
2312  * @return      0 if success, error code(<0) if fail
2313  * @retval      PMINFO_R_OK     success
2314  * @retval      PMINFO_R_EINVAL invalid argument
2315  * @retval      PMINFO_R_ERROR  internal error
2316  * @pre         pkgmgrinfo_pkginfo_filter_create()
2317  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2318  * @see         pkgmgrinfo_pkginfo_filter_count()
2319  * @code
2320 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2321 {
2322         char *pkgid = NULL;
2323         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2324         printf("pkg id : %s\n", pkgid);
2325         return 0;
2326 }
2327
2328 static int get_tpk_pkg_list()
2329 {
2330         int ret = 0;
2331         pkgmgrinfo_pkginfo_filter_h handle;
2332         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2333         if (ret != PMINFO_R_OK)
2334                 return -1;
2335         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2336         if (ret != PMINFO_R_OK) {
2337                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2338                 return -1;
2339         }
2340         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2341         if (ret != PMINFO_R_OK) {
2342                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2343                 return -1;
2344         }
2345         pkgmgrinfo_pkginfo_filter_destroy(handle);
2346         return 0;
2347 }
2348  * @endcode
2349  */
2350 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2351                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2352 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2353                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2354
2355 /**
2356  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2357  * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2358  * @brief       This API counts the package that satisfy the filter conditions
2359  *
2360  * @par         This API is for package-manager client application
2361  * @par Sync (or) Async : Synchronous API
2362  *
2363  * @param[in] handle            pointer to the package info filter handle.
2364  * @param[in] count             pointer to store the count value.
2365  * @param[in]   uid     the addressee user id of the instruction
2366  * @return      0 if success, error code(<0) if fail
2367  * @retval      PMINFO_R_OK     success
2368  * @retval      PMINFO_R_EINVAL invalid argument
2369  * @retval      PMINFO_R_ERROR  internal error
2370  * @pre         pkgmgrinfo_pkginfo_filter_create()
2371  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2372  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2373  * @code
2374 static int get_tpk_pkg_count()
2375 {
2376         int ret = 0;
2377         int count = 0;
2378         pkgmgrinfo_pkginfo_filter_h handle;
2379         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2380         if (ret != PMINFO_R_OK)
2381                 return -1;
2382         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2383         if (ret != PMINFO_R_OK) {
2384                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2385                 return -1;
2386         }
2387         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2388         if (ret != PMINFO_R_OK) {
2389                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2390                 return -1;
2391         }
2392         printf("No of tpk pkgs: %d\n", count);
2393         pkgmgrinfo_pkginfo_filter_destroy(handle);
2394         return 0;
2395 }
2396  * @endcode
2397  */
2398 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2399 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2400
2401 /**
2402  * @fn  int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2403                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2404  * @brief       This API gets the list of privilege for a particular package
2405  *
2406  * @par         This API is for package-manager client application
2407  * @par Sync (or) Async : Synchronous API
2408  * @param[in]   handle          pointer to the package info handle.
2409  * @param[in]   privilege_func          callback function for list
2410  * @param[in] user_data user data to be passed to callback function
2411  * @return      0 if success, error code(<0) if fail
2412  * @retval      PMINFO_R_OK     success
2413  * @retval      PMINFO_R_EINVAL invalid argument
2414  * @retval      PMINFO_R_ERROR  internal error
2415  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2416  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2417  * @code
2418 int privilege_func(const char *name, void *user_data)
2419 {
2420         if (strcmp(name, (char *)user_data) == 0)
2421                 return -1;
2422         else
2423                 return 0;
2424 }
2425
2426 static int list_privilege(const char *package, char *privilege)
2427 {
2428         int ret = 0;
2429         pkgmgrinfo_pkginfo_h handle;
2430         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2431         if (ret != PMINFO_R_OK)
2432                 return -1;
2433         ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2434         if (ret != PMINFO_R_OK) {
2435                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2436                 return -1;
2437         }
2438         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2439         return 0;
2440 }
2441  * @endcode
2442  */
2443 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2444                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2445
2446 /**
2447  * @fn  int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2448                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2449  * @brief       This API gets the list of appdefined privilege for a particular package
2450  *
2451  * @par         This API is for package-manager client application
2452  * @par Sync (or) Async : Synchronous API
2453  * @param[in]   handle          pointer to the package info handle.
2454  * @param[in]   privilege_func          callback function for list
2455  * @param[in] user_data user data to be passed to callback function
2456  * @return      0 if success, error code(<0) if fail
2457  * @retval      PMINFO_R_OK     success
2458  * @retval      PMINFO_R_EINVAL invalid argument
2459  * @retval      PMINFO_R_ERROR  internal error
2460  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2461  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2462  * @code
2463 int privilege_func(const char *name, const char *license_path, void *user_data)
2464 {
2465         printf("appdefined privilege : %s", name);
2466         if (license_path)
2467                 printf("licensed privilege, lecense path : %s", license_path);
2468         return 0;
2469 }
2470
2471 static int list_appdefined_privilege(const char *package)
2472 {
2473         int ret = 0;
2474         pkgmgrinfo_pkginfo_h handle;
2475         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2476         if (ret != PMINFO_R_OK)
2477                 return -1;
2478         ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2479         if (ret != PMINFO_R_OK) {
2480                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2481                 return -1;
2482         }
2483         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2484         return 0;
2485 }
2486  * @endcode
2487  */
2488 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2489                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2490
2491 /* TODO: add doxygen comment here */
2492 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2493
2494 /**
2495  * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2496  * @brief       This API copy the application information handle
2497  *
2498  * @par         This API is for package-manager client application
2499  * @par Sync (or) Async : Synchronous API
2500  *
2501  * @param[in]   handle  pointer to the package info handle.
2502  * @param[out]  handle  pointer to the package info handle.
2503  * @return      0 if success, error code(<0) if fail
2504  * @retval      PMINFO_R_OK     success
2505  * @retval      PMINFO_R_EINVAL invalid argument
2506  * @retval      PMINFO_R_ERROR  internal error
2507  * @pre         None
2508  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
2509  * @code
2510 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2511 {
2512         int ret = 0;
2513
2514         pkgmgrinfo_pkginfo_h clone;
2515
2516         ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2517         if (ret != PMINFO_R_OK)
2518                 return -1;
2519
2520
2521         printf("package: %s\n", clone->package);
2522         pkgmgrinfo_appinfo_destroy_appinfo(clone);
2523         return 0;
2524 }
2525  * @endcode
2526  */
2527 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2528
2529
2530 /**
2531  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2532  pkgmgrinfo_app_list_cb app_func, void *user_data)
2533  * @brief       This API gets list of installed applications for a particular package
2534  *
2535  * @par         This API is for package-manager client application
2536  * @par Sync (or) Async : Synchronous API
2537  * @param[in]   handle          package info handle
2538  * @param[in]   component       application component
2539  * @param[in]   app_func                iteration function for list
2540  * @param[in] user_data user data to be passed to callback function
2541  * @return      0 if success, error code(<0) if fail
2542  * @retval      PMINFO_R_OK     success
2543  * @retval      PMINFO_R_EINVAL invalid argument
2544  * @retval      PMINFO_R_ERROR  internal error
2545  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2546  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2547  * @code
2548 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2549 {
2550         char *appid = NULL;
2551         pkgmgrinfo_appinfo_get_appid(handle, &appid);
2552         printf("appid : %s\n", appid);
2553         return 0;
2554 }
2555
2556 static int list_apps(const char *pkgid)
2557 {
2558         int ret = 0;
2559         pkgmgrinfo_pkginfo_h handle;
2560         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2561         if (ret != PMINFO_R_OK)
2562                 return -1;
2563         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2564         if (ret != PMINFO_R_OK) {
2565                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2566                 return -1;
2567         }
2568         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2569         return 0;
2570 }
2571  * @endcode
2572  */
2573 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2574                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
2575 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2576                                                         pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2577
2578 /**
2579  * @fn  int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2580  * @brief       This API gets list of installed applications from all packages with  minimum informaion.
2581  *
2582  * @par         This API is for package-manager client application
2583  * @par Sync (or) Async : Synchronous API
2584  * @param[in]   app_func                iteration function for list
2585  * @param[in] user_data user data to be passed to callback function
2586  * @return      0 if success, error code(<0) if fail
2587  * @retval      PMINFO_R_OK     success
2588  * @retval      PMINFO_R_EINVAL invalid argument
2589  * @retval      PMINFO_R_ERROR  internal error
2590  * @pre         None
2591  * @post                None
2592  * @code
2593 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2594 {
2595         char *pkgid1 = NULL;
2596         char *pkgid2 = NULL;
2597         pkgid1 = (char *)user_data;
2598         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2599         if (strcmp(pkgid1, pkgid2) == 0) {
2600                 return -1;
2601         } else {
2602                 return 0;
2603         }
2604 }
2605
2606 static int list_apps()
2607 {
2608         int ret = 0;
2609         char *name = "helloworld";
2610         ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2611         if (ret != PMINFO_R_OK) {
2612                 return -1;
2613         }
2614         return 0;
2615 }
2616  * @endcode
2617  */
2618 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2619 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2620
2621 /**
2622  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2623  * @brief       This API gets list of installed applications from all packages.
2624  *
2625  * @par         This API is for package-manager client application
2626  * @par Sync (or) Async : Synchronous API
2627  * @param[in]   app_func                iteration function for list
2628  * @param[in] user_data user data to be passed to callback function
2629  * @return      0 if success, error code(<0) if fail
2630  * @retval      PMINFO_R_OK     success
2631  * @retval      PMINFO_R_EINVAL invalid argument
2632  * @retval      PMINFO_R_ERROR  internal error
2633  * @pre         None
2634  * @post                None
2635  * @code
2636 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2637 {
2638         char *pkgid1 = NULL;
2639         char *pkgid2 = NULL;
2640         pkgid1 = (char *)user_data;
2641         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2642         if (strcmp(pkgid1, pkgid2) == 0) {
2643                 return -1;
2644         } else {
2645                 return 0;
2646         }
2647 }
2648
2649 static int list_apps()
2650 {
2651         int ret = 0;
2652         char *name = "helloworld";
2653         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2654         if (ret != PMINFO_R_OK) {
2655                 return -1;
2656         }
2657         return 0;
2658 }
2659  * @endcode
2660  */
2661 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2662 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2663
2664 /**
2665  * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2666  * @brief       This API creates the disabled application information handle from db
2667  *
2668  * @par         This API is for package-manager client application
2669  * @par Sync (or) Async : Synchronous API
2670  *
2671  * @param[in]   appid   pointer to appid
2672  * @param[out] handle           pointer to the application info handle.
2673  * @return      0 if success, error code(<0) if fail
2674  * @retval      PMINFO_R_OK     success
2675  * @retval      PMINFO_R_EINVAL invalid argument
2676  * @retval      PMINFO_R_ERROR  internal error
2677  * @pre         None
2678  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2679  * @see         pkgmgrinfo_appinfo_get_pkgid()
2680  * @see         pkgmgrinfo_appinfo_is_multiple()
2681  * @code
2682 static int get_disabled_app_type(const char *appid)
2683 {
2684         int ret = 0;
2685         char *type = NULL;
2686         pkgmgrinfo_appinfo_h handle;
2687         ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2688         if (ret != PMINFO_R_OK)
2689                 return -1;
2690         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2691         if (ret != PMINFO_R_OK) {
2692                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2693                 return -1;
2694         }
2695         printf("apptype: %s\n", type);
2696         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2697         return 0;
2698 }
2699  * @endcode
2700  */
2701 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2702 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2703
2704 /**
2705  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2706  * @brief       This API creates the application information handle from db
2707  *
2708  * @par         This API is for package-manager client application
2709  * @par Sync (or) Async : Synchronous API
2710  *
2711  * @param[in]   appid   pointer to appid
2712  * @param[out] handle           pointer to the application info handle.
2713  * @return      0 if success, error code(<0) if fail
2714  * @retval      PMINFO_R_OK     success
2715  * @retval      PMINFO_R_EINVAL invalid argument
2716  * @retval      PMINFO_R_ERROR  internal error
2717  * @pre         None
2718  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2719  * @see         pkgmgrinfo_appinfo_get_pkgid()
2720  * @see         pkgmgrinfo_appinfo_is_multiple()
2721  * @code
2722 static int get_app_type(const char *appid)
2723 {
2724         int ret = 0;
2725         char *type = NULL;
2726         pkgmgrinfo_appinfo_h handle;
2727         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2728         if (ret != PMINFO_R_OK)
2729                 return -1;
2730         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2731         if (ret != PMINFO_R_OK) {
2732                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2733                 return -1;
2734         }
2735         printf("apptype: %s\n", type);
2736         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2737         return 0;
2738 }
2739  * @endcode
2740  */
2741 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2742 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2743
2744 /**
2745  * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2746  * @brief       This API creates the application information handle from db regardless of its disable or storage status
2747  *
2748  * @par         This API is for package-manager client application
2749  * @par Sync (or) Async : Synchronous API
2750  *
2751  * @param[in]   appid   pointer to appid
2752  * @param[out] handle           pointer to the application info handle.
2753  * @return      0 if success, error code(<0) if fail
2754  * @retval      PMINFO_R_OK     success
2755  * @retval      PMINFO_R_EINVAL invalid argument
2756  * @retval      PMINFO_R_ERROR  internal error
2757  * @pre         None
2758  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2759  * @see         pkgmgrinfo_appinfo_get_pkgid()
2760  * @see         pkgmgrinfo_appinfo_is_multiple()
2761  * @code
2762 static int get_app_type(const char *appid)
2763 {
2764         int ret = 0;
2765         char *type = NULL;
2766         pkgmgrinfo_appinfo_h handle;
2767         ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2768         if (ret != PMINFO_R_OK)
2769                 return -1;
2770         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2771         if (ret != PMINFO_R_OK) {
2772                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2773                 return -1;
2774         }
2775         printf("apptype: %s\n", type);
2776         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2777         return 0;
2778 }
2779  * @endcode
2780  */
2781 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2782 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2783
2784 /**
2785  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2786  * @brief       This API gets the application ID
2787  *
2788  * @par         This API is for package-manager client application
2789  * @par Sync (or) Async : Synchronous API
2790  *
2791  * @param[in] handle            pointer to the application info handle.
2792  * @param[out] appid            pointer to hold appid
2793  * @return      0 if success, error code(<0) if fail
2794  * @retval      PMINFO_R_OK     success
2795  * @retval      PMINFO_R_EINVAL invalid argument
2796  * @retval      PMINFO_R_ERROR  internal error
2797  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2798  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2799  * @see         pkgmgrinfo_appinfo_get_pkgid()
2800  * @see         pkgmgrinfo_appinfo_is_multiple()
2801  * @code
2802 static int get_app_id(const char *appid)
2803 {
2804         int ret = 0;
2805         char *app_id = NULL;
2806         pkgmgrinfo_appinfo_h handle;
2807         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2808         if (ret != PMINFO_R_OK)
2809                 return -1;
2810         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2811         if (ret != PMINFO_R_OK) {
2812                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2813                 return -1;
2814         }
2815         printf("app id: %s\n", app_id);
2816         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2817         return 0;
2818 }
2819  * @endcode
2820  */
2821 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
2822
2823 /**
2824  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2825  * @brief       This API gets the package name of the application
2826  *
2827  * @par         This API is for package-manager client application
2828  * @par Sync (or) Async : Synchronous API
2829  *
2830  * @param[in] handle            pointer to the application info handle.
2831  * @param[out] pkg_name         pointer to hold package name
2832  * @return      0 if success, error code(<0) if fail
2833  * @retval      PMINFO_R_OK     success
2834  * @retval      PMINFO_R_EINVAL invalid argument
2835  * @retval      PMINFO_R_ERROR  internal error
2836  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2837  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2838  * @see         pkgmgrinfo_appinfo_get_appid()
2839  * @see         pkgmgrinfo_appinfo_is_multiple()
2840  * @code
2841 static int get_app_pkgname(const char *appid)
2842 {
2843         int ret = 0;
2844         char *pkgname = NULL;
2845         pkgmgrinfo_appinfo_h handle;
2846         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2847         if (ret != PMINFO_R_OK)
2848                 return -1;
2849         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2850         if (ret != PMINFO_R_OK) {
2851                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2852                 return -1;
2853         }
2854         printf("pkg name: %s\n", pkgname);
2855         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2856         return 0;
2857 }
2858  * @endcode
2859  */
2860 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
2861
2862 /**
2863  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2864  * @brief       This API gets the package id of the application
2865  *
2866  * @par         This API is for package-manager client application
2867  * @par Sync (or) Async : Synchronous API
2868  *
2869  * @param[in] handle            pointer to the application info handle.
2870  * @param[out] pkgid            pointer to hold package id
2871  * @return      0 if success, error code(<0) if fail
2872  * @retval      PMINFO_R_OK     success
2873  * @retval      PMINFO_R_EINVAL invalid argument
2874  * @retval      PMINFO_R_ERROR  internal error
2875  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2876  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2877  * @see         pkgmgrinfo_appinfo_get_appid()
2878  * @see         pkgmgrinfo_appinfo_is_multiple()
2879  * @code
2880 static int get_app_pkgid(const char *appid)
2881 {
2882         int ret = 0;
2883         char *pkgid = NULL;
2884         pkgmgrinfo_appinfo_h handle;
2885         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2886         if (ret != PMINFO_R_OK)
2887                 return -1;
2888         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2889         if (ret != PMINFO_R_OK) {
2890                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2891                 return -1;
2892         }
2893         printf("pkg id: %s\n", pkgid);
2894         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2895         return 0;
2896 }
2897  * @endcode
2898  */
2899 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
2900
2901 /**
2902  * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2903  * @brief       This API gets the package type of the application
2904  *
2905  * @par         This API is for package-manager client application
2906  * @par Sync (or) Async : Synchronous API
2907  *
2908  * @param[in] handle            pointer to the application info handle.
2909  * @param[out] pkgtype          pointer to hold package type
2910  * @return      0 if success, error code(<0) if fail
2911  * @retval      PMINFO_R_OK     success
2912  * @retval      PMINFO_R_EINVAL invalid argument
2913  * @retval      PMINFO_R_ERROR  internal error
2914  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2915  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2916  * @see         pkgmgrinfo_appinfo_get_appid()
2917  * @see         pkgmgrinfo_appinfo_is_multiple()
2918  * @code
2919 static int get_app_pkgtype(const char *appid)
2920 {
2921         int ret = 0;
2922         char *pkgtype = NULL;
2923         pkgmgrinfo_appinfo_h handle = NULL;
2924         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2925         if (ret != PMINFO_R_OK)
2926                 return -1;
2927         ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2928         if (ret != PMINFO_R_OK) {
2929                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2930                 return -1;
2931         }
2932         printf("pkgtype: %s\n", pkgtype);
2933         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2934         return 0;
2935 }
2936  * @endcode
2937  */
2938 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h  handle, char **pkgtype);
2939
2940 /**
2941  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2942  * @brief       This API gets the executable name of the application
2943  *
2944  * @par         This API is for package-manager client application
2945  * @par Sync (or) Async : Synchronous API
2946  *
2947  * @param[in] handle            pointer to the application info handle.
2948  * @param[out] exec             pointer to hold app exec name
2949  * @return      0 if success, error code(<0) if fail
2950  * @retval      PMINFO_R_OK     success
2951  * @retval      PMINFO_R_EINVAL invalid argument
2952  * @retval      PMINFO_R_ERROR  internal error
2953  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2954  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2955  * @see         pkgmgrinfo_appinfo_get_appid()
2956  * @see         pkgmgrinfo_appinfo_is_multiple()
2957  * @code
2958 static int get_app_exec(const char *appid)
2959 {
2960         int ret = 0;
2961         char *exec = NULL;
2962         pkgmgrinfo_appinfo_h handle;
2963         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2964         if (ret != PMINFO_R_OK)
2965                 return -1;
2966         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2967         if (ret != PMINFO_R_OK) {
2968                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2969                 return -1;
2970         }
2971         printf("exec name: %s\n", exec);
2972         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973         return 0;
2974 }
2975  * @endcode
2976  */
2977 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
2978
2979 /**
2980  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2981  * @brief       This API gets the icon name of the application
2982  *
2983  * @par         This API is for package-manager client application
2984  * @par Sync (or) Async : Synchronous API
2985  *
2986  * @param[in] handle            pointer to the application info handle.
2987  * @param[out] icon             pointer to hold app icon name
2988  * @return      0 if success, error code(<0) if fail
2989  * @retval      PMINFO_R_OK     success
2990  * @retval      PMINFO_R_EINVAL invalid argument
2991  * @retval      PMINFO_R_ERROR  internal error
2992  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2993  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2994  * @see         pkgmgrinfo_appinfo_get_appid()
2995  * @see         pkgmgrinfo_appinfo_is_multiple()
2996  * @code
2997 static int get_app_icon(const char *appid)
2998 {
2999         int ret = 0;
3000         char *icon = NULL;
3001         pkgmgrinfo_appinfo_h handle;
3002         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3003         if (ret != PMINFO_R_OK)
3004                 return -1;
3005         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3006         if (ret != PMINFO_R_OK) {
3007                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3008                 return -1;
3009         }
3010         printf("icon name: %s\n", icon);
3011         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012         return 0;
3013 }
3014  * @endcode
3015  */
3016 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3017
3018 /**
3019  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3020  * @brief       This API gets the label of the application
3021  *
3022  * @par         This API is for package-manager client application
3023  * @par Sync (or) Async : Synchronous API
3024  *
3025  * @param[in] handle            pointer to the application info handle.
3026  * @param[out] label            pointer to hold app label
3027  * @return      0 if success, error code(<0) if fail
3028  * @retval      PMINFO_R_OK     success
3029  * @retval      PMINFO_R_EINVAL invalid argument
3030  * @retval      PMINFO_R_ERROR  internal error
3031  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3032  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3033  * @see         pkgmgrinfo_appinfo_get_appid()
3034  * @see         pkgmgrinfo_appinfo_is_multiple()
3035  * @code
3036 static int get_app_label(const char *appid)
3037 {
3038         int ret = 0;
3039         char *label = NULL;
3040         pkgmgrinfo_appinfo_h handle;
3041         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3042         if (ret != PMINFO_R_OK)
3043                 return -1;
3044         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3045         if (ret != PMINFO_R_OK) {
3046                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3047                 return -1;
3048         }
3049         printf("label : %s\n", label);
3050         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3051         return 0;
3052 }
3053  * @endcode
3054  */
3055 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
3056
3057 /**
3058  * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3059  * @brief       This API gets exactly matched label by given appid and locale
3060  *
3061  * @par         This API is for package-manager client application
3062  * @par Sync (or) Async : Synchronous API
3063  *
3064  * @param[in]   appid   pointer to appid
3065  * @param[in]   locale  pointer to locale
3066  * @param[out] label            pointer to hold app label
3067  * @return      0 if success, error code(<0) if fail
3068  * @retval      PMINFO_R_OK     success
3069  * @retval      PMINFO_R_EINVAL invalid argument
3070  * @retval      PMINFO_R_ERROR  internal error
3071  * @code
3072 static int get_localed_label(const char *appid, const char *locale)
3073 {
3074         int ret = 0;
3075         char *label = NULL;
3076
3077         ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3078         if (ret != PMINFO_R_OK)
3079                 return -1;
3080
3081         printf("localed label: %s\n", label);
3082
3083         free(label);
3084
3085         return 0;
3086 }
3087  * @endcode
3088  */
3089 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3090 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3091
3092 /**
3093  * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3094  * @brief       This API gets metadata value by given metadata key
3095  *
3096  * @par         This API is for package-manager client application
3097  * @par Sync (or) Async : Synchronous API
3098  *
3099  * @param[in]   handle  pointer to the application info handle
3100  * @param[in]   metadata_key    metadata key
3101  * @param[out] metadata_value           pointer to hold metadata value
3102  * @return      0 if success, error code(<0) if fail
3103  * @retval      PMINFO_R_OK     success
3104  * @retval      PMINFO_R_EINVAL invalid argument
3105  * @code
3106 static int get_metadata_value(const char *appid, const char *metadata_key)
3107 {
3108         int ret = 0;
3109         pkgmgrinfo_appinfo_h handle = NULL;
3110         char *metadata_value = NULL;
3111
3112         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3113         if (ret != PMINFO_R_OK)
3114                 return -1;
3115
3116         ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3117         if (ret != PMINFO_R_OK) {
3118                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3119                 return -1;
3120         }
3121
3122         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3123         return 0;
3124 }
3125  * @endcode
3126  */
3127 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3128
3129 /**
3130  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3131  * @brief       This API gets the component of the application
3132  *
3133  * @par         This API is for package-manager client application
3134  * @par Sync (or) Async : Synchronous API
3135  *
3136  * @param[in] handle            pointer to the application info handle.
3137  * @param[out] component                pointer to hold app component
3138  * @return      0 if success, error code(<0) if fail
3139  * @retval      PMINFO_R_OK     success
3140  * @retval      PMINFO_R_EINVAL invalid argument
3141  * @retval      PMINFO_R_ERROR  internal error
3142  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3143  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3144  * @see         pkgmgrinfo_appinfo_get_appid()
3145  * @see         pkgmgrinfo_appinfo_is_multiple()
3146  * @code
3147 static int get_app_component(const char *appid)
3148 {
3149         int ret = 0;
3150         pkgmgrinfo_app_component component;
3151         pkgmgrinfo_appinfo_h handle;
3152         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3153         if (ret != PMINFO_R_OK)
3154                 return -1;
3155         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3156         if (ret != PMINFO_R_OK) {
3157                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3158                 return -1;
3159         }
3160         printf("component : %s\n", component);
3161         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3162         return 0;
3163 }
3164  * @endcode
3165  */
3166 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
3167
3168 /**
3169  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3170  * @brief       This API gets the apptype of the application
3171  *
3172  * @par         This API is for package-manager client application
3173  * @par Sync (or) Async : Synchronous API
3174  *
3175  * @param[in] handle            pointer to the application info handle.
3176  * @param[out] app_type         pointer to hold apptype
3177  * @return      0 if success, error code(<0) if fail
3178  * @retval      PMINFO_R_OK     success
3179  * @retval      PMINFO_R_EINVAL invalid argument
3180  * @retval      PMINFO_R_ERROR  internal error
3181  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3182  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3183  * @see         pkgmgrinfo_appinfo_get_appid()
3184  * @see         pkgmgrinfo_appinfo_is_multiple()
3185  * @code
3186 static int get_app_type(const char *appid)
3187 {
3188         int ret = 0;
3189         char *apptype = NULL;
3190         pkgmgrinfo_appinfo_h handle;
3191         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3192         if (ret != PMINFO_R_OK)
3193                 return -1;
3194         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3195         if (ret != PMINFO_R_OK) {
3196                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3197                 return -1;
3198         }
3199         printf("apptype : %s\n", apptype);
3200         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3201         return 0;
3202 }
3203  * @endcode
3204  */
3205 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
3206
3207 /**
3208  * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
3209                                                                                 int *operation_count, char ***operation)
3210  * @brief       This API gets the list of operation of the application
3211  *
3212  * @par         This API is for package-manager client application
3213  * @par Sync (or) Async : Synchronous API
3214  *
3215  * @param[in] handle            pointer to the appcontrol handle.
3216  * @param[out] operation_count          pointer to hold number of operations
3217  * @param[out] operation                pointer to hold list of operations
3218  * @return      0 if success, error code(<0) if fail
3219  * @retval      PMINFO_R_OK     success
3220  * @retval      PMINFO_R_EINVAL invalid argument
3221  * @retval      PMINFO_R_ERROR  internal error
3222  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3223  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3224  * @see         pkgmgrinfo_appinfo_get_uri()
3225  * @see         pkgmgrinfo_appinfo_get_mime()
3226  * @code
3227 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3228 {
3229         int oc = 0;
3230         int i = 0;
3231         char **operation;
3232         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3233         for (i = 0; i < oc; i++) {
3234                 if (strcmp(operation[i], (char *)user_data) == 0)
3235                         return -1;
3236                 else
3237                         return 0;
3238         }
3239 }
3240
3241 static int check_operation(const char *appid, char *operation)
3242 {
3243         int ret = 0;
3244         pkgmgrinfo_appinfo_h handle;
3245         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3246         if (ret != PMINFO_R_OK)
3247                 return -1;
3248         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3249         if (ret != PMINFO_R_OK) {
3250                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3251                 return -1;
3252         }
3253         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3254         return 0;
3255 }
3256  * @endcode
3257  */
3258 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
3259                                                                                 int *operation_count, char ***operation);
3260
3261 /**
3262  * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
3263                                                                                 int *uri_count, char ***uri)
3264  * @brief       This API gets the list of uri of the application
3265  *
3266  * @par         This API is for package-manager client application
3267  * @par Sync (or) Async : Synchronous API
3268  *
3269  * @param[in] handle            pointer to the appcontrol handle.
3270  * @param[out] uri_count                pointer to hold number of uris
3271  * @param[out] uri              pointer to hold list of uris
3272  * @return      0 if success, error code(<0) if fail
3273  * @retval      PMINFO_R_OK     success
3274  * @retval      PMINFO_R_EINVAL invalid argument
3275  * @retval      PMINFO_R_ERROR  internal error
3276  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3277  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3278  * @see         pkgmgrinfo_appinfo_get_operation()
3279  * @see         pkgmgrinfo_appinfo_get_mime()
3280  * @code
3281 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3282 {
3283         int uc = 0;
3284         int i = 0;
3285         char **uri;
3286         pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
3287         for (i = 0; i < uc; i++) {
3288                 if (strcmp(uri[i], (char *)user_data) == 0)
3289                         return -1;
3290                 else
3291                         return 0;
3292         }
3293 }
3294
3295 static int check_uri(const char *appid, char *uri)
3296 {
3297         int ret = 0;
3298         pkgmgrinfo_appinfo_h handle;
3299         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3300         if (ret != PMINFO_R_OK)
3301                 return -1;
3302         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
3303         if (ret != PMINFO_R_OK) {
3304                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3305                 return -1;
3306         }
3307         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3308         return 0;
3309 }
3310  * @endcode
3311  */
3312 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
3313                                                                                 int *uri_count, char ***uri);
3314
3315 /**
3316  * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
3317                                                                                 int *mime_count, char ***mime)
3318  * @brief       This API gets the list of mime of the application
3319  *
3320  * @par         This API is for package-manager client application
3321  * @par Sync (or) Async : Synchronous API
3322  *
3323  * @param[in] handle            pointer to the appcontrol handle.
3324  * @param[out] mime_count               pointer to hold number of mimes
3325  * @param[out] mime             pointer to hold list of mimes
3326  * @return      0 if success, error code(<0) if fail
3327  * @retval      PMINFO_R_OK     success
3328  * @retval      PMINFO_R_EINVAL invalid argument
3329  * @retval      PMINFO_R_ERROR  internal error
3330  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3331  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3332  * @see         pkgmgrinfo_appinfo_get_uri()
3333  * @see         pkgmgrinfo_appinfo_get_operation()
3334  * @code
3335 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3336 {
3337         int mc = 0;
3338         int i = 0;
3339         char **mime;
3340         pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
3341         for (i = 0; i < mc; i++) {
3342                 if (strcmp(mime[i], (char *)user_data) == 0)
3343                         return -1;
3344                 else
3345                         return 0;
3346         }
3347 }
3348
3349 static int check_mime(const char *appid, char *mime)
3350 {
3351         int ret = 0;
3352         pkgmgrinfo_appinfo_h handle;
3353         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3354         if (ret != PMINFO_R_OK)
3355                 return -1;
3356         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
3357         if (ret != PMINFO_R_OK) {
3358                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3359                 return -1;
3360         }
3361         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3362         return 0;
3363 }
3364  * @endcode
3365  */
3366 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
3367                                                                                 int *mime_count, char ***mime);
3368
3369 /**
3370  * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
3371                                                                                 int *subapp_count, char ***subapp)
3372  * @brief       This API gets the list of subapp of the application
3373  *
3374  * @par         This API is for package-manager client application
3375  * @par Sync (or) Async : Synchronous API
3376  *
3377  * @param[in] handle            pointer to the appcontrol handle.
3378  * @param[out] subapp_count             pointer to hold number of subapp
3379  * @param[out] subapp           pointer to hold list of subapp
3380  * @return      0 if success, error code(<0) if fail
3381  * @retval      PMINFO_R_OK     success
3382  * @retval      PMINFO_R_EINVAL invalid argument
3383  * @retval      PMINFO_R_ERROR  internal error
3384  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3385  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3386  * @see         pkgmgrinfo_appinfo_get_uri()
3387  * @see         pkgmgrinfo_appinfo_get_operation()
3388  * @code
3389 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3390 {
3391         int sc = 0;
3392         int i = 0;
3393         char **subapp = NULL;
3394         pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
3395         for (i = 0; i < sc; i++) {
3396                 if (strcmp(subapp[i], (char *)user_data) == 0)
3397                         return -1;
3398                 else
3399                         return 0;
3400         }
3401 }
3402
3403 static int check_subapp(const char *appid, char *subapp)
3404 {
3405         int ret = 0;
3406         pkgmgrinfo_appinfo_h handle = NULL;
3407         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3408         if (ret != PMINFO_R_OK)
3409                 return -1;
3410         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
3411         if (ret != PMINFO_R_OK) {
3412                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413                 return -1;
3414         }
3415         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3416         return 0;
3417 }
3418  * @endcode
3419  */
3420 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
3421                                                 int *subapp_count, char ***subapp);
3422
3423 /**
3424  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3425  * @brief       This API gets the notification icon of the application
3426  *
3427  * @par         This API is for package-manager client application
3428  * @par Sync (or) Async : Synchronous API
3429  *
3430  * @param[in] handle            pointer to the application info handle.
3431  * @param[out] path             pointer to hold notification icon
3432  * @return      0 if success, error code(<0) if fail
3433  * @retval      PMINFO_R_OK     success
3434  * @retval      PMINFO_R_EINVAL invalid argument
3435  * @retval      PMINFO_R_ERROR  internal error
3436  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3437  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3438  * @see         pkgmgrinfo_appinfo_get_appid()
3439  * @see         pkgmgrinfo_appinfo_is_multiple()
3440  * @code
3441 static int get_app_notification_icon(const char *appid)
3442 {
3443         int ret = 0;
3444         char *notification_icon = NULL;
3445         pkgmgrinfo_appinfo_h handle;
3446         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447         if (ret != PMINFO_R_OK)
3448                 return -1;
3449         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
3450         if (ret != PMINFO_R_OK) {
3451                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452                 return -1;
3453         }
3454         printf("notification icon : %s\n", notification_icon);
3455         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456         return 0;
3457 }
3458  * @endcode
3459  */
3460 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3461
3462 /**
3463  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3464  * @brief       This API gets the type of recent image on app-tray
3465  *
3466  * @par         This API is for package-manager client application
3467  * @par Sync (or) Async : Synchronous API
3468  *
3469  * @param[in] handle            pointer to the application info handle.
3470  * @param[out] type             pointer to hold image type
3471  * @return      0 if success, error code(<0) if fail
3472  * @retval      PMINFO_R_OK     success
3473  * @retval      PMINFO_R_EINVAL invalid argument
3474  * @retval      PMINFO_R_ERROR  internal error
3475  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3476  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3477  * @see         pkgmgrinfo_appinfo_get_appid()
3478  * @see         pkgmgrinfo_appinfo_is_multiple()
3479  * @code
3480 static int get_app_recent_image_type(const char *appid)
3481 {
3482         int ret = 0;
3483         pkgmgrinfo_app_recentimage type;
3484         pkgmgrinfo_appinfo_h handle;
3485         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3486         if (ret != PMINFO_R_OK)
3487                 return -1;
3488         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3489         if (ret != PMINFO_R_OK) {
3490                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3491                 return -1;
3492         }
3493         printf("recent image type: %d\n", type);
3494         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3495         return 0;
3496 }
3497  * @endcode
3498  */
3499 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
3500
3501
3502 /**
3503  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
3504  * @brief       This API gets the preview image of application
3505  *
3506  * @par Sync (or) Async : Synchronous API
3507  *
3508  * @param[in] handle            pointer to the application info handle.
3509  * @param[out] preview_img              pointer to hold preview image path
3510  * @return      0 if success, error code(<0) if fail
3511  * @retval      PMINFO_R_OK     success
3512  * @retval      PMINFO_R_EINVAL invalid argument
3513  * @retval      PMINFO_R_ERROR  internal error
3514  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3515  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3516  * @see         pkgmgrinfo_appinfo_get_appid()
3517  * @code
3518 static int get_app_previewimage(const char *appid)
3519 {
3520         int ret = 0;
3521         char *preview = NULL;
3522         pkgmgrinfo_appinfo_h handle = NULL;
3523         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3524         if (ret != PMINFO_R_OK)
3525                 return -1;
3526         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3527         if (ret != PMINFO_R_OK) {
3528                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3529                 return -1;
3530         }
3531         printf("preview image path : %s\n", preview);
3532         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3533         return 0;
3534 }
3535  * @endcode
3536  */
3537 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3538
3539
3540 /**
3541  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3542  * @brief       This API gets the package permission type of the application
3543  *
3544  * @par         This API is for package-manager client application
3545  * @par Sync (or) Async : Synchronous API
3546  *
3547  * @param[in] handle            pointer to the application info handle.
3548  * @param[out] permission               pointer to hold package permission
3549  * @return      0 if success, error code(<0) if fail
3550  * @retval      PMINFO_R_OK     success
3551  * @retval      PMINFO_R_EINVAL invalid argument
3552  * @retval      PMINFO_R_ERROR  internal error
3553  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3554  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3555  * @see         pkgmgrinfo_appinfo_get_appid()
3556  * @code
3557 static int get_app_permission(const char *appid)
3558 {
3559         int ret = 0;
3560         pkgmgrinfo_permission_type permission = 0;
3561         pkgmgrinfo_appinfo_h handle;
3562
3563         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3564         if (ret != PMINFO_R_OK)
3565                 return -1;
3566         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3567         if (ret != PMINFO_R_OK) {
3568                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569                 return -1;
3570         }
3571         printf("permission type: %d\n", permission);
3572         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3573         return 0;
3574 }
3575  * @endcode
3576  */
3577 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3578
3579 /**
3580  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3581  * @brief       This API gets the component_type
3582  *
3583  * @par         This API is for package-manager client application
3584  * @par Sync (or) Async : Synchronous API
3585  *
3586  * @param[in] handle            pointer to the application info handle.
3587  * @param[out] component_type           pointer to hold component_type
3588  * @return      0 if success, error code(<0) if fail
3589  * @retval      PMINFO_R_OK     success
3590  * @retval      PMINFO_R_EINVAL invalid argument
3591  * @retval      PMINFO_R_ERROR  internal error
3592  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3593  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3594  * @see         pkgmgrinfo_appinfo_get_pkgid()
3595  * @see         pkgmgrinfo_appinfo_is_multiple()
3596  * @code
3597 static int get_component_type(const char *appid)
3598 {
3599         int ret = 0;
3600         char *component_type = NULL;
3601         pkgmgrinfo_appinfo_h handle;
3602         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3603         if (ret != PMINFO_R_OK)
3604                 return -1;
3605         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3606         if (ret != PMINFO_R_OK) {
3607                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608                 return -1;
3609         }
3610         printf("component_type: %s\n", component_type);
3611         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612         return 0;
3613 }
3614  * @endcode
3615  */
3616 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3617
3618 /**
3619  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3620  * @brief       This API gets the application 'hwacceleration' value from the app ID
3621  *
3622  * @par         This API is for package-manager client application
3623  * @par Sync (or) Async : Synchronous API
3624  *
3625  * @param[in]   handle  pointer to application info handle
3626  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3627  * @return      0 if success, error code(<0) if fail
3628  * @retval      PMINFO_R_OK     success
3629  * @retval      PMINFO_R_EINVAL invalid argument
3630  * @retval      PMINFO_R_ERROR  internal error
3631  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3632  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3633  * @see         pkgmgrinfo_appinfo_get_appid()
3634  * @see         pkgmgrinfo_appinfo_is_multiple()
3635  * @code
3636 static int get_app_hwacceleration(const char *appid)
3637 {
3638         int ret = 0;
3639         pkgmgrinfo_app_hwacceleration hwacceleration;
3640         pkgmgrinfo_appinfo_h handle;
3641         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3642         if (ret != PMINFO_R_OK)
3643                 return -1;
3644         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3645         if (ret != PMINFO_R_OK) {
3646                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3647                 return -1;
3648         }
3649         printf("app hwacceleration: %d\n", hwacceleration);
3650         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3651         return 0;
3652 }
3653  * @endcode
3654  */
3655 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3656
3657 /**
3658  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3659  * @brief       This API gets the application 'screenreader' value from the app ID
3660  *
3661  * @par         This API is for package-manager client application
3662  * @par Sync (or) Async : Synchronous API
3663  *
3664  * @param[in]   handle  pointer to application info handle
3665  * @param[out] screenreader             pointer to hold package accessibility value
3666  * @return      0 if success, error code(<0) if fail
3667  * @retval      PMINFO_R_OK     success
3668  * @retval      PMINFO_R_EINVAL invalid argument
3669  * @retval      PMINFO_R_ERROR  internal error
3670  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3671  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3672  * @see         pkgmgrinfo_appinfo_get_appid()
3673  * @see         pkgmgrinfo_appinfo_is_multiple()
3674  * @code
3675 static int get_app_screenreader(const char *appid)
3676 {
3677         int ret = 0;
3678         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3679         pkgmgrinfo_appinfo_h handle = NULL;
3680         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3681         if (ret != PMINFO_R_OK)
3682                 return -1;
3683         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3684         if (ret != PMINFO_R_OK) {
3685                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3686                 return -1;
3687         }
3688         printf("app screenreader: %d\n", screenreader);
3689         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3690         return 0;
3691 }
3692  * @endcode
3693  */
3694 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3695
3696 /**
3697  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3698  * @brief       This API gets the application's landscape & portrait effect images
3699  *
3700  * @par         This API is for package-manager client application
3701  * @par Sync (or) Async : Synchronous API
3702  *
3703  * @param[in]   handle  pointer to application info handle
3704  * @param[out]  portrait_img contains portrait mode effect image
3705  * @param[out]  landscape_img contains landscape mode effect image
3706  * @return      0 if success, error code(<0) if fail
3707  * @retval      PMINFO_R_OK     success
3708  * @retval      PMINFO_R_EINVAL invalid argument
3709  * @retval      PMINFO_R_ERROR  internal error
3710  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3711  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3712  * @see         pkgmgrinfo_appinfo_get_appid()
3713  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3714  * @code
3715 static int get_app_effectimages(const char *appid)
3716 {
3717         int ret = 0;
3718         char *portraitimg = NULL;
3719         char *landscapeimg = NULL;
3720         pkgmgrinfo_appinfo_h handle;
3721         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3722         if (ret != PMINFO_R_OK)
3723                 return -1;
3724         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3725         if (ret != PMINFO_R_OK) {
3726                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3727                 return -1;
3728         }
3729         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3730         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3731         return 0;
3732 }
3733  * @endcode
3734  */
3735 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3736
3737 /**
3738  * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h  handle, char **effectimg_type)
3739  * @brief       This API gets the application's effect image type
3740  *
3741  * @par         This API is for package-manager client application
3742  * @par Sync (or) Async : Synchronous API
3743  *
3744  * @param[in]   handle  pointer to application info handle
3745  * @param[out]  effectimg_type contains effect image type
3746  * @return      0 if success, error code(<0) if fail
3747  * @retval      PMINFO_R_OK     success
3748  * @retval      PMINFO_R_EINVAL invalid argument
3749  * @retval      PMINFO_R_ERROR  internal error
3750  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3751  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3752  * @see         pkgmgrinfo_appinfo_get_appid()
3753  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3754  * @code
3755 static int get_app_effectimage_type(const char *appid)
3756 {
3757         int ret = 0;
3758         char *effectimg_type = NULL;
3759         pkgmgrinfo_appinfo_h handle = NULL;
3760         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3761         if (ret != PMINFO_R_OK)
3762                 return -1;
3763         ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3764         if (ret != PMINFO_R_OK) {
3765                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3766                 return -1;
3767         }
3768         printf("app effect image type: %s\n", effectimg_type);
3769         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3770         return 0;
3771 }
3772  * @endcode
3773  */
3774 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3775
3776 /**
3777  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3778  * @brief       This API gets the submode_mainid of the application
3779  *
3780  * @par         This API is for package-manager client application
3781  * @par Sync (or) Async : Synchronous API
3782  *
3783  * @param[in] handle            pointer to the application info handle.
3784  * @param[out] submode_mainid           pointer to hold package name
3785  * @return      0 if success, error code(<0) if fail
3786  * @retval      PMINFO_R_OK     success
3787  * @retval      PMINFO_R_EINVAL invalid argument
3788  * @retval      PMINFO_R_ERROR  internal error
3789  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3790  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3791  * @see         pkgmgrinfo_appinfo_get_appid()
3792  * @see         pkgmgrinfo_appinfo_is_multiple()
3793  * @code
3794 static int get_app_submode_mainid(const char *appid)
3795 {
3796         int ret = 0;
3797         char *submode_mainid = NULL;
3798         pkgmgrinfo_appinfo_h handle = NULL;
3799         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3800         if (ret != PMINFO_R_OK)
3801                 return -1;
3802         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3803         if (ret != PMINFO_R_OK) {
3804                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3805                 return -1;
3806         }
3807         printf("submode_mainid: %s\n", submode_mainid);
3808         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3809         return 0;
3810 }
3811  * @endcode
3812  */
3813 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3814
3815 /**
3816  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3817  * @brief       This API gets the datacontrol info
3818  *
3819  * @par         This API is for package-manager client application
3820  * @par Sync (or) Async : Synchronous API
3821  *
3822  * @param[in] providerid                pointer to the providerid of dataconltrol.
3823  * @param[in] type                      pointer to the type of dataconltrol.
3824  * @param[out] appid                    pointer to hold appid, need to free after using
3825  * @param[out] access                   pointer to hold access, need to free after using
3826  * @return      0 if success, error code(<0) if fail
3827  * @retval      PMINFO_R_OK     success
3828  * @retval      PMINFO_R_EINVAL invalid argument
3829  * @retval      PMINFO_R_ERROR  internal error
3830  * @endcode
3831  */
3832 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3833 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3834
3835 /**
3836  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3837  * @brief       This API gets the appid of datacontrol
3838  *
3839  * @par         This API is for package-manager client application
3840  * @par Sync (or) Async : Synchronous API
3841  *
3842  * @param[in] providerid                pointer to the providerid of dataconltrol.
3843  * @param[out] appid                    pointer to hold appid, need to free after using
3844  * @return      0 if success, error code(<0) if fail
3845  * @retval      PMINFO_R_OK     success
3846  * @retval      PMINFO_R_EINVAL invalid argument
3847  * @retval      PMINFO_R_ERROR  internal error
3848  * @endcode
3849  */
3850 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3851 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3852
3853 /**
3854  * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3855  * @brief       This API gets the information about trusted datacontrol
3856  *
3857  * @par         This API is for package-manager client application
3858  * @par Sync (or) Async : Synchronous API
3859  *
3860  * @param[in] providerid                pointer to the providerid of datacontrol.
3861  * @param[out] appid                    pointer to hold appid, need to free after using
3862  * @param[out] is_trusted               pointer to hold whether it provides trusted datacontrol
3863  * @return      0 if success, error code(<0) if fail
3864  * @retval      PMINFO_R_OK     success
3865  * @retval      PMINFO_R_EINVAL invalid argument
3866  * @retval      PMINFO_R_ERROR  internal error
3867  * @endcode
3868  */
3869 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3870                 const char *type, char **appid, bool *is_trusted);
3871 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3872                 const char *type, uid_t uid, char **appid, bool *is_trusted);
3873
3874 /**
3875  * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3876                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3877  * @brief       This API retrieves the privileges and invokes given callback for each privilege.
3878  *
3879  * @par         This API is for package-manager client application
3880  * @par Sync (or) Async : Synchronous API
3881  *
3882  * @param[in] providerid                pointer to the providerid of datacontrol.
3883  * @param[in] type                      pointer to the type of dataconltrol.
3884  * @param[in] privilege_func            callback function for list
3885  * @param[in] user_data user data to be passed to callback function
3886  * @return      0 if success, error code(<0) if fail
3887  * @retval      PMINFO_R_OK     success
3888  * @retval      PMINFO_R_EINVAL invalid argument
3889  * @retval      PMINFO_R_ERROR  internal error
3890  */
3891 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3892                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3893 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3894                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3895
3896 /**
3897  * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h  handle, char **alias_appid)
3898  * @brief       This API gets the alias_appid of the application
3899  *
3900  * @par         This API is for package-manager client application
3901  * @par Sync (or) Async : Synchronous API
3902  *
3903  * @param[in] handle            pointer to the application info handle.
3904  * @param[out] alias_appid              pointer to hold app alias_appid
3905  * @return      0 if success, error code(<0) if fail
3906  * @retval      PMINFO_R_OK     success
3907  * @retval      PMINFO_R_EINVAL invalid argument
3908  * @retval      PMINFO_R_ERROR  internal error
3909  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3910  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3911  * @see         pkgmgrinfo_appinfo_get_appid()
3912  * @code
3913 static int get_alias_appid(const char *appid)
3914 {
3915         int ret = 0;
3916         char *alias_appid= 0;
3917         pkgmgrinfo_appinfo_h handle = NULL;
3918         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3919         if (ret != PMINFO_R_OK)
3920                 return -1;
3921         ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3922         if (ret != PMINFO_R_OK) {
3923                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3924                 return -1;
3925         }
3926         printf("alias_appid: %s\n", alias_appid);
3927         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3928         return 0;
3929 }
3930  * @endcode
3931  */
3932 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3933
3934 /**
3935  * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h  handle, char **effective_appid)
3936  * @brief       This API gets the effective_appid of the application
3937  *
3938  * @par         This API is for package-manager client application
3939  * @par Sync (or) Async : Synchronous API
3940  *
3941  * @param[in] handle            pointer to the application info handle.
3942  * @param[out] effective_appid          pointer to hold app effective_appid
3943  * @return      0 if success, error code(<0) if fail
3944  * @retval      PMINFO_R_OK     success
3945  * @retval      PMINFO_R_EINVAL invalid argument
3946  * @retval      PMINFO_R_ERROR  internal error
3947  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3948  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3949  * @see         pkgmgrinfo_appinfo_get_appid()
3950  * @code
3951 static int get_effective_appid(const char *appid)
3952 {
3953         int ret = 0;
3954         char *effective_appid= 0;
3955         pkgmgrinfo_appinfo_h handle = NULL;
3956         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3957         if (ret != PMINFO_R_OK)
3958                 return -1;
3959         ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3960         if (ret != PMINFO_R_OK) {
3961                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3962                 return -1;
3963         }
3964         printf("effective_appid: %s\n", effective_appid);
3965         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3966         return 0;
3967 }
3968  * @endcode
3969  */
3970 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3971
3972 /**
3973  * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3974  * @brief       This API gets tep(tizen expansion package) file name associated with the package which contain given application
3975  *
3976  * @par This API is for package-manager client application
3977  * @par Sync (or) Async : Synchronous API
3978  *
3979  * @param[in] handle            pointer to the appinfo handle.
3980  * @param[out] tep_name         pointer to hold tep name
3981  * @return      0 if success, error code(<0) if fail
3982  * @retval      PMINFO_R_OK success
3983  * @retval      PMINFO_R_EINVAL invalid argument
3984  * @retval      PMINFO_R_ERROR  internal error
3985  * @pre pkgmgrinfo_appinfo_get_appinfo()
3986  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3987  * @see pkgmgrinfo_appinfo_get_appid()
3988  * @code
3989 static int get_tep_name(const char *appid)
3990 {
3991         int ret = 0;
3992         char *tep_name = NULL;
3993         pkgmgrinfo_appinfo_h handle = NULL;
3994         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3995         if (ret != PMINFO_R_OK)
3996                 return -1;
3997         ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3998         if (ret != PMINFO_R_OK) {
3999                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4000                 return -1;
4001         }
4002         printf("TEP name is: %s\n", tep_name);
4003         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4004         return 0;
4005 }
4006  * @endcode
4007  */
4008 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4009
4010 /**
4011  * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4012  * @brief       This API gets zip mount file name associated with the package which contain given application
4013  *          If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4014  *
4015  * @par This API is for package-manager client application
4016  * @par Sync (or) Async : Synchronous API
4017  *
4018  * @param[in] handle            pointer to the appinfo handle.
4019  * @param[out] zip_mount_file           pointer to hold zip mount file name
4020  * @return      0 if success, error code(<0) if fail
4021  * @retval      PMINFO_R_OK success
4022  * @retval      PMINFO_R_EINVAL invalid argument
4023  * @retval      PMINFO_R_ERROR  internal error
4024  * @pre pkgmgrinfo_appinfo_get_appinfo()
4025  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4026  * @see pkgmgrinfo_appinfo_get_appid()
4027  * @code
4028 static int get_zip_mount_file(const char *appid)
4029 {
4030         int ret = 0;
4031         char *zip_mount_file = NULL;
4032         pkgmgrinfo_appinfo_h handle = NULL;
4033         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4034         if (ret != PMINFO_R_OK)
4035                 return -1;
4036         ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4037         if (ret != PMINFO_R_OK) {
4038                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4039                 return -1;
4040         }
4041         printf("Mount file name is: %s\n", zip_mount_file);
4042         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4043         return 0;
4044 }
4045  * @endcode
4046  */
4047 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4048
4049 /**
4050  * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4051  * @brief       This API gets the root path of application
4052  *
4053  * @par Sync (or) Async : Synchronous API
4054  *
4055  * @param[in] handle            pointer to appinfo handle
4056  * @param[out] path             pointer to hold root path of application
4057  * @return      0 if success, error code(<0) if fail
4058  * @retval      PMINFO_R_OK     success
4059  * @retval      PMINFO_R_EINVAL invalid argument
4060  * @retval      PMINFO_R_ERROR  internal error
4061  * @code
4062 static int get_root_path(const char *appid)
4063 {
4064         int ret = 0;
4065         char *path = 0;
4066         pkgmgrinfo_appinfo_h handle;
4067         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4068         if (ret != PMINFO_R_OK)
4069                 return -1;
4070
4071         ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4072         if (ret != PMINFO_R_OK) {
4073                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4074                 return -1;
4075         }
4076         printf("path : %s\n", path);
4077         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4078
4079         return 0;
4080 }
4081  * @endcode
4082  */
4083 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4084
4085 /**
4086  * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4087  * @brief       This API gets the application api_version from the application ID
4088  *
4089  * @par         This API is for package-manager client application
4090  * @par Sync (or) Async : Synchronous API
4091  *
4092  * @param[in]   handle  pointer to appinfo handle
4093  * @param[out] api_version              pointer to hold application api_version
4094  * @return      0 if success, error code(<0) if fail
4095  * @retval      PMINFO_R_OK     success
4096  * @retval      PMINFO_R_EINVAL invalid argument
4097  * @retval      PMINFO_R_ERROR  internal error
4098  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4099  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4100  * @see         pkgmgrinfo_appinfo_get_appid()
4101  * @code
4102 static int get_app_api_version(const char *appid)
4103 {
4104         int ret = 0;
4105         char *api_version = NULL;
4106         pkgmgrinfo_appinfo_h handle = NULL;
4107         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4108         if (ret != PMINFO_R_OK)
4109                 return -1;
4110         ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4111         if (ret != PMINFO_R_OK) {
4112                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4113                 return -1;
4114         }
4115         printf("app api_version: %s\n", api_version);
4116         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4117         return 0;
4118 }
4119  * @endcode
4120  */
4121 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4122
4123 /**
4124  * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4125  * @brief       This API gets the installed_time of the application
4126  *
4127  * @par         This API is for package-manager client application
4128  * @par Sync (or) Async : Synchronous API
4129  *
4130  * @param[in] handle            pointer to the application info handle.
4131  * @param[out] installed_time           pointer to hold installed_time
4132  * @return      0 if success, error code(<0) if fail
4133  * @retval      PMINFO_R_OK     success
4134  * @retval      PMINFO_R_EINVAL invalid argument
4135  * @retval      PMINFO_R_ERROR  internal error
4136  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4137  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4138  * @see         pkgmgrinfo_appinfo_get_appid()
4139  * @see         pkgmgrinfo_appinfo_is_multiple()
4140  * @code
4141 static int get_app_installed_time(const char *appid)
4142 {
4143         int ret = 0;
4144         int installed_time = 0;
4145         pkgmgrinfo_appinfo_h handle = NULL;
4146         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4147         if (ret != PMINFO_R_OK)
4148                 return -1;
4149         ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4150         if (ret != PMINFO_R_OK) {
4151                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4152                 return -1;
4153         }
4154         printf("installed_time: %d\n", installed_time);
4155         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4156         return 0;
4157 }
4158  * @endcode
4159  */
4160 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4161
4162 /**
4163  * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h  handle, int *support_mode)
4164  * @brief       This API gets the support_mode of the application
4165  *
4166  * @par         This API is for package-manager client application
4167  * @par Sync (or) Async : Synchronous API
4168  *
4169  * @param[in] handle            pointer to the application info handle.
4170  * @param[out] support_mode             pointer to hold app support_mode
4171  * @return      0 if success, error code(<0) if fail
4172  * @retval      PMINFO_R_OK     success
4173  * @retval      PMINFO_R_EINVAL invalid argument
4174  * @retval      PMINFO_R_ERROR  internal error
4175  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4176  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4177  * @see         pkgmgrinfo_appinfo_get_appid()
4178  * @code
4179 static int get_app_support_mode(const char *appid)
4180 {
4181         int ret = 0;
4182         int support_mode = 0;
4183         pkgmgrinfo_appinfo_h handle = NULL;
4184         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4185         if (ret != PMINFO_R_OK)
4186                 return -1;
4187         ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4188         if (ret != PMINFO_R_OK) {
4189                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4190                 return -1;
4191         }
4192         printf("support_mode: %s\n", support_mode);
4193         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4194         return 0;
4195 }
4196  * @endcode
4197  */
4198 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4199
4200
4201 /**
4202  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4203                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4204  * @brief       This API gets the list of category for a particular application
4205  *
4206  * @par         This API is for package-manager client application
4207  * @par Sync (or) Async : Synchronous API
4208  * @param[in]   handle          pointer to the application info handle.
4209  * @param[in]   category_func           callback function for list
4210  * @param[in] user_data user data to be passed to callback function
4211  * @return      0 if success, error code(<0) if fail
4212  * @retval      PMINFO_R_OK     success
4213  * @retval      PMINFO_R_EINVAL invalid argument
4214  * @retval      PMINFO_R_ERROR  internal error
4215  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4216  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4217  * @code
4218 int category_func(const char *name, void *user_data)
4219 {
4220         if (strcmp(name, (char *)user_data) == 0)
4221                 return -1;
4222         else
4223                 return 0;
4224 }
4225
4226 static int list_category(const char *appid, char *category)
4227 {
4228         int ret = 0;
4229         pkgmgrinfo_appinfo_h handle;
4230         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4231         if (ret != PMINFO_R_OK)
4232                 return -1;
4233         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4234         if (ret != PMINFO_R_OK) {
4235                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4236                 return -1;
4237         }
4238         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4239         return 0;
4240 }
4241  * @endcode
4242  */
4243 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4244                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4245
4246 /**
4247  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4248                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4249  * @brief       This API gets the list of metadata for a particular application
4250  *
4251  * @par         This API is for package-manager client application
4252  * @par Sync (or) Async : Synchronous API
4253  * @param[in]   handle          pointer to the application info handle.
4254  * @param[in]   metadata_func           callback function for list
4255  * @param[in] user_data user data to be passed to callback function
4256  * @return      0 if success, error code(<0) if fail
4257  * @retval      PMINFO_R_OK     success
4258  * @retval      PMINFO_R_EINVAL invalid argument
4259  * @retval      PMINFO_R_ERROR  internal error
4260  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4261  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4262  * @code
4263 int metadata_func(const char *key, const char *value, void *user_data)
4264 {
4265         if (strcmp(key, (char *)user_data) == 0) {
4266                 printf("Value is %s\n", value);
4267                 return -1;
4268         }
4269         else
4270                 return 0;
4271 }
4272
4273 static int list_metadata(const char *appid, char *key)
4274 {
4275         int ret = 0;
4276         pkgmgrinfo_appinfo_h handle;
4277         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4278         if (ret != PMINFO_R_OK)
4279                 return -1;
4280         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4281         if (ret != PMINFO_R_OK) {
4282                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4283                 return -1;
4284         }
4285         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4286         return 0;
4287 }
4288  * @endcode
4289  */
4290 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4291                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4292
4293 /**
4294  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4295  *                      const char *operation,
4296  *                      pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4297  *                      void *user_data);
4298  * @brief       This API gets the list of privileges for a particular
4299  *              appllication's app_control
4300  *
4301  * @par         This API is for package-manager client application
4302  * @par Sync (or) Async : Synchronous API
4303  * @param[in]   appid           application id
4304  * @param[in]   operation       operation of appcontrol
4305  * @param[in]   privilege_func  callback function for list
4306  * @param[in]   user_data       user data to be passed to callback function
4307  * @return      0 if success, error code(<0) if fail
4308  * @retval      PMINFO_R_OK     success
4309  * @retval      PMINFO_R_EINVAL invalid argument
4310  * @retval      PMINFO_R_ERROR  internal error
4311  */
4312 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4313                 const char *operation,
4314                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4315                 void *user_data, uid_t uid);
4316 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4317                 const char *operation,
4318                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4319                 void *user_data);
4320
4321 /**
4322  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4323                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4324  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4325                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4326  * @brief       This API gets the list of app-control for a particular application
4327  *
4328  * @par         This API is for package-manager client application
4329  * @par Sync (or) Async : Synchronous API
4330  * @param[in]   handle          pointer to the application info handle.
4331  * @param[in]   appcontrol_func         callback function for list
4332  * @param[in] user_data user data to be passed to callback function
4333  * @param[in]   uid     the addressee user id of the instruction
4334  * @return      0 if success, error code(<0) if fail
4335  * @retval      PMINFO_R_OK     success
4336  * @retval      PMINFO_R_EINVAL invalid argument
4337  * @retval      PMINFO_R_ERROR  internal error
4338  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4339  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4340  * @code
4341 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
4342 {
4343         int oc = 0;
4344         int i = 0;
4345         char **operation;
4346         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
4347         for (i = 0; i < oc; i++) {
4348                 if (strcmp(operation[i], (char *)user_data) == 0)
4349                         return -1;
4350                 else
4351                         return 0;
4352         }
4353 }
4354
4355 static int check_operation(const char *appid, char *operation)
4356 {
4357         int ret = 0;
4358         pkgmgrinfo_appinfo_h handle;
4359         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4360         if (ret != PMINFO_R_OK)
4361                 return -1;
4362         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4363         if (ret != PMINFO_R_OK) {
4364                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4365                 return -1;
4366         }
4367         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4368         return 0;
4369 }
4370  * @endcode
4371  */
4372 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4373                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4374
4375 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4376                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4377
4378 /**
4379  * @brief
4380  */
4381 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4382                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4383
4384 /**
4385  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4386                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4387  * @brief       This API gets the list of splashscreen for a particular application
4388  *
4389  * @par         This API is for package-manager client application
4390  * @par Sync (or) Async : Synchronous API
4391  * @param[in]   handle          pointer to the application info handle.
4392  * @param[in]   splash_screen_func              callback function for list
4393  * @param[in]   user_data       user data to be passed to callback function
4394  * @return      0 if success, error code(<0) if fail
4395  * @retval      PMINFO_R_OK     success
4396  * @retval      PMINFO_R_EINVAL invalid argument
4397  * @retval      PMINFO_R_ERROR  internal error
4398  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4399  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4400  * @code
4401  */
4402 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4403                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4404
4405 /**
4406  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4407  * @brief       This API gets the application 'nodisplay' value from the app ID
4408  *
4409  * @par         This API is for package-manager client application
4410  * @par Sync (or) Async : Synchronous API
4411  *
4412  * @param[in]   handle  pointer to application info handle
4413  * @param[out] nodisplay                pointer to hold package nodisplay value
4414  * @return      0 if success, error code(<0) if fail
4415  * @retval      PMINFO_R_OK     success
4416  * @retval      PMINFO_R_EINVAL invalid argument
4417  * @retval      PMINFO_R_ERROR  internal error
4418  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4419  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4420  * @see         pkgmgrinfo_appinfo_get_appid()
4421  * @see         pkgmgrinfo_appinfo_is_multiple()
4422  * @code
4423 static int get_app_nodisplay(const char *appid)
4424 {
4425         int ret = 0;
4426         bool nodisplay;
4427         pkgmgrinfo_appinfo_h handle;
4428         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4429         if (ret != PMINFO_R_OK)
4430                 return -1;
4431         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4432         if (ret != PMINFO_R_OK) {
4433                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4434                 return -1;
4435         }
4436         printf("app nodisplay: %d\n", nodisplay);
4437         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4438         return 0;
4439 }
4440  * @endcode
4441  */
4442 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
4443
4444 /**
4445  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4446  * @brief       This API gets the application 'multiple' value from the app ID
4447  *
4448  * @par         This API is for package-manager client application
4449  * @par Sync (or) Async : Synchronous API
4450  *
4451  * @param[in]   handle  pointer to application info handle
4452  * @param[out] multiple         pointer to hold package multiple value
4453  * @return      0 if success, error code(<0) if fail
4454  * @retval      PMINFO_R_OK     success
4455  * @retval      PMINFO_R_EINVAL invalid argument
4456  * @retval      PMINFO_R_ERROR  internal error
4457  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4458  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4459  * @see         pkgmgrinfo_appinfo_get_appid()
4460  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4461  * @code
4462 static int get_app_multiple(const char *appid)
4463 {
4464         int ret = 0;
4465         bool multiple;
4466         pkgmgrinfo_appinfo_h handle;
4467         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4468         if (ret != PMINFO_R_OK)
4469                 return -1;
4470         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4471         if (ret != PMINFO_R_OK) {
4472                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4473                 return -1;
4474         }
4475         printf("app multiple: %d\n", multiple);
4476         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477         return 0;
4478 }
4479  * @endcode
4480  */
4481 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
4482
4483 /**
4484  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4485  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4486  *              application launching effect. If fales, indicator will be hidden during application launching effect
4487  *
4488  * @par         This API is for package-manager client application
4489  * @par Sync (or) Async : Synchronous API
4490  *
4491  * @param[in]   handle  pointer to application info handle
4492  * @param[out]  indicator_disp contains indicator display status for application launching effect
4493  * @return      0 if success, error code(<0) if fail
4494  * @retval      PMINFO_R_OK     success
4495  * @retval      PMINFO_R_EINVAL invalid argument
4496  * @retval      PMINFO_R_ERROR  internal error
4497  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4498  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4499  * @see         pkgmgrinfo_appinfo_get_appid()
4500  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4501  * @code
4502 static int get_app_indicator_display(const char *appid)
4503 {
4504         int ret = 0;
4505         bool indicator_disp;
4506         pkgmgrinfo_appinfo_h handle;
4507         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4508         if (ret != PMINFO_R_OK)
4509                 return -1;
4510         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4511         if (ret != PMINFO_R_OK){
4512                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4513                 return -1;
4514         }
4515         printf("app indicator disp : %d\n", indicator_disp);
4516         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4517         return 0;
4518 }
4519  * @endcode
4520  */
4521 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4522
4523 /**
4524  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4525  * @brief       This API gets the application 'taskmanage' value from the app ID
4526  *
4527  * @par         This API is for package-manager client application
4528  * @par Sync (or) Async : Synchronous API
4529  *
4530  * @param[in]   handle  pointer to application info handle
4531  * @param[out] taskmanage               pointer to hold package taskmanage value
4532  * @return      0 if success, error code(<0) if fail
4533  * @retval      PMINFO_R_OK     success
4534  * @retval      PMINFO_R_EINVAL invalid argument
4535  * @retval      PMINFO_R_ERROR  internal error
4536  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4537  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4538  * @see         pkgmgrinfo_appinfo_get_appid()
4539  * @see         pkgmgrinfo_appinfo_is_multiple()
4540  * @code
4541 static int get_app_taskmanage(const char *appid)
4542 {
4543         int ret = 0;
4544         bool taskmanage;
4545         pkgmgrinfo_appinfo_h handle;
4546         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4547         if (ret != PMINFO_R_OK)
4548                 return -1;
4549         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4550         if (ret != PMINFO_R_OK) {
4551                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4552                 return -1;
4553         }
4554         printf("app taskmanage: %d\n", taskmanage);
4555         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4556         return 0;
4557 }
4558  * @endcode
4559  */
4560 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
4561
4562 /**
4563  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4564  * @brief       This API gets the application 'taskmanage' value from the app ID
4565  *
4566  * @par         This API is for package-manager client application
4567  * @par Sync (or) Async : Synchronous API
4568  *
4569  * @param[in]   handle  pointer to application info handle
4570  * @param[out] enabled          pointer to hold package enabled value
4571  * @return      0 if success, error code(<0) if fail
4572  * @retval      PMINFO_R_OK     success
4573  * @retval      PMINFO_R_EINVAL invalid argument
4574  * @retval      PMINFO_R_ERROR  internal error
4575  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4576  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4577  * @see         pkgmgrinfo_appinfo_get_appid()
4578  * @see         pkgmgrinfo_appinfo_is_multiple()
4579  * @code
4580 static int get_app_enabled(const char *appid)
4581 {
4582         int ret = 0;
4583         bool enabled;
4584         pkgmgrinfo_appinfo_h handle;
4585         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4586         if (ret != PMINFO_R_OK)
4587                 return -1;
4588         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4589         if (ret != PMINFO_R_OK) {
4590                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4591                 return -1;
4592         }
4593         printf("app enabled: %d\n", enabled);
4594         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4595         return 0;
4596 }
4597  * @endcode
4598  */
4599 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
4600
4601 /**
4602  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4603  * @brief       This API gets the application 'onboot' value from the app ID
4604  *
4605  * @par         This API is for package-manager client application
4606  * @par Sync (or) Async : Synchronous API
4607  *
4608  * @param[in]   handle  pointer to application info handle
4609  * @param[out] onboot           pointer to hold package onboot value
4610  * @return      0 if success, error code(<0) if fail
4611  * @retval      PMINFO_R_OK     success
4612  * @retval      PMINFO_R_EINVAL invalid argument
4613  * @retval      PMINFO_R_ERROR  internal error
4614  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4615  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4616  * @see         pkgmgrinfo_appinfo_get_appid()
4617  * @see         pkgmgrinfo_appinfo_is_multiple()
4618  * @code
4619 static int get_app_onboot(const char *appid)
4620 {
4621         int ret = 0;
4622         bool onboot;
4623         pkgmgrinfo_appinfo_h handle;
4624         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4625         if (ret != PMINFO_R_OK)
4626                 return -1;
4627         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4628         if (ret != PMINFO_R_OK) {
4629                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4630                 return -1;
4631         }
4632         printf("app onboot: %d\n", onboot);
4633         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4634         return 0;
4635 }
4636  * @endcode
4637  */
4638 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
4639
4640 /**
4641  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4642  * @brief       This API gets the application 'autorestart' value from the app ID
4643  *
4644  * @par         This API is for package-manager client application
4645  * @par Sync (or) Async : Synchronous API
4646  *
4647  * @param[in]   handle  pointer to application info handle
4648  * @param[out] autorestart              pointer to hold package autorestart value
4649  * @return      0 if success, error code(<0) if fail
4650  * @retval      PMINFO_R_OK     success
4651  * @retval      PMINFO_R_EINVAL invalid argument
4652  * @retval      PMINFO_R_ERROR  internal error
4653  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4654  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4655  * @see         pkgmgrinfo_appinfo_get_appid()
4656  * @see         pkgmgrinfo_appinfo_is_multiple()
4657  * @code
4658 static int get_app_autorestart(const char *appid)
4659 {
4660         int ret = 0;
4661         bool autorestart;
4662         pkgmgrinfo_appinfo_h handle;
4663         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4664         if (ret != PMINFO_R_OK)
4665                 return -1;
4666         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4667         if (ret != PMINFO_R_OK) {
4668                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4669                 return -1;
4670         }
4671         printf("app autorestart: %d\n", autorestart);
4672         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4673         return 0;
4674 }
4675  * @endcode
4676  */
4677 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4678
4679 /**
4680  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4681  * @brief       This API gets the value for given application is main app or not from handle
4682  *
4683  * @par         This API is for package-manager client application
4684  * @par Sync (or) Async : Synchronous API
4685  *
4686  * @param[in]   handle  pointer to application info handle
4687  * @param[out] mainapp          pointer to hold package mainapp is or not
4688  * @return      0 if success, error code(<0) if fail
4689  * @retval      PMINFO_R_OK     success
4690  * @retval      PMINFO_R_EINVAL invalid argument
4691  * @retval      PMINFO_R_ERROR  internal error
4692  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4693  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4694  * @see         pkgmgrinfo_appinfo_get_appid()
4695  * @see         pkgmgrinfo_appinfo_is_multiple()
4696  * @code
4697 static int get_app_mainapp(const char *appid)
4698 {
4699         int ret = 0;
4700         bool mainapp;
4701         pkgmgrinfo_appinfo_h handle;
4702         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4703         if (ret != PMINFO_R_OK)
4704                 return -1;
4705         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4706         if (ret != PMINFO_R_OK) {
4707                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4708                 return -1;
4709         }
4710         printf("mainapp: %d\n", mainapp);
4711         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4712         return 0;
4713 }
4714  * @endcode
4715  */
4716 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4717
4718
4719 /**
4720  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4721  * @brief       This API gets the value for given application is preload or not from handle
4722  *
4723  * @par         This API is for package-manager client application
4724  * @par Sync (or) Async : Synchronous API
4725  *
4726  * @param[in]   handle  pointer to application info handle
4727  * @param[out] preload          pointer to hold preload is or not
4728  * @return      0 if success, error code(<0) if fail
4729  * @retval      PMINFO_R_OK     success
4730  * @retval      PMINFO_R_EINVAL invalid argument
4731  * @retval      PMINFO_R_ERROR  internal error
4732  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4733  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4734  * @see         pkgmgrinfo_appinfo_get_appid()
4735  * @see         pkgmgrinfo_appinfo_is_multiple()
4736  * @code
4737 static int get_app_preload(const char *appid)
4738 {
4739         int ret = 0;
4740         bool preload = 0;
4741         pkgmgrinfo_appinfo_h handle = NULL;
4742         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4743         if (ret != PMINFO_R_OK)
4744                 return -1;
4745         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4746         if (ret != PMINFO_R_OK) {
4747                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4748                 return -1;
4749         }
4750         printf("preload: %d\n", preload);
4751         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4752         return 0;
4753 }
4754  * @endcode
4755  */
4756 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4757
4758 /**
4759  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4760  * @brief       This API gets the value for given application is submode or not from handle
4761  *
4762  * @par         This API is for package-manager client application
4763  * @par Sync (or) Async : Synchronous API
4764  *
4765  * @param[in]   handle  pointer to application info handle
4766  * @param[out] submode          pointer to hold submode is or not
4767  * @return      0 if success, error code(<0) if fail
4768  * @retval      PMINFO_R_OK     success
4769  * @retval      PMINFO_R_EINVAL invalid argument
4770  * @retval      PMINFO_R_ERROR  internal error
4771  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4772  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4773  * @see         pkgmgrinfo_appinfo_get_appid()
4774  * @see         pkgmgrinfo_appinfo_is_multiple()
4775  * @code
4776 static int get_app_submode(const char *appid)
4777 {
4778         int ret = 0;
4779         bool submode = 0;
4780         pkgmgrinfo_appinfo_h handle = NULL;
4781         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4782         if (ret != PMINFO_R_OK)
4783                 return -1;
4784         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4785         if (ret != PMINFO_R_OK) {
4786                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4787                 return -1;
4788         }
4789         printf("submode: %d\n", submode);
4790         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4791         return 0;
4792 }
4793  * @endcode
4794  */
4795 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4796
4797 /**
4798  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4799  * @brief       This API gets the value for given application is process_pool or not from handle
4800  *
4801  * @par         This API is for package-manager client application
4802  * @par Sync (or) Async : Synchronous API
4803  *
4804  * @param[in]   handle  pointer to application info handle
4805  * @param[out] process_pool             pointer to hold process_pool is or not
4806  * @return      0 if success, error code(<0) if fail
4807  * @retval      PMINFO_R_OK     success
4808  * @retval      PMINFO_R_EINVAL invalid argument
4809  * @retval      PMINFO_R_ERROR  internal error
4810  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4811  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4812  * @see         pkgmgrinfo_appinfo_get_appid()
4813  * @code
4814 static int get_app_process_pool(const char *appid)
4815 {
4816         int ret = 0;
4817         bool process_pool = 0;
4818         pkgmgrinfo_appinfo_h handle = NULL;
4819         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4820         if (ret != PMINFO_R_OK)
4821                 return -1;
4822         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4823         if (ret != PMINFO_R_OK) {
4824                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4825                 return -1;
4826         }
4827         printf("process_pool: %d\n", process_pool);
4828         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4829         return 0;
4830 }
4831  * @endcode
4832  */
4833 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4834
4835 /**
4836  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4837  * @brief       This API gets the installed storage location of the application
4838  *
4839  * @par This API is for package-manager client application
4840  * @par Sync (or) Async : Synchronous API
4841  *
4842  * @param[in] handle            pointer to the application info handle.
4843  * @param[out] app_type         pointer to hold installed storage location
4844  * @return      0 if success, error code(<0) if fail
4845  * @retval      PMINFO_R_OK success
4846  * @retval      PMINFO_R_EINVAL invalid argument
4847  * @retval      PMINFO_R_ERROR  internal error
4848  * @pre pkgmgrinfo_appinfo_get_appinfo()
4849  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4850  * @see pkgmgrinfo_appinfo_get_appid()
4851  * @code
4852 static int get_app_installed_location(const char *appid)
4853 {
4854         int ret = 0;
4855         pkgmgrinfo_installed_storage storage;
4856         pkgmgrinfo_appinfo_h handle = NULL;
4857         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4858         if (ret != PMINFO_R_OK)
4859                 return -1;
4860         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4861         if (ret != PMINFO_R_OK) {
4862                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4863                 return -1;
4864         }
4865         printf("Installed storage location : %d\n", storage);
4866         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4867         return 0;
4868 }
4869  * @endcode
4870  */
4871 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4872
4873
4874 /**
4875  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4876  * @brief       This API checks if the application has the given category
4877  *
4878  * @par         This API is for package-manager client application
4879  * @par Sync (or) Async : Synchronous API
4880  *
4881  * @param[in]   handle  pointer to the application info handle
4882  * @param[in]   category        category
4883  * @param[out] exist            value Gets whether the application has the given category
4884  * @return      0 if success, error code(<0) if fail
4885  * @retval      PMINFO_R_OK     success
4886  * @retval      PMINFO_R_EINVAL invalid argument
4887  * @retval      PMINFO_R_ERROR  internal error
4888  * @code
4889 static int is_category_exist(const char *appid, const char *category)
4890 {
4891         int ret = 0;
4892         pkgmgrinfo_appinfo_h handle;
4893         bool exist = false;
4894
4895         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4896         if (ret != PMINFO_R_OK)
4897                 return -1;
4898
4899         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4900         if (ret != PMINFO_R_OK) {
4901                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4902                 return -1;
4903         }
4904
4905         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4906         return 0;
4907 }
4908  * @endcode
4909  */
4910 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4911
4912 /**
4913  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4914  * @brief       This API gets the application 'ui_gadget' value from the app ID
4915  *
4916  * @par         This API is for package-manager client application
4917  * @par Sync (or) Async : Synchronous API
4918  *
4919  * @param[in]   handle  pointer to application info handle
4920  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4921  * @return      0 if success, error code(<0) if fail
4922  * @retval      PMINFO_R_OK     success
4923  * @retval      PMINFO_R_EINVAL invalid argument
4924  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4925  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4926  * @code
4927 static int get_app_ui_gadget(const char *appid)
4928 {
4929         int ret = 0;
4930         bool ui_gadget;
4931         pkgmgrinfo_appinfo_h handle = NULL;
4932         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4933         if (ret != PMINFO_R_OK)
4934                 return -1;
4935         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4936         if (ret != PMINFO_R_OK) {
4937                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4938                 return -1;
4939         }
4940         printf("app ui_gadget: %d\n", ui_gadget);
4941         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4942         return 0;
4943 }
4944  * @endcode
4945  */
4946 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4947
4948 /**
4949  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4950  * @brief       This API gets the application 'support_disable' value from the app ID
4951  *
4952  * @par         This API is for package-manager client application
4953  * @par Sync (or) Async : Synchronous API
4954  *
4955  * @param[in]   handle  pointer to application info handle
4956  * @param[out]  support_disable pointer to hold package support_disable value
4957  * @return      0 if success, error code(<0) if fail
4958  * @retval      PMINFO_R_OK     success
4959  * @retval      PMINFO_R_EINVAL invalid argument
4960  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4961  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4962  * @code
4963 static int get_app_support_disable(const char *appid)
4964 {
4965         int ret = 0;
4966         bool support_disable;
4967         pkgmgrinfo_appinfo_h handle = NULL;
4968         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4969         if (ret != PMINFO_R_OK)
4970                 return -1;
4971         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4972         if (ret != PMINFO_R_OK) {
4973                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4974                 return -1;
4975         }
4976         printf("app support_disable: %d\n", support_disable);
4977         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4978         return 0;
4979 }
4980  * @endcode
4981  */
4982 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4983
4984 /**
4985  * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4986  * @brief       This API gets the application 'removable' value from the app ID
4987  *
4988  * @par         This API is for package-manager client application
4989  * @par Sync (or) Async : Synchronous API
4990  *
4991  * @param[in]   handle  pointer to application info handle
4992  * @param[out]  removable       pointer to hold package removable value
4993  * @return      0 if success, error code(<0) if fail
4994  * @retval      PMINFO_R_OK     success
4995  * @retval      PMINFO_R_EINVAL invalid argument
4996  * @retval      PMINFO_R_ERROR  internal error
4997  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4998  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4999  * @see         pkgmgrinfo_appinfo_get_appid()
5000  * @code
5001 static int get_app_removable(const char *appid)
5002 {
5003         int ret = 0;
5004         bool removable;
5005         pkgmgrinfo_appinfo_h handle = NULL;
5006         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5007         if (ret != PMINFO_R_OK)
5008                 return -1;
5009         ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5010         if (ret != PMINFO_R_OK) {
5011                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5012                 return -1;
5013         }
5014         printf("app removable: %d\n", removable);
5015         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5016         return 0;
5017 }
5018  * @endcode
5019  */
5020 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5021
5022 /**
5023  * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5024  * @brief       This API gets the application 'system' value from the app ID
5025  *
5026  * @par         This API is for package-manager client application
5027  * @par Sync (or) Async : Synchronous API
5028  *
5029  * @param[in]   handle  pointer to application info handle
5030  * @param[out]  system  pointer to hold package system value
5031  * @return      0 if success, error code(<0) if fail
5032  * @retval      PMINFO_R_OK     success
5033  * @retval      PMINFO_R_EINVAL invalid argument
5034  * @retval      PMINFO_R_ERROR  internal error
5035  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5036  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5037  * @see         pkgmgrinfo_appinfo_get_appid()
5038  * @code
5039 static int get_app_system(const char *appid)
5040 {
5041         int ret = 0;
5042         bool system = false;
5043         pkgmgrinfo_appinfo_h handle = NULL;
5044         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5045         if (ret != PMINFO_R_OK)
5046                 return -1;
5047         ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5048         if (ret != PMINFO_R_OK) {
5049                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5050                 return -1;
5051         }
5052         printf("app system: %d\n", system);
5053         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5054         return 0;
5055 }
5056  * @endcode
5057  */
5058 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5059
5060
5061 /**
5062  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5063  * @brief       This API gets the application 'is_disable' value from the app ID
5064  *
5065  * @par         This API is for package-manager client application
5066  * @par Sync (or) Async : Synchronous API
5067  *
5068  * @param[in]   handle  pointer to application info handle
5069  * @param[out]  disabled        pointer to hold application is_disabled value
5070  * @return      0 if success, error code(<0) if fail
5071  * @retval      PMINFO_R_OK     success
5072  * @retval      PMINFO_R_EINVAL invalid argument
5073  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5074  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
5075  * @code
5076 static int get_app_is_disable(const char *appid)
5077 {
5078         int ret = 0;
5079         bool is_disable;
5080         pkgmgrinfo_appinfo_h handle = NULL;
5081         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5082         if (ret != PMINFO_R_OK)
5083                 return -1;
5084         ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5085         if (ret != PMINFO_R_OK) {
5086                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5087                 return -1;
5088         }
5089         printf("app is_disable: %d\n", is_disable);
5090         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5091         return 0;
5092 }
5093  * @endcode
5094  */
5095 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5096
5097 /**
5098  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5099  * @brief       This API gets whethere the given application is global application or user application
5100  *
5101  * @par         This API is for package-manager client application
5102  * @par Sync (or) Async : Synchronous API
5103  *
5104  * @param[in]   handle  pointer to application info handle
5105  * @param[in]   global  pointer to hold application global value
5106  * @return      0 if success, error code(<0) if fail
5107  * @retval      PMINFO_R_OK     success
5108  * @retval      PMINFO_R_EINVAL invalid argument
5109  * @retval      PMINFO_R_ERROR  internal error
5110  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5111  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5112  * @see         pkgmgrinfo_appinfo_get_appid()
5113  static int get_app_is_global(const char *appid)
5114  {
5115          int ret = 0;
5116          bool global;
5117          pkgmgrinfo_appinfo_h handle = NULL;
5118          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5119          if (ret != PMINFO_R_OK)
5120                  return -1;
5121          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5122          if (ret != PMINFO_R_OK) {
5123                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
5124                  return -1;
5125          }
5126          printf("app is_global: %d\n", global);
5127          pkgmgrinfo_appinfo_destroy_appinfo(handle);
5128          return 0;
5129  }
5130   * @endcode
5131   */
5132 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5133
5134 /**
5135  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5136  * @brief       This API gets the application 'splash_screen_display' value from the app ID
5137  *
5138  * @par         This API is for package-manager client application
5139  * @par Sync (or) Async : Synchronous API
5140  *
5141  * @param[in]   handle          pointer to application info handle
5142  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
5143  * @return      0 if success, error code(<0) if fail
5144  * @retval      PMINFO_R_OK     success
5145  * @retval      PMINFO_R_EINVAL invalid argument
5146  * @retval      PMINFO_R_ERROR  internal error
5147  */
5148 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5149
5150 /**
5151  * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5152  * @brief       This API gets the application 'setup_appid' value from the app ID
5153  *
5154  * @par         This API is for package-manager client application
5155  * @par Sync (or) Async : Synchronous API
5156  *
5157  * @param[in]   handle          pointer to application info handle
5158  * @param[out]  setup_appid     pointer to hold package setup_appid value
5159  * @return      0 if success, error code(<0) if fail
5160  * @retval      PMINFO_R_OK     success
5161  * @retval      PMINFO_R_EINVAL invalid argument
5162  * @retval      PMINFO_R_ERROR  internal error
5163  */
5164 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5165
5166 /**
5167  * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5168  * @brief       This API gets the application 'support_ambient' value from the app ID
5169  *
5170  * @par         This API is for package-manager client application
5171  * @par Sync (or) Async : Synchronous API
5172  *
5173  * @param[in]   handle          pointer to application info handle
5174  * @param[out]  support_ambient pointer to hold package support_ambient value
5175  * @return      0 if success, error code(<0) if fail
5176  * @retval      PMINFO_R_OK     success
5177  * @retval      PMINFO_R_EINVAL invalid argument
5178  * @retval      PMINFO_R_ERROR  internal error
5179  */
5180 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5181
5182 /**
5183  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5184  * @brief       This API destroys the application information handle freeing up all the resources
5185  *
5186  * @par         This API is for package-manager client application
5187  * @par Sync (or) Async : Synchronous API
5188  *
5189  * @param[in] handle            pointer to the application info handle.
5190  * @return      0 if success, error code(<0) if fail
5191  * @retval      PMINFO_R_OK     success
5192  * @retval      PMINFO_R_EINVAL invalid argument
5193  * @retval      PMINFO_R_ERROR  internal error
5194  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5195  * @post                None
5196  * @see         pkgmgrinfo_appinfo_get_pkgid()
5197  * @see         pkgmgrinfo_appinfo_is_multiple()
5198  * @code
5199 static int get_app_type(const char *appid)
5200 {
5201         int ret = 0;
5202         char *type = NULL;
5203         pkgmgrinfo_appinfo_h handle;
5204         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5205         if (ret != PMINFO_R_OK)
5206                 return -1;
5207         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5208         if (ret != PMINFO_R_OK) {
5209                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5210                 return -1;
5211         }
5212         printf("apptype: %s\n", type);
5213         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5214         return 0;
5215 }
5216  * @endcode
5217  */
5218 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
5219
5220 /**
5221  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5222  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
5223  The query will search the entire application information collected from the manifest file of all the installed packages
5224  *
5225  * @par         This API is for package-manager client application
5226  * @par Sync (or) Async : Synchronous API
5227  *
5228  * @param[out] handle           pointer to the application info filter handle.
5229  * @return      0 if success, error code(<0) if fail
5230  * @retval      PMINFO_R_OK     success
5231  * @retval      PMINFO_R_EINVAL invalid argument
5232  * @retval      PMINFO_R_ERROR  internal error
5233  * @pre         None
5234  * @post                pkgmgrinfo_appinfo_filter_destroy()
5235  * @see         pkgmgrinfo_appinfo_filter_count()
5236  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5237  * @code
5238 static int get_capp_count()
5239 {
5240         int ret = 0;
5241         int count = 0;
5242         pkgmgrinfo_appinfo_filter_h handle;
5243         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5244         if (ret != PMINFO_R_OK)
5245                 return -1;
5246         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5247         if (ret != PMINFO_R_OK) {
5248                 pkgmgrinfo_appinfo_filter_destroy(handle);
5249                 return -1;
5250         }
5251         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5252         if (ret != PMINFO_R_OK) {
5253                 pkgmgrinfo_appinfo_filter_destroy(handle);
5254                 return -1;
5255         }
5256         printf("No of capp: %d\n", count);
5257         pkgmgrinfo_appinfo_filter_destroy(handle);
5258         return 0;
5259 }
5260  * @endcode
5261  */
5262 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5263
5264 /**
5265  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5266  * @brief       This API destroys the application information filter handle freeing up all the resources
5267  *
5268  * @par         This API is for package-manager client application
5269  * @par Sync (or) Async : Synchronous API
5270  *
5271  * @param[in] handle            pointer to the application info filter handle.
5272  * @return      0 if success, error code(<0) if fail
5273  * @retval      PMINFO_R_OK     success
5274  * @retval      PMINFO_R_EINVAL invalid argument
5275  * @retval      PMINFO_R_ERROR  internal error
5276  * @pre         pkgmgrinfo_appinfo_filter_create()
5277  * @post                None
5278  * @see         pkgmgrinfo_appinfo_filter_count()
5279  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5280  * @code
5281 static int get_capp_count()
5282 {
5283         int ret = 0;
5284         int count = 0;
5285         pkgmgrinfo_appinfo_filter_h handle;
5286         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5287         if (ret != PMINFO_R_OK)
5288                 return -1;
5289         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5290         if (ret != PMINFO_R_OK) {
5291                 pkgmgrinfo_appinfo_filter_destroy(handle);
5292                 return -1;
5293         }
5294         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5295         if (ret != PMINFO_R_OK) {
5296                 pkgmgrinfo_appinfo_filter_destroy(handle);
5297                 return -1;
5298         }
5299         printf("No of capp: %d\n", count);
5300         pkgmgrinfo_appinfo_filter_destroy(handle);
5301         return 0;
5302 }
5303  * @endcode
5304  */
5305 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5306
5307 /**
5308  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5309  * @brief       This API adds a boolean filter property to the filter handle
5310  *
5311  * @par         This API is for package-manager client application
5312  * @par Sync (or) Async : Synchronous API
5313  *
5314  * @param[in] handle            pointer to the application info filter handle.
5315  * @param[in] property          boolean property name.
5316  * @param[in] value             value corresponding to the property.
5317  * @return      0 if success, error code(<0) if fail
5318  * @retval      PMINFO_R_OK     success
5319  * @retval      PMINFO_R_EINVAL invalid argument
5320  * @retval      PMINFO_R_ERROR  internal error
5321  * @pre         pkgmgrinfo_appinfo_filter_create()
5322  * @post                pkgmgrinfo_appinfo_filter_destroy()
5323  * @see         pkgmgrinfo_appinfo_filter_count()
5324  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5325  * @code
5326 static int get_taskmanageable_app_count()
5327 {
5328         int ret = 0;
5329         int count = 0;
5330         pkgmgrinfo_appinfo_filter_h handle;
5331         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5332         if (ret != PMINFO_R_OK)
5333                 return -1;
5334         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5335         if (ret != PMINFO_R_OK) {
5336                 pkgmgrinfo_appinfo_filter_destroy(handle);
5337                 return -1;
5338         }
5339         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5340         if (ret != PMINFO_R_OK) {
5341                 pkgmgrinfo_appinfo_filter_destroy(handle);
5342                 return -1;
5343         }
5344         printf("No of taskmanageable apps: %d\n", count);
5345         pkgmgrinfo_appinfo_filter_destroy(handle);
5346         return 0;
5347 }
5348  * @endcode
5349  */
5350 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5351                 const char *property, const bool value);
5352
5353 /**
5354  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5355  * @brief       This API adds an integer filter property to the filter handle
5356  *
5357  * @par         This API is for package-manager client application
5358  * @par Sync (or) Async : Synchronous API
5359  *
5360  * @param[in] handle            pointer to the application info filter handle.
5361  * @param[in] property          integer property name.
5362  * @param[in] value             value corresponding to the property.
5363  * @return      0 if success, error code(<0) if fail
5364  * @retval      PMINFO_R_OK     success
5365  * @retval      PMINFO_R_EINVAL invalid argument
5366  * @retval      PMINFO_R_ERROR  internal error
5367  * @pre         pkgmgrinfo_appinfo_filter_create()
5368  * @post                pkgmgrinfo_appinfo_filter_destroy()
5369  * @see         pkgmgrinfo_appinfo_filter_count()
5370  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5371  * @code
5372 static int get_taskmanageable_app_count()
5373 {
5374         int ret = 0;
5375         int count = 0;
5376         pkgmgrinfo_appinfo_filter_h handle;
5377         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5378         if (ret != PMINFO_R_OK)
5379                 return -1;
5380         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5381         if (ret != PMINFO_R_OK) {
5382                 pkgmgrinfo_appinfo_filter_destroy(handle);
5383                 return -1;
5384         }
5385         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5386         if (ret != PMINFO_R_OK) {
5387                 pkgmgrinfo_appinfo_filter_destroy(handle);
5388                 return -1;
5389         }
5390         printf("No of apps: %d\n", count);
5391         pkgmgrinfo_appinfo_filter_destroy(handle);
5392         return 0;
5393 }
5394  * @endcode
5395  */
5396 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5397                 const char *property, const int value);
5398
5399 /**
5400  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5401  * @brief       This API adds a string filter property to the filter handle
5402  *
5403  * @par         This API is for package-manager client application
5404  * @par Sync (or) Async : Synchronous API
5405  *
5406  * @param[in] handle            pointer to the application info filter handle.
5407  * @param[in] property          string property name.
5408  * @param[in] value             value corresponding to the property.
5409  * @return      0 if success, error code(<0) if fail
5410  * @retval      PMINFO_R_OK     success
5411  * @retval      PMINFO_R_EINVAL invalid argument
5412  * @retval      PMINFO_R_ERROR  internal error
5413  * @pre         pkgmgrinfo_appinfo_filter_create()
5414  * @post                pkgmgrinfo_appinfo_filter_destroy()
5415  * @see         pkgmgrinfo_appinfo_filter_count()
5416  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5417  * @code
5418 static int get_capp_count()
5419 {
5420         int ret = 0;
5421         int count = 0;
5422         pkgmgrinfo_appinfo_filter_h handle;
5423         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5424         if (ret != PMINFO_R_OK)
5425                 return -1;
5426         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5427         if (ret != PMINFO_R_OK) {
5428                 pkgmgrinfo_appinfo_filter_destroy(handle);
5429                 return -1;
5430         }
5431         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5432         if (ret != PMINFO_R_OK) {
5433                 pkgmgrinfo_appinfo_filter_destroy(handle);
5434                 return -1;
5435         }
5436         printf("No of capp: %d\n", count);
5437         pkgmgrinfo_appinfo_filter_destroy(handle);
5438         return 0;
5439 }
5440  * @endcode
5441  */
5442 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5443                 const char *property, const char *value);
5444
5445 /**
5446  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5447  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
5448  *
5449  * @par         This API is for package-manager client application
5450  * @par Sync (or) Async : Synchronous API
5451  *
5452  * @param[in] handle            pointer to the application info filter handle.
5453  * @param[in] app_cb            callback function.
5454  * @param[in] user_data         user data to be passed to the callback function
5455  * @return      0 if success, error code(<0) if fail
5456  * @retval      PMINFO_R_OK     success
5457  * @retval      PMINFO_R_EINVAL invalid argument
5458  * @retval      PMINFO_R_ERROR  internal error
5459  * @pre         pkgmgrinfo_appinfo_filter_create()
5460  * @post                pkgmgrinfo_appinfo_filter_destroy()
5461  * @see         pkgmgrinfo_appinfo_filter_count()
5462  * @code
5463 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5464 {
5465         char *appid = NULL;
5466         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5467         printf("appid : %s\n", appid);
5468         return 0;
5469 }
5470
5471 static int get_capp_list()
5472 {
5473         int ret = 0;
5474         pkgmgrinfo_appinfo_filter_h handle;
5475         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5476         if (ret != PMINFO_R_OK)
5477                 return -1;
5478         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5479         if (ret != PMINFO_R_OK) {
5480                 pkgmgrinfo_appinfo_filter_destroy(handle);
5481                 return -1;
5482         }
5483         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5484         if (ret != PMINFO_R_OK) {
5485                 pkgmgrinfo_appinfo_filter_destroy(handle);
5486                 return -1;
5487         }
5488         pkgmgrinfo_appinfo_filter_destroy(handle);
5489         return 0;
5490 }
5491  * @endcode
5492  */
5493 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5494                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5495 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5496                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5497
5498 /**
5499  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5500  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5501  * @brief       This API counts the application that satisfy the filter conditions
5502  *
5503  * @par         This API is for package-manager client application
5504  * @par Sync (or) Async : Synchronous API
5505  *
5506  * @param[in] handle            pointer to the application info filter handle.
5507  * @param[in] count             pointer to store count value
5508  * @param[in]   uid     the addressee user id of the instruction
5509  * @return      0 if success, error code(<0) if fail
5510  * @retval      PMINFO_R_OK     success
5511  * @retval      PMINFO_R_EINVAL invalid argument
5512  * @retval      PMINFO_R_ERROR  internal error
5513  * @pre         pkgmgrinfo_appinfo_filter_create()
5514  * @post                pkgmgrinfo_appinfo_filter_destroy()
5515  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5516  * @code
5517 static int get_capp_count()
5518 {
5519         int ret = 0;
5520         int count = 0;
5521         pkgmgrinfo_appinfo_filter_h handle;
5522         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5523         if (ret != PMINFO_R_OK)
5524                 return -1;
5525         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5526         if (ret != PMINFO_R_OK) {
5527                 pkgmgrinfo_appinfo_filter_destroy(handle);
5528                 return -1;
5529         }
5530         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5531         if (ret != PMINFO_R_OK) {
5532                 pkgmgrinfo_appinfo_filter_destroy(handle);
5533                 return -1;
5534         }
5535         printf("No of capp: %d\n", count);
5536         pkgmgrinfo_appinfo_filter_destroy(handle);
5537         return 0;
5538 }
5539  * @endcode
5540  */
5541 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5542 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5543 /**
5544  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5545  * @brief       This API creates the application's metadata  information filter handle from db.
5546  *
5547  * @par         This API is for package-manager client application
5548  * @par Sync (or) Async : Synchronous API
5549  *
5550  * @param[out] handle           pointer to the application metadata info filter handle.
5551  * @return      0 if success, error code(<0) if fail
5552  * @retval      PMINFO_R_OK     success
5553  * @retval      PMINFO_R_EINVAL invalid argument
5554  * @retval      PMINFO_R_ERROR  internal error
5555  * @pre         None
5556  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5557  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5558  * @code
5559 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5560 {
5561         char *appid = NULL;
5562         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5563         printf("appid : %s\n", appid);
5564         return 0;
5565 }
5566
5567 static int get_app_list(const char *mkey, const char *mvalue)
5568 {
5569         int ret = 0;
5570         pkgmgrinfo_appinfo_metadata_filter_h handle;
5571         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5572         if (ret != PMINFO_R_OK)
5573                 return -1;
5574         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5575         if (ret != PMINFO_R_OK) {
5576                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5577                 return -1;
5578         }
5579         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5580         if (ret != PMINFO_R_OK) {
5581                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5582                 return -1;
5583         }
5584         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5585         return 0;
5586 }
5587  * @endcode
5588  */
5589 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5590
5591 /**
5592  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5593  * @brief       This API destroys the application's metadata  information filter handle.
5594  *
5595  * @par         This API is for package-manager client application
5596  * @par Sync (or) Async : Synchronous API
5597  *
5598  * @param[in] handle            pointer to the application metadata info filter handle.
5599  * @return      0 if success, error code(<0) if fail
5600  * @retval      PMINFO_R_OK     success
5601  * @retval      PMINFO_R_EINVAL invalid argument
5602  * @retval      PMINFO_R_ERROR  internal error
5603  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5604  * @post                None
5605  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5606  * @code
5607 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5608 {
5609         char *appid = NULL;
5610         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5611         printf("appid : %s\n", appid);
5612         return 0;
5613 }
5614
5615 static int get_app_list(const char *mkey, const char *mvalue)
5616 {
5617         int ret = 0;
5618         pkgmgrinfo_appinfo_metadata_filter_h handle;
5619         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5620         if (ret != PMINFO_R_OK)
5621                 return -1;
5622         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5623         if (ret != PMINFO_R_OK) {
5624                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5625                 return -1;
5626         }
5627         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5628         if (ret != PMINFO_R_OK) {
5629                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5630                 return -1;
5631         }
5632         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5633         return 0;
5634 }
5635  * @endcode
5636  */
5637 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5638
5639 /**
5640  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5641  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
5642  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5643  *
5644  * @par         This API is for package-manager client application
5645  * @par Sync (or) Async : Synchronous API
5646  *
5647  * @param[in] handle            pointer to the application metadata info filter handle.
5648  * @param[in] key                       pointer to metadata key
5649  * @param[in] value                     pointer to metadata value
5650  * @return      0 if success, error code(<0) if fail
5651  * @retval      PMINFO_R_OK     success
5652  * @retval      PMINFO_R_EINVAL invalid argument
5653  * @retval      PMINFO_R_ERROR  internal error
5654  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5655  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5656  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5657  * @code
5658 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5659 {
5660         char *appid = NULL;
5661         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5662         printf("appid : %s\n", appid);
5663         return 0;
5664 }
5665
5666 static int get_app_list(const char *mkey, const char *mvalue)
5667 {
5668         int ret = 0;
5669         pkgmgrinfo_appinfo_metadata_filter_h handle;
5670         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5671         if (ret != PMINFO_R_OK)
5672                 return -1;
5673         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5674         if (ret != PMINFO_R_OK) {
5675                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5676                 return -1;
5677         }
5678         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5679         if (ret != PMINFO_R_OK) {
5680                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5681                 return -1;
5682         }
5683         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5684         return 0;
5685 }
5686  * @endcode
5687  */
5688 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5689                 const char *key, const char *value);
5690
5691 /**
5692  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5693  * @fn int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid)
5694  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
5695  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5696  * negative value, no more callbacks will be called and API will return.
5697  *
5698  * @par         This API is for package-manager client application
5699  * @par Sync (or) Async : Synchronous API
5700  *
5701  * @param[in] handle            pointer to the application metadata info filter handle.
5702  * @param[in] app_cb            function pointer to callback
5703  * @param[in] user_data         pointer to user data
5704  * @param[in]   uid     the addressee user id of the instruction
5705  * @return      0 if success, error code(<0) if fail
5706  * @retval      PMINFO_R_OK     success
5707  * @retval      PMINFO_R_EINVAL invalid argument
5708  * @retval      PMINFO_R_ERROR  internal error
5709  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5710  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5711  * @code
5712 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5713 {
5714         char *appid = NULL;
5715         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5716         printf("appid : %s\n", appid);
5717         return 0;
5718 }
5719
5720 static int get_app_list(const char *mkey, const char *mvalue)
5721 {
5722         int ret = 0;
5723         pkgmgrinfo_appinfo_metadata_filter_h handle;
5724         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5725         if (ret != PMINFO_R_OK)
5726                 return -1;
5727         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5728         if (ret != PMINFO_R_OK) {
5729                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5730                 return -1;
5731         }
5732         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5733         if (ret != PMINFO_R_OK) {
5734                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5735                 return -1;
5736         }
5737         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5738         return 0;
5739 }
5740  * @endcode
5741  */
5742 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5743                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5744 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5745                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5746 /**
5747  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5748  * @brief       This API creates the package cert information handle to get data from db.
5749  *
5750  * @par         This API is for package-manager client application
5751  * @par Sync (or) Async : Synchronous API
5752  *
5753  * @param[out] handle           pointer to the package cert handle.
5754  * @return      0 if success, error code(<0) if fail
5755  * @retval      PMINFO_R_OK     success
5756  * @retval      PMINFO_R_EINVAL invalid argument
5757  * @retval      PMINFO_R_ERROR  internal error
5758  * @pre         None
5759  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5760  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5761  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5762  * @code
5763 static int get_cert_info(const char *pkgid)
5764 {
5765         int ret = 0;
5766         pkgmgrinfo_certinfo_h handle;
5767         char *auth_cert = NULL;
5768         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5769         if (ret != PMINFO_R_OK)
5770                 return -1;
5771         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5772         if (ret != PMINFO_R_OK) {
5773                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5774                 return -1;
5775         }
5776         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5777         if (ret != PMINFO_R_OK) {
5778                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5779                 return -1;
5780         }
5781         printf("Author root certificate: %s\n", auth_root);
5782         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5783         return 0;
5784 }
5785  * @endcode
5786  */
5787 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5788
5789 /**
5790  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5791  * @brief       This API loads the package cert information handle with data from db.
5792  *
5793  * @par         This API is for package-manager client application
5794  * @par Sync (or) Async : Synchronous API
5795  *
5796  * @param[in] pkgid             pointer to the package ID.
5797  * @param[in] handle            pointer to the package cert handle.
5798  * @return      0 if success, error code(<0) if fail
5799  * @retval      PMINFO_R_OK     success
5800  * @retval      PMINFO_R_EINVAL invalid argument
5801  * @retval      PMINFO_R_ERROR  internal error
5802  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5803  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5804  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5805  * @code
5806 static int get_cert_info(const char *pkgid)
5807 {
5808         int ret = 0;
5809         pkgmgrinfo_certinfo_h handle;
5810         char *auth_cert = NULL;
5811         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5812         if (ret != PMINFO_R_OK)
5813                 return -1;
5814         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5815         if (ret != PMINFO_R_OK) {
5816                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5817                 return -1;
5818         }
5819         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5820         if (ret != PMINFO_R_OK) {
5821                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5822                 return -1;
5823         }
5824         printf("Author root certificate: %s\n", auth_root);
5825         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5826         return 0;
5827 }
5828  * @endcode
5829  */
5830 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5831
5832 /**
5833  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5834  * @brief       This API gets the package cert information from the handle
5835  *
5836  * @par         This API is for package-manager client application
5837  * @par Sync (or) Async : Synchronous API
5838  *
5839  * @param[in] handle            pointer to the package cert handle.
5840  * @param[in] cert_type         certificate type
5841  * @param[out] cert_value       pointer to hold certificate value
5842  * @return      0 if success, error code(<0) if fail
5843  * @retval      PMINFO_R_OK     success
5844  * @retval      PMINFO_R_EINVAL invalid argument
5845  * @retval      PMINFO_R_ERROR  internal error
5846  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5847  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5848  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5849  * @code
5850 static int get_cert_info(const char *pkgid)
5851 {
5852         int ret = 0;
5853         pkgmgrinfo_certinfo_h handle;
5854         char *auth_cert = NULL;
5855         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5856         if (ret != PMINFO_R_OK)
5857                 return -1;
5858         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5859         if (ret != PMINFO_R_OK) {
5860                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5861                 return -1;
5862         }
5863         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5864         if (ret != PMINFO_R_OK) {
5865                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5866                 return -1;
5867         }
5868         printf("Author root certificate: %s\n", auth_root);
5869         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5870         return 0;
5871 }
5872  * @endcode
5873  */
5874 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5875
5876 /**
5877  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5878  * @brief       This API destroys the package cert information handle freeing up all the resources
5879  *
5880  * @par         This API is for package-manager client application
5881  * @par Sync (or) Async : Synchronous API
5882  *
5883  * @param[in] handle            pointer to the package cert handle.
5884  * @return      0 if success, error code(<0) if fail
5885  * @retval      PMINFO_R_OK     success
5886  * @retval      PMINFO_R_EINVAL invalid argument
5887  * @retval      PMINFO_R_ERROR  internal error
5888  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5889  * @post                None
5890  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5891  * @code
5892 static int get_cert_info(const char *pkgid)
5893 {
5894         int ret = 0;
5895         pkgmgrinfo_certinfo_h handle;
5896         char *auth_cert = NULL;
5897         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5898         if (ret != PMINFO_R_OK)
5899                 return -1;
5900         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5901         if (ret != PMINFO_R_OK) {
5902                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5903                 return -1;
5904         }
5905         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5906         if (ret != PMINFO_R_OK) {
5907                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5908                 return -1;
5909         }
5910         printf("Author root certificate: %s\n", auth_root);
5911         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5912         return 0;
5913 }
5914  * @endcode
5915  */
5916 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5917
5918 /**
5919  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5920  * @brief       This API deletes the package cert information from DB
5921  *
5922  * @par         This API is for package-manager client application
5923  * @par Sync (or) Async : Synchronous API
5924  *
5925  * @param[in] pkgid             pointer to the package ID.
5926  * @return      0 if success, error code(<0) if fail
5927  * @retval      PMINFO_R_OK     success
5928  * @retval      PMINFO_R_EINVAL invalid argument
5929  * @retval      PMINFO_R_ERROR  internal error
5930  * @pre         None
5931  * @post                None
5932  * @code
5933 static int delete_cert_info(const char *pkgid)
5934 {
5935         int ret = 0;
5936         ret = pkgmgrinfo_delete_certinfo(pkgid);
5937         if (ret != PMINFO_R_OK)
5938                 return -1;
5939         return 0;
5940 }
5941  * @endcode
5942  */
5943 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5944 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5945
5946 /**
5947  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5948  * @brief       This API creates the package cert information handle to set data in db.
5949  *
5950  * @par         This API is for package-manager client application
5951  * @par Sync (or) Async : Synchronous API
5952  *
5953  * @param[out] handle           pointer to the package cert handle.
5954  * @return      0 if success, error code(<0) if fail
5955  * @retval      PMINFO_R_OK     success
5956  * @retval      PMINFO_R_EINVAL invalid argument
5957  * @retval      PMINFO_R_ERROR  internal error
5958  * @pre         None
5959  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5960  * @see         pkgmgrinfo_set_cert_value()
5961  * @see         pkgmgrinfo_save_certinfo()
5962  * @code
5963 static int set_cert_in_db(const char *pkgid)
5964 {
5965         int ret = 0;
5966         pkgmgrinfo_instcertinfo_h handle;
5967         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5968         if (ret != PMINFO_R_OK)
5969                 return -1;
5970         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5971         if (ret != PMINFO_R_OK) {
5972                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5973                 return -1;
5974         }
5975         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5976         if (ret != PMINFO_R_OK) {
5977                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5978                 return -1;
5979         }
5980         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5981         return 0;
5982 }
5983  * @endcode
5984  */
5985 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5986
5987 /**
5988  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5989  * @brief       This API sets the package cert information in the handle.
5990  *
5991  * @par         This API is for package-manager client application
5992  * @par Sync (or) Async : Synchronous API
5993  *
5994  * @param[in] handle            pointer to the package cert handle.
5995  * @param[in] cert_type         certificate type.
5996  * @param[in] cert_value        certificate value.
5997  * @return      0 if success, error code(<0) if fail
5998  * @retval      PMINFO_R_OK     success
5999  * @retval      PMINFO_R_EINVAL invalid argument
6000  * @retval      PMINFO_R_ERROR  internal error
6001  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6002  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6003  * @see         pkgmgrinfo_save_certinfo()
6004  * @code
6005 static int set_cert_in_db(const char *pkgid)
6006 {
6007         int ret = 0;
6008         pkgmgrinfo_instcertinfo_h handle;
6009         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6010         if (ret != PMINFO_R_OK)
6011                 return -1;
6012         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6013         if (ret != PMINFO_R_OK) {
6014                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6015                 return -1;
6016         }
6017         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6018         if (ret != PMINFO_R_OK) {
6019                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6020                 return -1;
6021         }
6022         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6023         return 0;
6024 }
6025  * @endcode
6026  */
6027 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6028
6029 /**
6030  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6031  * @brief       This API saves the package cert information in the DB.
6032  *
6033  * @par         This API is for package-manager client application
6034  * @par Sync (or) Async : Synchronous API
6035  *
6036  * @param[in] pkgid             pointer to the package ID.
6037  * @param[in] handle            pointer to the package cert handle.
6038  * @return      0 if success, error code(<0) if fail
6039  * @retval      PMINFO_R_OK     success
6040  * @retval      PMINFO_R_EINVAL invalid argument
6041  * @retval      PMINFO_R_ERROR  internal error
6042  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6043  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6044  * @see         pkgmgrinfo_save_certinfo()
6045  * @code
6046 static int set_cert_in_db(const char *pkgid)
6047 {
6048         int ret = 0;
6049         pkgmgrinfo_instcertinfo_h handle;
6050         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6051         if (ret != PMINFO_R_OK)
6052                 return -1;
6053         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6054         if (ret != PMINFO_R_OK) {
6055                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6056                 return -1;
6057         }
6058         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6059         if (ret != PMINFO_R_OK) {
6060                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6061                 return -1;
6062         }
6063         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6064         return 0;
6065 }
6066  * @endcode
6067  */
6068 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6069
6070 /**
6071  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6072  * @brief       This API destroys the package cert information handle freeing up all the resources.
6073  *
6074  * @par         This API is for package-manager client application
6075  * @par Sync (or) Async : Synchronous API
6076  *
6077  * @param[in] handle            pointer to the package cert handle.
6078  * @return      0 if success, error code(<0) if fail
6079  * @retval      PMINFO_R_OK     success
6080  * @retval      PMINFO_R_EINVAL invalid argument
6081  * @retval      PMINFO_R_ERROR  internal error
6082  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6083  * @post                None
6084  * @see         pkgmgrinfo_save_certinfo()
6085  * @code
6086 static int set_cert_in_db(const char *pkgid)
6087 {
6088         int ret = 0;
6089         pkgmgrinfo_instcertinfo_h handle;
6090         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6091         if (ret != PMINFO_R_OK)
6092                 return -1;
6093         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6094         if (ret != PMINFO_R_OK) {
6095                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6096                 return -1;
6097         }
6098         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6099         if (ret != PMINFO_R_OK) {
6100                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6101                 return -1;
6102         }
6103         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6104         return 0;
6105 }
6106  * @endcode
6107  */
6108 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6109
6110 /**
6111  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6112  * @brief       This API gets the datacontrol info
6113  *
6114  * @par         This API is for package-manager client application
6115  * @par Sync (or) Async : Synchronous API
6116  *
6117  * @param[in] providerid                pointer to the providerid of dataconltrol.
6118  * @param[in] type                      pointer to the type of dataconltrol.
6119  * @param[out] appid                    pointer to hold appid, need to free after using
6120  * @param[out] access                   pointer to hold access, need to free after using
6121  * @return      0 if success, error code(<0) if fail
6122  * @retval      PMINFO_R_OK     success
6123  * @retval      PMINFO_R_EINVAL invalid argument
6124  * @retval      PMINFO_R_ERROR  internal error
6125  * @endcode
6126  */
6127 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6128
6129 /**
6130  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6131  * @brief       This API gets the application 'guest mode visibility' value from the DB
6132  *
6133  * @par         This API is for package-manager client application
6134  * @par Sync (or) Async : Synchronous API
6135  *
6136  * @param[in]   handle  pointer to application info handle
6137  * @param[out] status           pointer to hold app guest mode visibility value
6138  * @return      0 if success, error code(<0) if fail
6139  * @retval      PMINFO_R_OK     success
6140  * @retval      PMINFO_R_EINVAL invalid argument
6141  * @retval      PMINFO_R_ERROR  internal error
6142  * @pre         pkgmgrinfo_appinfo_get_appinfo()
6143  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
6144  * @see         pkgmgrinfo_appinfo_get_appid()
6145  * @see         pkgmgrinfo_appinfo_is_multiple()
6146  * @code
6147 static int get_app_guestmode_visibility(const char *appid)
6148 {
6149         int ret = 0;
6150         bool status;
6151         pkgmgrinfo_appinfo_h handle;
6152         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6153         if (ret != PMINFO_R_OK)
6154                 return -1;
6155         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6156         if (ret != PMINFO_R_OK) {
6157                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6158                 return -1;
6159         }
6160         printf("app guest mode visibility: %d\n", status);
6161         pkgmgrinfo_appinfo_destroy_appinfo(handle);
6162         return 0;
6163 }
6164  * @endcode
6165  */
6166 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6167
6168 /**
6169 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6170 * @brief         This API sets the package 'installed_storage' value in db
6171 *
6172 * @par  This API is for package-manager client application
6173 * @par Sync (or) Async : Synchronous API
6174 *
6175 * @param[in] pkgid              pointer to the package ID.
6176 * @param[in] location  package install location
6177 * @param[in] external_pkg_path  image path if pkg has installed at external storage
6178 * @return  0 if success, error code(<0) if fail
6179 * @retval  PMINFO_R_OK success
6180 * @retval  PMINFO_R_EINVAL       invalid argument
6181 * @retval  PMINFO_R_ERROR internal error
6182 * @code
6183 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6184 {
6185         int ret = 0;
6186
6187         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6188         if (ret != PMINFO_R_OK) {
6189                 return -1;
6190         }
6191         return 0;
6192 }
6193 * @endcode
6194 */
6195 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6196 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6197
6198 /* version compare */
6199 int pkgmgrinfo_compare_package_version(const char *current_version,
6200                 const char *target_version, pkgmgrinfo_version_compare_type *res);
6201
6202 /**
6203  * @brief       TEMP
6204  */
6205
6206
6207 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6208                 int flag, void *user_data, uid_t uid);
6209 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6210                 int flag, void *user_data);
6211 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6212                 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6213                 void *user_data);
6214 int pkgmgrinfo_appinfo_get_installed_list_full(
6215                 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6216
6217
6218 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6219                 pkgmgrinfo_archiveinfo_h *handle);
6220 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6221 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6222                 const char **pkgid);
6223 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6224                 const char **type);
6225 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6226                 const char **version);
6227 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6228                 const char **api_version);
6229 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6230                 const char **description);
6231 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6232                 const char **label);
6233 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6234                 const char **author);
6235 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6236                 const unsigned char **icon, size_t *size);
6237
6238 /**
6239  * @pkgmgrinfo client API end
6240 **/
6241
6242
6243 /** @} */
6244 #ifdef __cplusplus
6245 }
6246 #endif
6247 #endif                          /* __PKG_INFO_H__ */
6248 /**
6249  * @}
6250  * @}
6251  */
6252