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