add pkgmgrinfo_appinfo_get_metadata_value API
[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_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2576  * @brief       This API gets metadata value by given metadata key
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[in]   metadata_key    metadata key
2583  * @param[out] metadata_value           pointer to hold metadata value
2584  * @return      0 if success, error code(<0) if fail
2585  * @retval      PMINFO_R_OK     success
2586  * @retval      PMINFO_R_EINVAL invalid argument
2587  * @code
2588 static int get_metadata_value(const char *appid, const char *metadata_key)
2589 {
2590         int ret = 0;
2591         pkgmgrinfo_appinfo_h handle = NULL;
2592         char *metadata_value = NULL;
2593
2594         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2595         if (ret != PMINFO_R_OK)
2596                 return -1;
2597
2598         ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2599         if (ret != PMINFO_R_OK) {
2600                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2601                 return -1;
2602         }
2603
2604         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605         return 0;
2606 }
2607  * @endcode
2608  */
2609 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2610
2611 /**
2612  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2613  * @brief       This API gets the component of the application
2614  *
2615  * @par         This API is for package-manager client application
2616  * @par Sync (or) Async : Synchronous API
2617  *
2618  * @param[in] handle            pointer to the application info handle.
2619  * @param[out] component                pointer to hold app component
2620  * @return      0 if success, error code(<0) if fail
2621  * @retval      PMINFO_R_OK     success
2622  * @retval      PMINFO_R_EINVAL invalid argument
2623  * @retval      PMINFO_R_ERROR  internal error
2624  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2625  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2626  * @see         pkgmgrinfo_appinfo_get_appid()
2627  * @see         pkgmgrinfo_appinfo_is_multiple()
2628  * @code
2629 static int get_app_component(const char *appid)
2630 {
2631         int ret = 0;
2632         pkgmgrinfo_app_component component;
2633         pkgmgrinfo_appinfo_h handle;
2634         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2635         if (ret != PMINFO_R_OK)
2636                 return -1;
2637         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2638         if (ret != PMINFO_R_OK) {
2639                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2640                 return -1;
2641         }
2642         printf("component : %s\n", component);
2643         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2644         return 0;
2645 }
2646  * @endcode
2647  */
2648 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
2649
2650 /**
2651  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2652  * @brief       This API gets the apptype of the application
2653  *
2654  * @par         This API is for package-manager client application
2655  * @par Sync (or) Async : Synchronous API
2656  *
2657  * @param[in] handle            pointer to the application info handle.
2658  * @param[out] app_type         pointer to hold apptype
2659  * @return      0 if success, error code(<0) if fail
2660  * @retval      PMINFO_R_OK     success
2661  * @retval      PMINFO_R_EINVAL invalid argument
2662  * @retval      PMINFO_R_ERROR  internal error
2663  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2664  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2665  * @see         pkgmgrinfo_appinfo_get_appid()
2666  * @see         pkgmgrinfo_appinfo_is_multiple()
2667  * @code
2668 static int get_app_type(const char *appid)
2669 {
2670         int ret = 0;
2671         char *apptype = NULL;
2672         pkgmgrinfo_appinfo_h handle;
2673         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2674         if (ret != PMINFO_R_OK)
2675                 return -1;
2676         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2677         if (ret != PMINFO_R_OK) {
2678                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2679                 return -1;
2680         }
2681         printf("apptype : %s\n", apptype);
2682         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2683         return 0;
2684 }
2685  * @endcode
2686  */
2687 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
2688
2689 /**
2690  * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2691                                                                                 int *operation_count, char ***operation)
2692  * @brief       This API gets the list of operation of the application
2693  *
2694  * @par         This API is for package-manager client application
2695  * @par Sync (or) Async : Synchronous API
2696  *
2697  * @param[in] handle            pointer to the appcontrol handle.
2698  * @param[out] operation_count          pointer to hold number of operations
2699  * @param[out] operation                pointer to hold list of operations
2700  * @return      0 if success, error code(<0) if fail
2701  * @retval      PMINFO_R_OK     success
2702  * @retval      PMINFO_R_EINVAL invalid argument
2703  * @retval      PMINFO_R_ERROR  internal error
2704  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2705  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2706  * @see         pkgmgrinfo_appinfo_get_uri()
2707  * @see         pkgmgrinfo_appinfo_get_mime()
2708  * @code
2709 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2710 {
2711         int oc = 0;
2712         int i = 0;
2713         char **operation;
2714         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2715         for (i = 0; i < oc; i++) {
2716                 if (strcmp(operation[i], (char *)user_data) == 0)
2717                         return -1;
2718                 else
2719                         return 0;
2720         }
2721 }
2722
2723 static int check_operation(const char *appid, char *operation)
2724 {
2725         int ret = 0;
2726         pkgmgrinfo_appinfo_h handle;
2727         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2728         if (ret != PMINFO_R_OK)
2729                 return -1;
2730         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2731         if (ret != PMINFO_R_OK) {
2732                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2733                 return -1;
2734         }
2735         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2736         return 0;
2737 }
2738  * @endcode
2739  */
2740 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h  handle,
2741                                                                                 int *operation_count, char ***operation);
2742
2743 /**
2744  * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2745                                                                                 int *uri_count, char ***uri)
2746  * @brief       This API gets the list of uri of the application
2747  *
2748  * @par         This API is for package-manager client application
2749  * @par Sync (or) Async : Synchronous API
2750  *
2751  * @param[in] handle            pointer to the appcontrol handle.
2752  * @param[out] uri_count                pointer to hold number of uris
2753  * @param[out] uri              pointer to hold list of uris
2754  * @return      0 if success, error code(<0) if fail
2755  * @retval      PMINFO_R_OK     success
2756  * @retval      PMINFO_R_EINVAL invalid argument
2757  * @retval      PMINFO_R_ERROR  internal error
2758  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2759  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2760  * @see         pkgmgrinfo_appinfo_get_operation()
2761  * @see         pkgmgrinfo_appinfo_get_mime()
2762  * @code
2763 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2764 {
2765         int uc = 0;
2766         int i = 0;
2767         char **uri;
2768         pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2769         for (i = 0; i < uc; i++) {
2770                 if (strcmp(uri[i], (char *)user_data) == 0)
2771                         return -1;
2772                 else
2773                         return 0;
2774         }
2775 }
2776
2777 static int check_uri(const char *appid, char *uri)
2778 {
2779         int ret = 0;
2780         pkgmgrinfo_appinfo_h handle;
2781         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2782         if (ret != PMINFO_R_OK)
2783                 return -1;
2784         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2785         if (ret != PMINFO_R_OK) {
2786                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2787                 return -1;
2788         }
2789         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2790         return 0;
2791 }
2792  * @endcode
2793  */
2794 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h  handle,
2795                                                                                 int *uri_count, char ***uri);
2796
2797 /**
2798  * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2799                                                                                 int *mime_count, char ***mime)
2800  * @brief       This API gets the list of mime of the application
2801  *
2802  * @par         This API is for package-manager client application
2803  * @par Sync (or) Async : Synchronous API
2804  *
2805  * @param[in] handle            pointer to the appcontrol handle.
2806  * @param[out] mime_count               pointer to hold number of mimes
2807  * @param[out] mime             pointer to hold list of mimes
2808  * @return      0 if success, error code(<0) if fail
2809  * @retval      PMINFO_R_OK     success
2810  * @retval      PMINFO_R_EINVAL invalid argument
2811  * @retval      PMINFO_R_ERROR  internal error
2812  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2813  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2814  * @see         pkgmgrinfo_appinfo_get_uri()
2815  * @see         pkgmgrinfo_appinfo_get_operation()
2816  * @code
2817 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2818 {
2819         int mc = 0;
2820         int i = 0;
2821         char **mime;
2822         pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2823         for (i = 0; i < mc; i++) {
2824                 if (strcmp(mime[i], (char *)user_data) == 0)
2825                         return -1;
2826                 else
2827                         return 0;
2828         }
2829 }
2830
2831 static int check_mime(const char *appid, char *mime)
2832 {
2833         int ret = 0;
2834         pkgmgrinfo_appinfo_h handle;
2835         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2836         if (ret != PMINFO_R_OK)
2837                 return -1;
2838         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2839         if (ret != PMINFO_R_OK) {
2840                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2841                 return -1;
2842         }
2843         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2844         return 0;
2845 }
2846  * @endcode
2847  */
2848 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h  handle,
2849                                                                                 int *mime_count, char ***mime);
2850
2851 /**
2852  * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2853                                                                                 int *subapp_count, char ***subapp)
2854  * @brief       This API gets the list of subapp of the application
2855  *
2856  * @par         This API is for package-manager client application
2857  * @par Sync (or) Async : Synchronous API
2858  *
2859  * @param[in] handle            pointer to the appcontrol handle.
2860  * @param[out] subapp_count             pointer to hold number of subapp
2861  * @param[out] subapp           pointer to hold list of subapp
2862  * @return      0 if success, error code(<0) if fail
2863  * @retval      PMINFO_R_OK     success
2864  * @retval      PMINFO_R_EINVAL invalid argument
2865  * @retval      PMINFO_R_ERROR  internal error
2866  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2867  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2868  * @see         pkgmgrinfo_appinfo_get_uri()
2869  * @see         pkgmgrinfo_appinfo_get_operation()
2870  * @code
2871 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2872 {
2873         int sc = 0;
2874         int i = 0;
2875         char **subapp = NULL;
2876         pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2877         for (i = 0; i < sc; i++) {
2878                 if (strcmp(subapp[i], (char *)user_data) == 0)
2879                         return -1;
2880                 else
2881                         return 0;
2882         }
2883 }
2884
2885 static int check_subapp(const char *appid, char *subapp)
2886 {
2887         int ret = 0;
2888         pkgmgrinfo_appinfo_h handle = NULL;
2889         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2890         if (ret != PMINFO_R_OK)
2891                 return -1;
2892         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2893         if (ret != PMINFO_R_OK) {
2894                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2895                 return -1;
2896         }
2897         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2898         return 0;
2899 }
2900  * @endcode
2901  */
2902 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h  handle,
2903                                                 int *subapp_count, char ***subapp);
2904
2905 /**
2906  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2907  * @brief       This API gets the notification icon of the application
2908  *
2909  * @par         This API is for package-manager client application
2910  * @par Sync (or) Async : Synchronous API
2911  *
2912  * @param[in] handle            pointer to the application info handle.
2913  * @param[out] path             pointer to hold notification icon
2914  * @return      0 if success, error code(<0) if fail
2915  * @retval      PMINFO_R_OK     success
2916  * @retval      PMINFO_R_EINVAL invalid argument
2917  * @retval      PMINFO_R_ERROR  internal error
2918  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2919  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2920  * @see         pkgmgrinfo_appinfo_get_appid()
2921  * @see         pkgmgrinfo_appinfo_is_multiple()
2922  * @code
2923 static int get_app_notification_icon(const char *appid)
2924 {
2925         int ret = 0;
2926         char *notification_icon = NULL;
2927         pkgmgrinfo_appinfo_h handle;
2928         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2929         if (ret != PMINFO_R_OK)
2930                 return -1;
2931         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
2932         if (ret != PMINFO_R_OK) {
2933                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2934                 return -1;
2935         }
2936         printf("notification icon : %s\n", notification_icon);
2937         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2938         return 0;
2939 }
2940  * @endcode
2941  */
2942 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2943
2944 /**
2945  * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2946  * @brief       This API gets the setting icon of the application
2947  *
2948  * @par         This API is for package-manager client application
2949  * @par Sync (or) Async : Synchronous API
2950  *
2951  * @param[in] handle            pointer to the application info handle.
2952  * @param[out] path             pointer to hold setting icon
2953  * @return      0 if success, error code(<0) if fail
2954  * @retval      PMINFO_R_OK     success
2955  * @retval      PMINFO_R_EINVAL invalid argument
2956  * @retval      PMINFO_R_ERROR  internal error
2957  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2958  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2959  * @see         pkgmgrinfo_appinfo_get_appid()
2960  * @see         pkgmgrinfo_appinfo_is_multiple()
2961  * @code
2962 static int get_app_setting_icon(const char *appid)
2963 {
2964         int ret = 0;
2965         char *setting_icon = NULL;
2966         pkgmgrinfo_appinfo_h handle;
2967         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2968         if (ret != PMINFO_R_OK)
2969                 return -1;
2970         ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2971         if (ret != PMINFO_R_OK) {
2972                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973                 return -1;
2974         }
2975         printf("setting icon : %s\n", setting_icon);
2976         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2977         return 0;
2978 }
2979  * @endcode
2980  */
2981 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
2982
2983 /**
2984  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2985  * @brief       This API gets the type of recent image on app-tray
2986  *
2987  * @par         This API is for package-manager client application
2988  * @par Sync (or) Async : Synchronous API
2989  *
2990  * @param[in] handle            pointer to the application info handle.
2991  * @param[out] type             pointer to hold image type
2992  * @return      0 if success, error code(<0) if fail
2993  * @retval      PMINFO_R_OK     success
2994  * @retval      PMINFO_R_EINVAL invalid argument
2995  * @retval      PMINFO_R_ERROR  internal error
2996  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2997  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2998  * @see         pkgmgrinfo_appinfo_get_appid()
2999  * @see         pkgmgrinfo_appinfo_is_multiple()
3000  * @code
3001 static int get_app_recent_image_type(const char *appid)
3002 {
3003         int ret = 0;
3004         pkgmgrinfo_app_recentimage type;
3005         pkgmgrinfo_appinfo_h handle;
3006         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3007         if (ret != PMINFO_R_OK)
3008                 return -1;
3009         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3010         if (ret != PMINFO_R_OK) {
3011                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012                 return -1;
3013         }
3014         printf("recent image type: %d\n", type);
3015         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3016         return 0;
3017 }
3018  * @endcode
3019  */
3020 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
3021
3022
3023 /**
3024  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
3025  * @brief       This API gets the preview image of application
3026  *
3027  * @par Sync (or) Async : Synchronous API
3028  *
3029  * @param[in] handle            pointer to the application info handle.
3030  * @param[out] preview_img              pointer to hold preview image path
3031  * @return      0 if success, error code(<0) if fail
3032  * @retval      PMINFO_R_OK     success
3033  * @retval      PMINFO_R_EINVAL invalid argument
3034  * @retval      PMINFO_R_ERROR  internal error
3035  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3036  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3037  * @see         pkgmgrinfo_appinfo_get_appid()
3038  * @code
3039 static int get_app_previewimage(const char *appid)
3040 {
3041         int ret = 0;
3042         char *preview = NULL;
3043         pkgmgrinfo_appinfo_h handle = NULL;
3044         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3045         if (ret != PMINFO_R_OK)
3046                 return -1;
3047         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3048         if (ret != PMINFO_R_OK) {
3049                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3050                 return -1;
3051         }
3052         printf("preview image path : %s\n", preview);
3053         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3054         return 0;
3055 }
3056  * @endcode
3057  */
3058 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3059
3060
3061 /**
3062  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3063  * @brief       This API gets the package permission type of the application
3064  *
3065  * @par         This API is for package-manager client application
3066  * @par Sync (or) Async : Synchronous API
3067  *
3068  * @param[in] handle            pointer to the application info handle.
3069  * @param[out] permission               pointer to hold package permission
3070  * @return      0 if success, error code(<0) if fail
3071  * @retval      PMINFO_R_OK     success
3072  * @retval      PMINFO_R_EINVAL invalid argument
3073  * @retval      PMINFO_R_ERROR  internal error
3074  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3075  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3076  * @see         pkgmgrinfo_appinfo_get_appid()
3077  * @code
3078 static int get_app_permission(const char *appid)
3079 {
3080         int ret = 0;
3081         pkgmgrinfo_permission_type permission = 0;
3082         pkgmgrinfo_appinfo_h handle;
3083
3084         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3085         if (ret != PMINFO_R_OK)
3086                 return -1;
3087         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3088         if (ret != PMINFO_R_OK) {
3089                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3090                 return -1;
3091         }
3092         printf("permission type: %d\n", permission);
3093         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3094         return 0;
3095 }
3096  * @endcode
3097  */
3098 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3099
3100 /**
3101  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3102  * @brief       This API gets the component_type
3103  *
3104  * @par         This API is for package-manager client application
3105  * @par Sync (or) Async : Synchronous API
3106  *
3107  * @param[in] handle            pointer to the application info handle.
3108  * @param[out] component_type           pointer to hold component_type
3109  * @return      0 if success, error code(<0) if fail
3110  * @retval      PMINFO_R_OK     success
3111  * @retval      PMINFO_R_EINVAL invalid argument
3112  * @retval      PMINFO_R_ERROR  internal error
3113  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3114  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3115  * @see         pkgmgrinfo_appinfo_get_pkgid()
3116  * @see         pkgmgrinfo_appinfo_is_multiple()
3117  * @code
3118 static int get_component_type(const char *appid)
3119 {
3120         int ret = 0;
3121         char *component_type = NULL;
3122         pkgmgrinfo_appinfo_h handle;
3123         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3124         if (ret != PMINFO_R_OK)
3125                 return -1;
3126         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3127         if (ret != PMINFO_R_OK) {
3128                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3129                 return -1;
3130         }
3131         printf("component_type: %s\n", component_type);
3132         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3133         return 0;
3134 }
3135  * @endcode
3136  */
3137 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3138
3139 /**
3140  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3141  * @brief       This API gets the application 'hwacceleration' value from the app ID
3142  *
3143  * @par         This API is for package-manager client application
3144  * @par Sync (or) Async : Synchronous API
3145  *
3146  * @param[in]   handle  pointer to application info handle
3147  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3148  * @return      0 if success, error code(<0) if fail
3149  * @retval      PMINFO_R_OK     success
3150  * @retval      PMINFO_R_EINVAL invalid argument
3151  * @retval      PMINFO_R_ERROR  internal error
3152  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3153  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3154  * @see         pkgmgrinfo_appinfo_get_appid()
3155  * @see         pkgmgrinfo_appinfo_is_multiple()
3156  * @code
3157 static int get_app_hwacceleration(const char *appid)
3158 {
3159         int ret = 0;
3160         pkgmgrinfo_app_hwacceleration hwacceleration;
3161         pkgmgrinfo_appinfo_h handle;
3162         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3163         if (ret != PMINFO_R_OK)
3164                 return -1;
3165         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3166         if (ret != PMINFO_R_OK) {
3167                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3168                 return -1;
3169         }
3170         printf("app hwacceleration: %d\n", hwacceleration);
3171         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3172         return 0;
3173 }
3174  * @endcode
3175  */
3176 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3177
3178 /**
3179  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3180  * @brief       This API gets the application 'screenreader' value from the app ID
3181  *
3182  * @par         This API is for package-manager client application
3183  * @par Sync (or) Async : Synchronous API
3184  *
3185  * @param[in]   handle  pointer to application info handle
3186  * @param[out] screenreader             pointer to hold package accessibility value
3187  * @return      0 if success, error code(<0) if fail
3188  * @retval      PMINFO_R_OK     success
3189  * @retval      PMINFO_R_EINVAL invalid argument
3190  * @retval      PMINFO_R_ERROR  internal error
3191  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3192  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3193  * @see         pkgmgrinfo_appinfo_get_appid()
3194  * @see         pkgmgrinfo_appinfo_is_multiple()
3195  * @code
3196 static int get_app_screenreader(const char *appid)
3197 {
3198         int ret = 0;
3199         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3200         pkgmgrinfo_appinfo_h handle = NULL;
3201         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3202         if (ret != PMINFO_R_OK)
3203                 return -1;
3204         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3205         if (ret != PMINFO_R_OK) {
3206                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3207                 return -1;
3208         }
3209         printf("app screenreader: %d\n", screenreader);
3210         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3211         return 0;
3212 }
3213  * @endcode
3214  */
3215 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3216
3217 /**
3218  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3219  * @brief       This API gets the application's landscape & portrait effect images
3220  *
3221  * @par         This API is for package-manager client application
3222  * @par Sync (or) Async : Synchronous API
3223  *
3224  * @param[in]   handle  pointer to application info handle
3225  * @param[out]  portrait_img contains portrait mode effect image
3226  * @param[out]  landscape_img contains landscape mode effect image
3227  * @return      0 if success, error code(<0) if fail
3228  * @retval      PMINFO_R_OK     success
3229  * @retval      PMINFO_R_EINVAL invalid argument
3230  * @retval      PMINFO_R_ERROR  internal error
3231  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3232  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3233  * @see         pkgmgrinfo_appinfo_get_appid()
3234  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3235  * @code
3236 static int get_app_effectimages(const char *appid)
3237 {
3238         int ret = 0;
3239         char *portraitimg = NULL;
3240         char *landscapeimg = NULL;
3241         pkgmgrinfo_appinfo_h handle;
3242         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3243         if (ret != PMINFO_R_OK)
3244                 return -1;
3245         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3246         if (ret != PMINFO_R_OK) {
3247                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3248                 return -1;
3249         }
3250         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3251         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3252         return 0;
3253 }
3254  * @endcode
3255  */
3256 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3257
3258 /**
3259  * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h  handle, char **effectimg_type)
3260  * @brief       This API gets the application's effect image type
3261  *
3262  * @par         This API is for package-manager client application
3263  * @par Sync (or) Async : Synchronous API
3264  *
3265  * @param[in]   handle  pointer to application info handle
3266  * @param[out]  effectimg_type contains effect image type
3267  * @return      0 if success, error code(<0) if fail
3268  * @retval      PMINFO_R_OK     success
3269  * @retval      PMINFO_R_EINVAL invalid argument
3270  * @retval      PMINFO_R_ERROR  internal error
3271  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3272  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3273  * @see         pkgmgrinfo_appinfo_get_appid()
3274  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3275  * @code
3276 static int get_app_effectimage_type(const char *appid)
3277 {
3278         int ret = 0;
3279         char *effectimg_type = NULL;
3280         pkgmgrinfo_appinfo_h handle = NULL;
3281         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3282         if (ret != PMINFO_R_OK)
3283                 return -1;
3284         ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3285         if (ret != PMINFO_R_OK) {
3286                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3287                 return -1;
3288         }
3289         printf("app effect image type: %s\n", effectimg_type);
3290         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3291         return 0;
3292 }
3293  * @endcode
3294  */
3295 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3296
3297 /**
3298  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3299  * @brief       This API gets the submode_mainid of the application
3300  *
3301  * @par         This API is for package-manager client application
3302  * @par Sync (or) Async : Synchronous API
3303  *
3304  * @param[in] handle            pointer to the application info handle.
3305  * @param[out] submode_mainid           pointer to hold package name
3306  * @return      0 if success, error code(<0) if fail
3307  * @retval      PMINFO_R_OK     success
3308  * @retval      PMINFO_R_EINVAL invalid argument
3309  * @retval      PMINFO_R_ERROR  internal error
3310  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3311  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3312  * @see         pkgmgrinfo_appinfo_get_appid()
3313  * @see         pkgmgrinfo_appinfo_is_multiple()
3314  * @code
3315 static int get_app_submode_mainid(const char *appid)
3316 {
3317         int ret = 0;
3318         char *submode_mainid = NULL;
3319         pkgmgrinfo_appinfo_h handle = NULL;
3320         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3321         if (ret != PMINFO_R_OK)
3322                 return -1;
3323         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3324         if (ret != PMINFO_R_OK) {
3325                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3326                 return -1;
3327         }
3328         printf("submode_mainid: %s\n", submode_mainid);
3329         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3330         return 0;
3331 }
3332  * @endcode
3333  */
3334 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3335
3336 /**
3337  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3338  * @brief       This API gets the datacontrol info
3339  *
3340  * @par         This API is for package-manager client application
3341  * @par Sync (or) Async : Synchronous API
3342  *
3343  * @param[in] providerid                pointer to the providerid of dataconltrol.
3344  * @param[in] type                      pointer to the type of dataconltrol.
3345  * @param[out] appid                    pointer to hold appid, need to free after using
3346  * @param[out] access                   pointer to hold access, need to free after using
3347  * @return      0 if success, error code(<0) if fail
3348  * @retval      PMINFO_R_OK     success
3349  * @retval      PMINFO_R_EINVAL invalid argument
3350  * @retval      PMINFO_R_ERROR  internal error
3351  * @endcode
3352  */
3353 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3354 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3355
3356 /**
3357  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3358  * @brief       This API gets the appid of datacontrol
3359  *
3360  * @par         This API is for package-manager client application
3361  * @par Sync (or) Async : Synchronous API
3362  *
3363  * @param[in] providerid                pointer to the providerid of dataconltrol.
3364  * @param[out] appid                    pointer to hold appid, need to free after using
3365  * @return      0 if success, error code(<0) if fail
3366  * @retval      PMINFO_R_OK     success
3367  * @retval      PMINFO_R_EINVAL invalid argument
3368  * @retval      PMINFO_R_ERROR  internal error
3369  * @endcode
3370  */
3371 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3372 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3373
3374 /**
3375  * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h  handle, char **alias_appid)
3376  * @brief       This API gets the alias_appid of the application
3377  *
3378  * @par         This API is for package-manager client application
3379  * @par Sync (or) Async : Synchronous API
3380  *
3381  * @param[in] handle            pointer to the application info handle.
3382  * @param[out] alias_appid              pointer to hold app alias_appid
3383  * @return      0 if success, error code(<0) if fail
3384  * @retval      PMINFO_R_OK     success
3385  * @retval      PMINFO_R_EINVAL invalid argument
3386  * @retval      PMINFO_R_ERROR  internal error
3387  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3388  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3389  * @see         pkgmgrinfo_appinfo_get_appid()
3390  * @code
3391 static int get_alias_appid(const char *appid)
3392 {
3393         int ret = 0;
3394         char *alias_appid= 0;
3395         pkgmgrinfo_appinfo_h handle = NULL;
3396         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3397         if (ret != PMINFO_R_OK)
3398                 return -1;
3399         ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3400         if (ret != PMINFO_R_OK) {
3401                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3402                 return -1;
3403         }
3404         printf("alias_appid: %s\n", alias_appid);
3405         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3406         return 0;
3407 }
3408  * @endcode
3409  */
3410 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3411
3412 /**
3413  * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h  handle, char **effective_appid)
3414  * @brief       This API gets the effective_appid of the application
3415  *
3416  * @par         This API is for package-manager client application
3417  * @par Sync (or) Async : Synchronous API
3418  *
3419  * @param[in] handle            pointer to the application info handle.
3420  * @param[out] effective_appid          pointer to hold app effective_appid
3421  * @return      0 if success, error code(<0) if fail
3422  * @retval      PMINFO_R_OK     success
3423  * @retval      PMINFO_R_EINVAL invalid argument
3424  * @retval      PMINFO_R_ERROR  internal error
3425  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3426  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3427  * @see         pkgmgrinfo_appinfo_get_appid()
3428  * @code
3429 static int get_effective_appid(const char *appid)
3430 {
3431         int ret = 0;
3432         char *effective_appid= 0;
3433         pkgmgrinfo_appinfo_h handle = NULL;
3434         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3435         if (ret != PMINFO_R_OK)
3436                 return -1;
3437         ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3438         if (ret != PMINFO_R_OK) {
3439                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3440                 return -1;
3441         }
3442         printf("effective_appid: %s\n", effective_appid);
3443         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3444         return 0;
3445 }
3446  * @endcode
3447  */
3448 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3449
3450 /**
3451  * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3452  * @brief       This API gets tep(tizen expansion package) file name associated with the package which contain given application
3453  *
3454  * @par This API is for package-manager client application
3455  * @par Sync (or) Async : Synchronous API
3456  *
3457  * @param[in] handle            pointer to the appinfo handle.
3458  * @param[out] tep_name         pointer to hold tep name
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  * @pre pkgmgrinfo_appinfo_get_appinfo()
3464  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3465  * @see pkgmgrinfo_appinfo_get_appid()
3466  * @code
3467 static int get_tep_name(const char *appid)
3468 {
3469         int ret = 0;
3470         char *tep_name = NULL;
3471         pkgmgrinfo_appinfo_h handle = NULL;
3472         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3473         if (ret != PMINFO_R_OK)
3474                 return -1;
3475         ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3476         if (ret != PMINFO_R_OK) {
3477                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3478                 return -1;
3479         }
3480         printf("TEP name is: %s\n", tep_name);
3481         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3482         return 0;
3483 }
3484  * @endcode
3485  */
3486 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3487
3488 /**
3489  * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3490  * @brief       This API gets the root path of application
3491  *
3492  * @par Sync (or) Async : Synchronous API
3493  *
3494  * @param[in] handle            pointer to appinfo handle
3495  * @param[out] path             pointer to hold root path of application
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  * @code
3501 static int get_root_path(const char *appid)
3502 {
3503         int ret = 0;
3504         char *path = 0;
3505         pkgmgrinfo_appinfo_h handle;
3506         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3507         if (ret != PMINFO_R_OK)
3508                 return -1;
3509
3510         ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3511         if (ret != PMINFO_R_OK) {
3512                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3513                 return -1;
3514         }
3515         printf("path : %s\n", path);
3516         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3517
3518         return 0;
3519 }
3520  * @endcode
3521  */
3522 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3523
3524 /**
3525  * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3526  * @brief       This API gets the application api_version from the application ID
3527  *
3528  * @par         This API is for package-manager client application
3529  * @par Sync (or) Async : Synchronous API
3530  *
3531  * @param[in]   handle  pointer to appinfo handle
3532  * @param[out] api_version              pointer to hold application api_version
3533  * @return      0 if success, error code(<0) if fail
3534  * @retval      PMINFO_R_OK     success
3535  * @retval      PMINFO_R_EINVAL invalid argument
3536  * @retval      PMINFO_R_ERROR  internal error
3537  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3538  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3539  * @see         pkgmgrinfo_appinfo_get_appid()
3540  * @code
3541 static int get_app_api_version(const char *appid)
3542 {
3543         int ret = 0;
3544         char *api_version = NULL;
3545         pkgmgrinfo_appinfo_h handle = NULL;
3546         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3547         if (ret != PMINFO_R_OK)
3548                 return -1;
3549         ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3550         if (ret != PMINFO_R_OK) {
3551                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3552                 return -1;
3553         }
3554         printf("app api_version: %s\n", api_version);
3555         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3556         return 0;
3557 }
3558  * @endcode
3559  */
3560 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3561
3562 /**
3563  * @fn  int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3564                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3565  * @brief       This API gets the list of permission for a particular application
3566  *
3567  * @par         This API is for package-manager client application
3568  * @par Sync (or) Async : Synchronous API
3569  * @param[in]   handle          pointer to the application info handle.
3570  * @param[in]   permission_func         callback function for list
3571  * @param[in] user_data user data to be passed to callback function
3572  * @return      0 if success, error code(<0) if fail
3573  * @retval      PMINFO_R_OK     success
3574  * @retval      PMINFO_R_EINVAL invalid argument
3575  * @retval      PMINFO_R_ERROR  internal error
3576  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3577  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3578  * @code
3579 int permission_func(const char *name, void *user_data)
3580 {
3581         if (strcmp(name, (char *)user_data) == 0)
3582                 return -1;
3583         else
3584                 return 0;
3585 }
3586
3587 static int list_permission(const char *appid, char *permission)
3588 {
3589         int ret = 0;
3590         pkgmgrinfo_appinfo_h handle;
3591         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3592         if (ret != PMINFO_R_OK)
3593                 return -1;
3594         ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3595         if (ret != PMINFO_R_OK) {
3596                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3597                 return -1;
3598         }
3599         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3600         return 0;
3601 }
3602  * @endcode
3603  */
3604 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3605                         pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3606
3607 /**
3608  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3609                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3610  * @brief       This API gets the list of category for a particular application
3611  *
3612  * @par         This API is for package-manager client application
3613  * @par Sync (or) Async : Synchronous API
3614  * @param[in]   handle          pointer to the application info handle.
3615  * @param[in]   category_func           callback function for list
3616  * @param[in] user_data user data to be passed to callback function
3617  * @return      0 if success, error code(<0) if fail
3618  * @retval      PMINFO_R_OK     success
3619  * @retval      PMINFO_R_EINVAL invalid argument
3620  * @retval      PMINFO_R_ERROR  internal error
3621  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3622  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3623  * @code
3624 int category_func(const char *name, void *user_data)
3625 {
3626         if (strcmp(name, (char *)user_data) == 0)
3627                 return -1;
3628         else
3629                 return 0;
3630 }
3631
3632 static int list_category(const char *appid, char *category)
3633 {
3634         int ret = 0;
3635         pkgmgrinfo_appinfo_h handle;
3636         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3637         if (ret != PMINFO_R_OK)
3638                 return -1;
3639         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3640         if (ret != PMINFO_R_OK) {
3641                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3642                 return -1;
3643         }
3644         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3645         return 0;
3646 }
3647  * @endcode
3648  */
3649 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3650                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3651
3652 /**
3653  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3654                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3655  * @brief       This API gets the list of metadata for a particular application
3656  *
3657  * @par         This API is for package-manager client application
3658  * @par Sync (or) Async : Synchronous API
3659  * @param[in]   handle          pointer to the application info handle.
3660  * @param[in]   metadata_func           callback function for list
3661  * @param[in] user_data user data to be passed to callback function
3662  * @return      0 if success, error code(<0) if fail
3663  * @retval      PMINFO_R_OK     success
3664  * @retval      PMINFO_R_EINVAL invalid argument
3665  * @retval      PMINFO_R_ERROR  internal error
3666  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3667  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3668  * @code
3669 int metadata_func(const char *key, const char *value, void *user_data)
3670 {
3671         if (strcmp(key, (char *)user_data) == 0) {
3672                 printf("Value is %s\n", value);
3673                 return -1;
3674         }
3675         else
3676                 return 0;
3677 }
3678
3679 static int list_metadata(const char *appid, char *key)
3680 {
3681         int ret = 0;
3682         pkgmgrinfo_appinfo_h handle;
3683         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3684         if (ret != PMINFO_R_OK)
3685                 return -1;
3686         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3687         if (ret != PMINFO_R_OK) {
3688                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3689                 return -1;
3690         }
3691         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3692         return 0;
3693 }
3694  * @endcode
3695  */
3696 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3697                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3698
3699
3700 /**
3701  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3702                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3703  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3704                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3705  * @brief       This API gets the list of app-control for a particular application
3706  *
3707  * @par         This API is for package-manager client application
3708  * @par Sync (or) Async : Synchronous API
3709  * @param[in]   handle          pointer to the application info handle.
3710  * @param[in]   appcontrol_func         callback function for list
3711  * @param[in] user_data user data to be passed to callback function
3712  * @param[in]   uid     the addressee user id of the instruction
3713  * @return      0 if success, error code(<0) if fail
3714  * @retval      PMINFO_R_OK     success
3715  * @retval      PMINFO_R_EINVAL invalid argument
3716  * @retval      PMINFO_R_ERROR  internal error
3717  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3718  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3719  * @code
3720 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3721 {
3722         int oc = 0;
3723         int i = 0;
3724         char **operation;
3725         pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3726         for (i = 0; i < oc; i++) {
3727                 if (strcmp(operation[i], (char *)user_data) == 0)
3728                         return -1;
3729                 else
3730                         return 0;
3731         }
3732 }
3733
3734 static int check_operation(const char *appid, char *operation)
3735 {
3736         int ret = 0;
3737         pkgmgrinfo_appinfo_h handle;
3738         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3739         if (ret != PMINFO_R_OK)
3740                 return -1;
3741         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3742         if (ret != PMINFO_R_OK) {
3743                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3744                 return -1;
3745         }
3746         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3747         return 0;
3748 }
3749  * @endcode
3750  */
3751 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3752                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3753
3754 /**
3755  * @brief
3756  */
3757 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3758                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3759
3760 /**
3761  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3762                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3763  * @brief       This API gets the list of splashscreen for a particular application
3764  *
3765  * @par         This API is for package-manager client application
3766  * @par Sync (or) Async : Synchronous API
3767  * @param[in]   handle          pointer to the application info handle.
3768  * @param[in]   splash_screen_func              callback function for list
3769  * @param[in]   user_data       user data to be passed to callback function
3770  * @return      0 if success, error code(<0) if fail
3771  * @retval      PMINFO_R_OK     success
3772  * @retval      PMINFO_R_EINVAL invalid argument
3773  * @retval      PMINFO_R_ERROR  internal error
3774  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3775  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3776  * @code
3777  */
3778 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3779                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3780
3781 /**
3782  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3783  * @brief       This API gets the application 'nodisplay' value from the app ID
3784  *
3785  * @par         This API is for package-manager client application
3786  * @par Sync (or) Async : Synchronous API
3787  *
3788  * @param[in]   handle  pointer to application info handle
3789  * @param[out] nodisplay                pointer to hold package nodisplay value
3790  * @return      0 if success, error code(<0) if fail
3791  * @retval      PMINFO_R_OK     success
3792  * @retval      PMINFO_R_EINVAL invalid argument
3793  * @retval      PMINFO_R_ERROR  internal error
3794  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3795  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3796  * @see         pkgmgrinfo_appinfo_get_appid()
3797  * @see         pkgmgrinfo_appinfo_is_multiple()
3798  * @code
3799 static int get_app_nodisplay(const char *appid)
3800 {
3801         int ret = 0;
3802         bool nodisplay;
3803         pkgmgrinfo_appinfo_h handle;
3804         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3805         if (ret != PMINFO_R_OK)
3806                 return -1;
3807         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3808         if (ret != PMINFO_R_OK) {
3809                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3810                 return -1;
3811         }
3812         printf("app nodisplay: %d\n", nodisplay);
3813         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3814         return 0;
3815 }
3816  * @endcode
3817  */
3818 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
3819
3820 /**
3821  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3822  * @brief       This API gets the application 'multiple' value from the app ID
3823  *
3824  * @par         This API is for package-manager client application
3825  * @par Sync (or) Async : Synchronous API
3826  *
3827  * @param[in]   handle  pointer to application info handle
3828  * @param[out] multiple         pointer to hold package multiple value
3829  * @return      0 if success, error code(<0) if fail
3830  * @retval      PMINFO_R_OK     success
3831  * @retval      PMINFO_R_EINVAL invalid argument
3832  * @retval      PMINFO_R_ERROR  internal error
3833  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3834  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3835  * @see         pkgmgrinfo_appinfo_get_appid()
3836  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3837  * @code
3838 static int get_app_multiple(const char *appid)
3839 {
3840         int ret = 0;
3841         bool multiple;
3842         pkgmgrinfo_appinfo_h handle;
3843         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3844         if (ret != PMINFO_R_OK)
3845                 return -1;
3846         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3847         if (ret != PMINFO_R_OK) {
3848                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3849                 return -1;
3850         }
3851         printf("app multiple: %d\n", multiple);
3852         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3853         return 0;
3854 }
3855  * @endcode
3856  */
3857 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
3858
3859 /**
3860  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3861  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3862  *              application launching effect. If fales, indicator will be hidden during application launching effect
3863  *
3864  * @par         This API is for package-manager client application
3865  * @par Sync (or) Async : Synchronous API
3866  *
3867  * @param[in]   handle  pointer to application info handle
3868  * @param[out]  indicator_disp contains indicator display status for application launching effect
3869  * @return      0 if success, error code(<0) if fail
3870  * @retval      PMINFO_R_OK     success
3871  * @retval      PMINFO_R_EINVAL invalid argument
3872  * @retval      PMINFO_R_ERROR  internal error
3873  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3874  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3875  * @see         pkgmgrinfo_appinfo_get_appid()
3876  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3877  * @code
3878 static int get_app_indicator_display(const char *appid)
3879 {
3880         int ret = 0;
3881         bool indicator_disp;
3882         pkgmgrinfo_appinfo_h handle;
3883         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3884         if (ret != PMINFO_R_OK)
3885                 return -1;
3886         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3887         if (ret != PMINFO_R_OK){
3888                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3889                 return -1;
3890         }
3891         printf("app indicator disp : %d\n", indicator_disp);
3892         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3893         return 0;
3894 }
3895  * @endcode
3896  */
3897 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3898
3899 /**
3900  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3901  * @brief       This API gets the application 'taskmanage' value from the app ID
3902  *
3903  * @par         This API is for package-manager client application
3904  * @par Sync (or) Async : Synchronous API
3905  *
3906  * @param[in]   handle  pointer to application info handle
3907  * @param[out] taskmanage               pointer to hold package taskmanage value
3908  * @return      0 if success, error code(<0) if fail
3909  * @retval      PMINFO_R_OK     success
3910  * @retval      PMINFO_R_EINVAL invalid argument
3911  * @retval      PMINFO_R_ERROR  internal error
3912  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3913  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3914  * @see         pkgmgrinfo_appinfo_get_appid()
3915  * @see         pkgmgrinfo_appinfo_is_multiple()
3916  * @code
3917 static int get_app_taskmanage(const char *appid)
3918 {
3919         int ret = 0;
3920         bool taskmanage;
3921         pkgmgrinfo_appinfo_h handle;
3922         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3923         if (ret != PMINFO_R_OK)
3924                 return -1;
3925         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3926         if (ret != PMINFO_R_OK) {
3927                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3928                 return -1;
3929         }
3930         printf("app taskmanage: %d\n", taskmanage);
3931         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3932         return 0;
3933 }
3934  * @endcode
3935  */
3936 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
3937
3938 /**
3939  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3940  * @brief       This API gets the application 'taskmanage' value from the app ID
3941  *
3942  * @par         This API is for package-manager client application
3943  * @par Sync (or) Async : Synchronous API
3944  *
3945  * @param[in]   handle  pointer to application info handle
3946  * @param[out] enabled          pointer to hold package enabled value
3947  * @return      0 if success, error code(<0) if fail
3948  * @retval      PMINFO_R_OK     success
3949  * @retval      PMINFO_R_EINVAL invalid argument
3950  * @retval      PMINFO_R_ERROR  internal error
3951  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3952  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3953  * @see         pkgmgrinfo_appinfo_get_appid()
3954  * @see         pkgmgrinfo_appinfo_is_multiple()
3955  * @code
3956 static int get_app_enabled(const char *appid)
3957 {
3958         int ret = 0;
3959         bool enabled;
3960         pkgmgrinfo_appinfo_h handle;
3961         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3962         if (ret != PMINFO_R_OK)
3963                 return -1;
3964         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3965         if (ret != PMINFO_R_OK) {
3966                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3967                 return -1;
3968         }
3969         printf("app enabled: %d\n", enabled);
3970         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3971         return 0;
3972 }
3973  * @endcode
3974  */
3975 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
3976
3977 /**
3978  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3979  * @brief       This API gets the application 'onboot' value from the app ID
3980  *
3981  * @par         This API is for package-manager client application
3982  * @par Sync (or) Async : Synchronous API
3983  *
3984  * @param[in]   handle  pointer to application info handle
3985  * @param[out] onboot           pointer to hold package onboot value
3986  * @return      0 if success, error code(<0) if fail
3987  * @retval      PMINFO_R_OK     success
3988  * @retval      PMINFO_R_EINVAL invalid argument
3989  * @retval      PMINFO_R_ERROR  internal error
3990  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3991  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3992  * @see         pkgmgrinfo_appinfo_get_appid()
3993  * @see         pkgmgrinfo_appinfo_is_multiple()
3994  * @code
3995 static int get_app_onboot(const char *appid)
3996 {
3997         int ret = 0;
3998         bool onboot;
3999         pkgmgrinfo_appinfo_h handle;
4000         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4001         if (ret != PMINFO_R_OK)
4002                 return -1;
4003         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4004         if (ret != PMINFO_R_OK) {
4005                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4006                 return -1;
4007         }
4008         printf("app onboot: %d\n", onboot);
4009         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4010         return 0;
4011 }
4012  * @endcode
4013  */
4014 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
4015
4016 /**
4017  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4018  * @brief       This API gets the application 'autorestart' value from the app ID
4019  *
4020  * @par         This API is for package-manager client application
4021  * @par Sync (or) Async : Synchronous API
4022  *
4023  * @param[in]   handle  pointer to application info handle
4024  * @param[out] autorestart              pointer to hold package autorestart value
4025  * @return      0 if success, error code(<0) if fail
4026  * @retval      PMINFO_R_OK     success
4027  * @retval      PMINFO_R_EINVAL invalid argument
4028  * @retval      PMINFO_R_ERROR  internal error
4029  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4030  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4031  * @see         pkgmgrinfo_appinfo_get_appid()
4032  * @see         pkgmgrinfo_appinfo_is_multiple()
4033  * @code
4034 static int get_app_autorestart(const char *appid)
4035 {
4036         int ret = 0;
4037         bool autorestart;
4038         pkgmgrinfo_appinfo_h handle;
4039         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4040         if (ret != PMINFO_R_OK)
4041                 return -1;
4042         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4043         if (ret != PMINFO_R_OK) {
4044                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4045                 return -1;
4046         }
4047         printf("app autorestart: %d\n", autorestart);
4048         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4049         return 0;
4050 }
4051  * @endcode
4052  */
4053 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4054
4055 /**
4056  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4057  * @brief       This API gets the value for given application is main app or not from handle
4058  *
4059  * @par         This API is for package-manager client application
4060  * @par Sync (or) Async : Synchronous API
4061  *
4062  * @param[in]   handle  pointer to application info handle
4063  * @param[out] mainapp          pointer to hold package mainapp is or not
4064  * @return      0 if success, error code(<0) if fail
4065  * @retval      PMINFO_R_OK     success
4066  * @retval      PMINFO_R_EINVAL invalid argument
4067  * @retval      PMINFO_R_ERROR  internal error
4068  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4069  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4070  * @see         pkgmgrinfo_appinfo_get_appid()
4071  * @see         pkgmgrinfo_appinfo_is_multiple()
4072  * @code
4073 static int get_app_mainapp(const char *appid)
4074 {
4075         int ret = 0;
4076         bool mainapp;
4077         pkgmgrinfo_appinfo_h handle;
4078         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4079         if (ret != PMINFO_R_OK)
4080                 return -1;
4081         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4082         if (ret != PMINFO_R_OK) {
4083                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4084                 return -1;
4085         }
4086         printf("mainapp: %d\n", mainapp);
4087         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4088         return 0;
4089 }
4090  * @endcode
4091  */
4092 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4093
4094
4095 /**
4096  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4097  * @brief       This API gets the value for given application is preload or not from handle
4098  *
4099  * @par         This API is for package-manager client application
4100  * @par Sync (or) Async : Synchronous API
4101  *
4102  * @param[in]   handle  pointer to application info handle
4103  * @param[out] preload          pointer to hold preload is or not
4104  * @return      0 if success, error code(<0) if fail
4105  * @retval      PMINFO_R_OK     success
4106  * @retval      PMINFO_R_EINVAL invalid argument
4107  * @retval      PMINFO_R_ERROR  internal error
4108  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4109  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4110  * @see         pkgmgrinfo_appinfo_get_appid()
4111  * @see         pkgmgrinfo_appinfo_is_multiple()
4112  * @code
4113 static int get_app_preload(const char *appid)
4114 {
4115         int ret = 0;
4116         bool preload = 0;
4117         pkgmgrinfo_appinfo_h handle = NULL;
4118         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4119         if (ret != PMINFO_R_OK)
4120                 return -1;
4121         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4122         if (ret != PMINFO_R_OK) {
4123                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4124                 return -1;
4125         }
4126         printf("preload: %d\n", preload);
4127         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4128         return 0;
4129 }
4130  * @endcode
4131  */
4132 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4133
4134 /**
4135  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4136  * @brief       This API gets the value for given application is submode or not from handle
4137  *
4138  * @par         This API is for package-manager client application
4139  * @par Sync (or) Async : Synchronous API
4140  *
4141  * @param[in]   handle  pointer to application info handle
4142  * @param[out] submode          pointer to hold submode is or not
4143  * @return      0 if success, error code(<0) if fail
4144  * @retval      PMINFO_R_OK     success
4145  * @retval      PMINFO_R_EINVAL invalid argument
4146  * @retval      PMINFO_R_ERROR  internal error
4147  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4148  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4149  * @see         pkgmgrinfo_appinfo_get_appid()
4150  * @see         pkgmgrinfo_appinfo_is_multiple()
4151  * @code
4152 static int get_app_submode(const char *appid)
4153 {
4154         int ret = 0;
4155         bool submode = 0;
4156         pkgmgrinfo_appinfo_h handle = NULL;
4157         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4158         if (ret != PMINFO_R_OK)
4159                 return -1;
4160         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4161         if (ret != PMINFO_R_OK) {
4162                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4163                 return -1;
4164         }
4165         printf("submode: %d\n", submode);
4166         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4167         return 0;
4168 }
4169  * @endcode
4170  */
4171 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4172
4173 /**
4174  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4175  * @brief       This API gets the value for given application is process_pool or not from handle
4176  *
4177  * @par         This API is for package-manager client application
4178  * @par Sync (or) Async : Synchronous API
4179  *
4180  * @param[in]   handle  pointer to application info handle
4181  * @param[out] process_pool             pointer to hold process_pool is or not
4182  * @return      0 if success, error code(<0) if fail
4183  * @retval      PMINFO_R_OK     success
4184  * @retval      PMINFO_R_EINVAL invalid argument
4185  * @retval      PMINFO_R_ERROR  internal error
4186  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4187  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4188  * @see         pkgmgrinfo_appinfo_get_appid()
4189  * @code
4190 static int get_app_process_pool(const char *appid)
4191 {
4192         int ret = 0;
4193         bool process_pool = 0;
4194         pkgmgrinfo_appinfo_h handle = NULL;
4195         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4196         if (ret != PMINFO_R_OK)
4197                 return -1;
4198         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4199         if (ret != PMINFO_R_OK) {
4200                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4201                 return -1;
4202         }
4203         printf("process_pool: %d\n", process_pool);
4204         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4205         return 0;
4206 }
4207  * @endcode
4208  */
4209 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4210
4211 /**
4212  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4213  * @brief       This API gets the installed storage location of the application
4214  *
4215  * @par This API is for package-manager client application
4216  * @par Sync (or) Async : Synchronous API
4217  *
4218  * @param[in] handle            pointer to the application info handle.
4219  * @param[out] app_type         pointer to hold installed storage location
4220  * @return      0 if success, error code(<0) if fail
4221  * @retval      PMINFO_R_OK success
4222  * @retval      PMINFO_R_EINVAL invalid argument
4223  * @retval      PMINFO_R_ERROR  internal error
4224  * @pre pkgmgrinfo_appinfo_get_appinfo()
4225  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4226  * @see pkgmgrinfo_appinfo_get_appid()
4227  * @code
4228 static int get_app_installed_location(const char *appid)
4229 {
4230         int ret = 0;
4231         pkgmgrinfo_installed_storage storage;
4232         pkgmgrinfo_appinfo_h handle = NULL;
4233         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4234         if (ret != PMINFO_R_OK)
4235                 return -1;
4236         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4237         if (ret != PMINFO_R_OK) {
4238                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4239                 return -1;
4240         }
4241         printf("Installed storage location : %d\n", storage);
4242         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4243         return 0;
4244 }
4245  * @endcode
4246  */
4247 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4248
4249
4250 /**
4251  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4252  * @brief       This API checks if the application has the given category
4253  *
4254  * @par         This API is for package-manager client application
4255  * @par Sync (or) Async : Synchronous API
4256  *
4257  * @param[in]   handle  pointer to the application info handle
4258  * @param[in]   category        category
4259  * @param[out] exist            value Gets whether the application has the given category
4260  * @return      0 if success, error code(<0) if fail
4261  * @retval      PMINFO_R_OK     success
4262  * @retval      PMINFO_R_EINVAL invalid argument
4263  * @retval      PMINFO_R_ERROR  internal error
4264  * @code
4265 static int is_category_exist(const char *appid, const char *category)
4266 {
4267         int ret = 0;
4268         pkgmgrinfo_appinfo_h handle;
4269         bool exist = false;
4270
4271         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4272         if (ret != PMINFO_R_OK)
4273                 return -1;
4274
4275         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4276         if (ret != PMINFO_R_OK) {
4277                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4278                 return -1;
4279         }
4280
4281         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4282         return 0;
4283 }
4284  * @endcode
4285  */
4286 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4287
4288 /**
4289  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4290  * @brief       This API gets the application 'ui_gadget' value from the app ID
4291  *
4292  * @par         This API is for package-manager client application
4293  * @par Sync (or) Async : Synchronous API
4294  *
4295  * @param[in]   handle  pointer to application info handle
4296  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4297  * @return      0 if success, error code(<0) if fail
4298  * @retval      PMINFO_R_OK     success
4299  * @retval      PMINFO_R_EINVAL invalid argument
4300  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4301  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4302  * @code
4303 static int get_app_ui_gadget(const char *appid)
4304 {
4305         int ret = 0;
4306         bool ui_gadget;
4307         pkgmgrinfo_appinfo_h handle = NULL;
4308         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4309         if (ret != PMINFO_R_OK)
4310                 return -1;
4311         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4312         if (ret != PMINFO_R_OK) {
4313                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4314                 return -1;
4315         }
4316         printf("app ui_gadget: %d\n", ui_gadget);
4317         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4318         return 0;
4319 }
4320  * @endcode
4321  */
4322 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4323
4324 /**
4325  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4326  * @brief       This API gets the application 'support_disable' value from the app ID
4327  *
4328  * @par         This API is for package-manager client application
4329  * @par Sync (or) Async : Synchronous API
4330  *
4331  * @param[in]   handle  pointer to application info handle
4332  * @param[out]  support_disable pointer to hold package support_disable value
4333  * @return      0 if success, error code(<0) if fail
4334  * @retval      PMINFO_R_OK     success
4335  * @retval      PMINFO_R_EINVAL invalid argument
4336  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4337  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4338  * @code
4339 static int get_app_support_disable(const char *appid)
4340 {
4341         int ret = 0;
4342         bool support_disable;
4343         pkgmgrinfo_appinfo_h handle = NULL;
4344         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4345         if (ret != PMINFO_R_OK)
4346                 return -1;
4347         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4348         if (ret != PMINFO_R_OK) {
4349                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4350                 return -1;
4351         }
4352         printf("app support_disable: %d\n", support_disable);
4353         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4354         return 0;
4355 }
4356  * @endcode
4357  */
4358 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4359
4360 /**
4361  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4362  * @brief       This API gets the application 'is_disable' value from the app ID
4363  *
4364  * @par         This API is for package-manager client application
4365  * @par Sync (or) Async : Synchronous API
4366  *
4367  * @param[in]   handle  pointer to application info handle
4368  * @param[out]  disabled        pointer to hold application is_disabled value
4369  * @return      0 if success, error code(<0) if fail
4370  * @retval      PMINFO_R_OK     success
4371  * @retval      PMINFO_R_EINVAL invalid argument
4372  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4373  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4374  * @code
4375 static int get_app_is_disable(const char *appid)
4376 {
4377         int ret = 0;
4378         bool is_disable;
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_disabled(handle, &is_disable);
4384         if (ret != PMINFO_R_OK) {
4385                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4386                 return -1;
4387         }
4388         printf("app is_disable: %d\n", is_disable);
4389         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4390         return 0;
4391 }
4392  * @endcode
4393  */
4394 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4395
4396 /**
4397  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4398  * @brief       This API gets whethere the given application is global application or user application
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[in]   global  pointer to hold application global 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  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4410  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4411  * @see         pkgmgrinfo_appinfo_get_appid()
4412  static int get_app_is_global(const char *appid)
4413  {
4414          int ret = 0;
4415          bool global;
4416          pkgmgrinfo_appinfo_h handle = NULL;
4417          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4418          if (ret != PMINFO_R_OK)
4419                  return -1;
4420          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4421          if (ret != PMINFO_R_OK) {
4422                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
4423                  return -1;
4424          }
4425          printf("app is_global: %d\n", global);
4426          pkgmgrinfo_appinfo_destroy_appinfo(handle);
4427          return 0;
4428  }
4429   * @endcode
4430   */
4431 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4432
4433 /**
4434  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4435  * @brief       This API gets the application 'splash_screen_display' value from the app ID
4436  *
4437  * @par         This API is for package-manager client application
4438  * @par Sync (or) Async : Synchronous API
4439  *
4440  * @param[in]   handle          pointer to application info handle
4441  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
4442  * @return      0 if success, error code(<0) if fail
4443  * @retval      PMINFO_R_OK     success
4444  * @retval      PMINFO_R_EINVAL invalid argument
4445  * @retval      PMINFO_R_ERROR  internal error
4446  */
4447 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4448
4449 /**
4450  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4451  * @brief       This API destroys the application information handle freeing up all the resources
4452  *
4453  * @par         This API is for package-manager client application
4454  * @par Sync (or) Async : Synchronous API
4455  *
4456  * @param[in] handle            pointer to the application info handle.
4457  * @return      0 if success, error code(<0) if fail
4458  * @retval      PMINFO_R_OK     success
4459  * @retval      PMINFO_R_EINVAL invalid argument
4460  * @retval      PMINFO_R_ERROR  internal error
4461  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4462  * @post                None
4463  * @see         pkgmgrinfo_appinfo_get_pkgid()
4464  * @see         pkgmgrinfo_appinfo_is_multiple()
4465  * @code
4466 static int get_app_type(const char *appid)
4467 {
4468         int ret = 0;
4469         char *type = NULL;
4470         pkgmgrinfo_appinfo_h handle;
4471         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4472         if (ret != PMINFO_R_OK)
4473                 return -1;
4474         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4475         if (ret != PMINFO_R_OK) {
4476                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477                 return -1;
4478         }
4479         printf("apptype: %s\n", type);
4480         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4481         return 0;
4482 }
4483  * @endcode
4484  */
4485 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
4486
4487 /**
4488  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4489  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
4490  The query will search the entire application information collected from the manifest file of all the installed packages
4491  *
4492  * @par         This API is for package-manager client application
4493  * @par Sync (or) Async : Synchronous API
4494  *
4495  * @param[out] handle           pointer to the application info filter handle.
4496  * @return      0 if success, error code(<0) if fail
4497  * @retval      PMINFO_R_OK     success
4498  * @retval      PMINFO_R_EINVAL invalid argument
4499  * @retval      PMINFO_R_ERROR  internal error
4500  * @pre         None
4501  * @post                pkgmgrinfo_appinfo_filter_destroy()
4502  * @see         pkgmgrinfo_appinfo_filter_count()
4503  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4504  * @code
4505 static int get_capp_count()
4506 {
4507         int ret = 0;
4508         int count = 0;
4509         pkgmgrinfo_appinfo_filter_h handle;
4510         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4511         if (ret != PMINFO_R_OK)
4512                 return -1;
4513         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4514         if (ret != PMINFO_R_OK) {
4515                 pkgmgrinfo_appinfo_filter_destroy(handle);
4516                 return -1;
4517         }
4518         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4519         if (ret != PMINFO_R_OK) {
4520                 pkgmgrinfo_appinfo_filter_destroy(handle);
4521                 return -1;
4522         }
4523         printf("No of capp: %d\n", count);
4524         pkgmgrinfo_appinfo_filter_destroy(handle);
4525         return 0;
4526 }
4527  * @endcode
4528  */
4529 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4530
4531 /**
4532  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4533  * @brief       This API destroys the application information filter handle freeing up all the resources
4534  *
4535  * @par         This API is for package-manager client application
4536  * @par Sync (or) Async : Synchronous API
4537  *
4538  * @param[in] handle            pointer to the application info filter handle.
4539  * @return      0 if success, error code(<0) if fail
4540  * @retval      PMINFO_R_OK     success
4541  * @retval      PMINFO_R_EINVAL invalid argument
4542  * @retval      PMINFO_R_ERROR  internal error
4543  * @pre         pkgmgrinfo_appinfo_filter_create()
4544  * @post                None
4545  * @see         pkgmgrinfo_appinfo_filter_count()
4546  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4547  * @code
4548 static int get_capp_count()
4549 {
4550         int ret = 0;
4551         int count = 0;
4552         pkgmgrinfo_appinfo_filter_h handle;
4553         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4554         if (ret != PMINFO_R_OK)
4555                 return -1;
4556         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4557         if (ret != PMINFO_R_OK) {
4558                 pkgmgrinfo_appinfo_filter_destroy(handle);
4559                 return -1;
4560         }
4561         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4562         if (ret != PMINFO_R_OK) {
4563                 pkgmgrinfo_appinfo_filter_destroy(handle);
4564                 return -1;
4565         }
4566         printf("No of capp: %d\n", count);
4567         pkgmgrinfo_appinfo_filter_destroy(handle);
4568         return 0;
4569 }
4570  * @endcode
4571  */
4572 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4573
4574 /**
4575  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4576  * @brief       This API adds a boolean filter property to the filter handle
4577  *
4578  * @par         This API is for package-manager client application
4579  * @par Sync (or) Async : Synchronous API
4580  *
4581  * @param[in] handle            pointer to the application info filter handle.
4582  * @param[in] property          boolean property name.
4583  * @param[in] value             value corresponding to the property.
4584  * @return      0 if success, error code(<0) if fail
4585  * @retval      PMINFO_R_OK     success
4586  * @retval      PMINFO_R_EINVAL invalid argument
4587  * @retval      PMINFO_R_ERROR  internal error
4588  * @pre         pkgmgrinfo_appinfo_filter_create()
4589  * @post                pkgmgrinfo_appinfo_filter_destroy()
4590  * @see         pkgmgrinfo_appinfo_filter_count()
4591  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4592  * @code
4593 static int get_taskmanageable_app_count()
4594 {
4595         int ret = 0;
4596         int count = 0;
4597         pkgmgrinfo_appinfo_filter_h handle;
4598         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4599         if (ret != PMINFO_R_OK)
4600                 return -1;
4601         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4602         if (ret != PMINFO_R_OK) {
4603                 pkgmgrinfo_appinfo_filter_destroy(handle);
4604                 return -1;
4605         }
4606         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4607         if (ret != PMINFO_R_OK) {
4608                 pkgmgrinfo_appinfo_filter_destroy(handle);
4609                 return -1;
4610         }
4611         printf("No of taskmanageable apps: %d\n", count);
4612         pkgmgrinfo_appinfo_filter_destroy(handle);
4613         return 0;
4614 }
4615  * @endcode
4616  */
4617 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4618                 const char *property, const bool value);
4619
4620 /**
4621  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4622  * @brief       This API adds an integer filter property to the filter handle
4623  *
4624  * @par         This API is for package-manager client application
4625  * @par Sync (or) Async : Synchronous API
4626  *
4627  * @param[in] handle            pointer to the application info filter handle.
4628  * @param[in] property          integer property name.
4629  * @param[in] value             value corresponding to the property.
4630  * @return      0 if success, error code(<0) if fail
4631  * @retval      PMINFO_R_OK     success
4632  * @retval      PMINFO_R_EINVAL invalid argument
4633  * @retval      PMINFO_R_ERROR  internal error
4634  * @pre         pkgmgrinfo_appinfo_filter_create()
4635  * @post                pkgmgrinfo_appinfo_filter_destroy()
4636  * @see         pkgmgrinfo_appinfo_filter_count()
4637  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4638  * @code
4639 static int get_taskmanageable_app_count()
4640 {
4641         int ret = 0;
4642         int count = 0;
4643         pkgmgrinfo_appinfo_filter_h handle;
4644         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4645         if (ret != PMINFO_R_OK)
4646                 return -1;
4647         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4648         if (ret != PMINFO_R_OK) {
4649                 pkgmgrinfo_appinfo_filter_destroy(handle);
4650                 return -1;
4651         }
4652         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4653         if (ret != PMINFO_R_OK) {
4654                 pkgmgrinfo_appinfo_filter_destroy(handle);
4655                 return -1;
4656         }
4657         printf("No of apps: %d\n", count);
4658         pkgmgrinfo_appinfo_filter_destroy(handle);
4659         return 0;
4660 }
4661  * @endcode
4662  */
4663 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4664                 const char *property, const int value);
4665
4666 /**
4667  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4668  * @brief       This API adds a string filter property to the filter handle
4669  *
4670  * @par         This API is for package-manager client application
4671  * @par Sync (or) Async : Synchronous API
4672  *
4673  * @param[in] handle            pointer to the application info filter handle.
4674  * @param[in] property          string property name.
4675  * @param[in] value             value corresponding to the property.
4676  * @return      0 if success, error code(<0) if fail
4677  * @retval      PMINFO_R_OK     success
4678  * @retval      PMINFO_R_EINVAL invalid argument
4679  * @retval      PMINFO_R_ERROR  internal error
4680  * @pre         pkgmgrinfo_appinfo_filter_create()
4681  * @post                pkgmgrinfo_appinfo_filter_destroy()
4682  * @see         pkgmgrinfo_appinfo_filter_count()
4683  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4684  * @code
4685 static int get_capp_count()
4686 {
4687         int ret = 0;
4688         int count = 0;
4689         pkgmgrinfo_appinfo_filter_h handle;
4690         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4691         if (ret != PMINFO_R_OK)
4692                 return -1;
4693         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4694         if (ret != PMINFO_R_OK) {
4695                 pkgmgrinfo_appinfo_filter_destroy(handle);
4696                 return -1;
4697         }
4698         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4699         if (ret != PMINFO_R_OK) {
4700                 pkgmgrinfo_appinfo_filter_destroy(handle);
4701                 return -1;
4702         }
4703         printf("No of capp: %d\n", count);
4704         pkgmgrinfo_appinfo_filter_destroy(handle);
4705         return 0;
4706 }
4707  * @endcode
4708  */
4709 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4710                 const char *property, const char *value);
4711
4712 /**
4713  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4714  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
4715  *
4716  * @par         This API is for package-manager client application
4717  * @par Sync (or) Async : Synchronous API
4718  *
4719  * @param[in] handle            pointer to the application info filter handle.
4720  * @param[in] app_cb            callback function.
4721  * @param[in] user_data         user data to be passed to the callback function
4722  * @return      0 if success, error code(<0) if fail
4723  * @retval      PMINFO_R_OK     success
4724  * @retval      PMINFO_R_EINVAL invalid argument
4725  * @retval      PMINFO_R_ERROR  internal error
4726  * @pre         pkgmgrinfo_appinfo_filter_create()
4727  * @post                pkgmgrinfo_appinfo_filter_destroy()
4728  * @see         pkgmgrinfo_appinfo_filter_count()
4729  * @code
4730 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4731 {
4732         char *appid = NULL;
4733         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4734         printf("appid : %s\n", appid);
4735         return 0;
4736 }
4737
4738 static int get_capp_list()
4739 {
4740         int ret = 0;
4741         pkgmgrinfo_appinfo_filter_h handle;
4742         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4743         if (ret != PMINFO_R_OK)
4744                 return -1;
4745         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4746         if (ret != PMINFO_R_OK) {
4747                 pkgmgrinfo_appinfo_filter_destroy(handle);
4748                 return -1;
4749         }
4750         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4751         if (ret != PMINFO_R_OK) {
4752                 pkgmgrinfo_appinfo_filter_destroy(handle);
4753                 return -1;
4754         }
4755         pkgmgrinfo_appinfo_filter_destroy(handle);
4756         return 0;
4757 }
4758  * @endcode
4759  */
4760 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4761                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4762 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4763                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4764
4765 /**
4766  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4767  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4768  * @brief       This API counts the application that satisfy the filter conditions
4769  *
4770  * @par         This API is for package-manager client application
4771  * @par Sync (or) Async : Synchronous API
4772  *
4773  * @param[in] handle            pointer to the application info filter handle.
4774  * @param[in] count             pointer to store count value
4775  * @param[in]   uid     the addressee user id of the instruction
4776  * @return      0 if success, error code(<0) if fail
4777  * @retval      PMINFO_R_OK     success
4778  * @retval      PMINFO_R_EINVAL invalid argument
4779  * @retval      PMINFO_R_ERROR  internal error
4780  * @pre         pkgmgrinfo_appinfo_filter_create()
4781  * @post                pkgmgrinfo_appinfo_filter_destroy()
4782  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
4783  * @code
4784 static int get_capp_count()
4785 {
4786         int ret = 0;
4787         int count = 0;
4788         pkgmgrinfo_appinfo_filter_h handle;
4789         ret = pkgmgrinfo_appinfo_filter_create(&handle);
4790         if (ret != PMINFO_R_OK)
4791                 return -1;
4792         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4793         if (ret != PMINFO_R_OK) {
4794                 pkgmgrinfo_appinfo_filter_destroy(handle);
4795                 return -1;
4796         }
4797         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4798         if (ret != PMINFO_R_OK) {
4799                 pkgmgrinfo_appinfo_filter_destroy(handle);
4800                 return -1;
4801         }
4802         printf("No of capp: %d\n", count);
4803         pkgmgrinfo_appinfo_filter_destroy(handle);
4804         return 0;
4805 }
4806  * @endcode
4807  */
4808 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4809 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4810 /**
4811  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4812  * @brief       This API creates the application's metadata  information filter handle from db.
4813  *
4814  * @par         This API is for package-manager client application
4815  * @par Sync (or) Async : Synchronous API
4816  *
4817  * @param[out] handle           pointer to the application metadata info filter handle.
4818  * @return      0 if success, error code(<0) if fail
4819  * @retval      PMINFO_R_OK     success
4820  * @retval      PMINFO_R_EINVAL invalid argument
4821  * @retval      PMINFO_R_ERROR  internal error
4822  * @pre         None
4823  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4824  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4825  * @code
4826 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4827 {
4828         char *appid = NULL;
4829         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4830         printf("appid : %s\n", appid);
4831         return 0;
4832 }
4833
4834 static int get_app_list(const char *mkey, const char *mvalue)
4835 {
4836         int ret = 0;
4837         pkgmgrinfo_appinfo_metadata_filter_h handle;
4838         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4839         if (ret != PMINFO_R_OK)
4840                 return -1;
4841         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4842         if (ret != PMINFO_R_OK) {
4843                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4844                 return -1;
4845         }
4846         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4847         if (ret != PMINFO_R_OK) {
4848                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4849                 return -1;
4850         }
4851         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4852         return 0;
4853 }
4854  * @endcode
4855  */
4856 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4857
4858 /**
4859  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4860  * @brief       This API destroys the application's metadata  information filter handle.
4861  *
4862  * @par         This API is for package-manager client application
4863  * @par Sync (or) Async : Synchronous API
4864  *
4865  * @param[in] handle            pointer to the application metadata info filter handle.
4866  * @return      0 if success, error code(<0) if fail
4867  * @retval      PMINFO_R_OK     success
4868  * @retval      PMINFO_R_EINVAL invalid argument
4869  * @retval      PMINFO_R_ERROR  internal error
4870  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4871  * @post                None
4872  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4873  * @code
4874 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4875 {
4876         char *appid = NULL;
4877         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4878         printf("appid : %s\n", appid);
4879         return 0;
4880 }
4881
4882 static int get_app_list(const char *mkey, const char *mvalue)
4883 {
4884         int ret = 0;
4885         pkgmgrinfo_appinfo_metadata_filter_h handle;
4886         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4887         if (ret != PMINFO_R_OK)
4888                 return -1;
4889         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4890         if (ret != PMINFO_R_OK) {
4891                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4892                 return -1;
4893         }
4894         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4895         if (ret != PMINFO_R_OK) {
4896                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4897                 return -1;
4898         }
4899         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4900         return 0;
4901 }
4902  * @endcode
4903  */
4904 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4905
4906 /**
4907  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4908  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
4909  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4910  *
4911  * @par         This API is for package-manager client application
4912  * @par Sync (or) Async : Synchronous API
4913  *
4914  * @param[in] handle            pointer to the application metadata info filter handle.
4915  * @param[in] key                       pointer to metadata key
4916  * @param[in] value                     pointer to metadata value
4917  * @return      0 if success, error code(<0) if fail
4918  * @retval      PMINFO_R_OK     success
4919  * @retval      PMINFO_R_EINVAL invalid argument
4920  * @retval      PMINFO_R_ERROR  internal error
4921  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4922  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4923  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
4924  * @code
4925 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4926 {
4927         char *appid = NULL;
4928         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4929         printf("appid : %s\n", appid);
4930         return 0;
4931 }
4932
4933 static int get_app_list(const char *mkey, const char *mvalue)
4934 {
4935         int ret = 0;
4936         pkgmgrinfo_appinfo_metadata_filter_h handle;
4937         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4938         if (ret != PMINFO_R_OK)
4939                 return -1;
4940         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4941         if (ret != PMINFO_R_OK) {
4942                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4943                 return -1;
4944         }
4945         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4946         if (ret != PMINFO_R_OK) {
4947                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4948                 return -1;
4949         }
4950         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4951         return 0;
4952 }
4953  * @endcode
4954  */
4955 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4956                 const char *key, const char *value);
4957
4958 /**
4959  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4960  * @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)
4961  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
4962  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4963  * negative value, no more callbacks will be called and API will return.
4964  *
4965  * @par         This API is for package-manager client application
4966  * @par Sync (or) Async : Synchronous API
4967  *
4968  * @param[in] handle            pointer to the application metadata info filter handle.
4969  * @param[in] app_cb            function pointer to callback
4970  * @param[in] user_data         pointer to user data
4971  * @param[in]   uid     the addressee user id of the instruction
4972  * @return      0 if success, error code(<0) if fail
4973  * @retval      PMINFO_R_OK     success
4974  * @retval      PMINFO_R_EINVAL invalid argument
4975  * @retval      PMINFO_R_ERROR  internal error
4976  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
4977  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
4978  * @code
4979 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4980 {
4981         char *appid = NULL;
4982         pkgmgrinfo_appinfo_get_appid(handle, &appid);
4983         printf("appid : %s\n", appid);
4984         return 0;
4985 }
4986
4987 static int get_app_list(const char *mkey, const char *mvalue)
4988 {
4989         int ret = 0;
4990         pkgmgrinfo_appinfo_metadata_filter_h handle;
4991         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4992         if (ret != PMINFO_R_OK)
4993                 return -1;
4994         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4995         if (ret != PMINFO_R_OK) {
4996                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4997                 return -1;
4998         }
4999         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5000         if (ret != PMINFO_R_OK) {
5001                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5002                 return -1;
5003         }
5004         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5005         return 0;
5006 }
5007  * @endcode
5008  */
5009 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5010                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5011 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5012                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5013 /**
5014  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5015  * @brief       This API creates the package cert information handle to get data from db.
5016  *
5017  * @par         This API is for package-manager client application
5018  * @par Sync (or) Async : Synchronous API
5019  *
5020  * @param[out] handle           pointer to the package cert handle.
5021  * @return      0 if success, error code(<0) if fail
5022  * @retval      PMINFO_R_OK     success
5023  * @retval      PMINFO_R_EINVAL invalid argument
5024  * @retval      PMINFO_R_ERROR  internal error
5025  * @pre         None
5026  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5027  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5028  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5029  * @code
5030 static int get_cert_info(const char *pkgid)
5031 {
5032         int ret = 0;
5033         pkgmgrinfo_certinfo_h handle;
5034         char *auth_cert = NULL;
5035         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5036         if (ret != PMINFO_R_OK)
5037                 return -1;
5038         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5039         if (ret != PMINFO_R_OK) {
5040                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5041                 return -1;
5042         }
5043         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5044         if (ret != PMINFO_R_OK) {
5045                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5046                 return -1;
5047         }
5048         printf("Author root certificate: %s\n", auth_root);
5049         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5050         return 0;
5051 }
5052  * @endcode
5053  */
5054 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5055
5056 /**
5057  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5058  * @brief       This API loads the package cert information handle with data from db.
5059  *
5060  * @par         This API is for package-manager client application
5061  * @par Sync (or) Async : Synchronous API
5062  *
5063  * @param[in] pkgid             pointer to the package ID.
5064  * @param[in] handle            pointer to the package cert handle.
5065  * @return      0 if success, error code(<0) if fail
5066  * @retval      PMINFO_R_OK     success
5067  * @retval      PMINFO_R_EINVAL invalid argument
5068  * @retval      PMINFO_R_ERROR  internal error
5069  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5070  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5071  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5072  * @code
5073 static int get_cert_info(const char *pkgid)
5074 {
5075         int ret = 0;
5076         pkgmgrinfo_certinfo_h handle;
5077         char *auth_cert = NULL;
5078         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5079         if (ret != PMINFO_R_OK)
5080                 return -1;
5081         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5082         if (ret != PMINFO_R_OK) {
5083                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5084                 return -1;
5085         }
5086         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5087         if (ret != PMINFO_R_OK) {
5088                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5089                 return -1;
5090         }
5091         printf("Author root certificate: %s\n", auth_root);
5092         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5093         return 0;
5094 }
5095  * @endcode
5096  */
5097 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5098
5099 /**
5100  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5101  * @brief       This API gets the package cert information from the handle
5102  *
5103  * @par         This API is for package-manager client application
5104  * @par Sync (or) Async : Synchronous API
5105  *
5106  * @param[in] handle            pointer to the package cert handle.
5107  * @param[in] cert_type         certificate type
5108  * @param[out] cert_value       pointer to hold certificate value
5109  * @return      0 if success, error code(<0) if fail
5110  * @retval      PMINFO_R_OK     success
5111  * @retval      PMINFO_R_EINVAL invalid argument
5112  * @retval      PMINFO_R_ERROR  internal error
5113  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5114  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5115  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5116  * @code
5117 static int get_cert_info(const char *pkgid)
5118 {
5119         int ret = 0;
5120         pkgmgrinfo_certinfo_h handle;
5121         char *auth_cert = NULL;
5122         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5123         if (ret != PMINFO_R_OK)
5124                 return -1;
5125         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5126         if (ret != PMINFO_R_OK) {
5127                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5128                 return -1;
5129         }
5130         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5131         if (ret != PMINFO_R_OK) {
5132                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5133                 return -1;
5134         }
5135         printf("Author root certificate: %s\n", auth_root);
5136         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5137         return 0;
5138 }
5139  * @endcode
5140  */
5141 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5142
5143 /**
5144  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5145  * @brief       This API destroys the package cert information handle freeing up all the resources
5146  *
5147  * @par         This API is for package-manager client application
5148  * @par Sync (or) Async : Synchronous API
5149  *
5150  * @param[in] handle            pointer to the package cert handle.
5151  * @return      0 if success, error code(<0) if fail
5152  * @retval      PMINFO_R_OK     success
5153  * @retval      PMINFO_R_EINVAL invalid argument
5154  * @retval      PMINFO_R_ERROR  internal error
5155  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5156  * @post                None
5157  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5158  * @code
5159 static int get_cert_info(const char *pkgid)
5160 {
5161         int ret = 0;
5162         pkgmgrinfo_certinfo_h handle;
5163         char *auth_cert = NULL;
5164         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5165         if (ret != PMINFO_R_OK)
5166                 return -1;
5167         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5168         if (ret != PMINFO_R_OK) {
5169                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5170                 return -1;
5171         }
5172         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5173         if (ret != PMINFO_R_OK) {
5174                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5175                 return -1;
5176         }
5177         printf("Author root certificate: %s\n", auth_root);
5178         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5179         return 0;
5180 }
5181  * @endcode
5182  */
5183 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5184
5185 /**
5186  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5187  * @brief       This API deletes the package cert information from DB
5188  *
5189  * @par         This API is for package-manager client application
5190  * @par Sync (or) Async : Synchronous API
5191  *
5192  * @param[in] pkgid             pointer to the package ID.
5193  * @return      0 if success, error code(<0) if fail
5194  * @retval      PMINFO_R_OK     success
5195  * @retval      PMINFO_R_EINVAL invalid argument
5196  * @retval      PMINFO_R_ERROR  internal error
5197  * @pre         None
5198  * @post                None
5199  * @code
5200 static int delete_cert_info(const char *pkgid)
5201 {
5202         int ret = 0;
5203         ret = pkgmgrinfo_delete_certinfo(pkgid);
5204         if (ret != PMINFO_R_OK)
5205                 return -1;
5206         return 0;
5207 }
5208  * @endcode
5209  */
5210  int pkgmgrinfo_delete_certinfo(const char *pkgid);
5211  int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5212
5213 /**
5214  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5215  * @brief       This API creates the package cert information handle to set data in db.
5216  *
5217  * @par         This API is for package-manager client application
5218  * @par Sync (or) Async : Synchronous API
5219  *
5220  * @param[out] handle           pointer to the package cert handle.
5221  * @return      0 if success, error code(<0) if fail
5222  * @retval      PMINFO_R_OK     success
5223  * @retval      PMINFO_R_EINVAL invalid argument
5224  * @retval      PMINFO_R_ERROR  internal error
5225  * @pre         None
5226  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5227  * @see         pkgmgrinfo_set_cert_value()
5228  * @see         pkgmgrinfo_save_certinfo()
5229  * @code
5230 static int set_cert_in_db(const char *pkgid)
5231 {
5232         int ret = 0;
5233         pkgmgrinfo_instcertinfo_h handle;
5234         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5235         if (ret != PMINFO_R_OK)
5236                 return -1;
5237         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5238         if (ret != PMINFO_R_OK) {
5239                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5240                 return -1;
5241         }
5242         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5243         if (ret != PMINFO_R_OK) {
5244                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5245                 return -1;
5246         }
5247         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5248         return 0;
5249 }
5250  * @endcode
5251  */
5252 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5253
5254 /**
5255  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5256  * @brief       This API sets the package cert information in the handle.
5257  *
5258  * @par         This API is for package-manager client application
5259  * @par Sync (or) Async : Synchronous API
5260  *
5261  * @param[in] handle            pointer to the package cert handle.
5262  * @param[in] cert_type         certificate type.
5263  * @param[in] cert_value        certificate value.
5264  * @return      0 if success, error code(<0) if fail
5265  * @retval      PMINFO_R_OK     success
5266  * @retval      PMINFO_R_EINVAL invalid argument
5267  * @retval      PMINFO_R_ERROR  internal error
5268  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5269  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5270  * @see         pkgmgrinfo_save_certinfo()
5271  * @code
5272 static int set_cert_in_db(const char *pkgid)
5273 {
5274         int ret = 0;
5275         pkgmgrinfo_instcertinfo_h handle;
5276         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5277         if (ret != PMINFO_R_OK)
5278                 return -1;
5279         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5280         if (ret != PMINFO_R_OK) {
5281                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5282                 return -1;
5283         }
5284         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5285         if (ret != PMINFO_R_OK) {
5286                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5287                 return -1;
5288         }
5289         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5290         return 0;
5291 }
5292  * @endcode
5293  */
5294 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5295
5296 /**
5297  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5298  * @brief       This API saves the package cert information in the DB.
5299  *
5300  * @par         This API is for package-manager client application
5301  * @par Sync (or) Async : Synchronous API
5302  *
5303  * @param[in] pkgid             pointer to the package ID.
5304  * @param[in] handle            pointer to the package cert handle.
5305  * @return      0 if success, error code(<0) if fail
5306  * @retval      PMINFO_R_OK     success
5307  * @retval      PMINFO_R_EINVAL invalid argument
5308  * @retval      PMINFO_R_ERROR  internal error
5309  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5310  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5311  * @see         pkgmgrinfo_save_certinfo()
5312  * @code
5313 static int set_cert_in_db(const char *pkgid)
5314 {
5315         int ret = 0;
5316         pkgmgrinfo_instcertinfo_h handle;
5317         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5318         if (ret != PMINFO_R_OK)
5319                 return -1;
5320         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5321         if (ret != PMINFO_R_OK) {
5322                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5323                 return -1;
5324         }
5325         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5326         if (ret != PMINFO_R_OK) {
5327                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5328                 return -1;
5329         }
5330         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5331         return 0;
5332 }
5333  * @endcode
5334  */
5335 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5336
5337 /**
5338  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5339  * @brief       This API destroys the package cert information handle freeing up all the resources.
5340  *
5341  * @par         This API is for package-manager client application
5342  * @par Sync (or) Async : Synchronous API
5343  *
5344  * @param[in] handle            pointer to the package cert handle.
5345  * @return      0 if success, error code(<0) if fail
5346  * @retval      PMINFO_R_OK     success
5347  * @retval      PMINFO_R_EINVAL invalid argument
5348  * @retval      PMINFO_R_ERROR  internal error
5349  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5350  * @post                None
5351  * @see         pkgmgrinfo_save_certinfo()
5352  * @code
5353 static int set_cert_in_db(const char *pkgid)
5354 {
5355         int ret = 0;
5356         pkgmgrinfo_instcertinfo_h handle;
5357         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5358         if (ret != PMINFO_R_OK)
5359                 return -1;
5360         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5361         if (ret != PMINFO_R_OK) {
5362                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5363                 return -1;
5364         }
5365         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5366         if (ret != PMINFO_R_OK) {
5367                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5368                 return -1;
5369         }
5370         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5371         return 0;
5372 }
5373  * @endcode
5374  */
5375 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5376
5377 /**
5378  * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5379  * @brief       This API gets the datacontrol info
5380  *
5381  * @par         This API is for package-manager client application
5382  * @par Sync (or) Async : Synchronous API
5383  *
5384  * @param[in] providerid                pointer to the providerid of dataconltrol.
5385  * @param[in] type                      pointer to the type of dataconltrol.
5386  * @param[out] appid                    pointer to hold appid, need to free after using
5387  * @param[out] access                   pointer to hold access, need to free after using
5388  * @return      0 if success, error code(<0) if fail
5389  * @retval      PMINFO_R_OK     success
5390  * @retval      PMINFO_R_EINVAL invalid argument
5391  * @retval      PMINFO_R_ERROR  internal error
5392  * @endcode
5393  */
5394 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5395
5396 /**
5397  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5398  * @brief       This API gets the application 'guest mode visibility' value from the DB
5399  *
5400  * @par         This API is for package-manager client application
5401  * @par Sync (or) Async : Synchronous API
5402  *
5403  * @param[in]   handle  pointer to application info handle
5404  * @param[out] status           pointer to hold app guest mode visibility value
5405  * @return      0 if success, error code(<0) if fail
5406  * @retval      PMINFO_R_OK     success
5407  * @retval      PMINFO_R_EINVAL invalid argument
5408  * @retval      PMINFO_R_ERROR  internal error
5409  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5410  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5411  * @see         pkgmgrinfo_appinfo_get_appid()
5412  * @see         pkgmgrinfo_appinfo_is_multiple()
5413  * @code
5414 static int get_app_guestmode_visibility(const char *appid)
5415 {
5416         int ret = 0;
5417         bool status;
5418         pkgmgrinfo_appinfo_h handle;
5419         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5420         if (ret != PMINFO_R_OK)
5421                 return -1;
5422         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5423         if (ret != PMINFO_R_OK) {
5424                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5425                 return -1;
5426         }
5427         printf("app guest mode visibility: %d\n", status);
5428         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5429         return 0;
5430 }
5431  * @endcode
5432  */
5433  int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5434
5435 /**
5436  * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5437  * @brief       This API sets the application 'guest mode visibility' value in the DB
5438  *
5439  * @par         This API is for package-manager client application
5440  * @par Sync (or) Async : Synchronous API
5441  *
5442  * @param[in]   handle  pointer to application info handle
5443  * @param[out] status   app guest mode visibility value
5444  * @return      0 if success, error code(<0) if fail
5445  * @retval      PMINFO_R_OK     success
5446  * @retval      PMINFO_R_EINVAL invalid argument
5447  * @retval      PMINFO_R_ERROR  internal error
5448  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5449  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5450  * @see         pkgmgrinfo_appinfo_get_appid()
5451  * @see         pkgmgrinfo_appinfo_is_multiple()
5452  * @code
5453 static int set_app_guestmode_visibility(const char *appid, bool value)
5454 {
5455         int ret = 0;
5456         pkgmgrinfo_appinfo_h handle;
5457         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5458         if (ret != PMINFO_R_OK)
5459                 return -1;
5460         ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5461         if (ret != PMINFO_R_OK) {
5462                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5463                 return -1;
5464         }
5465         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5466         return 0;
5467 }
5468  * @endcode
5469  */
5470  int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5471  int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5472
5473 /**
5474 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5475 * @brief         This API sets the package 'installed_storage' value in db
5476 *
5477 * @par   This API is for package-manager client application
5478 * @par Sync (or) Async : Synchronous API
5479 *
5480 * @param[in] pkgid       pointer to the package ID.
5481 * @param[in] location  package install location
5482 * @return  0 if success, error code(<0) if fail
5483 * @retval  PMINFO_R_OK success
5484 * @retval  PMINFO_R_EINVAL       invalid argument
5485 * @retval  PMINFO_R_ERROR internal error
5486 * @code
5487 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5488 {
5489         int ret = 0;
5490
5491         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5492         if (ret != PMINFO_R_OK) {
5493                 return -1;
5494         }
5495         return 0;
5496 }
5497 * @endcode
5498 */
5499  int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5500  int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5501
5502 /**
5503  * @pkgmgrinfo client API
5504 **/
5505
5506 /**
5507  * @brief listening status type in pkgmgrinfo.
5508  */
5509 #define PMINFO_CLIENT_STATUS_ALL                                                0x00
5510 #define PMINFO_CLIENT_STATUS_INSTALL                                    0x01
5511 #define PMINFO_CLIENT_STATUS_UNINSTALL                                  0x02
5512 #define PMINFO_CLIENT_STATUS_UPGRADE                                    0x04
5513 #define PMINFO_CLIENT_STATUS_MOVE                                               0x08
5514 #define PMINFO_CLIENT_STATUS_CLEAR_DATA                                 0x10
5515 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS                   0x20
5516
5517 /**
5518  * @brief       This APIs provides pkgmgrinfo client listener
5519  */
5520 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5521 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5522 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5523 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5524 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5525
5526
5527 /**
5528  * @pkgmgrinfo client API end
5529 **/
5530
5531
5532 /** @} */
5533 #ifdef __cplusplus
5534 }
5535 #endif
5536 #endif                          /* __PKG_INFO_H__ */
5537 /**
5538  * @}
5539  * @}
5540  */
5541