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