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