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