0a97fcc5f9b5afc8e442ffad501dc14770de2bb9
[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_tpk_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, "tpk");
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 tpk 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_tpk_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, "tpk");
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 tpk 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_tpk_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, "tpk");
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 tpk 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_tpk_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, "tpk");
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_tpk_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, "tpk");
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 tpk 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_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
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[in]   handle  pointer to the package info handle.
2004  * @param[out]  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_clone_appinfo(handle, &clone);
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_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
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_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3550                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3551  * @brief       This API gets the list of splashscreen for a particular application
3552  *
3553  * @par         This API is for package-manager client application
3554  * @par Sync (or) Async : Synchronous API
3555  * @param[in]   handle          pointer to the application info handle.
3556  * @param[in]   splash_screen_func              callback function for list
3557  * @param[in]   user_data       user data to be passed to callback function
3558  * @return      0 if success, error code(<0) if fail
3559  * @retval      PMINFO_R_OK     success
3560  * @retval      PMINFO_R_EINVAL invalid argument
3561  * @retval      PMINFO_R_ERROR  internal error
3562  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3563  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3564  * @code
3565  */
3566 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3567                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3568
3569 /**
3570  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3571  * @brief       This API gets the application 'nodisplay' value from the app ID
3572  *
3573  * @par         This API is for package-manager client application
3574  * @par Sync (or) Async : Synchronous API
3575  *
3576  * @param[in]   handle  pointer to application info handle
3577  * @param[out] nodisplay                pointer to hold package nodisplay value
3578  * @return      0 if success, error code(<0) if fail
3579  * @retval      PMINFO_R_OK     success
3580  * @retval      PMINFO_R_EINVAL invalid argument
3581  * @retval      PMINFO_R_ERROR  internal error
3582  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3583  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3584  * @see         pkgmgrinfo_appinfo_get_appid()
3585  * @see         pkgmgrinfo_appinfo_is_multiple()
3586  * @code
3587 static int get_app_nodisplay(const char *appid)
3588 {
3589         int ret = 0;
3590         bool nodisplay;
3591         pkgmgrinfo_appinfo_h handle;
3592         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3593         if (ret != PMINFO_R_OK)
3594                 return -1;
3595         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3596         if (ret != PMINFO_R_OK) {
3597                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3598                 return -1;
3599         }
3600         printf("app nodisplay: %d\n", nodisplay);
3601         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3602         return 0;
3603 }
3604  * @endcode
3605  */
3606 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
3607
3608 /**
3609  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3610  * @brief       This API gets the application 'multiple' value from the app ID
3611  *
3612  * @par         This API is for package-manager client application
3613  * @par Sync (or) Async : Synchronous API
3614  *
3615  * @param[in]   handle  pointer to application info handle
3616  * @param[out] multiple         pointer to hold package multiple value
3617  * @return      0 if success, error code(<0) if fail
3618  * @retval      PMINFO_R_OK     success
3619  * @retval      PMINFO_R_EINVAL invalid argument
3620  * @retval      PMINFO_R_ERROR  internal error
3621  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3622  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3623  * @see         pkgmgrinfo_appinfo_get_appid()
3624  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3625  * @code
3626 static int get_app_multiple(const char *appid)
3627 {
3628         int ret = 0;
3629         bool multiple;
3630         pkgmgrinfo_appinfo_h handle;
3631         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3632         if (ret != PMINFO_R_OK)
3633                 return -1;
3634         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3635         if (ret != PMINFO_R_OK) {
3636                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3637                 return -1;
3638         }
3639         printf("app multiple: %d\n", multiple);
3640         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3641         return 0;
3642 }
3643  * @endcode
3644  */
3645 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
3646
3647 /**
3648  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3649  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3650  *              application launching effect. If fales, indicator will be hidden during application launching effect
3651  *
3652  * @par         This API is for package-manager client application
3653  * @par Sync (or) Async : Synchronous API
3654  *
3655  * @param[in]   handle  pointer to application info handle
3656  * @param[out]  indicator_disp contains indicator display status for application launching effect
3657  * @return      0 if success, error code(<0) if fail
3658  * @retval      PMINFO_R_OK     success
3659  * @retval      PMINFO_R_EINVAL invalid argument
3660  * @retval      PMINFO_R_ERROR  internal error
3661  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3662  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3663  * @see         pkgmgrinfo_appinfo_get_appid()
3664  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3665  * @code
3666 static int get_app_indicator_display(const char *appid)
3667 {
3668         int ret = 0;
3669         bool indicator_disp;
3670         pkgmgrinfo_appinfo_h handle;
3671         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3672         if (ret != PMINFO_R_OK)
3673                 return -1;
3674         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3675         if (ret != PMINFO_R_OK){
3676                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3677                 return -1;
3678         }
3679         printf("app indicator disp : %d\n", indicator_disp);
3680         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3681         return 0;
3682 }
3683  * @endcode
3684  */
3685 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3686
3687 /**
3688  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3689  * @brief       This API gets the application 'taskmanage' value from the app ID
3690  *
3691  * @par         This API is for package-manager client application
3692  * @par Sync (or) Async : Synchronous API
3693  *
3694  * @param[in]   handle  pointer to application info handle
3695  * @param[out] taskmanage               pointer to hold package taskmanage value
3696  * @return      0 if success, error code(<0) if fail
3697  * @retval      PMINFO_R_OK     success
3698  * @retval      PMINFO_R_EINVAL invalid argument
3699  * @retval      PMINFO_R_ERROR  internal error
3700  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3701  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3702  * @see         pkgmgrinfo_appinfo_get_appid()
3703  * @see         pkgmgrinfo_appinfo_is_multiple()
3704  * @code
3705 static int get_app_taskmanage(const char *appid)
3706 {
3707         int ret = 0;
3708         bool taskmanage;
3709         pkgmgrinfo_appinfo_h handle;
3710         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3711         if (ret != PMINFO_R_OK)
3712                 return -1;
3713         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3714         if (ret != PMINFO_R_OK) {
3715                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3716                 return -1;
3717         }
3718         printf("app taskmanage: %d\n", taskmanage);
3719         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3720         return 0;
3721 }
3722  * @endcode
3723  */
3724 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
3725
3726 /**
3727  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3728  * @brief       This API gets the application 'taskmanage' value from the app ID
3729  *
3730  * @par         This API is for package-manager client application
3731  * @par Sync (or) Async : Synchronous API
3732  *
3733  * @param[in]   handle  pointer to application info handle
3734  * @param[out] enabled          pointer to hold package enabled value
3735  * @return      0 if success, error code(<0) if fail
3736  * @retval      PMINFO_R_OK     success
3737  * @retval      PMINFO_R_EINVAL invalid argument
3738  * @retval      PMINFO_R_ERROR  internal error
3739  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3740  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3741  * @see         pkgmgrinfo_appinfo_get_appid()
3742  * @see         pkgmgrinfo_appinfo_is_multiple()
3743  * @code
3744 static int get_app_enabled(const char *appid)
3745 {
3746         int ret = 0;
3747         bool enabled;
3748         pkgmgrinfo_appinfo_h handle;
3749         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3750         if (ret != PMINFO_R_OK)
3751                 return -1;
3752         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3753         if (ret != PMINFO_R_OK) {
3754                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3755                 return -1;
3756         }
3757         printf("app enabled: %d\n", enabled);
3758         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3759         return 0;
3760 }
3761  * @endcode
3762  */
3763 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
3764
3765 /**
3766  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3767  * @brief       This API gets the application 'onboot' value from the app ID
3768  *
3769  * @par         This API is for package-manager client application
3770  * @par Sync (or) Async : Synchronous API
3771  *
3772  * @param[in]   handle  pointer to application info handle
3773  * @param[out] onboot           pointer to hold package onboot value
3774  * @return      0 if success, error code(<0) if fail
3775  * @retval      PMINFO_R_OK     success
3776  * @retval      PMINFO_R_EINVAL invalid argument
3777  * @retval      PMINFO_R_ERROR  internal error
3778  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3779  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3780  * @see         pkgmgrinfo_appinfo_get_appid()
3781  * @see         pkgmgrinfo_appinfo_is_multiple()
3782  * @code
3783 static int get_app_onboot(const char *appid)
3784 {
3785         int ret = 0;
3786         bool onboot;
3787         pkgmgrinfo_appinfo_h handle;
3788         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3789         if (ret != PMINFO_R_OK)
3790                 return -1;
3791         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3792         if (ret != PMINFO_R_OK) {
3793                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3794                 return -1;
3795         }
3796         printf("app onboot: %d\n", onboot);
3797         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3798         return 0;
3799 }
3800  * @endcode
3801  */
3802 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
3803
3804 /**
3805  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3806  * @brief       This API gets the application 'autorestart' value from the app ID
3807  *
3808  * @par         This API is for package-manager client application
3809  * @par Sync (or) Async : Synchronous API
3810  *
3811  * @param[in]   handle  pointer to application info handle
3812  * @param[out] autorestart              pointer to hold package autorestart value
3813  * @return      0 if success, error code(<0) if fail
3814  * @retval      PMINFO_R_OK     success
3815  * @retval      PMINFO_R_EINVAL invalid argument
3816  * @retval      PMINFO_R_ERROR  internal error
3817  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3818  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3819  * @see         pkgmgrinfo_appinfo_get_appid()
3820  * @see         pkgmgrinfo_appinfo_is_multiple()
3821  * @code
3822 static int get_app_autorestart(const char *appid)
3823 {
3824         int ret = 0;
3825         bool autorestart;
3826         pkgmgrinfo_appinfo_h handle;
3827         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3828         if (ret != PMINFO_R_OK)
3829                 return -1;
3830         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3831         if (ret != PMINFO_R_OK) {
3832                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3833                 return -1;
3834         }
3835         printf("app autorestart: %d\n", autorestart);
3836         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3837         return 0;
3838 }
3839  * @endcode
3840  */
3841 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
3842
3843 /**
3844  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
3845  * @brief       This API gets the value for given application is main app or not from handle
3846  *
3847  * @par         This API is for package-manager client application
3848  * @par Sync (or) Async : Synchronous API
3849  *
3850  * @param[in]   handle  pointer to application info handle
3851  * @param[out] mainapp          pointer to hold package mainapp is or not
3852  * @return      0 if success, error code(<0) if fail
3853  * @retval      PMINFO_R_OK     success
3854  * @retval      PMINFO_R_EINVAL invalid argument
3855  * @retval      PMINFO_R_ERROR  internal error
3856  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3857  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3858  * @see         pkgmgrinfo_appinfo_get_appid()
3859  * @see         pkgmgrinfo_appinfo_is_multiple()
3860  * @code
3861 static int get_app_mainapp(const char *appid)
3862 {
3863         int ret = 0;
3864         bool mainapp;
3865         pkgmgrinfo_appinfo_h handle;
3866         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3867         if (ret != PMINFO_R_OK)
3868                 return -1;
3869         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3870         if (ret != PMINFO_R_OK) {
3871                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3872                 return -1;
3873         }
3874         printf("mainapp: %d\n", mainapp);
3875         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3876         return 0;
3877 }
3878  * @endcode
3879  */
3880 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
3881
3882
3883 /**
3884  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3885  * @brief       This API gets the value for given application is preload or not from handle
3886  *
3887  * @par         This API is for package-manager client application
3888  * @par Sync (or) Async : Synchronous API
3889  *
3890  * @param[in]   handle  pointer to application info handle
3891  * @param[out] preload          pointer to hold preload is or not
3892  * @return      0 if success, error code(<0) if fail
3893  * @retval      PMINFO_R_OK     success
3894  * @retval      PMINFO_R_EINVAL invalid argument
3895  * @retval      PMINFO_R_ERROR  internal error
3896  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3897  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3898  * @see         pkgmgrinfo_appinfo_get_appid()
3899  * @see         pkgmgrinfo_appinfo_is_multiple()
3900  * @code
3901 static int get_app_preload(const char *appid)
3902 {
3903         int ret = 0;
3904         bool preload = 0;
3905         pkgmgrinfo_appinfo_h handle = NULL;
3906         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3907         if (ret != PMINFO_R_OK)
3908                 return -1;
3909         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3910         if (ret != PMINFO_R_OK) {
3911                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3912                 return -1;
3913         }
3914         printf("preload: %d\n", preload);
3915         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3916         return 0;
3917 }
3918  * @endcode
3919  */
3920 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3921
3922 /**
3923  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3924  * @brief       This API gets the value for given application is submode or not from handle
3925  *
3926  * @par         This API is for package-manager client application
3927  * @par Sync (or) Async : Synchronous API
3928  *
3929  * @param[in]   handle  pointer to application info handle
3930  * @param[out] submode          pointer to hold submode is or not
3931  * @return      0 if success, error code(<0) if fail
3932  * @retval      PMINFO_R_OK     success
3933  * @retval      PMINFO_R_EINVAL invalid argument
3934  * @retval      PMINFO_R_ERROR  internal error
3935  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3936  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3937  * @see         pkgmgrinfo_appinfo_get_appid()
3938  * @see         pkgmgrinfo_appinfo_is_multiple()
3939  * @code
3940 static int get_app_submode(const char *appid)
3941 {
3942         int ret = 0;
3943         bool submode = 0;
3944         pkgmgrinfo_appinfo_h handle = NULL;
3945         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3946         if (ret != PMINFO_R_OK)
3947                 return -1;
3948         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3949         if (ret != PMINFO_R_OK) {
3950                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3951                 return -1;
3952         }
3953         printf("submode: %d\n", submode);
3954         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3955         return 0;
3956 }
3957  * @endcode
3958  */
3959 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3960
3961 /**
3962  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
3963  * @brief       This API gets the value for given application is process_pool or not from handle
3964  *
3965  * @par         This API is for package-manager client application
3966  * @par Sync (or) Async : Synchronous API
3967  *
3968  * @param[in]   handle  pointer to application info handle
3969  * @param[out] process_pool             pointer to hold process_pool is or not
3970  * @return      0 if success, error code(<0) if fail
3971  * @retval      PMINFO_R_OK     success
3972  * @retval      PMINFO_R_EINVAL invalid argument
3973  * @retval      PMINFO_R_ERROR  internal error
3974  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3975  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3976  * @see         pkgmgrinfo_appinfo_get_appid()
3977  * @code
3978 static int get_app_process_pool(const char *appid)
3979 {
3980         int ret = 0;
3981         bool process_pool = 0;
3982         pkgmgrinfo_appinfo_h handle = NULL;
3983         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3984         if (ret != PMINFO_R_OK)
3985                 return -1;
3986         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
3987         if (ret != PMINFO_R_OK) {
3988                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3989                 return -1;
3990         }
3991         printf("process_pool: %d\n", process_pool);
3992         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3993         return 0;
3994 }
3995  * @endcode
3996  */
3997 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
3998
3999 /**
4000  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4001  * @brief       This API gets the installed storage location of the application
4002  *
4003  * @par This API is for package-manager client application
4004  * @par Sync (or) Async : Synchronous API
4005  *
4006  * @param[in] handle            pointer to the application info handle.
4007  * @param[out] app_type         pointer to hold installed storage location
4008  * @return      0 if success, error code(<0) if fail
4009  * @retval      PMINFO_R_OK success
4010  * @retval      PMINFO_R_EINVAL invalid argument
4011  * @retval      PMINFO_R_ERROR  internal error
4012  * @pre pkgmgrinfo_appinfo_get_appinfo()
4013  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4014  * @see pkgmgrinfo_appinfo_get_appid()
4015  * @code
4016 static int get_app_installed_location(const char *appid)
4017 {
4018         int ret = 0;
4019         pkgmgrinfo_installed_storage storage;
4020         pkgmgrinfo_appinfo_h handle = NULL;
4021         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4022         if (ret != PMINFO_R_OK)
4023                 return -1;
4024         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4025         if (ret != PMINFO_R_OK) {
4026                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4027                 return -1;
4028         }
4029         printf("Installed storage location : %d\n", storage);
4030         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4031         return 0;
4032 }
4033  * @endcode
4034  */
4035 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4036
4037
4038 /**
4039  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4040  * @brief       This API checks if the application has the given category
4041  *
4042  * @par         This API is for package-manager client application
4043  * @par Sync (or) Async : Synchronous API
4044  *
4045  * @param[in]   handle  pointer to the application info handle
4046  * @param[in]   category        category
4047  * @param[out] exist            value Gets whether the application has the given category
4048  * @return      0 if success, error code(<0) if fail
4049  * @retval      PMINFO_R_OK     success
4050  * @retval      PMINFO_R_EINVAL invalid argument
4051  * @retval      PMINFO_R_ERROR  internal error
4052  * @code
4053 static int is_category_exist(const char *appid, const char *category)
4054 {
4055         int ret = 0;
4056         pkgmgrinfo_appinfo_h handle;
4057         bool exist = false;
4058
4059         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4060         if (ret != PMINFO_R_OK)
4061                 return -1;
4062
4063         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4064         if (ret != PMINFO_R_OK) {
4065                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4066                 return -1;
4067         }
4068
4069         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4070         return 0;
4071 }
4072  * @endcode
4073  */
4074 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4075
4076 /**
4077  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4078  * @brief       This API gets the application 'ui_gadget' value from the app ID
4079  *
4080  * @par         This API is for package-manager client application
4081  * @par Sync (or) Async : Synchronous API
4082  *
4083  * @param[in]   handle  pointer to application info handle
4084  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4085  * @return      0 if success, error code(<0) if fail
4086  * @retval      PMINFO_R_OK     success
4087  * @retval      PMINFO_R_EINVAL invalid argument
4088  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4089  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4090  * @code
4091 static int get_app_ui_gadget(const char *appid)
4092 {
4093         int ret = 0;
4094         bool ui_gadget;
4095         pkgmgrinfo_appinfo_h handle = NULL;
4096         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4097         if (ret != PMINFO_R_OK)
4098                 return -1;
4099         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4100         if (ret != PMINFO_R_OK) {
4101                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4102                 return -1;
4103         }
4104         printf("app ui_gadget: %d\n", ui_gadget);
4105         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4106         return 0;
4107 }
4108  * @endcode
4109  */
4110 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4111
4112 /**
4113  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4114  * @brief       This API gets the application 'support_disable' value from the app ID
4115  *
4116  * @par         This API is for package-manager client application
4117  * @par Sync (or) Async : Synchronous API
4118  *
4119  * @param[in]   handle  pointer to application info handle
4120  * @param[out]  support_disable pointer to hold package support_disable value
4121  * @return      0 if success, error code(<0) if fail
4122  * @retval      PMINFO_R_OK     success
4123  * @retval      PMINFO_R_EINVAL invalid argument
4124  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4125  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4126  * @code
4127 static int get_app_support_disable(const char *appid)
4128 {
4129         int ret = 0;
4130         bool support_disable;
4131         pkgmgrinfo_appinfo_h handle = NULL;
4132         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4133         if (ret != PMINFO_R_OK)
4134                 return -1;
4135         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4136         if (ret != PMINFO_R_OK) {
4137                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4138                 return -1;
4139         }
4140         printf("app support_disable: %d\n", support_disable);
4141         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4142         return 0;
4143 }
4144  * @endcode
4145  */
4146 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4147
4148 /**
4149  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4150  * @brief       This API destroys the application information handle freeing up all the resources
4151  *
4152  * @par         This API is for package-manager client application
4153  * @par Sync (or) Async : Synchronous API
4154  *
4155  * @param[in] handle            pointer to the application info handle.
4156  * @return      0 if success, error code(<0) if fail
4157  * @retval      PMINFO_R_OK     success
4158  * @retval      PMINFO_R_EINVAL invalid argument
4159  * @retval      PMINFO_R_ERROR  internal error
4160  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4161  * @post                None
4162  * @see         pkgmgrinfo_appinfo_get_pkgid()
4163  * @see         pkgmgrinfo_appinfo_is_multiple()
4164  * @code
4165 static int get_app_type(const char *appid)
4166 {
4167         int ret = 0;
4168         char *type = NULL;
4169         pkgmgrinfo_appinfo_h handle;
4170         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4171         if (ret != PMINFO_R_OK)
4172                 return -1;
4173         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4174         if (ret != PMINFO_R_OK) {
4175                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4176                 return -1;
4177         }
4178         printf("apptype: %s\n", type);
4179         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4180         return 0;
4181 }
4182  * @endcode
4183  */
4184 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
4185
4186 /**
4187  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4188  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
4189  The query will search the entire application information collected from the manifest file of all the installed packages
4190  *
4191  * @par         This API is for package-manager client application
4192  * @par Sync (or) Async : Synchronous API
4193  *
4194  * @param[out] handle           pointer to the application info filter handle.
4195  * @return      0 if success, error code(<0) if fail
4196  * @retval      PMINFO_R_OK     success
4197  * @retval      PMINFO_R_EINVAL invalid argument
4198  * @retval      PMINFO_R_ERROR  internal error
4199  * @pre         None
4200  * @post                pkgmgrinfo_appinfo_filter_destroy()
4201  * @see         pkgmgrinfo_appinfo_filter_count()
4202  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4203  * @code
4204 static int get_capp_count()
4205 {
4206         int ret = 0;
4207         int count = 0;
4208         pkgmgrinfo_appinfo_filter_h handle;
4209         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4210         if (ret != PMINFO_R_OK)
4211                 return -1;
4212         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4213         if (ret != PMINFO_R_OK) {
4214                 pkgmgrinfo_appinfo_filter_destroy(handle);
4215                 return -1;
4216         }
4217         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4218         if (ret != PMINFO_R_OK) {
4219                 pkgmgrinfo_appinfo_filter_destroy(handle);
4220                 return -1;
4221         }
4222         printf("No of capp: %d\n", count);
4223         pkgmgrinfo_appinfo_filter_destroy(handle);
4224         return 0;
4225 }
4226  * @endcode
4227  */
4228 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4229
4230 /**
4231  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4232  * @brief       This API destroys the application information filter handle freeing up all the resources
4233  *
4234  * @par         This API is for package-manager client application
4235  * @par Sync (or) Async : Synchronous API
4236  *
4237  * @param[in] handle            pointer to the application info filter handle.
4238  * @return      0 if success, error code(<0) if fail
4239  * @retval      PMINFO_R_OK     success
4240  * @retval      PMINFO_R_EINVAL invalid argument
4241  * @retval      PMINFO_R_ERROR  internal error
4242  * @pre         pkgmgrinfo_appinfo_filter_create()
4243  * @post                None
4244  * @see         pkgmgrinfo_appinfo_filter_count()
4245  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4246  * @code
4247 static int get_capp_count()
4248 {
4249         int ret = 0;
4250         int count = 0;
4251         pkgmgrinfo_appinfo_filter_h handle;
4252         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4253         if (ret != PMINFO_R_OK)
4254                 return -1;
4255         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4256         if (ret != PMINFO_R_OK) {
4257                 pkgmgrinfo_appinfo_filter_destroy(handle);
4258                 return -1;
4259         }
4260         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4261         if (ret != PMINFO_R_OK) {
4262                 pkgmgrinfo_appinfo_filter_destroy(handle);
4263                 return -1;
4264         }
4265         printf("No of capp: %d\n", count);
4266         pkgmgrinfo_appinfo_filter_destroy(handle);
4267         return 0;
4268 }
4269  * @endcode
4270  */
4271 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4272
4273 /**
4274  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4275  * @brief       This API adds a boolean filter property to the filter handle
4276  *
4277  * @par         This API is for package-manager client application
4278  * @par Sync (or) Async : Synchronous API
4279  *
4280  * @param[in] handle            pointer to the application info filter handle.
4281  * @param[in] property          boolean property name.
4282  * @param[in] value             value corresponding to the property.
4283  * @return      0 if success, error code(<0) if fail
4284  * @retval      PMINFO_R_OK     success
4285  * @retval      PMINFO_R_EINVAL invalid argument
4286  * @retval      PMINFO_R_ERROR  internal error
4287  * @pre         pkgmgrinfo_appinfo_filter_create()
4288  * @post                pkgmgrinfo_appinfo_filter_destroy()
4289  * @see         pkgmgrinfo_appinfo_filter_count()
4290  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4291  * @code
4292 static int get_taskmanageable_app_count()
4293 {
4294         int ret = 0;
4295         int count = 0;
4296         pkgmgrinfo_appinfo_filter_h handle;
4297         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4298         if (ret != PMINFO_R_OK)
4299                 return -1;
4300         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4301         if (ret != PMINFO_R_OK) {
4302                 pkgmgrinfo_appinfo_filter_destroy(handle);
4303                 return -1;
4304         }
4305         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4306         if (ret != PMINFO_R_OK) {
4307                 pkgmgrinfo_appinfo_filter_destroy(handle);
4308                 return -1;
4309         }
4310         printf("No of taskmanageable apps: %d\n", count);
4311         pkgmgrinfo_appinfo_filter_destroy(handle);
4312         return 0;
4313 }
4314  * @endcode
4315  */
4316 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4317                 const char *property, const bool value);
4318
4319 /**
4320  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4321  * @brief       This API adds an integer filter property to the filter handle
4322  *
4323  * @par         This API is for package-manager client application
4324  * @par Sync (or) Async : Synchronous API
4325  *
4326  * @param[in] handle            pointer to the application info filter handle.
4327  * @param[in] property          integer property name.
4328  * @param[in] value             value corresponding to the property.
4329  * @return      0 if success, error code(<0) if fail
4330  * @retval      PMINFO_R_OK     success
4331  * @retval      PMINFO_R_EINVAL invalid argument
4332  * @retval      PMINFO_R_ERROR  internal error
4333  * @pre         pkgmgrinfo_appinfo_filter_create()
4334  * @post                pkgmgrinfo_appinfo_filter_destroy()
4335  * @see         pkgmgrinfo_appinfo_filter_count()
4336  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4337  * @code
4338 static int get_taskmanageable_app_count()
4339 {
4340         int ret = 0;
4341         int count = 0;
4342         pkgmgrinfo_appinfo_filter_h handle;
4343         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4344         if (ret != PMINFO_R_OK)
4345                 return -1;
4346         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4347         if (ret != PMINFO_R_OK) {
4348                 pkgmgrinfo_appinfo_filter_destroy(handle);
4349                 return -1;
4350         }
4351         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4352         if (ret != PMINFO_R_OK) {
4353                 pkgmgrinfo_appinfo_filter_destroy(handle);
4354                 return -1;
4355         }
4356         printf("No of apps: %d\n", count);
4357         pkgmgrinfo_appinfo_filter_destroy(handle);
4358         return 0;
4359 }
4360  * @endcode
4361  */
4362 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4363                 const char *property, const int value);
4364
4365 /**
4366  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4367  * @brief       This API adds a string filter property to the filter handle
4368  *
4369  * @par         This API is for package-manager client application
4370  * @par Sync (or) Async : Synchronous API
4371  *
4372  * @param[in] handle            pointer to the application info filter handle.
4373  * @param[in] property          string property name.
4374  * @param[in] value             value corresponding to the property.
4375  * @return      0 if success, error code(<0) if fail
4376  * @retval      PMINFO_R_OK     success
4377  * @retval      PMINFO_R_EINVAL invalid argument
4378  * @retval      PMINFO_R_ERROR  internal error
4379  * @pre         pkgmgrinfo_appinfo_filter_create()
4380  * @post                pkgmgrinfo_appinfo_filter_destroy()
4381  * @see         pkgmgrinfo_appinfo_filter_count()
4382  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4383  * @code
4384 static int get_capp_count()
4385 {
4386         int ret = 0;
4387         int count = 0;
4388         pkgmgrinfo_appinfo_filter_h handle;
4389         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4390         if (ret != PMINFO_R_OK)
4391                 return -1;
4392         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4393         if (ret != PMINFO_R_OK) {
4394                 pkgmgrinfo_appinfo_filter_destroy(handle);
4395                 return -1;
4396         }
4397         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4398         if (ret != PMINFO_R_OK) {
4399                 pkgmgrinfo_appinfo_filter_destroy(handle);
4400                 return -1;
4401         }
4402         printf("No of capp: %d\n", count);
4403         pkgmgrinfo_appinfo_filter_destroy(handle);
4404         return 0;
4405 }
4406  * @endcode
4407  */
4408 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4409                 const char *property, const char *value);
4410
4411 /**
4412  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4413  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
4414  *
4415  * @par         This API is for package-manager client application
4416  * @par Sync (or) Async : Synchronous API
4417  *
4418  * @param[in] handle            pointer to the application info filter handle.
4419  * @param[in] app_cb            callback function.
4420  * @param[in] user_data         user data to be passed to the callback function
4421  * @return      0 if success, error code(<0) if fail
4422  * @retval      PMINFO_R_OK     success
4423  * @retval      PMINFO_R_EINVAL invalid argument
4424  * @retval      PMINFO_R_ERROR  internal error
4425  * @pre         pkgmgrinfo_appinfo_filter_create()
4426  * @post                pkgmgrinfo_appinfo_filter_destroy()
4427  * @see         pkgmgrinfo_appinfo_filter_count()
4428  * @code
4429 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4430 {
4431         char *appid = NULL;
4432         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4433         printf("appid : %s\n", appid);
4434         return 0;
4435 }
4436
4437 static int get_capp_list()
4438 {
4439         int ret = 0;
4440         pkgmgrinfo_appinfo_filter_h handle;
4441         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4442         if (ret != PMINFO_R_OK)
4443                 return -1;
4444         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4445         if (ret != PMINFO_R_OK) {
4446                 pkgmgrinfo_appinfo_filter_destroy(handle);
4447                 return -1;
4448         }
4449         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4450         if (ret != PMINFO_R_OK) {
4451                 pkgmgrinfo_appinfo_filter_destroy(handle);
4452                 return -1;
4453         }
4454         pkgmgrinfo_appinfo_filter_destroy(handle);
4455         return 0;
4456 }
4457  * @endcode
4458  */
4459 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4460                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4461 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4462                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4463
4464 /**
4465  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4466  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4467  * @brief       This API counts the application that satisfy the filter conditions
4468  *
4469  * @par         This API is for package-manager client application
4470  * @par Sync (or) Async : Synchronous API
4471  *
4472  * @param[in] handle            pointer to the application info filter handle.
4473  * @param[in] count             pointer to store count value
4474  * @param[in]   uid     the addressee user id of the instruction
4475  * @return      0 if success, error code(<0) if fail
4476  * @retval      PMINFO_R_OK     success
4477  * @retval      PMINFO_R_EINVAL invalid argument
4478  * @retval      PMINFO_R_ERROR  internal error
4479  * @pre         pkgmgrinfo_appinfo_filter_create()
4480  * @post                pkgmgrinfo_appinfo_filter_destroy()
4481  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4482  * @code
4483 static int get_capp_count()
4484 {
4485         int ret = 0;
4486         int count = 0;
4487         pkgmgrinfo_appinfo_filter_h handle;
4488         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4489         if (ret != PMINFO_R_OK)
4490                 return -1;
4491         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4492         if (ret != PMINFO_R_OK) {
4493                 pkgmgrinfo_appinfo_filter_destroy(handle);
4494                 return -1;
4495         }
4496         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4497         if (ret != PMINFO_R_OK) {
4498                 pkgmgrinfo_appinfo_filter_destroy(handle);
4499                 return -1;
4500         }
4501         printf("No of capp: %d\n", count);
4502         pkgmgrinfo_appinfo_filter_destroy(handle);
4503         return 0;
4504 }
4505  * @endcode
4506  */
4507 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4508 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4509 /**
4510  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4511  * @brief       This API creates the application's metadata  information filter handle from db.
4512  *
4513  * @par         This API is for package-manager client application
4514  * @par Sync (or) Async : Synchronous API
4515  *
4516  * @param[out] handle           pointer to the application metadata info filter handle.
4517  * @return      0 if success, error code(<0) if fail
4518  * @retval      PMINFO_R_OK     success
4519  * @retval      PMINFO_R_EINVAL invalid argument
4520  * @retval      PMINFO_R_ERROR  internal error
4521  * @pre         None
4522  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4523  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4524  * @code
4525 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4526 {
4527         char *appid = NULL;
4528         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4529         printf("appid : %s\n", appid);
4530         return 0;
4531 }
4532
4533 static int get_app_list(const char *mkey, const char *mvalue)
4534 {
4535         int ret = 0;
4536         pkgmgrinfo_appinfo_metadata_filter_h handle;
4537         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4538         if (ret != PMINFO_R_OK)
4539                 return -1;
4540         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4541         if (ret != PMINFO_R_OK) {
4542                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4543                 return -1;
4544         }
4545         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4546         if (ret != PMINFO_R_OK) {
4547                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4548                 return -1;
4549         }
4550         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4551         return 0;
4552 }
4553  * @endcode
4554  */
4555 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4556
4557 /**
4558  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4559  * @brief       This API destroys the application's metadata  information filter handle.
4560  *
4561  * @par         This API is for package-manager client application
4562  * @par Sync (or) Async : Synchronous API
4563  *
4564  * @param[in] handle            pointer to the application metadata info filter handle.
4565  * @return      0 if success, error code(<0) if fail
4566  * @retval      PMINFO_R_OK     success
4567  * @retval      PMINFO_R_EINVAL invalid argument
4568  * @retval      PMINFO_R_ERROR  internal error
4569  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4570  * @post                None
4571  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4572  * @code
4573 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4574 {
4575         char *appid = NULL;
4576         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4577         printf("appid : %s\n", appid);
4578         return 0;
4579 }
4580
4581 static int get_app_list(const char *mkey, const char *mvalue)
4582 {
4583         int ret = 0;
4584         pkgmgrinfo_appinfo_metadata_filter_h handle;
4585         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4586         if (ret != PMINFO_R_OK)
4587                 return -1;
4588         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4589         if (ret != PMINFO_R_OK) {
4590                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4591                 return -1;
4592         }
4593         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4594         if (ret != PMINFO_R_OK) {
4595                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4596                 return -1;
4597         }
4598         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4599         return 0;
4600 }
4601  * @endcode
4602  */
4603 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4604
4605 /**
4606  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4607  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
4608  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4609  *
4610  * @par         This API is for package-manager client application
4611  * @par Sync (or) Async : Synchronous API
4612  *
4613  * @param[in] handle            pointer to the application metadata info filter handle.
4614  * @param[in] key                       pointer to metadata key
4615  * @param[in] value                     pointer to metadata value
4616  * @return      0 if success, error code(<0) if fail
4617  * @retval      PMINFO_R_OK     success
4618  * @retval      PMINFO_R_EINVAL invalid argument
4619  * @retval      PMINFO_R_ERROR  internal error
4620  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4621  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4622  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4623  * @code
4624 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4625 {
4626         char *appid = NULL;
4627         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4628         printf("appid : %s\n", appid);
4629         return 0;
4630 }
4631
4632 static int get_app_list(const char *mkey, const char *mvalue)
4633 {
4634         int ret = 0;
4635         pkgmgrinfo_appinfo_metadata_filter_h handle;
4636         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4637         if (ret != PMINFO_R_OK)
4638                 return -1;
4639         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4640         if (ret != PMINFO_R_OK) {
4641                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4642                 return -1;
4643         }
4644         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4645         if (ret != PMINFO_R_OK) {
4646                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4647                 return -1;
4648         }
4649         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4650         return 0;
4651 }
4652  * @endcode
4653  */
4654 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4655                 const char *key, const char *value);
4656
4657 /**
4658  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4659  * @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)
4660  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
4661  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4662  * negative value, no more callbacks will be called and API will return.
4663  *
4664  * @par         This API is for package-manager client application
4665  * @par Sync (or) Async : Synchronous API
4666  *
4667  * @param[in] handle            pointer to the application metadata info filter handle.
4668  * @param[in] app_cb            function pointer to callback
4669  * @param[in] user_data         pointer to user data
4670  * @param[in]   uid     the addressee user id of the instruction
4671  * @return      0 if success, error code(<0) if fail
4672  * @retval      PMINFO_R_OK     success
4673  * @retval      PMINFO_R_EINVAL invalid argument
4674  * @retval      PMINFO_R_ERROR  internal error
4675  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4676  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4677  * @code
4678 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4679 {
4680         char *appid = NULL;
4681         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4682         printf("appid : %s\n", appid);
4683         return 0;
4684 }
4685
4686 static int get_app_list(const char *mkey, const char *mvalue)
4687 {
4688         int ret = 0;
4689         pkgmgrinfo_appinfo_metadata_filter_h handle;
4690         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4691         if (ret != PMINFO_R_OK)
4692                 return -1;
4693         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4694         if (ret != PMINFO_R_OK) {
4695                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4696                 return -1;
4697         }
4698         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4699         if (ret != PMINFO_R_OK) {
4700                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4701                 return -1;
4702         }
4703         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4704         return 0;
4705 }
4706  * @endcode
4707  */
4708 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4709                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4710 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4711                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4712 /**
4713  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4714  * @brief       This API creates the package cert information handle to get data from db.
4715  *
4716  * @par         This API is for package-manager client application
4717  * @par Sync (or) Async : Synchronous API
4718  *
4719  * @param[out] handle           pointer to the package cert handle.
4720  * @return      0 if success, error code(<0) if fail
4721  * @retval      PMINFO_R_OK     success
4722  * @retval      PMINFO_R_EINVAL invalid argument
4723  * @retval      PMINFO_R_ERROR  internal error
4724  * @pre         None
4725  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4726  * @see         pkgmgrinfo_pkginfo_get_cert_value()
4727  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4728  * @code
4729 static int get_cert_info(const char *pkgid)
4730 {
4731         int ret = 0;
4732         pkgmgrinfo_certinfo_h handle;
4733         char *auth_cert = NULL;
4734         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4735         if (ret != PMINFO_R_OK)
4736                 return -1;
4737         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4738         if (ret != PMINFO_R_OK) {
4739                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4740                 return -1;
4741         }
4742         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4743         if (ret != PMINFO_R_OK) {
4744                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4745                 return -1;
4746         }
4747         printf("Author root certificate: %s\n", auth_root);
4748         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4749         return 0;
4750 }
4751  * @endcode
4752  */
4753 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4754
4755 /**
4756  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4757  * @brief       This API loads the package cert information handle with data from db.
4758  *
4759  * @par         This API is for package-manager client application
4760  * @par Sync (or) Async : Synchronous API
4761  *
4762  * @param[in] pkgid             pointer to the package ID.
4763  * @param[in] handle            pointer to the package cert handle.
4764  * @return      0 if success, error code(<0) if fail
4765  * @retval      PMINFO_R_OK     success
4766  * @retval      PMINFO_R_EINVAL invalid argument
4767  * @retval      PMINFO_R_ERROR  internal error
4768  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4769  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4770  * @see         pkgmgrinfo_pkginfo_get_cert_value()
4771  * @code
4772 static int get_cert_info(const char *pkgid)
4773 {
4774         int ret = 0;
4775         pkgmgrinfo_certinfo_h handle;
4776         char *auth_cert = NULL;
4777         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4778         if (ret != PMINFO_R_OK)
4779                 return -1;
4780         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4781         if (ret != PMINFO_R_OK) {
4782                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4783                 return -1;
4784         }
4785         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4786         if (ret != PMINFO_R_OK) {
4787                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4788                 return -1;
4789         }
4790         printf("Author root certificate: %s\n", auth_root);
4791         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4792         return 0;
4793 }
4794  * @endcode
4795  */
4796 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4797
4798 /**
4799  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4800  * @brief       This API gets the package cert information from the handle
4801  *
4802  * @par         This API is for package-manager client application
4803  * @par Sync (or) Async : Synchronous API
4804  *
4805  * @param[in] handle            pointer to the package cert handle.
4806  * @param[in] cert_type         certificate type
4807  * @param[out] cert_value       pointer to hold certificate value
4808  * @return      0 if success, error code(<0) if fail
4809  * @retval      PMINFO_R_OK     success
4810  * @retval      PMINFO_R_EINVAL invalid argument
4811  * @retval      PMINFO_R_ERROR  internal error
4812  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4813  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4814  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4815  * @code
4816 static int get_cert_info(const char *pkgid)
4817 {
4818         int ret = 0;
4819         pkgmgrinfo_certinfo_h handle;
4820         char *auth_cert = NULL;
4821         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4822         if (ret != PMINFO_R_OK)
4823                 return -1;
4824         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4825         if (ret != PMINFO_R_OK) {
4826                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4827                 return -1;
4828         }
4829         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4830         if (ret != PMINFO_R_OK) {
4831                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4832                 return -1;
4833         }
4834         printf("Author root certificate: %s\n", auth_root);
4835         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4836         return 0;
4837 }
4838  * @endcode
4839  */
4840 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4841
4842 /**
4843  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4844  * @brief       This API destroys the package cert information handle freeing up all the resources
4845  *
4846  * @par         This API is for package-manager client application
4847  * @par Sync (or) Async : Synchronous API
4848  *
4849  * @param[in] handle            pointer to the package cert handle.
4850  * @return      0 if success, error code(<0) if fail
4851  * @retval      PMINFO_R_OK     success
4852  * @retval      PMINFO_R_EINVAL invalid argument
4853  * @retval      PMINFO_R_ERROR  internal error
4854  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
4855  * @post                None
4856  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4857  * @code
4858 static int get_cert_info(const char *pkgid)
4859 {
4860         int ret = 0;
4861         pkgmgrinfo_certinfo_h handle;
4862         char *auth_cert = NULL;
4863         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4864         if (ret != PMINFO_R_OK)
4865                 return -1;
4866         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4867         if (ret != PMINFO_R_OK) {
4868                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4869                 return -1;
4870         }
4871         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4872         if (ret != PMINFO_R_OK) {
4873                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4874                 return -1;
4875         }
4876         printf("Author root certificate: %s\n", auth_root);
4877         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4878         return 0;
4879 }
4880  * @endcode
4881  */
4882 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4883
4884 /**
4885  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4886  * @brief       This API deletes the package cert information from DB
4887  *
4888  * @par         This API is for package-manager client application
4889  * @par Sync (or) Async : Synchronous API
4890  *
4891  * @param[in] pkgid             pointer to the package ID.
4892  * @return      0 if success, error code(<0) if fail
4893  * @retval      PMINFO_R_OK     success
4894  * @retval      PMINFO_R_EINVAL invalid argument
4895  * @retval      PMINFO_R_ERROR  internal error
4896  * @pre         None
4897  * @post                None
4898  * @code
4899 static int delete_cert_info(const char *pkgid)
4900 {
4901         int ret = 0;
4902         ret = pkgmgrinfo_delete_certinfo(pkgid);
4903         if (ret != PMINFO_R_OK)
4904                 return -1;
4905         return 0;
4906 }
4907  * @endcode
4908  */
4909  int pkgmgrinfo_delete_certinfo(const char *pkgid);
4910  int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4911 /**
4912  * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4913  * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4914  * @brief       This API creates the package db information handle to set data in db.
4915  *
4916  * @par         This API is for package-manager client application
4917  * @par Sync (or) Async : Synchronous API
4918  *
4919  * @param[in] pkgid     pointer to the package ID.
4920  * @param[in]   uid     the addressee user id of the instruction
4921  * @param[out] handle           pointer to the package db info handle.
4922  * @return      0 if success, error code(<0) if fail
4923  * @retval      PMINFO_R_OK     success
4924  * @retval      PMINFO_R_EINVAL invalid argument
4925  * @retval      PMINFO_R_ERROR  internal error
4926  * @pre         None
4927  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4928  * @see         pkgmgrinfo_save_pkgdbinfo()
4929  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
4930  * @code
4931 static int set_pkg_in_db(const char *pkgid)
4932 {
4933         int ret = 0;
4934         pkgmgrinfo_pkgdbinfo_h handle;
4935         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4936         if (ret != PMINFO_R_OK)
4937                 return -1;
4938         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4939         if (ret != PMINFO_R_OK) {
4940                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4941                 return -1;
4942         }
4943         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4944         if (ret != PMINFO_R_OK) {
4945                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4946                 return -1;
4947         }
4948         pkgmgrinfo_destroy_pkgdbinfo(handle);
4949         return 0;
4950 }
4951  * @endcode
4952  */
4953 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4954 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4955
4956 /**
4957  * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4958  * @brief       This API sets the package type in db handle
4959  *
4960  * @par         This API is for package-manager client application
4961  * @par Sync (or) Async : Synchronous API
4962  *
4963  * @param[in] handle    pointer to the pkgdbinfo handle.
4964  * @param[in] type              pointer to the package type.
4965  * @return      0 if success, error code(<0) if fail
4966  * @retval      PMINFO_R_OK     success
4967  * @retval      PMINFO_R_EINVAL invalid argument
4968  * @retval      PMINFO_R_ERROR  internal error
4969  * @pre         pkgmgrinfo_create_pkgdbinfo()
4970  * @post                pkgmgrinfo_destroy_pkgdbinfo()
4971  * @see         pkgmgrinfo_save_pkgdbinfo()
4972  * @see         pkgmgrinfo_set_version_to_pkgdbinfo()
4973  * @code
4974 static int set_pkg_type_in_db(const char *pkgid)
4975 {
4976         int ret = 0;
4977         pkgmgrinfo_pkgdbinfo_h handle;
4978         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4979         if (ret != PMINFO_R_OK)
4980                 return -1;
4981         ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4982         if (ret != PMINFO_R_OK) {
4983                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4984                 return -1;
4985         }
4986         ret = pkgmgrinfo_save_pkgdbinfo(handle);
4987         if (ret != PMINFO_R_OK) {
4988                 pkgmgrinfo_destroy_pkgdbinfo(handle);
4989                 return -1;
4990         }
4991         pkgmgrinfo_destroy_pkgdbinfo(handle);
4992         return 0;
4993 }
4994  * @endcode
4995  */
4996 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4997
4998 /**
4999  * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
5000  * @brief       This API sets the package version in db handle
5001  *
5002  * @par         This API is for package-manager client application
5003  * @par Sync (or) Async : Synchronous API
5004  *
5005  * @param[in] handle    pointer to the pkgdbinfo handle.
5006  * @param[in] version           pointer to the package version
5007  * @return      0 if success, error code(<0) if fail
5008  * @retval      PMINFO_R_OK     success
5009  * @retval      PMINFO_R_EINVAL invalid argument
5010  * @retval      PMINFO_R_ERROR  internal error
5011  * @pre         pkgmgrinfo_create_pkgdbinfo()
5012  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5013  * @see         pkgmgrinfo_save_pkgdbinfo()
5014  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5015  * @code
5016 static int set_pkg_version_in_db(const char *pkgid)
5017 {
5018         int ret = 0;
5019         pkgmgrinfo_pkgdbinfo_h handle;
5020         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5021         if (ret != PMINFO_R_OK)
5022                 return -1;
5023         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5024         if (ret != PMINFO_R_OK) {
5025                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5026                 return -1;
5027         }
5028         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5029         if (ret != PMINFO_R_OK) {
5030                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5031                 return -1;
5032         }
5033         pkgmgrinfo_destroy_pkgdbinfo(handle);
5034         return 0;
5035 }
5036  * @endcode
5037  */
5038 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
5039
5040 /**
5041  * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5042  * @brief       This API sets the package install location in db handle
5043  *
5044  * @par         This API is for package-manager client application
5045  * @par Sync (or) Async : Synchronous API
5046  *
5047  * @param[in] handle    pointer to the pkgdbinfo handle.
5048  * @param[in] location  package install location
5049  * @return      0 if success, error code(<0) if fail
5050  * @retval      PMINFO_R_OK     success
5051  * @retval      PMINFO_R_EINVAL invalid argument
5052  * @retval      PMINFO_R_ERROR  internal error
5053  * @pre         pkgmgrinfo_create_pkgdbinfo()
5054  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5055  * @see         pkgmgrinfo_save_pkgdbinfo()
5056  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5057  * @code
5058 static int set_pkg_install_location_in_db(const char *pkgid)
5059 {
5060         int ret = 0;
5061         pkgmgrinfo_pkgdbinfo_h handle;
5062         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5063         if (ret != PMINFO_R_OK)
5064                 return -1;
5065         ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5066         if (ret != PMINFO_R_OK) {
5067                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5068                 return -1;
5069         }
5070         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5071         if (ret != PMINFO_R_OK) {
5072                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5073                 return -1;
5074         }
5075         pkgmgrinfo_destroy_pkgdbinfo(handle);
5076         return 0;
5077 }
5078  * @endcode
5079  */
5080 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5081
5082 /**
5083  * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
5084  * @brief       This API sets the package size in db handle
5085  *
5086  * @par         This API is for package-manager client application
5087  * @par Sync (or) Async : Synchronous API
5088  *
5089  * @param[in] handle    pointer to the pkgdbinfo handle.
5090  * @param[in] size              pointer to the package size
5091  * @return      0 if success, error code(<0) if fail
5092  * @retval      PMINFO_R_OK     success
5093  * @retval      PMINFO_R_EINVAL invalid argument
5094  * @retval      PMINFO_R_ERROR  internal error
5095  * @pre         pkgmgrinfo_create_pkgdbinfo()
5096  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5097  * @see         pkgmgrinfo_save_pkgdbinfo()
5098  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5099  * @code
5100 static int set_pkg_size_in_db(const char *pkgid)
5101 {
5102         int ret = 0;
5103         pkgmgrinfo_pkgdbinfo_h handle;
5104         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5105         if (ret != PMINFO_R_OK)
5106                 return -1;
5107         ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
5108         if (ret != PMINFO_R_OK) {
5109                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5110                 return -1;
5111         }
5112         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5113         if (ret != PMINFO_R_OK) {
5114                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5115                 return -1;
5116         }
5117         pkgmgrinfo_destroy_pkgdbinfo(handle);
5118         return 0;
5119 }
5120  * @endcode
5121  */
5122 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
5123
5124 /**
5125  * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
5126  * @brief       This API sets the package label in db handle
5127  *
5128  * @par         This API is for package-manager client application
5129  * @par Sync (or) Async : Synchronous API
5130  *
5131  * @param[in] handle    pointer to the pkgdbinfo handle.
5132  * @param[in] label             pointer to the package label
5133  * @param[in] locale    pointer to the locale
5134  * @return      0 if success, error code(<0) if fail
5135  * @retval      PMINFO_R_OK     success
5136  * @retval      PMINFO_R_EINVAL invalid argument
5137  * @retval      PMINFO_R_ERROR  internal error
5138  * @pre         pkgmgrinfo_create_pkgdbinfo()
5139  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5140  * @see         pkgmgrinfo_save_pkgdbinfo()
5141  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5142  * @code
5143 static int set_pkg_label_in_db(const char *pkgid)
5144 {
5145         int ret = 0;
5146         pkgmgrinfo_pkgdbinfo_h handle;
5147         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5148         if (ret != PMINFO_R_OK)
5149                 return -1;
5150         ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
5151         if (ret != PMINFO_R_OK) {
5152                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5153                 return -1;
5154         }
5155         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5156         if (ret != PMINFO_R_OK) {
5157                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5158                 return -1;
5159         }
5160         pkgmgrinfo_destroy_pkgdbinfo(handle);
5161         return 0;
5162 }
5163  * @endcode
5164  */
5165 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
5166
5167 /**
5168  * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
5169  * @brief       This API sets the package icon in db handle
5170  *
5171  * @par         This API is for package-manager client application
5172  * @par Sync (or) Async : Synchronous API
5173  *
5174  * @param[in] handle    pointer to the pkgdbinfo handle.
5175  * @param[in] icon              pointer to the package icon
5176  * @param[in] locale    pointer to the locale
5177  * @return      0 if success, error code(<0) if fail
5178  * @retval      PMINFO_R_OK     success
5179  * @retval      PMINFO_R_EINVAL invalid argument
5180  * @retval      PMINFO_R_ERROR  internal error
5181  * @pre         pkgmgrinfo_create_pkgdbinfo()
5182  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5183  * @see         pkgmgrinfo_save_pkgdbinfo()
5184  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5185  * @code
5186 static int set_pkg_icon_in_db(const char *pkgid)
5187 {
5188         int ret = 0;
5189         pkgmgrinfo_pkgdbinfo_h handle;
5190         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5191         if (ret != PMINFO_R_OK)
5192                 return -1;
5193         ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5194         if (ret != PMINFO_R_OK) {
5195                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5196                 return -1;
5197         }
5198         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5199         if (ret != PMINFO_R_OK) {
5200                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5201                 return -1;
5202         }
5203         pkgmgrinfo_destroy_pkgdbinfo(handle);
5204         return 0;
5205 }
5206  * @endcode
5207  */
5208 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5209
5210 /**
5211  * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5212  * @brief       This API sets the package description in db handle
5213  *
5214  * @par         This API is for package-manager client application
5215  * @par Sync (or) Async : Synchronous API
5216  *
5217  * @param[in] handle    pointer to the pkgdbinfo handle.
5218  * @param[in] description               pointer to the package description
5219  * @param[in] locale    pointer to the locale
5220  * @return      0 if success, error code(<0) if fail
5221  * @retval      PMINFO_R_OK     success
5222  * @retval      PMINFO_R_EINVAL invalid argument
5223  * @retval      PMINFO_R_ERROR  internal error
5224  * @pre         pkgmgrinfo_create_pkgdbinfo()
5225  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5226  * @see         pkgmgrinfo_save_pkgdbinfo()
5227  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5228  * @code
5229 static int set_pkg_description_in_db(const char *pkgid)
5230 {
5231         int ret = 0;
5232         pkgmgrinfo_pkgdbinfo_h handle;
5233         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5234         if (ret != PMINFO_R_OK)
5235                 return -1;
5236         ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5237         if (ret != PMINFO_R_OK) {
5238                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5239                 return -1;
5240         }
5241         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5242         if (ret != PMINFO_R_OK) {
5243                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5244                 return -1;
5245         }
5246         pkgmgrinfo_destroy_pkgdbinfo(handle);
5247         return 0;
5248 }
5249  * @endcode
5250  */
5251 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5252
5253 /**
5254  * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5255  const char *author_email, const char *author_href, const char *locale)
5256  * @brief       This API sets the package author info in db handle
5257  *
5258  * @par         This API is for package-manager client application
5259  * @par Sync (or) Async : Synchronous API
5260  *
5261  * @param[in] handle    pointer to the pkgdbinfo handle.
5262  * @param[in] author_name               pointer to the package author name
5263  * @param[in] author_email              pointer to the package author email
5264  * @param[in] author_href               pointer to the package author href
5265  * @param[in] locale    pointer to the locale
5266  * @return      0 if success, error code(<0) if fail
5267  * @retval      PMINFO_R_OK     success
5268  * @retval      PMINFO_R_EINVAL invalid argument
5269  * @retval      PMINFO_R_ERROR  internal error
5270  * @pre         pkgmgrinfo_create_pkgdbinfo()
5271  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5272  * @see         pkgmgrinfo_save_pkgdbinfo()
5273  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5274  * @code
5275 static int set_pkg_author_in_db(const char *pkgid)
5276 {
5277         int ret = 0;
5278         pkgmgrinfo_pkgdbinfo_h handle;
5279         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5280         if (ret != PMINFO_R_OK)
5281                 return -1;
5282         ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5283         if (ret != PMINFO_R_OK) {
5284                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5285                 return -1;
5286         }
5287         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5288         if (ret != PMINFO_R_OK) {
5289                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5290                 return -1;
5291         }
5292         pkgmgrinfo_destroy_pkgdbinfo(handle);
5293         return 0;
5294 }
5295  * @endcode
5296  */
5297 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5298                         const char *author_email, const char *author_href, const char *locale);
5299
5300 /**
5301  * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5302  * @brief       This API sets the package 'removable' value in db handle
5303  *
5304  * @par         This API is for package-manager client application
5305  * @par Sync (or) Async : Synchronous API
5306  *
5307  * @param[in] handle    pointer to the pkgdbinfo handle.
5308  * @param[in] removable         package removable value
5309  * @return      0 if success, error code(<0) if fail
5310  * @retval      PMINFO_R_OK     success
5311  * @retval      PMINFO_R_EINVAL invalid argument
5312  * @retval      PMINFO_R_ERROR  internal error
5313  * @pre         pkgmgrinfo_create_pkgdbinfo()
5314  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5315  * @see         pkgmgrinfo_save_pkgdbinfo()
5316  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5317  * @code
5318 static int set_pkg_removable_in_db(const char *pkgid)
5319 {
5320         int ret = 0;
5321         pkgmgrinfo_pkgdbinfo_h handle;
5322         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5323         if (ret != PMINFO_R_OK)
5324                 return -1;
5325         ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5326         if (ret != PMINFO_R_OK) {
5327                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5328                 return -1;
5329         }
5330         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5331         if (ret != PMINFO_R_OK) {
5332                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5333                 return -1;
5334         }
5335         pkgmgrinfo_destroy_pkgdbinfo(handle);
5336         return 0;
5337 }
5338  * @endcode
5339  */
5340 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5341
5342 /**
5343  * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5344  * @brief       This API sets the package 'preload' value in db handle
5345  *
5346  * @par         This API is for package-manager client application
5347  * @par Sync (or) Async : Synchronous API
5348  *
5349  * @param[in] handle    pointer to the pkgdbinfo handle.
5350  * @param[in] preload           package preload value
5351  * @return      0 if success, error code(<0) if fail
5352  * @retval      PMINFO_R_OK     success
5353  * @retval      PMINFO_R_EINVAL invalid argument
5354  * @retval      PMINFO_R_ERROR  internal error
5355  * @pre         pkgmgrinfo_create_pkgdbinfo()
5356  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5357  * @see         pkgmgrinfo_save_pkgdbinfo()
5358  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5359  * @code
5360 static int set_pkg_preload_in_db(const char *pkgid)
5361 {
5362         int ret = 0;
5363         pkgmgrinfo_pkgdbinfo_h handle;
5364         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5365         if (ret != PMINFO_R_OK)
5366                 return -1;
5367         ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5368         if (ret != PMINFO_R_OK) {
5369                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5370                 return -1;
5371         }
5372         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5373         if (ret != PMINFO_R_OK) {
5374                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5375                 return -1;
5376         }
5377         pkgmgrinfo_destroy_pkgdbinfo(handle);
5378         return 0;
5379 }
5380  * @endcode
5381  */
5382 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5383
5384 /**
5385  * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5386  * @brief       This API sets the package 'installed_storage' value in db handle
5387  *
5388  * @par         This API is for package-manager client application
5389  * @par Sync (or) Async : Synchronous API
5390  *
5391  * @param[in] handle    pointer to the pkgdbinfo handle.
5392  * @param[in] location          installed_storage value
5393  * @return      0 if success, error code(<0) if fail
5394  * @retval      PMINFO_R_OK     success
5395  * @retval      PMINFO_R_EINVAL invalid argument
5396  * @retval      PMINFO_R_ERROR  internal error
5397  * @pre         pkgmgrinfo_create_pkgdbinfo()
5398  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5399  * @see         pkgmgrinfo_save_pkgdbinfo()
5400  * @code
5401 static int set_pkg_installed_storage_in_db(const char *pkgid)
5402 {
5403         int ret = 0;
5404         pkgmgrinfo_pkgdbinfo_h handle;
5405         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5406         if (ret != PMINFO_R_OK)
5407                 return -1;
5408         ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5409         if (ret != PMINFO_R_OK) {
5410                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5411                 return -1;
5412         }
5413         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5414         if (ret != PMINFO_R_OK) {
5415                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5416                 return -1;
5417         }
5418         pkgmgrinfo_destroy_pkgdbinfo(handle);
5419         return 0;
5420 }
5421  * @endcode
5422  */
5423 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5424
5425 /**
5426  * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5427  * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5428  * @brief       This API saves all the information from the handle to the DB.
5429  *
5430  * @par         This API is for package-manager client application
5431  * @par Sync (or) Async : Synchronous API
5432  *
5433  * @param[in] handle            pointer to the package db info handle.
5434  * @param[in]   uid     the addressee user id of the instruction
5435  * @return      0 if success, error code(<0) if fail
5436  * @retval      PMINFO_R_OK     success
5437  * @retval      PMINFO_R_EINVAL invalid argument
5438  * @retval      PMINFO_R_ERROR  internal error
5439  * @pre         pkgmgrinfo_create_pkgdbinfo()
5440  * @post                pkgmgrinfo_destroy_pkgdbinfo()
5441  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5442  * @code
5443 static int set_pkg_in_db(const char *pkgid)
5444 {
5445         int ret = 0;
5446         pkgmgrinfo_pkgdbinfo_h handle;
5447         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5448         if (ret != PMINFO_R_OK)
5449                 return -1;
5450         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5451         if (ret != PMINFO_R_OK) {
5452                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5453                 return -1;
5454         }
5455         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5456         if (ret != PMINFO_R_OK) {
5457                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5458                 return -1;
5459         }
5460         pkgmgrinfo_destroy_pkgdbinfo(handle);
5461         return 0;
5462 }
5463  * @endcode
5464  */
5465 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5466 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5467 /**
5468  * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5469  * @brief       This API destroys the package db information handle freeing up all the resources
5470  *
5471  * @par         This API is for package-manager client application
5472  * @par Sync (or) Async : Synchronous API
5473  *
5474  * @param[in] handle            pointer to the package db info handle.
5475  * @return      0 if success, error code(<0) if fail
5476  * @retval      PMINFO_R_OK     success
5477  * @retval      PMINFO_R_EINVAL invalid argument
5478  * @retval      PMINFO_R_ERROR  internal error
5479  * @pre         pkgmgrinfo_create_pkgdbinfo()
5480  * @post                None
5481  * @see         pkgmgrinfo_save_pkgdbinfo()
5482  * @see         pkgmgrinfo_set_type_to_pkgdbinfo()
5483  * @code
5484 static int set_pkg_in_db(const char *pkgid)
5485 {
5486         int ret = 0;
5487         pkgmgrinfo_pkgdbinfo_h handle;
5488         ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5489         if (ret != PMINFO_R_OK)
5490                 return -1;
5491         ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5492         if (ret != PMINFO_R_OK) {
5493                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5494                 return -1;
5495         }
5496         ret = pkgmgrinfo_save_pkgdbinfo(handle);
5497         if (ret != PMINFO_R_OK) {
5498                 pkgmgrinfo_destroy_pkgdbinfo(handle);
5499                 return -1;
5500         }
5501         pkgmgrinfo_destroy_pkgdbinfo(handle);
5502         return 0;
5503 }
5504  * @endcode
5505  */
5506 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5507
5508
5509 /**
5510  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5511  * @brief       This API creates the package cert information handle to set data in db.
5512  *
5513  * @par         This API is for package-manager client application
5514  * @par Sync (or) Async : Synchronous API
5515  *
5516  * @param[out] handle           pointer to the package cert handle.
5517  * @return      0 if success, error code(<0) if fail
5518  * @retval      PMINFO_R_OK     success
5519  * @retval      PMINFO_R_EINVAL invalid argument
5520  * @retval      PMINFO_R_ERROR  internal error
5521  * @pre         None
5522  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5523  * @see         pkgmgrinfo_set_cert_value()
5524  * @see         pkgmgrinfo_save_certinfo()
5525  * @code
5526 static int set_cert_in_db(const char *pkgid)
5527 {
5528         int ret = 0;
5529         pkgmgrinfo_instcertinfo_h handle;
5530         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5531         if (ret != PMINFO_R_OK)
5532                 return -1;
5533         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5534         if (ret != PMINFO_R_OK) {
5535                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5536                 return -1;
5537         }
5538         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5539         if (ret != PMINFO_R_OK) {
5540                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5541                 return -1;
5542         }
5543         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5544         return 0;
5545 }
5546  * @endcode
5547  */
5548 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5549
5550 /**
5551  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5552  * @brief       This API sets the package cert information in the handle.
5553  *
5554  * @par         This API is for package-manager client application
5555  * @par Sync (or) Async : Synchronous API
5556  *
5557  * @param[in] handle            pointer to the package cert handle.
5558  * @param[in] cert_type         certificate type.
5559  * @param[in] cert_value        certificate value.
5560  * @return      0 if success, error code(<0) if fail
5561  * @retval      PMINFO_R_OK     success
5562  * @retval      PMINFO_R_EINVAL invalid argument
5563  * @retval      PMINFO_R_ERROR  internal error
5564  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5565  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5566  * @see         pkgmgrinfo_save_certinfo()
5567  * @code
5568 static int set_cert_in_db(const char *pkgid)
5569 {
5570         int ret = 0;
5571         pkgmgrinfo_instcertinfo_h handle;
5572         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5573         if (ret != PMINFO_R_OK)
5574                 return -1;
5575         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5576         if (ret != PMINFO_R_OK) {
5577                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5578                 return -1;
5579         }
5580         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5581         if (ret != PMINFO_R_OK) {
5582                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5583                 return -1;
5584         }
5585         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5586         return 0;
5587 }
5588  * @endcode
5589  */
5590 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5591
5592 /**
5593  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5594  * @brief       This API saves the package cert information in the DB.
5595  *
5596  * @par         This API is for package-manager client application
5597  * @par Sync (or) Async : Synchronous API
5598  *
5599  * @param[in] pkgid             pointer to the package ID.
5600  * @param[in] handle            pointer to the package cert handle.
5601  * @return      0 if success, error code(<0) if fail
5602  * @retval      PMINFO_R_OK     success
5603  * @retval      PMINFO_R_EINVAL invalid argument
5604  * @retval      PMINFO_R_ERROR  internal error
5605  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5606  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5607  * @see         pkgmgrinfo_save_certinfo()
5608  * @code
5609 static int set_cert_in_db(const char *pkgid)
5610 {
5611         int ret = 0;
5612         pkgmgrinfo_instcertinfo_h handle;
5613         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5614         if (ret != PMINFO_R_OK)
5615                 return -1;
5616         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5617         if (ret != PMINFO_R_OK) {
5618                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5619                 return -1;
5620         }
5621         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5622         if (ret != PMINFO_R_OK) {
5623                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5624                 return -1;
5625         }
5626         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5627         return 0;
5628 }
5629  * @endcode
5630  */
5631 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5632
5633 /**
5634  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5635  * @brief       This API destroys the package cert information handle freeing up all the resources.
5636  *
5637  * @par         This API is for package-manager client application
5638  * @par Sync (or) Async : Synchronous API
5639  *
5640  * @param[in] handle            pointer to the package cert handle.
5641  * @return      0 if success, error code(<0) if fail
5642  * @retval      PMINFO_R_OK     success
5643  * @retval      PMINFO_R_EINVAL invalid argument
5644  * @retval      PMINFO_R_ERROR  internal error
5645  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5646  * @post                None
5647  * @see         pkgmgrinfo_save_certinfo()
5648  * @code
5649 static int set_cert_in_db(const char *pkgid)
5650 {
5651         int ret = 0;
5652         pkgmgrinfo_instcertinfo_h handle;
5653         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5654         if (ret != PMINFO_R_OK)
5655                 return -1;
5656         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5657         if (ret != PMINFO_R_OK) {
5658                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5659                 return -1;
5660         }
5661         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5662         if (ret != PMINFO_R_OK) {
5663                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5664                 return -1;
5665         }
5666         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5667         return 0;
5668 }
5669  * @endcode
5670  */
5671 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5672
5673 /**
5674  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5675  * @brief       This API gets the datacontrol info
5676  *
5677  * @par         This API is for package-manager client application
5678  * @par Sync (or) Async : Synchronous API
5679  *
5680  * @param[in] providerid                pointer to the providerid of dataconltrol.
5681  * @param[in] type                      pointer to the type of dataconltrol.
5682  * @param[out] appid                    pointer to hold appid, need to free after using
5683  * @param[out] access                   pointer to hold access, need to free after using
5684  * @return      0 if success, error code(<0) if fail
5685  * @retval      PMINFO_R_OK     success
5686  * @retval      PMINFO_R_EINVAL invalid argument
5687  * @retval      PMINFO_R_ERROR  internal error
5688  * @endcode
5689  */
5690 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5691
5692 /**
5693  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5694  * @brief       This API gets the application 'guest mode visibility' value from the DB
5695  *
5696  * @par         This API is for package-manager client application
5697  * @par Sync (or) Async : Synchronous API
5698  *
5699  * @param[in]   handle  pointer to application info handle
5700  * @param[out] status           pointer to hold app guest mode visibility value
5701  * @return      0 if success, error code(<0) if fail
5702  * @retval      PMINFO_R_OK     success
5703  * @retval      PMINFO_R_EINVAL invalid argument
5704  * @retval      PMINFO_R_ERROR  internal error
5705  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5706  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5707  * @see         pkgmgrinfo_appinfo_get_appid()
5708  * @see         pkgmgrinfo_appinfo_is_multiple()
5709  * @code
5710 static int get_app_guestmode_visibility(const char *appid)
5711 {
5712         int ret = 0;
5713         bool status;
5714         pkgmgrinfo_appinfo_h handle;
5715         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5716         if (ret != PMINFO_R_OK)
5717                 return -1;
5718         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5719         if (ret != PMINFO_R_OK) {
5720                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5721                 return -1;
5722         }
5723         printf("app guest mode visibility: %d\n", status);
5724         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5725         return 0;
5726 }
5727  * @endcode
5728  */
5729  int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5730
5731 /**
5732  * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5733  * @brief       This API sets the application 'guest mode visibility' value in the DB
5734  *
5735  * @par         This API is for package-manager client application
5736  * @par Sync (or) Async : Synchronous API
5737  *
5738  * @param[in]   handle  pointer to application info handle
5739  * @param[out] status   app guest mode visibility value
5740  * @return      0 if success, error code(<0) if fail
5741  * @retval      PMINFO_R_OK     success
5742  * @retval      PMINFO_R_EINVAL invalid argument
5743  * @retval      PMINFO_R_ERROR  internal error
5744  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5745  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5746  * @see         pkgmgrinfo_appinfo_get_appid()
5747  * @see         pkgmgrinfo_appinfo_is_multiple()
5748  * @code
5749 static int set_app_guestmode_visibility(const char *appid, bool value)
5750 {
5751         int ret = 0;
5752         pkgmgrinfo_appinfo_h handle;
5753         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5754         if (ret != PMINFO_R_OK)
5755                 return -1;
5756         ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5757         if (ret != PMINFO_R_OK) {
5758                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5759                 return -1;
5760         }
5761         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5762         return 0;
5763 }
5764  * @endcode
5765  */
5766  int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5767  int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5768
5769 /**
5770 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5771 * @brief         This API sets the package 'installed_storage' value in db
5772 *
5773 * @par   This API is for package-manager client application
5774 * @par Sync (or) Async : Synchronous API
5775 *
5776 * @param[in] pkgid       pointer to the package ID.
5777 * @param[in] location  package install location
5778 * @return  0 if success, error code(<0) if fail
5779 * @retval  PMINFO_R_OK success
5780 * @retval  PMINFO_R_EINVAL       invalid argument
5781 * @retval  PMINFO_R_ERROR internal error
5782 * @code
5783 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5784 {
5785         int ret = 0;
5786
5787         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5788         if (ret != PMINFO_R_OK) {
5789                 return -1;
5790         }
5791         return 0;
5792 }
5793 * @endcode
5794 */
5795  int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5796  int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5797
5798 /**
5799  * @pkgmgrinfo client API
5800 **/
5801
5802 /**
5803  * @brief listening status type in pkgmgrinfo.
5804  */
5805 #define PMINFO_CLIENT_STATUS_ALL                                                0x00
5806 #define PMINFO_CLIENT_STATUS_INSTALL                                    0x01
5807 #define PMINFO_CLIENT_STATUS_UNINSTALL                                  0x02
5808 #define PMINFO_CLIENT_STATUS_UPGRADE                                    0x04
5809 #define PMINFO_CLIENT_STATUS_MOVE                                               0x08
5810 #define PMINFO_CLIENT_STATUS_CLEAR_DATA                                 0x10
5811 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS                   0x20
5812
5813 /**
5814  * @brief       This APIs provides pkgmgrinfo client listener
5815  */
5816 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5817 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5818 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5819 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5820 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5821
5822
5823 /**
5824  * @pkgmgrinfo client API end
5825 **/
5826
5827
5828 /** @} */
5829 #ifdef __cplusplus
5830 }
5831 #endif
5832 #endif                          /* __PKG_INFO_H__ */
5833 /**
5834  * @}
5835  * @}
5836  */
5837