134af6451f2b94db2580abcc823419c8762f43e3
[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_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1798  * @brief       This API compare the cert information from given package id
1799  *
1800  * @par         This API is for package-manager client application
1801  * @par Sync (or) Async : Synchronous API
1802  *
1803  * @param[in]   lhs_package_id  pointer to first package ID
1804  * @param[in]   rhs_package_id  pointer to second package ID
1805  * @param[out] compare_result           pointer to the compare result.
1806  * @return      0 if success, error code(<0) if fail
1807  * @retval      PMINFO_R_OK     success
1808  * @retval      PMINFO_R_EINVAL invalid argument
1809  * @retval      PMINFO_R_ERROR  internal error
1810  * @pre         None
1811  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1812  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1813  * @see         pkgmgrinfo_pkginfo_is_removable()
1814  * @code
1815 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1816 {
1817         int ret = 0;
1818         pkgmgrinfo_cert_compare_result_type_e result;
1819
1820         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1821         if (ret != PMINFO_R_OK) {
1822                 return -1;
1823         }
1824         printf("result: %d\n", result);
1825         return 0;
1826 }
1827  * @endcode
1828  */
1829 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);
1830 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);
1831 /**
1832  * @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)
1833  * @brief       This API compare the cert information from given app id
1834  *
1835  * @par         This API is for package-manager client application
1836  * @par Sync (or) Async : Synchronous API
1837  *
1838  * @param[in]   lhs_app_id      pointer to first app ID
1839  * @param[in]   rhs_app_id      pointer to second app ID
1840  * @param[out] compare_result           pointer to the compare result.
1841  * @return      0 if success, error code(<0) if fail
1842  * @retval      PMINFO_R_OK     success
1843  * @retval      PMINFO_R_EINVAL invalid argument
1844  * @retval      PMINFO_R_ERROR  internal error
1845  * @pre         None
1846  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1847  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1848  * @see         pkgmgrinfo_pkginfo_is_removable()
1849  * @code
1850 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1851 {
1852         int ret = 0;
1853         pkgmgrinfo_cert_compare_result_type_e result;
1854
1855         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1856         if (ret != PMINFO_R_OK) {
1857                 return -1;
1858         }
1859         printf("result: %d\n", result);
1860         return 0;
1861 }
1862  * @endcode
1863  */
1864 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);
1865 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);
1866 /**
1867  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1868  * @brief       This API gets the package 'removable' value from the package ID
1869  *
1870  * @par         This API is for package-manager client application
1871  * @par Sync (or) Async : Synchronous API
1872  *
1873  * @param[in]   handle  pointer to package info handle
1874  * @param[out] removable                pointer to hold package removable value
1875  * @return      0 if success, error code(<0) if fail
1876  * @retval      PMINFO_R_OK     success
1877  * @retval      PMINFO_R_EINVAL invalid argument
1878  * @retval      PMINFO_R_ERROR  internal error
1879  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1880  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1881  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1882  * @see         pkgmgrinfo_pkginfo_is_readonly()
1883  * @code
1884 static int get_pkg_removable(const char *pkgid)
1885 {
1886         int ret = 0;
1887         bool removable;
1888         pkgmgrinfo_pkginfo_h handle;
1889         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1890         if (ret != PMINFO_R_OK)
1891                 return -1;
1892         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1893         if (ret != PMINFO_R_OK) {
1894                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1895                 return -1;
1896         }
1897         printf("pkg removable: %d\n", removable);
1898         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1899         return 0;
1900 }
1901  * @endcode
1902  */
1903 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1904
1905 /**
1906  * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1907  * @brief       This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1908  *
1909  * @par         This API is for package-manager client application
1910  * @par Sync (or) Async : Synchronous API
1911  *
1912  * @param[in]   handle  pointer to package info handle
1913  * @param[out] movable          pointer to hold package movable state
1914  * @return      0 if success, error code(<0) if fail
1915  * @retval      PMINFO_R_OK     success
1916  * @retval      PMINFO_R_EINVAL invalid argument
1917  * @retval      PMINFO_R_ERROR  internal error
1918  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1919  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1920  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1921  * @code
1922 static int get_pkg_movable(const char *pkgid)
1923 {
1924         int ret = 0;
1925         bool movable;
1926         pkgmgrinfo_pkginfo_h handle;
1927         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1928         if (ret != PMINFO_R_OK)
1929                 return -1;
1930         ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1931         if (ret != PMINFO_R_OK) {
1932                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1933                 return -1;
1934         }
1935         printf("pkg movable: %d\n", movable);
1936         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1937         return 0;
1938 }
1939  * @endcode
1940  */
1941 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1942
1943 /**
1944  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1945  * @brief       This API gets the package 'preload' value from the package ID
1946  *
1947  * @par         This API is for package-manager client application
1948  * @par Sync (or) Async : Synchronous API
1949  *
1950  * @param[in]   handle  pointer to package info handle
1951  * @param[out] preload          pointer to hold package preload value
1952  * @return      0 if success, error code(<0) if fail
1953  * @retval      PMINFO_R_OK     success
1954  * @retval      PMINFO_R_EINVAL invalid argument
1955  * @retval      PMINFO_R_ERROR  internal error
1956  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1957  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1958  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1959  * @see         pkgmgrinfo_pkginfo_is_readonly()
1960  * @code
1961 static int get_pkg_preload(const char *pkgid)
1962 {
1963         int ret = 0;
1964         bool preload;
1965         pkgmgrinfo_pkginfo_h handle;
1966         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1967         if (ret != PMINFO_R_OK)
1968                 return -1;
1969         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1970         if (ret != PMINFO_R_OK) {
1971                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1972                 return -1;
1973         }
1974         printf("pkg preload: %d\n", preload);
1975         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1976         return 0;
1977 }
1978  * @endcode
1979  */
1980 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1981
1982 /**
1983  * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1984  * @brief       This API gets the value for given handle is system or not
1985  *
1986  * @par         This API is for package-manager client application
1987  * @par Sync (or) Async : Synchronous API
1988  *
1989  * @param[in]   handle  pointer to package info handle
1990  * @param[out] system           pointer to hold  system is or not
1991  * @return      0 if success, error code(<0) if fail
1992  * @retval      PMINFO_R_OK     success
1993  * @retval      PMINFO_R_EINVAL invalid argument
1994  * @retval      PMINFO_R_ERROR  internal error
1995  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1996  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1997  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1998  * @see         pkgmgrinfo_pkginfo_is_readonly()
1999  * @code
2000 static int get_pkg_system(const char *pkgid)
2001 {
2002         int ret = 0;
2003         bool system = false;
2004         pkgmgrinfo_pkginfo_h handle = NULL;
2005         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2006         if (ret != PMINFO_R_OK)
2007                 return -1;
2008         ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
2009         if (ret != PMINFO_R_OK) {
2010                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2011                 return -1;
2012         }
2013         printf("pkg system: %d\n", system);
2014         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2015         return 0;
2016 }
2017  * @endcode
2018  */
2019 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
2020
2021 /**
2022  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
2023  * @brief       This API gets the package 'readonly' value from the package ID
2024  *
2025  * @par         This API is for package-manager client application
2026  * @par Sync (or) Async : Synchronous API
2027  *
2028  * @param[in]   handle  pointer to package info handle
2029  * @param[out] readonly pointer to hold package readonly value
2030  * @return      0 if success, error code(<0) if fail
2031  * @retval      PMINFO_R_OK     success
2032  * @retval      PMINFO_R_EINVAL invalid argument
2033  * @retval      PMINFO_R_ERROR  internal error
2034  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2035  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2036  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2037  * @see         pkgmgrinfo_pkginfo_is_removable()
2038  * @code
2039 static int get_pkg_readonly(const char *pkgid)
2040 {
2041         int ret = 0;
2042         bool readonly;
2043         pkgmgrinfo_pkginfo_h handle;
2044         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2045         if (ret != PMINFO_R_OK)
2046                 return -1;
2047         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2048         if (ret != PMINFO_R_OK) {
2049                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2050                 return -1;
2051         }
2052         printf("pkg readonly: %d\n", readonly);
2053         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2054         return 0;
2055 }
2056  * @endcode
2057  */
2058 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2059
2060
2061 /**
2062  * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2063  * @brief       This API gets the package 'update' value from the package ID
2064  *
2065  * @par         This API is for package-manager client application
2066  * @par Sync (or) Async : Synchronous API
2067  *
2068  * @param[in]   handle  pointer to package info handle
2069  * @param[out] update   pointer to hold package update value
2070  * @return      0 if success, error code(<0) if fail
2071  * @retval      PMINFO_R_OK     success
2072  * @retval      PMINFO_R_EINVAL invalid argument
2073  * @retval      PMINFO_R_ERROR  internal error
2074  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2075  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2076  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2077  * @code
2078 static int get_pkg_update(const char *pkgid)
2079 {
2080         int ret = 0;
2081         bool update;
2082         pkgmgrinfo_pkginfo_h handle;
2083         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2084         if (ret != PMINFO_R_OK)
2085                 return -1;
2086         ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2087         if (ret != PMINFO_R_OK) {
2088                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2089                 return -1;
2090         }
2091         printf("pkg update: %d\n", update);
2092         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2093         return 0;
2094 }
2095  * @endcode
2096  */
2097 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2098
2099 /**
2100  * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2101  * @brief       This API gets the package 'support_disable' value from the package ID
2102  *
2103  * @par         This API is for package-manager client application
2104  * @par Sync (or) Async : Synchronous API
2105  *
2106  * @param[in]   handle  pointer to package info handle
2107  * @param[out]  support_disable pointer to hold package support_disable value
2108  * @return      0 if success, error code(<0) if fail
2109  * @retval      PMINFO_R_OK     success
2110  * @retval      PMINFO_R_EINVAL invalid argument
2111  * @retval      PMINFO_R_ERROR  internal error
2112  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2113  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2114  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2115  * @code
2116 static int get_pkg_support_disable(const char *pkgid)
2117 {
2118         int ret = 0;
2119         bool support_disable;
2120         pkgmgrinfo_pkginfo_h handle = NULL;
2121         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2122         if (ret != PMINFO_R_OK)
2123                 return -1;
2124         ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2125         if (ret != PMINFO_R_OK) {
2126                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2127                 return -1;
2128         }
2129         printf("pkg support_disable: %d\n", support_disable);
2130         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2131         return 0;
2132 }
2133  * @endcode
2134  */
2135 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2136
2137 /**
2138  * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2139  * @brief       This API gets whether the given package is global package or user package
2140  *
2141  * @par         This API is for package-manager client application
2142  * @par Sync (or) Async : Synchronous API
2143  *
2144  * @param[in]   handle  pointer to package info handle
2145  * @param[in]   global  pointer to hold package global value
2146  * @return      0 if success, error code(<0) if fail
2147  * @retval      PMINFO_R_OK     success
2148  * @retval      PMINFO_R_EINVAL invalid argument
2149  * @retval      PMINFO_R_ERROR  internal error
2150  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2151  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2152  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2153  static int get_pkg_support_disable(const char *pkgid)
2154  {
2155          int ret = 0;
2156          bool global;
2157          pkgmgrinfo_pkginfo_h handle = NULL;
2158          ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2159          if (ret != PMINFO_R_OK)
2160                  return -1;
2161          ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2162          if (ret != PMINFO_R_OK) {
2163                  pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2164                  return -1;
2165          }
2166          printf("pkg is_global: %d\n", global);
2167          pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2168          return 0;
2169  }
2170   * @endcode
2171   */
2172 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2173
2174 /**
2175  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2176  * @brief       This API gets the package 'accessible' value from the package ID
2177  *
2178  * @par         This API is for package-manager client application
2179  * @par Sync (or) Async : Synchronous API
2180  *
2181  * @param[in]   handle  pointer to package info handle
2182  * @param[out] accessible       pointer to hold package accessible value
2183  * @return      0 if success, error code(<0) if fail
2184  * @retval      PMINFO_R_OK     success
2185  * @retval      PMINFO_R_EINVAL invalid argument
2186  * @retval      PMINFO_R_ERROR  internal error
2187  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2188  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2189  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2190  * @see         pkgmgrinfo_pkginfo_is_readonly()
2191  * @code
2192 static int get_pkg_accessible(const char *pkgid)
2193 {
2194         int ret = 0;
2195         bool accessible;
2196         pkgmgrinfo_pkginfo_h handle;
2197         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2198         if (ret != PMINFO_R_OK)
2199                 return -1;
2200         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2201         if (ret != PMINFO_R_OK) {
2202                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2203                 return -1;
2204         }
2205         printf("pkg accessible: %d\n", accessible);
2206         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2207         return 0;
2208 }
2209  * @endcode
2210  */
2211 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2212
2213 /**
2214  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2215  * @brief       This API destroys the package information handle freeing up all the resources
2216  *
2217  * @par         This API is for package-manager client application
2218  * @par Sync (or) Async : Synchronous API
2219  *
2220  * @param[in]   handle  pointer to the package info handle
2221  * @return      0 if success, error code(<0) if fail
2222  * @retval      PMINFO_R_OK     success
2223  * @retval      PMINFO_R_EINVAL invalid argument
2224  * @retval      PMINFO_R_ERROR  internal error
2225  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2226  * @post                None
2227  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2228  * @see         pkgmgrinfo_pkginfo_is_removable()
2229  * @code
2230 static int get_pkg_type(const char *pkgid)
2231 {
2232         int ret = 0;
2233         char *type = NULL;
2234         pkgmgrinfo_pkginfo_h handle;
2235         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2236         if (ret != PMINFO_R_OK)
2237                 return -1;
2238         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2239         if (ret != PMINFO_R_OK) {
2240                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2241                 return -1;
2242         }
2243         printf("pkgtype: %s\n", type);
2244         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2245         return 0;
2246 }
2247  * @endcode
2248  */
2249 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2250
2251 /**
2252  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2253  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
2254  The query will search the entire package information collected from the manifest file of all the installed packages
2255  *
2256  * @par         This API is for package-manager client application
2257  * @par Sync (or) Async : Synchronous API
2258  *
2259  * @param[out] handle           pointer to the package info filter handle.
2260  * @return      0 if success, error code(<0) if fail
2261  * @retval      PMINFO_R_OK     success
2262  * @retval      PMINFO_R_EINVAL invalid argument
2263  * @retval      PMINFO_R_ERROR  internal error
2264  * @pre         None
2265  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2266  * @see         pkgmgrinfo_pkginfo_filter_count()
2267  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2268  * @code
2269 static int get_tpk_pkg_count()
2270 {
2271         int ret = 0;
2272         int count = 0;
2273         pkgmgrinfo_pkginfo_filter_h handle;
2274         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2275         if (ret != PMINFO_R_OK)
2276                 return -1;
2277         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2278         if (ret != PMINFO_R_OK) {
2279                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2280                 return -1;
2281         }
2282         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2283         if (ret != PMINFO_R_OK) {
2284                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2285                 return -1;
2286         }
2287         printf("No of tpk pkgs: %d\n", count);
2288         pkgmgrinfo_pkginfo_filter_destroy(handle);
2289         return 0;
2290 }
2291  * @endcode
2292  */
2293 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2294
2295 /**
2296  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2297  * @brief       This API destroys the package information filter handle freeing up all the resources
2298  *
2299  * @par         This API is for package-manager client application
2300  * @par Sync (or) Async : Synchronous API
2301  *
2302  * @param[in] handle            pointer to the package info filter handle.
2303  * @return      0 if success, error code(<0) if fail
2304  * @retval      PMINFO_R_OK     success
2305  * @retval      PMINFO_R_EINVAL invalid argument
2306  * @retval      PMINFO_R_ERROR  internal error
2307  * @pre         pkgmgrinfo_pkginfo_filter_create()
2308  * @post                None
2309  * @see         pkgmgrinfo_pkginfo_filter_count()
2310  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2311  * @code
2312 static int get_tpk_pkg_count()
2313 {
2314         int ret = 0;
2315         int count = 0;
2316         pkgmgrinfo_pkginfo_filter_h handle;
2317         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2318         if (ret != PMINFO_R_OK)
2319                 return -1;
2320         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2321         if (ret != PMINFO_R_OK) {
2322                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2323                 return -1;
2324         }
2325         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2326         if (ret != PMINFO_R_OK) {
2327                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2328                 return -1;
2329         }
2330         printf("No of tpk pkgs: %d\n", count);
2331         pkgmgrinfo_pkginfo_filter_destroy(handle);
2332         return 0;
2333 }
2334  * @endcode
2335  */
2336 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2337
2338 /**
2339  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2340  * @brief       This API adds a boolean filter property to the filter handle
2341  *
2342  * @par         This API is for package-manager client application
2343  * @par Sync (or) Async : Synchronous API
2344  *
2345  * @param[in] handle            pointer to the package info filter handle.
2346  * @param[in] property          boolean property name.
2347  * @param[in] value             value corresponding to the property.
2348  * @return      0 if success, error code(<0) if fail
2349  * @retval      PMINFO_R_OK     success
2350  * @retval      PMINFO_R_EINVAL invalid argument
2351  * @retval      PMINFO_R_ERROR  internal error
2352  * @pre         pkgmgrinfo_pkginfo_filter_create()
2353  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2354  * @see         pkgmgrinfo_pkginfo_filter_count()
2355  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2356  * @code
2357 static int get_preload_pkg_count()
2358 {
2359         int ret = 0;
2360         int count = 0;
2361         pkgmgrinfo_pkginfo_filter_h handle;
2362         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2363         if (ret != PMINFO_R_OK)
2364                 return -1;
2365         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2366         if (ret != PMINFO_R_OK) {
2367                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2368                 return -1;
2369         }
2370         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2371         if (ret != PMINFO_R_OK) {
2372                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2373                 return -1;
2374         }
2375         printf("No of preload pkgs: %d\n", count);
2376         pkgmgrinfo_pkginfo_filter_destroy(handle);
2377         return 0;
2378 }
2379  * @endcode
2380  */
2381 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2382                 const char *property, const bool value);
2383
2384 /**
2385  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2386  * @brief       This API adds an integer filter property to the filter handle
2387  *
2388  * @par         This API is for package-manager client application
2389  * @par Sync (or) Async : Synchronous API
2390  *
2391  * @param[in] handle            pointer to the package info filter handle.
2392  * @param[in] property          integer property name.
2393  * @param[in] value             value corresponding to the property.
2394  * @return      0 if success, error code(<0) if fail
2395  * @retval      PMINFO_R_OK     success
2396  * @retval      PMINFO_R_EINVAL invalid argument
2397  * @retval      PMINFO_R_ERROR  internal error
2398  * @pre         pkgmgrinfo_pkginfo_filter_create()
2399  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2400  * @see         pkgmgrinfo_pkginfo_filter_count()
2401  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2402  * @code
2403 static int get_pkg_count()
2404 {
2405         int ret = 0;
2406         int count = 0;
2407         pkgmgrinfo_pkginfo_filter_h handle;
2408         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2409         if (ret != PMINFO_R_OK)
2410                 return -1;
2411         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2412         if (ret != PMINFO_R_OK) {
2413                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2414                 return -1;
2415         }
2416         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2417         if (ret != PMINFO_R_OK) {
2418                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2419                 return -1;
2420         }
2421         printf("No of preload pkgs: %d\n", count);
2422         pkgmgrinfo_pkginfo_filter_destroy(handle);
2423         return 0;
2424 }
2425  * @endcode
2426  */
2427 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2428                 const char *property, const int value);
2429
2430 /**
2431  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2432  * @brief       This API adds a string filter property to the filter handle
2433  *
2434  * @par         This API is for package-manager client application
2435  * @par Sync (or) Async : Synchronous API
2436  *
2437  * @param[in] handle            pointer to the package info filter handle.
2438  * @param[in] property          string property name.
2439  * @param[in] value             value corresponding to the property.
2440  * @return      0 if success, error code(<0) if fail
2441  * @retval      PMINFO_R_OK     success
2442  * @retval      PMINFO_R_EINVAL invalid argument
2443  * @retval      PMINFO_R_ERROR  internal error
2444  * @pre         pkgmgrinfo_pkginfo_filter_create()
2445  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2446  * @see         pkgmgrinfo_pkginfo_filter_count()
2447  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2448  * @code
2449 static int get_tpk_pkg_count()
2450 {
2451         int ret = 0;
2452         int count = 0;
2453         pkgmgrinfo_pkginfo_filter_h handle;
2454         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2455         if (ret != PMINFO_R_OK)
2456                 return -1;
2457         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2458         if (ret != PMINFO_R_OK) {
2459                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2460                 return -1;
2461         }
2462         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2463         if (ret != PMINFO_R_OK) {
2464                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2465                 return -1;
2466         }
2467         printf("No of tpk pkgs: %d\n", count);
2468         pkgmgrinfo_pkginfo_filter_destroy(handle);
2469         return 0;
2470 }
2471  * @endcode
2472  */
2473 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2474                 const char *property, const char *value);
2475
2476 /**
2477  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2478  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
2479  *
2480  * @par         This API is for package-manager client application
2481  * @par Sync (or) Async : Synchronous API
2482  *
2483  * @param[in] handle            pointer to the package info filter handle.
2484  * @param[in] pkg_cb            callback function.
2485  * @param[in] user_data         user data to be passed to the callback function
2486  * @return      0 if success, error code(<0) if fail
2487  * @retval      PMINFO_R_OK     success
2488  * @retval      PMINFO_R_EINVAL invalid argument
2489  * @retval      PMINFO_R_ERROR  internal error
2490  * @pre         pkgmgrinfo_pkginfo_filter_create()
2491  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2492  * @see         pkgmgrinfo_pkginfo_filter_count()
2493  * @code
2494 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2495 {
2496         char *pkgid = NULL;
2497         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2498         printf("pkg id : %s\n", pkgid);
2499         return 0;
2500 }
2501
2502 static int get_tpk_pkg_list()
2503 {
2504         int ret = 0;
2505         pkgmgrinfo_pkginfo_filter_h handle;
2506         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2507         if (ret != PMINFO_R_OK)
2508                 return -1;
2509         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2510         if (ret != PMINFO_R_OK) {
2511                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2512                 return -1;
2513         }
2514         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2515         if (ret != PMINFO_R_OK) {
2516                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2517                 return -1;
2518         }
2519         pkgmgrinfo_pkginfo_filter_destroy(handle);
2520         return 0;
2521 }
2522  * @endcode
2523  */
2524 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2525                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2526 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2527                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2528
2529 /**
2530  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2531  * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2532  * @brief       This API counts the package that satisfy the filter conditions
2533  *
2534  * @par         This API is for package-manager client application
2535  * @par Sync (or) Async : Synchronous API
2536  *
2537  * @param[in] handle            pointer to the package info filter handle.
2538  * @param[in] count             pointer to store the count value.
2539  * @param[in]   uid     the addressee user id of the instruction
2540  * @return      0 if success, error code(<0) if fail
2541  * @retval      PMINFO_R_OK     success
2542  * @retval      PMINFO_R_EINVAL invalid argument
2543  * @retval      PMINFO_R_ERROR  internal error
2544  * @pre         pkgmgrinfo_pkginfo_filter_create()
2545  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2546  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2547  * @code
2548 static int get_tpk_pkg_count()
2549 {
2550         int ret = 0;
2551         int count = 0;
2552         pkgmgrinfo_pkginfo_filter_h handle;
2553         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2554         if (ret != PMINFO_R_OK)
2555                 return -1;
2556         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2557         if (ret != PMINFO_R_OK) {
2558                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2559                 return -1;
2560         }
2561         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2562         if (ret != PMINFO_R_OK) {
2563                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2564                 return -1;
2565         }
2566         printf("No of tpk pkgs: %d\n", count);
2567         pkgmgrinfo_pkginfo_filter_destroy(handle);
2568         return 0;
2569 }
2570  * @endcode
2571  */
2572 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2573 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2574
2575 /**
2576  * @fn  int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2577                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2578  * @brief       This API gets the list of privilege for a particular package
2579  *
2580  * @par         This API is for package-manager client application
2581  * @par Sync (or) Async : Synchronous API
2582  * @param[in]   handle          pointer to the package info handle.
2583  * @param[in]   privilege_func          callback function for list
2584  * @param[in] user_data user data to be passed to callback function
2585  * @return      0 if success, error code(<0) if fail
2586  * @retval      PMINFO_R_OK     success
2587  * @retval      PMINFO_R_EINVAL invalid argument
2588  * @retval      PMINFO_R_ERROR  internal error
2589  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2590  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2591  * @code
2592 int privilege_func(const char *name, void *user_data)
2593 {
2594         if (strcmp(name, (char *)user_data) == 0)
2595                 return -1;
2596         else
2597                 return 0;
2598 }
2599
2600 static int list_privilege(const char *package, char *privilege)
2601 {
2602         int ret = 0;
2603         pkgmgrinfo_pkginfo_h handle;
2604         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2605         if (ret != PMINFO_R_OK)
2606                 return -1;
2607         ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2608         if (ret != PMINFO_R_OK) {
2609                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2610                 return -1;
2611         }
2612         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2613         return 0;
2614 }
2615  * @endcode
2616  */
2617 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2618                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2619
2620 /**
2621  * @fn  int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2622                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2623  * @brief       This API gets the list of appdefined privilege for a particular package
2624  *
2625  * @par         This API is for package-manager client application
2626  * @par Sync (or) Async : Synchronous API
2627  * @param[in]   handle          pointer to the package info handle.
2628  * @param[in]   privilege_func          callback function for list
2629  * @param[in] user_data user data to be passed to callback function
2630  * @return      0 if success, error code(<0) if fail
2631  * @retval      PMINFO_R_OK     success
2632  * @retval      PMINFO_R_EINVAL invalid argument
2633  * @retval      PMINFO_R_ERROR  internal error
2634  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2635  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2636  * @code
2637 int privilege_func(const char *name, const char *license_path, void *user_data)
2638 {
2639         printf("appdefined privilege : %s", name);
2640         if (license_path)
2641                 printf("licensed privilege, lecense path : %s", license_path);
2642         return 0;
2643 }
2644
2645 static int list_appdefined_privilege(const char *package)
2646 {
2647         int ret = 0;
2648         pkgmgrinfo_pkginfo_h handle;
2649         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2650         if (ret != PMINFO_R_OK)
2651                 return -1;
2652         ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2653         if (ret != PMINFO_R_OK) {
2654                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2655                 return -1;
2656         }
2657         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2658         return 0;
2659 }
2660  * @endcode
2661  */
2662 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2663                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2664
2665 /**
2666  * @fn  int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2667                         pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2668  * @brief       This API gets the list of plugin execution info for a particular package
2669  *
2670  * @par         This API is for package-manager client application
2671  * @par Sync (or) Async : Synchronous API
2672  * @param[in]   handle          pointer to the package info handle.
2673  * @param[in]   plugin_func             callback function for list
2674  * @param[in] user_data user data to be passed to callback function
2675  * @return      0 if success, error code(<0) if fail
2676  * @retval      PMINFO_R_OK     success
2677  * @retval      PMINFO_R_EINVAL invalid argument
2678  * @retval      PMINFO_R_ERROR  internal error
2679  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2680  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2681  * @code
2682 int plugin_func(const char *pkgid, const char *appid,
2683                                 const char *plugin_type, const char *plugin_name,
2684                                 void *user_data)
2685 {
2686         printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2687
2688         return 0;
2689 }
2690
2691 static int list_plugin(const char *package)
2692 {
2693         int ret = 0;
2694         pkgmgrinfo_pkginfo_h handle;
2695         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2696         if (ret != PMINFO_R_OK)
2697                 return -1;
2698         ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2699         if (ret != PMINFO_R_OK) {
2700                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2701                 return -1;
2702         }
2703         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2704         return 0;
2705 }
2706  * @endcode
2707  */
2708 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2709                         pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2710
2711 /* TODO: add doxygen comment here */
2712 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2713
2714 /**
2715  * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2716  * @brief       This API copy the application information handle
2717  *
2718  * @par         This API is for package-manager client application
2719  * @par Sync (or) Async : Synchronous API
2720  *
2721  * @param[in]   handle  pointer to the package info handle.
2722  * @param[out]  handle  pointer to the package info handle.
2723  * @return      0 if success, error code(<0) if fail
2724  * @retval      PMINFO_R_OK     success
2725  * @retval      PMINFO_R_EINVAL invalid argument
2726  * @retval      PMINFO_R_ERROR  internal error
2727  * @pre         None
2728  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
2729  * @code
2730 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2731 {
2732         int ret = 0;
2733
2734         pkgmgrinfo_pkginfo_h clone;
2735
2736         ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2737         if (ret != PMINFO_R_OK)
2738                 return -1;
2739
2740
2741         printf("package: %s\n", clone->package);
2742         pkgmgrinfo_appinfo_destroy_appinfo(clone);
2743         return 0;
2744 }
2745  * @endcode
2746  */
2747 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2748
2749
2750 /**
2751  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2752  pkgmgrinfo_app_list_cb app_func, void *user_data)
2753  * @brief       This API gets list of installed applications for a particular package
2754  *
2755  * @par         This API is for package-manager client application
2756  * @par Sync (or) Async : Synchronous API
2757  * @param[in]   handle          package info handle
2758  * @param[in]   component       application component
2759  * @param[in]   app_func                iteration function for list
2760  * @param[in] user_data user data to be passed to callback function
2761  * @return      0 if success, error code(<0) if fail
2762  * @retval      PMINFO_R_OK     success
2763  * @retval      PMINFO_R_EINVAL invalid argument
2764  * @retval      PMINFO_R_ERROR  internal error
2765  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2766  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2767  * @code
2768 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2769 {
2770         char *appid = NULL;
2771         pkgmgrinfo_appinfo_get_appid(handle, &appid);
2772         printf("appid : %s\n", appid);
2773         return 0;
2774 }
2775
2776 static int list_apps(const char *pkgid)
2777 {
2778         int ret = 0;
2779         pkgmgrinfo_pkginfo_h handle;
2780         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2781         if (ret != PMINFO_R_OK)
2782                 return -1;
2783         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2784         if (ret != PMINFO_R_OK) {
2785                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2786                 return -1;
2787         }
2788         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2789         return 0;
2790 }
2791  * @endcode
2792  */
2793 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2794                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
2795 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2796                                                         pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2797
2798 /**
2799  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2800  * @brief       This API gets list of installed applications from all packages.
2801  *
2802  * @par         This API is for package-manager client application
2803  * @par Sync (or) Async : Synchronous API
2804  * @param[in]   app_func                iteration function for list
2805  * @param[in] user_data user data to be passed to callback function
2806  * @return      0 if success, error code(<0) if fail
2807  * @retval      PMINFO_R_OK     success
2808  * @retval      PMINFO_R_EINVAL invalid argument
2809  * @retval      PMINFO_R_ERROR  internal error
2810  * @pre         None
2811  * @post                None
2812  * @code
2813 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2814 {
2815         char *pkgid1 = NULL;
2816         char *pkgid2 = NULL;
2817         pkgid1 = (char *)user_data;
2818         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2819         if (strcmp(pkgid1, pkgid2) == 0) {
2820                 return -1;
2821         } else {
2822                 return 0;
2823         }
2824 }
2825
2826 static int list_apps()
2827 {
2828         int ret = 0;
2829         char *name = "helloworld";
2830         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2831         if (ret != PMINFO_R_OK) {
2832                 return -1;
2833         }
2834         return 0;
2835 }
2836  * @endcode
2837  */
2838 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2839 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2840
2841 /**
2842  * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2843  * @brief       This API creates the disabled application information handle from db
2844  *
2845  * @par         This API is for package-manager client application
2846  * @par Sync (or) Async : Synchronous API
2847  *
2848  * @param[in]   appid   pointer to appid
2849  * @param[out] handle           pointer to the application info handle.
2850  * @return      0 if success, error code(<0) if fail
2851  * @retval      PMINFO_R_OK     success
2852  * @retval      PMINFO_R_EINVAL invalid argument
2853  * @retval      PMINFO_R_ERROR  internal error
2854  * @pre         None
2855  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2856  * @see         pkgmgrinfo_appinfo_get_pkgid()
2857  * @see         pkgmgrinfo_appinfo_is_multiple()
2858  * @code
2859 static int get_disabled_app_type(const char *appid)
2860 {
2861         int ret = 0;
2862         char *type = NULL;
2863         pkgmgrinfo_appinfo_h handle;
2864         ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2865         if (ret != PMINFO_R_OK)
2866                 return -1;
2867         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2868         if (ret != PMINFO_R_OK) {
2869                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2870                 return -1;
2871         }
2872         printf("apptype: %s\n", type);
2873         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2874         return 0;
2875 }
2876  * @endcode
2877  */
2878 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2879 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2880
2881 /**
2882  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2883  * @brief       This API creates the application information handle from db
2884  *
2885  * @par         This API is for package-manager client application
2886  * @par Sync (or) Async : Synchronous API
2887  *
2888  * @param[in]   appid   pointer to appid
2889  * @param[out] handle           pointer to the application info handle.
2890  * @return      0 if success, error code(<0) if fail
2891  * @retval      PMINFO_R_OK     success
2892  * @retval      PMINFO_R_EINVAL invalid argument
2893  * @retval      PMINFO_R_ERROR  internal error
2894  * @pre         None
2895  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2896  * @see         pkgmgrinfo_appinfo_get_pkgid()
2897  * @see         pkgmgrinfo_appinfo_is_multiple()
2898  * @code
2899 static int get_app_type(const char *appid)
2900 {
2901         int ret = 0;
2902         char *type = NULL;
2903         pkgmgrinfo_appinfo_h handle;
2904         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2905         if (ret != PMINFO_R_OK)
2906                 return -1;
2907         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2908         if (ret != PMINFO_R_OK) {
2909                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910                 return -1;
2911         }
2912         printf("apptype: %s\n", type);
2913         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2914         return 0;
2915 }
2916  * @endcode
2917  */
2918 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2919 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2920
2921 /**
2922  * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2923  * @brief       This API creates the application information handle from db regardless of its disable or storage status
2924  *
2925  * @par         This API is for package-manager client application
2926  * @par Sync (or) Async : Synchronous API
2927  *
2928  * @param[in]   appid   pointer to appid
2929  * @param[out] handle           pointer to the application info handle.
2930  * @return      0 if success, error code(<0) if fail
2931  * @retval      PMINFO_R_OK     success
2932  * @retval      PMINFO_R_EINVAL invalid argument
2933  * @retval      PMINFO_R_ERROR  internal error
2934  * @pre         None
2935  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2936  * @see         pkgmgrinfo_appinfo_get_pkgid()
2937  * @see         pkgmgrinfo_appinfo_is_multiple()
2938  * @code
2939 static int get_app_type(const char *appid)
2940 {
2941         int ret = 0;
2942         char *type = NULL;
2943         pkgmgrinfo_appinfo_h handle;
2944         ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2945         if (ret != PMINFO_R_OK)
2946                 return -1;
2947         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2948         if (ret != PMINFO_R_OK) {
2949                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2950                 return -1;
2951         }
2952         printf("apptype: %s\n", type);
2953         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2954         return 0;
2955 }
2956  * @endcode
2957  */
2958 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2959 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2960
2961 /**
2962  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2963  * @brief       This API gets the application ID
2964  *
2965  * @par         This API is for package-manager client application
2966  * @par Sync (or) Async : Synchronous API
2967  *
2968  * @param[in] handle            pointer to the application info handle.
2969  * @param[out] appid            pointer to hold appid
2970  * @return      0 if success, error code(<0) if fail
2971  * @retval      PMINFO_R_OK     success
2972  * @retval      PMINFO_R_EINVAL invalid argument
2973  * @retval      PMINFO_R_ERROR  internal error
2974  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2975  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2976  * @see         pkgmgrinfo_appinfo_get_pkgid()
2977  * @see         pkgmgrinfo_appinfo_is_multiple()
2978  * @code
2979 static int get_app_id(const char *appid)
2980 {
2981         int ret = 0;
2982         char *app_id = NULL;
2983         pkgmgrinfo_appinfo_h handle;
2984         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2985         if (ret != PMINFO_R_OK)
2986                 return -1;
2987         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2988         if (ret != PMINFO_R_OK) {
2989                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2990                 return -1;
2991         }
2992         printf("app id: %s\n", app_id);
2993         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2994         return 0;
2995 }
2996  * @endcode
2997  */
2998 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
2999
3000 /**
3001  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
3002  * @brief       This API gets the package name of the application
3003  *
3004  * @par         This API is for package-manager client application
3005  * @par Sync (or) Async : Synchronous API
3006  *
3007  * @param[in] handle            pointer to the application info handle.
3008  * @param[out] pkg_name         pointer to hold package name
3009  * @return      0 if success, error code(<0) if fail
3010  * @retval      PMINFO_R_OK     success
3011  * @retval      PMINFO_R_EINVAL invalid argument
3012  * @retval      PMINFO_R_ERROR  internal error
3013  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3014  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3015  * @see         pkgmgrinfo_appinfo_get_appid()
3016  * @see         pkgmgrinfo_appinfo_is_multiple()
3017  * @code
3018 static int get_app_pkgname(const char *appid)
3019 {
3020         int ret = 0;
3021         char *pkgname = NULL;
3022         pkgmgrinfo_appinfo_h handle;
3023         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3024         if (ret != PMINFO_R_OK)
3025                 return -1;
3026         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
3027         if (ret != PMINFO_R_OK) {
3028                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3029                 return -1;
3030         }
3031         printf("pkg name: %s\n", pkgname);
3032         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3033         return 0;
3034 }
3035  * @endcode
3036  */
3037 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
3038
3039 /**
3040  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3041  * @brief       This API gets the package id of the application
3042  *
3043  * @par         This API is for package-manager client application
3044  * @par Sync (or) Async : Synchronous API
3045  *
3046  * @param[in] handle            pointer to the application info handle.
3047  * @param[out] pkgid            pointer to hold package id
3048  * @return      0 if success, error code(<0) if fail
3049  * @retval      PMINFO_R_OK     success
3050  * @retval      PMINFO_R_EINVAL invalid argument
3051  * @retval      PMINFO_R_ERROR  internal error
3052  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3053  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3054  * @see         pkgmgrinfo_appinfo_get_appid()
3055  * @see         pkgmgrinfo_appinfo_is_multiple()
3056  * @code
3057 static int get_app_pkgid(const char *appid)
3058 {
3059         int ret = 0;
3060         char *pkgid = NULL;
3061         pkgmgrinfo_appinfo_h handle;
3062         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3063         if (ret != PMINFO_R_OK)
3064                 return -1;
3065         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3066         if (ret != PMINFO_R_OK) {
3067                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3068                 return -1;
3069         }
3070         printf("pkg id: %s\n", pkgid);
3071         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072         return 0;
3073 }
3074  * @endcode
3075  */
3076 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
3077
3078 /**
3079  * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3080  * @brief       This API gets the package type of the application
3081  *
3082  * @par         This API is for package-manager client application
3083  * @par Sync (or) Async : Synchronous API
3084  *
3085  * @param[in] handle            pointer to the application info handle.
3086  * @param[out] pkgtype          pointer to hold package type
3087  * @return      0 if success, error code(<0) if fail
3088  * @retval      PMINFO_R_OK     success
3089  * @retval      PMINFO_R_EINVAL invalid argument
3090  * @retval      PMINFO_R_ERROR  internal error
3091  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3092  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3093  * @see         pkgmgrinfo_appinfo_get_appid()
3094  * @see         pkgmgrinfo_appinfo_is_multiple()
3095  * @code
3096 static int get_app_pkgtype(const char *appid)
3097 {
3098         int ret = 0;
3099         char *pkgtype = NULL;
3100         pkgmgrinfo_appinfo_h handle = NULL;
3101         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3102         if (ret != PMINFO_R_OK)
3103                 return -1;
3104         ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3105         if (ret != PMINFO_R_OK) {
3106                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3107                 return -1;
3108         }
3109         printf("pkgtype: %s\n", pkgtype);
3110         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3111         return 0;
3112 }
3113  * @endcode
3114  */
3115 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h  handle, char **pkgtype);
3116
3117 /**
3118  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3119  * @brief       This API gets the executable name of the application
3120  *
3121  * @par         This API is for package-manager client application
3122  * @par Sync (or) Async : Synchronous API
3123  *
3124  * @param[in] handle            pointer to the application info handle.
3125  * @param[out] exec             pointer to hold app exec name
3126  * @return      0 if success, error code(<0) if fail
3127  * @retval      PMINFO_R_OK     success
3128  * @retval      PMINFO_R_EINVAL invalid argument
3129  * @retval      PMINFO_R_ERROR  internal error
3130  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3131  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3132  * @see         pkgmgrinfo_appinfo_get_appid()
3133  * @see         pkgmgrinfo_appinfo_is_multiple()
3134  * @code
3135 static int get_app_exec(const char *appid)
3136 {
3137         int ret = 0;
3138         char *exec = NULL;
3139         pkgmgrinfo_appinfo_h handle;
3140         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3141         if (ret != PMINFO_R_OK)
3142                 return -1;
3143         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3144         if (ret != PMINFO_R_OK) {
3145                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3146                 return -1;
3147         }
3148         printf("exec name: %s\n", exec);
3149         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3150         return 0;
3151 }
3152  * @endcode
3153  */
3154 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
3155
3156 /**
3157  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3158  * @brief       This API gets the icon name of the application
3159  *
3160  * @par         This API is for package-manager client application
3161  * @par Sync (or) Async : Synchronous API
3162  *
3163  * @param[in] handle            pointer to the application info handle.
3164  * @param[out] icon             pointer to hold app icon name
3165  * @return      0 if success, error code(<0) if fail
3166  * @retval      PMINFO_R_OK     success
3167  * @retval      PMINFO_R_EINVAL invalid argument
3168  * @retval      PMINFO_R_ERROR  internal error
3169  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3170  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3171  * @see         pkgmgrinfo_appinfo_get_appid()
3172  * @see         pkgmgrinfo_appinfo_is_multiple()
3173  * @code
3174 static int get_app_icon(const char *appid)
3175 {
3176         int ret = 0;
3177         char *icon = NULL;
3178         pkgmgrinfo_appinfo_h handle;
3179         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3180         if (ret != PMINFO_R_OK)
3181                 return -1;
3182         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3183         if (ret != PMINFO_R_OK) {
3184                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3185                 return -1;
3186         }
3187         printf("icon name: %s\n", icon);
3188         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3189         return 0;
3190 }
3191  * @endcode
3192  */
3193 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3194
3195 /**
3196  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3197  * @brief       This API gets the label of the application
3198  *
3199  * @par         This API is for package-manager client application
3200  * @par Sync (or) Async : Synchronous API
3201  *
3202  * @param[in] handle            pointer to the application info handle.
3203  * @param[out] label            pointer to hold app label
3204  * @return      0 if success, error code(<0) if fail
3205  * @retval      PMINFO_R_OK     success
3206  * @retval      PMINFO_R_EINVAL invalid argument
3207  * @retval      PMINFO_R_ERROR  internal error
3208  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3209  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3210  * @see         pkgmgrinfo_appinfo_get_appid()
3211  * @see         pkgmgrinfo_appinfo_is_multiple()
3212  * @code
3213 static int get_app_label(const char *appid)
3214 {
3215         int ret = 0;
3216         char *label = NULL;
3217         pkgmgrinfo_appinfo_h handle;
3218         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3219         if (ret != PMINFO_R_OK)
3220                 return -1;
3221         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3222         if (ret != PMINFO_R_OK) {
3223                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3224                 return -1;
3225         }
3226         printf("label : %s\n", label);
3227         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228         return 0;
3229 }
3230  * @endcode
3231  */
3232 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
3233
3234 /**
3235  * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3236  * @brief       This API gets exactly matched label by given appid and locale
3237  *
3238  * @par         This API is for package-manager client application
3239  * @par Sync (or) Async : Synchronous API
3240  *
3241  * @param[in]   appid   pointer to appid
3242  * @param[in]   locale  pointer to locale
3243  * @param[out] label            pointer to hold app label
3244  * @return      0 if success, error code(<0) if fail
3245  * @retval      PMINFO_R_OK     success
3246  * @retval      PMINFO_R_EINVAL invalid argument
3247  * @retval      PMINFO_R_ERROR  internal error
3248  * @code
3249 static int get_localed_label(const char *appid, const char *locale)
3250 {
3251         int ret = 0;
3252         char *label = NULL;
3253
3254         ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3255         if (ret != PMINFO_R_OK)
3256                 return -1;
3257
3258         printf("localed label: %s\n", label);
3259
3260         free(label);
3261
3262         return 0;
3263 }
3264  * @endcode
3265  */
3266 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3267 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3268
3269 /**
3270  * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3271  * @brief       This API gets metadata value by given metadata key
3272  *
3273  * @par         This API is for package-manager client application
3274  * @par Sync (or) Async : Synchronous API
3275  *
3276  * @param[in]   handle  pointer to the application info handle
3277  * @param[in]   metadata_key    metadata key
3278  * @param[out] metadata_value           pointer to hold metadata value
3279  * @return      0 if success, error code(<0) if fail
3280  * @retval      PMINFO_R_OK     success
3281  * @retval      PMINFO_R_EINVAL invalid argument
3282  * @code
3283 static int get_metadata_value(const char *appid, const char *metadata_key)
3284 {
3285         int ret = 0;
3286         pkgmgrinfo_appinfo_h handle = NULL;
3287         char *metadata_value = NULL;
3288
3289         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3290         if (ret != PMINFO_R_OK)
3291                 return -1;
3292
3293         ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3294         if (ret != PMINFO_R_OK) {
3295                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3296                 return -1;
3297         }
3298
3299         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3300         return 0;
3301 }
3302  * @endcode
3303  */
3304 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3305
3306 /**
3307  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3308  * @brief       This API gets the component of the application
3309  *
3310  * @par         This API is for package-manager client application
3311  * @par Sync (or) Async : Synchronous API
3312  *
3313  * @param[in] handle            pointer to the application info handle.
3314  * @param[out] component                pointer to hold app component
3315  * @return      0 if success, error code(<0) if fail
3316  * @retval      PMINFO_R_OK     success
3317  * @retval      PMINFO_R_EINVAL invalid argument
3318  * @retval      PMINFO_R_ERROR  internal error
3319  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3320  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3321  * @see         pkgmgrinfo_appinfo_get_appid()
3322  * @see         pkgmgrinfo_appinfo_is_multiple()
3323  * @code
3324 static int get_app_component(const char *appid)
3325 {
3326         int ret = 0;
3327         pkgmgrinfo_app_component component;
3328         pkgmgrinfo_appinfo_h handle;
3329         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3330         if (ret != PMINFO_R_OK)
3331                 return -1;
3332         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3333         if (ret != PMINFO_R_OK) {
3334                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3335                 return -1;
3336         }
3337         printf("component : %s\n", component);
3338         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3339         return 0;
3340 }
3341  * @endcode
3342  */
3343 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
3344
3345 /**
3346  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3347  * @brief       This API gets the apptype of the application
3348  *
3349  * @par         This API is for package-manager client application
3350  * @par Sync (or) Async : Synchronous API
3351  *
3352  * @param[in] handle            pointer to the application info handle.
3353  * @param[out] app_type         pointer to hold apptype
3354  * @return      0 if success, error code(<0) if fail
3355  * @retval      PMINFO_R_OK     success
3356  * @retval      PMINFO_R_EINVAL invalid argument
3357  * @retval      PMINFO_R_ERROR  internal error
3358  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3359  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3360  * @see         pkgmgrinfo_appinfo_get_appid()
3361  * @see         pkgmgrinfo_appinfo_is_multiple()
3362  * @code
3363 static int get_app_type(const char *appid)
3364 {
3365         int ret = 0;
3366         char *apptype = NULL;
3367         pkgmgrinfo_appinfo_h handle;
3368         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3369         if (ret != PMINFO_R_OK)
3370                 return -1;
3371         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3372         if (ret != PMINFO_R_OK) {
3373                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3374                 return -1;
3375         }
3376         printf("apptype : %s\n", apptype);
3377         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3378         return 0;
3379 }
3380  * @endcode
3381  */
3382 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
3383
3384 /**
3385  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3386  * @brief       This API gets the notification icon of the application
3387  *
3388  * @par         This API is for package-manager client application
3389  * @par Sync (or) Async : Synchronous API
3390  *
3391  * @param[in] handle            pointer to the application info handle.
3392  * @param[out] path             pointer to hold notification icon
3393  * @return      0 if success, error code(<0) if fail
3394  * @retval      PMINFO_R_OK     success
3395  * @retval      PMINFO_R_EINVAL invalid argument
3396  * @retval      PMINFO_R_ERROR  internal error
3397  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3398  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3399  * @see         pkgmgrinfo_appinfo_get_appid()
3400  * @see         pkgmgrinfo_appinfo_is_multiple()
3401  * @code
3402 static int get_app_notification_icon(const char *appid)
3403 {
3404         int ret = 0;
3405         char *notification_icon = NULL;
3406         pkgmgrinfo_appinfo_h handle;
3407         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3408         if (ret != PMINFO_R_OK)
3409                 return -1;
3410         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
3411         if (ret != PMINFO_R_OK) {
3412                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413                 return -1;
3414         }
3415         printf("notification icon : %s\n", notification_icon);
3416         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3417         return 0;
3418 }
3419  * @endcode
3420  */
3421 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3422
3423 /**
3424  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3425  * @brief       This API gets the type of recent image on app-tray
3426  *
3427  * @par         This API is for package-manager client application
3428  * @par Sync (or) Async : Synchronous API
3429  *
3430  * @param[in] handle            pointer to the application info handle.
3431  * @param[out] type             pointer to hold image type
3432  * @return      0 if success, error code(<0) if fail
3433  * @retval      PMINFO_R_OK     success
3434  * @retval      PMINFO_R_EINVAL invalid argument
3435  * @retval      PMINFO_R_ERROR  internal error
3436  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3437  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3438  * @see         pkgmgrinfo_appinfo_get_appid()
3439  * @see         pkgmgrinfo_appinfo_is_multiple()
3440  * @code
3441 static int get_app_recent_image_type(const char *appid)
3442 {
3443         int ret = 0;
3444         pkgmgrinfo_app_recentimage type;
3445         pkgmgrinfo_appinfo_h handle;
3446         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447         if (ret != PMINFO_R_OK)
3448                 return -1;
3449         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3450         if (ret != PMINFO_R_OK) {
3451                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452                 return -1;
3453         }
3454         printf("recent image type: %d\n", type);
3455         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456         return 0;
3457 }
3458  * @endcode
3459  */
3460 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
3461
3462
3463 /**
3464  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
3465  * @brief       This API gets the preview image of application
3466  *
3467  * @par Sync (or) Async : Synchronous API
3468  *
3469  * @param[in] handle            pointer to the application info handle.
3470  * @param[out] preview_img              pointer to hold preview image path
3471  * @return      0 if success, error code(<0) if fail
3472  * @retval      PMINFO_R_OK     success
3473  * @retval      PMINFO_R_EINVAL invalid argument
3474  * @retval      PMINFO_R_ERROR  internal error
3475  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3476  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3477  * @see         pkgmgrinfo_appinfo_get_appid()
3478  * @code
3479 static int get_app_previewimage(const char *appid)
3480 {
3481         int ret = 0;
3482         char *preview = NULL;
3483         pkgmgrinfo_appinfo_h handle = NULL;
3484         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3485         if (ret != PMINFO_R_OK)
3486                 return -1;
3487         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3488         if (ret != PMINFO_R_OK) {
3489                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3490                 return -1;
3491         }
3492         printf("preview image path : %s\n", preview);
3493         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3494         return 0;
3495 }
3496  * @endcode
3497  */
3498 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3499
3500
3501 /**
3502  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3503  * @brief       This API gets the package permission type of the application
3504  *
3505  * @par         This API is for package-manager client application
3506  * @par Sync (or) Async : Synchronous API
3507  *
3508  * @param[in] handle            pointer to the application info handle.
3509  * @param[out] permission               pointer to hold package permission
3510  * @return      0 if success, error code(<0) if fail
3511  * @retval      PMINFO_R_OK     success
3512  * @retval      PMINFO_R_EINVAL invalid argument
3513  * @retval      PMINFO_R_ERROR  internal error
3514  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3515  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3516  * @see         pkgmgrinfo_appinfo_get_appid()
3517  * @code
3518 static int get_app_permission(const char *appid)
3519 {
3520         int ret = 0;
3521         pkgmgrinfo_permission_type permission = 0;
3522         pkgmgrinfo_appinfo_h handle;
3523
3524         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3525         if (ret != PMINFO_R_OK)
3526                 return -1;
3527         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3528         if (ret != PMINFO_R_OK) {
3529                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530                 return -1;
3531         }
3532         printf("permission type: %d\n", permission);
3533         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534         return 0;
3535 }
3536  * @endcode
3537  */
3538 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3539
3540 /**
3541  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3542  * @brief       This API gets the component_type
3543  *
3544  * @par         This API is for package-manager client application
3545  * @par Sync (or) Async : Synchronous API
3546  *
3547  * @param[in] handle            pointer to the application info handle.
3548  * @param[out] component_type           pointer to hold component_type
3549  * @return      0 if success, error code(<0) if fail
3550  * @retval      PMINFO_R_OK     success
3551  * @retval      PMINFO_R_EINVAL invalid argument
3552  * @retval      PMINFO_R_ERROR  internal error
3553  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3554  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3555  * @see         pkgmgrinfo_appinfo_get_pkgid()
3556  * @see         pkgmgrinfo_appinfo_is_multiple()
3557  * @code
3558 static int get_component_type(const char *appid)
3559 {
3560         int ret = 0;
3561         char *component_type = NULL;
3562         pkgmgrinfo_appinfo_h handle;
3563         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3564         if (ret != PMINFO_R_OK)
3565                 return -1;
3566         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3567         if (ret != PMINFO_R_OK) {
3568                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3569                 return -1;
3570         }
3571         printf("component_type: %s\n", component_type);
3572         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3573         return 0;
3574 }
3575  * @endcode
3576  */
3577 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3578
3579 /**
3580  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3581  * @brief       This API gets the application 'hwacceleration' value from the app ID
3582  *
3583  * @par         This API is for package-manager client application
3584  * @par Sync (or) Async : Synchronous API
3585  *
3586  * @param[in]   handle  pointer to application info handle
3587  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3588  * @return      0 if success, error code(<0) if fail
3589  * @retval      PMINFO_R_OK     success
3590  * @retval      PMINFO_R_EINVAL invalid argument
3591  * @retval      PMINFO_R_ERROR  internal error
3592  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3593  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3594  * @see         pkgmgrinfo_appinfo_get_appid()
3595  * @see         pkgmgrinfo_appinfo_is_multiple()
3596  * @code
3597 static int get_app_hwacceleration(const char *appid)
3598 {
3599         int ret = 0;
3600         pkgmgrinfo_app_hwacceleration hwacceleration;
3601         pkgmgrinfo_appinfo_h handle;
3602         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3603         if (ret != PMINFO_R_OK)
3604                 return -1;
3605         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3606         if (ret != PMINFO_R_OK) {
3607                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608                 return -1;
3609         }
3610         printf("app hwacceleration: %d\n", hwacceleration);
3611         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612         return 0;
3613 }
3614  * @endcode
3615  */
3616 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3617
3618 /**
3619  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3620  * @brief       This API gets the application 'screenreader' value from the app ID
3621  *
3622  * @par         This API is for package-manager client application
3623  * @par Sync (or) Async : Synchronous API
3624  *
3625  * @param[in]   handle  pointer to application info handle
3626  * @param[out] screenreader             pointer to hold package accessibility value
3627  * @return      0 if success, error code(<0) if fail
3628  * @retval      PMINFO_R_OK     success
3629  * @retval      PMINFO_R_EINVAL invalid argument
3630  * @retval      PMINFO_R_ERROR  internal error
3631  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3632  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3633  * @see         pkgmgrinfo_appinfo_get_appid()
3634  * @see         pkgmgrinfo_appinfo_is_multiple()
3635  * @code
3636 static int get_app_screenreader(const char *appid)
3637 {
3638         int ret = 0;
3639         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3640         pkgmgrinfo_appinfo_h handle = NULL;
3641         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3642         if (ret != PMINFO_R_OK)
3643                 return -1;
3644         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3645         if (ret != PMINFO_R_OK) {
3646                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3647                 return -1;
3648         }
3649         printf("app screenreader: %d\n", screenreader);
3650         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3651         return 0;
3652 }
3653  * @endcode
3654  */
3655 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3656
3657 /**
3658  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3659  * @brief       This API gets the application's landscape & portrait effect images
3660  *
3661  * @par         This API is for package-manager client application
3662  * @par Sync (or) Async : Synchronous API
3663  *
3664  * @param[in]   handle  pointer to application info handle
3665  * @param[out]  portrait_img contains portrait mode effect image
3666  * @param[out]  landscape_img contains landscape mode effect image
3667  * @return      0 if success, error code(<0) if fail
3668  * @retval      PMINFO_R_OK     success
3669  * @retval      PMINFO_R_EINVAL invalid argument
3670  * @retval      PMINFO_R_ERROR  internal error
3671  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3672  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3673  * @see         pkgmgrinfo_appinfo_get_appid()
3674  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3675  * @code
3676 static int get_app_effectimages(const char *appid)
3677 {
3678         int ret = 0;
3679         char *portraitimg = NULL;
3680         char *landscapeimg = NULL;
3681         pkgmgrinfo_appinfo_h handle;
3682         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3683         if (ret != PMINFO_R_OK)
3684                 return -1;
3685         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3686         if (ret != PMINFO_R_OK) {
3687                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3688                 return -1;
3689         }
3690         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3691         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3692         return 0;
3693 }
3694  * @endcode
3695  */
3696 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3697
3698 /**
3699  * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h  handle, char **effectimg_type)
3700  * @brief       This API gets the application's effect image type
3701  *
3702  * @par         This API is for package-manager client application
3703  * @par Sync (or) Async : Synchronous API
3704  *
3705  * @param[in]   handle  pointer to application info handle
3706  * @param[out]  effectimg_type contains effect image type
3707  * @return      0 if success, error code(<0) if fail
3708  * @retval      PMINFO_R_OK     success
3709  * @retval      PMINFO_R_EINVAL invalid argument
3710  * @retval      PMINFO_R_ERROR  internal error
3711  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3712  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3713  * @see         pkgmgrinfo_appinfo_get_appid()
3714  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3715  * @code
3716 static int get_app_effectimage_type(const char *appid)
3717 {
3718         int ret = 0;
3719         char *effectimg_type = NULL;
3720         pkgmgrinfo_appinfo_h handle = NULL;
3721         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3722         if (ret != PMINFO_R_OK)
3723                 return -1;
3724         ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3725         if (ret != PMINFO_R_OK) {
3726                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3727                 return -1;
3728         }
3729         printf("app effect image type: %s\n", effectimg_type);
3730         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3731         return 0;
3732 }
3733  * @endcode
3734  */
3735 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3736
3737 /**
3738  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3739  * @brief       This API gets the submode_mainid of the application
3740  *
3741  * @par         This API is for package-manager client application
3742  * @par Sync (or) Async : Synchronous API
3743  *
3744  * @param[in] handle            pointer to the application info handle.
3745  * @param[out] submode_mainid           pointer to hold package name
3746  * @return      0 if success, error code(<0) if fail
3747  * @retval      PMINFO_R_OK     success
3748  * @retval      PMINFO_R_EINVAL invalid argument
3749  * @retval      PMINFO_R_ERROR  internal error
3750  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3751  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3752  * @see         pkgmgrinfo_appinfo_get_appid()
3753  * @see         pkgmgrinfo_appinfo_is_multiple()
3754  * @code
3755 static int get_app_submode_mainid(const char *appid)
3756 {
3757         int ret = 0;
3758         char *submode_mainid = NULL;
3759         pkgmgrinfo_appinfo_h handle = NULL;
3760         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3761         if (ret != PMINFO_R_OK)
3762                 return -1;
3763         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3764         if (ret != PMINFO_R_OK) {
3765                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3766                 return -1;
3767         }
3768         printf("submode_mainid: %s\n", submode_mainid);
3769         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3770         return 0;
3771 }
3772  * @endcode
3773  */
3774 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3775
3776 /**
3777  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3778  * @brief       This API gets the datacontrol info
3779  *
3780  * @par         This API is for package-manager client application
3781  * @par Sync (or) Async : Synchronous API
3782  *
3783  * @param[in] providerid                pointer to the providerid of dataconltrol.
3784  * @param[in] type                      pointer to the type of dataconltrol.
3785  * @param[out] appid                    pointer to hold appid, need to free after using
3786  * @param[out] access                   pointer to hold access, need to free after using
3787  * @return      0 if success, error code(<0) if fail
3788  * @retval      PMINFO_R_OK     success
3789  * @retval      PMINFO_R_EINVAL invalid argument
3790  * @retval      PMINFO_R_ERROR  internal error
3791  * @endcode
3792  */
3793 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3794 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3795
3796 /**
3797  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3798  * @brief       This API gets the appid of datacontrol
3799  *
3800  * @par         This API is for package-manager client application
3801  * @par Sync (or) Async : Synchronous API
3802  *
3803  * @param[in] providerid                pointer to the providerid of dataconltrol.
3804  * @param[out] appid                    pointer to hold appid, need to free after using
3805  * @return      0 if success, error code(<0) if fail
3806  * @retval      PMINFO_R_OK     success
3807  * @retval      PMINFO_R_EINVAL invalid argument
3808  * @retval      PMINFO_R_ERROR  internal error
3809  * @endcode
3810  */
3811 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3812 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3813
3814 /**
3815  * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3816  * @brief       This API gets the information about trusted datacontrol
3817  *
3818  * @par         This API is for package-manager client application
3819  * @par Sync (or) Async : Synchronous API
3820  *
3821  * @param[in] providerid                pointer to the providerid of datacontrol.
3822  * @param[out] appid                    pointer to hold appid, need to free after using
3823  * @param[out] is_trusted               pointer to hold whether it provides trusted datacontrol
3824  * @return      0 if success, error code(<0) if fail
3825  * @retval      PMINFO_R_OK     success
3826  * @retval      PMINFO_R_EINVAL invalid argument
3827  * @retval      PMINFO_R_ERROR  internal error
3828  * @endcode
3829  */
3830 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3831                 const char *type, char **appid, bool *is_trusted);
3832 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3833                 const char *type, uid_t uid, char **appid, bool *is_trusted);
3834
3835 /**
3836  * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3837                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3838  * @brief       This API retrieves the privileges and invokes given callback for each privilege.
3839  *
3840  * @par         This API is for package-manager client application
3841  * @par Sync (or) Async : Synchronous API
3842  *
3843  * @param[in] providerid                pointer to the providerid of datacontrol.
3844  * @param[in] type                      pointer to the type of dataconltrol.
3845  * @param[in] privilege_func            callback function for list
3846  * @param[in] user_data user data to be passed to callback function
3847  * @return      0 if success, error code(<0) if fail
3848  * @retval      PMINFO_R_OK     success
3849  * @retval      PMINFO_R_EINVAL invalid argument
3850  * @retval      PMINFO_R_ERROR  internal error
3851  */
3852 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3853                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3854 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3855                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3856
3857 /**
3858  * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h  handle, char **alias_appid)
3859  * @brief       This API gets the alias_appid of the application
3860  *
3861  * @par         This API is for package-manager client application
3862  * @par Sync (or) Async : Synchronous API
3863  *
3864  * @param[in] handle            pointer to the application info handle.
3865  * @param[out] alias_appid              pointer to hold app alias_appid
3866  * @return      0 if success, error code(<0) if fail
3867  * @retval      PMINFO_R_OK     success
3868  * @retval      PMINFO_R_EINVAL invalid argument
3869  * @retval      PMINFO_R_ERROR  internal error
3870  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3871  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3872  * @see         pkgmgrinfo_appinfo_get_appid()
3873  * @code
3874 static int get_alias_appid(const char *appid)
3875 {
3876         int ret = 0;
3877         char *alias_appid= 0;
3878         pkgmgrinfo_appinfo_h handle = NULL;
3879         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3880         if (ret != PMINFO_R_OK)
3881                 return -1;
3882         ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3883         if (ret != PMINFO_R_OK) {
3884                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3885                 return -1;
3886         }
3887         printf("alias_appid: %s\n", alias_appid);
3888         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3889         return 0;
3890 }
3891  * @endcode
3892  */
3893 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3894
3895 /**
3896  * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h  handle, char **effective_appid)
3897  * @brief       This API gets the effective_appid of the application
3898  *
3899  * @par         This API is for package-manager client application
3900  * @par Sync (or) Async : Synchronous API
3901  *
3902  * @param[in] handle            pointer to the application info handle.
3903  * @param[out] effective_appid          pointer to hold app effective_appid
3904  * @return      0 if success, error code(<0) if fail
3905  * @retval      PMINFO_R_OK     success
3906  * @retval      PMINFO_R_EINVAL invalid argument
3907  * @retval      PMINFO_R_ERROR  internal error
3908  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3909  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3910  * @see         pkgmgrinfo_appinfo_get_appid()
3911  * @code
3912 static int get_effective_appid(const char *appid)
3913 {
3914         int ret = 0;
3915         char *effective_appid= 0;
3916         pkgmgrinfo_appinfo_h handle = NULL;
3917         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3918         if (ret != PMINFO_R_OK)
3919                 return -1;
3920         ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3921         if (ret != PMINFO_R_OK) {
3922                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3923                 return -1;
3924         }
3925         printf("effective_appid: %s\n", effective_appid);
3926         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3927         return 0;
3928 }
3929  * @endcode
3930  */
3931 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3932
3933 /**
3934  * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3935  * @brief       This API gets tep(tizen expansion package) file name associated with the package which contain given application
3936  *
3937  * @par This API is for package-manager client application
3938  * @par Sync (or) Async : Synchronous API
3939  *
3940  * @param[in] handle            pointer to the appinfo handle.
3941  * @param[out] tep_name         pointer to hold tep name
3942  * @return      0 if success, error code(<0) if fail
3943  * @retval      PMINFO_R_OK success
3944  * @retval      PMINFO_R_EINVAL invalid argument
3945  * @retval      PMINFO_R_ERROR  internal error
3946  * @pre pkgmgrinfo_appinfo_get_appinfo()
3947  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3948  * @see pkgmgrinfo_appinfo_get_appid()
3949  * @code
3950 static int get_tep_name(const char *appid)
3951 {
3952         int ret = 0;
3953         char *tep_name = NULL;
3954         pkgmgrinfo_appinfo_h handle = NULL;
3955         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3956         if (ret != PMINFO_R_OK)
3957                 return -1;
3958         ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3959         if (ret != PMINFO_R_OK) {
3960                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3961                 return -1;
3962         }
3963         printf("TEP name is: %s\n", tep_name);
3964         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3965         return 0;
3966 }
3967  * @endcode
3968  */
3969 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3970
3971 /**
3972  * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3973  * @brief       This API gets zip mount file name associated with the package which contain given application
3974  *          If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3975  *
3976  * @par This API is for package-manager client application
3977  * @par Sync (or) Async : Synchronous API
3978  *
3979  * @param[in] handle            pointer to the appinfo handle.
3980  * @param[out] zip_mount_file           pointer to hold zip mount file name
3981  * @return      0 if success, error code(<0) if fail
3982  * @retval      PMINFO_R_OK success
3983  * @retval      PMINFO_R_EINVAL invalid argument
3984  * @retval      PMINFO_R_ERROR  internal error
3985  * @pre pkgmgrinfo_appinfo_get_appinfo()
3986  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3987  * @see pkgmgrinfo_appinfo_get_appid()
3988  * @code
3989 static int get_zip_mount_file(const char *appid)
3990 {
3991         int ret = 0;
3992         char *zip_mount_file = NULL;
3993         pkgmgrinfo_appinfo_h handle = NULL;
3994         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3995         if (ret != PMINFO_R_OK)
3996                 return -1;
3997         ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3998         if (ret != PMINFO_R_OK) {
3999                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4000                 return -1;
4001         }
4002         printf("Mount file name is: %s\n", zip_mount_file);
4003         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4004         return 0;
4005 }
4006  * @endcode
4007  */
4008 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4009
4010 /**
4011  * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4012  * @brief       This API gets the root path of application
4013  *
4014  * @par Sync (or) Async : Synchronous API
4015  *
4016  * @param[in] handle            pointer to appinfo handle
4017  * @param[out] path             pointer to hold root path of application
4018  * @return      0 if success, error code(<0) if fail
4019  * @retval      PMINFO_R_OK     success
4020  * @retval      PMINFO_R_EINVAL invalid argument
4021  * @retval      PMINFO_R_ERROR  internal error
4022  * @code
4023 static int get_root_path(const char *appid)
4024 {
4025         int ret = 0;
4026         char *path = 0;
4027         pkgmgrinfo_appinfo_h handle;
4028         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4029         if (ret != PMINFO_R_OK)
4030                 return -1;
4031
4032         ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4033         if (ret != PMINFO_R_OK) {
4034                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4035                 return -1;
4036         }
4037         printf("path : %s\n", path);
4038         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4039
4040         return 0;
4041 }
4042  * @endcode
4043  */
4044 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4045
4046 /**
4047  * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4048  * @brief       This API gets the application api_version from the application ID
4049  *
4050  * @par         This API is for package-manager client application
4051  * @par Sync (or) Async : Synchronous API
4052  *
4053  * @param[in]   handle  pointer to appinfo handle
4054  * @param[out] api_version              pointer to hold application api_version
4055  * @return      0 if success, error code(<0) if fail
4056  * @retval      PMINFO_R_OK     success
4057  * @retval      PMINFO_R_EINVAL invalid argument
4058  * @retval      PMINFO_R_ERROR  internal error
4059  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4060  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4061  * @see         pkgmgrinfo_appinfo_get_appid()
4062  * @code
4063 static int get_app_api_version(const char *appid)
4064 {
4065         int ret = 0;
4066         char *api_version = NULL;
4067         pkgmgrinfo_appinfo_h handle = NULL;
4068         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4069         if (ret != PMINFO_R_OK)
4070                 return -1;
4071         ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4072         if (ret != PMINFO_R_OK) {
4073                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4074                 return -1;
4075         }
4076         printf("app api_version: %s\n", api_version);
4077         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4078         return 0;
4079 }
4080  * @endcode
4081  */
4082 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4083
4084 /**
4085  * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4086  * @brief       This API gets the installed_time of the application
4087  *
4088  * @par         This API is for package-manager client application
4089  * @par Sync (or) Async : Synchronous API
4090  *
4091  * @param[in] handle            pointer to the application info handle.
4092  * @param[out] installed_time           pointer to hold installed_time
4093  * @return      0 if success, error code(<0) if fail
4094  * @retval      PMINFO_R_OK     success
4095  * @retval      PMINFO_R_EINVAL invalid argument
4096  * @retval      PMINFO_R_ERROR  internal error
4097  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4098  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4099  * @see         pkgmgrinfo_appinfo_get_appid()
4100  * @see         pkgmgrinfo_appinfo_is_multiple()
4101  * @code
4102 static int get_app_installed_time(const char *appid)
4103 {
4104         int ret = 0;
4105         int installed_time = 0;
4106         pkgmgrinfo_appinfo_h handle = NULL;
4107         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4108         if (ret != PMINFO_R_OK)
4109                 return -1;
4110         ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4111         if (ret != PMINFO_R_OK) {
4112                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4113                 return -1;
4114         }
4115         printf("installed_time: %d\n", installed_time);
4116         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4117         return 0;
4118 }
4119  * @endcode
4120  */
4121 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4122
4123 /**
4124  * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h  handle, int *support_mode)
4125  * @brief       This API gets the support_mode of the application
4126  *
4127  * @par         This API is for package-manager client application
4128  * @par Sync (or) Async : Synchronous API
4129  *
4130  * @param[in] handle            pointer to the application info handle.
4131  * @param[out] support_mode             pointer to hold app support_mode
4132  * @return      0 if success, error code(<0) if fail
4133  * @retval      PMINFO_R_OK     success
4134  * @retval      PMINFO_R_EINVAL invalid argument
4135  * @retval      PMINFO_R_ERROR  internal error
4136  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4137  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4138  * @see         pkgmgrinfo_appinfo_get_appid()
4139  * @code
4140 static int get_app_support_mode(const char *appid)
4141 {
4142         int ret = 0;
4143         int support_mode = 0;
4144         pkgmgrinfo_appinfo_h handle = NULL;
4145         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4146         if (ret != PMINFO_R_OK)
4147                 return -1;
4148         ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4149         if (ret != PMINFO_R_OK) {
4150                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4151                 return -1;
4152         }
4153         printf("support_mode: %s\n", support_mode);
4154         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4155         return 0;
4156 }
4157  * @endcode
4158  */
4159 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4160
4161
4162 /**
4163  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4164                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4165  * @brief       This API gets the list of category for a particular application
4166  *
4167  * @par         This API is for package-manager client application
4168  * @par Sync (or) Async : Synchronous API
4169  * @param[in]   handle          pointer to the application info handle.
4170  * @param[in]   category_func           callback function for list
4171  * @param[in] user_data user data to be passed to callback function
4172  * @return      0 if success, error code(<0) if fail
4173  * @retval      PMINFO_R_OK     success
4174  * @retval      PMINFO_R_EINVAL invalid argument
4175  * @retval      PMINFO_R_ERROR  internal error
4176  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4177  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4178  * @code
4179 int category_func(const char *name, void *user_data)
4180 {
4181         if (strcmp(name, (char *)user_data) == 0)
4182                 return -1;
4183         else
4184                 return 0;
4185 }
4186
4187 static int list_category(const char *appid, char *category)
4188 {
4189         int ret = 0;
4190         pkgmgrinfo_appinfo_h handle;
4191         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4192         if (ret != PMINFO_R_OK)
4193                 return -1;
4194         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4195         if (ret != PMINFO_R_OK) {
4196                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4197                 return -1;
4198         }
4199         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4200         return 0;
4201 }
4202  * @endcode
4203  */
4204 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4205                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4206
4207 /**
4208  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4209                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4210  * @brief       This API gets the list of metadata for a particular application
4211  *
4212  * @par         This API is for package-manager client application
4213  * @par Sync (or) Async : Synchronous API
4214  * @param[in]   handle          pointer to the application info handle.
4215  * @param[in]   metadata_func           callback function for list
4216  * @param[in] user_data user data to be passed to callback function
4217  * @return      0 if success, error code(<0) if fail
4218  * @retval      PMINFO_R_OK     success
4219  * @retval      PMINFO_R_EINVAL invalid argument
4220  * @retval      PMINFO_R_ERROR  internal error
4221  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4222  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4223  * @code
4224 int metadata_func(const char *key, const char *value, void *user_data)
4225 {
4226         if (strcmp(key, (char *)user_data) == 0) {
4227                 printf("Value is %s\n", value);
4228                 return -1;
4229         }
4230         else
4231                 return 0;
4232 }
4233
4234 static int list_metadata(const char *appid, char *key)
4235 {
4236         int ret = 0;
4237         pkgmgrinfo_appinfo_h handle;
4238         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4239         if (ret != PMINFO_R_OK)
4240                 return -1;
4241         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4242         if (ret != PMINFO_R_OK) {
4243                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4244                 return -1;
4245         }
4246         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4247         return 0;
4248 }
4249  * @endcode
4250  */
4251 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4252                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4253
4254 /**
4255  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4256  *                      const char *operation,
4257  *                      pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4258  *                      void *user_data);
4259  * @brief       This API gets the list of privileges for a particular
4260  *              appllication's app_control
4261  *
4262  * @par         This API is for package-manager client application
4263  * @par Sync (or) Async : Synchronous API
4264  * @param[in]   appid           application id
4265  * @param[in]   operation       operation of appcontrol
4266  * @param[in]   privilege_func  callback function for list
4267  * @param[in]   user_data       user data to be passed to callback function
4268  * @return      0 if success, error code(<0) if fail
4269  * @retval      PMINFO_R_OK     success
4270  * @retval      PMINFO_R_EINVAL invalid argument
4271  * @retval      PMINFO_R_ERROR  internal error
4272  */
4273 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4274                 const char *operation,
4275                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4276                 void *user_data, uid_t uid);
4277 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4278                 const char *operation,
4279                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4280                 void *user_data);
4281
4282 /**
4283  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4284                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4285  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4286                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4287  * @brief       This API gets the list of app-control for a particular application
4288  *
4289  * @par         This API is for package-manager client application
4290  * @par Sync (or) Async : Synchronous API
4291  * @param[in]   handle          pointer to the application info handle.
4292  * @param[in]   appcontrol_func         callback function for list
4293  * @param[in] user_data user data to be passed to callback function
4294  * @param[in]   uid     the addressee user id of the instruction
4295  * @return      0 if success, error code(<0) if fail
4296  * @retval      PMINFO_R_OK     success
4297  * @retval      PMINFO_R_EINVAL invalid argument
4298  * @retval      PMINFO_R_ERROR  internal error
4299  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4300  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4301  * @code
4302 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4303 {
4304         int i = 0;
4305         char **operation;
4306         char *compare_data = (char *)user_data;
4307         if (strcmp(operation, compare_data) == 0)
4308                 return -1;
4309         else
4310           return 0;
4311 }
4312
4313 static int check_operation(const char *appid, char *operation)
4314 {
4315         int ret = 0;
4316         pkgmgrinfo_appinfo_h handle;
4317         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4318         if (ret != PMINFO_R_OK)
4319                 return -1;
4320         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4321         if (ret != PMINFO_R_OK) {
4322                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4323                 return -1;
4324         }
4325         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4326         return 0;
4327 }
4328  * @endcode
4329  */
4330 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4331                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4332
4333 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4334                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4335
4336 /**
4337  * @brief
4338  */
4339 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4340                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4341
4342 /**
4343  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4344                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4345  * @brief       This API gets the list of splashscreen for a particular application
4346  *
4347  * @par         This API is for package-manager client application
4348  * @par Sync (or) Async : Synchronous API
4349  * @param[in]   handle          pointer to the application info handle.
4350  * @param[in]   splash_screen_func              callback function for list
4351  * @param[in]   user_data       user data to be passed to callback function
4352  * @return      0 if success, error code(<0) if fail
4353  * @retval      PMINFO_R_OK     success
4354  * @retval      PMINFO_R_EINVAL invalid argument
4355  * @retval      PMINFO_R_ERROR  internal error
4356  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4357  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4358  * @code
4359  */
4360 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4361                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4362
4363 /**
4364  * @fn  int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4365                         pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4366  * @brief       This API gets the list of resource control for a particular application
4367  *
4368  * @par         This API is for package-manager client application
4369  * @par Sync (or) Async : Synchronous API
4370  * @param[in]   handle                  pointer to the application info handle.
4371  * @param[in]   res_control_func        callback function for list
4372  * @param[in]   user_data               user data to be passed to callback function
4373  * @return      0 if success, error code(<0) if fail
4374  * @retval      PMINFO_R_OK     success
4375  * @retval      PMINFO_R_EINVAL invalid argument
4376  * @retval      PMINFO_R_ERROR  internal error
4377  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4378  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4379  * @code
4380 int res_control_func(const char *res_type,
4381                 const char *min_res_version, const char *max_res_version,
4382                 const char *auto_close, void *user_data)
4383 {
4384         printf("res_type : %s\n", res_type);
4385         return 0;
4386 }
4387
4388 static int list_res_control(const char *appid, char *key)
4389 {
4390         int ret = 0;
4391         pkgmgrinfo_appinfo_h handle;
4392         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4393         if (ret != PMINFO_R_OK)
4394                 return -1;
4395         ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4396         if (ret != PMINFO_R_OK) {
4397                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4398                 return -1;
4399         }
4400         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4401         return 0;
4402 }
4403  * @endcode
4404  */
4405 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4406                 pkgmgrinfo_app_res_control_list_cb res_control_func,
4407                 void *user_data);
4408
4409 /**
4410  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4411  * @brief       This API gets the application 'nodisplay' value from the app ID
4412  *
4413  * @par         This API is for package-manager client application
4414  * @par Sync (or) Async : Synchronous API
4415  *
4416  * @param[in]   handle  pointer to application info handle
4417  * @param[out] nodisplay                pointer to hold package nodisplay value
4418  * @return      0 if success, error code(<0) if fail
4419  * @retval      PMINFO_R_OK     success
4420  * @retval      PMINFO_R_EINVAL invalid argument
4421  * @retval      PMINFO_R_ERROR  internal error
4422  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4423  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4424  * @see         pkgmgrinfo_appinfo_get_appid()
4425  * @see         pkgmgrinfo_appinfo_is_multiple()
4426  * @code
4427 static int get_app_nodisplay(const char *appid)
4428 {
4429         int ret = 0;
4430         bool nodisplay;
4431         pkgmgrinfo_appinfo_h handle;
4432         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4433         if (ret != PMINFO_R_OK)
4434                 return -1;
4435         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4436         if (ret != PMINFO_R_OK) {
4437                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4438                 return -1;
4439         }
4440         printf("app nodisplay: %d\n", nodisplay);
4441         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4442         return 0;
4443 }
4444  * @endcode
4445  */
4446 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
4447
4448 /**
4449  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4450  * @brief       This API gets the application 'multiple' value from the app ID
4451  *
4452  * @par         This API is for package-manager client application
4453  * @par Sync (or) Async : Synchronous API
4454  *
4455  * @param[in]   handle  pointer to application info handle
4456  * @param[out] multiple         pointer to hold package multiple value
4457  * @return      0 if success, error code(<0) if fail
4458  * @retval      PMINFO_R_OK     success
4459  * @retval      PMINFO_R_EINVAL invalid argument
4460  * @retval      PMINFO_R_ERROR  internal error
4461  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4462  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4463  * @see         pkgmgrinfo_appinfo_get_appid()
4464  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4465  * @code
4466 static int get_app_multiple(const char *appid)
4467 {
4468         int ret = 0;
4469         bool multiple;
4470         pkgmgrinfo_appinfo_h handle;
4471         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4472         if (ret != PMINFO_R_OK)
4473                 return -1;
4474         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4475         if (ret != PMINFO_R_OK) {
4476                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477                 return -1;
4478         }
4479         printf("app multiple: %d\n", multiple);
4480         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4481         return 0;
4482 }
4483  * @endcode
4484  */
4485 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
4486
4487 /**
4488  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4489  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4490  *              application launching effect. If fales, indicator will be hidden during application launching effect
4491  *
4492  * @par         This API is for package-manager client application
4493  * @par Sync (or) Async : Synchronous API
4494  *
4495  * @param[in]   handle  pointer to application info handle
4496  * @param[out]  indicator_disp contains indicator display status for application launching effect
4497  * @return      0 if success, error code(<0) if fail
4498  * @retval      PMINFO_R_OK     success
4499  * @retval      PMINFO_R_EINVAL invalid argument
4500  * @retval      PMINFO_R_ERROR  internal error
4501  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4502  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4503  * @see         pkgmgrinfo_appinfo_get_appid()
4504  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4505  * @code
4506 static int get_app_indicator_display(const char *appid)
4507 {
4508         int ret = 0;
4509         bool indicator_disp;
4510         pkgmgrinfo_appinfo_h handle;
4511         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4512         if (ret != PMINFO_R_OK)
4513                 return -1;
4514         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4515         if (ret != PMINFO_R_OK){
4516                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4517                 return -1;
4518         }
4519         printf("app indicator disp : %d\n", indicator_disp);
4520         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4521         return 0;
4522 }
4523  * @endcode
4524  */
4525 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4526
4527 /**
4528  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4529  * @brief       This API gets the application 'taskmanage' value from the app ID
4530  *
4531  * @par         This API is for package-manager client application
4532  * @par Sync (or) Async : Synchronous API
4533  *
4534  * @param[in]   handle  pointer to application info handle
4535  * @param[out] taskmanage               pointer to hold package taskmanage value
4536  * @return      0 if success, error code(<0) if fail
4537  * @retval      PMINFO_R_OK     success
4538  * @retval      PMINFO_R_EINVAL invalid argument
4539  * @retval      PMINFO_R_ERROR  internal error
4540  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4541  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4542  * @see         pkgmgrinfo_appinfo_get_appid()
4543  * @see         pkgmgrinfo_appinfo_is_multiple()
4544  * @code
4545 static int get_app_taskmanage(const char *appid)
4546 {
4547         int ret = 0;
4548         bool taskmanage;
4549         pkgmgrinfo_appinfo_h handle;
4550         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4551         if (ret != PMINFO_R_OK)
4552                 return -1;
4553         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4554         if (ret != PMINFO_R_OK) {
4555                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4556                 return -1;
4557         }
4558         printf("app taskmanage: %d\n", taskmanage);
4559         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4560         return 0;
4561 }
4562  * @endcode
4563  */
4564 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
4565
4566 /**
4567  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4568  * @brief       This API gets the application 'taskmanage' value from the app ID
4569  *
4570  * @par         This API is for package-manager client application
4571  * @par Sync (or) Async : Synchronous API
4572  *
4573  * @param[in]   handle  pointer to application info handle
4574  * @param[out] enabled          pointer to hold package enabled value
4575  * @return      0 if success, error code(<0) if fail
4576  * @retval      PMINFO_R_OK     success
4577  * @retval      PMINFO_R_EINVAL invalid argument
4578  * @retval      PMINFO_R_ERROR  internal error
4579  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4580  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4581  * @see         pkgmgrinfo_appinfo_get_appid()
4582  * @see         pkgmgrinfo_appinfo_is_multiple()
4583  * @code
4584 static int get_app_enabled(const char *appid)
4585 {
4586         int ret = 0;
4587         bool enabled;
4588         pkgmgrinfo_appinfo_h handle;
4589         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4590         if (ret != PMINFO_R_OK)
4591                 return -1;
4592         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4593         if (ret != PMINFO_R_OK) {
4594                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4595                 return -1;
4596         }
4597         printf("app enabled: %d\n", enabled);
4598         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4599         return 0;
4600 }
4601  * @endcode
4602  */
4603 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
4604
4605 /**
4606  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4607  * @brief       This API gets the application 'onboot' value from the app ID
4608  *
4609  * @par         This API is for package-manager client application
4610  * @par Sync (or) Async : Synchronous API
4611  *
4612  * @param[in]   handle  pointer to application info handle
4613  * @param[out] onboot           pointer to hold package onboot value
4614  * @return      0 if success, error code(<0) if fail
4615  * @retval      PMINFO_R_OK     success
4616  * @retval      PMINFO_R_EINVAL invalid argument
4617  * @retval      PMINFO_R_ERROR  internal error
4618  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4619  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4620  * @see         pkgmgrinfo_appinfo_get_appid()
4621  * @see         pkgmgrinfo_appinfo_is_multiple()
4622  * @code
4623 static int get_app_onboot(const char *appid)
4624 {
4625         int ret = 0;
4626         bool onboot;
4627         pkgmgrinfo_appinfo_h handle;
4628         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4629         if (ret != PMINFO_R_OK)
4630                 return -1;
4631         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4632         if (ret != PMINFO_R_OK) {
4633                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4634                 return -1;
4635         }
4636         printf("app onboot: %d\n", onboot);
4637         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4638         return 0;
4639 }
4640  * @endcode
4641  */
4642 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
4643
4644 /**
4645  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4646  * @brief       This API gets the application 'autorestart' value from the app ID
4647  *
4648  * @par         This API is for package-manager client application
4649  * @par Sync (or) Async : Synchronous API
4650  *
4651  * @param[in]   handle  pointer to application info handle
4652  * @param[out] autorestart              pointer to hold package autorestart value
4653  * @return      0 if success, error code(<0) if fail
4654  * @retval      PMINFO_R_OK     success
4655  * @retval      PMINFO_R_EINVAL invalid argument
4656  * @retval      PMINFO_R_ERROR  internal error
4657  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4658  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4659  * @see         pkgmgrinfo_appinfo_get_appid()
4660  * @see         pkgmgrinfo_appinfo_is_multiple()
4661  * @code
4662 static int get_app_autorestart(const char *appid)
4663 {
4664         int ret = 0;
4665         bool autorestart;
4666         pkgmgrinfo_appinfo_h handle;
4667         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4668         if (ret != PMINFO_R_OK)
4669                 return -1;
4670         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4671         if (ret != PMINFO_R_OK) {
4672                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4673                 return -1;
4674         }
4675         printf("app autorestart: %d\n", autorestart);
4676         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4677         return 0;
4678 }
4679  * @endcode
4680  */
4681 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4682
4683 /**
4684  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4685  * @brief       This API gets the value for given application is main app or not from handle
4686  *
4687  * @par         This API is for package-manager client application
4688  * @par Sync (or) Async : Synchronous API
4689  *
4690  * @param[in]   handle  pointer to application info handle
4691  * @param[out] mainapp          pointer to hold package mainapp is or not
4692  * @return      0 if success, error code(<0) if fail
4693  * @retval      PMINFO_R_OK     success
4694  * @retval      PMINFO_R_EINVAL invalid argument
4695  * @retval      PMINFO_R_ERROR  internal error
4696  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4697  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4698  * @see         pkgmgrinfo_appinfo_get_appid()
4699  * @see         pkgmgrinfo_appinfo_is_multiple()
4700  * @code
4701 static int get_app_mainapp(const char *appid)
4702 {
4703         int ret = 0;
4704         bool mainapp;
4705         pkgmgrinfo_appinfo_h handle;
4706         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4707         if (ret != PMINFO_R_OK)
4708                 return -1;
4709         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4710         if (ret != PMINFO_R_OK) {
4711                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4712                 return -1;
4713         }
4714         printf("mainapp: %d\n", mainapp);
4715         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4716         return 0;
4717 }
4718  * @endcode
4719  */
4720 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4721
4722
4723 /**
4724  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4725  * @brief       This API gets the value for given application is preload or not from handle
4726  *
4727  * @par         This API is for package-manager client application
4728  * @par Sync (or) Async : Synchronous API
4729  *
4730  * @param[in]   handle  pointer to application info handle
4731  * @param[out] preload          pointer to hold preload is or not
4732  * @return      0 if success, error code(<0) if fail
4733  * @retval      PMINFO_R_OK     success
4734  * @retval      PMINFO_R_EINVAL invalid argument
4735  * @retval      PMINFO_R_ERROR  internal error
4736  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4737  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4738  * @see         pkgmgrinfo_appinfo_get_appid()
4739  * @see         pkgmgrinfo_appinfo_is_multiple()
4740  * @code
4741 static int get_app_preload(const char *appid)
4742 {
4743         int ret = 0;
4744         bool preload = 0;
4745         pkgmgrinfo_appinfo_h handle = NULL;
4746         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4747         if (ret != PMINFO_R_OK)
4748                 return -1;
4749         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4750         if (ret != PMINFO_R_OK) {
4751                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4752                 return -1;
4753         }
4754         printf("preload: %d\n", preload);
4755         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4756         return 0;
4757 }
4758  * @endcode
4759  */
4760 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4761
4762 /**
4763  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4764  * @brief       This API gets the value for given application is submode or not from handle
4765  *
4766  * @par         This API is for package-manager client application
4767  * @par Sync (or) Async : Synchronous API
4768  *
4769  * @param[in]   handle  pointer to application info handle
4770  * @param[out] submode          pointer to hold submode is or not
4771  * @return      0 if success, error code(<0) if fail
4772  * @retval      PMINFO_R_OK     success
4773  * @retval      PMINFO_R_EINVAL invalid argument
4774  * @retval      PMINFO_R_ERROR  internal error
4775  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4776  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4777  * @see         pkgmgrinfo_appinfo_get_appid()
4778  * @see         pkgmgrinfo_appinfo_is_multiple()
4779  * @code
4780 static int get_app_submode(const char *appid)
4781 {
4782         int ret = 0;
4783         bool submode = 0;
4784         pkgmgrinfo_appinfo_h handle = NULL;
4785         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4786         if (ret != PMINFO_R_OK)
4787                 return -1;
4788         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4789         if (ret != PMINFO_R_OK) {
4790                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4791                 return -1;
4792         }
4793         printf("submode: %d\n", submode);
4794         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4795         return 0;
4796 }
4797  * @endcode
4798  */
4799 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4800
4801 /**
4802  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4803  * @brief       This API gets the value for given application is process_pool or not from handle
4804  *
4805  * @par         This API is for package-manager client application
4806  * @par Sync (or) Async : Synchronous API
4807  *
4808  * @param[in]   handle  pointer to application info handle
4809  * @param[out] process_pool             pointer to hold process_pool is or not
4810  * @return      0 if success, error code(<0) if fail
4811  * @retval      PMINFO_R_OK     success
4812  * @retval      PMINFO_R_EINVAL invalid argument
4813  * @retval      PMINFO_R_ERROR  internal error
4814  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4815  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4816  * @see         pkgmgrinfo_appinfo_get_appid()
4817  * @code
4818 static int get_app_process_pool(const char *appid)
4819 {
4820         int ret = 0;
4821         bool process_pool = 0;
4822         pkgmgrinfo_appinfo_h handle = NULL;
4823         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4824         if (ret != PMINFO_R_OK)
4825                 return -1;
4826         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4827         if (ret != PMINFO_R_OK) {
4828                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4829                 return -1;
4830         }
4831         printf("process_pool: %d\n", process_pool);
4832         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4833         return 0;
4834 }
4835  * @endcode
4836  */
4837 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4838
4839 /**
4840  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4841  * @brief       This API gets the installed storage location of the application
4842  *
4843  * @par This API is for package-manager client application
4844  * @par Sync (or) Async : Synchronous API
4845  *
4846  * @param[in] handle            pointer to the application info handle.
4847  * @param[out] app_type         pointer to hold installed storage location
4848  * @return      0 if success, error code(<0) if fail
4849  * @retval      PMINFO_R_OK success
4850  * @retval      PMINFO_R_EINVAL invalid argument
4851  * @retval      PMINFO_R_ERROR  internal error
4852  * @pre pkgmgrinfo_appinfo_get_appinfo()
4853  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4854  * @see pkgmgrinfo_appinfo_get_appid()
4855  * @code
4856 static int get_app_installed_location(const char *appid)
4857 {
4858         int ret = 0;
4859         pkgmgrinfo_installed_storage storage;
4860         pkgmgrinfo_appinfo_h handle = NULL;
4861         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4862         if (ret != PMINFO_R_OK)
4863                 return -1;
4864         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4865         if (ret != PMINFO_R_OK) {
4866                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4867                 return -1;
4868         }
4869         printf("Installed storage location : %d\n", storage);
4870         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4871         return 0;
4872 }
4873  * @endcode
4874  */
4875 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4876
4877
4878 /**
4879  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4880  * @brief       This API checks if the application has the given category
4881  *
4882  * @par         This API is for package-manager client application
4883  * @par Sync (or) Async : Synchronous API
4884  *
4885  * @param[in]   handle  pointer to the application info handle
4886  * @param[in]   category        category
4887  * @param[out] exist            value Gets whether the application has the given category
4888  * @return      0 if success, error code(<0) if fail
4889  * @retval      PMINFO_R_OK     success
4890  * @retval      PMINFO_R_EINVAL invalid argument
4891  * @retval      PMINFO_R_ERROR  internal error
4892  * @code
4893 static int is_category_exist(const char *appid, const char *category)
4894 {
4895         int ret = 0;
4896         pkgmgrinfo_appinfo_h handle;
4897         bool exist = false;
4898
4899         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4900         if (ret != PMINFO_R_OK)
4901                 return -1;
4902
4903         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4904         if (ret != PMINFO_R_OK) {
4905                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4906                 return -1;
4907         }
4908
4909         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4910         return 0;
4911 }
4912  * @endcode
4913  */
4914 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4915
4916 /**
4917  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4918  * @brief       This API gets the application 'ui_gadget' value from the app ID
4919  *
4920  * @par         This API is for package-manager client application
4921  * @par Sync (or) Async : Synchronous API
4922  *
4923  * @param[in]   handle  pointer to application info handle
4924  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4925  * @return      0 if success, error code(<0) if fail
4926  * @retval      PMINFO_R_OK     success
4927  * @retval      PMINFO_R_EINVAL invalid argument
4928  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4929  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4930  * @code
4931 static int get_app_ui_gadget(const char *appid)
4932 {
4933         int ret = 0;
4934         bool ui_gadget;
4935         pkgmgrinfo_appinfo_h handle = NULL;
4936         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4937         if (ret != PMINFO_R_OK)
4938                 return -1;
4939         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4940         if (ret != PMINFO_R_OK) {
4941                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4942                 return -1;
4943         }
4944         printf("app ui_gadget: %d\n", ui_gadget);
4945         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4946         return 0;
4947 }
4948  * @endcode
4949  */
4950 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4951
4952 /**
4953  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4954  * @brief       This API gets the application 'support_disable' value from the app ID
4955  *
4956  * @par         This API is for package-manager client application
4957  * @par Sync (or) Async : Synchronous API
4958  *
4959  * @param[in]   handle  pointer to application info handle
4960  * @param[out]  support_disable pointer to hold package support_disable value
4961  * @return      0 if success, error code(<0) if fail
4962  * @retval      PMINFO_R_OK     success
4963  * @retval      PMINFO_R_EINVAL invalid argument
4964  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4965  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4966  * @code
4967 static int get_app_support_disable(const char *appid)
4968 {
4969         int ret = 0;
4970         bool support_disable;
4971         pkgmgrinfo_appinfo_h handle = NULL;
4972         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4973         if (ret != PMINFO_R_OK)
4974                 return -1;
4975         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4976         if (ret != PMINFO_R_OK) {
4977                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4978                 return -1;
4979         }
4980         printf("app support_disable: %d\n", support_disable);
4981         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4982         return 0;
4983 }
4984  * @endcode
4985  */
4986 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4987
4988 /**
4989  * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4990  * @brief       This API gets the application 'removable' value from the app ID
4991  *
4992  * @par         This API is for package-manager client application
4993  * @par Sync (or) Async : Synchronous API
4994  *
4995  * @param[in]   handle  pointer to application info handle
4996  * @param[out]  removable       pointer to hold package removable value
4997  * @return      0 if success, error code(<0) if fail
4998  * @retval      PMINFO_R_OK     success
4999  * @retval      PMINFO_R_EINVAL invalid argument
5000  * @retval      PMINFO_R_ERROR  internal error
5001  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5002  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5003  * @see         pkgmgrinfo_appinfo_get_appid()
5004  * @code
5005 static int get_app_removable(const char *appid)
5006 {
5007         int ret = 0;
5008         bool removable;
5009         pkgmgrinfo_appinfo_h handle = NULL;
5010         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5011         if (ret != PMINFO_R_OK)
5012                 return -1;
5013         ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5014         if (ret != PMINFO_R_OK) {
5015                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5016                 return -1;
5017         }
5018         printf("app removable: %d\n", removable);
5019         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5020         return 0;
5021 }
5022  * @endcode
5023  */
5024 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5025
5026 /**
5027  * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5028  * @brief       This API gets the application 'system' value from the app ID
5029  *
5030  * @par         This API is for package-manager client application
5031  * @par Sync (or) Async : Synchronous API
5032  *
5033  * @param[in]   handle  pointer to application info handle
5034  * @param[out]  system  pointer to hold package system value
5035  * @return      0 if success, error code(<0) if fail
5036  * @retval      PMINFO_R_OK     success
5037  * @retval      PMINFO_R_EINVAL invalid argument
5038  * @retval      PMINFO_R_ERROR  internal error
5039  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5040  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5041  * @see         pkgmgrinfo_appinfo_get_appid()
5042  * @code
5043 static int get_app_system(const char *appid)
5044 {
5045         int ret = 0;
5046         bool system = false;
5047         pkgmgrinfo_appinfo_h handle = NULL;
5048         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5049         if (ret != PMINFO_R_OK)
5050                 return -1;
5051         ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5052         if (ret != PMINFO_R_OK) {
5053                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5054                 return -1;
5055         }
5056         printf("app system: %d\n", system);
5057         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5058         return 0;
5059 }
5060  * @endcode
5061  */
5062 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5063
5064
5065 /**
5066  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5067  * @brief       This API gets the application 'is_disable' value from the app ID
5068  *
5069  * @par         This API is for package-manager client application
5070  * @par Sync (or) Async : Synchronous API
5071  *
5072  * @param[in]   handle  pointer to application info handle
5073  * @param[out]  disabled        pointer to hold application is_disabled value
5074  * @return      0 if success, error code(<0) if fail
5075  * @retval      PMINFO_R_OK     success
5076  * @retval      PMINFO_R_EINVAL invalid argument
5077  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5078  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
5079  * @code
5080 static int get_app_is_disable(const char *appid)
5081 {
5082         int ret = 0;
5083         bool is_disable;
5084         pkgmgrinfo_appinfo_h handle = NULL;
5085         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5086         if (ret != PMINFO_R_OK)
5087                 return -1;
5088         ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5089         if (ret != PMINFO_R_OK) {
5090                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5091                 return -1;
5092         }
5093         printf("app is_disable: %d\n", is_disable);
5094         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5095         return 0;
5096 }
5097  * @endcode
5098  */
5099 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5100
5101 /**
5102  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5103  * @brief       This API gets whether the given application is global application or user application
5104  *
5105  * @par         This API is for package-manager client application
5106  * @par Sync (or) Async : Synchronous API
5107  *
5108  * @param[in]   handle  pointer to application info handle
5109  * @param[in]   global  pointer to hold application global value
5110  * @return      0 if success, error code(<0) if fail
5111  * @retval      PMINFO_R_OK     success
5112  * @retval      PMINFO_R_EINVAL invalid argument
5113  * @retval      PMINFO_R_ERROR  internal error
5114  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5115  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5116  * @see         pkgmgrinfo_appinfo_get_appid()
5117  static int get_app_is_global(const char *appid)
5118  {
5119          int ret = 0;
5120          bool global;
5121          pkgmgrinfo_appinfo_h handle = NULL;
5122          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5123          if (ret != PMINFO_R_OK)
5124                  return -1;
5125          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5126          if (ret != PMINFO_R_OK) {
5127                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
5128                  return -1;
5129          }
5130          printf("app is_global: %d\n", global);
5131          pkgmgrinfo_appinfo_destroy_appinfo(handle);
5132          return 0;
5133  }
5134   * @endcode
5135   */
5136 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5137
5138 /**
5139  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5140  * @brief       This API gets the application 'splash_screen_display' value from the app ID
5141  *
5142  * @par         This API is for package-manager client application
5143  * @par Sync (or) Async : Synchronous API
5144  *
5145  * @param[in]   handle          pointer to application info handle
5146  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
5147  * @return      0 if success, error code(<0) if fail
5148  * @retval      PMINFO_R_OK     success
5149  * @retval      PMINFO_R_EINVAL invalid argument
5150  * @retval      PMINFO_R_ERROR  internal error
5151  */
5152 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5153
5154 /**
5155  * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5156  * @brief       This API gets the application 'setup_appid' value from the app ID
5157  *
5158  * @par         This API is for package-manager client application
5159  * @par Sync (or) Async : Synchronous API
5160  *
5161  * @param[in]   handle          pointer to application info handle
5162  * @param[out]  setup_appid     pointer to hold package setup_appid value
5163  * @return      0 if success, error code(<0) if fail
5164  * @retval      PMINFO_R_OK     success
5165  * @retval      PMINFO_R_EINVAL invalid argument
5166  * @retval      PMINFO_R_ERROR  internal error
5167  */
5168 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5169
5170 /**
5171  * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5172  * @brief       This API gets the application 'support_ambient' value from the app ID
5173  *
5174  * @par         This API is for package-manager client application
5175  * @par Sync (or) Async : Synchronous API
5176  *
5177  * @param[in]   handle          pointer to application info handle
5178  * @param[out]  support_ambient pointer to hold package support_ambient value
5179  * @return      0 if success, error code(<0) if fail
5180  * @retval      PMINFO_R_OK     success
5181  * @retval      PMINFO_R_EINVAL invalid argument
5182  * @retval      PMINFO_R_ERROR  internal error
5183  */
5184 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5185
5186 /**
5187  * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
5188  * @brief       This API gets the application 'light_user_switch_mode' value from the app ID
5189  *
5190  * @par         This API is for package-manager client application
5191  * @par Sync (or) Async : Synchronous API
5192  *
5193  * @param[in]   handle          pointer to application info handle
5194  * @param[out]  mode    pointer to hold package light_user_switch_mode value
5195  * @return      0 if success, error code(<0) if fail
5196  * @retval      PMINFO_R_OK     success
5197  * @retval      PMINFO_R_EINVAL invalid argument
5198  * @retval      PMINFO_R_ERROR  internal error
5199  */
5200 int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
5201
5202 /**
5203  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5204  * @brief       This API destroys the application information handle freeing up all the resources
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  * @return      0 if success, error code(<0) if fail
5211  * @retval      PMINFO_R_OK     success
5212  * @retval      PMINFO_R_EINVAL invalid argument
5213  * @retval      PMINFO_R_ERROR  internal error
5214  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5215  * @post                None
5216  * @see         pkgmgrinfo_appinfo_get_pkgid()
5217  * @see         pkgmgrinfo_appinfo_is_multiple()
5218  * @code
5219 static int get_app_type(const char *appid)
5220 {
5221         int ret = 0;
5222         char *type = NULL;
5223         pkgmgrinfo_appinfo_h handle;
5224         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5225         if (ret != PMINFO_R_OK)
5226                 return -1;
5227         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5228         if (ret != PMINFO_R_OK) {
5229                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5230                 return -1;
5231         }
5232         printf("apptype: %s\n", type);
5233         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5234         return 0;
5235 }
5236  * @endcode
5237  */
5238 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
5239
5240 /**
5241  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5242  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
5243  The query will search the entire application information collected from the manifest file of all the installed packages
5244  *
5245  * @par         This API is for package-manager client application
5246  * @par Sync (or) Async : Synchronous API
5247  *
5248  * @param[out] handle           pointer to the application info filter handle.
5249  * @return      0 if success, error code(<0) if fail
5250  * @retval      PMINFO_R_OK     success
5251  * @retval      PMINFO_R_EINVAL invalid argument
5252  * @retval      PMINFO_R_ERROR  internal error
5253  * @pre         None
5254  * @post                pkgmgrinfo_appinfo_filter_destroy()
5255  * @see         pkgmgrinfo_appinfo_filter_count()
5256  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5257  * @code
5258 static int get_capp_count()
5259 {
5260         int ret = 0;
5261         int count = 0;
5262         pkgmgrinfo_appinfo_filter_h handle;
5263         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5264         if (ret != PMINFO_R_OK)
5265                 return -1;
5266         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5267         if (ret != PMINFO_R_OK) {
5268                 pkgmgrinfo_appinfo_filter_destroy(handle);
5269                 return -1;
5270         }
5271         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5272         if (ret != PMINFO_R_OK) {
5273                 pkgmgrinfo_appinfo_filter_destroy(handle);
5274                 return -1;
5275         }
5276         printf("No of capp: %d\n", count);
5277         pkgmgrinfo_appinfo_filter_destroy(handle);
5278         return 0;
5279 }
5280  * @endcode
5281  */
5282 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5283
5284 /**
5285  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5286  * @brief       This API destroys the application information filter handle freeing up all the resources
5287  *
5288  * @par         This API is for package-manager client application
5289  * @par Sync (or) Async : Synchronous API
5290  *
5291  * @param[in] handle            pointer to the application info filter handle.
5292  * @return      0 if success, error code(<0) if fail
5293  * @retval      PMINFO_R_OK     success
5294  * @retval      PMINFO_R_EINVAL invalid argument
5295  * @retval      PMINFO_R_ERROR  internal error
5296  * @pre         pkgmgrinfo_appinfo_filter_create()
5297  * @post                None
5298  * @see         pkgmgrinfo_appinfo_filter_count()
5299  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5300  * @code
5301 static int get_capp_count()
5302 {
5303         int ret = 0;
5304         int count = 0;
5305         pkgmgrinfo_appinfo_filter_h handle;
5306         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5307         if (ret != PMINFO_R_OK)
5308                 return -1;
5309         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5310         if (ret != PMINFO_R_OK) {
5311                 pkgmgrinfo_appinfo_filter_destroy(handle);
5312                 return -1;
5313         }
5314         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5315         if (ret != PMINFO_R_OK) {
5316                 pkgmgrinfo_appinfo_filter_destroy(handle);
5317                 return -1;
5318         }
5319         printf("No of capp: %d\n", count);
5320         pkgmgrinfo_appinfo_filter_destroy(handle);
5321         return 0;
5322 }
5323  * @endcode
5324  */
5325 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5326
5327 /**
5328  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5329  * @brief       This API adds a boolean filter property to the filter handle
5330  *
5331  * @par         This API is for package-manager client application
5332  * @par Sync (or) Async : Synchronous API
5333  *
5334  * @param[in] handle            pointer to the application info filter handle.
5335  * @param[in] property          boolean property name.
5336  * @param[in] value             value corresponding to the property.
5337  * @return      0 if success, error code(<0) if fail
5338  * @retval      PMINFO_R_OK     success
5339  * @retval      PMINFO_R_EINVAL invalid argument
5340  * @retval      PMINFO_R_ERROR  internal error
5341  * @pre         pkgmgrinfo_appinfo_filter_create()
5342  * @post                pkgmgrinfo_appinfo_filter_destroy()
5343  * @see         pkgmgrinfo_appinfo_filter_count()
5344  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5345  * @code
5346 static int get_taskmanageable_app_count()
5347 {
5348         int ret = 0;
5349         int count = 0;
5350         pkgmgrinfo_appinfo_filter_h handle;
5351         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5352         if (ret != PMINFO_R_OK)
5353                 return -1;
5354         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5355         if (ret != PMINFO_R_OK) {
5356                 pkgmgrinfo_appinfo_filter_destroy(handle);
5357                 return -1;
5358         }
5359         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5360         if (ret != PMINFO_R_OK) {
5361                 pkgmgrinfo_appinfo_filter_destroy(handle);
5362                 return -1;
5363         }
5364         printf("No of taskmanageable apps: %d\n", count);
5365         pkgmgrinfo_appinfo_filter_destroy(handle);
5366         return 0;
5367 }
5368  * @endcode
5369  */
5370 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5371                 const char *property, const bool value);
5372
5373 /**
5374  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5375  * @brief       This API adds an integer filter property to the filter handle
5376  *
5377  * @par         This API is for package-manager client application
5378  * @par Sync (or) Async : Synchronous API
5379  *
5380  * @param[in] handle            pointer to the application info filter handle.
5381  * @param[in] property          integer property name.
5382  * @param[in] value             value corresponding to the property.
5383  * @return      0 if success, error code(<0) if fail
5384  * @retval      PMINFO_R_OK     success
5385  * @retval      PMINFO_R_EINVAL invalid argument
5386  * @retval      PMINFO_R_ERROR  internal error
5387  * @pre         pkgmgrinfo_appinfo_filter_create()
5388  * @post                pkgmgrinfo_appinfo_filter_destroy()
5389  * @see         pkgmgrinfo_appinfo_filter_count()
5390  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5391  * @code
5392 static int get_taskmanageable_app_count()
5393 {
5394         int ret = 0;
5395         int count = 0;
5396         pkgmgrinfo_appinfo_filter_h handle;
5397         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5398         if (ret != PMINFO_R_OK)
5399                 return -1;
5400         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5401         if (ret != PMINFO_R_OK) {
5402                 pkgmgrinfo_appinfo_filter_destroy(handle);
5403                 return -1;
5404         }
5405         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5406         if (ret != PMINFO_R_OK) {
5407                 pkgmgrinfo_appinfo_filter_destroy(handle);
5408                 return -1;
5409         }
5410         printf("No of apps: %d\n", count);
5411         pkgmgrinfo_appinfo_filter_destroy(handle);
5412         return 0;
5413 }
5414  * @endcode
5415  */
5416 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5417                 const char *property, const int value);
5418
5419 /**
5420  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5421  * @brief       This API adds a string filter property to the filter handle
5422  *
5423  * @par         This API is for package-manager client application
5424  * @par Sync (or) Async : Synchronous API
5425  *
5426  * @param[in] handle            pointer to the application info filter handle.
5427  * @param[in] property          string property name.
5428  * @param[in] value             value corresponding to the property.
5429  * @return      0 if success, error code(<0) if fail
5430  * @retval      PMINFO_R_OK     success
5431  * @retval      PMINFO_R_EINVAL invalid argument
5432  * @retval      PMINFO_R_ERROR  internal error
5433  * @pre         pkgmgrinfo_appinfo_filter_create()
5434  * @post                pkgmgrinfo_appinfo_filter_destroy()
5435  * @see         pkgmgrinfo_appinfo_filter_count()
5436  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5437  * @code
5438 static int get_capp_count()
5439 {
5440         int ret = 0;
5441         int count = 0;
5442         pkgmgrinfo_appinfo_filter_h handle;
5443         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5444         if (ret != PMINFO_R_OK)
5445                 return -1;
5446         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5447         if (ret != PMINFO_R_OK) {
5448                 pkgmgrinfo_appinfo_filter_destroy(handle);
5449                 return -1;
5450         }
5451         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5452         if (ret != PMINFO_R_OK) {
5453                 pkgmgrinfo_appinfo_filter_destroy(handle);
5454                 return -1;
5455         }
5456         printf("No of capp: %d\n", count);
5457         pkgmgrinfo_appinfo_filter_destroy(handle);
5458         return 0;
5459 }
5460  * @endcode
5461  */
5462 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5463                 const char *property, const char *value);
5464
5465 /**
5466  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5467  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
5468  *
5469  * @par         This API is for package-manager client application
5470  * @par Sync (or) Async : Synchronous API
5471  *
5472  * @param[in] handle            pointer to the application info filter handle.
5473  * @param[in] app_cb            callback function.
5474  * @param[in] user_data         user data to be passed to the callback function
5475  * @return      0 if success, error code(<0) if fail
5476  * @retval      PMINFO_R_OK     success
5477  * @retval      PMINFO_R_EINVAL invalid argument
5478  * @retval      PMINFO_R_ERROR  internal error
5479  * @pre         pkgmgrinfo_appinfo_filter_create()
5480  * @post                pkgmgrinfo_appinfo_filter_destroy()
5481  * @see         pkgmgrinfo_appinfo_filter_count()
5482  * @code
5483 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5484 {
5485         char *appid = NULL;
5486         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5487         printf("appid : %s\n", appid);
5488         return 0;
5489 }
5490
5491 static int get_capp_list()
5492 {
5493         int ret = 0;
5494         pkgmgrinfo_appinfo_filter_h handle;
5495         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5496         if (ret != PMINFO_R_OK)
5497                 return -1;
5498         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5499         if (ret != PMINFO_R_OK) {
5500                 pkgmgrinfo_appinfo_filter_destroy(handle);
5501                 return -1;
5502         }
5503         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5504         if (ret != PMINFO_R_OK) {
5505                 pkgmgrinfo_appinfo_filter_destroy(handle);
5506                 return -1;
5507         }
5508         pkgmgrinfo_appinfo_filter_destroy(handle);
5509         return 0;
5510 }
5511  * @endcode
5512  */
5513 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5514                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5515 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5516                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5517
5518 /**
5519  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5520  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5521  * @brief       This API counts the application that satisfy the filter conditions
5522  *
5523  * @par         This API is for package-manager client application
5524  * @par Sync (or) Async : Synchronous API
5525  *
5526  * @param[in] handle            pointer to the application info filter handle.
5527  * @param[in] count             pointer to store count value
5528  * @param[in]   uid     the addressee user id of the instruction
5529  * @return      0 if success, error code(<0) if fail
5530  * @retval      PMINFO_R_OK     success
5531  * @retval      PMINFO_R_EINVAL invalid argument
5532  * @retval      PMINFO_R_ERROR  internal error
5533  * @pre         pkgmgrinfo_appinfo_filter_create()
5534  * @post                pkgmgrinfo_appinfo_filter_destroy()
5535  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5536  * @code
5537 static int get_capp_count()
5538 {
5539         int ret = 0;
5540         int count = 0;
5541         pkgmgrinfo_appinfo_filter_h handle;
5542         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5543         if (ret != PMINFO_R_OK)
5544                 return -1;
5545         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5546         if (ret != PMINFO_R_OK) {
5547                 pkgmgrinfo_appinfo_filter_destroy(handle);
5548                 return -1;
5549         }
5550         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5551         if (ret != PMINFO_R_OK) {
5552                 pkgmgrinfo_appinfo_filter_destroy(handle);
5553                 return -1;
5554         }
5555         printf("No of capp: %d\n", count);
5556         pkgmgrinfo_appinfo_filter_destroy(handle);
5557         return 0;
5558 }
5559  * @endcode
5560  */
5561 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5562 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5563 /**
5564  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5565  * @brief       This API creates the application's metadata  information filter handle from db.
5566  *
5567  * @par         This API is for package-manager client application
5568  * @par Sync (or) Async : Synchronous API
5569  *
5570  * @param[out] handle           pointer to the application metadata info filter handle.
5571  * @return      0 if success, error code(<0) if fail
5572  * @retval      PMINFO_R_OK     success
5573  * @retval      PMINFO_R_EINVAL invalid argument
5574  * @retval      PMINFO_R_ERROR  internal error
5575  * @pre         None
5576  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5577  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5578  * @code
5579 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5580 {
5581         char *appid = NULL;
5582         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5583         printf("appid : %s\n", appid);
5584         return 0;
5585 }
5586
5587 static int get_app_list(const char *mkey, const char *mvalue)
5588 {
5589         int ret = 0;
5590         pkgmgrinfo_appinfo_metadata_filter_h handle;
5591         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5592         if (ret != PMINFO_R_OK)
5593                 return -1;
5594         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5595         if (ret != PMINFO_R_OK) {
5596                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5597                 return -1;
5598         }
5599         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5600         if (ret != PMINFO_R_OK) {
5601                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5602                 return -1;
5603         }
5604         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5605         return 0;
5606 }
5607  * @endcode
5608  */
5609 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5610
5611 /**
5612  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5613  * @brief       This API destroys the application's metadata  information filter handle.
5614  *
5615  * @par         This API is for package-manager client application
5616  * @par Sync (or) Async : Synchronous API
5617  *
5618  * @param[in] handle            pointer to the application metadata info filter handle.
5619  * @return      0 if success, error code(<0) if fail
5620  * @retval      PMINFO_R_OK     success
5621  * @retval      PMINFO_R_EINVAL invalid argument
5622  * @retval      PMINFO_R_ERROR  internal error
5623  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5624  * @post                None
5625  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5626  * @code
5627 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5628 {
5629         char *appid = NULL;
5630         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5631         printf("appid : %s\n", appid);
5632         return 0;
5633 }
5634
5635 static int get_app_list(const char *mkey, const char *mvalue)
5636 {
5637         int ret = 0;
5638         pkgmgrinfo_appinfo_metadata_filter_h handle;
5639         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5640         if (ret != PMINFO_R_OK)
5641                 return -1;
5642         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5643         if (ret != PMINFO_R_OK) {
5644                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5645                 return -1;
5646         }
5647         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5648         if (ret != PMINFO_R_OK) {
5649                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5650                 return -1;
5651         }
5652         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5653         return 0;
5654 }
5655  * @endcode
5656  */
5657 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5658
5659 /**
5660  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5661  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
5662  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5663  *
5664  * @par         This API is for package-manager client application
5665  * @par Sync (or) Async : Synchronous API
5666  *
5667  * @param[in] handle            pointer to the application metadata info filter handle.
5668  * @param[in] key                       pointer to metadata key
5669  * @param[in] value                     pointer to metadata value
5670  * @return      0 if success, error code(<0) if fail
5671  * @retval      PMINFO_R_OK     success
5672  * @retval      PMINFO_R_EINVAL invalid argument
5673  * @retval      PMINFO_R_ERROR  internal error
5674  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5675  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5676  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5677  * @code
5678 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5679 {
5680         char *appid = NULL;
5681         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5682         printf("appid : %s\n", appid);
5683         return 0;
5684 }
5685
5686 static int get_app_list(const char *mkey, const char *mvalue)
5687 {
5688         int ret = 0;
5689         pkgmgrinfo_appinfo_metadata_filter_h handle;
5690         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5691         if (ret != PMINFO_R_OK)
5692                 return -1;
5693         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5694         if (ret != PMINFO_R_OK) {
5695                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5696                 return -1;
5697         }
5698         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5699         if (ret != PMINFO_R_OK) {
5700                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5701                 return -1;
5702         }
5703         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5704         return 0;
5705 }
5706  * @endcode
5707  */
5708 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5709                 const char *key, const char *value);
5710
5711 /**
5712  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5713  * @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)
5714  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
5715  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5716  * negative value, no more callbacks will be called and API will return.
5717  *
5718  * @par         This API is for package-manager client application
5719  * @par Sync (or) Async : Synchronous API
5720  *
5721  * @param[in] handle            pointer to the application metadata info filter handle.
5722  * @param[in] app_cb            function pointer to callback
5723  * @param[in] user_data         pointer to user data
5724  * @param[in]   uid     the addressee user id of the instruction
5725  * @return      0 if success, error code(<0) if fail
5726  * @retval      PMINFO_R_OK     success
5727  * @retval      PMINFO_R_EINVAL invalid argument
5728  * @retval      PMINFO_R_ERROR  internal error
5729  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5730  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5731  * @code
5732 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5733 {
5734         char *appid = NULL;
5735         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5736         printf("appid : %s\n", appid);
5737         return 0;
5738 }
5739
5740 static int get_app_list(const char *mkey, const char *mvalue)
5741 {
5742         int ret = 0;
5743         pkgmgrinfo_appinfo_metadata_filter_h handle;
5744         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5745         if (ret != PMINFO_R_OK)
5746                 return -1;
5747         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5748         if (ret != PMINFO_R_OK) {
5749                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5750                 return -1;
5751         }
5752         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5753         if (ret != PMINFO_R_OK) {
5754                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5755                 return -1;
5756         }
5757         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5758         return 0;
5759 }
5760  * @endcode
5761  */
5762 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5763                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5764 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5765                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5766
5767 /**
5768  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5769                         pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5770  * @fn  int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5771                         pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5772  * @brief       This API gets the list of app-control for a particular application
5773  *
5774  * @par         This API is for package-manager client application
5775  * @par Sync (or) Async : Synchronous API
5776  * @param[in]   handle          pointer to the application info handle.
5777  * @param[in]   appcontrol_func callback function for list
5778  * @param[in]   user_data       user data to be passed to callback function
5779  * @return      0 if success, error code(<0) if fail
5780  * @retval      PMINFO_R_OK     success
5781  * @retval      PMINFO_R_EINVAL invalid argument
5782  * @retval      PMINFO_R_ERROR  internal error
5783  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5784  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
5785  */
5786 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5787                 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5788                 void *user_data);
5789 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5790                 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5791                 void *user_data);
5792 /**
5793  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5794  * @brief       This API creates the package cert information handle to get data from db.
5795  *
5796  * @par         This API is for package-manager client application
5797  * @par Sync (or) Async : Synchronous API
5798  *
5799  * @param[out] handle           pointer to the package cert handle.
5800  * @return      0 if success, error code(<0) if fail
5801  * @retval      PMINFO_R_OK     success
5802  * @retval      PMINFO_R_EINVAL invalid argument
5803  * @retval      PMINFO_R_ERROR  internal error
5804  * @pre         None
5805  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5806  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5807  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5808  * @code
5809 static int get_cert_info(const char *pkgid)
5810 {
5811         int ret = 0;
5812         pkgmgrinfo_certinfo_h handle;
5813         char *auth_cert = NULL;
5814         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5815         if (ret != PMINFO_R_OK)
5816                 return -1;
5817         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5818         if (ret != PMINFO_R_OK) {
5819                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5820                 return -1;
5821         }
5822         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5823         if (ret != PMINFO_R_OK) {
5824                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5825                 return -1;
5826         }
5827         printf("Author root certificate: %s\n", auth_root);
5828         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5829         return 0;
5830 }
5831  * @endcode
5832  */
5833 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5834
5835 /**
5836  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5837  * @brief       This API loads the package cert information handle with data from db.
5838  *
5839  * @par         This API is for package-manager client application
5840  * @par Sync (or) Async : Synchronous API
5841  *
5842  * @param[in] pkgid             pointer to the package ID.
5843  * @param[in] handle            pointer to the package cert handle.
5844  * @return      0 if success, error code(<0) if fail
5845  * @retval      PMINFO_R_OK     success
5846  * @retval      PMINFO_R_EINVAL invalid argument
5847  * @retval      PMINFO_R_ERROR  internal error
5848  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5849  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5850  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5851  * @code
5852 static int get_cert_info(const char *pkgid)
5853 {
5854         int ret = 0;
5855         pkgmgrinfo_certinfo_h handle;
5856         char *auth_cert = NULL;
5857         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5858         if (ret != PMINFO_R_OK)
5859                 return -1;
5860         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5861         if (ret != PMINFO_R_OK) {
5862                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5863                 return -1;
5864         }
5865         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5866         if (ret != PMINFO_R_OK) {
5867                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5868                 return -1;
5869         }
5870         printf("Author root certificate: %s\n", auth_root);
5871         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5872         return 0;
5873 }
5874  * @endcode
5875  */
5876 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5877
5878 /**
5879  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5880  * @brief       This API gets the package cert information from the handle
5881  *
5882  * @par         This API is for package-manager client application
5883  * @par Sync (or) Async : Synchronous API
5884  *
5885  * @param[in] handle            pointer to the package cert handle.
5886  * @param[in] cert_type         certificate type
5887  * @param[out] cert_value       pointer to hold certificate value
5888  * @return      0 if success, error code(<0) if fail
5889  * @retval      PMINFO_R_OK     success
5890  * @retval      PMINFO_R_EINVAL invalid argument
5891  * @retval      PMINFO_R_ERROR  internal error
5892  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5893  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5894  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5895  * @code
5896 static int get_cert_info(const char *pkgid)
5897 {
5898         int ret = 0;
5899         pkgmgrinfo_certinfo_h handle;
5900         char *auth_cert = NULL;
5901         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5902         if (ret != PMINFO_R_OK)
5903                 return -1;
5904         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5905         if (ret != PMINFO_R_OK) {
5906                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5907                 return -1;
5908         }
5909         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5910         if (ret != PMINFO_R_OK) {
5911                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5912                 return -1;
5913         }
5914         printf("Author root certificate: %s\n", auth_root);
5915         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5916         return 0;
5917 }
5918  * @endcode
5919  */
5920 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5921
5922 /**
5923  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5924  * @brief       This API destroys the package cert information handle freeing up all the resources
5925  *
5926  * @par         This API is for package-manager client application
5927  * @par Sync (or) Async : Synchronous API
5928  *
5929  * @param[in] handle            pointer to the package cert handle.
5930  * @return      0 if success, error code(<0) if fail
5931  * @retval      PMINFO_R_OK     success
5932  * @retval      PMINFO_R_EINVAL invalid argument
5933  * @retval      PMINFO_R_ERROR  internal error
5934  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5935  * @post                None
5936  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5937  * @code
5938 static int get_cert_info(const char *pkgid)
5939 {
5940         int ret = 0;
5941         pkgmgrinfo_certinfo_h handle;
5942         char *auth_cert = NULL;
5943         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5944         if (ret != PMINFO_R_OK)
5945                 return -1;
5946         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5947         if (ret != PMINFO_R_OK) {
5948                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5949                 return -1;
5950         }
5951         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5952         if (ret != PMINFO_R_OK) {
5953                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5954                 return -1;
5955         }
5956         printf("Author root certificate: %s\n", auth_root);
5957         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5958         return 0;
5959 }
5960  * @endcode
5961  */
5962 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5963
5964 /**
5965  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5966  * @brief       This API deletes the package cert information from DB
5967  *
5968  * @par         This API is for package-manager client application
5969  * @par Sync (or) Async : Synchronous API
5970  *
5971  * @param[in] pkgid             pointer to the package ID.
5972  * @return      0 if success, error code(<0) if fail
5973  * @retval      PMINFO_R_OK     success
5974  * @retval      PMINFO_R_EINVAL invalid argument
5975  * @retval      PMINFO_R_ERROR  internal error
5976  * @pre         None
5977  * @post                None
5978  * @code
5979 static int delete_cert_info(const char *pkgid)
5980 {
5981         int ret = 0;
5982         ret = pkgmgrinfo_delete_certinfo(pkgid);
5983         if (ret != PMINFO_R_OK)
5984                 return -1;
5985         return 0;
5986 }
5987  * @endcode
5988  */
5989 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5990 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5991
5992 /**
5993  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5994  * @brief       This API creates the package cert information handle to set data in db.
5995  *
5996  * @par         This API is for package-manager client application
5997  * @par Sync (or) Async : Synchronous API
5998  *
5999  * @param[out] handle           pointer to the package cert handle.
6000  * @return      0 if success, error code(<0) if fail
6001  * @retval      PMINFO_R_OK     success
6002  * @retval      PMINFO_R_EINVAL invalid argument
6003  * @retval      PMINFO_R_ERROR  internal error
6004  * @pre         None
6005  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6006  * @see         pkgmgrinfo_set_cert_value()
6007  * @see         pkgmgrinfo_save_certinfo()
6008  * @code
6009 static int set_cert_in_db(const char *pkgid)
6010 {
6011         int ret = 0;
6012         pkgmgrinfo_instcertinfo_h handle;
6013         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6014         if (ret != PMINFO_R_OK)
6015                 return -1;
6016         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6017         if (ret != PMINFO_R_OK) {
6018                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6019                 return -1;
6020         }
6021         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6022         if (ret != PMINFO_R_OK) {
6023                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6024                 return -1;
6025         }
6026         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6027         return 0;
6028 }
6029  * @endcode
6030  */
6031 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6032
6033 /**
6034  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6035  * @brief       This API sets the package cert information in the handle.
6036  *
6037  * @par         This API is for package-manager client application
6038  * @par Sync (or) Async : Synchronous API
6039  *
6040  * @param[in] handle            pointer to the package cert handle.
6041  * @param[in] cert_type         certificate type.
6042  * @param[in] cert_value        certificate value.
6043  * @return      0 if success, error code(<0) if fail
6044  * @retval      PMINFO_R_OK     success
6045  * @retval      PMINFO_R_EINVAL invalid argument
6046  * @retval      PMINFO_R_ERROR  internal error
6047  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6048  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6049  * @see         pkgmgrinfo_save_certinfo()
6050  * @code
6051 static int set_cert_in_db(const char *pkgid)
6052 {
6053         int ret = 0;
6054         pkgmgrinfo_instcertinfo_h handle;
6055         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6056         if (ret != PMINFO_R_OK)
6057                 return -1;
6058         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6059         if (ret != PMINFO_R_OK) {
6060                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6061                 return -1;
6062         }
6063         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6064         if (ret != PMINFO_R_OK) {
6065                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6066                 return -1;
6067         }
6068         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6069         return 0;
6070 }
6071  * @endcode
6072  */
6073 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6074
6075 /**
6076  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6077  * @brief       This API saves the package cert information in the DB.
6078  *
6079  * @par         This API is for package-manager client application
6080  * @par Sync (or) Async : Synchronous API
6081  *
6082  * @param[in] pkgid             pointer to the package ID.
6083  * @param[in] handle            pointer to the package cert handle.
6084  * @return      0 if success, error code(<0) if fail
6085  * @retval      PMINFO_R_OK     success
6086  * @retval      PMINFO_R_EINVAL invalid argument
6087  * @retval      PMINFO_R_ERROR  internal error
6088  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6089  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6090  * @see         pkgmgrinfo_save_certinfo()
6091  * @code
6092 static int set_cert_in_db(const char *pkgid)
6093 {
6094         int ret = 0;
6095         pkgmgrinfo_instcertinfo_h handle;
6096         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6097         if (ret != PMINFO_R_OK)
6098                 return -1;
6099         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6100         if (ret != PMINFO_R_OK) {
6101                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6102                 return -1;
6103         }
6104         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6105         if (ret != PMINFO_R_OK) {
6106                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6107                 return -1;
6108         }
6109         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6110         return 0;
6111 }
6112  * @endcode
6113  */
6114 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6115
6116 /**
6117  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6118  * @brief       This API destroys the package cert information handle freeing up all the resources.
6119  *
6120  * @par         This API is for package-manager client application
6121  * @par Sync (or) Async : Synchronous API
6122  *
6123  * @param[in] 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         pkgmgrinfo_create_certinfo_set_handle()
6129  * @post                None
6130  * @see         pkgmgrinfo_save_certinfo()
6131  * @code
6132 static int set_cert_in_db(const char *pkgid)
6133 {
6134         int ret = 0;
6135         pkgmgrinfo_instcertinfo_h handle;
6136         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6137         if (ret != PMINFO_R_OK)
6138                 return -1;
6139         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6140         if (ret != PMINFO_R_OK) {
6141                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6142                 return -1;
6143         }
6144         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6145         if (ret != PMINFO_R_OK) {
6146                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6147                 return -1;
6148         }
6149         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6150         return 0;
6151 }
6152  * @endcode
6153  */
6154 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6155
6156 /**
6157  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6158  * @brief       This API gets the application 'guest mode visibility' value from the DB
6159  *
6160  * @par         This API is for package-manager client application
6161  * @par Sync (or) Async : Synchronous API
6162  *
6163  * @param[in]   handle  pointer to application info handle
6164  * @param[out] status           pointer to hold app guest mode visibility value
6165  * @return      0 if success, error code(<0) if fail
6166  * @retval      PMINFO_R_OK     success
6167  * @retval      PMINFO_R_EINVAL invalid argument
6168  * @retval      PMINFO_R_ERROR  internal error
6169  * @pre         pkgmgrinfo_appinfo_get_appinfo()
6170  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
6171  * @see         pkgmgrinfo_appinfo_get_appid()
6172  * @see         pkgmgrinfo_appinfo_is_multiple()
6173  * @code
6174 static int get_app_guestmode_visibility(const char *appid)
6175 {
6176         int ret = 0;
6177         bool status;
6178         pkgmgrinfo_appinfo_h handle;
6179         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6180         if (ret != PMINFO_R_OK)
6181                 return -1;
6182         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6183         if (ret != PMINFO_R_OK) {
6184                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6185                 return -1;
6186         }
6187         printf("app guest mode visibility: %d\n", status);
6188         pkgmgrinfo_appinfo_destroy_appinfo(handle);
6189         return 0;
6190 }
6191  * @endcode
6192  */
6193 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6194
6195 /**
6196 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6197 * @brief         This API sets the package 'installed_storage' value in db
6198 *
6199 * @par  This API is for package-manager client application
6200 * @par Sync (or) Async : Synchronous API
6201 *
6202 * @param[in] pkgid              pointer to the package ID.
6203 * @param[in] location  package install location
6204 * @param[in] external_pkg_path  image path if pkg has installed at external storage
6205 * @return  0 if success, error code(<0) if fail
6206 * @retval  PMINFO_R_OK success
6207 * @retval  PMINFO_R_EINVAL       invalid argument
6208 * @retval  PMINFO_R_ERROR internal error
6209 * @code
6210 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6211 {
6212         int ret = 0;
6213
6214         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6215         if (ret != PMINFO_R_OK) {
6216                 return -1;
6217         }
6218         return 0;
6219 }
6220 * @endcode
6221 */
6222 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6223 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6224
6225 /* version compare */
6226 int pkgmgrinfo_compare_package_version(const char *current_version,
6227                 const char *target_version, pkgmgrinfo_version_compare_type *res);
6228
6229 /**
6230  * @fn  int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6231                         pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6232                         void *user_data);
6233  * @brief       This API gets the list of dependency of a particular package
6234  *
6235  * @par         This API is for package-manager client application
6236  * @par Sync (or) Async : Synchronous API
6237  * @param[in]   handle          pointer to the package info handle.
6238  * @param[in]   dependency_cb           callback function for list
6239  * @param[in] user_data user data to be passed to callback function
6240  * @return      0 if success, error code(<0) if fail
6241  * @retval      PMINFO_R_OK     success
6242  * @retval      PMINFO_R_EINVAL invalid argument
6243  * @retval      PMINFO_R_ERROR  internal error
6244  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
6245  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
6246  * @code
6247 int dependency_cb(const char *from const char *to, const char *type,
6248                 const char *required_version,void *user_data)
6249 {
6250         printf("this package %s %s", type, to);
6251         if (required_version)
6252                 printf("required version : %s", required_version);
6253         return 0;
6254 }
6255
6256 static int list_dependency(const char *package)
6257 {
6258         int ret = 0;
6259         pkgmgrinfo_pkginfo_h handle;
6260         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6261         if (ret != PMINFO_R_OK)
6262                 return -1;
6263         ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6264         if (ret != PMINFO_R_OK) {
6265                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6266                 return -1;
6267         }
6268         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6269         return 0;
6270 }
6271  * @endcode
6272  */
6273 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6274                 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6275                 void *user_data);
6276
6277 /**
6278  * @fn  int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6279                         pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6280                         void *user_data);
6281  * @brief       This API gets the list of packages which has dependency directly
6282  *              and indirectly of a particular package
6283  *
6284  * @par         This API is for package-manager client application
6285  * @par Sync (or) Async : Synchronous API
6286  * @param[in]   handle          pointer to the package info handle.
6287  * @param[in]   dependency_cb           callback function for list
6288  * @param[in] user_data user data to be passed to callback function
6289  * @return      0 if success, error code(<0) if fail
6290  * @retval      PMINFO_R_OK     success
6291  * @retval      PMINFO_R_EINVAL invalid argument
6292  * @retval      PMINFO_R_ERROR  internal error
6293  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
6294  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
6295  * @code
6296 int dependency_cb(const char *from, const char *to, const char *type,
6297                 const char *required_version,void *user_data)
6298 {
6299         printf("%s %s %s package", from, to, type);
6300         if (required_version)
6301                 printf("required version : %s", required_version);
6302         return 0;
6303 }
6304
6305 static int list_depends_on(const char *package)
6306 {
6307         int ret = 0;
6308         pkgmgrinfo_pkginfo_h handle;
6309         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6310         if (ret != PMINFO_R_OK)
6311                 return -1;
6312         ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6313         if (ret != PMINFO_R_OK) {
6314                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6315                 return -1;
6316         }
6317         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6318         return 0;
6319 }
6320  * @endcode
6321  */
6322 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6323                 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6324                 void *user_data);
6325
6326 /**
6327  * @fn  int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6328                 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6329                 void *user_data)
6330  * @brief       This API gets the list of allowed package for a particular package
6331  *
6332  * @par         This API is for package-manager client application
6333  * @par Sync (or) Async : Synchronous API
6334  * @param[in]   handle                  pointer to the package info handle.
6335  * @param[in]   res_allowed_package_cb  callback function for list
6336  * @param[in]   user_data               user data to be passed to callback function
6337  * @return      0 if success, error code(<0) if fail
6338  * @retval      PMINFO_R_OK     success
6339  * @retval      PMINFO_R_EINVAL invalid argument
6340  * @retval      PMINFO_R_ERROR  internal error
6341  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
6342  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
6343  * @code
6344 int res_allowed_package_cb(const char *allowed_package,
6345                 required_privilege_h handle, void *user_data)
6346 {
6347         printf("allowed package : %s", allowed_package);
6348
6349         return 0;
6350 }
6351
6352 static int list_res_allowed_package(const char *package)
6353 {
6354         int ret = 0;
6355         pkgmgrinfo_pkginfo_h handle;
6356         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6357         if (ret != PMINFO_R_OK)
6358                 return -1;
6359         ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6360         if (ret != PMINFO_R_OK) {
6361                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6362                 return -1;
6363         }
6364         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6365         return 0;
6366 }
6367  * @endcode
6368  */
6369 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6370                 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6371                 void *user_data);
6372
6373 /**
6374  * @fn  int pkgmgrinfo_pkginfo_foreach_required_privilege(
6375                 required_privilege_h handle,
6376                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6377                 void *user_data)
6378  * @brief       This API gets the list of allowed package's required privileges
6379  *
6380  * @par         This API is for package-manager client application
6381  * @par Sync (or) Async : Synchronous API
6382  * @param[in]   handle                  pointer to the required privilege handle.
6383  * @param[in]   privilege_func          callback function for list
6384  * @param[in]   user_data               user data to be passed to callback function
6385  * @return      0 if success, error code(<0) if fail
6386  * @retval      PMINFO_R_OK     success
6387  * @retval      PMINFO_R_EINVAL invalid argument
6388  * @pre         pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6389  * @post        None
6390  * @code
6391 int privilege_func(const char *privilege_name, void *user_data)
6392 {
6393         printf("required privilege : %s", privilege_name);
6394
6395         return 0;
6396 }
6397
6398 int res_allowed_package_cb(const char *allowed_package,
6399                 required_privilege_h handle, void *user_data)
6400 {
6401         int ret = 0;
6402         printf("allowed package : %s", allowed_package);
6403
6404         ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6405         if (ret != PMINFO_R_OK)
6406                 return -1;
6407
6408         return 0;
6409 }
6410
6411 static int list_res_allowed_package(const char *package)
6412 {
6413         int ret = 0;
6414         pkgmgrinfo_pkginfo_h handle;
6415         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6416         if (ret != PMINFO_R_OK)
6417                 return -1;
6418         ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6419         if (ret != PMINFO_R_OK) {
6420                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6421                 return -1;
6422         }
6423         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6424         return 0;
6425 }
6426  * @endcode
6427  */
6428 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6429                 required_privilege_h handle,
6430                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6431                 void *user_data);
6432
6433 /**
6434  * @fn  int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6435  * @brief       This API gets list of installed packages using flag that used for masking package's information
6436  *
6437  * @par         This API is for package-manager client application
6438  * @par Sync (or) Async : Synchronous API
6439  * @param[in]   pkg_list_cb     iteration function for list
6440  * @param[in]   flag    enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6441  * @param[in]   user_data       user data to be passed to callback function
6442  * @return      0 if success, error code(<0) if fail
6443  * @retval      PMINFO_R_OK     success
6444  * @retval      PMINFO_R_EINVAL invalid argument
6445  * @retval      PMINFO_R_ERROR  internal error
6446  * @pre         None
6447  * @post        None
6448  * @see         pkgmgrinfo_pkginfo_get_option
6449  * @code
6450 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6451 {
6452         char *label1 = NULL;
6453         char *label2 = NULL;
6454         label1 = (char *)user_data;
6455         pkgmgrinfo_pkginfo_get_label(handle, &label2);
6456         if (strcmp(label1, label2) == 0)
6457                 return -1;
6458         else
6459                 return 0;
6460 }
6461
6462 static int list_pkgs()
6463 {
6464         int ret = 0;
6465         char *label = "helloworld";
6466         ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6467         if (ret != PMINFO_R_OK)
6468                 return -1;
6469         return 0;
6470 }
6471  * @endcode
6472  */
6473 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6474                 int flag, void *user_data, uid_t uid);
6475 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6476                 int flag, void *user_data);
6477
6478 /**
6479  * @fn  int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6480  * @brief       This API gets list of installed applications from all packages using flag that used for masking application's information
6481  *
6482  * @par         This API is for package-manager client application
6483  * @par Sync (or) Async : Synchronous API
6484  * @param[in]   app_func        iteration function for list
6485  * @param[in]   flag    enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6486  * @param[in]   user_data       user data to be passed to callback function
6487  * @return      0 if success, error code(<0) if fail
6488  * @retval      PMINFO_R_OK     success
6489  * @retval      PMINFO_R_EINVAL invalid argument
6490  * @retval      PMINFO_R_ERROR  internal error
6491  * @pre         None
6492  * @post        None
6493  * @see         pkgmgrinfo_appinfo_get_option
6494  * @code
6495 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6496 {
6497         int ret = 0;
6498         char *label1 = NULL;
6499         char *label2 = NULL;
6500         label1 = (char *)user_data;
6501         ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6502         if (ret != PMINFO_R_OK) {
6503                 printf("pkgmgrinfo_appinfo_get_label fail");
6504                 return -1;
6505         }
6506         if (strcmp(label1, label2) == 0)
6507                 return -1;
6508         else
6509                 return 0;
6510 }
6511
6512 static int list_apps()
6513 {
6514         int ret = 0;
6515         char *label = "helloworld";
6516         ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6517         if (ret != PMINFO_R_OK)
6518                 return -1;
6519         return 0;
6520 }
6521  * @endcode
6522  */
6523 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6524                 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6525                 void *user_data);
6526 int pkgmgrinfo_appinfo_get_installed_list_full(
6527                 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6528
6529 /**
6530  * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6531  * @brief       This API creates the package archive information handle from given path
6532  *
6533  * @par         This API is for package-manager client application
6534  * @par Sync (or) Async : Synchronous API
6535  *
6536  * @param[in]   path    path of package archive
6537  * @param[out]  handle  pointer to the package archive info handle
6538  * @return      0 if success, error code(<0) if fail
6539  * @retval      PMINFO_R_OK     success
6540  * @retval      PMINFO_R_EINVAL invalid argument
6541  * @retval      PMINFO_R_ERROR  internal error
6542  * @pre         None
6543  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6544  * @code
6545 static int get_pkg_archive_type(const char *path)
6546 {
6547         int ret = 0;
6548         char *type = NULL;
6549         pkgmgrinfo_archiveinfo_h handle;
6550         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6551         if (ret != PMINFO_R_OK)
6552                 return -1;
6553         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6554         if (ret != PMINFO_R_OK) {
6555                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6556                 return -1;
6557         }
6558         printf("pkg archive type: %s\n", type);
6559         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6560         return 0;
6561 }
6562  * @endcode
6563  */
6564 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6565                 pkgmgrinfo_archiveinfo_h *handle);
6566
6567 /**
6568  * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6569  * @brief       This API destroys the package archive information handle freeing up all the resources
6570  *
6571  * @par         This API is for package-manager client application
6572  * @par Sync (or) Async : Synchronous API
6573  *
6574  * @param[in]   handle  pointer to the package archive info handle
6575  * @return      0 if success, error code(<0) if fail
6576  * @retval      PMINFO_R_OK     success
6577  * @retval      PMINFO_R_EINVAL invalid argument
6578  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6579  * @post        None
6580  * @code
6581 static int get_pkg_archive_type(const char *path)
6582 {
6583         int ret = 0;
6584         char *type = NULL;
6585         pkgmgrinfo_archiveinfo_h handle;
6586         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6587         if (ret != PMINFO_R_OK)
6588                 return -1;
6589         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6590         if (ret != PMINFO_R_OK) {
6591                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6592                 return -1;
6593         }
6594         printf("pkg archive type: %s\n", type);
6595         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6596         return 0;
6597 }
6598  * @endcode
6599  */
6600 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6601
6602 /**
6603  * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6604  * @brief       This API gets the package id from the package archive info handle
6605  *
6606  * @par         This API is for package-manager client application
6607  * @par Sync (or) Async : Synchronous API
6608  *
6609  * @param[in]   handle  pointer to package archive info handle
6610  * @param[out]  pkgid   pointer to hold package id
6611  * @return      0 if success, error code(<0) if fail
6612  * @retval      PMINFO_R_OK     success
6613  * @retval      PMINFO_R_EINVAL invalid argument
6614  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6615  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6616  * @code
6617 static int get_pkg_archive_id(const char *path)
6618 {
6619         int ret = 0;
6620         char *pkg_id = NULL;
6621         pkgmgrinfo_archiveinfo_h handle;
6622         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6623         if (ret != PMINFO_R_OK)
6624                 return -1;
6625         ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6626         if (ret != PMINFO_R_OK) {
6627                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6628                 return -1;
6629         }
6630         printf("pkg archive id: %s\n", pkg_id);
6631         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6632         return 0;
6633 }
6634  * @endcode
6635  */
6636 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6637                 const char **pkgid);
6638
6639 /**
6640  * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6641  * @brief       This API gets the package type from the package archive info handle
6642  *
6643  * @par         This API is for package-manager client application
6644  * @par Sync (or) Async : Synchronous API
6645  *
6646  * @param[in]   handle  pointer to package archive info handle
6647  * @param[out]  type    pointer to hold package type
6648  * @return      0 if success, error code(<0) if fail
6649  * @retval      PMINFO_R_OK     success
6650  * @retval      PMINFO_R_EINVAL invalid argument
6651  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6652  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6653  * @code
6654 static int get_pkg_archive_type(const char *path)
6655 {
6656         int ret = 0;
6657         char *type = NULL;
6658         pkgmgrinfo_archiveinfo_h handle;
6659         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6660         if (ret != PMINFO_R_OK)
6661                 return -1;
6662         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6663         if (ret != PMINFO_R_OK) {
6664                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6665                 return -1;
6666         }
6667         printf("pkg archive type: %s\n", type);
6668         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6669         return 0;
6670 }
6671  * @endcode
6672  */
6673 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6674                 const char **type);
6675
6676 /**
6677  * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6678  * @brief       This API gets the package version from the package archive info handle
6679  *
6680  * @par         This API is for package-manager client application
6681  * @par Sync (or) Async : Synchronous API
6682  *
6683  * @param[in]   handle  pointer to package archive info handle
6684  * @param[out]  version pointer to hold package version
6685  * @return      0 if success, error code(<0) if fail
6686  * @retval      PMINFO_R_OK     success
6687  * @retval      PMINFO_R_EINVAL invalid argument
6688  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6689  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6690  * @code
6691 static int get_pkg_archive_version(const char *path)
6692 {
6693         int ret = 0;
6694         char *version = NULL;
6695         pkgmgrinfo_archiveinfo_h handle;
6696         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6697         if (ret != PMINFO_R_OK)
6698                 return -1;
6699         ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6700         if (ret != PMINFO_R_OK) {
6701                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6702                 return -1;
6703         }
6704         printf("pkg archive version: %s\n", version);
6705         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6706         return 0;
6707 }
6708  * @endcode
6709  */
6710 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6711                 const char **version);
6712
6713 /**
6714  * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6715  * @brief       This API gets the package api version from the package archive info handle
6716  *
6717  * @par         This API is for package-manager client application
6718  * @par Sync (or) Async : Synchronous API
6719  *
6720  * @param[in]   handle  pointer to package archive info handle
6721  * @param[out]  api_version     pointer to hold package api_version
6722  * @return      0 if success, error code(<0) if fail
6723  * @retval      PMINFO_R_OK     success
6724  * @retval      PMINFO_R_EINVAL invalid argument
6725  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6726  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6727  * @code
6728 static int get_pkg_archive_api_version(const char *path)
6729 {
6730         int ret = 0;
6731         char *api_version = NULL;
6732         pkgmgrinfo_archiveinfo_h handle;
6733         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6734         if (ret != PMINFO_R_OK)
6735                 return -1;
6736         ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6737         if (ret != PMINFO_R_OK) {
6738                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6739                 return -1;
6740         }
6741         printf("pkg archive api_version: %s\n", api_version);
6742         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6743         return 0;
6744 }
6745  * @endcode
6746  */
6747 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6748                 const char **api_version);
6749
6750 /**
6751  * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
6752  * @brief       This API gets the package description from the package archive info handle
6753  *
6754  * @par         This API is for package-manager client application
6755  * @par Sync (or) Async : Synchronous API
6756  *
6757  * @param[in]   handle  pointer to package archive info handle
6758  * @param[out]  description     pointer to hold package description
6759  * @return      0 if success, error code(<0) if fail
6760  * @retval      PMINFO_R_OK     success
6761  * @retval      PMINFO_R_EINVAL invalid argument
6762  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6763  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6764  * @code
6765 static int get_pkg_archive_description(const char *path)
6766 {
6767         int ret = 0;
6768         char *description = NULL;
6769         pkgmgrinfo_archiveinfo_h handle;
6770         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6771         if (ret != PMINFO_R_OK)
6772                 return -1;
6773         ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
6774         if (ret != PMINFO_R_OK) {
6775                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6776                 return -1;
6777         }
6778         printf("pkg archive description: %s\n", description);
6779         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6780         return 0;
6781 }
6782  * @endcode
6783  */
6784 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6785                 const char **description);
6786
6787 /**
6788  * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
6789  * @brief       This API gets the package label from the package archive info handle
6790  *
6791  * @par         This API is for package-manager client application
6792  * @par Sync (or) Async : Synchronous API
6793  *
6794  * @param[in]   handle  pointer to package archive info handle
6795  * @param[out]  label   pointer to hold package label
6796  * @return      0 if success, error code(<0) if fail
6797  * @retval      PMINFO_R_OK     success
6798  * @retval      PMINFO_R_EINVAL invalid argument
6799  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6800  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6801  * @code
6802 static int get_pkg_archive_label(const char *path)
6803 {
6804         int ret = 0;
6805         char *label = NULL;
6806         pkgmgrinfo_archiveinfo_h handle;
6807         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6808         if (ret != PMINFO_R_OK)
6809                 return -1;
6810         ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
6811         if (ret != PMINFO_R_OK) {
6812                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6813                 return -1;
6814         }
6815         printf("pkg archive label: %s\n", label);
6816         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6817         return 0;
6818 }
6819  * @endcode
6820  */
6821 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6822                 const char **label);
6823
6824 /**
6825  * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
6826  * @brief       This API gets the package author from the package archive info handle
6827  *
6828  * @par         This API is for package-manager client application
6829  * @par Sync (or) Async : Synchronous API
6830  *
6831  * @param[in]   handle  pointer to package archive info handle
6832  * @param[out]  author  pointer to hold package author
6833  * @return      0 if success, error code(<0) if fail
6834  * @retval      PMINFO_R_OK     success
6835  * @retval      PMINFO_R_EINVAL invalid argument
6836  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6837  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6838  * @code
6839 static int get_pkg_archive_author(const char *path)
6840 {
6841         int ret = 0;
6842         char *author = NULL;
6843         pkgmgrinfo_archiveinfo_h handle;
6844         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6845         if (ret != PMINFO_R_OK)
6846                 return -1;
6847         ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
6848         if (ret != PMINFO_R_OK) {
6849                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6850                 return -1;
6851         }
6852         printf("pkg archive author: %s\n", author);
6853         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6854         return 0;
6855 }
6856  * @endcode
6857  */
6858 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6859                 const char **author);
6860
6861 /**
6862  * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
6863  * @brief       This API gets the package icon and size from the package archive info handle
6864  *
6865  * @par         This API is for package-manager client application
6866  * @par Sync (or) Async : Synchronous API
6867  *
6868  * @param[in]   handle  pointer to package archive info handle
6869  * @param[out]  icon    pointer to hold package icon
6870  * @param[out]  size    pointer to hold size of package icon
6871  * @return      0 if success, error code(<0) if fail
6872  * @retval      PMINFO_R_OK     success
6873  * @retval      PMINFO_R_EINVAL invalid argument
6874  * @retval      PMINFO_R_ENOENT no result
6875  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6876  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6877  * @code
6878 static int get_pkg_archive_icon(const char *path)
6879 {
6880         int ret = 0;
6881         unsigned char *icon = NULL;
6882         size_t icon_size = 0;
6883         pkgmgrinfo_archiveinfo_h handle;
6884         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6885         if (ret != PMINFO_R_OK)
6886                 return -1;
6887         ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
6888         if (ret != PMINFO_R_OK) {
6889                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6890                 return -1;
6891         }
6892         printf("pkg archive icon size : %zu\n", icon_size);
6893         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6894         return 0;
6895 }
6896  * @endcode
6897  */
6898 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6899                 const unsigned char **icon, size_t *size);
6900
6901 /**
6902  * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
6903  * @brief       This API retrieve the dependency information and invoke given callback for it.
6904  *
6905  * @par         This API is for package-manager client application
6906  * @par Sync (or) Async : Synchronous API
6907  *
6908  * @param[in]   handle  pointer to package archive info handle
6909  * @param[in]   callback        callback to be invoked for each retrieved dependency information
6910  * @param[in]   user_data       user data to be passed to callback
6911  * @return      0 if success, error code(<0) if fail
6912  * @retval      PMINFO_R_OK     success
6913  * @retval      PMINFO_R_EINVAL invalid argument
6914  * @retval      PMINFO_R_ERROR  internal error
6915  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6916  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6917  * @code
6918 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
6919 {
6920         int ret = 0;
6921         size_t icon_size = 0;
6922         pkgmgrinfo_archiveinfo_h handle;
6923         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6924         if (ret != PMINFO_R_OK)
6925                 return -1;
6926         ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
6927         if (ret != PMINFO_R_OK) {
6928                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6929                 return -1;
6930         }
6931         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6932         return 0;
6933 }
6934  * @endcode
6935  */
6936 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
6937                 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
6938
6939 /**
6940  * @pkgmgrinfo client API end
6941 **/
6942
6943
6944 /** @} */
6945 #ifdef __cplusplus
6946 }
6947 #endif
6948 #endif                          /* __PKG_INFO_H__ */
6949 /**
6950  * @}
6951  * @}
6952  */
6953