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