Add splash screen display field for appinfo table
[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  * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1113  * @brief       This API gets the root path of package
1114  *
1115  * @par Sync (or) Async : Synchronous API
1116  *
1117  * @param[in] handle            pointer to package info handle
1118  * @param[out] path             pointer to hold root path of package
1119  * @return      0 if success, error code(<0) if fail
1120  * @retval      PMINFO_R_OK     success
1121  * @retval      PMINFO_R_EINVAL invalid argument
1122  * @retval      PMINFO_R_ERROR  internal error
1123  * @code
1124 static int get_root_path(const char *pkgid)
1125 {
1126         int ret = 0;
1127         char *path = 0;
1128         pkgmgrinfo_pkginfo_h handle;
1129         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1130         if (ret != PMINFO_R_OK)
1131                 return -1;
1132
1133         ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1134         if (ret != PMINFO_R_OK) {
1135                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1136                 return -1;
1137         }
1138         printf("path : %s\n", path);
1139         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1140
1141         return 0;
1142 }
1143  * @endcode
1144  */
1145 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1146
1147
1148 /**
1149  * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1150  * @brief       This API gets the csc path of package
1151  *
1152  * @par Sync (or) Async : Synchronous API
1153  *
1154  * @param[in] handle            pointer to package info handle
1155  * @param[out] path             pointer to hold csc path of package
1156  * @return      0 if success, error code(<0) if fail
1157  * @retval      PMINFO_R_OK     success
1158  * @retval      PMINFO_R_EINVAL invalid argument
1159  * @retval      PMINFO_R_ERROR  internal error
1160  * @code
1161 static int get_csc_path(const char *pkgid)
1162 {
1163         int ret = 0;
1164         char *path = 0;
1165         pkgmgrinfo_pkginfo_h handle;
1166         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1167         if (ret != PMINFO_R_OK)
1168                 return -1;
1169
1170         ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1171         if (ret != PMINFO_R_OK) {
1172                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1173                 return -1;
1174         }
1175         printf("path : %s\n", path);
1176         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1177
1178         return 0;
1179 }
1180  * @endcode
1181  */
1182 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1183
1184 /**
1185  * @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)
1186  * @brief       This API compare the cert information from given package id
1187  *
1188  * @par         This API is for package-manager client application
1189  * @par Sync (or) Async : Synchronous API
1190  *
1191  * @param[in]   lhs_package_id  pointer to first package ID
1192  * @param[in]   rhs_package_id  pointer to second package ID
1193  * @param[out] compare_result           pointer to the compare result.
1194  * @return      0 if success, error code(<0) if fail
1195  * @retval      PMINFO_R_OK     success
1196  * @retval      PMINFO_R_EINVAL invalid argument
1197  * @retval      PMINFO_R_ERROR  internal error
1198  * @pre         None
1199  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1200  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1201  * @see         pkgmgrinfo_pkginfo_is_removable()
1202  * @code
1203 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1204 {
1205         int ret = 0;
1206         pkgmgrinfo_cert_compare_result_type_e result;
1207
1208         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1209         if (ret != PMINFO_R_OK) {
1210                 return -1;
1211         }
1212         printf("result: %d\n", result);
1213         return 0;
1214 }
1215  * @endcode
1216  */
1217 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);
1218 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);
1219 /**
1220  * @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)
1221  * @brief       This API compare the cert information from given app id
1222  *
1223  * @par         This API is for package-manager client application
1224  * @par Sync (or) Async : Synchronous API
1225  *
1226  * @param[in]   lhs_app_id      pointer to first app ID
1227  * @param[in]   rhs_app_id      pointer to second app ID
1228  * @param[out] compare_result           pointer to the compare result.
1229  * @return      0 if success, error code(<0) if fail
1230  * @retval      PMINFO_R_OK     success
1231  * @retval      PMINFO_R_EINVAL invalid argument
1232  * @retval      PMINFO_R_ERROR  internal error
1233  * @pre         None
1234  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1235  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1236  * @see         pkgmgrinfo_pkginfo_is_removable()
1237  * @code
1238 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1239 {
1240         int ret = 0;
1241         pkgmgrinfo_cert_compare_result_type_e result;
1242
1243         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1244         if (ret != PMINFO_R_OK) {
1245                 return -1;
1246         }
1247         printf("result: %d\n", result);
1248         return 0;
1249 }
1250  * @endcode
1251  */
1252 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);
1253 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);
1254 /**
1255  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1256  * @brief       This API gets the package 'removable' value from the package ID
1257  *
1258  * @par         This API is for package-manager client application
1259  * @par Sync (or) Async : Synchronous API
1260  *
1261  * @param[in]   handle  pointer to package info handle
1262  * @param[out] removable                pointer to hold package removable value
1263  * @return      0 if success, error code(<0) if fail
1264  * @retval      PMINFO_R_OK     success
1265  * @retval      PMINFO_R_EINVAL invalid argument
1266  * @retval      PMINFO_R_ERROR  internal error
1267  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1268  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1269  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1270  * @see         pkgmgrinfo_pkginfo_is_readonly()
1271  * @code
1272 static int get_pkg_removable(const char *pkgid)
1273 {
1274         int ret = 0;
1275         bool removable;
1276         pkgmgrinfo_pkginfo_h handle;
1277         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1278         if (ret != PMINFO_R_OK)
1279                 return -1;
1280         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1281         if (ret != PMINFO_R_OK) {
1282                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1283                 return -1;
1284         }
1285         printf("pkg removable: %d\n", removable);
1286         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1287         return 0;
1288 }
1289  * @endcode
1290  */
1291 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1292
1293 /**
1294  * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1295  * @brief       This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1296  *
1297  * @par         This API is for package-manager client application
1298  * @par Sync (or) Async : Synchronous API
1299  *
1300  * @param[in]   handle  pointer to package info handle
1301  * @param[out] movable          pointer to hold package movable state
1302  * @return      0 if success, error code(<0) if fail
1303  * @retval      PMINFO_R_OK     success
1304  * @retval      PMINFO_R_EINVAL invalid argument
1305  * @retval      PMINFO_R_ERROR  internal error
1306  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1307  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1308  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1309  * @code
1310 static int get_pkg_movable(const char *pkgid)
1311 {
1312         int ret = 0;
1313         bool movable;
1314         pkgmgrinfo_pkginfo_h handle;
1315         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1316         if (ret != PMINFO_R_OK)
1317                 return -1;
1318         ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1319         if (ret != PMINFO_R_OK) {
1320                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1321                 return -1;
1322         }
1323         printf("pkg movable: %d\n", movable);
1324         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1325         return 0;
1326 }
1327  * @endcode
1328  */
1329 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1330
1331 /**
1332  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1333  * @brief       This API gets the package 'preload' value from the package ID
1334  *
1335  * @par         This API is for package-manager client application
1336  * @par Sync (or) Async : Synchronous API
1337  *
1338  * @param[in]   handle  pointer to package info handle
1339  * @param[out] preload          pointer to hold package preload value
1340  * @return      0 if success, error code(<0) if fail
1341  * @retval      PMINFO_R_OK     success
1342  * @retval      PMINFO_R_EINVAL invalid argument
1343  * @retval      PMINFO_R_ERROR  internal error
1344  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1345  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1346  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1347  * @see         pkgmgrinfo_pkginfo_is_readonly()
1348  * @code
1349 static int get_pkg_preload(const char *pkgid)
1350 {
1351         int ret = 0;
1352         bool preload;
1353         pkgmgrinfo_pkginfo_h handle;
1354         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1355         if (ret != PMINFO_R_OK)
1356                 return -1;
1357         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1358         if (ret != PMINFO_R_OK) {
1359                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1360                 return -1;
1361         }
1362         printf("pkg preload: %d\n", preload);
1363         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1364         return 0;
1365 }
1366  * @endcode
1367  */
1368 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1369
1370 /**
1371  * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1372  * @brief       This API gets the value for given handle is system or not
1373  *
1374  * @par         This API is for package-manager client application
1375  * @par Sync (or) Async : Synchronous API
1376  *
1377  * @param[in]   handle  pointer to package info handle
1378  * @param[out] system           pointer to hold  system is or not
1379  * @return      0 if success, error code(<0) if fail
1380  * @retval      PMINFO_R_OK     success
1381  * @retval      PMINFO_R_EINVAL invalid argument
1382  * @retval      PMINFO_R_ERROR  internal error
1383  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1384  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1385  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1386  * @see         pkgmgrinfo_pkginfo_is_readonly()
1387  * @code
1388 static int get_pkg_system(const char *pkgid)
1389 {
1390         int ret = 0;
1391         bool system = false;
1392         pkgmgrinfo_pkginfo_h handle = NULL;
1393         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1394         if (ret != PMINFO_R_OK)
1395                 return -1;
1396         ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1397         if (ret != PMINFO_R_OK) {
1398                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1399                 return -1;
1400         }
1401         printf("pkg system: %d\n", system);
1402         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1403         return 0;
1404 }
1405  * @endcode
1406  */
1407 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1408
1409 /**
1410  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1411  * @brief       This API gets the package 'readonly' value from the package ID
1412  *
1413  * @par         This API is for package-manager client application
1414  * @par Sync (or) Async : Synchronous API
1415  *
1416  * @param[in]   handle  pointer to package info handle
1417  * @param[out] readonly pointer to hold package readonly value
1418  * @return      0 if success, error code(<0) if fail
1419  * @retval      PMINFO_R_OK     success
1420  * @retval      PMINFO_R_EINVAL invalid argument
1421  * @retval      PMINFO_R_ERROR  internal error
1422  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1423  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1424  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1425  * @see         pkgmgrinfo_pkginfo_is_removable()
1426  * @code
1427 static int get_pkg_readonly(const char *pkgid)
1428 {
1429         int ret = 0;
1430         bool readonly;
1431         pkgmgrinfo_pkginfo_h handle;
1432         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1433         if (ret != PMINFO_R_OK)
1434                 return -1;
1435         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1436         if (ret != PMINFO_R_OK) {
1437                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1438                 return -1;
1439         }
1440         printf("pkg readonly: %d\n", readonly);
1441         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1442         return 0;
1443 }
1444  * @endcode
1445  */
1446 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1447
1448
1449 /**
1450  * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1451  * @brief       This API gets the package 'upate' value from the package ID
1452  *
1453  * @par         This API is for package-manager client application
1454  * @par Sync (or) Async : Synchronous API
1455  *
1456  * @param[in]   handle  pointer to package info handle
1457  * @param[out] update   pointer to hold package update value
1458  * @return      0 if success, error code(<0) if fail
1459  * @retval      PMINFO_R_OK     success
1460  * @retval      PMINFO_R_EINVAL invalid argument
1461  * @retval      PMINFO_R_ERROR  internal error
1462  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1463  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1464  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1465  * @code
1466 static int get_pkg_update(const char *pkgid)
1467 {
1468         int ret = 0;
1469         bool update;
1470         pkgmgrinfo_pkginfo_h handle;
1471         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1472         if (ret != PMINFO_R_OK)
1473                 return -1;
1474         ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1475         if (ret != PMINFO_R_OK) {
1476                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1477                 return -1;
1478         }
1479         printf("pkg update: %d\n", update);
1480         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1481         return 0;
1482 }
1483  * @endcode
1484  */
1485 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1486
1487 /**
1488  * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1489  * @brief       This API gets the package 'support_disable' value from the package ID
1490  *
1491  * @par         This API is for package-manager client application
1492  * @par Sync (or) Async : Synchronous API
1493  *
1494  * @param[in]   handle  pointer to package info handle
1495  * @param[out]  support_disable pointer to hold package support_disable value
1496  * @return      0 if success, error code(<0) if fail
1497  * @retval      PMINFO_R_OK     success
1498  * @retval      PMINFO_R_EINVAL invalid argument
1499  * @retval      PMINFO_R_ERROR  internal error
1500  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1501  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1502  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1503  * @code
1504 static int get_pkg_support_disable(const char *pkgid)
1505 {
1506         int ret = 0;
1507         bool support_disable;
1508         pkgmgrinfo_pkginfo_h handle = NULL;
1509         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1510         if (ret != PMINFO_R_OK)
1511                 return -1;
1512         ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1513         if (ret != PMINFO_R_OK) {
1514                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1515                 return -1;
1516         }
1517         printf("pkg support_disable: %d\n", support_disable);
1518         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1519         return 0;
1520 }
1521  * @endcode
1522  */
1523 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1524
1525 /**
1526  * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1527  * @brief       This API gets whethere the given package is global package or user package
1528  *
1529  * @par         This API is for package-manager client application
1530  * @par Sync (or) Async : Synchronous API
1531  *
1532  * @param[in]   handle  pointer to package info handle
1533  * @param[in]   global  pointer to hold package global value
1534  * @return      0 if success, error code(<0) if fail
1535  * @retval      PMINFO_R_OK     success
1536  * @retval      PMINFO_R_EINVAL invalid argument
1537  * @retval      PMINFO_R_ERROR  internal error
1538  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1539  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1540  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1541  static int get_pkg_support_disable(const char *pkgid)
1542  {
1543          int ret = 0;
1544          bool global;
1545          pkgmgrinfo_pkginfo_h handle = NULL;
1546          ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1547          if (ret != PMINFO_R_OK)
1548                  return -1;
1549          ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1550          if (ret != PMINFO_R_OK) {
1551                  pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1552                  return -1;
1553          }
1554          printf("pkg is_global: %d\n", global);
1555          pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1556          return 0;
1557  }
1558   * @endcode
1559   */
1560 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1561
1562 /**
1563  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1564  * @brief       This API gets the package 'accessible' value from the package ID
1565  *
1566  * @par         This API is for package-manager client application
1567  * @par Sync (or) Async : Synchronous API
1568  *
1569  * @param[in]   handle  pointer to package info handle
1570  * @param[out] accessible       pointer to hold package accessible value
1571  * @return      0 if success, error code(<0) if fail
1572  * @retval      PMINFO_R_OK     success
1573  * @retval      PMINFO_R_EINVAL invalid argument
1574  * @retval      PMINFO_R_ERROR  internal error
1575  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1576  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1577  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1578  * @see         pkgmgrinfo_pkginfo_is_readonly()
1579  * @code
1580 static int get_pkg_accessible(const char *pkgid)
1581 {
1582         int ret = 0;
1583         bool accessible;
1584         pkgmgrinfo_pkginfo_h handle;
1585         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1586         if (ret != PMINFO_R_OK)
1587                 return -1;
1588         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1589         if (ret != PMINFO_R_OK) {
1590                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1591                 return -1;
1592         }
1593         printf("pkg accessible: %d\n", accessible);
1594         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1595         return 0;
1596 }
1597  * @endcode
1598  */
1599 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1600
1601 /**
1602  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1603  * @brief       This API destroys the package information handle freeing up all the resources
1604  *
1605  * @par         This API is for package-manager client application
1606  * @par Sync (or) Async : Synchronous API
1607  *
1608  * @param[in]   handle  pointer to the package info handle
1609  * @return      0 if success, error code(<0) if fail
1610  * @retval      PMINFO_R_OK     success
1611  * @retval      PMINFO_R_EINVAL invalid argument
1612  * @retval      PMINFO_R_ERROR  internal error
1613  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1614  * @post                None
1615  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1616  * @see         pkgmgrinfo_pkginfo_is_removable()
1617  * @code
1618 static int get_pkg_type(const char *pkgid)
1619 {
1620         int ret = 0;
1621         char *type = NULL;
1622         pkgmgrinfo_pkginfo_h handle;
1623         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1624         if (ret != PMINFO_R_OK)
1625                 return -1;
1626         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1627         if (ret != PMINFO_R_OK) {
1628                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1629                 return -1;
1630         }
1631         printf("pkgtype: %s\n", type);
1632         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1633         return 0;
1634 }
1635  * @endcode
1636  */
1637 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1638
1639 /**
1640  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1641  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
1642  The query will search the entire package information collected from the manifest file of all the installed packages
1643  *
1644  * @par         This API is for package-manager client application
1645  * @par Sync (or) Async : Synchronous API
1646  *
1647  * @param[out] handle           pointer to the package info filter handle.
1648  * @return      0 if success, error code(<0) if fail
1649  * @retval      PMINFO_R_OK     success
1650  * @retval      PMINFO_R_EINVAL invalid argument
1651  * @retval      PMINFO_R_ERROR  internal error
1652  * @pre         None
1653  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1654  * @see         pkgmgrinfo_pkginfo_filter_count()
1655  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1656  * @code
1657 static int get_tpk_pkg_count()
1658 {
1659         int ret = 0;
1660         int count = 0;
1661         pkgmgrinfo_pkginfo_filter_h handle;
1662         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1663         if (ret != PMINFO_R_OK)
1664                 return -1;
1665         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1666         if (ret != PMINFO_R_OK) {
1667                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1668                 return -1;
1669         }
1670         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1671         if (ret != PMINFO_R_OK) {
1672                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1673                 return -1;
1674         }
1675         printf("No of tpk pkgs: %d\n", count);
1676         pkgmgrinfo_pkginfo_filter_destroy(handle);
1677         return 0;
1678 }
1679  * @endcode
1680  */
1681 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1682
1683 /**
1684  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1685  * @brief       This API destroys the package information filter handle freeing up all the resources
1686  *
1687  * @par         This API is for package-manager client application
1688  * @par Sync (or) Async : Synchronous API
1689  *
1690  * @param[in] handle            pointer to the package info filter handle.
1691  * @return      0 if success, error code(<0) if fail
1692  * @retval      PMINFO_R_OK     success
1693  * @retval      PMINFO_R_EINVAL invalid argument
1694  * @retval      PMINFO_R_ERROR  internal error
1695  * @pre         pkgmgrinfo_pkginfo_filter_create()
1696  * @post                None
1697  * @see         pkgmgrinfo_pkginfo_filter_count()
1698  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1699  * @code
1700 static int get_tpk_pkg_count()
1701 {
1702         int ret = 0;
1703         int count = 0;
1704         pkgmgrinfo_pkginfo_filter_h handle;
1705         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1706         if (ret != PMINFO_R_OK)
1707                 return -1;
1708         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1709         if (ret != PMINFO_R_OK) {
1710                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1711                 return -1;
1712         }
1713         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1714         if (ret != PMINFO_R_OK) {
1715                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1716                 return -1;
1717         }
1718         printf("No of tpk pkgs: %d\n", count);
1719         pkgmgrinfo_pkginfo_filter_destroy(handle);
1720         return 0;
1721 }
1722  * @endcode
1723  */
1724 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1725
1726 /**
1727  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1728  * @brief       This API adds a boolean filter property to the filter handle
1729  *
1730  * @par         This API is for package-manager client application
1731  * @par Sync (or) Async : Synchronous API
1732  *
1733  * @param[in] handle            pointer to the package info filter handle.
1734  * @param[in] property          boolean property name.
1735  * @param[in] value             value corresponding to the property.
1736  * @return      0 if success, error code(<0) if fail
1737  * @retval      PMINFO_R_OK     success
1738  * @retval      PMINFO_R_EINVAL invalid argument
1739  * @retval      PMINFO_R_ERROR  internal error
1740  * @pre         pkgmgrinfo_pkginfo_filter_create()
1741  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1742  * @see         pkgmgrinfo_pkginfo_filter_count()
1743  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1744  * @code
1745 static int get_preload_pkg_count()
1746 {
1747         int ret = 0;
1748         int count = 0;
1749         pkgmgrinfo_pkginfo_filter_h handle;
1750         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1751         if (ret != PMINFO_R_OK)
1752                 return -1;
1753         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1754         if (ret != PMINFO_R_OK) {
1755                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1756                 return -1;
1757         }
1758         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1759         if (ret != PMINFO_R_OK) {
1760                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1761                 return -1;
1762         }
1763         printf("No of preload pkgs: %d\n", count);
1764         pkgmgrinfo_pkginfo_filter_destroy(handle);
1765         return 0;
1766 }
1767  * @endcode
1768  */
1769 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1770                 const char *property, const bool value);
1771
1772 /**
1773  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1774  * @brief       This API adds an integer filter property to the filter handle
1775  *
1776  * @par         This API is for package-manager client application
1777  * @par Sync (or) Async : Synchronous API
1778  *
1779  * @param[in] handle            pointer to the package info filter handle.
1780  * @param[in] property          integer property name.
1781  * @param[in] value             value corresponding to the property.
1782  * @return      0 if success, error code(<0) if fail
1783  * @retval      PMINFO_R_OK     success
1784  * @retval      PMINFO_R_EINVAL invalid argument
1785  * @retval      PMINFO_R_ERROR  internal error
1786  * @pre         pkgmgrinfo_pkginfo_filter_create()
1787  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1788  * @see         pkgmgrinfo_pkginfo_filter_count()
1789  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1790  * @code
1791 static int get_pkg_count()
1792 {
1793         int ret = 0;
1794         int count = 0;
1795         pkgmgrinfo_pkginfo_filter_h handle;
1796         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1797         if (ret != PMINFO_R_OK)
1798                 return -1;
1799         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1800         if (ret != PMINFO_R_OK) {
1801                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802                 return -1;
1803         }
1804         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1805         if (ret != PMINFO_R_OK) {
1806                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1807                 return -1;
1808         }
1809         printf("No of preload pkgs: %d\n", count);
1810         pkgmgrinfo_pkginfo_filter_destroy(handle);
1811         return 0;
1812 }
1813  * @endcode
1814  */
1815 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1816                 const char *property, const int value);
1817
1818 /**
1819  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1820  * @brief       This API adds a string filter property to the filter handle
1821  *
1822  * @par         This API is for package-manager client application
1823  * @par Sync (or) Async : Synchronous API
1824  *
1825  * @param[in] handle            pointer to the package info filter handle.
1826  * @param[in] property          string property name.
1827  * @param[in] value             value corresponding to the property.
1828  * @return      0 if success, error code(<0) if fail
1829  * @retval      PMINFO_R_OK     success
1830  * @retval      PMINFO_R_EINVAL invalid argument
1831  * @retval      PMINFO_R_ERROR  internal error
1832  * @pre         pkgmgrinfo_pkginfo_filter_create()
1833  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1834  * @see         pkgmgrinfo_pkginfo_filter_count()
1835  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1836  * @code
1837 static int get_tpk_pkg_count()
1838 {
1839         int ret = 0;
1840         int count = 0;
1841         pkgmgrinfo_pkginfo_filter_h handle;
1842         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1843         if (ret != PMINFO_R_OK)
1844                 return -1;
1845         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1846         if (ret != PMINFO_R_OK) {
1847                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1848                 return -1;
1849         }
1850         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1851         if (ret != PMINFO_R_OK) {
1852                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1853                 return -1;
1854         }
1855         printf("No of tpk pkgs: %d\n", count);
1856         pkgmgrinfo_pkginfo_filter_destroy(handle);
1857         return 0;
1858 }
1859  * @endcode
1860  */
1861 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1862                 const char *property, const char *value);
1863
1864 /**
1865  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1866  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
1867  *
1868  * @par         This API is for package-manager client application
1869  * @par Sync (or) Async : Synchronous API
1870  *
1871  * @param[in] handle            pointer to the package info filter handle.
1872  * @param[in] pkg_cb            callback function.
1873  * @param[in] user_data         user data to be passed to the callback function
1874  * @return      0 if success, error code(<0) if fail
1875  * @retval      PMINFO_R_OK     success
1876  * @retval      PMINFO_R_EINVAL invalid argument
1877  * @retval      PMINFO_R_ERROR  internal error
1878  * @pre         pkgmgrinfo_pkginfo_filter_create()
1879  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1880  * @see         pkgmgrinfo_pkginfo_filter_count()
1881  * @code
1882 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1883 {
1884         char *pkgid = NULL;
1885         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1886         printf("pkg id : %s\n", pkgid);
1887         return 0;
1888 }
1889
1890 static int get_tpk_pkg_list()
1891 {
1892         int ret = 0;
1893         pkgmgrinfo_pkginfo_filter_h handle;
1894         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1895         if (ret != PMINFO_R_OK)
1896                 return -1;
1897         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1898         if (ret != PMINFO_R_OK) {
1899                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1900                 return -1;
1901         }
1902         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1903         if (ret != PMINFO_R_OK) {
1904                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905                 return -1;
1906         }
1907         pkgmgrinfo_pkginfo_filter_destroy(handle);
1908         return 0;
1909 }
1910  * @endcode
1911  */
1912 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1913                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1914 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1915                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1916
1917 /**
1918  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1919  * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1920  * @brief       This API counts the package that satisfy the filter conditions
1921  *
1922  * @par         This API is for package-manager client application
1923  * @par Sync (or) Async : Synchronous API
1924  *
1925  * @param[in] handle            pointer to the package info filter handle.
1926  * @param[in] count             pointer to store the count value.
1927  * @param[in]   uid     the addressee user id of the instruction
1928  * @return      0 if success, error code(<0) if fail
1929  * @retval      PMINFO_R_OK     success
1930  * @retval      PMINFO_R_EINVAL invalid argument
1931  * @retval      PMINFO_R_ERROR  internal error
1932  * @pre         pkgmgrinfo_pkginfo_filter_create()
1933  * @post                pkgmgrinfo_pkginfo_filter_destroy()
1934  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1935  * @code
1936 static int get_tpk_pkg_count()
1937 {
1938         int ret = 0;
1939         int count = 0;
1940         pkgmgrinfo_pkginfo_filter_h handle;
1941         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1942         if (ret != PMINFO_R_OK)
1943                 return -1;
1944         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1945         if (ret != PMINFO_R_OK) {
1946                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1947                 return -1;
1948         }
1949         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1950         if (ret != PMINFO_R_OK) {
1951                 pkgmgrinfo_pkginfo_filter_destroy(handle);
1952                 return -1;
1953         }
1954         printf("No of tpk pkgs: %d\n", count);
1955         pkgmgrinfo_pkginfo_filter_destroy(handle);
1956         return 0;
1957 }
1958  * @endcode
1959  */
1960 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1961 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1962 /**
1963  * @fn  int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1964                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1965  * @brief       This API gets the list of privilege for a particular package
1966  *
1967  * @par         This API is for package-manager client application
1968  * @par Sync (or) Async : Synchronous API
1969  * @param[in]   handle          pointer to the package info handle.
1970  * @param[in]   privilege_func          callback function for list
1971  * @param[in] user_data user data to be passed to callback function
1972  * @return      0 if success, error code(<0) if fail
1973  * @retval      PMINFO_R_OK     success
1974  * @retval      PMINFO_R_EINVAL invalid argument
1975  * @retval      PMINFO_R_ERROR  internal error
1976  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1977  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1978  * @code
1979 int privilege_func(const char *name, void *user_data)
1980 {
1981         if (strcmp(name, (char *)user_data) == 0)
1982                 return -1;
1983         else
1984                 return 0;
1985 }
1986
1987 static int list_privilege(const char *package, char *privilege)
1988 {
1989         int ret = 0;
1990         pkgmgrinfo_pkginfo_h handle;
1991         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1992         if (ret != PMINFO_R_OK)
1993                 return -1;
1994         ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1995         if (ret != PMINFO_R_OK) {
1996                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1997                 return -1;
1998         }
1999         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2000         return 0;
2001 }
2002  * @endcode
2003  */
2004 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2005                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2006
2007 /* TODO: add doxygen comment here */
2008 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2009 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2010 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2011 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2012 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2013 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2014 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2015
2016 /**
2017  * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2018  * @brief       This API copy the application information handle
2019  *
2020  * @par         This API is for package-manager client application
2021  * @par Sync (or) Async : Synchronous API
2022  *
2023  * @param[in]   handle  pointer to the package info handle.
2024  * @param[out]  handle  pointer to the package info handle.
2025  * @return      0 if success, error code(<0) if fail
2026  * @retval      PMINFO_R_OK     success
2027  * @retval      PMINFO_R_EINVAL invalid argument
2028  * @retval      PMINFO_R_ERROR  internal error
2029  * @pre         None
2030  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
2031  * @code
2032 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2033 {
2034         int ret = 0;
2035
2036         pkgmgrinfo_pkginfo_h clone;
2037
2038         ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2039         if (ret != PMINFO_R_OK)
2040                 return -1;
2041
2042
2043         printf("package: %s\n", clone->package);
2044         pkgmgrinfo_appinfo_destroy_appinfo(clone);
2045         return 0;
2046 }
2047  * @endcode
2048  */
2049 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2050
2051
2052 /**
2053  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2054  pkgmgrinfo_app_list_cb app_func, void *user_data)
2055  * @brief       This API gets list of installed applications for a particular package
2056  *
2057  * @par         This API is for package-manager client application
2058  * @par Sync (or) Async : Synchronous API
2059  * @param[in]   handle          package info handle
2060  * @param[in]   component       application component
2061  * @param[in]   app_func                iteration function for list
2062  * @param[in] user_data user data to be passed to callback function
2063  * @return      0 if success, error code(<0) if fail
2064  * @retval      PMINFO_R_OK     success
2065  * @retval      PMINFO_R_EINVAL invalid argument
2066  * @retval      PMINFO_R_ERROR  internal error
2067  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2068  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2069  * @code
2070 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2071 {
2072         char *appid = NULL;
2073         pkgmgrinfo_appinfo_get_appid(handle, &appid);
2074         printf("appid : %s\n", appid);
2075         return 0;
2076 }
2077
2078 static int list_apps(const char *pkgid)
2079 {
2080         int ret = 0;
2081         pkgmgrinfo_pkginfo_h handle;
2082         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2083         if (ret != PMINFO_R_OK)
2084                 return -1;
2085         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2086         if (ret != PMINFO_R_OK) {
2087                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2088                 return -1;
2089         }
2090         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2091         return 0;
2092 }
2093  * @endcode
2094  */
2095 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2096                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
2097 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2098                                                         pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2099
2100 /**
2101  * @fn  int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2102  * @brief       This API gets list of installed applications from all packages with  minimum informaion.
2103  *
2104  * @par         This API is for package-manager client application
2105  * @par Sync (or) Async : Synchronous API
2106  * @param[in]   app_func                iteration function for list
2107  * @param[in] user_data user data to be passed to callback function
2108  * @return      0 if success, error code(<0) if fail
2109  * @retval      PMINFO_R_OK     success
2110  * @retval      PMINFO_R_EINVAL invalid argument
2111  * @retval      PMINFO_R_ERROR  internal error
2112  * @pre         None
2113  * @post                None
2114  * @code
2115 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2116 {
2117         char *pkgid1 = NULL;
2118         char *pkgid2 = NULL;
2119         pkgid1 = (char *)user_data;
2120         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2121         if (strcmp(pkgid1, pkgid2) == 0) {
2122                 return -1;
2123         } else {
2124                 return 0;
2125         }
2126 }
2127
2128 static int list_apps()
2129 {
2130         int ret = 0;
2131         char *name = "helloworld";
2132         ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2133         if (ret != PMINFO_R_OK) {
2134                 return -1;
2135         }
2136         return 0;
2137 }
2138  * @endcode
2139  */
2140 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2141 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2142
2143 /**
2144  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2145  * @brief       This API gets list of installed applications from all packages.
2146  *
2147  * @par         This API is for package-manager client application
2148  * @par Sync (or) Async : Synchronous API
2149  * @param[in]   app_func                iteration function for list
2150  * @param[in] user_data user data to be passed to callback function
2151  * @return      0 if success, error code(<0) if fail
2152  * @retval      PMINFO_R_OK     success
2153  * @retval      PMINFO_R_EINVAL invalid argument
2154  * @retval      PMINFO_R_ERROR  internal error
2155  * @pre         None
2156  * @post                None
2157  * @code
2158 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2159 {
2160         char *pkgid1 = NULL;
2161         char *pkgid2 = NULL;
2162         pkgid1 = (char *)user_data;
2163         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2164         if (strcmp(pkgid1, pkgid2) == 0) {
2165                 return -1;
2166         } else {
2167                 return 0;
2168         }
2169 }
2170
2171 static int list_apps()
2172 {
2173         int ret = 0;
2174         char *name = "helloworld";
2175         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2176         if (ret != PMINFO_R_OK) {
2177                 return -1;
2178         }
2179         return 0;
2180 }
2181  * @endcode
2182  */
2183 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2184 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2185
2186 /**
2187  * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2188  * @brief       This API creates the disabled application information handle from db
2189  *
2190  * @par         This API is for package-manager client application
2191  * @par Sync (or) Async : Synchronous API
2192  *
2193  * @param[in]   appid   pointer to appid
2194  * @param[out] handle           pointer to the application info handle.
2195  * @return      0 if success, error code(<0) if fail
2196  * @retval      PMINFO_R_OK     success
2197  * @retval      PMINFO_R_EINVAL invalid argument
2198  * @retval      PMINFO_R_ERROR  internal error
2199  * @pre         None
2200  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2201  * @see         pkgmgrinfo_appinfo_get_pkgid()
2202  * @see         pkgmgrinfo_appinfo_is_multiple()
2203  * @code
2204 static int get_disabled_app_type(const char *appid)
2205 {
2206         int ret = 0;
2207         char *type = NULL;
2208         pkgmgrinfo_appinfo_h handle;
2209         ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2210         if (ret != PMINFO_R_OK)
2211                 return -1;
2212         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2213         if (ret != PMINFO_R_OK) {
2214                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2215                 return -1;
2216         }
2217         printf("apptype: %s\n", type);
2218         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2219         return 0;
2220 }
2221  * @endcode
2222  */
2223 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2224 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2225
2226 /**
2227  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2228  * @brief       This API creates the application information handle from db
2229  *
2230  * @par         This API is for package-manager client application
2231  * @par Sync (or) Async : Synchronous API
2232  *
2233  * @param[in]   appid   pointer to appid
2234  * @param[out] handle           pointer to the application info handle.
2235  * @return      0 if success, error code(<0) if fail
2236  * @retval      PMINFO_R_OK     success
2237  * @retval      PMINFO_R_EINVAL invalid argument
2238  * @retval      PMINFO_R_ERROR  internal error
2239  * @pre         None
2240  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2241  * @see         pkgmgrinfo_appinfo_get_pkgid()
2242  * @see         pkgmgrinfo_appinfo_is_multiple()
2243  * @code
2244 static int get_app_type(const char *appid)
2245 {
2246         int ret = 0;
2247         char *type = NULL;
2248         pkgmgrinfo_appinfo_h handle;
2249         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2250         if (ret != PMINFO_R_OK)
2251                 return -1;
2252         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2253         if (ret != PMINFO_R_OK) {
2254                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2255                 return -1;
2256         }
2257         printf("apptype: %s\n", type);
2258         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2259         return 0;
2260 }
2261  * @endcode
2262  */
2263 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2264 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2265
2266 /**
2267  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2268  * @brief       This API gets the application ID
2269  *
2270  * @par         This API is for package-manager client application
2271  * @par Sync (or) Async : Synchronous API
2272  *
2273  * @param[in] handle            pointer to the application info handle.
2274  * @param[out] appid            pointer to hold appid
2275  * @return      0 if success, error code(<0) if fail
2276  * @retval      PMINFO_R_OK     success
2277  * @retval      PMINFO_R_EINVAL invalid argument
2278  * @retval      PMINFO_R_ERROR  internal error
2279  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2280  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2281  * @see         pkgmgrinfo_appinfo_get_pkgid()
2282  * @see         pkgmgrinfo_appinfo_is_multiple()
2283  * @code
2284 static int get_app_id(const char *appid)
2285 {
2286         int ret = 0;
2287         char *app_id = NULL;
2288         pkgmgrinfo_appinfo_h handle;
2289         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2290         if (ret != PMINFO_R_OK)
2291                 return -1;
2292         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2293         if (ret != PMINFO_R_OK) {
2294                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2295                 return -1;
2296         }
2297         printf("app id: %s\n", app_id);
2298         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2299         return 0;
2300 }
2301  * @endcode
2302  */
2303 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
2304
2305 /**
2306  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2307  * @brief       This API gets the package name of the application
2308  *
2309  * @par         This API is for package-manager client application
2310  * @par Sync (or) Async : Synchronous API
2311  *
2312  * @param[in] handle            pointer to the application info handle.
2313  * @param[out] pkg_name         pointer to hold package name
2314  * @return      0 if success, error code(<0) if fail
2315  * @retval      PMINFO_R_OK     success
2316  * @retval      PMINFO_R_EINVAL invalid argument
2317  * @retval      PMINFO_R_ERROR  internal error
2318  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2319  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2320  * @see         pkgmgrinfo_appinfo_get_appid()
2321  * @see         pkgmgrinfo_appinfo_is_multiple()
2322  * @code
2323 static int get_app_pkgname(const char *appid)
2324 {
2325         int ret = 0;
2326         char *pkgname = NULL;
2327         pkgmgrinfo_appinfo_h handle;
2328         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2329         if (ret != PMINFO_R_OK)
2330                 return -1;
2331         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2332         if (ret != PMINFO_R_OK) {
2333                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2334                 return -1;
2335         }
2336         printf("pkg name: %s\n", pkgname);
2337         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2338         return 0;
2339 }
2340  * @endcode
2341  */
2342 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
2343
2344 /**
2345  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2346  * @brief       This API gets the package id of the application
2347  *
2348  * @par         This API is for package-manager client application
2349  * @par Sync (or) Async : Synchronous API
2350  *
2351  * @param[in] handle            pointer to the application info handle.
2352  * @param[out] pkgid            pointer to hold package id
2353  * @return      0 if success, error code(<0) if fail
2354  * @retval      PMINFO_R_OK     success
2355  * @retval      PMINFO_R_EINVAL invalid argument
2356  * @retval      PMINFO_R_ERROR  internal error
2357  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2358  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2359  * @see         pkgmgrinfo_appinfo_get_appid()
2360  * @see         pkgmgrinfo_appinfo_is_multiple()
2361  * @code
2362 static int get_app_pkgid(const char *appid)
2363 {
2364         int ret = 0;
2365         char *pkgid = NULL;
2366         pkgmgrinfo_appinfo_h handle;
2367         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2368         if (ret != PMINFO_R_OK)
2369                 return -1;
2370         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2371         if (ret != PMINFO_R_OK) {
2372                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2373                 return -1;
2374         }
2375         printf("pkg id: %s\n", pkgid);
2376         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2377         return 0;
2378 }
2379  * @endcode
2380  */
2381 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
2382
2383 /**
2384  * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2385  * @brief       This API gets the package type of the application
2386  *
2387  * @par         This API is for package-manager client application
2388  * @par Sync (or) Async : Synchronous API
2389  *
2390  * @param[in] handle            pointer to the application info handle.
2391  * @param[out] pkgtype          pointer to hold package type
2392  * @return      0 if success, error code(<0) if fail
2393  * @retval      PMINFO_R_OK     success
2394  * @retval      PMINFO_R_EINVAL invalid argument
2395  * @retval      PMINFO_R_ERROR  internal error
2396  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2397  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2398  * @see         pkgmgrinfo_appinfo_get_appid()
2399  * @see         pkgmgrinfo_appinfo_is_multiple()
2400  * @code
2401 static int get_app_pkgtype(const char *appid)
2402 {
2403         int ret = 0;
2404         char *pkgtype = NULL;
2405         pkgmgrinfo_appinfo_h handle = NULL;
2406         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2407         if (ret != PMINFO_R_OK)
2408                 return -1;
2409         ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2410         if (ret != PMINFO_R_OK) {
2411                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2412                 return -1;
2413         }
2414         printf("pkgtype: %s\n", pkgtype);
2415         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2416         return 0;
2417 }
2418  * @endcode
2419  */
2420 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h  handle, char **pkgtype);
2421
2422 /**
2423  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2424  * @brief       This API gets the executable name of the application
2425  *
2426  * @par         This API is for package-manager client application
2427  * @par Sync (or) Async : Synchronous API
2428  *
2429  * @param[in] handle            pointer to the application info handle.
2430  * @param[out] exec             pointer to hold app exec name
2431  * @return      0 if success, error code(<0) if fail
2432  * @retval      PMINFO_R_OK     success
2433  * @retval      PMINFO_R_EINVAL invalid argument
2434  * @retval      PMINFO_R_ERROR  internal error
2435  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2436  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2437  * @see         pkgmgrinfo_appinfo_get_appid()
2438  * @see         pkgmgrinfo_appinfo_is_multiple()
2439  * @code
2440 static int get_app_exec(const char *appid)
2441 {
2442         int ret = 0;
2443         char *exec = NULL;
2444         pkgmgrinfo_appinfo_h handle;
2445         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2446         if (ret != PMINFO_R_OK)
2447                 return -1;
2448         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2449         if (ret != PMINFO_R_OK) {
2450                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2451                 return -1;
2452         }
2453         printf("exec name: %s\n", exec);
2454         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2455         return 0;
2456 }
2457  * @endcode
2458  */
2459 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
2460
2461 /**
2462  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2463  * @brief       This API gets the icon name of the application
2464  *
2465  * @par         This API is for package-manager client application
2466  * @par Sync (or) Async : Synchronous API
2467  *
2468  * @param[in] handle            pointer to the application info handle.
2469  * @param[out] icon             pointer to hold app icon name
2470  * @return      0 if success, error code(<0) if fail
2471  * @retval      PMINFO_R_OK     success
2472  * @retval      PMINFO_R_EINVAL invalid argument
2473  * @retval      PMINFO_R_ERROR  internal error
2474  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2475  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2476  * @see         pkgmgrinfo_appinfo_get_appid()
2477  * @see         pkgmgrinfo_appinfo_is_multiple()
2478  * @code
2479 static int get_app_icon(const char *appid)
2480 {
2481         int ret = 0;
2482         char *icon = NULL;
2483         pkgmgrinfo_appinfo_h handle;
2484         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2485         if (ret != PMINFO_R_OK)
2486                 return -1;
2487         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2488         if (ret != PMINFO_R_OK) {
2489                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2490                 return -1;
2491         }
2492         printf("icon name: %s\n", icon);
2493         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2494         return 0;
2495 }
2496  * @endcode
2497  */
2498 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2499
2500 /**
2501  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2502  * @brief       This API gets the label of the application
2503  *
2504  * @par         This API is for package-manager client application
2505  * @par Sync (or) Async : Synchronous API
2506  *
2507  * @param[in] handle            pointer to the application info handle.
2508  * @param[out] label            pointer to hold app label
2509  * @return      0 if success, error code(<0) if fail
2510  * @retval      PMINFO_R_OK     success
2511  * @retval      PMINFO_R_EINVAL invalid argument
2512  * @retval      PMINFO_R_ERROR  internal error
2513  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2514  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2515  * @see         pkgmgrinfo_appinfo_get_appid()
2516  * @see         pkgmgrinfo_appinfo_is_multiple()
2517  * @code
2518 static int get_app_label(const char *appid)
2519 {
2520         int ret = 0;
2521         char *label = NULL;
2522         pkgmgrinfo_appinfo_h handle;
2523         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2524         if (ret != PMINFO_R_OK)
2525                 return -1;
2526         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2527         if (ret != PMINFO_R_OK) {
2528                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2529                 return -1;
2530         }
2531         printf("label : %s\n", label);
2532         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2533         return 0;
2534 }
2535  * @endcode
2536  */
2537 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
2538
2539 /**
2540  * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2541  * @brief       This API gets exactly matched label by given appid and locale
2542  *
2543  * @par         This API is for package-manager client application
2544  * @par Sync (or) Async : Synchronous API
2545  *
2546  * @param[in]   appid   pointer to appid
2547  * @param[in]   locale  pointer to locale
2548  * @param[out] label            pointer to hold app label
2549  * @return      0 if success, error code(<0) if fail
2550  * @retval      PMINFO_R_OK     success
2551  * @retval      PMINFO_R_EINVAL invalid argument
2552  * @retval      PMINFO_R_ERROR  internal error
2553  * @code
2554 static int get_localed_label(const char *appid, const char *locale)
2555 {
2556         int ret = 0;
2557         char *label = NULL;
2558
2559         ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2560         if (ret != PMINFO_R_OK)
2561                 return -1;
2562
2563         printf("localed label: %s\n", label);
2564
2565         free(label);
2566
2567         return 0;
2568 }
2569  * @endcode
2570  */
2571 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2572 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2573
2574 /**
2575  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2576  * @brief       This API gets the component of the application
2577  *
2578  * @par         This API is for package-manager client application
2579  * @par Sync (or) Async : Synchronous API
2580  *
2581  * @param[in] handle            pointer to the application info handle.
2582  * @param[out] component                pointer to hold app component
2583  * @return      0 if success, error code(<0) if fail
2584  * @retval      PMINFO_R_OK     success
2585  * @retval      PMINFO_R_EINVAL invalid argument
2586  * @retval      PMINFO_R_ERROR  internal error
2587  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2588  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2589  * @see         pkgmgrinfo_appinfo_get_appid()
2590  * @see         pkgmgrinfo_appinfo_is_multiple()
2591  * @code
2592 static int get_app_component(const char *appid)
2593 {
2594         int ret = 0;
2595         pkgmgrinfo_app_component component;
2596         pkgmgrinfo_appinfo_h handle;
2597         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2598         if (ret != PMINFO_R_OK)
2599                 return -1;
2600         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2601         if (ret != PMINFO_R_OK) {
2602                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2603                 return -1;
2604         }
2605         printf("component : %s\n", component);
2606         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2607         return 0;
2608 }
2609  * @endcode
2610  */
2611 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
2612
2613 /**
2614  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2615  * @brief       This API gets the apptype of the application
2616  *
2617  * @par         This API is for package-manager client application
2618  * @par Sync (or) Async : Synchronous API
2619  *
2620  * @param[in] handle            pointer to the application info handle.
2621  * @param[out] app_type         pointer to hold apptype
2622  * @return      0 if success, error code(<0) if fail
2623  * @retval      PMINFO_R_OK     success
2624  * @retval      PMINFO_R_EINVAL invalid argument
2625  * @retval      PMINFO_R_ERROR  internal error
2626  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2627  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2628  * @see         pkgmgrinfo_appinfo_get_appid()
2629  * @see         pkgmgrinfo_appinfo_is_multiple()
2630  * @code
2631 static int get_app_type(const char *appid)
2632 {
2633         int ret = 0;
2634         char *apptype = NULL;
2635         pkgmgrinfo_appinfo_h handle;
2636         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2637         if (ret != PMINFO_R_OK)
2638                 return -1;
2639         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2640         if (ret != PMINFO_R_OK) {
2641                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2642                 return -1;
2643         }
2644         printf("apptype : %s\n", apptype);
2645         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2646         return 0;
2647 }
2648  * @endcode
2649  */
2650 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
2651
2652 /**
2653  * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2654                                                                                 int *operation_count, char ***operation)
2655  * @brief       This API gets the list of operation of the application
2656  *
2657  * @par         This API is for package-manager client application
2658  * @par Sync (or) Async : Synchronous API
2659  *
2660  * @param[in] handle            pointer to the appcontrol handle.
2661  * @param[out] operation_count          pointer to hold number of operations
2662  * @param[out] operation                pointer to hold list of operations
2663  * @return      0 if success, error code(<0) if fail
2664  * @retval      PMINFO_R_OK     success
2665  * @retval      PMINFO_R_EINVAL invalid argument
2666  * @retval      PMINFO_R_ERROR  internal error
2667  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2668  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2669  * @see         pkgmgrinfo_appinfo_get_uri()
2670  * @see         pkgmgrinfo_appinfo_get_mime()
2671  * @code
2672 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2673 {
2674         int oc = 0;
2675         int i = 0;
2676         char **operation;
2677         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2678         for (i = 0; i < oc; i++) {
2679                 if (strcmp(operation[i], (char *)user_data) == 0)
2680                         return -1;
2681                 else
2682                         return 0;
2683         }
2684 }
2685
2686 static int check_operation(const char *appid, char *operation)
2687 {
2688         int ret = 0;
2689         pkgmgrinfo_appinfo_h handle;
2690         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2691         if (ret != PMINFO_R_OK)
2692                 return -1;
2693         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2694         if (ret != PMINFO_R_OK) {
2695                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2696                 return -1;
2697         }
2698         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2699         return 0;
2700 }
2701  * @endcode
2702  */
2703 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2704                                                                                 int *operation_count, char ***operation);
2705
2706 /**
2707  * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2708                                                                                 int *uri_count, char ***uri)
2709  * @brief       This API gets the list of uri of the application
2710  *
2711  * @par         This API is for package-manager client application
2712  * @par Sync (or) Async : Synchronous API
2713  *
2714  * @param[in] handle            pointer to the appcontrol handle.
2715  * @param[out] uri_count                pointer to hold number of uris
2716  * @param[out] uri              pointer to hold list of uris
2717  * @return      0 if success, error code(<0) if fail
2718  * @retval      PMINFO_R_OK     success
2719  * @retval      PMINFO_R_EINVAL invalid argument
2720  * @retval      PMINFO_R_ERROR  internal error
2721  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2722  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2723  * @see         pkgmgrinfo_appinfo_get_operation()
2724  * @see         pkgmgrinfo_appinfo_get_mime()
2725  * @code
2726 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2727 {
2728         int uc = 0;
2729         int i = 0;
2730         char **uri;
2731         pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2732         for (i = 0; i < uc; i++) {
2733                 if (strcmp(uri[i], (char *)user_data) == 0)
2734                         return -1;
2735                 else
2736                         return 0;
2737         }
2738 }
2739
2740 static int check_uri(const char *appid, char *uri)
2741 {
2742         int ret = 0;
2743         pkgmgrinfo_appinfo_h handle;
2744         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2745         if (ret != PMINFO_R_OK)
2746                 return -1;
2747         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2748         if (ret != PMINFO_R_OK) {
2749                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2750                 return -1;
2751         }
2752         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2753         return 0;
2754 }
2755  * @endcode
2756  */
2757 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2758                                                                                 int *uri_count, char ***uri);
2759
2760 /**
2761  * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2762                                                                                 int *mime_count, char ***mime)
2763  * @brief       This API gets the list of mime of the application
2764  *
2765  * @par         This API is for package-manager client application
2766  * @par Sync (or) Async : Synchronous API
2767  *
2768  * @param[in] handle            pointer to the appcontrol handle.
2769  * @param[out] mime_count               pointer to hold number of mimes
2770  * @param[out] mime             pointer to hold list of mimes
2771  * @return      0 if success, error code(<0) if fail
2772  * @retval      PMINFO_R_OK     success
2773  * @retval      PMINFO_R_EINVAL invalid argument
2774  * @retval      PMINFO_R_ERROR  internal error
2775  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2776  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2777  * @see         pkgmgrinfo_appinfo_get_uri()
2778  * @see         pkgmgrinfo_appinfo_get_operation()
2779  * @code
2780 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2781 {
2782         int mc = 0;
2783         int i = 0;
2784         char **mime;
2785         pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2786         for (i = 0; i < mc; i++) {
2787                 if (strcmp(mime[i], (char *)user_data) == 0)
2788                         return -1;
2789                 else
2790                         return 0;
2791         }
2792 }
2793
2794 static int check_mime(const char *appid, char *mime)
2795 {
2796         int ret = 0;
2797         pkgmgrinfo_appinfo_h handle;
2798         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2799         if (ret != PMINFO_R_OK)
2800                 return -1;
2801         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2802         if (ret != PMINFO_R_OK) {
2803                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2804                 return -1;
2805         }
2806         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2807         return 0;
2808 }
2809  * @endcode
2810  */
2811 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2812                                                                                 int *mime_count, char ***mime);
2813
2814 /**
2815  * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2816                                                                                 int *subapp_count, char ***subapp)
2817  * @brief       This API gets the list of subapp of the application
2818  *
2819  * @par         This API is for package-manager client application
2820  * @par Sync (or) Async : Synchronous API
2821  *
2822  * @param[in] handle            pointer to the appcontrol handle.
2823  * @param[out] subapp_count             pointer to hold number of subapp
2824  * @param[out] subapp           pointer to hold list of subapp
2825  * @return      0 if success, error code(<0) if fail
2826  * @retval      PMINFO_R_OK     success
2827  * @retval      PMINFO_R_EINVAL invalid argument
2828  * @retval      PMINFO_R_ERROR  internal error
2829  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2830  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2831  * @see         pkgmgrinfo_appinfo_get_uri()
2832  * @see         pkgmgrinfo_appinfo_get_operation()
2833  * @code
2834 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2835 {
2836         int sc = 0;
2837         int i = 0;
2838         char **subapp = NULL;
2839         pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2840         for (i = 0; i < sc; i++) {
2841                 if (strcmp(subapp[i], (char *)user_data) == 0)
2842                         return -1;
2843                 else
2844                         return 0;
2845         }
2846 }
2847
2848 static int check_subapp(const char *appid, char *subapp)
2849 {
2850         int ret = 0;
2851         pkgmgrinfo_appinfo_h handle = NULL;
2852         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2853         if (ret != PMINFO_R_OK)
2854                 return -1;
2855         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2856         if (ret != PMINFO_R_OK) {
2857                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2858                 return -1;
2859         }
2860         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2861         return 0;
2862 }
2863  * @endcode
2864  */
2865 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2866                                                 int *subapp_count, char ***subapp);
2867
2868 /**
2869  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2870  * @brief       This API gets the notification icon of the application
2871  *
2872  * @par         This API is for package-manager client application
2873  * @par Sync (or) Async : Synchronous API
2874  *
2875  * @param[in] handle            pointer to the application info handle.
2876  * @param[out] path             pointer to hold notification icon
2877  * @return      0 if success, error code(<0) if fail
2878  * @retval      PMINFO_R_OK     success
2879  * @retval      PMINFO_R_EINVAL invalid argument
2880  * @retval      PMINFO_R_ERROR  internal error
2881  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2882  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2883  * @see         pkgmgrinfo_appinfo_get_appid()
2884  * @see         pkgmgrinfo_appinfo_is_multiple()
2885  * @code
2886 static int get_app_notification_icon(const char *appid)
2887 {
2888         int ret = 0;
2889         char *notification_icon = NULL;
2890         pkgmgrinfo_appinfo_h handle;
2891         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2892         if (ret != PMINFO_R_OK)
2893                 return -1;
2894         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
2895         if (ret != PMINFO_R_OK) {
2896                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2897                 return -1;
2898         }
2899         printf("notification icon : %s\n", notification_icon);
2900         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2901         return 0;
2902 }
2903  * @endcode
2904  */
2905 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2906
2907 /**
2908  * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2909  * @brief       This API gets the setting icon of the application
2910  *
2911  * @par         This API is for package-manager client application
2912  * @par Sync (or) Async : Synchronous API
2913  *
2914  * @param[in] handle            pointer to the application info handle.
2915  * @param[out] path             pointer to hold setting icon
2916  * @return      0 if success, error code(<0) if fail
2917  * @retval      PMINFO_R_OK     success
2918  * @retval      PMINFO_R_EINVAL invalid argument
2919  * @retval      PMINFO_R_ERROR  internal error
2920  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2921  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2922  * @see         pkgmgrinfo_appinfo_get_appid()
2923  * @see         pkgmgrinfo_appinfo_is_multiple()
2924  * @code
2925 static int get_app_setting_icon(const char *appid)
2926 {
2927         int ret = 0;
2928         char *setting_icon = NULL;
2929         pkgmgrinfo_appinfo_h handle;
2930         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2931         if (ret != PMINFO_R_OK)
2932                 return -1;
2933         ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2934         if (ret != PMINFO_R_OK) {
2935                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2936                 return -1;
2937         }
2938         printf("setting icon : %s\n", setting_icon);
2939         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2940         return 0;
2941 }
2942  * @endcode
2943  */
2944 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2945
2946 /**
2947  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2948  * @brief       This API gets the type of recent image on app-tray
2949  *
2950  * @par         This API is for package-manager client application
2951  * @par Sync (or) Async : Synchronous API
2952  *
2953  * @param[in] handle            pointer to the application info handle.
2954  * @param[out] type             pointer to hold image type
2955  * @return      0 if success, error code(<0) if fail
2956  * @retval      PMINFO_R_OK     success
2957  * @retval      PMINFO_R_EINVAL invalid argument
2958  * @retval      PMINFO_R_ERROR  internal error
2959  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2960  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2961  * @see         pkgmgrinfo_appinfo_get_appid()
2962  * @see         pkgmgrinfo_appinfo_is_multiple()
2963  * @code
2964 static int get_app_recent_image_type(const char *appid)
2965 {
2966         int ret = 0;
2967         pkgmgrinfo_app_recentimage type;
2968         pkgmgrinfo_appinfo_h handle;
2969         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2970         if (ret != PMINFO_R_OK)
2971                 return -1;
2972         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2973         if (ret != PMINFO_R_OK) {
2974                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2975                 return -1;
2976         }
2977         printf("recent image type: %d\n", type);
2978         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2979         return 0;
2980 }
2981  * @endcode
2982  */
2983 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
2984
2985
2986 /**
2987  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
2988  * @brief       This API gets the preview image of application
2989  *
2990  * @par Sync (or) Async : Synchronous API
2991  *
2992  * @param[in] handle            pointer to the application info handle.
2993  * @param[out] preview_img              pointer to hold preview image path
2994  * @return      0 if success, error code(<0) if fail
2995  * @retval      PMINFO_R_OK     success
2996  * @retval      PMINFO_R_EINVAL invalid argument
2997  * @retval      PMINFO_R_ERROR  internal error
2998  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2999  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3000  * @see         pkgmgrinfo_appinfo_get_appid()
3001  * @code
3002 static int get_app_previewimage(const char *appid)
3003 {
3004         int ret = 0;
3005         char *preview = NULL;
3006         pkgmgrinfo_appinfo_h handle = NULL;
3007         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3008         if (ret != PMINFO_R_OK)
3009                 return -1;
3010         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3011         if (ret != PMINFO_R_OK) {
3012                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3013                 return -1;
3014         }
3015         printf("preview image path : %s\n", preview);
3016         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3017         return 0;
3018 }
3019  * @endcode
3020  */
3021 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3022
3023
3024 /**
3025  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3026  * @brief       This API gets the package permission type of the application
3027  *
3028  * @par         This API is for package-manager client application
3029  * @par Sync (or) Async : Synchronous API
3030  *
3031  * @param[in] handle            pointer to the application info handle.
3032  * @param[out] permission               pointer to hold package permission
3033  * @return      0 if success, error code(<0) if fail
3034  * @retval      PMINFO_R_OK     success
3035  * @retval      PMINFO_R_EINVAL invalid argument
3036  * @retval      PMINFO_R_ERROR  internal error
3037  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3038  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3039  * @see         pkgmgrinfo_appinfo_get_appid()
3040  * @code
3041 static int get_app_permission(const char *appid)
3042 {
3043         int ret = 0;
3044         pkgmgrinfo_permission_type permission = 0;
3045         pkgmgrinfo_appinfo_h handle;
3046
3047         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3048         if (ret != PMINFO_R_OK)
3049                 return -1;
3050         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3051         if (ret != PMINFO_R_OK) {
3052                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3053                 return -1;
3054         }
3055         printf("permission type: %d\n", permission);
3056         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3057         return 0;
3058 }
3059  * @endcode
3060  */
3061 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3062
3063 /**
3064  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3065  * @brief       This API gets the component_type
3066  *
3067  * @par         This API is for package-manager client application
3068  * @par Sync (or) Async : Synchronous API
3069  *
3070  * @param[in] handle            pointer to the application info handle.
3071  * @param[out] component_type           pointer to hold component_type
3072  * @return      0 if success, error code(<0) if fail
3073  * @retval      PMINFO_R_OK     success
3074  * @retval      PMINFO_R_EINVAL invalid argument
3075  * @retval      PMINFO_R_ERROR  internal error
3076  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3077  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3078  * @see         pkgmgrinfo_appinfo_get_pkgid()
3079  * @see         pkgmgrinfo_appinfo_is_multiple()
3080  * @code
3081 static int get_component_type(const char *appid)
3082 {
3083         int ret = 0;
3084         char *component_type = NULL;
3085         pkgmgrinfo_appinfo_h handle;
3086         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3087         if (ret != PMINFO_R_OK)
3088                 return -1;
3089         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3090         if (ret != PMINFO_R_OK) {
3091                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3092                 return -1;
3093         }
3094         printf("component_type: %s\n", component_type);
3095         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3096         return 0;
3097 }
3098  * @endcode
3099  */
3100 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3101
3102 /**
3103  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3104  * @brief       This API gets the application 'hwacceleration' value from the app ID
3105  *
3106  * @par         This API is for package-manager client application
3107  * @par Sync (or) Async : Synchronous API
3108  *
3109  * @param[in]   handle  pointer to application info handle
3110  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3111  * @return      0 if success, error code(<0) if fail
3112  * @retval      PMINFO_R_OK     success
3113  * @retval      PMINFO_R_EINVAL invalid argument
3114  * @retval      PMINFO_R_ERROR  internal error
3115  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3116  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3117  * @see         pkgmgrinfo_appinfo_get_appid()
3118  * @see         pkgmgrinfo_appinfo_is_multiple()
3119  * @code
3120 static int get_app_hwacceleration(const char *appid)
3121 {
3122         int ret = 0;
3123         pkgmgrinfo_app_hwacceleration hwacceleration;
3124         pkgmgrinfo_appinfo_h handle;
3125         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3126         if (ret != PMINFO_R_OK)
3127                 return -1;
3128         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3129         if (ret != PMINFO_R_OK) {
3130                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3131                 return -1;
3132         }
3133         printf("app hwacceleration: %d\n", hwacceleration);
3134         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3135         return 0;
3136 }
3137  * @endcode
3138  */
3139 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3140
3141 /**
3142  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3143  * @brief       This API gets the application 'screenreader' value from the app ID
3144  *
3145  * @par         This API is for package-manager client application
3146  * @par Sync (or) Async : Synchronous API
3147  *
3148  * @param[in]   handle  pointer to application info handle
3149  * @param[out] screenreader             pointer to hold package accessibility value
3150  * @return      0 if success, error code(<0) if fail
3151  * @retval      PMINFO_R_OK     success
3152  * @retval      PMINFO_R_EINVAL invalid argument
3153  * @retval      PMINFO_R_ERROR  internal error
3154  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3155  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3156  * @see         pkgmgrinfo_appinfo_get_appid()
3157  * @see         pkgmgrinfo_appinfo_is_multiple()
3158  * @code
3159 static int get_app_screenreader(const char *appid)
3160 {
3161         int ret = 0;
3162         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3163         pkgmgrinfo_appinfo_h handle = NULL;
3164         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3165         if (ret != PMINFO_R_OK)
3166                 return -1;
3167         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3168         if (ret != PMINFO_R_OK) {
3169                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3170                 return -1;
3171         }
3172         printf("app screenreader: %d\n", screenreader);
3173         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3174         return 0;
3175 }
3176  * @endcode
3177  */
3178 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3179
3180 /**
3181  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3182  * @brief       This API gets the application's landscape & portrait effect images
3183  *
3184  * @par         This API is for package-manager client application
3185  * @par Sync (or) Async : Synchronous API
3186  *
3187  * @param[in]   handle  pointer to application info handle
3188  * @param[out]  portrait_img contains portrait mode effect image
3189  * @param[out]  landscape_img contains landscape mode effect image
3190  * @return      0 if success, error code(<0) if fail
3191  * @retval      PMINFO_R_OK     success
3192  * @retval      PMINFO_R_EINVAL invalid argument
3193  * @retval      PMINFO_R_ERROR  internal error
3194  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3195  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3196  * @see         pkgmgrinfo_appinfo_get_appid()
3197  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3198  * @code
3199 static int get_app_effectimages(const char *appid)
3200 {
3201         int ret = 0;
3202         char *portraitimg = NULL;
3203         char *landscapeimg = NULL;
3204         pkgmgrinfo_appinfo_h handle;
3205         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3206         if (ret != PMINFO_R_OK)
3207                 return -1;
3208         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3209         if (ret != PMINFO_R_OK) {
3210                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3211                 return -1;
3212         }
3213         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3214         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3215         return 0;
3216 }
3217  * @endcode
3218  */
3219 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3220
3221 /**
3222  * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h  handle, char **effectimg_type)
3223  * @brief       This API gets the application's effect image type
3224  *
3225  * @par         This API is for package-manager client application
3226  * @par Sync (or) Async : Synchronous API
3227  *
3228  * @param[in]   handle  pointer to application info handle
3229  * @param[out]  effectimg_type contains effect image type
3230  * @return      0 if success, error code(<0) if fail
3231  * @retval      PMINFO_R_OK     success
3232  * @retval      PMINFO_R_EINVAL invalid argument
3233  * @retval      PMINFO_R_ERROR  internal error
3234  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3235  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3236  * @see         pkgmgrinfo_appinfo_get_appid()
3237  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3238  * @code
3239 static int get_app_effectimage_type(const char *appid)
3240 {
3241         int ret = 0;
3242         char *effectimg_type = NULL;
3243         pkgmgrinfo_appinfo_h handle = NULL;
3244         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3245         if (ret != PMINFO_R_OK)
3246                 return -1;
3247         ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3248         if (ret != PMINFO_R_OK) {
3249                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3250                 return -1;
3251         }
3252         printf("app effect image type: %s\n", effectimg_type);
3253         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3254         return 0;
3255 }
3256  * @endcode
3257  */
3258 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3259
3260 /**
3261  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3262  * @brief       This API gets the submode_mainid of the application
3263  *
3264  * @par         This API is for package-manager client application
3265  * @par Sync (or) Async : Synchronous API
3266  *
3267  * @param[in] handle            pointer to the application info handle.
3268  * @param[out] submode_mainid           pointer to hold package name
3269  * @return      0 if success, error code(<0) if fail
3270  * @retval      PMINFO_R_OK     success
3271  * @retval      PMINFO_R_EINVAL invalid argument
3272  * @retval      PMINFO_R_ERROR  internal error
3273  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3274  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3275  * @see         pkgmgrinfo_appinfo_get_appid()
3276  * @see         pkgmgrinfo_appinfo_is_multiple()
3277  * @code
3278 static int get_app_submode_mainid(const char *appid)
3279 {
3280         int ret = 0;
3281         char *submode_mainid = NULL;
3282         pkgmgrinfo_appinfo_h handle = NULL;
3283         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3284         if (ret != PMINFO_R_OK)
3285                 return -1;
3286         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3287         if (ret != PMINFO_R_OK) {
3288                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3289                 return -1;
3290         }
3291         printf("submode_mainid: %s\n", submode_mainid);
3292         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3293         return 0;
3294 }
3295  * @endcode
3296  */
3297 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3298
3299 /**
3300  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3301  * @brief       This API gets the datacontrol info
3302  *
3303  * @par         This API is for package-manager client application
3304  * @par Sync (or) Async : Synchronous API
3305  *
3306  * @param[in] providerid                pointer to the providerid of dataconltrol.
3307  * @param[in] type                      pointer to the type of dataconltrol.
3308  * @param[out] appid                    pointer to hold appid, need to free after using
3309  * @param[out] access                   pointer to hold access, need to free after using
3310  * @return      0 if success, error code(<0) if fail
3311  * @retval      PMINFO_R_OK     success
3312  * @retval      PMINFO_R_EINVAL invalid argument
3313  * @retval      PMINFO_R_ERROR  internal error
3314  * @endcode
3315  */
3316 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3317 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3318
3319 /**
3320  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3321  * @brief       This API gets the appid of datacontrol
3322  *
3323  * @par         This API is for package-manager client application
3324  * @par Sync (or) Async : Synchronous API
3325  *
3326  * @param[in] providerid                pointer to the providerid of dataconltrol.
3327  * @param[out] appid                    pointer to hold appid, need to free after using
3328  * @return      0 if success, error code(<0) if fail
3329  * @retval      PMINFO_R_OK     success
3330  * @retval      PMINFO_R_EINVAL invalid argument
3331  * @retval      PMINFO_R_ERROR  internal error
3332  * @endcode
3333  */
3334 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3335 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3336
3337 /**
3338  * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h  handle, char **alias_appid)
3339  * @brief       This API gets the alias_appid of the application
3340  *
3341  * @par         This API is for package-manager client application
3342  * @par Sync (or) Async : Synchronous API
3343  *
3344  * @param[in] handle            pointer to the application info handle.
3345  * @param[out] alias_appid              pointer to hold app alias_appid
3346  * @return      0 if success, error code(<0) if fail
3347  * @retval      PMINFO_R_OK     success
3348  * @retval      PMINFO_R_EINVAL invalid argument
3349  * @retval      PMINFO_R_ERROR  internal error
3350  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3351  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3352  * @see         pkgmgrinfo_appinfo_get_appid()
3353  * @code
3354 static int get_alias_appid(const char *appid)
3355 {
3356         int ret = 0;
3357         char *alias_appid= 0;
3358         pkgmgrinfo_appinfo_h handle = NULL;
3359         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3360         if (ret != PMINFO_R_OK)
3361                 return -1;
3362         ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3363         if (ret != PMINFO_R_OK) {
3364                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3365                 return -1;
3366         }
3367         printf("alias_appid: %s\n", alias_appid);
3368         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3369         return 0;
3370 }
3371  * @endcode
3372  */
3373 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3374
3375 /**
3376  * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h  handle, char **effective_appid)
3377  * @brief       This API gets the effective_appid of the application
3378  *
3379  * @par         This API is for package-manager client application
3380  * @par Sync (or) Async : Synchronous API
3381  *
3382  * @param[in] handle            pointer to the application info handle.
3383  * @param[out] effective_appid          pointer to hold app effective_appid
3384  * @return      0 if success, error code(<0) if fail
3385  * @retval      PMINFO_R_OK     success
3386  * @retval      PMINFO_R_EINVAL invalid argument
3387  * @retval      PMINFO_R_ERROR  internal error
3388  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3389  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3390  * @see         pkgmgrinfo_appinfo_get_appid()
3391  * @code
3392 static int get_effective_appid(const char *appid)
3393 {
3394         int ret = 0;
3395         char *effective_appid= 0;
3396         pkgmgrinfo_appinfo_h handle = NULL;
3397         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3398         if (ret != PMINFO_R_OK)
3399                 return -1;
3400         ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3401         if (ret != PMINFO_R_OK) {
3402                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3403                 return -1;
3404         }
3405         printf("effective_appid: %s\n", effective_appid);
3406         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3407         return 0;
3408 }
3409  * @endcode
3410  */
3411 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3412
3413 /**
3414  * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3415  * @brief       This API gets tep(tizen expansion package) file name associated with the package which contain given application
3416  *
3417  * @par This API is for package-manager client application
3418  * @par Sync (or) Async : Synchronous API
3419  *
3420  * @param[in] handle            pointer to the appinfo handle.
3421  * @param[out] tep_name         pointer to hold tep name
3422  * @return      0 if success, error code(<0) if fail
3423  * @retval      PMINFO_R_OK success
3424  * @retval      PMINFO_R_EINVAL invalid argument
3425  * @retval      PMINFO_R_ERROR  internal error
3426  * @pre pkgmgrinfo_appinfo_get_appinfo()
3427  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3428  * @see pkgmgrinfo_appinfo_get_appid()
3429  * @code
3430 static int get_tep_name(const char *appid)
3431 {
3432         int ret = 0;
3433         char *tep_name = NULL;
3434         pkgmgrinfo_appinfo_h handle = NULL;
3435         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3436         if (ret != PMINFO_R_OK)
3437                 return -1;
3438         ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3439         if (ret != PMINFO_R_OK) {
3440                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3441                 return -1;
3442         }
3443         printf("TEP name is: %s\n", tep_name);
3444         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3445         return 0;
3446 }
3447  * @endcode
3448  */
3449 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3450
3451 /**
3452  * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3453  * @brief       This API gets the root path of application
3454  *
3455  * @par Sync (or) Async : Synchronous API
3456  *
3457  * @param[in] handle            pointer to appinfo handle
3458  * @param[out] path             pointer to hold root path of application
3459  * @return      0 if success, error code(<0) if fail
3460  * @retval      PMINFO_R_OK     success
3461  * @retval      PMINFO_R_EINVAL invalid argument
3462  * @retval      PMINFO_R_ERROR  internal error
3463  * @code
3464 static int get_root_path(const char *appid)
3465 {
3466         int ret = 0;
3467         char *path = 0;
3468         pkgmgrinfo_appinfo_h handle;
3469         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3470         if (ret != PMINFO_R_OK)
3471                 return -1;
3472
3473         ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3474         if (ret != PMINFO_R_OK) {
3475                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3476                 return -1;
3477         }
3478         printf("path : %s\n", path);
3479         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3480
3481         return 0;
3482 }
3483  * @endcode
3484  */
3485 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3486
3487 /**
3488  * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3489  * @brief       This API gets the application api_version from the application ID
3490  *
3491  * @par         This API is for package-manager client application
3492  * @par Sync (or) Async : Synchronous API
3493  *
3494  * @param[in]   handle  pointer to appinfo handle
3495  * @param[out] api_version              pointer to hold application api_version
3496  * @return      0 if success, error code(<0) if fail
3497  * @retval      PMINFO_R_OK     success
3498  * @retval      PMINFO_R_EINVAL invalid argument
3499  * @retval      PMINFO_R_ERROR  internal error
3500  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3501  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3502  * @see         pkgmgrinfo_appinfo_get_appid()
3503  * @code
3504 static int get_app_api_version(const char *appid)
3505 {
3506         int ret = 0;
3507         char *api_version = NULL;
3508         pkgmgrinfo_appinfo_h handle = NULL;
3509         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3510         if (ret != PMINFO_R_OK)
3511                 return -1;
3512         ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3513         if (ret != PMINFO_R_OK) {
3514                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3515                 return -1;
3516         }
3517         printf("app api_version: %s\n", api_version);
3518         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3519         return 0;
3520 }
3521  * @endcode
3522  */
3523 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3524
3525 /**
3526  * @fn  int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3527                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3528  * @brief       This API gets the list of permission for a particular application
3529  *
3530  * @par         This API is for package-manager client application
3531  * @par Sync (or) Async : Synchronous API
3532  * @param[in]   handle          pointer to the application info handle.
3533  * @param[in]   permission_func         callback function for list
3534  * @param[in] user_data user data to be passed to callback function
3535  * @return      0 if success, error code(<0) if fail
3536  * @retval      PMINFO_R_OK     success
3537  * @retval      PMINFO_R_EINVAL invalid argument
3538  * @retval      PMINFO_R_ERROR  internal error
3539  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3540  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3541  * @code
3542 int permission_func(const char *name, void *user_data)
3543 {
3544         if (strcmp(name, (char *)user_data) == 0)
3545                 return -1;
3546         else
3547                 return 0;
3548 }
3549
3550 static int list_permission(const char *appid, char *permission)
3551 {
3552         int ret = 0;
3553         pkgmgrinfo_appinfo_h handle;
3554         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3555         if (ret != PMINFO_R_OK)
3556                 return -1;
3557         ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3558         if (ret != PMINFO_R_OK) {
3559                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3560                 return -1;
3561         }
3562         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3563         return 0;
3564 }
3565  * @endcode
3566  */
3567 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3568                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3569
3570 /**
3571  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3572                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3573  * @brief       This API gets the list of category for a particular application
3574  *
3575  * @par         This API is for package-manager client application
3576  * @par Sync (or) Async : Synchronous API
3577  * @param[in]   handle          pointer to the application info handle.
3578  * @param[in]   category_func           callback function for list
3579  * @param[in] user_data user data to be passed to callback function
3580  * @return      0 if success, error code(<0) if fail
3581  * @retval      PMINFO_R_OK     success
3582  * @retval      PMINFO_R_EINVAL invalid argument
3583  * @retval      PMINFO_R_ERROR  internal error
3584  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3585  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3586  * @code
3587 int category_func(const char *name, void *user_data)
3588 {
3589         if (strcmp(name, (char *)user_data) == 0)
3590                 return -1;
3591         else
3592                 return 0;
3593 }
3594
3595 static int list_category(const char *appid, char *category)
3596 {
3597         int ret = 0;
3598         pkgmgrinfo_appinfo_h handle;
3599         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3600         if (ret != PMINFO_R_OK)
3601                 return -1;
3602         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3603         if (ret != PMINFO_R_OK) {
3604                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3605                 return -1;
3606         }
3607         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608         return 0;
3609 }
3610  * @endcode
3611  */
3612 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3613                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3614
3615 /**
3616  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3617                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3618  * @brief       This API gets the list of metadata for a particular application
3619  *
3620  * @par         This API is for package-manager client application
3621  * @par Sync (or) Async : Synchronous API
3622  * @param[in]   handle          pointer to the application info handle.
3623  * @param[in]   metadata_func           callback function for list
3624  * @param[in] user_data user data to be passed to callback function
3625  * @return      0 if success, error code(<0) if fail
3626  * @retval      PMINFO_R_OK     success
3627  * @retval      PMINFO_R_EINVAL invalid argument
3628  * @retval      PMINFO_R_ERROR  internal error
3629  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3630  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3631  * @code
3632 int metadata_func(const char *key, const char *value, void *user_data)
3633 {
3634         if (strcmp(key, (char *)user_data) == 0) {
3635                 printf("Value is %s\n", value);
3636                 return -1;
3637         }
3638         else
3639                 return 0;
3640 }
3641
3642 static int list_metadata(const char *appid, char *key)
3643 {
3644         int ret = 0;
3645         pkgmgrinfo_appinfo_h handle;
3646         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3647         if (ret != PMINFO_R_OK)
3648                 return -1;
3649         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3650         if (ret != PMINFO_R_OK) {
3651                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3652                 return -1;
3653         }
3654         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3655         return 0;
3656 }
3657  * @endcode
3658  */
3659 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3660                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3661
3662
3663 /**
3664  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3665                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3666  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3667                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3668  * @brief       This API gets the list of app-control for a particular application
3669  *
3670  * @par         This API is for package-manager client application
3671  * @par Sync (or) Async : Synchronous API
3672  * @param[in]   handle          pointer to the application info handle.
3673  * @param[in]   appcontrol_func         callback function for list
3674  * @param[in] user_data user data to be passed to callback function
3675  * @param[in]   uid     the addressee user id of the instruction
3676  * @return      0 if success, error code(<0) if fail
3677  * @retval      PMINFO_R_OK     success
3678  * @retval      PMINFO_R_EINVAL invalid argument
3679  * @retval      PMINFO_R_ERROR  internal error
3680  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3681  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3682  * @code
3683 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3684 {
3685         int oc = 0;
3686         int i = 0;
3687         char **operation;
3688         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3689         for (i = 0; i < oc; i++) {
3690                 if (strcmp(operation[i], (char *)user_data) == 0)
3691                         return -1;
3692                 else
3693                         return 0;
3694         }
3695 }
3696
3697 static int check_operation(const char *appid, char *operation)
3698 {
3699         int ret = 0;
3700         pkgmgrinfo_appinfo_h handle;
3701         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3702         if (ret != PMINFO_R_OK)
3703                 return -1;
3704         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3705         if (ret != PMINFO_R_OK) {
3706                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3707                 return -1;
3708         }
3709         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3710         return 0;
3711 }
3712  * @endcode
3713  */
3714 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3715                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3716
3717 /**
3718  * @brief
3719  */
3720 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3721                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3722
3723 /**
3724  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3725                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3726  * @brief       This API gets the list of splashscreen for a particular application
3727  *
3728  * @par         This API is for package-manager client application
3729  * @par Sync (or) Async : Synchronous API
3730  * @param[in]   handle          pointer to the application info handle.
3731  * @param[in]   splash_screen_func              callback function for list
3732  * @param[in]   user_data       user data to be passed to callback function
3733  * @return      0 if success, error code(<0) if fail
3734  * @retval      PMINFO_R_OK     success
3735  * @retval      PMINFO_R_EINVAL invalid argument
3736  * @retval      PMINFO_R_ERROR  internal error
3737  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3738  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3739  * @code
3740  */
3741 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3742                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3743
3744 /**
3745  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3746  * @brief       This API gets the application 'nodisplay' value from the app ID
3747  *
3748  * @par         This API is for package-manager client application
3749  * @par Sync (or) Async : Synchronous API
3750  *
3751  * @param[in]   handle  pointer to application info handle
3752  * @param[out] nodisplay                pointer to hold package nodisplay value
3753  * @return      0 if success, error code(<0) if fail
3754  * @retval      PMINFO_R_OK     success
3755  * @retval      PMINFO_R_EINVAL invalid argument
3756  * @retval      PMINFO_R_ERROR  internal error
3757  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3758  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3759  * @see         pkgmgrinfo_appinfo_get_appid()
3760  * @see         pkgmgrinfo_appinfo_is_multiple()
3761  * @code
3762 static int get_app_nodisplay(const char *appid)
3763 {
3764         int ret = 0;
3765         bool nodisplay;
3766         pkgmgrinfo_appinfo_h handle;
3767         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3768         if (ret != PMINFO_R_OK)
3769                 return -1;
3770         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3771         if (ret != PMINFO_R_OK) {
3772                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3773                 return -1;
3774         }
3775         printf("app nodisplay: %d\n", nodisplay);
3776         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3777         return 0;
3778 }
3779  * @endcode
3780  */
3781 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
3782
3783 /**
3784  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3785  * @brief       This API gets the application 'multiple' value from the app ID
3786  *
3787  * @par         This API is for package-manager client application
3788  * @par Sync (or) Async : Synchronous API
3789  *
3790  * @param[in]   handle  pointer to application info handle
3791  * @param[out] multiple         pointer to hold package multiple value
3792  * @return      0 if success, error code(<0) if fail
3793  * @retval      PMINFO_R_OK     success
3794  * @retval      PMINFO_R_EINVAL invalid argument
3795  * @retval      PMINFO_R_ERROR  internal error
3796  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3797  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3798  * @see         pkgmgrinfo_appinfo_get_appid()
3799  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3800  * @code
3801 static int get_app_multiple(const char *appid)
3802 {
3803         int ret = 0;
3804         bool multiple;
3805         pkgmgrinfo_appinfo_h handle;
3806         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3807         if (ret != PMINFO_R_OK)
3808                 return -1;
3809         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3810         if (ret != PMINFO_R_OK) {
3811                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3812                 return -1;
3813         }
3814         printf("app multiple: %d\n", multiple);
3815         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3816         return 0;
3817 }
3818  * @endcode
3819  */
3820 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
3821
3822 /**
3823  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3824  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3825  *              application launching effect. If fales, indicator will be hidden during application launching effect
3826  *
3827  * @par         This API is for package-manager client application
3828  * @par Sync (or) Async : Synchronous API
3829  *
3830  * @param[in]   handle  pointer to application info handle
3831  * @param[out]  indicator_disp contains indicator display status for application launching effect
3832  * @return      0 if success, error code(<0) if fail
3833  * @retval      PMINFO_R_OK     success
3834  * @retval      PMINFO_R_EINVAL invalid argument
3835  * @retval      PMINFO_R_ERROR  internal error
3836  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3837  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3838  * @see         pkgmgrinfo_appinfo_get_appid()
3839  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3840  * @code
3841 static int get_app_indicator_display(const char *appid)
3842 {
3843         int ret = 0;
3844         bool indicator_disp;
3845         pkgmgrinfo_appinfo_h handle;
3846         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3847         if (ret != PMINFO_R_OK)
3848                 return -1;
3849         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3850         if (ret != PMINFO_R_OK){
3851                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3852                 return -1;
3853         }
3854         printf("app indicator disp : %d\n", indicator_disp);
3855         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3856         return 0;
3857 }
3858  * @endcode
3859  */
3860 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3861
3862 /**
3863  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3864  * @brief       This API gets the application 'taskmanage' value from the app ID
3865  *
3866  * @par         This API is for package-manager client application
3867  * @par Sync (or) Async : Synchronous API
3868  *
3869  * @param[in]   handle  pointer to application info handle
3870  * @param[out] taskmanage               pointer to hold package taskmanage value
3871  * @return      0 if success, error code(<0) if fail
3872  * @retval      PMINFO_R_OK     success
3873  * @retval      PMINFO_R_EINVAL invalid argument
3874  * @retval      PMINFO_R_ERROR  internal error
3875  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3876  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3877  * @see         pkgmgrinfo_appinfo_get_appid()
3878  * @see         pkgmgrinfo_appinfo_is_multiple()
3879  * @code
3880 static int get_app_taskmanage(const char *appid)
3881 {
3882         int ret = 0;
3883         bool taskmanage;
3884         pkgmgrinfo_appinfo_h handle;
3885         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3886         if (ret != PMINFO_R_OK)
3887                 return -1;
3888         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3889         if (ret != PMINFO_R_OK) {
3890                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3891                 return -1;
3892         }
3893         printf("app taskmanage: %d\n", taskmanage);
3894         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895         return 0;
3896 }
3897  * @endcode
3898  */
3899 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
3900
3901 /**
3902  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3903  * @brief       This API gets the application 'taskmanage' value from the app ID
3904  *
3905  * @par         This API is for package-manager client application
3906  * @par Sync (or) Async : Synchronous API
3907  *
3908  * @param[in]   handle  pointer to application info handle
3909  * @param[out] enabled          pointer to hold package enabled value
3910  * @return      0 if success, error code(<0) if fail
3911  * @retval      PMINFO_R_OK     success
3912  * @retval      PMINFO_R_EINVAL invalid argument
3913  * @retval      PMINFO_R_ERROR  internal error
3914  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3915  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3916  * @see         pkgmgrinfo_appinfo_get_appid()
3917  * @see         pkgmgrinfo_appinfo_is_multiple()
3918  * @code
3919 static int get_app_enabled(const char *appid)
3920 {
3921         int ret = 0;
3922         bool enabled;
3923         pkgmgrinfo_appinfo_h handle;
3924         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3925         if (ret != PMINFO_R_OK)
3926                 return -1;
3927         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3928         if (ret != PMINFO_R_OK) {
3929                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3930                 return -1;
3931         }
3932         printf("app enabled: %d\n", enabled);
3933         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3934         return 0;
3935 }
3936  * @endcode
3937  */
3938 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
3939
3940 /**
3941  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3942  * @brief       This API gets the application 'onboot' value from the app ID
3943  *
3944  * @par         This API is for package-manager client application
3945  * @par Sync (or) Async : Synchronous API
3946  *
3947  * @param[in]   handle  pointer to application info handle
3948  * @param[out] onboot           pointer to hold package onboot value
3949  * @return      0 if success, error code(<0) if fail
3950  * @retval      PMINFO_R_OK     success
3951  * @retval      PMINFO_R_EINVAL invalid argument
3952  * @retval      PMINFO_R_ERROR  internal error
3953  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3954  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3955  * @see         pkgmgrinfo_appinfo_get_appid()
3956  * @see         pkgmgrinfo_appinfo_is_multiple()
3957  * @code
3958 static int get_app_onboot(const char *appid)
3959 {
3960         int ret = 0;
3961         bool onboot;
3962         pkgmgrinfo_appinfo_h handle;
3963         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3964         if (ret != PMINFO_R_OK)
3965                 return -1;
3966         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3967         if (ret != PMINFO_R_OK) {
3968                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3969                 return -1;
3970         }
3971         printf("app onboot: %d\n", onboot);
3972         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3973         return 0;
3974 }
3975  * @endcode
3976  */
3977 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
3978
3979 /**
3980  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3981  * @brief       This API gets the application 'autorestart' value from the app ID
3982  *
3983  * @par         This API is for package-manager client application
3984  * @par Sync (or) Async : Synchronous API
3985  *
3986  * @param[in]   handle  pointer to application info handle
3987  * @param[out] autorestart              pointer to hold package autorestart value
3988  * @return      0 if success, error code(<0) if fail
3989  * @retval      PMINFO_R_OK     success
3990  * @retval      PMINFO_R_EINVAL invalid argument
3991  * @retval      PMINFO_R_ERROR  internal error
3992  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3993  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3994  * @see         pkgmgrinfo_appinfo_get_appid()
3995  * @see         pkgmgrinfo_appinfo_is_multiple()
3996  * @code
3997 static int get_app_autorestart(const char *appid)
3998 {
3999         int ret = 0;
4000         bool autorestart;
4001         pkgmgrinfo_appinfo_h handle;
4002         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4003         if (ret != PMINFO_R_OK)
4004                 return -1;
4005         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4006         if (ret != PMINFO_R_OK) {
4007                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008                 return -1;
4009         }
4010         printf("app autorestart: %d\n", autorestart);
4011         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4012         return 0;
4013 }
4014  * @endcode
4015  */
4016 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4017
4018 /**
4019  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4020  * @brief       This API gets the value for given application is main app or not from handle
4021  *
4022  * @par         This API is for package-manager client application
4023  * @par Sync (or) Async : Synchronous API
4024  *
4025  * @param[in]   handle  pointer to application info handle
4026  * @param[out] mainapp          pointer to hold package mainapp is or not
4027  * @return      0 if success, error code(<0) if fail
4028  * @retval      PMINFO_R_OK     success
4029  * @retval      PMINFO_R_EINVAL invalid argument
4030  * @retval      PMINFO_R_ERROR  internal error
4031  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4032  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4033  * @see         pkgmgrinfo_appinfo_get_appid()
4034  * @see         pkgmgrinfo_appinfo_is_multiple()
4035  * @code
4036 static int get_app_mainapp(const char *appid)
4037 {
4038         int ret = 0;
4039         bool mainapp;
4040         pkgmgrinfo_appinfo_h handle;
4041         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4042         if (ret != PMINFO_R_OK)
4043                 return -1;
4044         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4045         if (ret != PMINFO_R_OK) {
4046                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4047                 return -1;
4048         }
4049         printf("mainapp: %d\n", mainapp);
4050         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4051         return 0;
4052 }
4053  * @endcode
4054  */
4055 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4056
4057
4058 /**
4059  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4060  * @brief       This API gets the value for given application is preload or not from handle
4061  *
4062  * @par         This API is for package-manager client application
4063  * @par Sync (or) Async : Synchronous API
4064  *
4065  * @param[in]   handle  pointer to application info handle
4066  * @param[out] preload          pointer to hold preload is or not
4067  * @return      0 if success, error code(<0) if fail
4068  * @retval      PMINFO_R_OK     success
4069  * @retval      PMINFO_R_EINVAL invalid argument
4070  * @retval      PMINFO_R_ERROR  internal error
4071  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4072  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4073  * @see         pkgmgrinfo_appinfo_get_appid()
4074  * @see         pkgmgrinfo_appinfo_is_multiple()
4075  * @code
4076 static int get_app_preload(const char *appid)
4077 {
4078         int ret = 0;
4079         bool preload = 0;
4080         pkgmgrinfo_appinfo_h handle = NULL;
4081         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4082         if (ret != PMINFO_R_OK)
4083                 return -1;
4084         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4085         if (ret != PMINFO_R_OK) {
4086                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4087                 return -1;
4088         }
4089         printf("preload: %d\n", preload);
4090         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4091         return 0;
4092 }
4093  * @endcode
4094  */
4095 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4096
4097 /**
4098  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4099  * @brief       This API gets the value for given application is submode or not from handle
4100  *
4101  * @par         This API is for package-manager client application
4102  * @par Sync (or) Async : Synchronous API
4103  *
4104  * @param[in]   handle  pointer to application info handle
4105  * @param[out] submode          pointer to hold submode is or not
4106  * @return      0 if success, error code(<0) if fail
4107  * @retval      PMINFO_R_OK     success
4108  * @retval      PMINFO_R_EINVAL invalid argument
4109  * @retval      PMINFO_R_ERROR  internal error
4110  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4111  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4112  * @see         pkgmgrinfo_appinfo_get_appid()
4113  * @see         pkgmgrinfo_appinfo_is_multiple()
4114  * @code
4115 static int get_app_submode(const char *appid)
4116 {
4117         int ret = 0;
4118         bool submode = 0;
4119         pkgmgrinfo_appinfo_h handle = NULL;
4120         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4121         if (ret != PMINFO_R_OK)
4122                 return -1;
4123         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4124         if (ret != PMINFO_R_OK) {
4125                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4126                 return -1;
4127         }
4128         printf("submode: %d\n", submode);
4129         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4130         return 0;
4131 }
4132  * @endcode
4133  */
4134 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4135
4136 /**
4137  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4138  * @brief       This API gets the value for given application is process_pool or not from handle
4139  *
4140  * @par         This API is for package-manager client application
4141  * @par Sync (or) Async : Synchronous API
4142  *
4143  * @param[in]   handle  pointer to application info handle
4144  * @param[out] process_pool             pointer to hold process_pool is or not
4145  * @return      0 if success, error code(<0) if fail
4146  * @retval      PMINFO_R_OK     success
4147  * @retval      PMINFO_R_EINVAL invalid argument
4148  * @retval      PMINFO_R_ERROR  internal error
4149  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4150  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4151  * @see         pkgmgrinfo_appinfo_get_appid()
4152  * @code
4153 static int get_app_process_pool(const char *appid)
4154 {
4155         int ret = 0;
4156         bool process_pool = 0;
4157         pkgmgrinfo_appinfo_h handle = NULL;
4158         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4159         if (ret != PMINFO_R_OK)
4160                 return -1;
4161         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4162         if (ret != PMINFO_R_OK) {
4163                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4164                 return -1;
4165         }
4166         printf("process_pool: %d\n", process_pool);
4167         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4168         return 0;
4169 }
4170  * @endcode
4171  */
4172 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4173
4174 /**
4175  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4176  * @brief       This API gets the installed storage location of the application
4177  *
4178  * @par This API is for package-manager client application
4179  * @par Sync (or) Async : Synchronous API
4180  *
4181  * @param[in] handle            pointer to the application info handle.
4182  * @param[out] app_type         pointer to hold installed storage location
4183  * @return      0 if success, error code(<0) if fail
4184  * @retval      PMINFO_R_OK success
4185  * @retval      PMINFO_R_EINVAL invalid argument
4186  * @retval      PMINFO_R_ERROR  internal error
4187  * @pre pkgmgrinfo_appinfo_get_appinfo()
4188  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4189  * @see pkgmgrinfo_appinfo_get_appid()
4190  * @code
4191 static int get_app_installed_location(const char *appid)
4192 {
4193         int ret = 0;
4194         pkgmgrinfo_installed_storage storage;
4195         pkgmgrinfo_appinfo_h handle = NULL;
4196         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4197         if (ret != PMINFO_R_OK)
4198                 return -1;
4199         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4200         if (ret != PMINFO_R_OK) {
4201                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4202                 return -1;
4203         }
4204         printf("Installed storage location : %d\n", storage);
4205         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4206         return 0;
4207 }
4208  * @endcode
4209  */
4210 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4211
4212
4213 /**
4214  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4215  * @brief       This API checks if the application has the given category
4216  *
4217  * @par         This API is for package-manager client application
4218  * @par Sync (or) Async : Synchronous API
4219  *
4220  * @param[in]   handle  pointer to the application info handle
4221  * @param[in]   category        category
4222  * @param[out] exist            value Gets whether the application has the given category
4223  * @return      0 if success, error code(<0) if fail
4224  * @retval      PMINFO_R_OK     success
4225  * @retval      PMINFO_R_EINVAL invalid argument
4226  * @retval      PMINFO_R_ERROR  internal error
4227  * @code
4228 static int is_category_exist(const char *appid, const char *category)
4229 {
4230         int ret = 0;
4231         pkgmgrinfo_appinfo_h handle;
4232         bool exist = false;
4233
4234         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4235         if (ret != PMINFO_R_OK)
4236                 return -1;
4237
4238         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4239         if (ret != PMINFO_R_OK) {
4240                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4241                 return -1;
4242         }
4243
4244         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4245         return 0;
4246 }
4247  * @endcode
4248  */
4249 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4250
4251 /**
4252  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4253  * @brief       This API gets the application 'ui_gadget' value from the app ID
4254  *
4255  * @par         This API is for package-manager client application
4256  * @par Sync (or) Async : Synchronous API
4257  *
4258  * @param[in]   handle  pointer to application info handle
4259  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4260  * @return      0 if success, error code(<0) if fail
4261  * @retval      PMINFO_R_OK     success
4262  * @retval      PMINFO_R_EINVAL invalid argument
4263  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4264  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4265  * @code
4266 static int get_app_ui_gadget(const char *appid)
4267 {
4268         int ret = 0;
4269         bool ui_gadget;
4270         pkgmgrinfo_appinfo_h handle = NULL;
4271         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4272         if (ret != PMINFO_R_OK)
4273                 return -1;
4274         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4275         if (ret != PMINFO_R_OK) {
4276                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4277                 return -1;
4278         }
4279         printf("app ui_gadget: %d\n", ui_gadget);
4280         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4281         return 0;
4282 }
4283  * @endcode
4284  */
4285 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4286
4287 /**
4288  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4289  * @brief       This API gets the application 'support_disable' value from the app ID
4290  *
4291  * @par         This API is for package-manager client application
4292  * @par Sync (or) Async : Synchronous API
4293  *
4294  * @param[in]   handle  pointer to application info handle
4295  * @param[out]  support_disable pointer to hold package support_disable value
4296  * @return      0 if success, error code(<0) if fail
4297  * @retval      PMINFO_R_OK     success
4298  * @retval      PMINFO_R_EINVAL invalid argument
4299  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4300  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4301  * @code
4302 static int get_app_support_disable(const char *appid)
4303 {
4304         int ret = 0;
4305         bool support_disable;
4306         pkgmgrinfo_appinfo_h handle = NULL;
4307         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4308         if (ret != PMINFO_R_OK)
4309                 return -1;
4310         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4311         if (ret != PMINFO_R_OK) {
4312                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4313                 return -1;
4314         }
4315         printf("app support_disable: %d\n", support_disable);
4316         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4317         return 0;
4318 }
4319  * @endcode
4320  */
4321 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4322
4323 /**
4324  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4325  * @brief       This API gets the application 'is_disable' value from the app ID
4326  *
4327  * @par         This API is for package-manager client application
4328  * @par Sync (or) Async : Synchronous API
4329  *
4330  * @param[in]   handle  pointer to application info handle
4331  * @param[out]  disabled        pointer to hold application is_disabled value
4332  * @return      0 if success, error code(<0) if fail
4333  * @retval      PMINFO_R_OK     success
4334  * @retval      PMINFO_R_EINVAL invalid argument
4335  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4336  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4337  * @code
4338 static int get_app_is_disable(const char *appid)
4339 {
4340         int ret = 0;
4341         bool is_disable;
4342         pkgmgrinfo_appinfo_h handle = NULL;
4343         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4344         if (ret != PMINFO_R_OK)
4345                 return -1;
4346         ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4347         if (ret != PMINFO_R_OK) {
4348                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4349                 return -1;
4350         }
4351         printf("app is_disable: %d\n", is_disable);
4352         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4353         return 0;
4354 }
4355  * @endcode
4356  */
4357 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4358
4359 /**
4360  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4361  * @brief       This API gets whethere the given application is global application or user application
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 application info handle
4367  * @param[in]   global  pointer to hold application global value
4368  * @return      0 if success, error code(<0) if fail
4369  * @retval      PMINFO_R_OK     success
4370  * @retval      PMINFO_R_EINVAL invalid argument
4371  * @retval      PMINFO_R_ERROR  internal error
4372  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4373  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4374  * @see         pkgmgrinfo_appinfo_get_appid()
4375  static int get_app_is_global(const char *appid)
4376  {
4377          int ret = 0;
4378          bool global;
4379          pkgmgrinfo_appinfo_h handle = NULL;
4380          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4381          if (ret != PMINFO_R_OK)
4382                  return -1;
4383          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4384          if (ret != PMINFO_R_OK) {
4385                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
4386                  return -1;
4387          }
4388          printf("app is_global: %d\n", global);
4389          pkgmgrinfo_appinfo_destroy_appinfo(handle);
4390          return 0;
4391  }
4392   * @endcode
4393   */
4394 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4395
4396 /**
4397  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4398  * @brief       This API gets the application 'splash_screen_display' value from the app ID
4399  *
4400  * @par         This API is for package-manager client application
4401  * @par Sync (or) Async : Synchronous API
4402  *
4403  * @param[in]   handle          pointer to application info handle
4404  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
4405  * @return      0 if success, error code(<0) if fail
4406  * @retval      PMINFO_R_OK     success
4407  * @retval      PMINFO_R_EINVAL invalid argument
4408  * @retval      PMINFO_R_ERROR  internal error
4409  */
4410 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4411
4412 /**
4413  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4414  * @brief       This API destroys the application information handle freeing up all the resources
4415  *
4416  * @par         This API is for package-manager client application
4417  * @par Sync (or) Async : Synchronous API
4418  *
4419  * @param[in] handle            pointer to the application info handle.
4420  * @return      0 if success, error code(<0) if fail
4421  * @retval      PMINFO_R_OK     success
4422  * @retval      PMINFO_R_EINVAL invalid argument
4423  * @retval      PMINFO_R_ERROR  internal error
4424  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4425  * @post                None
4426  * @see         pkgmgrinfo_appinfo_get_pkgid()
4427  * @see         pkgmgrinfo_appinfo_is_multiple()
4428  * @code
4429 static int get_app_type(const char *appid)
4430 {
4431         int ret = 0;
4432         char *type = NULL;
4433         pkgmgrinfo_appinfo_h handle;
4434         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4435         if (ret != PMINFO_R_OK)
4436                 return -1;
4437         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4438         if (ret != PMINFO_R_OK) {
4439                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4440                 return -1;
4441         }
4442         printf("apptype: %s\n", type);
4443         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4444         return 0;
4445 }
4446  * @endcode
4447  */
4448 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
4449
4450 /**
4451  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4452  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
4453  The query will search the entire application information collected from the manifest file of all the installed packages
4454  *
4455  * @par         This API is for package-manager client application
4456  * @par Sync (or) Async : Synchronous API
4457  *
4458  * @param[out] handle           pointer to the application info filter handle.
4459  * @return      0 if success, error code(<0) if fail
4460  * @retval      PMINFO_R_OK     success
4461  * @retval      PMINFO_R_EINVAL invalid argument
4462  * @retval      PMINFO_R_ERROR  internal error
4463  * @pre         None
4464  * @post                pkgmgrinfo_appinfo_filter_destroy()
4465  * @see         pkgmgrinfo_appinfo_filter_count()
4466  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4467  * @code
4468 static int get_capp_count()
4469 {
4470         int ret = 0;
4471         int count = 0;
4472         pkgmgrinfo_appinfo_filter_h handle;
4473         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4474         if (ret != PMINFO_R_OK)
4475                 return -1;
4476         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4477         if (ret != PMINFO_R_OK) {
4478                 pkgmgrinfo_appinfo_filter_destroy(handle);
4479                 return -1;
4480         }
4481         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4482         if (ret != PMINFO_R_OK) {
4483                 pkgmgrinfo_appinfo_filter_destroy(handle);
4484                 return -1;
4485         }
4486         printf("No of capp: %d\n", count);
4487         pkgmgrinfo_appinfo_filter_destroy(handle);
4488         return 0;
4489 }
4490  * @endcode
4491  */
4492 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4493
4494 /**
4495  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4496  * @brief       This API destroys the application information filter handle freeing up all the resources
4497  *
4498  * @par         This API is for package-manager client application
4499  * @par Sync (or) Async : Synchronous API
4500  *
4501  * @param[in] handle            pointer to the application info filter handle.
4502  * @return      0 if success, error code(<0) if fail
4503  * @retval      PMINFO_R_OK     success
4504  * @retval      PMINFO_R_EINVAL invalid argument
4505  * @retval      PMINFO_R_ERROR  internal error
4506  * @pre         pkgmgrinfo_appinfo_filter_create()
4507  * @post                None
4508  * @see         pkgmgrinfo_appinfo_filter_count()
4509  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4510  * @code
4511 static int get_capp_count()
4512 {
4513         int ret = 0;
4514         int count = 0;
4515         pkgmgrinfo_appinfo_filter_h handle;
4516         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4517         if (ret != PMINFO_R_OK)
4518                 return -1;
4519         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4520         if (ret != PMINFO_R_OK) {
4521                 pkgmgrinfo_appinfo_filter_destroy(handle);
4522                 return -1;
4523         }
4524         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4525         if (ret != PMINFO_R_OK) {
4526                 pkgmgrinfo_appinfo_filter_destroy(handle);
4527                 return -1;
4528         }
4529         printf("No of capp: %d\n", count);
4530         pkgmgrinfo_appinfo_filter_destroy(handle);
4531         return 0;
4532 }
4533  * @endcode
4534  */
4535 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4536
4537 /**
4538  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4539  * @brief       This API adds a boolean filter property to the filter handle
4540  *
4541  * @par         This API is for package-manager client application
4542  * @par Sync (or) Async : Synchronous API
4543  *
4544  * @param[in] handle            pointer to the application info filter handle.
4545  * @param[in] property          boolean property name.
4546  * @param[in] value             value corresponding to the property.
4547  * @return      0 if success, error code(<0) if fail
4548  * @retval      PMINFO_R_OK     success
4549  * @retval      PMINFO_R_EINVAL invalid argument
4550  * @retval      PMINFO_R_ERROR  internal error
4551  * @pre         pkgmgrinfo_appinfo_filter_create()
4552  * @post                pkgmgrinfo_appinfo_filter_destroy()
4553  * @see         pkgmgrinfo_appinfo_filter_count()
4554  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4555  * @code
4556 static int get_taskmanageable_app_count()
4557 {
4558         int ret = 0;
4559         int count = 0;
4560         pkgmgrinfo_appinfo_filter_h handle;
4561         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4562         if (ret != PMINFO_R_OK)
4563                 return -1;
4564         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4565         if (ret != PMINFO_R_OK) {
4566                 pkgmgrinfo_appinfo_filter_destroy(handle);
4567                 return -1;
4568         }
4569         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4570         if (ret != PMINFO_R_OK) {
4571                 pkgmgrinfo_appinfo_filter_destroy(handle);
4572                 return -1;
4573         }
4574         printf("No of taskmanageable apps: %d\n", count);
4575         pkgmgrinfo_appinfo_filter_destroy(handle);
4576         return 0;
4577 }
4578  * @endcode
4579  */
4580 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4581                 const char *property, const bool value);
4582
4583 /**
4584  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4585  * @brief       This API adds an integer filter property to the filter handle
4586  *
4587  * @par         This API is for package-manager client application
4588  * @par Sync (or) Async : Synchronous API
4589  *
4590  * @param[in] handle            pointer to the application info filter handle.
4591  * @param[in] property          integer property name.
4592  * @param[in] value             value corresponding to the property.
4593  * @return      0 if success, error code(<0) if fail
4594  * @retval      PMINFO_R_OK     success
4595  * @retval      PMINFO_R_EINVAL invalid argument
4596  * @retval      PMINFO_R_ERROR  internal error
4597  * @pre         pkgmgrinfo_appinfo_filter_create()
4598  * @post                pkgmgrinfo_appinfo_filter_destroy()
4599  * @see         pkgmgrinfo_appinfo_filter_count()
4600  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4601  * @code
4602 static int get_taskmanageable_app_count()
4603 {
4604         int ret = 0;
4605         int count = 0;
4606         pkgmgrinfo_appinfo_filter_h handle;
4607         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4608         if (ret != PMINFO_R_OK)
4609                 return -1;
4610         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4611         if (ret != PMINFO_R_OK) {
4612                 pkgmgrinfo_appinfo_filter_destroy(handle);
4613                 return -1;
4614         }
4615         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4616         if (ret != PMINFO_R_OK) {
4617                 pkgmgrinfo_appinfo_filter_destroy(handle);
4618                 return -1;
4619         }
4620         printf("No of apps: %d\n", count);
4621         pkgmgrinfo_appinfo_filter_destroy(handle);
4622         return 0;
4623 }
4624  * @endcode
4625  */
4626 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4627                 const char *property, const int value);
4628
4629 /**
4630  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4631  * @brief       This API adds a string filter property to the filter handle
4632  *
4633  * @par         This API is for package-manager client application
4634  * @par Sync (or) Async : Synchronous API
4635  *
4636  * @param[in] handle            pointer to the application info filter handle.
4637  * @param[in] property          string property name.
4638  * @param[in] value             value corresponding to the property.
4639  * @return      0 if success, error code(<0) if fail
4640  * @retval      PMINFO_R_OK     success
4641  * @retval      PMINFO_R_EINVAL invalid argument
4642  * @retval      PMINFO_R_ERROR  internal error
4643  * @pre         pkgmgrinfo_appinfo_filter_create()
4644  * @post                pkgmgrinfo_appinfo_filter_destroy()
4645  * @see         pkgmgrinfo_appinfo_filter_count()
4646  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4647  * @code
4648 static int get_capp_count()
4649 {
4650         int ret = 0;
4651         int count = 0;
4652         pkgmgrinfo_appinfo_filter_h handle;
4653         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4654         if (ret != PMINFO_R_OK)
4655                 return -1;
4656         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4657         if (ret != PMINFO_R_OK) {
4658                 pkgmgrinfo_appinfo_filter_destroy(handle);
4659                 return -1;
4660         }
4661         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4662         if (ret != PMINFO_R_OK) {
4663                 pkgmgrinfo_appinfo_filter_destroy(handle);
4664                 return -1;
4665         }
4666         printf("No of capp: %d\n", count);
4667         pkgmgrinfo_appinfo_filter_destroy(handle);
4668         return 0;
4669 }
4670  * @endcode
4671  */
4672 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4673                 const char *property, const char *value);
4674
4675 /**
4676  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4677  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
4678  *
4679  * @par         This API is for package-manager client application
4680  * @par Sync (or) Async : Synchronous API
4681  *
4682  * @param[in] handle            pointer to the application info filter handle.
4683  * @param[in] app_cb            callback function.
4684  * @param[in] user_data         user data to be passed to the callback function
4685  * @return      0 if success, error code(<0) if fail
4686  * @retval      PMINFO_R_OK     success
4687  * @retval      PMINFO_R_EINVAL invalid argument
4688  * @retval      PMINFO_R_ERROR  internal error
4689  * @pre         pkgmgrinfo_appinfo_filter_create()
4690  * @post                pkgmgrinfo_appinfo_filter_destroy()
4691  * @see         pkgmgrinfo_appinfo_filter_count()
4692  * @code
4693 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4694 {
4695         char *appid = NULL;
4696         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4697         printf("appid : %s\n", appid);
4698         return 0;
4699 }
4700
4701 static int get_capp_list()
4702 {
4703         int ret = 0;
4704         pkgmgrinfo_appinfo_filter_h handle;
4705         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4706         if (ret != PMINFO_R_OK)
4707                 return -1;
4708         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4709         if (ret != PMINFO_R_OK) {
4710                 pkgmgrinfo_appinfo_filter_destroy(handle);
4711                 return -1;
4712         }
4713         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4714         if (ret != PMINFO_R_OK) {
4715                 pkgmgrinfo_appinfo_filter_destroy(handle);
4716                 return -1;
4717         }
4718         pkgmgrinfo_appinfo_filter_destroy(handle);
4719         return 0;
4720 }
4721  * @endcode
4722  */
4723 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4724                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4725 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4726                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4727
4728 /**
4729  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4730  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4731  * @brief       This API counts the application that satisfy the filter conditions
4732  *
4733  * @par         This API is for package-manager client application
4734  * @par Sync (or) Async : Synchronous API
4735  *
4736  * @param[in] handle            pointer to the application info filter handle.
4737  * @param[in] count             pointer to store count value
4738  * @param[in]   uid     the addressee user id of the instruction
4739  * @return      0 if success, error code(<0) if fail
4740  * @retval      PMINFO_R_OK     success
4741  * @retval      PMINFO_R_EINVAL invalid argument
4742  * @retval      PMINFO_R_ERROR  internal error
4743  * @pre         pkgmgrinfo_appinfo_filter_create()
4744  * @post                pkgmgrinfo_appinfo_filter_destroy()
4745  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4746  * @code
4747 static int get_capp_count()
4748 {
4749         int ret = 0;
4750         int count = 0;
4751         pkgmgrinfo_appinfo_filter_h handle;
4752         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4753         if (ret != PMINFO_R_OK)
4754                 return -1;
4755         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4756         if (ret != PMINFO_R_OK) {
4757                 pkgmgrinfo_appinfo_filter_destroy(handle);
4758                 return -1;
4759         }
4760         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4761         if (ret != PMINFO_R_OK) {
4762                 pkgmgrinfo_appinfo_filter_destroy(handle);
4763                 return -1;
4764         }
4765         printf("No of capp: %d\n", count);
4766         pkgmgrinfo_appinfo_filter_destroy(handle);
4767         return 0;
4768 }
4769  * @endcode
4770  */
4771 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4772 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4773 /**
4774  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4775  * @brief       This API creates the application's metadata  information filter handle from db.
4776  *
4777  * @par         This API is for package-manager client application
4778  * @par Sync (or) Async : Synchronous API
4779  *
4780  * @param[out] handle           pointer to the application metadata info filter handle.
4781  * @return      0 if success, error code(<0) if fail
4782  * @retval      PMINFO_R_OK     success
4783  * @retval      PMINFO_R_EINVAL invalid argument
4784  * @retval      PMINFO_R_ERROR  internal error
4785  * @pre         None
4786  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4787  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4788  * @code
4789 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4790 {
4791         char *appid = NULL;
4792         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4793         printf("appid : %s\n", appid);
4794         return 0;
4795 }
4796
4797 static int get_app_list(const char *mkey, const char *mvalue)
4798 {
4799         int ret = 0;
4800         pkgmgrinfo_appinfo_metadata_filter_h handle;
4801         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4802         if (ret != PMINFO_R_OK)
4803                 return -1;
4804         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4805         if (ret != PMINFO_R_OK) {
4806                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4807                 return -1;
4808         }
4809         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4810         if (ret != PMINFO_R_OK) {
4811                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4812                 return -1;
4813         }
4814         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4815         return 0;
4816 }
4817  * @endcode
4818  */
4819 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4820
4821 /**
4822  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4823  * @brief       This API destroys the application's metadata  information filter handle.
4824  *
4825  * @par         This API is for package-manager client application
4826  * @par Sync (or) Async : Synchronous API
4827  *
4828  * @param[in] handle            pointer to the application metadata info filter handle.
4829  * @return      0 if success, error code(<0) if fail
4830  * @retval      PMINFO_R_OK     success
4831  * @retval      PMINFO_R_EINVAL invalid argument
4832  * @retval      PMINFO_R_ERROR  internal error
4833  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4834  * @post                None
4835  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4836  * @code
4837 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4838 {
4839         char *appid = NULL;
4840         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4841         printf("appid : %s\n", appid);
4842         return 0;
4843 }
4844
4845 static int get_app_list(const char *mkey, const char *mvalue)
4846 {
4847         int ret = 0;
4848         pkgmgrinfo_appinfo_metadata_filter_h handle;
4849         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4850         if (ret != PMINFO_R_OK)
4851                 return -1;
4852         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4853         if (ret != PMINFO_R_OK) {
4854                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4855                 return -1;
4856         }
4857         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4858         if (ret != PMINFO_R_OK) {
4859                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4860                 return -1;
4861         }
4862         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4863         return 0;
4864 }
4865  * @endcode
4866  */
4867 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4868
4869 /**
4870  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4871  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
4872  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4873  *
4874  * @par         This API is for package-manager client application
4875  * @par Sync (or) Async : Synchronous API
4876  *
4877  * @param[in] handle            pointer to the application metadata info filter handle.
4878  * @param[in] key                       pointer to metadata key
4879  * @param[in] value                     pointer to metadata value
4880  * @return      0 if success, error code(<0) if fail
4881  * @retval      PMINFO_R_OK     success
4882  * @retval      PMINFO_R_EINVAL invalid argument
4883  * @retval      PMINFO_R_ERROR  internal error
4884  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4885  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4886  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4887  * @code
4888 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4889 {
4890         char *appid = NULL;
4891         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4892         printf("appid : %s\n", appid);
4893         return 0;
4894 }
4895
4896 static int get_app_list(const char *mkey, const char *mvalue)
4897 {
4898         int ret = 0;
4899         pkgmgrinfo_appinfo_metadata_filter_h handle;
4900         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4901         if (ret != PMINFO_R_OK)
4902                 return -1;
4903         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4904         if (ret != PMINFO_R_OK) {
4905                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4906                 return -1;
4907         }
4908         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4909         if (ret != PMINFO_R_OK) {
4910                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4911                 return -1;
4912         }
4913         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4914         return 0;
4915 }
4916  * @endcode
4917  */
4918 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4919                 const char *key, const char *value);
4920
4921 /**
4922  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4923  * @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)
4924  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
4925  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4926  * negative value, no more callbacks will be called and API will return.
4927  *
4928  * @par         This API is for package-manager client application
4929  * @par Sync (or) Async : Synchronous API
4930  *
4931  * @param[in] handle            pointer to the application metadata info filter handle.
4932  * @param[in] app_cb            function pointer to callback
4933  * @param[in] user_data         pointer to user data
4934  * @param[in]   uid     the addressee user id of the instruction
4935  * @return      0 if success, error code(<0) if fail
4936  * @retval      PMINFO_R_OK     success
4937  * @retval      PMINFO_R_EINVAL invalid argument
4938  * @retval      PMINFO_R_ERROR  internal error
4939  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4940  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4941  * @code
4942 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4943 {
4944         char *appid = NULL;
4945         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4946         printf("appid : %s\n", appid);
4947         return 0;
4948 }
4949
4950 static int get_app_list(const char *mkey, const char *mvalue)
4951 {
4952         int ret = 0;
4953         pkgmgrinfo_appinfo_metadata_filter_h handle;
4954         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4955         if (ret != PMINFO_R_OK)
4956                 return -1;
4957         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4958         if (ret != PMINFO_R_OK) {
4959                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4960                 return -1;
4961         }
4962         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4963         if (ret != PMINFO_R_OK) {
4964                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4965                 return -1;
4966         }
4967         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4968         return 0;
4969 }
4970  * @endcode
4971  */
4972 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4973                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4974 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4975                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4976 /**
4977  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4978  * @brief       This API creates the package cert information handle to get data from db.
4979  *
4980  * @par         This API is for package-manager client application
4981  * @par Sync (or) Async : Synchronous API
4982  *
4983  * @param[out] handle           pointer to the package cert handle.
4984  * @return      0 if success, error code(<0) if fail
4985  * @retval      PMINFO_R_OK     success
4986  * @retval      PMINFO_R_EINVAL invalid argument
4987  * @retval      PMINFO_R_ERROR  internal error
4988  * @pre         None
4989  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
4990  * @see         pkgmgrinfo_pkginfo_get_cert_value()
4991  * @see         pkgmgrinfo_pkginfo_load_certinfo()
4992  * @code
4993 static int get_cert_info(const char *pkgid)
4994 {
4995         int ret = 0;
4996         pkgmgrinfo_certinfo_h handle;
4997         char *auth_cert = NULL;
4998         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4999         if (ret != PMINFO_R_OK)
5000                 return -1;
5001         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5002         if (ret != PMINFO_R_OK) {
5003                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5004                 return -1;
5005         }
5006         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5007         if (ret != PMINFO_R_OK) {
5008                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5009                 return -1;
5010         }
5011         printf("Author root certificate: %s\n", auth_root);
5012         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5013         return 0;
5014 }
5015  * @endcode
5016  */
5017 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5018
5019 /**
5020  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5021  * @brief       This API loads the package cert information handle with data from db.
5022  *
5023  * @par         This API is for package-manager client application
5024  * @par Sync (or) Async : Synchronous API
5025  *
5026  * @param[in] pkgid             pointer to the package ID.
5027  * @param[in] handle            pointer to the package cert handle.
5028  * @return      0 if success, error code(<0) if fail
5029  * @retval      PMINFO_R_OK     success
5030  * @retval      PMINFO_R_EINVAL invalid argument
5031  * @retval      PMINFO_R_ERROR  internal error
5032  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5033  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5034  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5035  * @code
5036 static int get_cert_info(const char *pkgid)
5037 {
5038         int ret = 0;
5039         pkgmgrinfo_certinfo_h handle;
5040         char *auth_cert = NULL;
5041         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5042         if (ret != PMINFO_R_OK)
5043                 return -1;
5044         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5045         if (ret != PMINFO_R_OK) {
5046                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5047                 return -1;
5048         }
5049         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5050         if (ret != PMINFO_R_OK) {
5051                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5052                 return -1;
5053         }
5054         printf("Author root certificate: %s\n", auth_root);
5055         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5056         return 0;
5057 }
5058  * @endcode
5059  */
5060 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5061
5062 /**
5063  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5064  * @brief       This API gets the package cert information from the handle
5065  *
5066  * @par         This API is for package-manager client application
5067  * @par Sync (or) Async : Synchronous API
5068  *
5069  * @param[in] handle            pointer to the package cert handle.
5070  * @param[in] cert_type         certificate type
5071  * @param[out] cert_value       pointer to hold certificate value
5072  * @return      0 if success, error code(<0) if fail
5073  * @retval      PMINFO_R_OK     success
5074  * @retval      PMINFO_R_EINVAL invalid argument
5075  * @retval      PMINFO_R_ERROR  internal error
5076  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5077  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5078  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5079  * @code
5080 static int get_cert_info(const char *pkgid)
5081 {
5082         int ret = 0;
5083         pkgmgrinfo_certinfo_h handle;
5084         char *auth_cert = NULL;
5085         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5086         if (ret != PMINFO_R_OK)
5087                 return -1;
5088         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5089         if (ret != PMINFO_R_OK) {
5090                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5091                 return -1;
5092         }
5093         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5094         if (ret != PMINFO_R_OK) {
5095                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5096                 return -1;
5097         }
5098         printf("Author root certificate: %s\n", auth_root);
5099         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5100         return 0;
5101 }
5102  * @endcode
5103  */
5104 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5105
5106 /**
5107  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5108  * @brief       This API destroys the package cert information handle freeing up all the resources
5109  *
5110  * @par         This API is for package-manager client application
5111  * @par Sync (or) Async : Synchronous API
5112  *
5113  * @param[in] handle            pointer to the package cert handle.
5114  * @return      0 if success, error code(<0) if fail
5115  * @retval      PMINFO_R_OK     success
5116  * @retval      PMINFO_R_EINVAL invalid argument
5117  * @retval      PMINFO_R_ERROR  internal error
5118  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5119  * @post                None
5120  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5121  * @code
5122 static int get_cert_info(const char *pkgid)
5123 {
5124         int ret = 0;
5125         pkgmgrinfo_certinfo_h handle;
5126         char *auth_cert = NULL;
5127         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5128         if (ret != PMINFO_R_OK)
5129                 return -1;
5130         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5131         if (ret != PMINFO_R_OK) {
5132                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5133                 return -1;
5134         }
5135         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5136         if (ret != PMINFO_R_OK) {
5137                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5138                 return -1;
5139         }
5140         printf("Author root certificate: %s\n", auth_root);
5141         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5142         return 0;
5143 }
5144  * @endcode
5145  */
5146 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5147
5148 /**
5149  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5150  * @brief       This API deletes the package cert information from DB
5151  *
5152  * @par         This API is for package-manager client application
5153  * @par Sync (or) Async : Synchronous API
5154  *
5155  * @param[in] pkgid             pointer to the package ID.
5156  * @return      0 if success, error code(<0) if fail
5157  * @retval      PMINFO_R_OK     success
5158  * @retval      PMINFO_R_EINVAL invalid argument
5159  * @retval      PMINFO_R_ERROR  internal error
5160  * @pre         None
5161  * @post                None
5162  * @code
5163 static int delete_cert_info(const char *pkgid)
5164 {
5165         int ret = 0;
5166         ret = pkgmgrinfo_delete_certinfo(pkgid);
5167         if (ret != PMINFO_R_OK)
5168                 return -1;
5169         return 0;
5170 }
5171  * @endcode
5172  */
5173  int pkgmgrinfo_delete_certinfo(const char *pkgid);
5174  int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5175
5176 /**
5177  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5178  * @brief       This API creates the package cert information handle to set data in db.
5179  *
5180  * @par         This API is for package-manager client application
5181  * @par Sync (or) Async : Synchronous API
5182  *
5183  * @param[out] handle           pointer to the package cert handle.
5184  * @return      0 if success, error code(<0) if fail
5185  * @retval      PMINFO_R_OK     success
5186  * @retval      PMINFO_R_EINVAL invalid argument
5187  * @retval      PMINFO_R_ERROR  internal error
5188  * @pre         None
5189  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5190  * @see         pkgmgrinfo_set_cert_value()
5191  * @see         pkgmgrinfo_save_certinfo()
5192  * @code
5193 static int set_cert_in_db(const char *pkgid)
5194 {
5195         int ret = 0;
5196         pkgmgrinfo_instcertinfo_h handle;
5197         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5198         if (ret != PMINFO_R_OK)
5199                 return -1;
5200         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5201         if (ret != PMINFO_R_OK) {
5202                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5203                 return -1;
5204         }
5205         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5206         if (ret != PMINFO_R_OK) {
5207                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5208                 return -1;
5209         }
5210         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5211         return 0;
5212 }
5213  * @endcode
5214  */
5215 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5216
5217 /**
5218  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5219  * @brief       This API sets the package cert information in the handle.
5220  *
5221  * @par         This API is for package-manager client application
5222  * @par Sync (or) Async : Synchronous API
5223  *
5224  * @param[in] handle            pointer to the package cert handle.
5225  * @param[in] cert_type         certificate type.
5226  * @param[in] cert_value        certificate value.
5227  * @return      0 if success, error code(<0) if fail
5228  * @retval      PMINFO_R_OK     success
5229  * @retval      PMINFO_R_EINVAL invalid argument
5230  * @retval      PMINFO_R_ERROR  internal error
5231  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5232  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5233  * @see         pkgmgrinfo_save_certinfo()
5234  * @code
5235 static int set_cert_in_db(const char *pkgid)
5236 {
5237         int ret = 0;
5238         pkgmgrinfo_instcertinfo_h handle;
5239         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5240         if (ret != PMINFO_R_OK)
5241                 return -1;
5242         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5243         if (ret != PMINFO_R_OK) {
5244                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5245                 return -1;
5246         }
5247         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5248         if (ret != PMINFO_R_OK) {
5249                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5250                 return -1;
5251         }
5252         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5253         return 0;
5254 }
5255  * @endcode
5256  */
5257 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5258
5259 /**
5260  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5261  * @brief       This API saves the package cert information in the DB.
5262  *
5263  * @par         This API is for package-manager client application
5264  * @par Sync (or) Async : Synchronous API
5265  *
5266  * @param[in] pkgid             pointer to the package ID.
5267  * @param[in] handle            pointer to the package cert handle.
5268  * @return      0 if success, error code(<0) if fail
5269  * @retval      PMINFO_R_OK     success
5270  * @retval      PMINFO_R_EINVAL invalid argument
5271  * @retval      PMINFO_R_ERROR  internal error
5272  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5273  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5274  * @see         pkgmgrinfo_save_certinfo()
5275  * @code
5276 static int set_cert_in_db(const char *pkgid)
5277 {
5278         int ret = 0;
5279         pkgmgrinfo_instcertinfo_h handle;
5280         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5281         if (ret != PMINFO_R_OK)
5282                 return -1;
5283         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5284         if (ret != PMINFO_R_OK) {
5285                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5286                 return -1;
5287         }
5288         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5289         if (ret != PMINFO_R_OK) {
5290                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5291                 return -1;
5292         }
5293         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5294         return 0;
5295 }
5296  * @endcode
5297  */
5298 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5299
5300 /**
5301  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5302  * @brief       This API destroys the package cert information handle freeing up all the resources.
5303  *
5304  * @par         This API is for package-manager client application
5305  * @par Sync (or) Async : Synchronous API
5306  *
5307  * @param[in] handle            pointer to the package cert handle.
5308  * @return      0 if success, error code(<0) if fail
5309  * @retval      PMINFO_R_OK     success
5310  * @retval      PMINFO_R_EINVAL invalid argument
5311  * @retval      PMINFO_R_ERROR  internal error
5312  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5313  * @post                None
5314  * @see         pkgmgrinfo_save_certinfo()
5315  * @code
5316 static int set_cert_in_db(const char *pkgid)
5317 {
5318         int ret = 0;
5319         pkgmgrinfo_instcertinfo_h handle;
5320         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5321         if (ret != PMINFO_R_OK)
5322                 return -1;
5323         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5324         if (ret != PMINFO_R_OK) {
5325                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5326                 return -1;
5327         }
5328         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5329         if (ret != PMINFO_R_OK) {
5330                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5331                 return -1;
5332         }
5333         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5334         return 0;
5335 }
5336  * @endcode
5337  */
5338 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5339
5340 /**
5341  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5342  * @brief       This API gets the datacontrol info
5343  *
5344  * @par         This API is for package-manager client application
5345  * @par Sync (or) Async : Synchronous API
5346  *
5347  * @param[in] providerid                pointer to the providerid of dataconltrol.
5348  * @param[in] type                      pointer to the type of dataconltrol.
5349  * @param[out] appid                    pointer to hold appid, need to free after using
5350  * @param[out] access                   pointer to hold access, need to free after using
5351  * @return      0 if success, error code(<0) if fail
5352  * @retval      PMINFO_R_OK     success
5353  * @retval      PMINFO_R_EINVAL invalid argument
5354  * @retval      PMINFO_R_ERROR  internal error
5355  * @endcode
5356  */
5357 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5358
5359 /**
5360  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5361  * @brief       This API gets the application 'guest mode visibility' value from the DB
5362  *
5363  * @par         This API is for package-manager client application
5364  * @par Sync (or) Async : Synchronous API
5365  *
5366  * @param[in]   handle  pointer to application info handle
5367  * @param[out] status           pointer to hold app guest mode visibility value
5368  * @return      0 if success, error code(<0) if fail
5369  * @retval      PMINFO_R_OK     success
5370  * @retval      PMINFO_R_EINVAL invalid argument
5371  * @retval      PMINFO_R_ERROR  internal error
5372  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5373  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5374  * @see         pkgmgrinfo_appinfo_get_appid()
5375  * @see         pkgmgrinfo_appinfo_is_multiple()
5376  * @code
5377 static int get_app_guestmode_visibility(const char *appid)
5378 {
5379         int ret = 0;
5380         bool status;
5381         pkgmgrinfo_appinfo_h handle;
5382         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5383         if (ret != PMINFO_R_OK)
5384                 return -1;
5385         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5386         if (ret != PMINFO_R_OK) {
5387                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5388                 return -1;
5389         }
5390         printf("app guest mode visibility: %d\n", status);
5391         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5392         return 0;
5393 }
5394  * @endcode
5395  */
5396  int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5397
5398 /**
5399  * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5400  * @brief       This API sets the application 'guest mode visibility' value in the DB
5401  *
5402  * @par         This API is for package-manager client application
5403  * @par Sync (or) Async : Synchronous API
5404  *
5405  * @param[in]   handle  pointer to application info handle
5406  * @param[out] status   app guest mode visibility value
5407  * @return      0 if success, error code(<0) if fail
5408  * @retval      PMINFO_R_OK     success
5409  * @retval      PMINFO_R_EINVAL invalid argument
5410  * @retval      PMINFO_R_ERROR  internal error
5411  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5412  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5413  * @see         pkgmgrinfo_appinfo_get_appid()
5414  * @see         pkgmgrinfo_appinfo_is_multiple()
5415  * @code
5416 static int set_app_guestmode_visibility(const char *appid, bool value)
5417 {
5418         int ret = 0;
5419         pkgmgrinfo_appinfo_h handle;
5420         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5421         if (ret != PMINFO_R_OK)
5422                 return -1;
5423         ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5424         if (ret != PMINFO_R_OK) {
5425                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5426                 return -1;
5427         }
5428         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5429         return 0;
5430 }
5431  * @endcode
5432  */
5433  int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5434  int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5435
5436 /**
5437 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5438 * @brief         This API sets the package 'installed_storage' value in db
5439 *
5440 * @par   This API is for package-manager client application
5441 * @par Sync (or) Async : Synchronous API
5442 *
5443 * @param[in] pkgid       pointer to the package ID.
5444 * @param[in] location  package install location
5445 * @return  0 if success, error code(<0) if fail
5446 * @retval  PMINFO_R_OK success
5447 * @retval  PMINFO_R_EINVAL       invalid argument
5448 * @retval  PMINFO_R_ERROR internal error
5449 * @code
5450 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5451 {
5452         int ret = 0;
5453
5454         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5455         if (ret != PMINFO_R_OK) {
5456                 return -1;
5457         }
5458         return 0;
5459 }
5460 * @endcode
5461 */
5462  int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5463  int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5464
5465 /**
5466  * @pkgmgrinfo client API
5467 **/
5468
5469 /**
5470  * @brief listening status type in pkgmgrinfo.
5471  */
5472 #define PMINFO_CLIENT_STATUS_ALL                                                0x00
5473 #define PMINFO_CLIENT_STATUS_INSTALL                                    0x01
5474 #define PMINFO_CLIENT_STATUS_UNINSTALL                                  0x02
5475 #define PMINFO_CLIENT_STATUS_UPGRADE                                    0x04
5476 #define PMINFO_CLIENT_STATUS_MOVE                                               0x08
5477 #define PMINFO_CLIENT_STATUS_CLEAR_DATA                                 0x10
5478 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS                   0x20
5479
5480 /**
5481  * @brief       This APIs provides pkgmgrinfo client listener
5482  */
5483 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5484 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5485 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5486 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5487 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5488
5489
5490 /**
5491  * @pkgmgrinfo client API end
5492 **/
5493
5494
5495 /** @} */
5496 #ifdef __cplusplus
5497 }
5498 #endif
5499 #endif                          /* __PKG_INFO_H__ */
5500 /**
5501  * @}
5502  * @}
5503  */
5504