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