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