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