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