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