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