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