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