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