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