4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
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>
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
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
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
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 /** String property for filtering based on package info*/
96 #define PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
116 /** Boolean property for filtering based on package info*/
117 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
119 /** Integer property for filtering based on package info*/
120 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
148 /** String property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
151 /** Integer property for filtering app support mode */
152 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
174 /** Boolean property for filtering based on app info*/
175 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
177 /** will be updated*/
178 /** string property for filtering based on pkg info*/
179 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
181 /* For multiuser support */
182 const char *getIconPath(uid_t uid, bool readonly);
183 char *getUserPkgParserDBPath(void);
184 char *getUserPkgParserDBPathUID(uid_t uid);
185 char *getUserPkgCertDBPath(void);
186 const char *getUserManifestPath(uid_t uid, bool readonly);
189 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
190 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
191 * @brief This API gets list of installed packages
193 * @par This API is for package-manager client application
194 * @par Sync (or) Async : Synchronous API
195 * @param[in] pkg_list_cb iteration function for list
196 * @param[in] user_data user data to be passed to callback function
197 * @param[in] uid the addressee user id of the instruction
198 * @return 0 if success, error code(<0) if fail
199 * @retval PMINFO_R_OK success
200 * @retval PMINFO_R_EINVAL invalid argument
201 * @retval PMINFO_R_ERROR internal error
205 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
209 pkgid1 = (char *)user_data;
210 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
211 if (strcmp(pkgid1, pkgid2) == 0) {
218 static int list_pkgs()
221 char *name = "helloworld";
222 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
223 if (ret != PMINFO_R_OK) {
230 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
231 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
234 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
235 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
236 * @brief This API gets list of disabled packages
238 * @par This API is for package-manager client application
239 * @par Sync (or) Async : Synchronous API
240 * @param[in] pkg_list_cb iteration function for list
241 * @param[in] user_data user data to be passed to callback function
242 * @param[in] uid the addressee user id of the instruction
243 * @return 0 if success, error code(<0) if fail
244 * @retval PMINFO_R_OK success
245 * @retval PMINFO_R_EINVAL invalid argument
246 * @retval PMINFO_R_ERROR internal error
250 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
251 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
254 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
255 * @brief This API creates the package information handle from db which is not disabled
257 * @par This API is for package-manager client application
258 * @par Sync (or) Async : Synchronous API
260 * @param[in] pkgid pointer to package ID
261 * @param[in] uid the addressee user id of the instruction
262 * @param[out] handle pointer to the package info handle.
263 * @return 0 if success, error code(<0) if fail
264 * @retval PMINFO_R_OK success
265 * @retval PMINFO_R_EINVAL invalid argument
266 * @retval PMINFO_R_ERROR internal error
268 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
269 * @see pkgmgrinfo_pkginfo_get_pkgid()
270 * @see pkgmgrinfo_pkginfo_is_removable()
272 static int get_pkg_type(const char *pkgid)
276 pkgmgrinfo_pkginfo_h handle;
277 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
278 if (ret != PMINFO_R_OK)
280 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
281 if (ret != PMINFO_R_OK) {
282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285 printf("pkgtype: %s\n", type);
286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
291 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
292 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
295 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
296 * @brief This API creates the disabled package information handle from db
298 * @par This API is for package-manager client application
299 * @par Sync (or) Async : Synchronous API
301 * @param[in] pkgid pointer to package ID
302 * @param[in] uid the addressee user id of the instruction
303 * @param[out] handle pointer to the package info handle.
304 * @return 0 if success, error code(<0) if fail
305 * @retval PMINFO_R_OK success
306 * @retval PMINFO_R_EINVAL invalid argument
307 * @retval PMINFO_R_ERROR internal error
309 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
310 * @see pkgmgrinfo_pkginfo_get_pkginfo()
312 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
313 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
316 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
317 * @brief This API creates the package information handle from db regardless of its disable or storage status
319 * @par This API is for package-manager client application
320 * @par Sync (or) Async : Synchronous API
322 * @param[in] pkgid pointer to package ID
323 * @param[in] uid the addressee user id of the instruction
324 * @param[out] handle pointer to the package info handle.
325 * @return 0 if success, error code(<0) if fail
326 * @retval PMINFO_R_OK success
327 * @retval PMINFO_R_EINVAL invalid argument
328 * @retval PMINFO_R_ERROR internal error
330 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
331 * @see pkgmgrinfo_pkginfo_get_pkgid()
332 * @see pkgmgrinfo_pkginfo_is_removable()
334 static int get_pkg_type(const char *pkgid)
338 pkgmgrinfo_pkginfo_h handle;
339 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
340 if (ret != PMINFO_R_OK)
342 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
343 if (ret != PMINFO_R_OK) {
344 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347 printf("pkgtype: %s\n", type);
348 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
353 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
354 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
357 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
358 * @brief This API gets the package name from the package ID
360 * @par This API is for package-manager client application
361 * @par Sync (or) Async : Synchronous API
363 * @param[in] handle pointer to package info handle
364 * @param[out] pkg_name pointer to hold package name
365 * @return 0 if success, error code(<0) if fail
366 * @retval PMINFO_R_OK success
367 * @retval PMINFO_R_EINVAL invalid argument
368 * @retval PMINFO_R_ERROR internal error
369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
371 * @see pkgmgrinfo_pkginfo_get_type()
372 * @see pkgmgrinfo_pkginfo_is_removable()
374 static int get_pkg_name(const char *pkgid)
377 char *pkgname = NULL;
378 pkgmgrinfo_pkginfo_h handle;
379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
380 if (ret != PMINFO_R_OK)
382 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
383 if (ret != PMINFO_R_OK) {
384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
387 printf("pkgname: %s\n", pkgname);
388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
393 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
396 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
397 * @brief This API gets the package id from the package ID
399 * @par This API is for package-manager client application
400 * @par Sync (or) Async : Synchronous API
402 * @param[in] handle pointer to package info handle
403 * @param[out] pkgid pointer to hold package id
404 * @return 0 if success, error code(<0) if fail
405 * @retval PMINFO_R_OK success
406 * @retval PMINFO_R_EINVAL invalid argument
407 * @retval PMINFO_R_ERROR internal error
408 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
410 * @see pkgmgrinfo_pkginfo_get_type()
411 * @see pkgmgrinfo_pkginfo_is_removable()
413 static int get_pkgid(const char *pkgid)
417 pkgmgrinfo_pkginfo_h handle;
418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419 if (ret != PMINFO_R_OK)
421 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
422 if (ret != PMINFO_R_OK) {
423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426 printf("pkg id: %s\n", pkg_id);
427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
432 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
435 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
436 * @brief This API gets the package type from the package ID
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] handle pointer to package info handle
442 * @param[out] type pointer to hold package type
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_pkgid()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_type(const char *pkgid)
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgtype: %s\n", type);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
474 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
475 * @brief This API gets the package version from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] version pointer to hold package version
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_pkgid()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkg_version(const char *pkgid)
494 char *version = NULL;
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkg version: %s\n", version);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
513 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
514 * @brief This API gets the package api_version from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] api_version pointer to hold package api_version
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_pkgid()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkg_api_version(const char *pkgid)
533 char *api_version = NULL;
534 pkgmgrinfo_pkginfo_h handle = NULL;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkg api_version: %s\n", api_version);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
552 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
553 * @brief This API gets tep(tizen expansion package) file name associated with the package
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to the pkginfo handle.
559 * @param[out] tep_name pointer to hold tep name
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
568 static int get_tep_name(const char *pkgid)
571 char *tep_name = NULL;
572 pkgmgrinfo_pkginfo_h handle = NULL;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("TEP name is: %s\n", tep_name);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
590 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
591 * @brief This API gets package mount point path associated with the package
592 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to the pkginfo handle.
598 * @param[out] zip_mount_file pointer to hold zip mount file
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
607 static int get_zip_mount_file(const char *pkgid)
610 char *zip_mount_file = NULL;
611 pkgmgrinfo_pkginfo_h handle = NULL;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 if (zip_mount_file != NULL)
621 printf("Zip mount path is: %s\n", zip_mount_file);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
630 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
631 * @brief This API gets package external image path associated with the package
632 * if package is installed in external storage.
633 * Otherwise, the return value will be PMINFO_R_ENOENT.
635 * @par This API is for package-manager client application
636 * @par Sync (or) Async : Synchronous API
638 * @param[in] handle pointer to the pkginfo handle.
639 * @param[out] ext_image_path pointer to hold external image path
640 * @return 0 if success, error code(<0) if fail
641 * @retval PMINFO_R_OK success
642 * @retval PMINFO_R_EINVAL invalid argument
643 * @retval PMINFO_R_ERROR internal error
644 * @revall PMINFO_R_ENOENT no valid data
645 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
646 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
647 * @see pkgmgrinfo_pkginfo_get_pkgid()
649 static int get_external_image_path(const char *pkgid)
652 char *ext_image_path = NULL;
653 pkgmgrinfo_pkginfo_h handle = NULL;
654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655 if (ret != PMINFO_R_OK)
657 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
658 if (ret != PMINFO_R_OK) {
659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662 printf("external image path is: %s\n", ext_image_path);
663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
668 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
671 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
672 * @brief This API gets the package install location from the package ID
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] location pointer to hold package install location
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
683 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
684 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
685 * @see pkgmgrinfo_pkginfo_get_pkgid()
686 * @see pkgmgrinfo_pkginfo_is_removable()
688 static int get_pkg_install_location(const char *pkgid)
691 pkgmgrinfo_install_location location;
692 pkgmgrinfo_pkginfo_h handle;
693 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
694 if (ret != PMINFO_R_OK)
696 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
697 if (ret != PMINFO_R_OK) {
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701 printf("pkg install location: %d\n", location);
702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
707 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
710 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
711 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
712 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
713 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
715 * @par This API is for package-manager client application
716 * @par Sync (or) Async : Synchronous API
718 * @param[in] handle pointer to package info handle
719 * @param[out] size pointer to hold package size
720 * @return 0 if success, error code(<0) if fail
721 * @retval PMINFO_R_OK success
722 * @retval PMINFO_R_EINVAL invalid argument
723 * @retval PMINFO_R_ERROR internal error
724 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
725 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
726 * @see pkgmgrinfo_pkginfo_get_pkgid()
727 * @see pkgmgrinfo_pkginfo_is_removable()
729 static int get_pkg_size(const char *pkgid)
733 pkgmgrinfo_pkginfo_h handle;
734 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
735 if (ret != PMINFO_R_OK)
737 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
738 if (ret != PMINFO_R_OK) {
739 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742 printf("pkgsize: %d\n", size);
743 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
748 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
751 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
752 * @brief This API gets the package icon from the package ID
754 * @par This API is for package-manager client application
755 * @par Sync (or) Async : Synchronous API
757 * @param[in] handle pointer to package info handle
758 * @param[out] icon pointer to hold package icon
759 * @return 0 if success, error code(<0) if fail
760 * @retval PMINFO_R_OK success
761 * @retval PMINFO_R_EINVAL invalid argument
762 * @retval PMINFO_R_ERROR internal error
763 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
764 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
765 * @see pkgmgrinfo_pkginfo_get_pkgid()
766 * @see pkgmgrinfo_pkginfo_is_removable()
768 static int get_pkg_icon(const char *pkgid)
772 pkgmgrinfo_pkginfo_h handle;
773 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
774 if (ret != PMINFO_R_OK)
776 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
777 if (ret != PMINFO_R_OK) {
778 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
781 printf("pkg icon: %s\n", icon);
782 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
787 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
790 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
791 * @brief This API gets the package label from the package ID
793 * @par This API is for package-manager client application
794 * @par Sync (or) Async : Synchronous API
796 * @param[in] handle pointer to package info handle
797 * @param[out] label pointer to hold package label
798 * @return 0 if success, error code(<0) if fail
799 * @retval PMINFO_R_OK success
800 * @retval PMINFO_R_EINVAL invalid argument
801 * @retval PMINFO_R_ERROR internal error
802 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
803 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
804 * @see pkgmgrinfo_pkginfo_get_pkgid()
805 * @see pkgmgrinfo_pkginfo_is_removable()
807 static int get_pkg_label(const char *pkgid)
811 pkgmgrinfo_pkginfo_h handle;
812 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
813 if (ret != PMINFO_R_OK)
815 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
816 if (ret != PMINFO_R_OK) {
817 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
820 printf("pkg label: %s\n", label);
821 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
826 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
829 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
830 * @brief This API gets the package description from the package ID
832 * @par This API is for package-manager client application
833 * @par Sync (or) Async : Synchronous API
835 * @param[in] handle pointer to package info handle
836 * @param[out] description pointer to hold package description
837 * @return 0 if success, error code(<0) if fail
838 * @retval PMINFO_R_OK success
839 * @retval PMINFO_R_EINVAL invalid argument
840 * @retval PMINFO_R_ERROR internal error
841 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
842 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
843 * @see pkgmgrinfo_pkginfo_get_pkgid()
844 * @see pkgmgrinfo_pkginfo_is_removable()
846 static int get_pkg_description(const char *pkgid)
849 char *description = NULL;
850 pkgmgrinfo_pkginfo_h handle;
851 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
852 if (ret != PMINFO_R_OK)
854 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
855 if (ret != PMINFO_R_OK) {
856 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
859 printf("pkg description: %s\n", description);
860 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
865 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
868 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
869 * @brief This API gets the package's author name from the package ID
871 * @par This API is for package-manager client application
872 * @par Sync (or) Async : Synchronous API
874 * @param[in] handle pointer to package info handle
875 * @param[out] author_name pointer to hold package author name
876 * @return 0 if success, error code(<0) if fail
877 * @retval PMINFO_R_OK success
878 * @retval PMINFO_R_EINVAL invalid argument
879 * @retval PMINFO_R_ERROR internal error
880 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
881 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
882 * @see pkgmgrinfo_pkginfo_get_pkgid()
883 * @see pkgmgrinfo_pkginfo_is_removable()
885 static int get_pkg_author_name(const char *pkgid)
888 char *author_name = NULL;
889 pkgmgrinfo_pkginfo_h handle;
890 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
891 if (ret != PMINFO_R_OK)
893 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
894 if (ret != PMINFO_R_OK) {
895 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
898 printf("pkg author name: %s\n", author_name);
899 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
904 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
907 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
908 * @brief This API gets the package's author email from the package ID
910 * @par This API is for package-manager client application
911 * @par Sync (or) Async : Synchronous API
913 * @param[in] handle pointer to package info handle
914 * @param[out] author_email pointer to hold package author email
915 * @return 0 if success, error code(<0) if fail
916 * @retval PMINFO_R_OK success
917 * @retval PMINFO_R_EINVAL invalid argument
918 * @retval PMINFO_R_ERROR internal error
919 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
920 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
921 * @see pkgmgrinfo_pkginfo_get_pkgid()
922 * @see pkgmgrinfo_pkginfo_is_removable()
924 static int get_pkg_author_email(const char *pkgid)
927 char *author_email = NULL;
928 pkgmgrinfo_pkginfo_h handle;
929 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
930 if (ret != PMINFO_R_OK)
932 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
933 if (ret != PMINFO_R_OK) {
934 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
937 printf("pkg author email: %s\n", author_email);
938 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
943 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
946 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
947 * @brief This API gets the package's author href from the package ID
949 * @par This API is for package-manager client application
950 * @par Sync (or) Async : Synchronous API
952 * @param[in] handle pointer to package info handle
953 * @param[out] author_href pointer to hold package author href
954 * @return 0 if success, error code(<0) if fail
955 * @retval PMINFO_R_OK success
956 * @retval PMINFO_R_EINVAL invalid argument
957 * @retval PMINFO_R_ERROR internal error
958 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
959 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
960 * @see pkgmgrinfo_pkginfo_get_pkgid()
961 * @see pkgmgrinfo_pkginfo_is_removable()
963 static int get_pkg_author_href(const char *pkgid)
966 char *author_href = NULL;
967 pkgmgrinfo_pkginfo_h handle;
968 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
969 if (ret != PMINFO_R_OK)
971 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
972 if (ret != PMINFO_R_OK) {
973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
976 printf("pkg author href: %s\n", author_href);
977 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
982 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
985 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
986 * @brief This API gets the package installed storagae value from the package ID
988 * @par This API is for package-manager client application
989 * @par Sync (or) Async : Synchronous API
991 * @param[in] handle pointer to package info handle
992 * @param[out] storage pointer to hold package installed storage
993 * @return 0 if success, error code(<0) if fail
994 * @retval PMINFO_R_OK success
995 * @retval PMINFO_R_EINVAL invalid argument
996 * @retval PMINFO_R_ERROR internal error
997 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
998 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
999 * @see pkgmgrinfo_pkginfo_get_pkgid()
1000 * @see pkgmgrinfo_pkginfo_is_removable()
1002 static int get_pkg_installed_storage(const char *pkgid)
1005 pkgmgrinfo_installed_storage storage;
1006 pkgmgrinfo_pkginfo_h handle;
1007 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1008 if (ret != PMINFO_R_OK)
1010 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1011 if (ret != PMINFO_R_OK) {
1012 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1015 printf("pkg installed storage: %d\n", storage);
1016 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1021 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1024 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1025 * @brief This API gets the installed time of package from the package ID
1027 * @par This API is for package-manager client application
1028 * @par Sync (or) Async : Synchronous API
1030 * @param[in] handle pointer to package info handle
1031 * @param[out] installed_time pointer to hold installed time of package
1032 * @return 0 if success, error code(<0) if fail
1033 * @retval PMINFO_R_OK success
1034 * @retval PMINFO_R_EINVAL invalid argument
1035 * @retval PMINFO_R_ERROR internal error
1036 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1037 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1038 * @see pkgmgrinfo_pkginfo_get_pkgid()
1039 * @see pkgmgrinfo_pkginfo_is_removable()
1041 static int get_pkg_installed_time(const char *pkgid)
1044 int installed_time = 0;
1045 pkgmgrinfo_pkginfo_h handle;
1046 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1047 if (ret != PMINFO_R_OK)
1049 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1050 if (ret != PMINFO_R_OK) {
1051 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1054 printf("installed_time: %d\n", installed_time);
1055 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1060 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1063 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1064 * @brief This API creates the update info handle
1066 * @par This API is for package-manager client application
1067 * @par Sync (or) Async : Synchronous API
1069 * @param[out] handle pointer to package update info handle
1070 * @return 0 if success, error code(<0) if fail
1071 * @retval PMINFO_R_OK success
1072 * @retval PMINFO_R_EINVAL invalid argument
1073 * @retval PMINFO_R_ERROR internal error
1074 * @post pkgmgrinfo_updateinfo_destroy()
1075 * @see pkgmgrinfo_updateinfo_set_pkgid()
1076 * @see pkgmgrinfo_updateinfo_set_version()
1077 * @see pkgmgrinfo_updateinfo_set_type()
1078 * @see pkgmgr_client_register_pkg_updateinfo()
1080 static int updateinfo_handle_create()
1084 pkgmgrinfo_updateinfo_h handle;
1085 ret = pkgmgrinfo_updateinfo_create(&handle);
1086 if (ret != PMINFO_R_OK)
1088 pkgmgrinfo_update_infodestroy(handle);
1093 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1096 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1097 * @brief This API destroy the update info handle
1099 * @par This API is for package-manager client application
1100 * @par Sync (or) Async : Synchronous API
1102 * @param[in] handle pointer to package update info handle
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @pre pkgmgrinfo_updateinfo_create()
1107 * @see pkgmgr_client_register_pkg_updateinfo()
1109 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1113 ret = pkgmgrinfo_updateinfo_destroy(handle);
1114 if (ret != PMINFO_R_OK)
1120 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1123 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1124 * @brief This API creates the package update information handle from db
1126 * @par This API is for package-manager client application
1127 * @par Sync (or) Async : Synchronous API
1129 * @param[in] pkgid pointer to package ID
1130 * @param[in] uid the addressee user id of the instruction
1131 * @param[out] update_handle pointer to the package update info handle.
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1137 * @post pkgmgrinfo_updateinfo_destroy()
1138 * @see pkgmgrinfo_updateinfo_get_pkgid()
1139 * @see pkgmgrinfo_updateinfo_get_version()
1140 * @see pkgmgrinfo_updateinfo_get_update_type()
1142 static int get_pkg_update_info(const char *pkgid)
1146 pkgmgrinfo_updateinfo_h handle;
1147 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1148 if (ret != PMINFO_R_OK)
1150 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1151 if (ret != PMINFO_R_OK) {
1152 pkgmgrinfo_updateinfo_destroy(handle);
1155 printf("pkg update version: %s\n", version
1156 pkgmgrinfo_updateinfo_destroy(handle);
1161 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1162 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1165 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1166 * @brief This API sets given pkgid into handle
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package update info handle
1172 * @param[in] pkgid package id
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1178 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1182 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1183 if (ret != PMINFO_R_OK)
1189 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1192 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1193 * @brief This API sets given version into handle
1195 * @par This API is for package-manager client application
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package update info handle
1199 * @param[in] version update version
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1205 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1209 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1210 if (ret != PMINFO_R_OK)
1216 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1219 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1220 * @brief This API sets given update type into handle
1222 * @par This API is for package-manager client application
1223 * @par Sync (or) Async : Synchronous API
1225 * @param[in] handle pointer to package update info handle
1226 * @param[in] type update type
1227 * @return 0 if success, error code(<0) if fail
1228 * @retval PMINFO_R_OK success
1229 * @retval PMINFO_R_EINVAL invalid argument
1230 * @retval PMINFO_R_ERROR internal error
1232 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1236 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1237 if (ret != PMINFO_R_OK)
1243 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1246 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1247 * @brief This API retrieves the pkgid from given update info
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] handle pointer to package update info handle
1253 * @param[out] pkgid package id
1254 * @return 0 if success, error code(<0) if fail
1255 * @retval PMINFO_R_OK success
1256 * @retval PMINFO_R_EINVAL invalid argument
1257 * @retval PMINFO_R_ERROR internal error
1259 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1264 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1265 if (ret != PMINFO_R_OK)
1271 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1274 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1275 * @brief This API retrieves the version from given update info
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] handle pointer to package update info handle
1281 * @param[out] version update version
1282 * @return 0 if success, error code(<0) if fail
1283 * @retval PMINFO_R_OK success
1284 * @retval PMINFO_R_EINVAL invalid argument
1285 * @retval PMINFO_R_ERROR internal error
1287 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1292 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1293 if (ret != PMINFO_R_OK)
1299 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1302 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1303 * @brief This API retrieves the update type from given update info
1305 * @par This API is for package-manager client application
1306 * @par Sync (or) Async : Synchronous API
1308 * @param[in] handle pointer to package update info handle
1309 * @param[out] type update type
1310 * @return 0 if success, error code(<0) if fail
1311 * @retval PMINFO_R_OK success
1312 * @retval PMINFO_R_EINVAL invalid argument
1313 * @retval PMINFO_R_ERROR internal error
1315 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1318 pkgmgrinfo_updateinfo_update_type *type;
1320 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1321 if (ret != PMINFO_R_OK)
1327 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1331 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1332 * @brief This API retrieve the update informations and invoke given callback for it.
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] callback callback to be invoked for each retrieved informations
1338 * @param[in] user_data user data to be passed to callback
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1344 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1348 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1349 if (ret != PMINFO_R_OK)
1355 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1359 * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1360 * @brief This API checkes whether given plugin had been executed with given package ID and application ID or not.
1362 * @par This API is for package-manager client application
1363 * @par Sync (or) Async : Synchronous API
1365 * @param[in] pkgid package ID
1366 * @param[in] appid application ID
1367 * @param[in] plugin_type plugin type to be checked
1368 * @param[in] plugin_name plugin name to be checked
1369 * @param[out] is_executed check result
1370 * @return 0 if success, error code(<0) if fail
1371 * @retval PMINFO_R_OK success
1372 * @retval PMINFO_R_EINVAL invalid argument
1373 * @retval PMINFO_R_ERROR internal error
1375 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1380 ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1381 if (ret != PMINFO_R_OK)
1383 printf("is checked is [%d]\n", is_executed);
1388 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1389 const char *plugin_type, const char *plugin_name, bool *is_executed);
1392 * @fn int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1393 * @brief This API retrieve the previous plugin execution info and invoke callbacks each of it.
1395 * @par This API is for package-manager client application
1396 * @par Sync (or) Async : Synchronous API
1398 * @param[in] pkgid package ID
1399 * @param[in] plugin_type type of plugin
1400 * @param[in] plugin_name name of plugin
1401 * @param[in] plugin_list_cb callback to be invoked for each plugin execution info
1402 * @param[out] user_data user data to be passed to callback
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1408 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1412 ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1413 if (ret != PMINFO_R_OK)
1419 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1420 const char *plugin_type, const char *plugin_name,
1421 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1424 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1425 * @brief This API gets the launch mode of package from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] mode pointer to hold launch mode of package
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1439 * @see pkgmgrinfo_pkginfo_is_removable()
1441 static int get_pkg_launch_mode(const char *pkgid)
1444 char *launch_mode = NULL;
1445 pkgmgrinfo_pkginfo_h handle;
1446 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1447 if (ret != PMINFO_R_OK)
1449 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1450 if (ret != PMINFO_R_OK) {
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 printf("launch mode: %s\n", mode);
1455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1460 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1463 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1464 * @brief This API gets the store client id of package from the package ID
1466 * @par This API is for package-manager client application
1467 * @par Sync (or) Async : Synchronous API
1469 * @param[in] handle pointer to package info handle
1470 * @param[out] storeclientid pointer to hold store client id of package
1471 * @return 0 if success, error code(<0) if fail
1472 * @retval PMINFO_R_OK success
1473 * @retval PMINFO_R_EINVAL invalid argument
1474 * @retval PMINFO_R_ERROR internal error
1475 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1476 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1477 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 * @see pkgmgrinfo_pkginfo_is_removable()
1480 static int get_pkg_storeclientid(const char *pkgid)
1483 char *storeclientid = 0;
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf(store client id: %s\n", storeclientid);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1502 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1503 * @brief This API gets the main app id of package from the package ID
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[out] mainappid pointer to hold main app id of package
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1517 * @see pkgmgrinfo_pkginfo_is_removable()
1519 static int get_pkg_mainappid(const char *pkgid)
1522 char *mainappid = 0;
1523 pkgmgrinfo_pkginfo_h handle;
1524 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1525 if (ret != PMINFO_R_OK)
1527 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1528 if (ret != PMINFO_R_OK) {
1529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1532 printf(main app id: %s\n", mainappid);
1533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1541 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1542 * @brief This API gets the url of package from the package ID
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[in] handle pointer to package info handle
1548 * @param[out] url pointer to hold url of package
1549 * @return 0 if success, error code(<0) if fail
1550 * @retval PMINFO_R_OK success
1551 * @retval PMINFO_R_EINVAL invalid argument
1552 * @retval PMINFO_R_ERROR internal error
1553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1555 * @see pkgmgrinfo_pkginfo_get_pkgid()
1556 * @see pkgmgrinfo_pkginfo_is_removable()
1558 static int get_pkg_url(const char *pkgid)
1562 pkgmgrinfo_pkginfo_h handle;
1563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1564 if (ret != PMINFO_R_OK)
1566 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571 printf("url : %s\n", url);
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1580 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1581 * @brief This API gets the root path of package
1583 * @par Sync (or) Async : Synchronous API
1585 * @param[in] handle pointer to package info handle
1586 * @param[out] path pointer to hold root path of package
1587 * @return 0 if success, error code(<0) if fail
1588 * @retval PMINFO_R_OK success
1589 * @retval PMINFO_R_EINVAL invalid argument
1590 * @retval PMINFO_R_ERROR internal error
1592 static int get_root_path(const char *pkgid)
1596 pkgmgrinfo_pkginfo_h handle;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1601 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1602 if (ret != PMINFO_R_OK) {
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1606 printf("path : %s\n", path);
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1617 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1618 * @brief This API gets the csc path of package
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to package info handle
1623 * @param[out] path pointer to hold csc path of package
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1629 static int get_csc_path(const char *pkgid)
1633 pkgmgrinfo_pkginfo_h handle;
1634 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1635 if (ret != PMINFO_R_OK)
1638 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1639 if (ret != PMINFO_R_OK) {
1640 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643 printf("path : %s\n", path);
1644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1653 * @fn int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type)
1654 * @brief This API gets the resource type of package
1656 * @par Sync (or) Async : Synchronous API
1658 * @param[in] handle pointer to package info handle
1659 * @param[out] res_type pointer to hold resource type of package
1660 * @return 0 if success, error code(<0) if fail
1661 * @retval PMINFO_R_OK success
1662 * @retval PMINFO_R_EINVAL invalid argument
1663 * @retval PMINFO_R_ERROR internal error
1665 static int get_res_type(const char *pkgid)
1669 pkgmgrinfo_pkginfo_h handle;
1670 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1671 if (ret != PMINFO_R_OK)
1674 ret = pkgmgrinfo_pkginfo_get_res_type(handle, &res_type);
1675 if (ret != PMINFO_R_OK) {
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 printf("res_type : %s\n", res_type);
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1686 int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type);
1689 * @fn int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version)
1690 * @brief This API gets the resource version of package
1692 * @par Sync (or) Async : Synchronous API
1694 * @param[in] handle pointer to package info handle
1695 * @param[out] res_version pointer to hold resource version of package
1696 * @return 0 if success, error code(<0) if fail
1697 * @retval PMINFO_R_OK success
1698 * @retval PMINFO_R_EINVAL invalid argument
1699 * @retval PMINFO_R_ERROR internal error
1701 static int get_res_version(const char *pkgid)
1704 char *res_version = 0;
1705 pkgmgrinfo_pkginfo_h handle;
1706 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1707 if (ret != PMINFO_R_OK)
1710 ret = pkgmgrinfo_pkginfo_get_res_version(handle, &res_version);
1711 if (ret != PMINFO_R_OK) {
1712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1715 printf("res_version : %s\n", res_version);
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1722 int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version);
1725 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1726 * @brief This API gets the support_mode of package
1728 * @par Sync (or) Async : Synchronous API
1730 * @param[in] handle pointer to package info handle
1731 * @param[out] support_mode pointer to hold support_mode of package
1732 * @return 0 if success, error code(<0) if fail
1733 * @retval PMINFO_R_OK success
1734 * @retval PMINFO_R_EINVAL invalid argument
1735 * @retval PMINFO_R_ERROR internal error
1737 static int get_support_mode(const char *pkgid)
1740 int support_mode = 0;
1741 pkgmgrinfo_pkginfo_h handle = NULL;
1742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1743 if (ret != PMINFO_R_OK)
1746 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1747 if (ret != PMINFO_R_OK) {
1748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1751 printf("support_mode : %s\n", support_mode);
1752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1758 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1761 * @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)
1762 * @brief This API compare the cert information from given package id
1764 * @par This API is for package-manager client application
1765 * @par Sync (or) Async : Synchronous API
1767 * @param[in] lhs_package_id pointer to first package ID
1768 * @param[in] rhs_package_id pointer to second package ID
1769 * @param[out] compare_result pointer to the compare result.
1770 * @return 0 if success, error code(<0) if fail
1771 * @retval PMINFO_R_OK success
1772 * @retval PMINFO_R_EINVAL invalid argument
1773 * @retval PMINFO_R_ERROR internal error
1775 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1776 * @see pkgmgrinfo_pkginfo_get_pkgid()
1777 * @see pkgmgrinfo_pkginfo_is_removable()
1779 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1782 pkgmgrinfo_cert_compare_result_type_e result;
1784 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1785 if (ret != PMINFO_R_OK) {
1788 printf("result: %d\n", result);
1793 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);
1794 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);
1796 * @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)
1797 * @brief This API compare the cert information from given app id
1799 * @par This API is for package-manager client application
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] lhs_app_id pointer to first app ID
1803 * @param[in] rhs_app_id pointer to second app ID
1804 * @param[out] compare_result pointer to the compare result.
1805 * @return 0 if success, error code(<0) if fail
1806 * @retval PMINFO_R_OK success
1807 * @retval PMINFO_R_EINVAL invalid argument
1808 * @retval PMINFO_R_ERROR internal error
1810 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1811 * @see pkgmgrinfo_pkginfo_get_pkgid()
1812 * @see pkgmgrinfo_pkginfo_is_removable()
1814 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1817 pkgmgrinfo_cert_compare_result_type_e result;
1819 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1820 if (ret != PMINFO_R_OK) {
1823 printf("result: %d\n", result);
1828 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);
1829 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);
1831 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1832 * @brief This API gets the package 'removable' value from the package ID
1834 * @par This API is for package-manager client application
1835 * @par Sync (or) Async : Synchronous API
1837 * @param[in] handle pointer to package info handle
1838 * @param[out] removable pointer to hold package removable value
1839 * @return 0 if success, error code(<0) if fail
1840 * @retval PMINFO_R_OK success
1841 * @retval PMINFO_R_EINVAL invalid argument
1842 * @retval PMINFO_R_ERROR internal error
1843 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1844 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1845 * @see pkgmgrinfo_pkginfo_get_pkgid()
1846 * @see pkgmgrinfo_pkginfo_is_readonly()
1848 static int get_pkg_removable(const char *pkgid)
1852 pkgmgrinfo_pkginfo_h handle;
1853 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1854 if (ret != PMINFO_R_OK)
1856 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1857 if (ret != PMINFO_R_OK) {
1858 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1861 printf("pkg removable: %d\n", removable);
1862 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1867 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1870 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1871 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1873 * @par This API is for package-manager client application
1874 * @par Sync (or) Async : Synchronous API
1876 * @param[in] handle pointer to package info handle
1877 * @param[out] movable pointer to hold package movable state
1878 * @return 0 if success, error code(<0) if fail
1879 * @retval PMINFO_R_OK success
1880 * @retval PMINFO_R_EINVAL invalid argument
1881 * @retval PMINFO_R_ERROR internal error
1882 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1883 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1884 * @see pkgmgrinfo_pkginfo_get_pkgid()
1886 static int get_pkg_movable(const char *pkgid)
1890 pkgmgrinfo_pkginfo_h handle;
1891 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1892 if (ret != PMINFO_R_OK)
1894 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1895 if (ret != PMINFO_R_OK) {
1896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1899 printf("pkg movable: %d\n", movable);
1900 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1905 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1908 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1909 * @brief This API gets the package 'preload' value from the package ID
1911 * @par This API is for package-manager client application
1912 * @par Sync (or) Async : Synchronous API
1914 * @param[in] handle pointer to package info handle
1915 * @param[out] preload pointer to hold package preload value
1916 * @return 0 if success, error code(<0) if fail
1917 * @retval PMINFO_R_OK success
1918 * @retval PMINFO_R_EINVAL invalid argument
1919 * @retval PMINFO_R_ERROR internal error
1920 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1921 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1922 * @see pkgmgrinfo_pkginfo_get_pkgid()
1923 * @see pkgmgrinfo_pkginfo_is_readonly()
1925 static int get_pkg_preload(const char *pkgid)
1929 pkgmgrinfo_pkginfo_h handle;
1930 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1931 if (ret != PMINFO_R_OK)
1933 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1934 if (ret != PMINFO_R_OK) {
1935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1938 printf("pkg preload: %d\n", preload);
1939 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1944 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1947 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1948 * @brief This API gets the value for given handle is system or not
1950 * @par This API is for package-manager client application
1951 * @par Sync (or) Async : Synchronous API
1953 * @param[in] handle pointer to package info handle
1954 * @param[out] system pointer to hold system is or not
1955 * @return 0 if success, error code(<0) if fail
1956 * @retval PMINFO_R_OK success
1957 * @retval PMINFO_R_EINVAL invalid argument
1958 * @retval PMINFO_R_ERROR internal error
1959 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1960 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1961 * @see pkgmgrinfo_pkginfo_get_pkgid()
1962 * @see pkgmgrinfo_pkginfo_is_readonly()
1964 static int get_pkg_system(const char *pkgid)
1967 bool system = false;
1968 pkgmgrinfo_pkginfo_h handle = NULL;
1969 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1970 if (ret != PMINFO_R_OK)
1972 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1973 if (ret != PMINFO_R_OK) {
1974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1977 printf("pkg system: %d\n", system);
1978 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1983 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1986 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1987 * @brief This API gets the package 'readonly' value from the package ID
1989 * @par This API is for package-manager client application
1990 * @par Sync (or) Async : Synchronous API
1992 * @param[in] handle pointer to package info handle
1993 * @param[out] readonly pointer to hold package readonly value
1994 * @return 0 if success, error code(<0) if fail
1995 * @retval PMINFO_R_OK success
1996 * @retval PMINFO_R_EINVAL invalid argument
1997 * @retval PMINFO_R_ERROR internal error
1998 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1999 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2000 * @see pkgmgrinfo_pkginfo_get_pkgid()
2001 * @see pkgmgrinfo_pkginfo_is_removable()
2003 static int get_pkg_readonly(const char *pkgid)
2007 pkgmgrinfo_pkginfo_h handle;
2008 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2009 if (ret != PMINFO_R_OK)
2011 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2012 if (ret != PMINFO_R_OK) {
2013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2016 printf("pkg readonly: %d\n", readonly);
2017 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2022 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2026 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2027 * @brief This API gets the package 'update' value from the package ID
2029 * @par This API is for package-manager client application
2030 * @par Sync (or) Async : Synchronous API
2032 * @param[in] handle pointer to package info handle
2033 * @param[out] update pointer to hold package update value
2034 * @return 0 if success, error code(<0) if fail
2035 * @retval PMINFO_R_OK success
2036 * @retval PMINFO_R_EINVAL invalid argument
2037 * @retval PMINFO_R_ERROR internal error
2038 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2039 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2040 * @see pkgmgrinfo_pkginfo_get_pkgid()
2042 static int get_pkg_update(const char *pkgid)
2046 pkgmgrinfo_pkginfo_h handle;
2047 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2048 if (ret != PMINFO_R_OK)
2050 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2051 if (ret != PMINFO_R_OK) {
2052 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2055 printf("pkg update: %d\n", update);
2056 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2061 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2064 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2065 * @brief This API gets the package 'support_disable' value from the package ID
2067 * @par This API is for package-manager client application
2068 * @par Sync (or) Async : Synchronous API
2070 * @param[in] handle pointer to package info handle
2071 * @param[out] support_disable pointer to hold package support_disable value
2072 * @return 0 if success, error code(<0) if fail
2073 * @retval PMINFO_R_OK success
2074 * @retval PMINFO_R_EINVAL invalid argument
2075 * @retval PMINFO_R_ERROR internal error
2076 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2077 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2078 * @see pkgmgrinfo_pkginfo_get_pkgid()
2080 static int get_pkg_support_disable(const char *pkgid)
2083 bool support_disable;
2084 pkgmgrinfo_pkginfo_h handle = NULL;
2085 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2086 if (ret != PMINFO_R_OK)
2088 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2089 if (ret != PMINFO_R_OK) {
2090 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2093 printf("pkg support_disable: %d\n", support_disable);
2094 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2099 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2102 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2103 * @brief This API gets whether the given package is global package or user package
2105 * @par This API is for package-manager client application
2106 * @par Sync (or) Async : Synchronous API
2108 * @param[in] handle pointer to package info handle
2109 * @param[in] global pointer to hold package global value
2110 * @return 0 if success, error code(<0) if fail
2111 * @retval PMINFO_R_OK success
2112 * @retval PMINFO_R_EINVAL invalid argument
2113 * @retval PMINFO_R_ERROR internal error
2114 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2115 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2116 * @see pkgmgrinfo_pkginfo_get_pkgid()
2117 static int get_pkg_support_disable(const char *pkgid)
2121 pkgmgrinfo_pkginfo_h handle = NULL;
2122 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2123 if (ret != PMINFO_R_OK)
2125 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2126 if (ret != PMINFO_R_OK) {
2127 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2130 printf("pkg is_global: %d\n", global);
2131 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2136 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2139 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2140 * @brief This API gets the package 'accessible' value from the package ID
2142 * @par This API is for package-manager client application
2143 * @par Sync (or) Async : Synchronous API
2145 * @param[in] handle pointer to package info handle
2146 * @param[out] accessible pointer to hold package accessible value
2147 * @return 0 if success, error code(<0) if fail
2148 * @retval PMINFO_R_OK success
2149 * @retval PMINFO_R_EINVAL invalid argument
2150 * @retval PMINFO_R_ERROR internal error
2151 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2152 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2153 * @see pkgmgrinfo_pkginfo_get_pkgid()
2154 * @see pkgmgrinfo_pkginfo_is_readonly()
2156 static int get_pkg_accessible(const char *pkgid)
2160 pkgmgrinfo_pkginfo_h handle;
2161 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2162 if (ret != PMINFO_R_OK)
2164 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2165 if (ret != PMINFO_R_OK) {
2166 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2169 printf("pkg accessible: %d\n", accessible);
2170 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2175 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2178 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2179 * @brief This API destroys the package information handle freeing up all the resources
2181 * @par This API is for package-manager client application
2182 * @par Sync (or) Async : Synchronous API
2184 * @param[in] handle pointer to the package info handle
2185 * @return 0 if success, error code(<0) if fail
2186 * @retval PMINFO_R_OK success
2187 * @retval PMINFO_R_EINVAL invalid argument
2188 * @retval PMINFO_R_ERROR internal error
2189 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2191 * @see pkgmgrinfo_pkginfo_get_pkgid()
2192 * @see pkgmgrinfo_pkginfo_is_removable()
2194 static int get_pkg_type(const char *pkgid)
2198 pkgmgrinfo_pkginfo_h handle;
2199 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2200 if (ret != PMINFO_R_OK)
2202 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2203 if (ret != PMINFO_R_OK) {
2204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2207 printf("pkgtype: %s\n", type);
2208 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2213 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2216 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2217 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2218 The query will search the entire package information collected from the manifest file of all the installed packages
2220 * @par This API is for package-manager client application
2221 * @par Sync (or) Async : Synchronous API
2223 * @param[out] handle pointer to the package info filter handle.
2224 * @return 0 if success, error code(<0) if fail
2225 * @retval PMINFO_R_OK success
2226 * @retval PMINFO_R_EINVAL invalid argument
2227 * @retval PMINFO_R_ERROR internal error
2229 * @post pkgmgrinfo_pkginfo_filter_destroy()
2230 * @see pkgmgrinfo_pkginfo_filter_count()
2231 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2233 static int get_tpk_pkg_count()
2237 pkgmgrinfo_pkginfo_filter_h handle;
2238 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2239 if (ret != PMINFO_R_OK)
2241 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2242 if (ret != PMINFO_R_OK) {
2243 pkgmgrinfo_pkginfo_filter_destroy(handle);
2246 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2247 if (ret != PMINFO_R_OK) {
2248 pkgmgrinfo_pkginfo_filter_destroy(handle);
2251 printf("No of tpk pkgs: %d\n", count);
2252 pkgmgrinfo_pkginfo_filter_destroy(handle);
2257 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2260 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2261 * @brief This API destroys the package information filter handle freeing up all the resources
2263 * @par This API is for package-manager client application
2264 * @par Sync (or) Async : Synchronous API
2266 * @param[in] handle pointer to the package info filter handle.
2267 * @return 0 if success, error code(<0) if fail
2268 * @retval PMINFO_R_OK success
2269 * @retval PMINFO_R_EINVAL invalid argument
2270 * @retval PMINFO_R_ERROR internal error
2271 * @pre pkgmgrinfo_pkginfo_filter_create()
2273 * @see pkgmgrinfo_pkginfo_filter_count()
2274 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2276 static int get_tpk_pkg_count()
2280 pkgmgrinfo_pkginfo_filter_h handle;
2281 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2282 if (ret != PMINFO_R_OK)
2284 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2285 if (ret != PMINFO_R_OK) {
2286 pkgmgrinfo_pkginfo_filter_destroy(handle);
2289 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2290 if (ret != PMINFO_R_OK) {
2291 pkgmgrinfo_pkginfo_filter_destroy(handle);
2294 printf("No of tpk pkgs: %d\n", count);
2295 pkgmgrinfo_pkginfo_filter_destroy(handle);
2300 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2303 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2304 * @brief This API adds a boolean filter property to the filter handle
2306 * @par This API is for package-manager client application
2307 * @par Sync (or) Async : Synchronous API
2309 * @param[in] handle pointer to the package info filter handle.
2310 * @param[in] property boolean property name.
2311 * @param[in] value value corresponding to the property.
2312 * @return 0 if success, error code(<0) if fail
2313 * @retval PMINFO_R_OK success
2314 * @retval PMINFO_R_EINVAL invalid argument
2315 * @retval PMINFO_R_ERROR internal error
2316 * @pre pkgmgrinfo_pkginfo_filter_create()
2317 * @post pkgmgrinfo_pkginfo_filter_destroy()
2318 * @see pkgmgrinfo_pkginfo_filter_count()
2319 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2321 static int get_preload_pkg_count()
2325 pkgmgrinfo_pkginfo_filter_h handle;
2326 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2327 if (ret != PMINFO_R_OK)
2329 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2330 if (ret != PMINFO_R_OK) {
2331 pkgmgrinfo_pkginfo_filter_destroy(handle);
2334 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2335 if (ret != PMINFO_R_OK) {
2336 pkgmgrinfo_pkginfo_filter_destroy(handle);
2339 printf("No of preload pkgs: %d\n", count);
2340 pkgmgrinfo_pkginfo_filter_destroy(handle);
2345 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2346 const char *property, const bool value);
2349 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2350 * @brief This API adds an integer filter property to the filter handle
2352 * @par This API is for package-manager client application
2353 * @par Sync (or) Async : Synchronous API
2355 * @param[in] handle pointer to the package info filter handle.
2356 * @param[in] property integer property name.
2357 * @param[in] value value corresponding to the property.
2358 * @return 0 if success, error code(<0) if fail
2359 * @retval PMINFO_R_OK success
2360 * @retval PMINFO_R_EINVAL invalid argument
2361 * @retval PMINFO_R_ERROR internal error
2362 * @pre pkgmgrinfo_pkginfo_filter_create()
2363 * @post pkgmgrinfo_pkginfo_filter_destroy()
2364 * @see pkgmgrinfo_pkginfo_filter_count()
2365 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2367 static int get_pkg_count()
2371 pkgmgrinfo_pkginfo_filter_h handle;
2372 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2373 if (ret != PMINFO_R_OK)
2375 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2376 if (ret != PMINFO_R_OK) {
2377 pkgmgrinfo_pkginfo_filter_destroy(handle);
2380 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2381 if (ret != PMINFO_R_OK) {
2382 pkgmgrinfo_pkginfo_filter_destroy(handle);
2385 printf("No of preload pkgs: %d\n", count);
2386 pkgmgrinfo_pkginfo_filter_destroy(handle);
2391 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2392 const char *property, const int value);
2395 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2396 * @brief This API adds a string filter property to the filter handle
2398 * @par This API is for package-manager client application
2399 * @par Sync (or) Async : Synchronous API
2401 * @param[in] handle pointer to the package info filter handle.
2402 * @param[in] property string property name.
2403 * @param[in] value value corresponding to the property.
2404 * @return 0 if success, error code(<0) if fail
2405 * @retval PMINFO_R_OK success
2406 * @retval PMINFO_R_EINVAL invalid argument
2407 * @retval PMINFO_R_ERROR internal error
2408 * @pre pkgmgrinfo_pkginfo_filter_create()
2409 * @post pkgmgrinfo_pkginfo_filter_destroy()
2410 * @see pkgmgrinfo_pkginfo_filter_count()
2411 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2413 static int get_tpk_pkg_count()
2417 pkgmgrinfo_pkginfo_filter_h handle;
2418 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2419 if (ret != PMINFO_R_OK)
2421 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2422 if (ret != PMINFO_R_OK) {
2423 pkgmgrinfo_pkginfo_filter_destroy(handle);
2426 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2427 if (ret != PMINFO_R_OK) {
2428 pkgmgrinfo_pkginfo_filter_destroy(handle);
2431 printf("No of tpk pkgs: %d\n", count);
2432 pkgmgrinfo_pkginfo_filter_destroy(handle);
2437 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2438 const char *property, const char *value);
2441 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2442 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2444 * @par This API is for package-manager client application
2445 * @par Sync (or) Async : Synchronous API
2447 * @param[in] handle pointer to the package info filter handle.
2448 * @param[in] pkg_cb callback function.
2449 * @param[in] user_data user data to be passed to the callback function
2450 * @return 0 if success, error code(<0) if fail
2451 * @retval PMINFO_R_OK success
2452 * @retval PMINFO_R_EINVAL invalid argument
2453 * @retval PMINFO_R_ERROR internal error
2454 * @pre pkgmgrinfo_pkginfo_filter_create()
2455 * @post pkgmgrinfo_pkginfo_filter_destroy()
2456 * @see pkgmgrinfo_pkginfo_filter_count()
2458 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2461 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2462 printf("pkg id : %s\n", pkgid);
2466 static int get_tpk_pkg_list()
2469 pkgmgrinfo_pkginfo_filter_h handle;
2470 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2471 if (ret != PMINFO_R_OK)
2473 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2474 if (ret != PMINFO_R_OK) {
2475 pkgmgrinfo_pkginfo_filter_destroy(handle);
2478 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2479 if (ret != PMINFO_R_OK) {
2480 pkgmgrinfo_pkginfo_filter_destroy(handle);
2483 pkgmgrinfo_pkginfo_filter_destroy(handle);
2488 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2489 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2490 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2491 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2494 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2495 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2496 * @brief This API counts the package that satisfy the filter conditions
2498 * @par This API is for package-manager client application
2499 * @par Sync (or) Async : Synchronous API
2501 * @param[in] handle pointer to the package info filter handle.
2502 * @param[in] count pointer to store the count value.
2503 * @param[in] uid the addressee user id of the instruction
2504 * @return 0 if success, error code(<0) if fail
2505 * @retval PMINFO_R_OK success
2506 * @retval PMINFO_R_EINVAL invalid argument
2507 * @retval PMINFO_R_ERROR internal error
2508 * @pre pkgmgrinfo_pkginfo_filter_create()
2509 * @post pkgmgrinfo_pkginfo_filter_destroy()
2510 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2512 static int get_tpk_pkg_count()
2516 pkgmgrinfo_pkginfo_filter_h handle;
2517 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2518 if (ret != PMINFO_R_OK)
2520 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2521 if (ret != PMINFO_R_OK) {
2522 pkgmgrinfo_pkginfo_filter_destroy(handle);
2525 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2526 if (ret != PMINFO_R_OK) {
2527 pkgmgrinfo_pkginfo_filter_destroy(handle);
2530 printf("No of tpk pkgs: %d\n", count);
2531 pkgmgrinfo_pkginfo_filter_destroy(handle);
2536 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2537 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2540 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2541 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2542 * @brief This API gets the list of privilege for a particular package
2544 * @par This API is for package-manager client application
2545 * @par Sync (or) Async : Synchronous API
2546 * @param[in] handle pointer to the package info handle.
2547 * @param[in] privilege_func callback function for list
2548 * @param[in] user_data user data to be passed to callback function
2549 * @return 0 if success, error code(<0) if fail
2550 * @retval PMINFO_R_OK success
2551 * @retval PMINFO_R_EINVAL invalid argument
2552 * @retval PMINFO_R_ERROR internal error
2553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2556 int privilege_func(const char *name, void *user_data)
2558 if (strcmp(name, (char *)user_data) == 0)
2564 static int list_privilege(const char *package, char *privilege)
2567 pkgmgrinfo_pkginfo_h handle;
2568 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2569 if (ret != PMINFO_R_OK)
2571 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2572 if (ret != PMINFO_R_OK) {
2573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2576 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2581 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2582 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2585 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2586 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2587 * @brief This API gets the list of appdefined privilege for a particular package
2589 * @par This API is for package-manager client application
2590 * @par Sync (or) Async : Synchronous API
2591 * @param[in] handle pointer to the package info handle.
2592 * @param[in] privilege_func callback function for list
2593 * @param[in] user_data user data to be passed to callback function
2594 * @return 0 if success, error code(<0) if fail
2595 * @retval PMINFO_R_OK success
2596 * @retval PMINFO_R_EINVAL invalid argument
2597 * @retval PMINFO_R_ERROR internal error
2598 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2599 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2601 int privilege_func(const char *name, const char *license_path, void *user_data)
2603 printf("appdefined privilege : %s", name);
2605 printf("licensed privilege, lecense path : %s", license_path);
2609 static int list_appdefined_privilege(const char *package)
2612 pkgmgrinfo_pkginfo_h handle;
2613 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2614 if (ret != PMINFO_R_OK)
2616 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2617 if (ret != PMINFO_R_OK) {
2618 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2626 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2627 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2630 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2631 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2632 * @brief This API gets the list of plugin execution info for a particular package
2634 * @par This API is for package-manager client application
2635 * @par Sync (or) Async : Synchronous API
2636 * @param[in] handle pointer to the package info handle.
2637 * @param[in] plugin_func callback function for list
2638 * @param[in] user_data user data to be passed to callback function
2639 * @return 0 if success, error code(<0) if fail
2640 * @retval PMINFO_R_OK success
2641 * @retval PMINFO_R_EINVAL invalid argument
2642 * @retval PMINFO_R_ERROR internal error
2643 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2644 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2646 int plugin_func(const char *pkgid, const char *appid,
2647 const char *plugin_type, const char *plugin_name,
2650 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2655 static int list_plugin(const char *package)
2658 pkgmgrinfo_pkginfo_h handle;
2659 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2660 if (ret != PMINFO_R_OK)
2662 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2663 if (ret != PMINFO_R_OK) {
2664 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2667 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2672 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2673 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2675 /* TODO: add doxygen comment here */
2676 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2679 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2680 * @brief This API copy the application information handle
2682 * @par This API is for package-manager client application
2683 * @par Sync (or) Async : Synchronous API
2685 * @param[in] handle pointer to the package info handle.
2686 * @param[out] handle pointer to the package info handle.
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
2692 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2694 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2698 pkgmgrinfo_pkginfo_h clone;
2700 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2701 if (ret != PMINFO_R_OK)
2705 printf("package: %s\n", clone->package);
2706 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2711 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2715 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2716 pkgmgrinfo_app_list_cb app_func, void *user_data)
2717 * @brief This API gets list of installed applications for a particular package
2719 * @par This API is for package-manager client application
2720 * @par Sync (or) Async : Synchronous API
2721 * @param[in] handle package info handle
2722 * @param[in] component application component
2723 * @param[in] app_func iteration function for list
2724 * @param[in] user_data user data to be passed to callback function
2725 * @return 0 if success, error code(<0) if fail
2726 * @retval PMINFO_R_OK success
2727 * @retval PMINFO_R_EINVAL invalid argument
2728 * @retval PMINFO_R_ERROR internal error
2729 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2730 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2732 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2735 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2736 printf("appid : %s\n", appid);
2740 static int list_apps(const char *pkgid)
2743 pkgmgrinfo_pkginfo_h handle;
2744 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2745 if (ret != PMINFO_R_OK)
2747 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2748 if (ret != PMINFO_R_OK) {
2749 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2757 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2758 pkgmgrinfo_app_list_cb app_func, void *user_data);
2759 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2760 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2763 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2764 * @brief This API gets list of installed applications from all packages.
2766 * @par This API is for package-manager client application
2767 * @par Sync (or) Async : Synchronous API
2768 * @param[in] app_func iteration function for list
2769 * @param[in] user_data user data to be passed to callback function
2770 * @return 0 if success, error code(<0) if fail
2771 * @retval PMINFO_R_OK success
2772 * @retval PMINFO_R_EINVAL invalid argument
2773 * @retval PMINFO_R_ERROR internal error
2777 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2779 char *pkgid1 = NULL;
2780 char *pkgid2 = NULL;
2781 pkgid1 = (char *)user_data;
2782 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2783 if (strcmp(pkgid1, pkgid2) == 0) {
2790 static int list_apps()
2793 char *name = "helloworld";
2794 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2795 if (ret != PMINFO_R_OK) {
2802 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2803 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2806 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2807 * @brief This API creates the disabled application information handle from db
2809 * @par This API is for package-manager client application
2810 * @par Sync (or) Async : Synchronous API
2812 * @param[in] appid pointer to appid
2813 * @param[out] handle pointer to the application info handle.
2814 * @return 0 if success, error code(<0) if fail
2815 * @retval PMINFO_R_OK success
2816 * @retval PMINFO_R_EINVAL invalid argument
2817 * @retval PMINFO_R_ERROR internal error
2819 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2820 * @see pkgmgrinfo_appinfo_get_pkgid()
2821 * @see pkgmgrinfo_appinfo_is_multiple()
2823 static int get_disabled_app_type(const char *appid)
2827 pkgmgrinfo_appinfo_h handle;
2828 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2829 if (ret != PMINFO_R_OK)
2831 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2832 if (ret != PMINFO_R_OK) {
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2836 printf("apptype: %s\n", type);
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2843 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2846 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2847 * @brief This API creates the application information handle from db
2849 * @par This API is for package-manager client application
2850 * @par Sync (or) Async : Synchronous API
2852 * @param[in] appid pointer to appid
2853 * @param[out] handle pointer to the application info handle.
2854 * @return 0 if success, error code(<0) if fail
2855 * @retval PMINFO_R_OK success
2856 * @retval PMINFO_R_EINVAL invalid argument
2857 * @retval PMINFO_R_ERROR internal error
2859 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2860 * @see pkgmgrinfo_appinfo_get_pkgid()
2861 * @see pkgmgrinfo_appinfo_is_multiple()
2863 static int get_app_type(const char *appid)
2867 pkgmgrinfo_appinfo_h handle;
2868 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2869 if (ret != PMINFO_R_OK)
2871 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2872 if (ret != PMINFO_R_OK) {
2873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 printf("apptype: %s\n", type);
2877 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2882 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2883 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2886 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2887 * @brief This API creates the application information handle from db regardless of its disable or storage status
2889 * @par This API is for package-manager client application
2890 * @par Sync (or) Async : Synchronous API
2892 * @param[in] appid pointer to appid
2893 * @param[out] handle pointer to the application info handle.
2894 * @return 0 if success, error code(<0) if fail
2895 * @retval PMINFO_R_OK success
2896 * @retval PMINFO_R_EINVAL invalid argument
2897 * @retval PMINFO_R_ERROR internal error
2899 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2900 * @see pkgmgrinfo_appinfo_get_pkgid()
2901 * @see pkgmgrinfo_appinfo_is_multiple()
2903 static int get_app_type(const char *appid)
2907 pkgmgrinfo_appinfo_h handle;
2908 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2909 if (ret != PMINFO_R_OK)
2911 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2912 if (ret != PMINFO_R_OK) {
2913 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2916 printf("apptype: %s\n", type);
2917 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2922 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2923 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2926 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2927 * @brief This API gets the application ID
2929 * @par This API is for package-manager client application
2930 * @par Sync (or) Async : Synchronous API
2932 * @param[in] handle pointer to the application info handle.
2933 * @param[out] appid pointer to hold appid
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()
2943 static int get_app_id(const char *appid)
2946 char *app_id = NULL;
2947 pkgmgrinfo_appinfo_h handle;
2948 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2949 if (ret != PMINFO_R_OK)
2951 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2952 if (ret != PMINFO_R_OK) {
2953 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2956 printf("app id: %s\n", app_id);
2957 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2962 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2965 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2966 * @brief This API gets the package name of the application
2968 * @par This API is for package-manager client application
2969 * @par Sync (or) Async : Synchronous API
2971 * @param[in] handle pointer to the application info handle.
2972 * @param[out] pkg_name pointer to hold package name
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()
2982 static int get_app_pkgname(const char *appid)
2985 char *pkgname = NULL;
2986 pkgmgrinfo_appinfo_h handle;
2987 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2988 if (ret != PMINFO_R_OK)
2990 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2991 if (ret != PMINFO_R_OK) {
2992 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2995 printf("pkg name: %s\n", pkgname);
2996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3001 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
3004 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3005 * @brief This API gets the package id of the application
3007 * @par This API is for package-manager client application
3008 * @par Sync (or) Async : Synchronous API
3010 * @param[in] handle pointer to the application info handle.
3011 * @param[out] pkgid pointer to hold package id
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()
3021 static int get_app_pkgid(const char *appid)
3025 pkgmgrinfo_appinfo_h handle;
3026 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3027 if (ret != PMINFO_R_OK)
3029 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3030 if (ret != PMINFO_R_OK) {
3031 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3034 printf("pkg id: %s\n", pkgid);
3035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3040 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3043 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3044 * @brief This API gets the package type of the application
3046 * @par This API is for package-manager client application
3047 * @par Sync (or) Async : Synchronous API
3049 * @param[in] handle pointer to the application info handle.
3050 * @param[out] pkgtype pointer to hold package type
3051 * @return 0 if success, error code(<0) if fail
3052 * @retval PMINFO_R_OK success
3053 * @retval PMINFO_R_EINVAL invalid argument
3054 * @retval PMINFO_R_ERROR internal error
3055 * @pre pkgmgrinfo_appinfo_get_appinfo()
3056 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3057 * @see pkgmgrinfo_appinfo_get_appid()
3058 * @see pkgmgrinfo_appinfo_is_multiple()
3060 static int get_app_pkgtype(const char *appid)
3063 char *pkgtype = NULL;
3064 pkgmgrinfo_appinfo_h handle = NULL;
3065 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3066 if (ret != PMINFO_R_OK)
3068 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3069 if (ret != PMINFO_R_OK) {
3070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3073 printf("pkgtype: %s\n", pkgtype);
3074 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3079 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3082 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3083 * @brief This API gets the executable name of the application
3085 * @par This API is for package-manager client application
3086 * @par Sync (or) Async : Synchronous API
3088 * @param[in] handle pointer to the application info handle.
3089 * @param[out] exec pointer to hold app exec name
3090 * @return 0 if success, error code(<0) if fail
3091 * @retval PMINFO_R_OK success
3092 * @retval PMINFO_R_EINVAL invalid argument
3093 * @retval PMINFO_R_ERROR internal error
3094 * @pre pkgmgrinfo_appinfo_get_appinfo()
3095 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3096 * @see pkgmgrinfo_appinfo_get_appid()
3097 * @see pkgmgrinfo_appinfo_is_multiple()
3099 static int get_app_exec(const char *appid)
3103 pkgmgrinfo_appinfo_h handle;
3104 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3105 if (ret != PMINFO_R_OK)
3107 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3108 if (ret != PMINFO_R_OK) {
3109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3112 printf("exec name: %s\n", exec);
3113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3118 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3121 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3122 * @brief This API gets the icon name of the application
3124 * @par This API is for package-manager client application
3125 * @par Sync (or) Async : Synchronous API
3127 * @param[in] handle pointer to the application info handle.
3128 * @param[out] icon pointer to hold app icon name
3129 * @return 0 if success, error code(<0) if fail
3130 * @retval PMINFO_R_OK success
3131 * @retval PMINFO_R_EINVAL invalid argument
3132 * @retval PMINFO_R_ERROR internal error
3133 * @pre pkgmgrinfo_appinfo_get_appinfo()
3134 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3135 * @see pkgmgrinfo_appinfo_get_appid()
3136 * @see pkgmgrinfo_appinfo_is_multiple()
3138 static int get_app_icon(const char *appid)
3142 pkgmgrinfo_appinfo_h handle;
3143 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3144 if (ret != PMINFO_R_OK)
3146 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3147 if (ret != PMINFO_R_OK) {
3148 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3151 printf("icon name: %s\n", icon);
3152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3157 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3160 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3161 * @brief This API gets the label of the application
3163 * @par This API is for package-manager client application
3164 * @par Sync (or) Async : Synchronous API
3166 * @param[in] handle pointer to the application info handle.
3167 * @param[out] label pointer to hold app label
3168 * @return 0 if success, error code(<0) if fail
3169 * @retval PMINFO_R_OK success
3170 * @retval PMINFO_R_EINVAL invalid argument
3171 * @retval PMINFO_R_ERROR internal error
3172 * @pre pkgmgrinfo_appinfo_get_appinfo()
3173 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3174 * @see pkgmgrinfo_appinfo_get_appid()
3175 * @see pkgmgrinfo_appinfo_is_multiple()
3177 static int get_app_label(const char *appid)
3181 pkgmgrinfo_appinfo_h handle;
3182 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3183 if (ret != PMINFO_R_OK)
3185 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3186 if (ret != PMINFO_R_OK) {
3187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3190 printf("label : %s\n", label);
3191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3196 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3199 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3200 * @brief This API gets exactly matched label by given appid and locale
3202 * @par This API is for package-manager client application
3203 * @par Sync (or) Async : Synchronous API
3205 * @param[in] appid pointer to appid
3206 * @param[in] locale pointer to locale
3207 * @param[out] label pointer to hold app label
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
3213 static int get_localed_label(const char *appid, const char *locale)
3218 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3219 if (ret != PMINFO_R_OK)
3222 printf("localed label: %s\n", label);
3230 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3231 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3234 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3235 * @brief This API gets metadata value by given metadata key
3237 * @par This API is for package-manager client application
3238 * @par Sync (or) Async : Synchronous API
3240 * @param[in] handle pointer to the application info handle
3241 * @param[in] metadata_key metadata key
3242 * @param[out] metadata_value pointer to hold metadata value
3243 * @return 0 if success, error code(<0) if fail
3244 * @retval PMINFO_R_OK success
3245 * @retval PMINFO_R_EINVAL invalid argument
3247 static int get_metadata_value(const char *appid, const char *metadata_key)
3250 pkgmgrinfo_appinfo_h handle = NULL;
3251 char *metadata_value = NULL;
3253 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3254 if (ret != PMINFO_R_OK)
3257 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3258 if (ret != PMINFO_R_OK) {
3259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3271 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3272 * @brief This API gets the component of the application
3274 * @par This API is for package-manager client application
3275 * @par Sync (or) Async : Synchronous API
3277 * @param[in] handle pointer to the application info handle.
3278 * @param[out] component pointer to hold app component
3279 * @return 0 if success, error code(<0) if fail
3280 * @retval PMINFO_R_OK success
3281 * @retval PMINFO_R_EINVAL invalid argument
3282 * @retval PMINFO_R_ERROR internal error
3283 * @pre pkgmgrinfo_appinfo_get_appinfo()
3284 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3285 * @see pkgmgrinfo_appinfo_get_appid()
3286 * @see pkgmgrinfo_appinfo_is_multiple()
3288 static int get_app_component(const char *appid)
3291 pkgmgrinfo_app_component component;
3292 pkgmgrinfo_appinfo_h handle;
3293 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3294 if (ret != PMINFO_R_OK)
3296 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3297 if (ret != PMINFO_R_OK) {
3298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3301 printf("component : %s\n", component);
3302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3310 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3311 * @brief This API gets the apptype of the application
3313 * @par This API is for package-manager client application
3314 * @par Sync (or) Async : Synchronous API
3316 * @param[in] handle pointer to the application info handle.
3317 * @param[out] app_type pointer to hold apptype
3318 * @return 0 if success, error code(<0) if fail
3319 * @retval PMINFO_R_OK success
3320 * @retval PMINFO_R_EINVAL invalid argument
3321 * @retval PMINFO_R_ERROR internal error
3322 * @pre pkgmgrinfo_appinfo_get_appinfo()
3323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3324 * @see pkgmgrinfo_appinfo_get_appid()
3325 * @see pkgmgrinfo_appinfo_is_multiple()
3327 static int get_app_type(const char *appid)
3330 char *apptype = NULL;
3331 pkgmgrinfo_appinfo_h handle;
3332 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3333 if (ret != PMINFO_R_OK)
3335 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3336 if (ret != PMINFO_R_OK) {
3337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3340 printf("apptype : %s\n", apptype);
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3349 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3350 * @brief This API gets the notification icon of the application
3352 * @par This API is for package-manager client application
3353 * @par Sync (or) Async : Synchronous API
3355 * @param[in] handle pointer to the application info handle.
3356 * @param[out] path pointer to hold notification icon
3357 * @return 0 if success, error code(<0) if fail
3358 * @retval PMINFO_R_OK success
3359 * @retval PMINFO_R_EINVAL invalid argument
3360 * @retval PMINFO_R_ERROR internal error
3361 * @pre pkgmgrinfo_appinfo_get_appinfo()
3362 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3363 * @see pkgmgrinfo_appinfo_get_appid()
3364 * @see pkgmgrinfo_appinfo_is_multiple()
3366 static int get_app_notification_icon(const char *appid)
3369 char *notification_icon = NULL;
3370 pkgmgrinfo_appinfo_h handle;
3371 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3372 if (ret != PMINFO_R_OK)
3374 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3375 if (ret != PMINFO_R_OK) {
3376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3379 printf("notification icon : %s\n", notification_icon);
3380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3385 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3388 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3389 * @brief This API gets the type of recent image on app-tray
3391 * @par This API is for package-manager client application
3392 * @par Sync (or) Async : Synchronous API
3394 * @param[in] handle pointer to the application info handle.
3395 * @param[out] type pointer to hold image type
3396 * @return 0 if success, error code(<0) if fail
3397 * @retval PMINFO_R_OK success
3398 * @retval PMINFO_R_EINVAL invalid argument
3399 * @retval PMINFO_R_ERROR internal error
3400 * @pre pkgmgrinfo_appinfo_get_appinfo()
3401 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3402 * @see pkgmgrinfo_appinfo_get_appid()
3403 * @see pkgmgrinfo_appinfo_is_multiple()
3405 static int get_app_recent_image_type(const char *appid)
3408 pkgmgrinfo_app_recentimage type;
3409 pkgmgrinfo_appinfo_h handle;
3410 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3411 if (ret != PMINFO_R_OK)
3413 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3414 if (ret != PMINFO_R_OK) {
3415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3418 printf("recent image type: %d\n", type);
3419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3424 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3428 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3429 * @brief This API gets the preview image of application
3431 * @par Sync (or) Async : Synchronous API
3433 * @param[in] handle pointer to the application info handle.
3434 * @param[out] preview_img pointer to hold preview image path
3435 * @return 0 if success, error code(<0) if fail
3436 * @retval PMINFO_R_OK success
3437 * @retval PMINFO_R_EINVAL invalid argument
3438 * @retval PMINFO_R_ERROR internal error
3439 * @pre pkgmgrinfo_appinfo_get_appinfo()
3440 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3441 * @see pkgmgrinfo_appinfo_get_appid()
3443 static int get_app_previewimage(const char *appid)
3446 char *preview = NULL;
3447 pkgmgrinfo_appinfo_h handle = NULL;
3448 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3449 if (ret != PMINFO_R_OK)
3451 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3452 if (ret != PMINFO_R_OK) {
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 printf("preview image path : %s\n", preview);
3457 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3462 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3466 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3467 * @brief This API gets the package permission type of the application
3469 * @par This API is for package-manager client application
3470 * @par Sync (or) Async : Synchronous API
3472 * @param[in] handle pointer to the application info handle.
3473 * @param[out] permission pointer to hold package permission
3474 * @return 0 if success, error code(<0) if fail
3475 * @retval PMINFO_R_OK success
3476 * @retval PMINFO_R_EINVAL invalid argument
3477 * @retval PMINFO_R_ERROR internal error
3478 * @pre pkgmgrinfo_appinfo_get_appinfo()
3479 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3480 * @see pkgmgrinfo_appinfo_get_appid()
3482 static int get_app_permission(const char *appid)
3485 pkgmgrinfo_permission_type permission = 0;
3486 pkgmgrinfo_appinfo_h handle;
3488 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3489 if (ret != PMINFO_R_OK)
3491 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3492 if (ret != PMINFO_R_OK) {
3493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3496 printf("permission type: %d\n", permission);
3497 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3502 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3505 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3506 * @brief This API gets the component_type
3508 * @par This API is for package-manager client application
3509 * @par Sync (or) Async : Synchronous API
3511 * @param[in] handle pointer to the application info handle.
3512 * @param[out] component_type pointer to hold component_type
3513 * @return 0 if success, error code(<0) if fail
3514 * @retval PMINFO_R_OK success
3515 * @retval PMINFO_R_EINVAL invalid argument
3516 * @retval PMINFO_R_ERROR internal error
3517 * @pre pkgmgrinfo_appinfo_get_appinfo()
3518 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3519 * @see pkgmgrinfo_appinfo_get_pkgid()
3520 * @see pkgmgrinfo_appinfo_is_multiple()
3522 static int get_component_type(const char *appid)
3525 char *component_type = NULL;
3526 pkgmgrinfo_appinfo_h handle;
3527 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3528 if (ret != PMINFO_R_OK)
3530 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3531 if (ret != PMINFO_R_OK) {
3532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3535 printf("component_type: %s\n", component_type);
3536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3541 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3544 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3545 * @brief This API gets the application 'hwacceleration' value from the app ID
3547 * @par This API is for package-manager client application
3548 * @par Sync (or) Async : Synchronous API
3550 * @param[in] handle pointer to application info handle
3551 * @param[out] hwacceleration pointer to hold package hwacceleration value
3552 * @return 0 if success, error code(<0) if fail
3553 * @retval PMINFO_R_OK success
3554 * @retval PMINFO_R_EINVAL invalid argument
3555 * @retval PMINFO_R_ERROR internal error
3556 * @pre pkgmgrinfo_appinfo_get_appinfo()
3557 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3558 * @see pkgmgrinfo_appinfo_get_appid()
3559 * @see pkgmgrinfo_appinfo_is_multiple()
3561 static int get_app_hwacceleration(const char *appid)
3564 pkgmgrinfo_app_hwacceleration hwacceleration;
3565 pkgmgrinfo_appinfo_h handle;
3566 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3567 if (ret != PMINFO_R_OK)
3569 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3570 if (ret != PMINFO_R_OK) {
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3574 printf("app hwacceleration: %d\n", hwacceleration);
3575 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3580 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3583 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3584 * @brief This API gets the application 'screenreader' value from the app ID
3586 * @par This API is for package-manager client application
3587 * @par Sync (or) Async : Synchronous API
3589 * @param[in] handle pointer to application info handle
3590 * @param[out] screenreader pointer to hold package accessibility value
3591 * @return 0 if success, error code(<0) if fail
3592 * @retval PMINFO_R_OK success
3593 * @retval PMINFO_R_EINVAL invalid argument
3594 * @retval PMINFO_R_ERROR internal error
3595 * @pre pkgmgrinfo_appinfo_get_appinfo()
3596 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3597 * @see pkgmgrinfo_appinfo_get_appid()
3598 * @see pkgmgrinfo_appinfo_is_multiple()
3600 static int get_app_screenreader(const char *appid)
3603 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3604 pkgmgrinfo_appinfo_h handle = NULL;
3605 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3606 if (ret != PMINFO_R_OK)
3608 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3609 if (ret != PMINFO_R_OK) {
3610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3613 printf("app screenreader: %d\n", screenreader);
3614 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3619 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3622 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3623 * @brief This API gets the application's landscape & portrait effect images
3625 * @par This API is for package-manager client application
3626 * @par Sync (or) Async : Synchronous API
3628 * @param[in] handle pointer to application info handle
3629 * @param[out] portrait_img contains portrait mode effect image
3630 * @param[out] landscape_img contains landscape mode effect image
3631 * @return 0 if success, error code(<0) if fail
3632 * @retval PMINFO_R_OK success
3633 * @retval PMINFO_R_EINVAL invalid argument
3634 * @retval PMINFO_R_ERROR internal error
3635 * @pre pkgmgrinfo_appinfo_get_appinfo()
3636 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3637 * @see pkgmgrinfo_appinfo_get_appid()
3638 * @see pkgmgrinfo_appinfo_is_nodisplay()
3640 static int get_app_effectimages(const char *appid)
3643 char *portraitimg = NULL;
3644 char *landscapeimg = NULL;
3645 pkgmgrinfo_appinfo_h handle;
3646 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3647 if (ret != PMINFO_R_OK)
3649 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3650 if (ret != PMINFO_R_OK) {
3651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3654 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3660 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3663 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3664 * @brief This API gets the application's effect image type
3666 * @par This API is for package-manager client application
3667 * @par Sync (or) Async : Synchronous API
3669 * @param[in] handle pointer to application info handle
3670 * @param[out] effectimg_type contains effect image type
3671 * @return 0 if success, error code(<0) if fail
3672 * @retval PMINFO_R_OK success
3673 * @retval PMINFO_R_EINVAL invalid argument
3674 * @retval PMINFO_R_ERROR internal error
3675 * @pre pkgmgrinfo_appinfo_get_appinfo()
3676 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3677 * @see pkgmgrinfo_appinfo_get_appid()
3678 * @see pkgmgrinfo_appinfo_is_nodisplay()
3680 static int get_app_effectimage_type(const char *appid)
3683 char *effectimg_type = NULL;
3684 pkgmgrinfo_appinfo_h handle = NULL;
3685 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3686 if (ret != PMINFO_R_OK)
3688 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3689 if (ret != PMINFO_R_OK) {
3690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3693 printf("app effect image type: %s\n", effectimg_type);
3694 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3699 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3702 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3703 * @brief This API gets the submode_mainid of the application
3705 * @par This API is for package-manager client application
3706 * @par Sync (or) Async : Synchronous API
3708 * @param[in] handle pointer to the application info handle.
3709 * @param[out] submode_mainid pointer to hold package name
3710 * @return 0 if success, error code(<0) if fail
3711 * @retval PMINFO_R_OK success
3712 * @retval PMINFO_R_EINVAL invalid argument
3713 * @retval PMINFO_R_ERROR internal error
3714 * @pre pkgmgrinfo_appinfo_get_appinfo()
3715 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3716 * @see pkgmgrinfo_appinfo_get_appid()
3717 * @see pkgmgrinfo_appinfo_is_multiple()
3719 static int get_app_submode_mainid(const char *appid)
3722 char *submode_mainid = NULL;
3723 pkgmgrinfo_appinfo_h handle = NULL;
3724 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3725 if (ret != PMINFO_R_OK)
3727 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3728 if (ret != PMINFO_R_OK) {
3729 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3732 printf("submode_mainid: %s\n", submode_mainid);
3733 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3738 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3741 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3742 * @brief This API gets the datacontrol info
3744 * @par This API is for package-manager client application
3745 * @par Sync (or) Async : Synchronous API
3747 * @param[in] providerid pointer to the providerid of dataconltrol.
3748 * @param[in] type pointer to the type of dataconltrol.
3749 * @param[out] appid pointer to hold appid, need to free after using
3750 * @param[out] access pointer to hold access, need to free after using
3751 * @return 0 if success, error code(<0) if fail
3752 * @retval PMINFO_R_OK success
3753 * @retval PMINFO_R_EINVAL invalid argument
3754 * @retval PMINFO_R_ERROR internal error
3757 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3758 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3761 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3762 * @brief This API gets the appid of datacontrol
3764 * @par This API is for package-manager client application
3765 * @par Sync (or) Async : Synchronous API
3767 * @param[in] providerid pointer to the providerid of dataconltrol.
3768 * @param[out] appid pointer to hold appid, need to free after using
3769 * @return 0 if success, error code(<0) if fail
3770 * @retval PMINFO_R_OK success
3771 * @retval PMINFO_R_EINVAL invalid argument
3772 * @retval PMINFO_R_ERROR internal error
3775 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3776 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3779 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3780 * @brief This API gets the information about trusted datacontrol
3782 * @par This API is for package-manager client application
3783 * @par Sync (or) Async : Synchronous API
3785 * @param[in] providerid pointer to the providerid of datacontrol.
3786 * @param[out] appid pointer to hold appid, need to free after using
3787 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
3788 * @return 0 if success, error code(<0) if fail
3789 * @retval PMINFO_R_OK success
3790 * @retval PMINFO_R_EINVAL invalid argument
3791 * @retval PMINFO_R_ERROR internal error
3794 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3795 const char *type, char **appid, bool *is_trusted);
3796 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3797 const char *type, uid_t uid, char **appid, bool *is_trusted);
3800 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3801 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3802 * @brief This API retrieves the privileges and invokes given callback for each privilege.
3804 * @par This API is for package-manager client application
3805 * @par Sync (or) Async : Synchronous API
3807 * @param[in] providerid pointer to the providerid of datacontrol.
3808 * @param[in] type pointer to the type of dataconltrol.
3809 * @param[in] privilege_func callback function for list
3810 * @param[in] user_data user data to be passed to callback function
3811 * @return 0 if success, error code(<0) if fail
3812 * @retval PMINFO_R_OK success
3813 * @retval PMINFO_R_EINVAL invalid argument
3814 * @retval PMINFO_R_ERROR internal error
3816 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3817 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3818 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3819 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3822 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3823 * @brief This API gets the alias_appid of the application
3825 * @par This API is for package-manager client application
3826 * @par Sync (or) Async : Synchronous API
3828 * @param[in] handle pointer to the application info handle.
3829 * @param[out] alias_appid pointer to hold app alias_appid
3830 * @return 0 if success, error code(<0) if fail
3831 * @retval PMINFO_R_OK success
3832 * @retval PMINFO_R_EINVAL invalid argument
3833 * @retval PMINFO_R_ERROR internal error
3834 * @pre pkgmgrinfo_appinfo_get_appinfo()
3835 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3836 * @see pkgmgrinfo_appinfo_get_appid()
3838 static int get_alias_appid(const char *appid)
3841 char *alias_appid= 0;
3842 pkgmgrinfo_appinfo_h handle = NULL;
3843 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3844 if (ret != PMINFO_R_OK)
3846 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3847 if (ret != PMINFO_R_OK) {
3848 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3851 printf("alias_appid: %s\n", alias_appid);
3852 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3857 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3860 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3861 * @brief This API gets the effective_appid of the application
3863 * @par This API is for package-manager client application
3864 * @par Sync (or) Async : Synchronous API
3866 * @param[in] handle pointer to the application info handle.
3867 * @param[out] effective_appid pointer to hold app effective_appid
3868 * @return 0 if success, error code(<0) if fail
3869 * @retval PMINFO_R_OK success
3870 * @retval PMINFO_R_EINVAL invalid argument
3871 * @retval PMINFO_R_ERROR internal error
3872 * @pre pkgmgrinfo_appinfo_get_appinfo()
3873 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3874 * @see pkgmgrinfo_appinfo_get_appid()
3876 static int get_effective_appid(const char *appid)
3879 char *effective_appid= 0;
3880 pkgmgrinfo_appinfo_h handle = NULL;
3881 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3882 if (ret != PMINFO_R_OK)
3884 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3885 if (ret != PMINFO_R_OK) {
3886 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3889 printf("effective_appid: %s\n", effective_appid);
3890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3898 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3899 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3901 * @par This API is for package-manager client application
3902 * @par Sync (or) Async : Synchronous API
3904 * @param[in] handle pointer to the appinfo handle.
3905 * @param[out] tep_name pointer to hold tep name
3906 * @return 0 if success, error code(<0) if fail
3907 * @retval PMINFO_R_OK success
3908 * @retval PMINFO_R_EINVAL invalid argument
3909 * @retval PMINFO_R_ERROR internal error
3910 * @pre pkgmgrinfo_appinfo_get_appinfo()
3911 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3912 * @see pkgmgrinfo_appinfo_get_appid()
3914 static int get_tep_name(const char *appid)
3917 char *tep_name = NULL;
3918 pkgmgrinfo_appinfo_h handle = NULL;
3919 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3920 if (ret != PMINFO_R_OK)
3922 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3923 if (ret != PMINFO_R_OK) {
3924 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3927 printf("TEP name is: %s\n", tep_name);
3928 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3933 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3936 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3937 * @brief This API gets zip mount file name associated with the package which contain given application
3938 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3940 * @par This API is for package-manager client application
3941 * @par Sync (or) Async : Synchronous API
3943 * @param[in] handle pointer to the appinfo handle.
3944 * @param[out] zip_mount_file pointer to hold zip mount file name
3945 * @return 0 if success, error code(<0) if fail
3946 * @retval PMINFO_R_OK success
3947 * @retval PMINFO_R_EINVAL invalid argument
3948 * @retval PMINFO_R_ERROR internal error
3949 * @pre pkgmgrinfo_appinfo_get_appinfo()
3950 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3951 * @see pkgmgrinfo_appinfo_get_appid()
3953 static int get_zip_mount_file(const char *appid)
3956 char *zip_mount_file = NULL;
3957 pkgmgrinfo_appinfo_h handle = NULL;
3958 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3959 if (ret != PMINFO_R_OK)
3961 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3962 if (ret != PMINFO_R_OK) {
3963 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3966 printf("Mount file name is: %s\n", zip_mount_file);
3967 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3972 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3975 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3976 * @brief This API gets the root path of application
3978 * @par Sync (or) Async : Synchronous API
3980 * @param[in] handle pointer to appinfo handle
3981 * @param[out] path pointer to hold root path of application
3982 * @return 0 if success, error code(<0) if fail
3983 * @retval PMINFO_R_OK success
3984 * @retval PMINFO_R_EINVAL invalid argument
3985 * @retval PMINFO_R_ERROR internal error
3987 static int get_root_path(const char *appid)
3991 pkgmgrinfo_appinfo_h handle;
3992 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3993 if (ret != PMINFO_R_OK)
3996 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3997 if (ret != PMINFO_R_OK) {
3998 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4001 printf("path : %s\n", path);
4002 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4008 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4011 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4012 * @brief This API gets the application api_version from the application ID
4014 * @par This API is for package-manager client application
4015 * @par Sync (or) Async : Synchronous API
4017 * @param[in] handle pointer to appinfo handle
4018 * @param[out] api_version pointer to hold application api_version
4019 * @return 0 if success, error code(<0) if fail
4020 * @retval PMINFO_R_OK success
4021 * @retval PMINFO_R_EINVAL invalid argument
4022 * @retval PMINFO_R_ERROR internal error
4023 * @pre pkgmgrinfo_appinfo_get_appinfo()
4024 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4025 * @see pkgmgrinfo_appinfo_get_appid()
4027 static int get_app_api_version(const char *appid)
4030 char *api_version = NULL;
4031 pkgmgrinfo_appinfo_h handle = NULL;
4032 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4033 if (ret != PMINFO_R_OK)
4035 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4036 if (ret != PMINFO_R_OK) {
4037 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4040 printf("app api_version: %s\n", api_version);
4041 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4046 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4049 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4050 * @brief This API gets the installed_time of the application
4052 * @par This API is for package-manager client application
4053 * @par Sync (or) Async : Synchronous API
4055 * @param[in] handle pointer to the application info handle.
4056 * @param[out] installed_time pointer to hold installed_time
4057 * @return 0 if success, error code(<0) if fail
4058 * @retval PMINFO_R_OK success
4059 * @retval PMINFO_R_EINVAL invalid argument
4060 * @retval PMINFO_R_ERROR internal error
4061 * @pre pkgmgrinfo_appinfo_get_appinfo()
4062 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4063 * @see pkgmgrinfo_appinfo_get_appid()
4064 * @see pkgmgrinfo_appinfo_is_multiple()
4066 static int get_app_installed_time(const char *appid)
4069 int installed_time = 0;
4070 pkgmgrinfo_appinfo_h handle = NULL;
4071 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4072 if (ret != PMINFO_R_OK)
4074 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4075 if (ret != PMINFO_R_OK) {
4076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4079 printf("installed_time: %d\n", installed_time);
4080 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4085 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4088 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4089 * @brief This API gets the support_mode of the application
4091 * @par This API is for package-manager client application
4092 * @par Sync (or) Async : Synchronous API
4094 * @param[in] handle pointer to the application info handle.
4095 * @param[out] support_mode pointer to hold app support_mode
4096 * @return 0 if success, error code(<0) if fail
4097 * @retval PMINFO_R_OK success
4098 * @retval PMINFO_R_EINVAL invalid argument
4099 * @retval PMINFO_R_ERROR internal error
4100 * @pre pkgmgrinfo_appinfo_get_appinfo()
4101 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4102 * @see pkgmgrinfo_appinfo_get_appid()
4104 static int get_app_support_mode(const char *appid)
4107 int support_mode = 0;
4108 pkgmgrinfo_appinfo_h handle = NULL;
4109 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4110 if (ret != PMINFO_R_OK)
4112 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4113 if (ret != PMINFO_R_OK) {
4114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4117 printf("support_mode: %s\n", support_mode);
4118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4123 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4127 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4128 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4129 * @brief This API gets the list of category for a particular application
4131 * @par This API is for package-manager client application
4132 * @par Sync (or) Async : Synchronous API
4133 * @param[in] handle pointer to the application info handle.
4134 * @param[in] category_func callback function for list
4135 * @param[in] user_data user data to be passed to callback function
4136 * @return 0 if success, error code(<0) if fail
4137 * @retval PMINFO_R_OK success
4138 * @retval PMINFO_R_EINVAL invalid argument
4139 * @retval PMINFO_R_ERROR internal error
4140 * @pre pkgmgrinfo_appinfo_get_appinfo()
4141 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4143 int category_func(const char *name, void *user_data)
4145 if (strcmp(name, (char *)user_data) == 0)
4151 static int list_category(const char *appid, char *category)
4154 pkgmgrinfo_appinfo_h handle;
4155 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4156 if (ret != PMINFO_R_OK)
4158 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4159 if (ret != PMINFO_R_OK) {
4160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4168 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4169 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4172 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4173 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4174 * @brief This API gets the list of metadata for a particular application
4176 * @par This API is for package-manager client application
4177 * @par Sync (or) Async : Synchronous API
4178 * @param[in] handle pointer to the application info handle.
4179 * @param[in] metadata_func callback function for list
4180 * @param[in] user_data user data to be passed to callback function
4181 * @return 0 if success, error code(<0) if fail
4182 * @retval PMINFO_R_OK success
4183 * @retval PMINFO_R_EINVAL invalid argument
4184 * @retval PMINFO_R_ERROR internal error
4185 * @pre pkgmgrinfo_appinfo_get_appinfo()
4186 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4188 int metadata_func(const char *key, const char *value, void *user_data)
4190 if (strcmp(key, (char *)user_data) == 0) {
4191 printf("Value is %s\n", value);
4198 static int list_metadata(const char *appid, char *key)
4201 pkgmgrinfo_appinfo_h handle;
4202 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4203 if (ret != PMINFO_R_OK)
4205 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4206 if (ret != PMINFO_R_OK) {
4207 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4215 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4216 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4219 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4220 * const char *operation,
4221 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4223 * @brief This API gets the list of privileges for a particular
4224 * appllication's app_control
4226 * @par This API is for package-manager client application
4227 * @par Sync (or) Async : Synchronous API
4228 * @param[in] appid application id
4229 * @param[in] operation operation of appcontrol
4230 * @param[in] privilege_func callback function for list
4231 * @param[in] user_data user data to be passed to callback function
4232 * @return 0 if success, error code(<0) if fail
4233 * @retval PMINFO_R_OK success
4234 * @retval PMINFO_R_EINVAL invalid argument
4235 * @retval PMINFO_R_ERROR internal error
4237 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4238 const char *operation,
4239 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4240 void *user_data, uid_t uid);
4241 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4242 const char *operation,
4243 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4247 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4248 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4249 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4250 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4251 * @brief This API gets the list of app-control for a particular application
4253 * @par This API is for package-manager client application
4254 * @par Sync (or) Async : Synchronous API
4255 * @param[in] handle pointer to the application info handle.
4256 * @param[in] appcontrol_func callback function for list
4257 * @param[in] user_data user data to be passed to callback function
4258 * @param[in] uid the addressee user id of the instruction
4259 * @return 0 if success, error code(<0) if fail
4260 * @retval PMINFO_R_OK success
4261 * @retval PMINFO_R_EINVAL invalid argument
4262 * @retval PMINFO_R_ERROR internal error
4263 * @pre pkgmgrinfo_appinfo_get_appinfo()
4264 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4266 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4270 char *compare_data = (char *)user_data;
4271 if (strcmp(operation, compare_data) == 0)
4277 static int check_operation(const char *appid, char *operation)
4280 pkgmgrinfo_appinfo_h handle;
4281 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4282 if (ret != PMINFO_R_OK)
4284 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4285 if (ret != PMINFO_R_OK) {
4286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4289 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4294 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4295 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4297 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4298 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4303 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4304 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4307 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4308 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4309 * @brief This API gets the list of splashscreen for a particular application
4311 * @par This API is for package-manager client application
4312 * @par Sync (or) Async : Synchronous API
4313 * @param[in] handle pointer to the application info handle.
4314 * @param[in] splash_screen_func callback function for list
4315 * @param[in] user_data user data to be passed to callback function
4316 * @return 0 if success, error code(<0) if fail
4317 * @retval PMINFO_R_OK success
4318 * @retval PMINFO_R_EINVAL invalid argument
4319 * @retval PMINFO_R_ERROR internal error
4320 * @pre pkgmgrinfo_appinfo_get_appinfo()
4321 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4324 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4325 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4328 * @fn int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4329 pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4330 * @brief This API gets the list of resource control for a particular application
4332 * @par This API is for package-manager client application
4333 * @par Sync (or) Async : Synchronous API
4334 * @param[in] handle pointer to the application info handle.
4335 * @param[in] res_control_func callback function for list
4336 * @param[in] user_data user data to be passed to callback function
4337 * @return 0 if success, error code(<0) if fail
4338 * @retval PMINFO_R_OK success
4339 * @retval PMINFO_R_EINVAL invalid argument
4340 * @retval PMINFO_R_ERROR internal error
4341 * @pre pkgmgrinfo_appinfo_get_appinfo()
4342 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4344 int res_control_func(const char *res_type,
4345 const char *min_res_version, const char *max_res_version,
4346 const char *auto_close, void *user_data)
4348 printf("res_type : %s\n", res_type);
4352 static int list_res_control(const char *appid, char *key)
4355 pkgmgrinfo_appinfo_h handle;
4356 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4357 if (ret != PMINFO_R_OK)
4359 ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4360 if (ret != PMINFO_R_OK) {
4361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4369 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4370 pkgmgrinfo_app_res_control_list_cb res_control_func,
4374 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4375 * @brief This API gets the application 'nodisplay' value from the app ID
4377 * @par This API is for package-manager client application
4378 * @par Sync (or) Async : Synchronous API
4380 * @param[in] handle pointer to application info handle
4381 * @param[out] nodisplay pointer to hold package nodisplay value
4382 * @return 0 if success, error code(<0) if fail
4383 * @retval PMINFO_R_OK success
4384 * @retval PMINFO_R_EINVAL invalid argument
4385 * @retval PMINFO_R_ERROR internal error
4386 * @pre pkgmgrinfo_appinfo_get_appinfo()
4387 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4388 * @see pkgmgrinfo_appinfo_get_appid()
4389 * @see pkgmgrinfo_appinfo_is_multiple()
4391 static int get_app_nodisplay(const char *appid)
4395 pkgmgrinfo_appinfo_h handle;
4396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4397 if (ret != PMINFO_R_OK)
4399 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4400 if (ret != PMINFO_R_OK) {
4401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4404 printf("app nodisplay: %d\n", nodisplay);
4405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4410 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4413 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4414 * @brief This API gets the application 'multiple' value from the app ID
4416 * @par This API is for package-manager client application
4417 * @par Sync (or) Async : Synchronous API
4419 * @param[in] handle pointer to application info handle
4420 * @param[out] multiple pointer to hold package multiple value
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 pkgmgrinfo_appinfo_get_appinfo()
4426 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4427 * @see pkgmgrinfo_appinfo_get_appid()
4428 * @see pkgmgrinfo_appinfo_is_nodisplay()
4430 static int get_app_multiple(const char *appid)
4434 pkgmgrinfo_appinfo_h handle;
4435 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4436 if (ret != PMINFO_R_OK)
4438 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4439 if (ret != PMINFO_R_OK) {
4440 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4443 printf("app multiple: %d\n", multiple);
4444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4449 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4452 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4453 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4454 * application launching effect. If fales, indicator will be hidden during application launching effect
4456 * @par This API is for package-manager client application
4457 * @par Sync (or) Async : Synchronous API
4459 * @param[in] handle pointer to application info handle
4460 * @param[out] indicator_disp contains indicator display status for application launching effect
4461 * @return 0 if success, error code(<0) if fail
4462 * @retval PMINFO_R_OK success
4463 * @retval PMINFO_R_EINVAL invalid argument
4464 * @retval PMINFO_R_ERROR internal error
4465 * @pre pkgmgrinfo_appinfo_get_appinfo()
4466 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4467 * @see pkgmgrinfo_appinfo_get_appid()
4468 * @see pkgmgrinfo_appinfo_is_nodisplay()
4470 static int get_app_indicator_display(const char *appid)
4473 bool indicator_disp;
4474 pkgmgrinfo_appinfo_h handle;
4475 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4476 if (ret != PMINFO_R_OK)
4478 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4479 if (ret != PMINFO_R_OK){
4480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4483 printf("app indicator disp : %d\n", indicator_disp);
4484 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4489 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4492 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4493 * @brief This API gets the application 'taskmanage' value from the app ID
4495 * @par This API is for package-manager client application
4496 * @par Sync (or) Async : Synchronous API
4498 * @param[in] handle pointer to application info handle
4499 * @param[out] taskmanage pointer to hold package taskmanage value
4500 * @return 0 if success, error code(<0) if fail
4501 * @retval PMINFO_R_OK success
4502 * @retval PMINFO_R_EINVAL invalid argument
4503 * @retval PMINFO_R_ERROR internal error
4504 * @pre pkgmgrinfo_appinfo_get_appinfo()
4505 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4506 * @see pkgmgrinfo_appinfo_get_appid()
4507 * @see pkgmgrinfo_appinfo_is_multiple()
4509 static int get_app_taskmanage(const char *appid)
4513 pkgmgrinfo_appinfo_h handle;
4514 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4515 if (ret != PMINFO_R_OK)
4517 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4518 if (ret != PMINFO_R_OK) {
4519 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4522 printf("app taskmanage: %d\n", taskmanage);
4523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4528 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4531 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4532 * @brief This API gets the application 'taskmanage' value from the app ID
4534 * @par This API is for package-manager client application
4535 * @par Sync (or) Async : Synchronous API
4537 * @param[in] handle pointer to application info handle
4538 * @param[out] enabled pointer to hold package enabled value
4539 * @return 0 if success, error code(<0) if fail
4540 * @retval PMINFO_R_OK success
4541 * @retval PMINFO_R_EINVAL invalid argument
4542 * @retval PMINFO_R_ERROR internal error
4543 * @pre pkgmgrinfo_appinfo_get_appinfo()
4544 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4545 * @see pkgmgrinfo_appinfo_get_appid()
4546 * @see pkgmgrinfo_appinfo_is_multiple()
4548 static int get_app_enabled(const char *appid)
4552 pkgmgrinfo_appinfo_h handle;
4553 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4554 if (ret != PMINFO_R_OK)
4556 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4557 if (ret != PMINFO_R_OK) {
4558 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4561 printf("app enabled: %d\n", enabled);
4562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4567 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4570 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4571 * @brief This API gets the application 'onboot' value from the app ID
4573 * @par This API is for package-manager client application
4574 * @par Sync (or) Async : Synchronous API
4576 * @param[in] handle pointer to application info handle
4577 * @param[out] onboot pointer to hold package onboot value
4578 * @return 0 if success, error code(<0) if fail
4579 * @retval PMINFO_R_OK success
4580 * @retval PMINFO_R_EINVAL invalid argument
4581 * @retval PMINFO_R_ERROR internal error
4582 * @pre pkgmgrinfo_appinfo_get_appinfo()
4583 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4584 * @see pkgmgrinfo_appinfo_get_appid()
4585 * @see pkgmgrinfo_appinfo_is_multiple()
4587 static int get_app_onboot(const char *appid)
4591 pkgmgrinfo_appinfo_h handle;
4592 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4593 if (ret != PMINFO_R_OK)
4595 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4596 if (ret != PMINFO_R_OK) {
4597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4600 printf("app onboot: %d\n", onboot);
4601 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4606 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4609 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4610 * @brief This API gets the application 'autorestart' value from the app ID
4612 * @par This API is for package-manager client application
4613 * @par Sync (or) Async : Synchronous API
4615 * @param[in] handle pointer to application info handle
4616 * @param[out] autorestart pointer to hold package autorestart value
4617 * @return 0 if success, error code(<0) if fail
4618 * @retval PMINFO_R_OK success
4619 * @retval PMINFO_R_EINVAL invalid argument
4620 * @retval PMINFO_R_ERROR internal error
4621 * @pre pkgmgrinfo_appinfo_get_appinfo()
4622 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4623 * @see pkgmgrinfo_appinfo_get_appid()
4624 * @see pkgmgrinfo_appinfo_is_multiple()
4626 static int get_app_autorestart(const char *appid)
4630 pkgmgrinfo_appinfo_h handle;
4631 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4632 if (ret != PMINFO_R_OK)
4634 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4635 if (ret != PMINFO_R_OK) {
4636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4639 printf("app autorestart: %d\n", autorestart);
4640 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4645 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4648 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4649 * @brief This API gets the value for given application is main app or not from handle
4651 * @par This API is for package-manager client application
4652 * @par Sync (or) Async : Synchronous API
4654 * @param[in] handle pointer to application info handle
4655 * @param[out] mainapp pointer to hold package mainapp is or not
4656 * @return 0 if success, error code(<0) if fail
4657 * @retval PMINFO_R_OK success
4658 * @retval PMINFO_R_EINVAL invalid argument
4659 * @retval PMINFO_R_ERROR internal error
4660 * @pre pkgmgrinfo_appinfo_get_appinfo()
4661 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4662 * @see pkgmgrinfo_appinfo_get_appid()
4663 * @see pkgmgrinfo_appinfo_is_multiple()
4665 static int get_app_mainapp(const char *appid)
4669 pkgmgrinfo_appinfo_h handle;
4670 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4671 if (ret != PMINFO_R_OK)
4673 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4674 if (ret != PMINFO_R_OK) {
4675 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4678 printf("mainapp: %d\n", mainapp);
4679 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4684 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4688 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4689 * @brief This API gets the value for given application is preload or not from handle
4691 * @par This API is for package-manager client application
4692 * @par Sync (or) Async : Synchronous API
4694 * @param[in] handle pointer to application info handle
4695 * @param[out] preload pointer to hold preload is or not
4696 * @return 0 if success, error code(<0) if fail
4697 * @retval PMINFO_R_OK success
4698 * @retval PMINFO_R_EINVAL invalid argument
4699 * @retval PMINFO_R_ERROR internal error
4700 * @pre pkgmgrinfo_appinfo_get_appinfo()
4701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4702 * @see pkgmgrinfo_appinfo_get_appid()
4703 * @see pkgmgrinfo_appinfo_is_multiple()
4705 static int get_app_preload(const char *appid)
4709 pkgmgrinfo_appinfo_h handle = NULL;
4710 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4711 if (ret != PMINFO_R_OK)
4713 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4714 if (ret != PMINFO_R_OK) {
4715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4718 printf("preload: %d\n", preload);
4719 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4724 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4727 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4728 * @brief This API gets the value for given application is submode or not from handle
4730 * @par This API is for package-manager client application
4731 * @par Sync (or) Async : Synchronous API
4733 * @param[in] handle pointer to application info handle
4734 * @param[out] submode pointer to hold submode is or not
4735 * @return 0 if success, error code(<0) if fail
4736 * @retval PMINFO_R_OK success
4737 * @retval PMINFO_R_EINVAL invalid argument
4738 * @retval PMINFO_R_ERROR internal error
4739 * @pre pkgmgrinfo_appinfo_get_appinfo()
4740 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4741 * @see pkgmgrinfo_appinfo_get_appid()
4742 * @see pkgmgrinfo_appinfo_is_multiple()
4744 static int get_app_submode(const char *appid)
4748 pkgmgrinfo_appinfo_h handle = NULL;
4749 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4750 if (ret != PMINFO_R_OK)
4752 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4753 if (ret != PMINFO_R_OK) {
4754 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4757 printf("submode: %d\n", submode);
4758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4763 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4766 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4767 * @brief This API gets the value for given application is process_pool or not from handle
4769 * @par This API is for package-manager client application
4770 * @par Sync (or) Async : Synchronous API
4772 * @param[in] handle pointer to application info handle
4773 * @param[out] process_pool pointer to hold process_pool is or not
4774 * @return 0 if success, error code(<0) if fail
4775 * @retval PMINFO_R_OK success
4776 * @retval PMINFO_R_EINVAL invalid argument
4777 * @retval PMINFO_R_ERROR internal error
4778 * @pre pkgmgrinfo_appinfo_get_appinfo()
4779 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4780 * @see pkgmgrinfo_appinfo_get_appid()
4782 static int get_app_process_pool(const char *appid)
4785 bool process_pool = 0;
4786 pkgmgrinfo_appinfo_h handle = NULL;
4787 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4788 if (ret != PMINFO_R_OK)
4790 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4791 if (ret != PMINFO_R_OK) {
4792 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4795 printf("process_pool: %d\n", process_pool);
4796 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4801 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4804 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4805 * @brief This API gets the installed storage location of the application
4807 * @par This API is for package-manager client application
4808 * @par Sync (or) Async : Synchronous API
4810 * @param[in] handle pointer to the application info handle.
4811 * @param[out] app_type pointer to hold installed storage location
4812 * @return 0 if success, error code(<0) if fail
4813 * @retval PMINFO_R_OK success
4814 * @retval PMINFO_R_EINVAL invalid argument
4815 * @retval PMINFO_R_ERROR internal error
4816 * @pre pkgmgrinfo_appinfo_get_appinfo()
4817 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4818 * @see pkgmgrinfo_appinfo_get_appid()
4820 static int get_app_installed_location(const char *appid)
4823 pkgmgrinfo_installed_storage storage;
4824 pkgmgrinfo_appinfo_h handle = NULL;
4825 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4826 if (ret != PMINFO_R_OK)
4828 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4829 if (ret != PMINFO_R_OK) {
4830 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4833 printf("Installed storage location : %d\n", storage);
4834 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4839 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4843 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4844 * @brief This API checks if the application has the given category
4846 * @par This API is for package-manager client application
4847 * @par Sync (or) Async : Synchronous API
4849 * @param[in] handle pointer to the application info handle
4850 * @param[in] category category
4851 * @param[out] exist value Gets whether the application has the given category
4852 * @return 0 if success, error code(<0) if fail
4853 * @retval PMINFO_R_OK success
4854 * @retval PMINFO_R_EINVAL invalid argument
4855 * @retval PMINFO_R_ERROR internal error
4857 static int is_category_exist(const char *appid, const char *category)
4860 pkgmgrinfo_appinfo_h handle;
4863 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4864 if (ret != PMINFO_R_OK)
4867 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4868 if (ret != PMINFO_R_OK) {
4869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4878 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4881 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4882 * @brief This API gets the application 'ui_gadget' value from the app ID
4884 * @par This API is for package-manager client application
4885 * @par Sync (or) Async : Synchronous API
4887 * @param[in] handle pointer to application info handle
4888 * @param[out] ui_gadget pointer to hold package ui_gadget value
4889 * @return 0 if success, error code(<0) if fail
4890 * @retval PMINFO_R_OK success
4891 * @retval PMINFO_R_EINVAL invalid argument
4892 * @pre pkgmgrinfo_appinfo_get_appinfo()
4893 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4895 static int get_app_ui_gadget(const char *appid)
4899 pkgmgrinfo_appinfo_h handle = NULL;
4900 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4901 if (ret != PMINFO_R_OK)
4903 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4904 if (ret != PMINFO_R_OK) {
4905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4908 printf("app ui_gadget: %d\n", ui_gadget);
4909 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4914 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4917 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4918 * @brief This API gets the application 'support_disable' value from the app ID
4920 * @par This API is for package-manager client application
4921 * @par Sync (or) Async : Synchronous API
4923 * @param[in] handle pointer to application info handle
4924 * @param[out] support_disable pointer to hold package support_disable value
4925 * @return 0 if success, error code(<0) if fail
4926 * @retval PMINFO_R_OK success
4927 * @retval PMINFO_R_EINVAL invalid argument
4928 * @pre pkgmgrinfo_appinfo_get_appinfo()
4929 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4931 static int get_app_support_disable(const char *appid)
4934 bool support_disable;
4935 pkgmgrinfo_appinfo_h handle = NULL;
4936 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4937 if (ret != PMINFO_R_OK)
4939 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4940 if (ret != PMINFO_R_OK) {
4941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4944 printf("app support_disable: %d\n", support_disable);
4945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4950 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4953 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4954 * @brief This API gets the application 'removable' value from the app ID
4956 * @par This API is for package-manager client application
4957 * @par Sync (or) Async : Synchronous API
4959 * @param[in] handle pointer to application info handle
4960 * @param[out] removable pointer to hold package removable value
4961 * @return 0 if success, error code(<0) if fail
4962 * @retval PMINFO_R_OK success
4963 * @retval PMINFO_R_EINVAL invalid argument
4964 * @retval PMINFO_R_ERROR internal error
4965 * @pre pkgmgrinfo_appinfo_get_appinfo()
4966 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4967 * @see pkgmgrinfo_appinfo_get_appid()
4969 static int get_app_removable(const char *appid)
4973 pkgmgrinfo_appinfo_h handle = NULL;
4974 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4975 if (ret != PMINFO_R_OK)
4977 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4978 if (ret != PMINFO_R_OK) {
4979 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4982 printf("app removable: %d\n", removable);
4983 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4988 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4991 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4992 * @brief This API gets the application 'system' value from the app ID
4994 * @par This API is for package-manager client application
4995 * @par Sync (or) Async : Synchronous API
4997 * @param[in] handle pointer to application info handle
4998 * @param[out] system pointer to hold package system value
4999 * @return 0 if success, error code(<0) if fail
5000 * @retval PMINFO_R_OK success
5001 * @retval PMINFO_R_EINVAL invalid argument
5002 * @retval PMINFO_R_ERROR internal error
5003 * @pre pkgmgrinfo_appinfo_get_appinfo()
5004 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5005 * @see pkgmgrinfo_appinfo_get_appid()
5007 static int get_app_system(const char *appid)
5010 bool system = false;
5011 pkgmgrinfo_appinfo_h handle = NULL;
5012 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5013 if (ret != PMINFO_R_OK)
5015 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5016 if (ret != PMINFO_R_OK) {
5017 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5020 printf("app system: %d\n", system);
5021 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5026 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5030 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5031 * @brief This API gets the application 'is_disable' value from the app ID
5033 * @par This API is for package-manager client application
5034 * @par Sync (or) Async : Synchronous API
5036 * @param[in] handle pointer to application info handle
5037 * @param[out] disabled pointer to hold application is_disabled value
5038 * @return 0 if success, error code(<0) if fail
5039 * @retval PMINFO_R_OK success
5040 * @retval PMINFO_R_EINVAL invalid argument
5041 * @pre pkgmgrinfo_appinfo_get_appinfo()
5042 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5044 static int get_app_is_disable(const char *appid)
5048 pkgmgrinfo_appinfo_h handle = NULL;
5049 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5050 if (ret != PMINFO_R_OK)
5052 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5053 if (ret != PMINFO_R_OK) {
5054 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5057 printf("app is_disable: %d\n", is_disable);
5058 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5063 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5066 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5067 * @brief This API gets whether the given application is global application or user application
5069 * @par This API is for package-manager client application
5070 * @par Sync (or) Async : Synchronous API
5072 * @param[in] handle pointer to application info handle
5073 * @param[in] global pointer to hold application global value
5074 * @return 0 if success, error code(<0) if fail
5075 * @retval PMINFO_R_OK success
5076 * @retval PMINFO_R_EINVAL invalid argument
5077 * @retval PMINFO_R_ERROR internal error
5078 * @pre pkgmgrinfo_appinfo_get_appinfo()
5079 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5080 * @see pkgmgrinfo_appinfo_get_appid()
5081 static int get_app_is_global(const char *appid)
5085 pkgmgrinfo_appinfo_h handle = NULL;
5086 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5087 if (ret != PMINFO_R_OK)
5089 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5090 if (ret != PMINFO_R_OK) {
5091 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5094 printf("app is_global: %d\n", global);
5095 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5100 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5103 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5104 * @brief This API gets the application 'splash_screen_display' value from the app ID
5106 * @par This API is for package-manager client application
5107 * @par Sync (or) Async : Synchronous API
5109 * @param[in] handle pointer to application info handle
5110 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5111 * @return 0 if success, error code(<0) if fail
5112 * @retval PMINFO_R_OK success
5113 * @retval PMINFO_R_EINVAL invalid argument
5114 * @retval PMINFO_R_ERROR internal error
5116 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5119 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5120 * @brief This API gets the application 'setup_appid' value from the app ID
5122 * @par This API is for package-manager client application
5123 * @par Sync (or) Async : Synchronous API
5125 * @param[in] handle pointer to application info handle
5126 * @param[out] setup_appid pointer to hold package setup_appid value
5127 * @return 0 if success, error code(<0) if fail
5128 * @retval PMINFO_R_OK success
5129 * @retval PMINFO_R_EINVAL invalid argument
5130 * @retval PMINFO_R_ERROR internal error
5132 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5135 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5136 * @brief This API gets the application 'support_ambient' value from the app ID
5138 * @par This API is for package-manager client application
5139 * @par Sync (or) Async : Synchronous API
5141 * @param[in] handle pointer to application info handle
5142 * @param[out] support_ambient pointer to hold package support_ambient value
5143 * @return 0 if success, error code(<0) if fail
5144 * @retval PMINFO_R_OK success
5145 * @retval PMINFO_R_EINVAL invalid argument
5146 * @retval PMINFO_R_ERROR internal error
5148 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5151 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5152 * @brief This API destroys the application information handle freeing up all the resources
5154 * @par This API is for package-manager client application
5155 * @par Sync (or) Async : Synchronous API
5157 * @param[in] handle pointer to the application info handle.
5158 * @return 0 if success, error code(<0) if fail
5159 * @retval PMINFO_R_OK success
5160 * @retval PMINFO_R_EINVAL invalid argument
5161 * @retval PMINFO_R_ERROR internal error
5162 * @pre pkgmgrinfo_appinfo_get_appinfo()
5164 * @see pkgmgrinfo_appinfo_get_pkgid()
5165 * @see pkgmgrinfo_appinfo_is_multiple()
5167 static int get_app_type(const char *appid)
5171 pkgmgrinfo_appinfo_h handle;
5172 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5173 if (ret != PMINFO_R_OK)
5175 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5176 if (ret != PMINFO_R_OK) {
5177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5180 printf("apptype: %s\n", type);
5181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5186 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5189 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5190 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5191 The query will search the entire application information collected from the manifest file of all the installed packages
5193 * @par This API is for package-manager client application
5194 * @par Sync (or) Async : Synchronous API
5196 * @param[out] handle pointer to the application info filter handle.
5197 * @return 0 if success, error code(<0) if fail
5198 * @retval PMINFO_R_OK success
5199 * @retval PMINFO_R_EINVAL invalid argument
5200 * @retval PMINFO_R_ERROR internal error
5202 * @post pkgmgrinfo_appinfo_filter_destroy()
5203 * @see pkgmgrinfo_appinfo_filter_count()
5204 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5206 static int get_capp_count()
5210 pkgmgrinfo_appinfo_filter_h handle;
5211 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5212 if (ret != PMINFO_R_OK)
5214 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5215 if (ret != PMINFO_R_OK) {
5216 pkgmgrinfo_appinfo_filter_destroy(handle);
5219 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5220 if (ret != PMINFO_R_OK) {
5221 pkgmgrinfo_appinfo_filter_destroy(handle);
5224 printf("No of capp: %d\n", count);
5225 pkgmgrinfo_appinfo_filter_destroy(handle);
5230 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5233 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5234 * @brief This API destroys the application information filter handle freeing up all the resources
5236 * @par This API is for package-manager client application
5237 * @par Sync (or) Async : Synchronous API
5239 * @param[in] handle pointer to the application info filter handle.
5240 * @return 0 if success, error code(<0) if fail
5241 * @retval PMINFO_R_OK success
5242 * @retval PMINFO_R_EINVAL invalid argument
5243 * @retval PMINFO_R_ERROR internal error
5244 * @pre pkgmgrinfo_appinfo_filter_create()
5246 * @see pkgmgrinfo_appinfo_filter_count()
5247 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5249 static int get_capp_count()
5253 pkgmgrinfo_appinfo_filter_h handle;
5254 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5255 if (ret != PMINFO_R_OK)
5257 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5258 if (ret != PMINFO_R_OK) {
5259 pkgmgrinfo_appinfo_filter_destroy(handle);
5262 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5263 if (ret != PMINFO_R_OK) {
5264 pkgmgrinfo_appinfo_filter_destroy(handle);
5267 printf("No of capp: %d\n", count);
5268 pkgmgrinfo_appinfo_filter_destroy(handle);
5273 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5276 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5277 * @brief This API adds a boolean filter property to the filter handle
5279 * @par This API is for package-manager client application
5280 * @par Sync (or) Async : Synchronous API
5282 * @param[in] handle pointer to the application info filter handle.
5283 * @param[in] property boolean property name.
5284 * @param[in] value value corresponding to the property.
5285 * @return 0 if success, error code(<0) if fail
5286 * @retval PMINFO_R_OK success
5287 * @retval PMINFO_R_EINVAL invalid argument
5288 * @retval PMINFO_R_ERROR internal error
5289 * @pre pkgmgrinfo_appinfo_filter_create()
5290 * @post pkgmgrinfo_appinfo_filter_destroy()
5291 * @see pkgmgrinfo_appinfo_filter_count()
5292 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5294 static int get_taskmanageable_app_count()
5298 pkgmgrinfo_appinfo_filter_h handle;
5299 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5300 if (ret != PMINFO_R_OK)
5302 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5303 if (ret != PMINFO_R_OK) {
5304 pkgmgrinfo_appinfo_filter_destroy(handle);
5307 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5308 if (ret != PMINFO_R_OK) {
5309 pkgmgrinfo_appinfo_filter_destroy(handle);
5312 printf("No of taskmanageable apps: %d\n", count);
5313 pkgmgrinfo_appinfo_filter_destroy(handle);
5318 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5319 const char *property, const bool value);
5322 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5323 * @brief This API adds an integer filter property to the filter handle
5325 * @par This API is for package-manager client application
5326 * @par Sync (or) Async : Synchronous API
5328 * @param[in] handle pointer to the application info filter handle.
5329 * @param[in] property integer property name.
5330 * @param[in] value value corresponding to the property.
5331 * @return 0 if success, error code(<0) if fail
5332 * @retval PMINFO_R_OK success
5333 * @retval PMINFO_R_EINVAL invalid argument
5334 * @retval PMINFO_R_ERROR internal error
5335 * @pre pkgmgrinfo_appinfo_filter_create()
5336 * @post pkgmgrinfo_appinfo_filter_destroy()
5337 * @see pkgmgrinfo_appinfo_filter_count()
5338 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5340 static int get_taskmanageable_app_count()
5344 pkgmgrinfo_appinfo_filter_h handle;
5345 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5346 if (ret != PMINFO_R_OK)
5348 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5349 if (ret != PMINFO_R_OK) {
5350 pkgmgrinfo_appinfo_filter_destroy(handle);
5353 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5354 if (ret != PMINFO_R_OK) {
5355 pkgmgrinfo_appinfo_filter_destroy(handle);
5358 printf("No of apps: %d\n", count);
5359 pkgmgrinfo_appinfo_filter_destroy(handle);
5364 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5365 const char *property, const int value);
5368 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5369 * @brief This API adds a string filter property to the filter handle
5371 * @par This API is for package-manager client application
5372 * @par Sync (or) Async : Synchronous API
5374 * @param[in] handle pointer to the application info filter handle.
5375 * @param[in] property string property name.
5376 * @param[in] value value corresponding to the property.
5377 * @return 0 if success, error code(<0) if fail
5378 * @retval PMINFO_R_OK success
5379 * @retval PMINFO_R_EINVAL invalid argument
5380 * @retval PMINFO_R_ERROR internal error
5381 * @pre pkgmgrinfo_appinfo_filter_create()
5382 * @post pkgmgrinfo_appinfo_filter_destroy()
5383 * @see pkgmgrinfo_appinfo_filter_count()
5384 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5386 static int get_capp_count()
5390 pkgmgrinfo_appinfo_filter_h handle;
5391 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5392 if (ret != PMINFO_R_OK)
5394 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5395 if (ret != PMINFO_R_OK) {
5396 pkgmgrinfo_appinfo_filter_destroy(handle);
5399 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5400 if (ret != PMINFO_R_OK) {
5401 pkgmgrinfo_appinfo_filter_destroy(handle);
5404 printf("No of capp: %d\n", count);
5405 pkgmgrinfo_appinfo_filter_destroy(handle);
5410 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5411 const char *property, const char *value);
5414 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5415 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5417 * @par This API is for package-manager client application
5418 * @par Sync (or) Async : Synchronous API
5420 * @param[in] handle pointer to the application info filter handle.
5421 * @param[in] app_cb callback function.
5422 * @param[in] user_data user data to be passed to the callback function
5423 * @return 0 if success, error code(<0) if fail
5424 * @retval PMINFO_R_OK success
5425 * @retval PMINFO_R_EINVAL invalid argument
5426 * @retval PMINFO_R_ERROR internal error
5427 * @pre pkgmgrinfo_appinfo_filter_create()
5428 * @post pkgmgrinfo_appinfo_filter_destroy()
5429 * @see pkgmgrinfo_appinfo_filter_count()
5431 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5434 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5435 printf("appid : %s\n", appid);
5439 static int get_capp_list()
5442 pkgmgrinfo_appinfo_filter_h handle;
5443 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5444 if (ret != PMINFO_R_OK)
5446 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5447 if (ret != PMINFO_R_OK) {
5448 pkgmgrinfo_appinfo_filter_destroy(handle);
5451 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5452 if (ret != PMINFO_R_OK) {
5453 pkgmgrinfo_appinfo_filter_destroy(handle);
5456 pkgmgrinfo_appinfo_filter_destroy(handle);
5461 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5462 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5463 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5464 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5467 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5468 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5469 * @brief This API counts the application that satisfy the filter conditions
5471 * @par This API is for package-manager client application
5472 * @par Sync (or) Async : Synchronous API
5474 * @param[in] handle pointer to the application info filter handle.
5475 * @param[in] count pointer to store count value
5476 * @param[in] uid the addressee user id of the instruction
5477 * @return 0 if success, error code(<0) if fail
5478 * @retval PMINFO_R_OK success
5479 * @retval PMINFO_R_EINVAL invalid argument
5480 * @retval PMINFO_R_ERROR internal error
5481 * @pre pkgmgrinfo_appinfo_filter_create()
5482 * @post pkgmgrinfo_appinfo_filter_destroy()
5483 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5485 static int get_capp_count()
5489 pkgmgrinfo_appinfo_filter_h handle;
5490 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5491 if (ret != PMINFO_R_OK)
5493 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5494 if (ret != PMINFO_R_OK) {
5495 pkgmgrinfo_appinfo_filter_destroy(handle);
5498 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5499 if (ret != PMINFO_R_OK) {
5500 pkgmgrinfo_appinfo_filter_destroy(handle);
5503 printf("No of capp: %d\n", count);
5504 pkgmgrinfo_appinfo_filter_destroy(handle);
5509 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5510 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5512 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5513 * @brief This API creates the application's metadata information filter handle from db.
5515 * @par This API is for package-manager client application
5516 * @par Sync (or) Async : Synchronous API
5518 * @param[out] handle pointer to the application metadata info filter handle.
5519 * @return 0 if success, error code(<0) if fail
5520 * @retval PMINFO_R_OK success
5521 * @retval PMINFO_R_EINVAL invalid argument
5522 * @retval PMINFO_R_ERROR internal error
5524 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5525 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5527 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5530 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5531 printf("appid : %s\n", appid);
5535 static int get_app_list(const char *mkey, const char *mvalue)
5538 pkgmgrinfo_appinfo_metadata_filter_h handle;
5539 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5540 if (ret != PMINFO_R_OK)
5542 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5543 if (ret != PMINFO_R_OK) {
5544 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5547 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5548 if (ret != PMINFO_R_OK) {
5549 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5552 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5557 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5560 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5561 * @brief This API destroys the application's metadata information filter handle.
5563 * @par This API is for package-manager client application
5564 * @par Sync (or) Async : Synchronous API
5566 * @param[in] handle pointer to the application metadata info filter handle.
5567 * @return 0 if success, error code(<0) if fail
5568 * @retval PMINFO_R_OK success
5569 * @retval PMINFO_R_EINVAL invalid argument
5570 * @retval PMINFO_R_ERROR internal error
5571 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5573 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5575 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5578 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5579 printf("appid : %s\n", appid);
5583 static int get_app_list(const char *mkey, const char *mvalue)
5586 pkgmgrinfo_appinfo_metadata_filter_h handle;
5587 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5588 if (ret != PMINFO_R_OK)
5590 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5591 if (ret != PMINFO_R_OK) {
5592 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5595 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5596 if (ret != PMINFO_R_OK) {
5597 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5600 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5605 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5608 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5609 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5610 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5612 * @par This API is for package-manager client application
5613 * @par Sync (or) Async : Synchronous API
5615 * @param[in] handle pointer to the application metadata info filter handle.
5616 * @param[in] key pointer to metadata key
5617 * @param[in] value pointer to metadata value
5618 * @return 0 if success, error code(<0) if fail
5619 * @retval PMINFO_R_OK success
5620 * @retval PMINFO_R_EINVAL invalid argument
5621 * @retval PMINFO_R_ERROR internal error
5622 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5623 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5624 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5626 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5629 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5630 printf("appid : %s\n", appid);
5634 static int get_app_list(const char *mkey, const char *mvalue)
5637 pkgmgrinfo_appinfo_metadata_filter_h handle;
5638 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5639 if (ret != PMINFO_R_OK)
5641 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5642 if (ret != PMINFO_R_OK) {
5643 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5646 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5647 if (ret != PMINFO_R_OK) {
5648 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5651 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5656 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5657 const char *key, const char *value);
5660 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5661 * @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)
5662 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5663 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5664 * negative value, no more callbacks will be called and API will return.
5666 * @par This API is for package-manager client application
5667 * @par Sync (or) Async : Synchronous API
5669 * @param[in] handle pointer to the application metadata info filter handle.
5670 * @param[in] app_cb function pointer to callback
5671 * @param[in] user_data pointer to user data
5672 * @param[in] uid the addressee user id of the instruction
5673 * @return 0 if success, error code(<0) if fail
5674 * @retval PMINFO_R_OK success
5675 * @retval PMINFO_R_EINVAL invalid argument
5676 * @retval PMINFO_R_ERROR internal error
5677 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5678 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5680 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5683 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5684 printf("appid : %s\n", appid);
5688 static int get_app_list(const char *mkey, const char *mvalue)
5691 pkgmgrinfo_appinfo_metadata_filter_h handle;
5692 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5693 if (ret != PMINFO_R_OK)
5695 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5696 if (ret != PMINFO_R_OK) {
5697 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5700 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5701 if (ret != PMINFO_R_OK) {
5702 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5705 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5710 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5711 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5712 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5713 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5716 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5717 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5718 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5719 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5720 * @brief This API gets the list of app-control for a particular application
5722 * @par This API is for package-manager client application
5723 * @par Sync (or) Async : Synchronous API
5724 * @param[in] handle pointer to the application info handle.
5725 * @param[in] appcontrol_func callback function for list
5726 * @param[in] user_data user data to be passed to callback function
5727 * @return 0 if success, error code(<0) if fail
5728 * @retval PMINFO_R_OK success
5729 * @retval PMINFO_R_EINVAL invalid argument
5730 * @retval PMINFO_R_ERROR internal error
5731 * @pre pkgmgrinfo_appinfo_get_appinfo()
5732 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5734 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5735 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5737 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5738 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5741 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5742 * @brief This API creates the package cert information handle to get data from db.
5744 * @par This API is for package-manager client application
5745 * @par Sync (or) Async : Synchronous API
5747 * @param[out] handle pointer to the package cert handle.
5748 * @return 0 if success, error code(<0) if fail
5749 * @retval PMINFO_R_OK success
5750 * @retval PMINFO_R_EINVAL invalid argument
5751 * @retval PMINFO_R_ERROR internal error
5753 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5754 * @see pkgmgrinfo_pkginfo_get_cert_value()
5755 * @see pkgmgrinfo_pkginfo_load_certinfo()
5757 static int get_cert_info(const char *pkgid)
5760 pkgmgrinfo_certinfo_h handle;
5761 char *auth_cert = NULL;
5762 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5763 if (ret != PMINFO_R_OK)
5765 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5766 if (ret != PMINFO_R_OK) {
5767 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5770 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5771 if (ret != PMINFO_R_OK) {
5772 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5775 printf("Author root certificate: %s\n", auth_root);
5776 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5781 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5784 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5785 * @brief This API loads the package cert information handle with data from db.
5787 * @par This API is for package-manager client application
5788 * @par Sync (or) Async : Synchronous API
5790 * @param[in] pkgid pointer to the package ID.
5791 * @param[in] handle pointer to the package cert handle.
5792 * @return 0 if success, error code(<0) if fail
5793 * @retval PMINFO_R_OK success
5794 * @retval PMINFO_R_EINVAL invalid argument
5795 * @retval PMINFO_R_ERROR internal error
5796 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5797 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5798 * @see pkgmgrinfo_pkginfo_get_cert_value()
5800 static int get_cert_info(const char *pkgid)
5803 pkgmgrinfo_certinfo_h handle;
5804 char *auth_cert = NULL;
5805 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5806 if (ret != PMINFO_R_OK)
5808 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5809 if (ret != PMINFO_R_OK) {
5810 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5813 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5814 if (ret != PMINFO_R_OK) {
5815 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5818 printf("Author root certificate: %s\n", auth_root);
5819 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5824 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5827 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5828 * @brief This API gets the package cert information from the handle
5830 * @par This API is for package-manager client application
5831 * @par Sync (or) Async : Synchronous API
5833 * @param[in] handle pointer to the package cert handle.
5834 * @param[in] cert_type certificate type
5835 * @param[out] cert_value pointer to hold certificate value
5836 * @return 0 if success, error code(<0) if fail
5837 * @retval PMINFO_R_OK success
5838 * @retval PMINFO_R_EINVAL invalid argument
5839 * @retval PMINFO_R_ERROR internal error
5840 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5841 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5842 * @see pkgmgrinfo_pkginfo_load_certinfo()
5844 static int get_cert_info(const char *pkgid)
5847 pkgmgrinfo_certinfo_h handle;
5848 char *auth_cert = NULL;
5849 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5850 if (ret != PMINFO_R_OK)
5852 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5853 if (ret != PMINFO_R_OK) {
5854 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5857 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5858 if (ret != PMINFO_R_OK) {
5859 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5862 printf("Author root certificate: %s\n", auth_root);
5863 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5868 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5871 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5872 * @brief This API destroys the package cert information handle freeing up all the resources
5874 * @par This API is for package-manager client application
5875 * @par Sync (or) Async : Synchronous API
5877 * @param[in] handle pointer to the package cert handle.
5878 * @return 0 if success, error code(<0) if fail
5879 * @retval PMINFO_R_OK success
5880 * @retval PMINFO_R_EINVAL invalid argument
5881 * @retval PMINFO_R_ERROR internal error
5882 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5884 * @see pkgmgrinfo_pkginfo_load_certinfo()
5886 static int get_cert_info(const char *pkgid)
5889 pkgmgrinfo_certinfo_h handle;
5890 char *auth_cert = NULL;
5891 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5892 if (ret != PMINFO_R_OK)
5894 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5895 if (ret != PMINFO_R_OK) {
5896 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5899 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5900 if (ret != PMINFO_R_OK) {
5901 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5904 printf("Author root certificate: %s\n", auth_root);
5905 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5910 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5913 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5914 * @brief This API deletes the package cert information from DB
5916 * @par This API is for package-manager client application
5917 * @par Sync (or) Async : Synchronous API
5919 * @param[in] pkgid pointer to the package ID.
5920 * @return 0 if success, error code(<0) if fail
5921 * @retval PMINFO_R_OK success
5922 * @retval PMINFO_R_EINVAL invalid argument
5923 * @retval PMINFO_R_ERROR internal error
5927 static int delete_cert_info(const char *pkgid)
5930 ret = pkgmgrinfo_delete_certinfo(pkgid);
5931 if (ret != PMINFO_R_OK)
5937 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5938 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5941 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5942 * @brief This API creates the package cert information handle to set data in db.
5944 * @par This API is for package-manager client application
5945 * @par Sync (or) Async : Synchronous API
5947 * @param[out] handle pointer to the package cert handle.
5948 * @return 0 if success, error code(<0) if fail
5949 * @retval PMINFO_R_OK success
5950 * @retval PMINFO_R_EINVAL invalid argument
5951 * @retval PMINFO_R_ERROR internal error
5953 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5954 * @see pkgmgrinfo_set_cert_value()
5955 * @see pkgmgrinfo_save_certinfo()
5957 static int set_cert_in_db(const char *pkgid)
5960 pkgmgrinfo_instcertinfo_h handle;
5961 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5962 if (ret != PMINFO_R_OK)
5964 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5965 if (ret != PMINFO_R_OK) {
5966 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5969 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5970 if (ret != PMINFO_R_OK) {
5971 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5974 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5979 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5982 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5983 * @brief This API sets the package cert information in the handle.
5985 * @par This API is for package-manager client application
5986 * @par Sync (or) Async : Synchronous API
5988 * @param[in] handle pointer to the package cert handle.
5989 * @param[in] cert_type certificate type.
5990 * @param[in] cert_value certificate value.
5991 * @return 0 if success, error code(<0) if fail
5992 * @retval PMINFO_R_OK success
5993 * @retval PMINFO_R_EINVAL invalid argument
5994 * @retval PMINFO_R_ERROR internal error
5995 * @pre pkgmgrinfo_create_certinfo_set_handle()
5996 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5997 * @see pkgmgrinfo_save_certinfo()
5999 static int set_cert_in_db(const char *pkgid)
6002 pkgmgrinfo_instcertinfo_h handle;
6003 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6004 if (ret != PMINFO_R_OK)
6006 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6007 if (ret != PMINFO_R_OK) {
6008 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6011 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6012 if (ret != PMINFO_R_OK) {
6013 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6016 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6021 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6024 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6025 * @brief This API saves the package cert information in the DB.
6027 * @par This API is for package-manager client application
6028 * @par Sync (or) Async : Synchronous API
6030 * @param[in] pkgid pointer to the package ID.
6031 * @param[in] handle pointer to the package cert handle.
6032 * @return 0 if success, error code(<0) if fail
6033 * @retval PMINFO_R_OK success
6034 * @retval PMINFO_R_EINVAL invalid argument
6035 * @retval PMINFO_R_ERROR internal error
6036 * @pre pkgmgrinfo_create_certinfo_set_handle()
6037 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6038 * @see pkgmgrinfo_save_certinfo()
6040 static int set_cert_in_db(const char *pkgid)
6043 pkgmgrinfo_instcertinfo_h handle;
6044 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6045 if (ret != PMINFO_R_OK)
6047 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6048 if (ret != PMINFO_R_OK) {
6049 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6052 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6053 if (ret != PMINFO_R_OK) {
6054 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6057 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6062 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6065 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6066 * @brief This API destroys the package cert information handle freeing up all the resources.
6068 * @par This API is for package-manager client application
6069 * @par Sync (or) Async : Synchronous API
6071 * @param[in] handle pointer to the package cert handle.
6072 * @return 0 if success, error code(<0) if fail
6073 * @retval PMINFO_R_OK success
6074 * @retval PMINFO_R_EINVAL invalid argument
6075 * @retval PMINFO_R_ERROR internal error
6076 * @pre pkgmgrinfo_create_certinfo_set_handle()
6078 * @see pkgmgrinfo_save_certinfo()
6080 static int set_cert_in_db(const char *pkgid)
6083 pkgmgrinfo_instcertinfo_h handle;
6084 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6085 if (ret != PMINFO_R_OK)
6087 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6088 if (ret != PMINFO_R_OK) {
6089 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6092 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6093 if (ret != PMINFO_R_OK) {
6094 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6097 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6102 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6105 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6106 * @brief This API gets the application 'guest mode visibility' value from the DB
6108 * @par This API is for package-manager client application
6109 * @par Sync (or) Async : Synchronous API
6111 * @param[in] handle pointer to application info handle
6112 * @param[out] status pointer to hold app guest mode visibility value
6113 * @return 0 if success, error code(<0) if fail
6114 * @retval PMINFO_R_OK success
6115 * @retval PMINFO_R_EINVAL invalid argument
6116 * @retval PMINFO_R_ERROR internal error
6117 * @pre pkgmgrinfo_appinfo_get_appinfo()
6118 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6119 * @see pkgmgrinfo_appinfo_get_appid()
6120 * @see pkgmgrinfo_appinfo_is_multiple()
6122 static int get_app_guestmode_visibility(const char *appid)
6126 pkgmgrinfo_appinfo_h handle;
6127 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6128 if (ret != PMINFO_R_OK)
6130 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6131 if (ret != PMINFO_R_OK) {
6132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6135 printf("app guest mode visibility: %d\n", status);
6136 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6141 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6144 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6145 * @brief This API sets the package 'installed_storage' value in db
6147 * @par This API is for package-manager client application
6148 * @par Sync (or) Async : Synchronous API
6150 * @param[in] pkgid pointer to the package ID.
6151 * @param[in] location package install location
6152 * @param[in] external_pkg_path image path if pkg has installed at external storage
6153 * @return 0 if success, error code(<0) if fail
6154 * @retval PMINFO_R_OK success
6155 * @retval PMINFO_R_EINVAL invalid argument
6156 * @retval PMINFO_R_ERROR internal error
6158 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6162 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6163 if (ret != PMINFO_R_OK) {
6170 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6171 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6173 /* version compare */
6174 int pkgmgrinfo_compare_package_version(const char *current_version,
6175 const char *target_version, pkgmgrinfo_version_compare_type *res);
6178 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6179 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6181 * @brief This API gets the list of dependency of a particular package
6183 * @par This API is for package-manager client application
6184 * @par Sync (or) Async : Synchronous API
6185 * @param[in] handle pointer to the package info handle.
6186 * @param[in] dependency_cb callback function for list
6187 * @param[in] user_data user data to be passed to callback function
6188 * @return 0 if success, error code(<0) if fail
6189 * @retval PMINFO_R_OK success
6190 * @retval PMINFO_R_EINVAL invalid argument
6191 * @retval PMINFO_R_ERROR internal error
6192 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6193 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6195 int dependency_cb(const char *from const char *to, const char *type,
6196 const char *required_version,void *user_data)
6198 printf("this package %s %s", type, to);
6199 if (required_version)
6200 printf("required version : %s", required_version);
6204 static int list_dependency(const char *package)
6207 pkgmgrinfo_pkginfo_h handle;
6208 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6209 if (ret != PMINFO_R_OK)
6211 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6212 if (ret != PMINFO_R_OK) {
6213 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6216 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6221 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6222 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6226 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6227 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6229 * @brief This API gets the list of packages which has dependency directly
6230 * and indirectly of a particular package
6232 * @par This API is for package-manager client application
6233 * @par Sync (or) Async : Synchronous API
6234 * @param[in] handle pointer to the package info handle.
6235 * @param[in] dependency_cb callback function for list
6236 * @param[in] user_data user data to be passed to callback function
6237 * @return 0 if success, error code(<0) if fail
6238 * @retval PMINFO_R_OK success
6239 * @retval PMINFO_R_EINVAL invalid argument
6240 * @retval PMINFO_R_ERROR internal error
6241 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6242 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6244 int dependency_cb(const char *from, const char *to, const char *type,
6245 const char *required_version,void *user_data)
6247 printf("%s %s %s package", from, to, type);
6248 if (required_version)
6249 printf("required version : %s", required_version);
6253 static int list_depends_on(const char *package)
6256 pkgmgrinfo_pkginfo_h handle;
6257 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6258 if (ret != PMINFO_R_OK)
6260 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6261 if (ret != PMINFO_R_OK) {
6262 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6265 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6270 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6271 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6275 * @fn int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6276 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6278 * @brief This API gets the list of allowed package for a particular package
6280 * @par This API is for package-manager client application
6281 * @par Sync (or) Async : Synchronous API
6282 * @param[in] handle pointer to the package info handle.
6283 * @param[in] res_allowed_package_cb callback function for list
6284 * @param[in] user_data user data to be passed to callback function
6285 * @return 0 if success, error code(<0) if fail
6286 * @retval PMINFO_R_OK success
6287 * @retval PMINFO_R_EINVAL invalid argument
6288 * @retval PMINFO_R_ERROR internal error
6289 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6290 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6292 int res_allowed_package_cb(const char *allowed_package,
6293 required_privilege_h handle, void *user_data)
6295 printf("allowed package : %s", allowed_package);
6300 static int list_res_allowed_package(const char *package)
6303 pkgmgrinfo_pkginfo_h handle;
6304 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6305 if (ret != PMINFO_R_OK)
6307 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6308 if (ret != PMINFO_R_OK) {
6309 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6317 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6318 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6322 * @fn int pkgmgrinfo_pkginfo_foreach_required_privilege(
6323 required_privilege_h handle,
6324 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6326 * @brief This API gets the list of allowed package's required privileges
6328 * @par This API is for package-manager client application
6329 * @par Sync (or) Async : Synchronous API
6330 * @param[in] handle pointer to the required privilege handle.
6331 * @param[in] privilege_func callback function for list
6332 * @param[in] user_data user data to be passed to callback function
6333 * @return 0 if success, error code(<0) if fail
6334 * @retval PMINFO_R_OK success
6335 * @retval PMINFO_R_EINVAL invalid argument
6336 * @pre pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6339 int privilege_func(const char *privilege_name, void *user_data)
6341 printf("required privilege : %s", privilege_name);
6346 int res_allowed_package_cb(const char *allowed_package,
6347 required_privilege_h handle, void *user_data)
6350 printf("allowed package : %s", allowed_package);
6352 ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6353 if (ret != PMINFO_R_OK)
6359 static int list_res_allowed_package(const char *package)
6362 pkgmgrinfo_pkginfo_h handle;
6363 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6364 if (ret != PMINFO_R_OK)
6366 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6367 if (ret != PMINFO_R_OK) {
6368 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6371 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6376 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6377 required_privilege_h handle,
6378 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6382 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6383 * @brief This API gets list of installed packages using flag that used for masking package's information
6385 * @par This API is for package-manager client application
6386 * @par Sync (or) Async : Synchronous API
6387 * @param[in] pkg_list_cb iteration function for list
6388 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6389 * @param[in] user_data user data to be passed to callback function
6390 * @return 0 if success, error code(<0) if fail
6391 * @retval PMINFO_R_OK success
6392 * @retval PMINFO_R_EINVAL invalid argument
6393 * @retval PMINFO_R_ERROR internal error
6396 * @see pkgmgrinfo_pkginfo_get_option
6398 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6400 char *label1 = NULL;
6401 char *label2 = NULL;
6402 label1 = (char *)user_data;
6403 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6404 if (strcmp(label1, label2) == 0)
6410 static int list_pkgs()
6413 char *label = "helloworld";
6414 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6415 if (ret != PMINFO_R_OK)
6421 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6422 int flag, void *user_data, uid_t uid);
6423 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6424 int flag, void *user_data);
6427 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6428 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6430 * @par This API is for package-manager client application
6431 * @par Sync (or) Async : Synchronous API
6432 * @param[in] app_func iteration function for list
6433 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6434 * @param[in] user_data user data to be passed to callback function
6435 * @return 0 if success, error code(<0) if fail
6436 * @retval PMINFO_R_OK success
6437 * @retval PMINFO_R_EINVAL invalid argument
6438 * @retval PMINFO_R_ERROR internal error
6441 * @see pkgmgrinfo_appinfo_get_option
6443 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6446 char *label1 = NULL;
6447 char *label2 = NULL;
6448 label1 = (char *)user_data;
6449 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6450 if (ret != PMINFO_R_OK) {
6451 printf("pkgmgrinfo_appinfo_get_label fail");
6454 if (strcmp(label1, label2) == 0)
6460 static int list_apps()
6463 char *label = "helloworld";
6464 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6465 if (ret != PMINFO_R_OK)
6471 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6472 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6474 int pkgmgrinfo_appinfo_get_installed_list_full(
6475 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6478 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6479 * @brief This API creates the package archive information handle from given path
6481 * @par This API is for package-manager client application
6482 * @par Sync (or) Async : Synchronous API
6484 * @param[in] path path of package archive
6485 * @param[out] handle pointer to the package archive info handle
6486 * @return 0 if success, error code(<0) if fail
6487 * @retval PMINFO_R_OK success
6488 * @retval PMINFO_R_EINVAL invalid argument
6489 * @retval PMINFO_R_ERROR internal error
6491 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6493 static int get_pkg_archive_type(const char *path)
6497 pkgmgrinfo_archiveinfo_h handle;
6498 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6499 if (ret != PMINFO_R_OK)
6501 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6502 if (ret != PMINFO_R_OK) {
6503 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6506 printf("pkg archive type: %s\n", type);
6507 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6512 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6513 pkgmgrinfo_archiveinfo_h *handle);
6516 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6517 * @brief This API destroys the package archive information handle freeing up all the resources
6519 * @par This API is for package-manager client application
6520 * @par Sync (or) Async : Synchronous API
6522 * @param[in] handle pointer to the package archive info handle
6523 * @return 0 if success, error code(<0) if fail
6524 * @retval PMINFO_R_OK success
6525 * @retval PMINFO_R_EINVAL invalid argument
6526 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6529 static int get_pkg_archive_type(const char *path)
6533 pkgmgrinfo_archiveinfo_h handle;
6534 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6535 if (ret != PMINFO_R_OK)
6537 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6538 if (ret != PMINFO_R_OK) {
6539 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6542 printf("pkg archive type: %s\n", type);
6543 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6548 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6551 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6552 * @brief This API gets the package id from the package archive info handle
6554 * @par This API is for package-manager client application
6555 * @par Sync (or) Async : Synchronous API
6557 * @param[in] handle pointer to package archive info handle
6558 * @param[out] pkgid pointer to hold package id
6559 * @return 0 if success, error code(<0) if fail
6560 * @retval PMINFO_R_OK success
6561 * @retval PMINFO_R_EINVAL invalid argument
6562 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6563 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6565 static int get_pkg_archive_id(const char *path)
6568 char *pkg_id = NULL;
6569 pkgmgrinfo_archiveinfo_h handle;
6570 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6571 if (ret != PMINFO_R_OK)
6573 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6574 if (ret != PMINFO_R_OK) {
6575 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6578 printf("pkg archive id: %s\n", pkg_id);
6579 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6584 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6585 const char **pkgid);
6588 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6589 * @brief This API gets the package type from the package archive info handle
6591 * @par This API is for package-manager client application
6592 * @par Sync (or) Async : Synchronous API
6594 * @param[in] handle pointer to package archive info handle
6595 * @param[out] type pointer to hold package type
6596 * @return 0 if success, error code(<0) if fail
6597 * @retval PMINFO_R_OK success
6598 * @retval PMINFO_R_EINVAL invalid argument
6599 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6600 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6602 static int get_pkg_archive_type(const char *path)
6606 pkgmgrinfo_archiveinfo_h handle;
6607 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6608 if (ret != PMINFO_R_OK)
6610 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6611 if (ret != PMINFO_R_OK) {
6612 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6615 printf("pkg archive type: %s\n", type);
6616 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6621 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6625 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6626 * @brief This API gets the package version from the package archive info handle
6628 * @par This API is for package-manager client application
6629 * @par Sync (or) Async : Synchronous API
6631 * @param[in] handle pointer to package archive info handle
6632 * @param[out] version pointer to hold package version
6633 * @return 0 if success, error code(<0) if fail
6634 * @retval PMINFO_R_OK success
6635 * @retval PMINFO_R_EINVAL invalid argument
6636 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6637 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6639 static int get_pkg_archive_version(const char *path)
6642 char *version = NULL;
6643 pkgmgrinfo_archiveinfo_h handle;
6644 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6645 if (ret != PMINFO_R_OK)
6647 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6648 if (ret != PMINFO_R_OK) {
6649 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6652 printf("pkg archive version: %s\n", version);
6653 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6658 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6659 const char **version);
6662 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6663 * @brief This API gets the package api version from the package archive info handle
6665 * @par This API is for package-manager client application
6666 * @par Sync (or) Async : Synchronous API
6668 * @param[in] handle pointer to package archive info handle
6669 * @param[out] api_version pointer to hold package api_version
6670 * @return 0 if success, error code(<0) if fail
6671 * @retval PMINFO_R_OK success
6672 * @retval PMINFO_R_EINVAL invalid argument
6673 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6674 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6676 static int get_pkg_archive_api_version(const char *path)
6679 char *api_version = NULL;
6680 pkgmgrinfo_archiveinfo_h handle;
6681 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6682 if (ret != PMINFO_R_OK)
6684 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6685 if (ret != PMINFO_R_OK) {
6686 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6689 printf("pkg archive api_version: %s\n", api_version);
6690 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6695 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6696 const char **api_version);
6699 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
6700 * @brief This API gets the package description from the package archive info handle
6702 * @par This API is for package-manager client application
6703 * @par Sync (or) Async : Synchronous API
6705 * @param[in] handle pointer to package archive info handle
6706 * @param[out] description pointer to hold package description
6707 * @return 0 if success, error code(<0) if fail
6708 * @retval PMINFO_R_OK success
6709 * @retval PMINFO_R_EINVAL invalid argument
6710 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6711 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6713 static int get_pkg_archive_description(const char *path)
6716 char *description = NULL;
6717 pkgmgrinfo_archiveinfo_h handle;
6718 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6719 if (ret != PMINFO_R_OK)
6721 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
6722 if (ret != PMINFO_R_OK) {
6723 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6726 printf("pkg archive description: %s\n", description);
6727 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6732 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6733 const char **description);
6736 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
6737 * @brief This API gets the package label from the package archive info handle
6739 * @par This API is for package-manager client application
6740 * @par Sync (or) Async : Synchronous API
6742 * @param[in] handle pointer to package archive info handle
6743 * @param[out] label pointer to hold package label
6744 * @return 0 if success, error code(<0) if fail
6745 * @retval PMINFO_R_OK success
6746 * @retval PMINFO_R_EINVAL invalid argument
6747 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6748 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6750 static int get_pkg_archive_label(const char *path)
6754 pkgmgrinfo_archiveinfo_h handle;
6755 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6756 if (ret != PMINFO_R_OK)
6758 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
6759 if (ret != PMINFO_R_OK) {
6760 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6763 printf("pkg archive label: %s\n", label);
6764 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6769 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6770 const char **label);
6773 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
6774 * @brief This API gets the package author from the package archive info handle
6776 * @par This API is for package-manager client application
6777 * @par Sync (or) Async : Synchronous API
6779 * @param[in] handle pointer to package archive info handle
6780 * @param[out] author pointer to hold package author
6781 * @return 0 if success, error code(<0) if fail
6782 * @retval PMINFO_R_OK success
6783 * @retval PMINFO_R_EINVAL invalid argument
6784 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6785 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6787 static int get_pkg_archive_author(const char *path)
6790 char *author = NULL;
6791 pkgmgrinfo_archiveinfo_h handle;
6792 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6793 if (ret != PMINFO_R_OK)
6795 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
6796 if (ret != PMINFO_R_OK) {
6797 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6800 printf("pkg archive author: %s\n", author);
6801 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6806 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6807 const char **author);
6810 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
6811 * @brief This API gets the package icon and size from the package archive info handle
6813 * @par This API is for package-manager client application
6814 * @par Sync (or) Async : Synchronous API
6816 * @param[in] handle pointer to package archive info handle
6817 * @param[out] icon pointer to hold package icon
6818 * @param[out] size pointer to hold size of package icon
6819 * @return 0 if success, error code(<0) if fail
6820 * @retval PMINFO_R_OK success
6821 * @retval PMINFO_R_EINVAL invalid argument
6822 * @retval PMINFO_R_ENOENT no result
6823 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6824 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6826 static int get_pkg_archive_icon(const char *path)
6829 unsigned char *icon = NULL;
6830 size_t icon_size = 0;
6831 pkgmgrinfo_archiveinfo_h handle;
6832 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6833 if (ret != PMINFO_R_OK)
6835 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
6836 if (ret != PMINFO_R_OK) {
6837 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6840 printf("pkg archive icon size : %zu\n", icon_size);
6841 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6846 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6847 const unsigned char **icon, size_t *size);
6850 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
6851 * @brief This API retrieve the dependency information and invoke given callback for it.
6853 * @par This API is for package-manager client application
6854 * @par Sync (or) Async : Synchronous API
6856 * @param[in] handle pointer to package archive info handle
6857 * @param[in] callback callback to be invoked for each retrieved dependency information
6858 * @param[in] user_data user data to be passed to callback
6859 * @return 0 if success, error code(<0) if fail
6860 * @retval PMINFO_R_OK success
6861 * @retval PMINFO_R_EINVAL invalid argument
6862 * @retval PMINFO_R_ERROR internal error
6863 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6864 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6866 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
6869 size_t icon_size = 0;
6870 pkgmgrinfo_archiveinfo_h handle;
6871 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6872 if (ret != PMINFO_R_OK)
6874 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
6875 if (ret != PMINFO_R_OK) {
6876 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6879 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6884 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
6885 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
6888 * @pkgmgrinfo client API end
6896 #endif /* __PKG_INFO_H__ */