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