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