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