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