Implement remote appcontrol feature
[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 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4374                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4375
4376 /**
4377  * @brief
4378  */
4379 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4380                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4381
4382 /**
4383  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4384                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4385  * @brief       This API gets the list of splashscreen for a particular application
4386  *
4387  * @par         This API is for package-manager client application
4388  * @par Sync (or) Async : Synchronous API
4389  * @param[in]   handle          pointer to the application info handle.
4390  * @param[in]   splash_screen_func              callback function for list
4391  * @param[in]   user_data       user data to be passed to callback function
4392  * @return      0 if success, error code(<0) if fail
4393  * @retval      PMINFO_R_OK     success
4394  * @retval      PMINFO_R_EINVAL invalid argument
4395  * @retval      PMINFO_R_ERROR  internal error
4396  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4397  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4398  * @code
4399  */
4400 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4401                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4402
4403 /**
4404  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4405  * @brief       This API gets the application 'nodisplay' value from the app ID
4406  *
4407  * @par         This API is for package-manager client application
4408  * @par Sync (or) Async : Synchronous API
4409  *
4410  * @param[in]   handle  pointer to application info handle
4411  * @param[out] nodisplay                pointer to hold package nodisplay value
4412  * @return      0 if success, error code(<0) if fail
4413  * @retval      PMINFO_R_OK     success
4414  * @retval      PMINFO_R_EINVAL invalid argument
4415  * @retval      PMINFO_R_ERROR  internal error
4416  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4417  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4418  * @see         pkgmgrinfo_appinfo_get_appid()
4419  * @see         pkgmgrinfo_appinfo_is_multiple()
4420  * @code
4421 static int get_app_nodisplay(const char *appid)
4422 {
4423         int ret = 0;
4424         bool nodisplay;
4425         pkgmgrinfo_appinfo_h handle;
4426         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4427         if (ret != PMINFO_R_OK)
4428                 return -1;
4429         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4430         if (ret != PMINFO_R_OK) {
4431                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4432                 return -1;
4433         }
4434         printf("app nodisplay: %d\n", nodisplay);
4435         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4436         return 0;
4437 }
4438  * @endcode
4439  */
4440 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
4441
4442 /**
4443  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4444  * @brief       This API gets the application 'multiple' value from the app ID
4445  *
4446  * @par         This API is for package-manager client application
4447  * @par Sync (or) Async : Synchronous API
4448  *
4449  * @param[in]   handle  pointer to application info handle
4450  * @param[out] multiple         pointer to hold package multiple value
4451  * @return      0 if success, error code(<0) if fail
4452  * @retval      PMINFO_R_OK     success
4453  * @retval      PMINFO_R_EINVAL invalid argument
4454  * @retval      PMINFO_R_ERROR  internal error
4455  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4456  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4457  * @see         pkgmgrinfo_appinfo_get_appid()
4458  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4459  * @code
4460 static int get_app_multiple(const char *appid)
4461 {
4462         int ret = 0;
4463         bool multiple;
4464         pkgmgrinfo_appinfo_h handle;
4465         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4466         if (ret != PMINFO_R_OK)
4467                 return -1;
4468         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4469         if (ret != PMINFO_R_OK) {
4470                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4471                 return -1;
4472         }
4473         printf("app multiple: %d\n", multiple);
4474         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4475         return 0;
4476 }
4477  * @endcode
4478  */
4479 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
4480
4481 /**
4482  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4483  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4484  *              application launching effect. If fales, indicator will be hidden during application launching effect
4485  *
4486  * @par         This API is for package-manager client application
4487  * @par Sync (or) Async : Synchronous API
4488  *
4489  * @param[in]   handle  pointer to application info handle
4490  * @param[out]  indicator_disp contains indicator display status for application launching effect
4491  * @return      0 if success, error code(<0) if fail
4492  * @retval      PMINFO_R_OK     success
4493  * @retval      PMINFO_R_EINVAL invalid argument
4494  * @retval      PMINFO_R_ERROR  internal error
4495  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4496  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4497  * @see         pkgmgrinfo_appinfo_get_appid()
4498  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4499  * @code
4500 static int get_app_indicator_display(const char *appid)
4501 {
4502         int ret = 0;
4503         bool indicator_disp;
4504         pkgmgrinfo_appinfo_h handle;
4505         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4506         if (ret != PMINFO_R_OK)
4507                 return -1;
4508         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4509         if (ret != PMINFO_R_OK){
4510                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4511                 return -1;
4512         }
4513         printf("app indicator disp : %d\n", indicator_disp);
4514         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4515         return 0;
4516 }
4517  * @endcode
4518  */
4519 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4520
4521 /**
4522  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4523  * @brief       This API gets the application 'taskmanage' value from the app ID
4524  *
4525  * @par         This API is for package-manager client application
4526  * @par Sync (or) Async : Synchronous API
4527  *
4528  * @param[in]   handle  pointer to application info handle
4529  * @param[out] taskmanage               pointer to hold package taskmanage value
4530  * @return      0 if success, error code(<0) if fail
4531  * @retval      PMINFO_R_OK     success
4532  * @retval      PMINFO_R_EINVAL invalid argument
4533  * @retval      PMINFO_R_ERROR  internal error
4534  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4535  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4536  * @see         pkgmgrinfo_appinfo_get_appid()
4537  * @see         pkgmgrinfo_appinfo_is_multiple()
4538  * @code
4539 static int get_app_taskmanage(const char *appid)
4540 {
4541         int ret = 0;
4542         bool taskmanage;
4543         pkgmgrinfo_appinfo_h handle;
4544         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4545         if (ret != PMINFO_R_OK)
4546                 return -1;
4547         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4548         if (ret != PMINFO_R_OK) {
4549                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4550                 return -1;
4551         }
4552         printf("app taskmanage: %d\n", taskmanage);
4553         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4554         return 0;
4555 }
4556  * @endcode
4557  */
4558 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
4559
4560 /**
4561  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4562  * @brief       This API gets the application 'taskmanage' value from the app ID
4563  *
4564  * @par         This API is for package-manager client application
4565  * @par Sync (or) Async : Synchronous API
4566  *
4567  * @param[in]   handle  pointer to application info handle
4568  * @param[out] enabled          pointer to hold package enabled value
4569  * @return      0 if success, error code(<0) if fail
4570  * @retval      PMINFO_R_OK     success
4571  * @retval      PMINFO_R_EINVAL invalid argument
4572  * @retval      PMINFO_R_ERROR  internal error
4573  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4574  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4575  * @see         pkgmgrinfo_appinfo_get_appid()
4576  * @see         pkgmgrinfo_appinfo_is_multiple()
4577  * @code
4578 static int get_app_enabled(const char *appid)
4579 {
4580         int ret = 0;
4581         bool enabled;
4582         pkgmgrinfo_appinfo_h handle;
4583         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4584         if (ret != PMINFO_R_OK)
4585                 return -1;
4586         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4587         if (ret != PMINFO_R_OK) {
4588                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4589                 return -1;
4590         }
4591         printf("app enabled: %d\n", enabled);
4592         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4593         return 0;
4594 }
4595  * @endcode
4596  */
4597 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
4598
4599 /**
4600  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4601  * @brief       This API gets the application 'onboot' value from the app ID
4602  *
4603  * @par         This API is for package-manager client application
4604  * @par Sync (or) Async : Synchronous API
4605  *
4606  * @param[in]   handle  pointer to application info handle
4607  * @param[out] onboot           pointer to hold package onboot value
4608  * @return      0 if success, error code(<0) if fail
4609  * @retval      PMINFO_R_OK     success
4610  * @retval      PMINFO_R_EINVAL invalid argument
4611  * @retval      PMINFO_R_ERROR  internal error
4612  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4613  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4614  * @see         pkgmgrinfo_appinfo_get_appid()
4615  * @see         pkgmgrinfo_appinfo_is_multiple()
4616  * @code
4617 static int get_app_onboot(const char *appid)
4618 {
4619         int ret = 0;
4620         bool onboot;
4621         pkgmgrinfo_appinfo_h handle;
4622         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4623         if (ret != PMINFO_R_OK)
4624                 return -1;
4625         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4626         if (ret != PMINFO_R_OK) {
4627                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4628                 return -1;
4629         }
4630         printf("app onboot: %d\n", onboot);
4631         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4632         return 0;
4633 }
4634  * @endcode
4635  */
4636 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
4637
4638 /**
4639  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4640  * @brief       This API gets the application 'autorestart' value from the app ID
4641  *
4642  * @par         This API is for package-manager client application
4643  * @par Sync (or) Async : Synchronous API
4644  *
4645  * @param[in]   handle  pointer to application info handle
4646  * @param[out] autorestart              pointer to hold package autorestart value
4647  * @return      0 if success, error code(<0) if fail
4648  * @retval      PMINFO_R_OK     success
4649  * @retval      PMINFO_R_EINVAL invalid argument
4650  * @retval      PMINFO_R_ERROR  internal error
4651  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4652  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4653  * @see         pkgmgrinfo_appinfo_get_appid()
4654  * @see         pkgmgrinfo_appinfo_is_multiple()
4655  * @code
4656 static int get_app_autorestart(const char *appid)
4657 {
4658         int ret = 0;
4659         bool autorestart;
4660         pkgmgrinfo_appinfo_h handle;
4661         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4662         if (ret != PMINFO_R_OK)
4663                 return -1;
4664         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4665         if (ret != PMINFO_R_OK) {
4666                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4667                 return -1;
4668         }
4669         printf("app autorestart: %d\n", autorestart);
4670         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4671         return 0;
4672 }
4673  * @endcode
4674  */
4675 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4676
4677 /**
4678  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4679  * @brief       This API gets the value for given application is main app or not from handle
4680  *
4681  * @par         This API is for package-manager client application
4682  * @par Sync (or) Async : Synchronous API
4683  *
4684  * @param[in]   handle  pointer to application info handle
4685  * @param[out] mainapp          pointer to hold package mainapp is or not
4686  * @return      0 if success, error code(<0) if fail
4687  * @retval      PMINFO_R_OK     success
4688  * @retval      PMINFO_R_EINVAL invalid argument
4689  * @retval      PMINFO_R_ERROR  internal error
4690  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4691  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4692  * @see         pkgmgrinfo_appinfo_get_appid()
4693  * @see         pkgmgrinfo_appinfo_is_multiple()
4694  * @code
4695 static int get_app_mainapp(const char *appid)
4696 {
4697         int ret = 0;
4698         bool mainapp;
4699         pkgmgrinfo_appinfo_h handle;
4700         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4701         if (ret != PMINFO_R_OK)
4702                 return -1;
4703         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4704         if (ret != PMINFO_R_OK) {
4705                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4706                 return -1;
4707         }
4708         printf("mainapp: %d\n", mainapp);
4709         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4710         return 0;
4711 }
4712  * @endcode
4713  */
4714 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4715
4716
4717 /**
4718  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4719  * @brief       This API gets the value for given application is preload or not from handle
4720  *
4721  * @par         This API is for package-manager client application
4722  * @par Sync (or) Async : Synchronous API
4723  *
4724  * @param[in]   handle  pointer to application info handle
4725  * @param[out] preload          pointer to hold preload is or not
4726  * @return      0 if success, error code(<0) if fail
4727  * @retval      PMINFO_R_OK     success
4728  * @retval      PMINFO_R_EINVAL invalid argument
4729  * @retval      PMINFO_R_ERROR  internal error
4730  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4731  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4732  * @see         pkgmgrinfo_appinfo_get_appid()
4733  * @see         pkgmgrinfo_appinfo_is_multiple()
4734  * @code
4735 static int get_app_preload(const char *appid)
4736 {
4737         int ret = 0;
4738         bool preload = 0;
4739         pkgmgrinfo_appinfo_h handle = NULL;
4740         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4741         if (ret != PMINFO_R_OK)
4742                 return -1;
4743         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4744         if (ret != PMINFO_R_OK) {
4745                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4746                 return -1;
4747         }
4748         printf("preload: %d\n", preload);
4749         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4750         return 0;
4751 }
4752  * @endcode
4753  */
4754 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4755
4756 /**
4757  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4758  * @brief       This API gets the value for given application is submode or not from handle
4759  *
4760  * @par         This API is for package-manager client application
4761  * @par Sync (or) Async : Synchronous API
4762  *
4763  * @param[in]   handle  pointer to application info handle
4764  * @param[out] submode          pointer to hold submode is or not
4765  * @return      0 if success, error code(<0) if fail
4766  * @retval      PMINFO_R_OK     success
4767  * @retval      PMINFO_R_EINVAL invalid argument
4768  * @retval      PMINFO_R_ERROR  internal error
4769  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4770  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4771  * @see         pkgmgrinfo_appinfo_get_appid()
4772  * @see         pkgmgrinfo_appinfo_is_multiple()
4773  * @code
4774 static int get_app_submode(const char *appid)
4775 {
4776         int ret = 0;
4777         bool submode = 0;
4778         pkgmgrinfo_appinfo_h handle = NULL;
4779         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4780         if (ret != PMINFO_R_OK)
4781                 return -1;
4782         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4783         if (ret != PMINFO_R_OK) {
4784                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4785                 return -1;
4786         }
4787         printf("submode: %d\n", submode);
4788         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4789         return 0;
4790 }
4791  * @endcode
4792  */
4793 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4794
4795 /**
4796  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4797  * @brief       This API gets the value for given application is process_pool or not from handle
4798  *
4799  * @par         This API is for package-manager client application
4800  * @par Sync (or) Async : Synchronous API
4801  *
4802  * @param[in]   handle  pointer to application info handle
4803  * @param[out] process_pool             pointer to hold process_pool is or not
4804  * @return      0 if success, error code(<0) if fail
4805  * @retval      PMINFO_R_OK     success
4806  * @retval      PMINFO_R_EINVAL invalid argument
4807  * @retval      PMINFO_R_ERROR  internal error
4808  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4809  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4810  * @see         pkgmgrinfo_appinfo_get_appid()
4811  * @code
4812 static int get_app_process_pool(const char *appid)
4813 {
4814         int ret = 0;
4815         bool process_pool = 0;
4816         pkgmgrinfo_appinfo_h handle = NULL;
4817         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4818         if (ret != PMINFO_R_OK)
4819                 return -1;
4820         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4821         if (ret != PMINFO_R_OK) {
4822                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4823                 return -1;
4824         }
4825         printf("process_pool: %d\n", process_pool);
4826         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4827         return 0;
4828 }
4829  * @endcode
4830  */
4831 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4832
4833 /**
4834  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4835  * @brief       This API gets the installed storage location of the application
4836  *
4837  * @par This API is for package-manager client application
4838  * @par Sync (or) Async : Synchronous API
4839  *
4840  * @param[in] handle            pointer to the application info handle.
4841  * @param[out] app_type         pointer to hold installed storage location
4842  * @return      0 if success, error code(<0) if fail
4843  * @retval      PMINFO_R_OK success
4844  * @retval      PMINFO_R_EINVAL invalid argument
4845  * @retval      PMINFO_R_ERROR  internal error
4846  * @pre pkgmgrinfo_appinfo_get_appinfo()
4847  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4848  * @see pkgmgrinfo_appinfo_get_appid()
4849  * @code
4850 static int get_app_installed_location(const char *appid)
4851 {
4852         int ret = 0;
4853         pkgmgrinfo_installed_storage storage;
4854         pkgmgrinfo_appinfo_h handle = NULL;
4855         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4856         if (ret != PMINFO_R_OK)
4857                 return -1;
4858         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4859         if (ret != PMINFO_R_OK) {
4860                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4861                 return -1;
4862         }
4863         printf("Installed storage location : %d\n", storage);
4864         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4865         return 0;
4866 }
4867  * @endcode
4868  */
4869 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4870
4871
4872 /**
4873  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4874  * @brief       This API checks if the application has the given category
4875  *
4876  * @par         This API is for package-manager client application
4877  * @par Sync (or) Async : Synchronous API
4878  *
4879  * @param[in]   handle  pointer to the application info handle
4880  * @param[in]   category        category
4881  * @param[out] exist            value Gets whether the application has the given category
4882  * @return      0 if success, error code(<0) if fail
4883  * @retval      PMINFO_R_OK     success
4884  * @retval      PMINFO_R_EINVAL invalid argument
4885  * @retval      PMINFO_R_ERROR  internal error
4886  * @code
4887 static int is_category_exist(const char *appid, const char *category)
4888 {
4889         int ret = 0;
4890         pkgmgrinfo_appinfo_h handle;
4891         bool exist = false;
4892
4893         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4894         if (ret != PMINFO_R_OK)
4895                 return -1;
4896
4897         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4898         if (ret != PMINFO_R_OK) {
4899                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4900                 return -1;
4901         }
4902
4903         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4904         return 0;
4905 }
4906  * @endcode
4907  */
4908 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4909
4910 /**
4911  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4912  * @brief       This API gets the application 'ui_gadget' value from the app ID
4913  *
4914  * @par         This API is for package-manager client application
4915  * @par Sync (or) Async : Synchronous API
4916  *
4917  * @param[in]   handle  pointer to application info handle
4918  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4919  * @return      0 if success, error code(<0) if fail
4920  * @retval      PMINFO_R_OK     success
4921  * @retval      PMINFO_R_EINVAL invalid argument
4922  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4923  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4924  * @code
4925 static int get_app_ui_gadget(const char *appid)
4926 {
4927         int ret = 0;
4928         bool ui_gadget;
4929         pkgmgrinfo_appinfo_h handle = NULL;
4930         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4931         if (ret != PMINFO_R_OK)
4932                 return -1;
4933         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4934         if (ret != PMINFO_R_OK) {
4935                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4936                 return -1;
4937         }
4938         printf("app ui_gadget: %d\n", ui_gadget);
4939         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4940         return 0;
4941 }
4942  * @endcode
4943  */
4944 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4945
4946 /**
4947  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4948  * @brief       This API gets the application 'support_disable' value from the app ID
4949  *
4950  * @par         This API is for package-manager client application
4951  * @par Sync (or) Async : Synchronous API
4952  *
4953  * @param[in]   handle  pointer to application info handle
4954  * @param[out]  support_disable pointer to hold package support_disable value
4955  * @return      0 if success, error code(<0) if fail
4956  * @retval      PMINFO_R_OK     success
4957  * @retval      PMINFO_R_EINVAL invalid argument
4958  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4959  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4960  * @code
4961 static int get_app_support_disable(const char *appid)
4962 {
4963         int ret = 0;
4964         bool support_disable;
4965         pkgmgrinfo_appinfo_h handle = NULL;
4966         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4967         if (ret != PMINFO_R_OK)
4968                 return -1;
4969         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4970         if (ret != PMINFO_R_OK) {
4971                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4972                 return -1;
4973         }
4974         printf("app support_disable: %d\n", support_disable);
4975         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4976         return 0;
4977 }
4978  * @endcode
4979  */
4980 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4981
4982 /**
4983  * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4984  * @brief       This API gets the application 'removable' value from the app ID
4985  *
4986  * @par         This API is for package-manager client application
4987  * @par Sync (or) Async : Synchronous API
4988  *
4989  * @param[in]   handle  pointer to application info handle
4990  * @param[out]  removable       pointer to hold package removable value
4991  * @return      0 if success, error code(<0) if fail
4992  * @retval      PMINFO_R_OK     success
4993  * @retval      PMINFO_R_EINVAL invalid argument
4994  * @retval      PMINFO_R_ERROR  internal error
4995  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4996  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4997  * @see         pkgmgrinfo_appinfo_get_appid()
4998  * @code
4999 static int get_app_removable(const char *appid)
5000 {
5001         int ret = 0;
5002         bool removable;
5003         pkgmgrinfo_appinfo_h handle = NULL;
5004         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5005         if (ret != PMINFO_R_OK)
5006                 return -1;
5007         ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5008         if (ret != PMINFO_R_OK) {
5009                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5010                 return -1;
5011         }
5012         printf("app removable: %d\n", removable);
5013         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5014         return 0;
5015 }
5016  * @endcode
5017  */
5018 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5019
5020 /**
5021  * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5022  * @brief       This API gets the application 'system' value from the app ID
5023  *
5024  * @par         This API is for package-manager client application
5025  * @par Sync (or) Async : Synchronous API
5026  *
5027  * @param[in]   handle  pointer to application info handle
5028  * @param[out]  system  pointer to hold package system value
5029  * @return      0 if success, error code(<0) if fail
5030  * @retval      PMINFO_R_OK     success
5031  * @retval      PMINFO_R_EINVAL invalid argument
5032  * @retval      PMINFO_R_ERROR  internal error
5033  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5034  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5035  * @see         pkgmgrinfo_appinfo_get_appid()
5036  * @code
5037 static int get_app_system(const char *appid)
5038 {
5039         int ret = 0;
5040         bool system = false;
5041         pkgmgrinfo_appinfo_h handle = NULL;
5042         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5043         if (ret != PMINFO_R_OK)
5044                 return -1;
5045         ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5046         if (ret != PMINFO_R_OK) {
5047                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5048                 return -1;
5049         }
5050         printf("app system: %d\n", system);
5051         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5052         return 0;
5053 }
5054  * @endcode
5055  */
5056 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5057
5058
5059 /**
5060  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5061  * @brief       This API gets the application 'is_disable' value from the app ID
5062  *
5063  * @par         This API is for package-manager client application
5064  * @par Sync (or) Async : Synchronous API
5065  *
5066  * @param[in]   handle  pointer to application info handle
5067  * @param[out]  disabled        pointer to hold application is_disabled value
5068  * @return      0 if success, error code(<0) if fail
5069  * @retval      PMINFO_R_OK     success
5070  * @retval      PMINFO_R_EINVAL invalid argument
5071  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5072  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
5073  * @code
5074 static int get_app_is_disable(const char *appid)
5075 {
5076         int ret = 0;
5077         bool is_disable;
5078         pkgmgrinfo_appinfo_h handle = NULL;
5079         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5080         if (ret != PMINFO_R_OK)
5081                 return -1;
5082         ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5083         if (ret != PMINFO_R_OK) {
5084                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5085                 return -1;
5086         }
5087         printf("app is_disable: %d\n", is_disable);
5088         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5089         return 0;
5090 }
5091  * @endcode
5092  */
5093 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5094
5095 /**
5096  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5097  * @brief       This API gets whethere the given application is global application or user application
5098  *
5099  * @par         This API is for package-manager client application
5100  * @par Sync (or) Async : Synchronous API
5101  *
5102  * @param[in]   handle  pointer to application info handle
5103  * @param[in]   global  pointer to hold application global value
5104  * @return      0 if success, error code(<0) if fail
5105  * @retval      PMINFO_R_OK     success
5106  * @retval      PMINFO_R_EINVAL invalid argument
5107  * @retval      PMINFO_R_ERROR  internal error
5108  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5109  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5110  * @see         pkgmgrinfo_appinfo_get_appid()
5111  static int get_app_is_global(const char *appid)
5112  {
5113          int ret = 0;
5114          bool global;
5115          pkgmgrinfo_appinfo_h handle = NULL;
5116          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5117          if (ret != PMINFO_R_OK)
5118                  return -1;
5119          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5120          if (ret != PMINFO_R_OK) {
5121                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
5122                  return -1;
5123          }
5124          printf("app is_global: %d\n", global);
5125          pkgmgrinfo_appinfo_destroy_appinfo(handle);
5126          return 0;
5127  }
5128   * @endcode
5129   */
5130 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5131
5132 /**
5133  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5134  * @brief       This API gets the application 'splash_screen_display' value from the app ID
5135  *
5136  * @par         This API is for package-manager client application
5137  * @par Sync (or) Async : Synchronous API
5138  *
5139  * @param[in]   handle          pointer to application info handle
5140  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
5141  * @return      0 if success, error code(<0) if fail
5142  * @retval      PMINFO_R_OK     success
5143  * @retval      PMINFO_R_EINVAL invalid argument
5144  * @retval      PMINFO_R_ERROR  internal error
5145  */
5146 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5147
5148 /**
5149  * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5150  * @brief       This API gets the application 'setup_appid' value from the app ID
5151  *
5152  * @par         This API is for package-manager client application
5153  * @par Sync (or) Async : Synchronous API
5154  *
5155  * @param[in]   handle          pointer to application info handle
5156  * @param[out]  setup_appid     pointer to hold package setup_appid value
5157  * @return      0 if success, error code(<0) if fail
5158  * @retval      PMINFO_R_OK     success
5159  * @retval      PMINFO_R_EINVAL invalid argument
5160  * @retval      PMINFO_R_ERROR  internal error
5161  */
5162 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5163
5164 /**
5165  * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5166  * @brief       This API gets the application 'support_ambient' value from the app ID
5167  *
5168  * @par         This API is for package-manager client application
5169  * @par Sync (or) Async : Synchronous API
5170  *
5171  * @param[in]   handle          pointer to application info handle
5172  * @param[out]  support_ambient pointer to hold package support_ambient value
5173  * @return      0 if success, error code(<0) if fail
5174  * @retval      PMINFO_R_OK     success
5175  * @retval      PMINFO_R_EINVAL invalid argument
5176  * @retval      PMINFO_R_ERROR  internal error
5177  */
5178 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5179
5180 /**
5181  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5182  * @brief       This API destroys the application information handle freeing up all the resources
5183  *
5184  * @par         This API is for package-manager client application
5185  * @par Sync (or) Async : Synchronous API
5186  *
5187  * @param[in] handle            pointer to the application info handle.
5188  * @return      0 if success, error code(<0) if fail
5189  * @retval      PMINFO_R_OK     success
5190  * @retval      PMINFO_R_EINVAL invalid argument
5191  * @retval      PMINFO_R_ERROR  internal error
5192  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5193  * @post                None
5194  * @see         pkgmgrinfo_appinfo_get_pkgid()
5195  * @see         pkgmgrinfo_appinfo_is_multiple()
5196  * @code
5197 static int get_app_type(const char *appid)
5198 {
5199         int ret = 0;
5200         char *type = NULL;
5201         pkgmgrinfo_appinfo_h handle;
5202         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5203         if (ret != PMINFO_R_OK)
5204                 return -1;
5205         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5206         if (ret != PMINFO_R_OK) {
5207                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5208                 return -1;
5209         }
5210         printf("apptype: %s\n", type);
5211         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5212         return 0;
5213 }
5214  * @endcode
5215  */
5216 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
5217
5218 /**
5219  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5220  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
5221  The query will search the entire application information collected from the manifest file of all the installed packages
5222  *
5223  * @par         This API is for package-manager client application
5224  * @par Sync (or) Async : Synchronous API
5225  *
5226  * @param[out] handle           pointer to the application info filter handle.
5227  * @return      0 if success, error code(<0) if fail
5228  * @retval      PMINFO_R_OK     success
5229  * @retval      PMINFO_R_EINVAL invalid argument
5230  * @retval      PMINFO_R_ERROR  internal error
5231  * @pre         None
5232  * @post                pkgmgrinfo_appinfo_filter_destroy()
5233  * @see         pkgmgrinfo_appinfo_filter_count()
5234  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5235  * @code
5236 static int get_capp_count()
5237 {
5238         int ret = 0;
5239         int count = 0;
5240         pkgmgrinfo_appinfo_filter_h handle;
5241         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5242         if (ret != PMINFO_R_OK)
5243                 return -1;
5244         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5245         if (ret != PMINFO_R_OK) {
5246                 pkgmgrinfo_appinfo_filter_destroy(handle);
5247                 return -1;
5248         }
5249         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5250         if (ret != PMINFO_R_OK) {
5251                 pkgmgrinfo_appinfo_filter_destroy(handle);
5252                 return -1;
5253         }
5254         printf("No of capp: %d\n", count);
5255         pkgmgrinfo_appinfo_filter_destroy(handle);
5256         return 0;
5257 }
5258  * @endcode
5259  */
5260 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5261
5262 /**
5263  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5264  * @brief       This API destroys the application information filter handle freeing up all the resources
5265  *
5266  * @par         This API is for package-manager client application
5267  * @par Sync (or) Async : Synchronous API
5268  *
5269  * @param[in] handle            pointer to the application info filter handle.
5270  * @return      0 if success, error code(<0) if fail
5271  * @retval      PMINFO_R_OK     success
5272  * @retval      PMINFO_R_EINVAL invalid argument
5273  * @retval      PMINFO_R_ERROR  internal error
5274  * @pre         pkgmgrinfo_appinfo_filter_create()
5275  * @post                None
5276  * @see         pkgmgrinfo_appinfo_filter_count()
5277  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5278  * @code
5279 static int get_capp_count()
5280 {
5281         int ret = 0;
5282         int count = 0;
5283         pkgmgrinfo_appinfo_filter_h handle;
5284         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5285         if (ret != PMINFO_R_OK)
5286                 return -1;
5287         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5288         if (ret != PMINFO_R_OK) {
5289                 pkgmgrinfo_appinfo_filter_destroy(handle);
5290                 return -1;
5291         }
5292         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5293         if (ret != PMINFO_R_OK) {
5294                 pkgmgrinfo_appinfo_filter_destroy(handle);
5295                 return -1;
5296         }
5297         printf("No of capp: %d\n", count);
5298         pkgmgrinfo_appinfo_filter_destroy(handle);
5299         return 0;
5300 }
5301  * @endcode
5302  */
5303 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5304
5305 /**
5306  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5307  * @brief       This API adds a boolean filter property to the filter handle
5308  *
5309  * @par         This API is for package-manager client application
5310  * @par Sync (or) Async : Synchronous API
5311  *
5312  * @param[in] handle            pointer to the application info filter handle.
5313  * @param[in] property          boolean property name.
5314  * @param[in] value             value corresponding to the property.
5315  * @return      0 if success, error code(<0) if fail
5316  * @retval      PMINFO_R_OK     success
5317  * @retval      PMINFO_R_EINVAL invalid argument
5318  * @retval      PMINFO_R_ERROR  internal error
5319  * @pre         pkgmgrinfo_appinfo_filter_create()
5320  * @post                pkgmgrinfo_appinfo_filter_destroy()
5321  * @see         pkgmgrinfo_appinfo_filter_count()
5322  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5323  * @code
5324 static int get_taskmanageable_app_count()
5325 {
5326         int ret = 0;
5327         int count = 0;
5328         pkgmgrinfo_appinfo_filter_h handle;
5329         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5330         if (ret != PMINFO_R_OK)
5331                 return -1;
5332         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5333         if (ret != PMINFO_R_OK) {
5334                 pkgmgrinfo_appinfo_filter_destroy(handle);
5335                 return -1;
5336         }
5337         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5338         if (ret != PMINFO_R_OK) {
5339                 pkgmgrinfo_appinfo_filter_destroy(handle);
5340                 return -1;
5341         }
5342         printf("No of taskmanageable apps: %d\n", count);
5343         pkgmgrinfo_appinfo_filter_destroy(handle);
5344         return 0;
5345 }
5346  * @endcode
5347  */
5348 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5349                 const char *property, const bool value);
5350
5351 /**
5352  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5353  * @brief       This API adds an integer filter property to the filter handle
5354  *
5355  * @par         This API is for package-manager client application
5356  * @par Sync (or) Async : Synchronous API
5357  *
5358  * @param[in] handle            pointer to the application info filter handle.
5359  * @param[in] property          integer property name.
5360  * @param[in] value             value corresponding to the property.
5361  * @return      0 if success, error code(<0) if fail
5362  * @retval      PMINFO_R_OK     success
5363  * @retval      PMINFO_R_EINVAL invalid argument
5364  * @retval      PMINFO_R_ERROR  internal error
5365  * @pre         pkgmgrinfo_appinfo_filter_create()
5366  * @post                pkgmgrinfo_appinfo_filter_destroy()
5367  * @see         pkgmgrinfo_appinfo_filter_count()
5368  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5369  * @code
5370 static int get_taskmanageable_app_count()
5371 {
5372         int ret = 0;
5373         int count = 0;
5374         pkgmgrinfo_appinfo_filter_h handle;
5375         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5376         if (ret != PMINFO_R_OK)
5377                 return -1;
5378         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5379         if (ret != PMINFO_R_OK) {
5380                 pkgmgrinfo_appinfo_filter_destroy(handle);
5381                 return -1;
5382         }
5383         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5384         if (ret != PMINFO_R_OK) {
5385                 pkgmgrinfo_appinfo_filter_destroy(handle);
5386                 return -1;
5387         }
5388         printf("No of apps: %d\n", count);
5389         pkgmgrinfo_appinfo_filter_destroy(handle);
5390         return 0;
5391 }
5392  * @endcode
5393  */
5394 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5395                 const char *property, const int value);
5396
5397 /**
5398  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5399  * @brief       This API adds a string filter property to the filter handle
5400  *
5401  * @par         This API is for package-manager client application
5402  * @par Sync (or) Async : Synchronous API
5403  *
5404  * @param[in] handle            pointer to the application info filter handle.
5405  * @param[in] property          string property name.
5406  * @param[in] value             value corresponding to the property.
5407  * @return      0 if success, error code(<0) if fail
5408  * @retval      PMINFO_R_OK     success
5409  * @retval      PMINFO_R_EINVAL invalid argument
5410  * @retval      PMINFO_R_ERROR  internal error
5411  * @pre         pkgmgrinfo_appinfo_filter_create()
5412  * @post                pkgmgrinfo_appinfo_filter_destroy()
5413  * @see         pkgmgrinfo_appinfo_filter_count()
5414  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5415  * @code
5416 static int get_capp_count()
5417 {
5418         int ret = 0;
5419         int count = 0;
5420         pkgmgrinfo_appinfo_filter_h handle;
5421         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5422         if (ret != PMINFO_R_OK)
5423                 return -1;
5424         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5425         if (ret != PMINFO_R_OK) {
5426                 pkgmgrinfo_appinfo_filter_destroy(handle);
5427                 return -1;
5428         }
5429         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5430         if (ret != PMINFO_R_OK) {
5431                 pkgmgrinfo_appinfo_filter_destroy(handle);
5432                 return -1;
5433         }
5434         printf("No of capp: %d\n", count);
5435         pkgmgrinfo_appinfo_filter_destroy(handle);
5436         return 0;
5437 }
5438  * @endcode
5439  */
5440 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5441                 const char *property, const char *value);
5442
5443 /**
5444  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5445  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
5446  *
5447  * @par         This API is for package-manager client application
5448  * @par Sync (or) Async : Synchronous API
5449  *
5450  * @param[in] handle            pointer to the application info filter handle.
5451  * @param[in] app_cb            callback function.
5452  * @param[in] user_data         user data to be passed to the callback function
5453  * @return      0 if success, error code(<0) if fail
5454  * @retval      PMINFO_R_OK     success
5455  * @retval      PMINFO_R_EINVAL invalid argument
5456  * @retval      PMINFO_R_ERROR  internal error
5457  * @pre         pkgmgrinfo_appinfo_filter_create()
5458  * @post                pkgmgrinfo_appinfo_filter_destroy()
5459  * @see         pkgmgrinfo_appinfo_filter_count()
5460  * @code
5461 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5462 {
5463         char *appid = NULL;
5464         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5465         printf("appid : %s\n", appid);
5466         return 0;
5467 }
5468
5469 static int get_capp_list()
5470 {
5471         int ret = 0;
5472         pkgmgrinfo_appinfo_filter_h handle;
5473         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5474         if (ret != PMINFO_R_OK)
5475                 return -1;
5476         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5477         if (ret != PMINFO_R_OK) {
5478                 pkgmgrinfo_appinfo_filter_destroy(handle);
5479                 return -1;
5480         }
5481         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5482         if (ret != PMINFO_R_OK) {
5483                 pkgmgrinfo_appinfo_filter_destroy(handle);
5484                 return -1;
5485         }
5486         pkgmgrinfo_appinfo_filter_destroy(handle);
5487         return 0;
5488 }
5489  * @endcode
5490  */
5491 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5492                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5493 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5494                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5495
5496 /**
5497  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5498  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5499  * @brief       This API counts the application that satisfy the filter conditions
5500  *
5501  * @par         This API is for package-manager client application
5502  * @par Sync (or) Async : Synchronous API
5503  *
5504  * @param[in] handle            pointer to the application info filter handle.
5505  * @param[in] count             pointer to store count value
5506  * @param[in]   uid     the addressee user id of the instruction
5507  * @return      0 if success, error code(<0) if fail
5508  * @retval      PMINFO_R_OK     success
5509  * @retval      PMINFO_R_EINVAL invalid argument
5510  * @retval      PMINFO_R_ERROR  internal error
5511  * @pre         pkgmgrinfo_appinfo_filter_create()
5512  * @post                pkgmgrinfo_appinfo_filter_destroy()
5513  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5514  * @code
5515 static int get_capp_count()
5516 {
5517         int ret = 0;
5518         int count = 0;
5519         pkgmgrinfo_appinfo_filter_h handle;
5520         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5521         if (ret != PMINFO_R_OK)
5522                 return -1;
5523         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5524         if (ret != PMINFO_R_OK) {
5525                 pkgmgrinfo_appinfo_filter_destroy(handle);
5526                 return -1;
5527         }
5528         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5529         if (ret != PMINFO_R_OK) {
5530                 pkgmgrinfo_appinfo_filter_destroy(handle);
5531                 return -1;
5532         }
5533         printf("No of capp: %d\n", count);
5534         pkgmgrinfo_appinfo_filter_destroy(handle);
5535         return 0;
5536 }
5537  * @endcode
5538  */
5539 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5540 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5541 /**
5542  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5543  * @brief       This API creates the application's metadata  information filter handle from db.
5544  *
5545  * @par         This API is for package-manager client application
5546  * @par Sync (or) Async : Synchronous API
5547  *
5548  * @param[out] handle           pointer to the application metadata info filter handle.
5549  * @return      0 if success, error code(<0) if fail
5550  * @retval      PMINFO_R_OK     success
5551  * @retval      PMINFO_R_EINVAL invalid argument
5552  * @retval      PMINFO_R_ERROR  internal error
5553  * @pre         None
5554  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5555  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5556  * @code
5557 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5558 {
5559         char *appid = NULL;
5560         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5561         printf("appid : %s\n", appid);
5562         return 0;
5563 }
5564
5565 static int get_app_list(const char *mkey, const char *mvalue)
5566 {
5567         int ret = 0;
5568         pkgmgrinfo_appinfo_metadata_filter_h handle;
5569         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5570         if (ret != PMINFO_R_OK)
5571                 return -1;
5572         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5573         if (ret != PMINFO_R_OK) {
5574                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5575                 return -1;
5576         }
5577         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5578         if (ret != PMINFO_R_OK) {
5579                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5580                 return -1;
5581         }
5582         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5583         return 0;
5584 }
5585  * @endcode
5586  */
5587 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5588
5589 /**
5590  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5591  * @brief       This API destroys the application's metadata  information filter handle.
5592  *
5593  * @par         This API is for package-manager client application
5594  * @par Sync (or) Async : Synchronous API
5595  *
5596  * @param[in] handle            pointer to the application metadata info filter handle.
5597  * @return      0 if success, error code(<0) if fail
5598  * @retval      PMINFO_R_OK     success
5599  * @retval      PMINFO_R_EINVAL invalid argument
5600  * @retval      PMINFO_R_ERROR  internal error
5601  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5602  * @post                None
5603  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5604  * @code
5605 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5606 {
5607         char *appid = NULL;
5608         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5609         printf("appid : %s\n", appid);
5610         return 0;
5611 }
5612
5613 static int get_app_list(const char *mkey, const char *mvalue)
5614 {
5615         int ret = 0;
5616         pkgmgrinfo_appinfo_metadata_filter_h handle;
5617         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5618         if (ret != PMINFO_R_OK)
5619                 return -1;
5620         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5621         if (ret != PMINFO_R_OK) {
5622                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5623                 return -1;
5624         }
5625         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5626         if (ret != PMINFO_R_OK) {
5627                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5628                 return -1;
5629         }
5630         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5631         return 0;
5632 }
5633  * @endcode
5634  */
5635 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5636
5637 /**
5638  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5639  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
5640  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5641  *
5642  * @par         This API is for package-manager client application
5643  * @par Sync (or) Async : Synchronous API
5644  *
5645  * @param[in] handle            pointer to the application metadata info filter handle.
5646  * @param[in] key                       pointer to metadata key
5647  * @param[in] value                     pointer to metadata value
5648  * @return      0 if success, error code(<0) if fail
5649  * @retval      PMINFO_R_OK     success
5650  * @retval      PMINFO_R_EINVAL invalid argument
5651  * @retval      PMINFO_R_ERROR  internal error
5652  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5653  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5654  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5655  * @code
5656 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5657 {
5658         char *appid = NULL;
5659         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5660         printf("appid : %s\n", appid);
5661         return 0;
5662 }
5663
5664 static int get_app_list(const char *mkey, const char *mvalue)
5665 {
5666         int ret = 0;
5667         pkgmgrinfo_appinfo_metadata_filter_h handle;
5668         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5669         if (ret != PMINFO_R_OK)
5670                 return -1;
5671         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5672         if (ret != PMINFO_R_OK) {
5673                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5674                 return -1;
5675         }
5676         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5677         if (ret != PMINFO_R_OK) {
5678                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5679                 return -1;
5680         }
5681         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5682         return 0;
5683 }
5684  * @endcode
5685  */
5686 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5687                 const char *key, const char *value);
5688
5689 /**
5690  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5691  * @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)
5692  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
5693  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5694  * negative value, no more callbacks will be called and API will return.
5695  *
5696  * @par         This API is for package-manager client application
5697  * @par Sync (or) Async : Synchronous API
5698  *
5699  * @param[in] handle            pointer to the application metadata info filter handle.
5700  * @param[in] app_cb            function pointer to callback
5701  * @param[in] user_data         pointer to user data
5702  * @param[in]   uid     the addressee user id of the instruction
5703  * @return      0 if success, error code(<0) if fail
5704  * @retval      PMINFO_R_OK     success
5705  * @retval      PMINFO_R_EINVAL invalid argument
5706  * @retval      PMINFO_R_ERROR  internal error
5707  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5708  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5709  * @code
5710 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5711 {
5712         char *appid = NULL;
5713         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5714         printf("appid : %s\n", appid);
5715         return 0;
5716 }
5717
5718 static int get_app_list(const char *mkey, const char *mvalue)
5719 {
5720         int ret = 0;
5721         pkgmgrinfo_appinfo_metadata_filter_h handle;
5722         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5723         if (ret != PMINFO_R_OK)
5724                 return -1;
5725         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5726         if (ret != PMINFO_R_OK) {
5727                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5728                 return -1;
5729         }
5730         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5731         if (ret != PMINFO_R_OK) {
5732                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5733                 return -1;
5734         }
5735         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5736         return 0;
5737 }
5738  * @endcode
5739  */
5740 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5741                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5742 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5743                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5744 /**
5745  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5746  * @brief       This API creates the package cert information handle to get data from db.
5747  *
5748  * @par         This API is for package-manager client application
5749  * @par Sync (or) Async : Synchronous API
5750  *
5751  * @param[out] handle           pointer to the package cert handle.
5752  * @return      0 if success, error code(<0) if fail
5753  * @retval      PMINFO_R_OK     success
5754  * @retval      PMINFO_R_EINVAL invalid argument
5755  * @retval      PMINFO_R_ERROR  internal error
5756  * @pre         None
5757  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5758  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5759  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5760  * @code
5761 static int get_cert_info(const char *pkgid)
5762 {
5763         int ret = 0;
5764         pkgmgrinfo_certinfo_h handle;
5765         char *auth_cert = NULL;
5766         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5767         if (ret != PMINFO_R_OK)
5768                 return -1;
5769         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5770         if (ret != PMINFO_R_OK) {
5771                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5772                 return -1;
5773         }
5774         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5775         if (ret != PMINFO_R_OK) {
5776                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5777                 return -1;
5778         }
5779         printf("Author root certificate: %s\n", auth_root);
5780         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5781         return 0;
5782 }
5783  * @endcode
5784  */
5785 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5786
5787 /**
5788  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5789  * @brief       This API loads the package cert information handle with data from db.
5790  *
5791  * @par         This API is for package-manager client application
5792  * @par Sync (or) Async : Synchronous API
5793  *
5794  * @param[in] pkgid             pointer to the package ID.
5795  * @param[in] handle            pointer to the package cert handle.
5796  * @return      0 if success, error code(<0) if fail
5797  * @retval      PMINFO_R_OK     success
5798  * @retval      PMINFO_R_EINVAL invalid argument
5799  * @retval      PMINFO_R_ERROR  internal error
5800  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5801  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5802  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5803  * @code
5804 static int get_cert_info(const char *pkgid)
5805 {
5806         int ret = 0;
5807         pkgmgrinfo_certinfo_h handle;
5808         char *auth_cert = NULL;
5809         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5810         if (ret != PMINFO_R_OK)
5811                 return -1;
5812         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5813         if (ret != PMINFO_R_OK) {
5814                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5815                 return -1;
5816         }
5817         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5818         if (ret != PMINFO_R_OK) {
5819                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5820                 return -1;
5821         }
5822         printf("Author root certificate: %s\n", auth_root);
5823         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5824         return 0;
5825 }
5826  * @endcode
5827  */
5828 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5829
5830 /**
5831  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5832  * @brief       This API gets the package cert information from the handle
5833  *
5834  * @par         This API is for package-manager client application
5835  * @par Sync (or) Async : Synchronous API
5836  *
5837  * @param[in] handle            pointer to the package cert handle.
5838  * @param[in] cert_type         certificate type
5839  * @param[out] cert_value       pointer to hold certificate value
5840  * @return      0 if success, error code(<0) if fail
5841  * @retval      PMINFO_R_OK     success
5842  * @retval      PMINFO_R_EINVAL invalid argument
5843  * @retval      PMINFO_R_ERROR  internal error
5844  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5845  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5846  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5847  * @code
5848 static int get_cert_info(const char *pkgid)
5849 {
5850         int ret = 0;
5851         pkgmgrinfo_certinfo_h handle;
5852         char *auth_cert = NULL;
5853         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5854         if (ret != PMINFO_R_OK)
5855                 return -1;
5856         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5857         if (ret != PMINFO_R_OK) {
5858                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5859                 return -1;
5860         }
5861         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5862         if (ret != PMINFO_R_OK) {
5863                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5864                 return -1;
5865         }
5866         printf("Author root certificate: %s\n", auth_root);
5867         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5868         return 0;
5869 }
5870  * @endcode
5871  */
5872 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5873
5874 /**
5875  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5876  * @brief       This API destroys the package cert information handle freeing up all the resources
5877  *
5878  * @par         This API is for package-manager client application
5879  * @par Sync (or) Async : Synchronous API
5880  *
5881  * @param[in] handle            pointer to the package cert handle.
5882  * @return      0 if success, error code(<0) if fail
5883  * @retval      PMINFO_R_OK     success
5884  * @retval      PMINFO_R_EINVAL invalid argument
5885  * @retval      PMINFO_R_ERROR  internal error
5886  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5887  * @post                None
5888  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5889  * @code
5890 static int get_cert_info(const char *pkgid)
5891 {
5892         int ret = 0;
5893         pkgmgrinfo_certinfo_h handle;
5894         char *auth_cert = NULL;
5895         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5896         if (ret != PMINFO_R_OK)
5897                 return -1;
5898         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5899         if (ret != PMINFO_R_OK) {
5900                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5901                 return -1;
5902         }
5903         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5904         if (ret != PMINFO_R_OK) {
5905                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5906                 return -1;
5907         }
5908         printf("Author root certificate: %s\n", auth_root);
5909         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5910         return 0;
5911 }
5912  * @endcode
5913  */
5914 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5915
5916 /**
5917  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5918  * @brief       This API deletes the package cert information from DB
5919  *
5920  * @par         This API is for package-manager client application
5921  * @par Sync (or) Async : Synchronous API
5922  *
5923  * @param[in] pkgid             pointer to the package ID.
5924  * @return      0 if success, error code(<0) if fail
5925  * @retval      PMINFO_R_OK     success
5926  * @retval      PMINFO_R_EINVAL invalid argument
5927  * @retval      PMINFO_R_ERROR  internal error
5928  * @pre         None
5929  * @post                None
5930  * @code
5931 static int delete_cert_info(const char *pkgid)
5932 {
5933         int ret = 0;
5934         ret = pkgmgrinfo_delete_certinfo(pkgid);
5935         if (ret != PMINFO_R_OK)
5936                 return -1;
5937         return 0;
5938 }
5939  * @endcode
5940  */
5941 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5942 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5943
5944 /**
5945  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5946  * @brief       This API creates the package cert information handle to set data in db.
5947  *
5948  * @par         This API is for package-manager client application
5949  * @par Sync (or) Async : Synchronous API
5950  *
5951  * @param[out] handle           pointer to the package cert handle.
5952  * @return      0 if success, error code(<0) if fail
5953  * @retval      PMINFO_R_OK     success
5954  * @retval      PMINFO_R_EINVAL invalid argument
5955  * @retval      PMINFO_R_ERROR  internal error
5956  * @pre         None
5957  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5958  * @see         pkgmgrinfo_set_cert_value()
5959  * @see         pkgmgrinfo_save_certinfo()
5960  * @code
5961 static int set_cert_in_db(const char *pkgid)
5962 {
5963         int ret = 0;
5964         pkgmgrinfo_instcertinfo_h handle;
5965         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5966         if (ret != PMINFO_R_OK)
5967                 return -1;
5968         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5969         if (ret != PMINFO_R_OK) {
5970                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5971                 return -1;
5972         }
5973         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5974         if (ret != PMINFO_R_OK) {
5975                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5976                 return -1;
5977         }
5978         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5979         return 0;
5980 }
5981  * @endcode
5982  */
5983 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5984
5985 /**
5986  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5987  * @brief       This API sets the package cert information in the handle.
5988  *
5989  * @par         This API is for package-manager client application
5990  * @par Sync (or) Async : Synchronous API
5991  *
5992  * @param[in] handle            pointer to the package cert handle.
5993  * @param[in] cert_type         certificate type.
5994  * @param[in] cert_value        certificate value.
5995  * @return      0 if success, error code(<0) if fail
5996  * @retval      PMINFO_R_OK     success
5997  * @retval      PMINFO_R_EINVAL invalid argument
5998  * @retval      PMINFO_R_ERROR  internal error
5999  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6000  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6001  * @see         pkgmgrinfo_save_certinfo()
6002  * @code
6003 static int set_cert_in_db(const char *pkgid)
6004 {
6005         int ret = 0;
6006         pkgmgrinfo_instcertinfo_h handle;
6007         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6008         if (ret != PMINFO_R_OK)
6009                 return -1;
6010         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6011         if (ret != PMINFO_R_OK) {
6012                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6013                 return -1;
6014         }
6015         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6016         if (ret != PMINFO_R_OK) {
6017                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6018                 return -1;
6019         }
6020         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6021         return 0;
6022 }
6023  * @endcode
6024  */
6025 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6026
6027 /**
6028  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6029  * @brief       This API saves the package cert information in the DB.
6030  *
6031  * @par         This API is for package-manager client application
6032  * @par Sync (or) Async : Synchronous API
6033  *
6034  * @param[in] pkgid             pointer to the package ID.
6035  * @param[in] handle            pointer to the package cert handle.
6036  * @return      0 if success, error code(<0) if fail
6037  * @retval      PMINFO_R_OK     success
6038  * @retval      PMINFO_R_EINVAL invalid argument
6039  * @retval      PMINFO_R_ERROR  internal error
6040  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6041  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
6042  * @see         pkgmgrinfo_save_certinfo()
6043  * @code
6044 static int set_cert_in_db(const char *pkgid)
6045 {
6046         int ret = 0;
6047         pkgmgrinfo_instcertinfo_h handle;
6048         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6049         if (ret != PMINFO_R_OK)
6050                 return -1;
6051         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6052         if (ret != PMINFO_R_OK) {
6053                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6054                 return -1;
6055         }
6056         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6057         if (ret != PMINFO_R_OK) {
6058                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6059                 return -1;
6060         }
6061         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6062         return 0;
6063 }
6064  * @endcode
6065  */
6066 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6067
6068 /**
6069  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6070  * @brief       This API destroys the package cert information handle freeing up all the resources.
6071  *
6072  * @par         This API is for package-manager client application
6073  * @par Sync (or) Async : Synchronous API
6074  *
6075  * @param[in] handle            pointer to the package cert handle.
6076  * @return      0 if success, error code(<0) if fail
6077  * @retval      PMINFO_R_OK     success
6078  * @retval      PMINFO_R_EINVAL invalid argument
6079  * @retval      PMINFO_R_ERROR  internal error
6080  * @pre         pkgmgrinfo_create_certinfo_set_handle()
6081  * @post                None
6082  * @see         pkgmgrinfo_save_certinfo()
6083  * @code
6084 static int set_cert_in_db(const char *pkgid)
6085 {
6086         int ret = 0;
6087         pkgmgrinfo_instcertinfo_h handle;
6088         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6089         if (ret != PMINFO_R_OK)
6090                 return -1;
6091         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6092         if (ret != PMINFO_R_OK) {
6093                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6094                 return -1;
6095         }
6096         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6097         if (ret != PMINFO_R_OK) {
6098                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6099                 return -1;
6100         }
6101         pkgmgrinfo_destroy_certinfo_set_handle(handle);
6102         return 0;
6103 }
6104  * @endcode
6105  */
6106 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6107
6108 /**
6109  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
6110  * @brief       This API gets the datacontrol info
6111  *
6112  * @par         This API is for package-manager client application
6113  * @par Sync (or) Async : Synchronous API
6114  *
6115  * @param[in] providerid                pointer to the providerid of dataconltrol.
6116  * @param[in] type                      pointer to the type of dataconltrol.
6117  * @param[out] appid                    pointer to hold appid, need to free after using
6118  * @param[out] access                   pointer to hold access, need to free after using
6119  * @return      0 if success, error code(<0) if fail
6120  * @retval      PMINFO_R_OK     success
6121  * @retval      PMINFO_R_EINVAL invalid argument
6122  * @retval      PMINFO_R_ERROR  internal error
6123  * @endcode
6124  */
6125 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
6126
6127 /**
6128  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6129  * @brief       This API gets the application 'guest mode visibility' value from the DB
6130  *
6131  * @par         This API is for package-manager client application
6132  * @par Sync (or) Async : Synchronous API
6133  *
6134  * @param[in]   handle  pointer to application info handle
6135  * @param[out] status           pointer to hold app guest mode visibility value
6136  * @return      0 if success, error code(<0) if fail
6137  * @retval      PMINFO_R_OK     success
6138  * @retval      PMINFO_R_EINVAL invalid argument
6139  * @retval      PMINFO_R_ERROR  internal error
6140  * @pre         pkgmgrinfo_appinfo_get_appinfo()
6141  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
6142  * @see         pkgmgrinfo_appinfo_get_appid()
6143  * @see         pkgmgrinfo_appinfo_is_multiple()
6144  * @code
6145 static int get_app_guestmode_visibility(const char *appid)
6146 {
6147         int ret = 0;
6148         bool status;
6149         pkgmgrinfo_appinfo_h handle;
6150         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6151         if (ret != PMINFO_R_OK)
6152                 return -1;
6153         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6154         if (ret != PMINFO_R_OK) {
6155                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6156                 return -1;
6157         }
6158         printf("app guest mode visibility: %d\n", status);
6159         pkgmgrinfo_appinfo_destroy_appinfo(handle);
6160         return 0;
6161 }
6162  * @endcode
6163  */
6164 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6165
6166 /**
6167 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6168 * @brief         This API sets the package 'installed_storage' value in db
6169 *
6170 * @par  This API is for package-manager client application
6171 * @par Sync (or) Async : Synchronous API
6172 *
6173 * @param[in] pkgid              pointer to the package ID.
6174 * @param[in] location  package install location
6175 * @param[in] external_pkg_path  image path if pkg has installed at external storage
6176 * @return  0 if success, error code(<0) if fail
6177 * @retval  PMINFO_R_OK success
6178 * @retval  PMINFO_R_EINVAL       invalid argument
6179 * @retval  PMINFO_R_ERROR internal error
6180 * @code
6181 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6182 {
6183         int ret = 0;
6184
6185         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6186         if (ret != PMINFO_R_OK) {
6187                 return -1;
6188         }
6189         return 0;
6190 }
6191 * @endcode
6192 */
6193 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6194 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6195
6196 /* version compare */
6197 int pkgmgrinfo_compare_package_version(const char *current_version,
6198                 const char *target_version, pkgmgrinfo_version_compare_type *res);
6199
6200 /**
6201  * @brief       TEMP
6202  */
6203
6204
6205 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6206                 int flag, void *user_data, uid_t uid);
6207 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6208                 int flag, void *user_data);
6209 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6210                 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6211                 void *user_data);
6212 int pkgmgrinfo_appinfo_get_installed_list_full(
6213                 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6214
6215
6216 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6217                 pkgmgrinfo_archiveinfo_h *handle);
6218 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6219 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6220                 const char **pkgid);
6221 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6222                 const char **type);
6223 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6224                 const char **version);
6225 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6226                 const char **api_version);
6227 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6228                 const char **description);
6229 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6230                 const char **label);
6231 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6232                 const char **author);
6233 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6234                 const unsigned char **icon, size_t *size);
6235
6236 /**
6237  * @pkgmgrinfo client API end
6238 **/
6239
6240
6241 /** @} */
6242 #ifdef __cplusplus
6243 }
6244 #endif
6245 #endif                          /* __PKG_INFO_H__ */
6246 /**
6247  * @}
6248  * @}
6249  */
6250