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