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