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