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