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