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.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_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 * @brief A handle to insert certificate information
79 typedef void* pkgmgrinfo_instcertinfo_h;
82 * @brief Certificate Types to be used for setting information
85 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
86 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
87 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
88 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
89 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
90 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
91 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
92 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
93 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
94 }pkgmgrinfo_instcert_type;
97 PMINFO_CERT_COMPARE_MATCH,
98 PMINFO_CERT_COMPARE_MISMATCH,
99 PMINFO_CERT_COMPARE_LHS_NO_CERT,
100 PMINFO_CERT_COMPARE_RHS_NO_CERT,
101 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
102 PMINFO_CERT_COMPARE_ERROR,
103 } pkgmgrinfo_cert_compare_result_type_e;
106 * @brief API return values
109 PMINFO_R_EINVAL = -2, /**< Invalid argument */
110 PMINFO_R_ERROR = -1, /**< General error */
111 PMINFO_R_OK = 0 /**< General success */
115 * @brief Value to be used when filtering based on install location
117 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
120 * @brief Value to be used when filtering based on install location
122 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
125 * @brief Value to be used when filtering based on install location
127 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
130 * @brief Value to be used when filtering based on app-component
132 #define PMINFO_APPINFO_UI_APP "UI_APP"
135 * @brief Value to be used when filtering based on app-component
137 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
140 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
141 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
142 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
143 }pkgmgrinfo_app_hwacceleration;
146 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
147 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
148 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
149 }pkgmgrinfo_app_screenreader;
152 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
153 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
154 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
155 }pkgmgrinfo_app_recentimage;
158 * @brief A handle to get package information
160 typedef void* pkgmgrinfo_pkginfo_h;
163 * @brief A handle to get application information
165 typedef void* pkgmgrinfo_appinfo_h;
168 * @brief A handle to get certificate information
170 typedef void* pkgmgrinfo_certinfo_h;
173 * @brief A handle to insert package information
175 typedef void* pkgmgrinfo_pkgdbinfo_h;
178 * @brief A handle to filter package information
180 typedef void* pkgmgrinfo_pkginfo_filter_h;
183 * @brief A handle to filter application information
185 typedef void* pkgmgrinfo_appinfo_filter_h;
188 * @brief A handle to filter application metadata information
190 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
193 * @brief A handle to get appcontrol information
195 typedef void* pkgmgrinfo_appcontrol_h;
198 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
200 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
202 * @param[in] handle the pkginfo handle
203 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
205 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
207 * @see pkgmgrinfo_pkginfo_get_list()
208 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
214 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
216 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
218 * @param[in] handle the appinfo handle
219 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
221 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
223 * @see pkgmgrinfo_appinfo_get_list()
224 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
225 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
227 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
231 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
233 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
235 * @param[in] category_name the name of the category
236 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
238 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
240 * @see pkgmgrinfo_appinfo_foreach_category()
242 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
246 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
248 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
250 * @param[in] permission_name the name of the permission
251 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
253 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
255 * @see pkgmgrinfo_appinfo_foreach_category()
257 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
261 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
263 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
265 * @param[in] privilege_name the name of the privilege
266 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
268 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
270 * @see pkgmgrinfo_pkginfo_foreach_privilege()
272 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
276 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
278 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
280 * @param[in] metadata_name the name of the metadata
281 * @param[in] metadata_value the value of the metadata
282 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
284 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
286 * @see pkgmgrinfo_appinfo_foreach_metadata()
288 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
289 const char *metadata_value, void *user_data);
292 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
294 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
296 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
297 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
299 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
301 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
303 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
307 * @brief Install Location Types
310 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
311 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
312 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
313 }pkgmgrinfo_install_location;
316 * @brief Application Component Types
319 PMINFO_ALL_APP = 0, /**< All Application*/
320 PMINFO_UI_APP, /**< UI Application*/
321 PMINFO_SVC_APP, /**< Service Application*/
322 }pkgmgrinfo_app_component;
325 * @brief Application Storage Types
328 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
329 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
330 }pkgmgrinfo_installed_storage;
333 * @brief Certificate Types to be used for getting information
336 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
337 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
338 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
339 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
340 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
341 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
342 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
343 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
344 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
345 }pkgmgrinfo_cert_type;
348 * @brief Install Location Types to be used when setting data in DB
351 INSTALL_INTERNAL = 0, /**< Internal Installation*/
352 INSTALL_EXTERNAL, /**< External Installation*/
356 * @brief permission Types
359 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
360 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
361 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
362 }pkgmgrinfo_permission_type;
365 /** String property for filtering based on package info*/
366 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
367 /** String property for filtering based on package info*/
368 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
369 /** String property for filtering based on package info*/
370 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
382 /** Boolean property for filtering based on package info*/
383 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
384 /** Boolean property for filtering based on package info*/
385 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
386 /** Boolean property for filtering based on package info*/
387 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
388 /** Boolean property for filtering based on package info*/
389 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
395 /** Integer property for filtering based on package info*/
396 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
398 /** String property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
400 /** String property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
402 /** String property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
421 /** Boolean property for filtering based on app info*/
422 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
423 /** Boolean property for filtering based on app info*/
424 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
425 /** Boolean property for filtering based on app info*/
426 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
427 /** Boolean property for filtering based on app info*/
428 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
434 /** will be updated*/
435 /** string property for filtering based on pkg info*/
436 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
439 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
440 * @brief This API gets list of installed packages
442 * @par This API is for package-manager client application
443 * @par Sync (or) Async : Synchronous API
444 * @param[in] pkg_list_cb iteration function for list
445 * @param[in] user_data user data to be passed to callback function
446 * @return 0 if success, error code(<0) if fail
447 * @retval PMINFO_R_OK success
448 * @retval PMINFO_R_EINVAL invalid argument
449 * @retval PMINFO_R_ERROR internal error
453 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
457 pkgid1 = (char *)user_data;
458 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
459 if (strcmp(pkgid1, pkgid2) == 0) {
466 static int list_pkgs()
469 char *name = "helloworld";
470 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
471 if (ret != PMINFO_R_OK) {
478 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
481 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
482 * @brief This API creates the package information handle from db
484 * @par This API is for package-manager client application
485 * @par Sync (or) Async : Synchronous API
487 * @param[in] pkgid pointer to package ID
488 * @param[out] handle pointer to the package info handle.
489 * @return 0 if success, error code(<0) if fail
490 * @retval PMINFO_R_OK success
491 * @retval PMINFO_R_EINVAL invalid argument
492 * @retval PMINFO_R_ERROR internal error
494 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
495 * @see pkgmgrinfo_pkginfo_get_pkgid()
496 * @see pkgmgrinfo_pkginfo_is_removable()
498 static int get_pkg_type(const char *pkgid)
502 pkgmgrinfo_pkginfo_h handle;
503 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
504 if (ret != PMINFO_R_OK)
506 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
507 if (ret != PMINFO_R_OK) {
508 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
511 printf("pkgtype: %s\n", type);
512 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
517 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
520 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
521 * @brief This API gets the package name from the package ID
523 * @par This API is for package-manager client application
524 * @par Sync (or) Async : Synchronous API
526 * @param[in] handle pointer to package info handle
527 * @param[out] pkg_name pointer to hold package name
528 * @return 0 if success, error code(<0) if fail
529 * @retval PMINFO_R_OK success
530 * @retval PMINFO_R_EINVAL invalid argument
531 * @retval PMINFO_R_ERROR internal error
532 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
533 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
534 * @see pkgmgrinfo_pkginfo_get_type()
535 * @see pkgmgrinfo_pkginfo_is_removable()
537 static int get_pkg_name(const char *pkgid)
540 char *pkgname = NULL;
541 pkgmgrinfo_pkginfo_h handle;
542 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
543 if (ret != PMINFO_R_OK)
545 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
546 if (ret != PMINFO_R_OK) {
547 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
550 printf("pkgname: %s\n", pkgname);
551 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
556 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
559 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
560 * @brief This API gets the package id from the package ID
562 * @par This API is for package-manager client application
563 * @par Sync (or) Async : Synchronous API
565 * @param[in] handle pointer to package info handle
566 * @param[out] pkgid pointer to hold package id
567 * @return 0 if success, error code(<0) if fail
568 * @retval PMINFO_R_OK success
569 * @retval PMINFO_R_EINVAL invalid argument
570 * @retval PMINFO_R_ERROR internal error
571 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
572 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
573 * @see pkgmgrinfo_pkginfo_get_type()
574 * @see pkgmgrinfo_pkginfo_is_removable()
576 static int get_pkgid(const char *pkgid)
580 pkgmgrinfo_pkginfo_h handle;
581 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
582 if (ret != PMINFO_R_OK)
584 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
585 if (ret != PMINFO_R_OK) {
586 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
589 printf("pkg id: %s\n", pkg_id);
590 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
595 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
598 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
599 * @brief This API gets the package type from the package ID
601 * @par This API is for package-manager client application
602 * @par Sync (or) Async : Synchronous API
604 * @param[in] handle pointer to package info handle
605 * @param[out] type pointer to hold package type
606 * @return 0 if success, error code(<0) if fail
607 * @retval PMINFO_R_OK success
608 * @retval PMINFO_R_EINVAL invalid argument
609 * @retval PMINFO_R_ERROR internal error
610 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
611 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
612 * @see pkgmgrinfo_pkginfo_get_pkgid()
613 * @see pkgmgrinfo_pkginfo_is_removable()
615 static int get_pkg_type(const char *pkgid)
619 pkgmgrinfo_pkginfo_h handle;
620 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
621 if (ret != PMINFO_R_OK)
623 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
624 if (ret != PMINFO_R_OK) {
625 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
628 printf("pkgtype: %s\n", type);
629 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
634 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
637 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
638 * @brief This API gets the package version from the package ID
640 * @par This API is for package-manager client application
641 * @par Sync (or) Async : Synchronous API
643 * @param[in] handle pointer to package info handle
644 * @param[out] version pointer to hold package version
645 * @return 0 if success, error code(<0) if fail
646 * @retval PMINFO_R_OK success
647 * @retval PMINFO_R_EINVAL invalid argument
648 * @retval PMINFO_R_ERROR internal error
649 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
650 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
651 * @see pkgmgrinfo_pkginfo_get_pkgid()
652 * @see pkgmgrinfo_pkginfo_is_removable()
654 static int get_pkg_version(const char *pkgid)
657 char *version = NULL;
658 pkgmgrinfo_pkginfo_h handle;
659 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
660 if (ret != PMINFO_R_OK)
662 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
663 if (ret != PMINFO_R_OK) {
664 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
667 printf("pkg version: %s\n", version);
668 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
673 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
676 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
677 * @brief This API gets the package install location from the package ID
679 * @par This API is for package-manager client application
680 * @par Sync (or) Async : Synchronous API
682 * @param[in] handle pointer to package info handle
683 * @param[out] location pointer to hold package install location
684 * @return 0 if success, error code(<0) if fail
685 * @retval PMINFO_R_OK success
686 * @retval PMINFO_R_EINVAL invalid argument
687 * @retval PMINFO_R_ERROR internal error
688 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
689 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
690 * @see pkgmgrinfo_pkginfo_get_pkgid()
691 * @see pkgmgrinfo_pkginfo_is_removable()
693 static int get_pkg_install_location(const char *pkgid)
696 pkgmgrinfo_install_location location;
697 pkgmgrinfo_pkginfo_h handle;
698 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
699 if (ret != PMINFO_R_OK)
701 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
702 if (ret != PMINFO_R_OK) {
703 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
706 printf("pkg install location: %d\n", location);
707 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
712 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
715 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
716 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
717 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
718 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
720 * @par This API is for package-manager client application
721 * @par Sync (or) Async : Synchronous API
723 * @param[in] handle pointer to package info handle
724 * @param[out] size pointer to hold package size
725 * @return 0 if success, error code(<0) if fail
726 * @retval PMINFO_R_OK success
727 * @retval PMINFO_R_EINVAL invalid argument
728 * @retval PMINFO_R_ERROR internal error
729 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
730 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
731 * @see pkgmgrinfo_pkginfo_get_pkgid()
732 * @see pkgmgrinfo_pkginfo_is_removable()
734 static int get_pkg_size(const char *pkgid)
738 pkgmgrinfo_pkginfo_h handle;
739 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
740 if (ret != PMINFO_R_OK)
742 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
743 if (ret != PMINFO_R_OK) {
744 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
747 printf("pkgsize: %d\n", size);
748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
753 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
756 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
757 * @brief This API gets the installed package total size on the target.
759 * @par This API is for package-manager client application
760 * @par Sync (or) Async : Synchronous API
762 * @param[in] handle pointer to package info handle
763 * @param[out] size pointer to hold package total size
764 * @return 0 if success, error code(<0) if fail
765 * @retval PMINFO_R_OK success
766 * @retval PMINFO_R_EINVAL invalid argument
767 * @retval PMINFO_R_ERROR internal error
769 static int get_pkg_total_size(const char *pkgid)
773 pkgmgrinfo_pkginfo_h handle;
774 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
775 if (ret != PMINFO_R_OK)
777 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
778 if (ret != PMINFO_R_OK) {
779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782 printf("pkg total size: %d\n", size);
783 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
788 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
791 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
792 * @brief This API gets the installed package data size on the target.
794 * @par This API is for package-manager client application
795 * @par Sync (or) Async : Synchronous API
797 * @param[in] handle pointer to package info handle
798 * @param[out] size pointer to hold package data size
799 * @return 0 if success, error code(<0) if fail
800 * @retval PMINFO_R_OK success
801 * @retval PMINFO_R_EINVAL invalid argument
802 * @retval PMINFO_R_ERROR internal error
804 static int get_pkg_data_size(const char *pkgid)
808 pkgmgrinfo_pkginfo_h handle;
809 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
810 if (ret != PMINFO_R_OK)
812 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
813 if (ret != PMINFO_R_OK) {
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
817 printf("pkg data size: %d\n", size);
818 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
823 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
826 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
827 * @brief This API gets the package icon from the package ID
829 * @par This API is for package-manager client application
830 * @par Sync (or) Async : Synchronous API
832 * @param[in] handle pointer to package info handle
833 * @param[out] icon pointer to hold package icon
834 * @return 0 if success, error code(<0) if fail
835 * @retval PMINFO_R_OK success
836 * @retval PMINFO_R_EINVAL invalid argument
837 * @retval PMINFO_R_ERROR internal error
838 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
839 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
840 * @see pkgmgrinfo_pkginfo_get_pkgid()
841 * @see pkgmgrinfo_pkginfo_is_removable()
843 static int get_pkg_icon(const char *pkgid)
847 pkgmgrinfo_pkginfo_h handle;
848 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
849 if (ret != PMINFO_R_OK)
851 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
852 if (ret != PMINFO_R_OK) {
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
856 printf("pkg icon: %s\n", icon);
857 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
862 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
865 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
866 * @brief This API gets the package label from the package ID
868 * @par This API is for package-manager client application
869 * @par Sync (or) Async : Synchronous API
871 * @param[in] handle pointer to package info handle
872 * @param[out] label pointer to hold package label
873 * @return 0 if success, error code(<0) if fail
874 * @retval PMINFO_R_OK success
875 * @retval PMINFO_R_EINVAL invalid argument
876 * @retval PMINFO_R_ERROR internal error
877 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
878 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
879 * @see pkgmgrinfo_pkginfo_get_pkgid()
880 * @see pkgmgrinfo_pkginfo_is_removable()
882 static int get_pkg_label(const char *pkgid)
886 pkgmgrinfo_pkginfo_h handle;
887 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
888 if (ret != PMINFO_R_OK)
890 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
891 if (ret != PMINFO_R_OK) {
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
895 printf("pkg label: %s\n", label);
896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
901 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
904 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
905 * @brief This API gets the package description from the package ID
907 * @par This API is for package-manager client application
908 * @par Sync (or) Async : Synchronous API
910 * @param[in] handle pointer to package info handle
911 * @param[out] description pointer to hold package description
912 * @return 0 if success, error code(<0) if fail
913 * @retval PMINFO_R_OK success
914 * @retval PMINFO_R_EINVAL invalid argument
915 * @retval PMINFO_R_ERROR internal error
916 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
917 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
918 * @see pkgmgrinfo_pkginfo_get_pkgid()
919 * @see pkgmgrinfo_pkginfo_is_removable()
921 static int get_pkg_description(const char *pkgid)
924 char *description = NULL;
925 pkgmgrinfo_pkginfo_h handle;
926 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
927 if (ret != PMINFO_R_OK)
929 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
930 if (ret != PMINFO_R_OK) {
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
934 printf("pkg description: %s\n", description);
935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
940 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
943 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
944 * @brief This API gets the package's author name from the package ID
946 * @par This API is for package-manager client application
947 * @par Sync (or) Async : Synchronous API
949 * @param[in] handle pointer to package info handle
950 * @param[out] author_name pointer to hold package author name
951 * @return 0 if success, error code(<0) if fail
952 * @retval PMINFO_R_OK success
953 * @retval PMINFO_R_EINVAL invalid argument
954 * @retval PMINFO_R_ERROR internal error
955 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
956 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
957 * @see pkgmgrinfo_pkginfo_get_pkgid()
958 * @see pkgmgrinfo_pkginfo_is_removable()
960 static int get_pkg_author_name(const char *pkgid)
963 char *author_name = NULL;
964 pkgmgrinfo_pkginfo_h handle;
965 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
966 if (ret != PMINFO_R_OK)
968 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
969 if (ret != PMINFO_R_OK) {
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
973 printf("pkg author name: %s\n", author_name);
974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
979 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
982 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
983 * @brief This API gets the package's author email from the package ID
985 * @par This API is for package-manager client application
986 * @par Sync (or) Async : Synchronous API
988 * @param[in] handle pointer to package info handle
989 * @param[out] author_email pointer to hold package author email
990 * @return 0 if success, error code(<0) if fail
991 * @retval PMINFO_R_OK success
992 * @retval PMINFO_R_EINVAL invalid argument
993 * @retval PMINFO_R_ERROR internal error
994 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
995 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
996 * @see pkgmgrinfo_pkginfo_get_pkgid()
997 * @see pkgmgrinfo_pkginfo_is_removable()
999 static int get_pkg_author_email(const char *pkgid)
1002 char *author_email = NULL;
1003 pkgmgrinfo_pkginfo_h handle;
1004 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1005 if (ret != PMINFO_R_OK)
1007 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1008 if (ret != PMINFO_R_OK) {
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1012 printf("pkg author email: %s\n", author_email);
1013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1018 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1021 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1022 * @brief This API gets the package's author href from the package ID
1024 * @par This API is for package-manager client application
1025 * @par Sync (or) Async : Synchronous API
1027 * @param[in] handle pointer to package info handle
1028 * @param[out] author_href pointer to hold package author href
1029 * @return 0 if success, error code(<0) if fail
1030 * @retval PMINFO_R_OK success
1031 * @retval PMINFO_R_EINVAL invalid argument
1032 * @retval PMINFO_R_ERROR internal error
1033 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1034 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1035 * @see pkgmgrinfo_pkginfo_get_pkgid()
1036 * @see pkgmgrinfo_pkginfo_is_removable()
1038 static int get_pkg_author_href(const char *pkgid)
1041 char *author_href = NULL;
1042 pkgmgrinfo_pkginfo_h handle;
1043 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1044 if (ret != PMINFO_R_OK)
1046 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1047 if (ret != PMINFO_R_OK) {
1048 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1051 printf("pkg author href: %s\n", author_href);
1052 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1057 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1060 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1061 * @brief This API gets the package installed storagae value from the package ID
1063 * @par This API is for package-manager client application
1064 * @par Sync (or) Async : Synchronous API
1066 * @param[in] handle pointer to package info handle
1067 * @param[out] storage pointer to hold package installed storage
1068 * @return 0 if success, error code(<0) if fail
1069 * @retval PMINFO_R_OK success
1070 * @retval PMINFO_R_EINVAL invalid argument
1071 * @retval PMINFO_R_ERROR internal error
1072 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1073 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1074 * @see pkgmgrinfo_pkginfo_get_pkgid()
1075 * @see pkgmgrinfo_pkginfo_is_removable()
1077 static int get_pkg_installed_storage(const char *pkgid)
1080 pkgmgrinfo_installed_storage storage;
1081 pkgmgrinfo_pkginfo_h handle;
1082 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1083 if (ret != PMINFO_R_OK)
1085 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1086 if (ret != PMINFO_R_OK) {
1087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1090 printf("pkg installed storage: %d\n", storage);
1091 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1096 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1099 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1100 * @brief This API gets the installed time of package from the package ID
1102 * @par This API is for package-manager client application
1103 * @par Sync (or) Async : Synchronous API
1105 * @param[in] handle pointer to package info handle
1106 * @param[out] installed_time pointer to hold installed time of package
1107 * @return 0 if success, error code(<0) if fail
1108 * @retval PMINFO_R_OK success
1109 * @retval PMINFO_R_EINVAL invalid argument
1110 * @retval PMINFO_R_ERROR internal error
1111 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1112 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1113 * @see pkgmgrinfo_pkginfo_get_pkgid()
1114 * @see pkgmgrinfo_pkginfo_is_removable()
1116 static int get_pkg_installed_time(const char *pkgid)
1119 int installed_time = 0;
1120 pkgmgrinfo_pkginfo_h handle;
1121 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1122 if (ret != PMINFO_R_OK)
1124 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1125 if (ret != PMINFO_R_OK) {
1126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1129 printf("installed_time: %d\n", installed_time);
1130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1135 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1138 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1139 * @brief This API gets the store client id of package from the package ID
1141 * @par This API is for package-manager client application
1142 * @par Sync (or) Async : Synchronous API
1144 * @param[in] handle pointer to package info handle
1145 * @param[out] storeclientid pointer to hold store client id of package
1146 * @return 0 if success, error code(<0) if fail
1147 * @retval PMINFO_R_OK success
1148 * @retval PMINFO_R_EINVAL invalid argument
1149 * @retval PMINFO_R_ERROR internal error
1150 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1151 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1152 * @see pkgmgrinfo_pkginfo_get_pkgid()
1153 * @see pkgmgrinfo_pkginfo_is_removable()
1155 static int get_pkg_storeclientid(const char *pkgid)
1158 char *storeclientid = 0;
1159 pkgmgrinfo_pkginfo_h handle;
1160 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1161 if (ret != PMINFO_R_OK)
1163 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1164 if (ret != PMINFO_R_OK) {
1165 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1168 printf(store client id: %s\n", storeclientid);
1169 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1174 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1177 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1178 * @brief This API gets the main app id of package from the package ID
1180 * @par This API is for package-manager client application
1181 * @par Sync (or) Async : Synchronous API
1183 * @param[in] handle pointer to package info handle
1184 * @param[out] mainappid pointer to hold main app id of package
1185 * @return 0 if success, error code(<0) if fail
1186 * @retval PMINFO_R_OK success
1187 * @retval PMINFO_R_EINVAL invalid argument
1188 * @retval PMINFO_R_ERROR internal error
1189 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1190 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1191 * @see pkgmgrinfo_pkginfo_get_pkgid()
1192 * @see pkgmgrinfo_pkginfo_is_removable()
1194 static int get_pkg_mainappid(const char *pkgid)
1197 char *mainappid = 0;
1198 pkgmgrinfo_pkginfo_h handle;
1199 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1200 if (ret != PMINFO_R_OK)
1202 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1203 if (ret != PMINFO_R_OK) {
1204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1207 printf(main app id: %s\n", mainappid);
1208 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1213 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1216 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1217 * @brief This API gets the url of package from the package ID
1219 * @par This API is for package-manager client application
1220 * @par Sync (or) Async : Synchronous API
1222 * @param[in] handle pointer to package info handle
1223 * @param[out] url pointer to hold url of package
1224 * @return 0 if success, error code(<0) if fail
1225 * @retval PMINFO_R_OK success
1226 * @retval PMINFO_R_EINVAL invalid argument
1227 * @retval PMINFO_R_ERROR internal error
1228 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1229 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1230 * @see pkgmgrinfo_pkginfo_get_pkgid()
1231 * @see pkgmgrinfo_pkginfo_is_removable()
1233 static int get_pkg_url(const char *pkgid)
1237 pkgmgrinfo_pkginfo_h handle;
1238 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1239 if (ret != PMINFO_R_OK)
1241 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1242 if (ret != PMINFO_R_OK) {
1243 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1246 printf("url : %s\n", url);
1247 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1252 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1256 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1257 * @brief This API gets the root path of package
1259 * @par Sync (or) Async : Synchronous API
1261 * @param[in] handle pointer to package info handle
1262 * @param[out] path pointer to hold root path of package
1263 * @return 0 if success, error code(<0) if fail
1264 * @retval PMINFO_R_OK success
1265 * @retval PMINFO_R_EINVAL invalid argument
1266 * @retval PMINFO_R_ERROR internal error
1268 static int get_root_path(const char *pkgid)
1272 pkgmgrinfo_pkginfo_h handle;
1273 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1274 if (ret != PMINFO_R_OK)
1277 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1278 if (ret != PMINFO_R_OK) {
1279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1282 printf("path : %s\n", path);
1283 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1289 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1293 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1294 * @brief This API gets the csc path of package
1296 * @par Sync (or) Async : Synchronous API
1298 * @param[in] handle pointer to package info handle
1299 * @param[out] path pointer to hold csc path of package
1300 * @return 0 if success, error code(<0) if fail
1301 * @retval PMINFO_R_OK success
1302 * @retval PMINFO_R_EINVAL invalid argument
1303 * @retval PMINFO_R_ERROR internal error
1305 static int get_csc_path(const char *pkgid)
1309 pkgmgrinfo_pkginfo_h handle;
1310 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1311 if (ret != PMINFO_R_OK)
1314 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1315 if (ret != PMINFO_R_OK) {
1316 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1319 printf("path : %s\n", path);
1320 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1326 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1329 * @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)
1330 * @brief This API compare the cert information from given package id
1332 * @par This API is for package-manager client application
1333 * @par Sync (or) Async : Synchronous API
1335 * @param[in] lhs_package_id pointer to first package ID
1336 * @param[in] rhs_package_id pointer to second package ID
1337 * @param[out] compare_result pointer to the compare result.
1338 * @return 0 if success, error code(<0) if fail
1339 * @retval PMINFO_R_OK success
1340 * @retval PMINFO_R_EINVAL invalid argument
1341 * @retval PMINFO_R_ERROR internal error
1343 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1344 * @see pkgmgrinfo_pkginfo_get_pkgid()
1345 * @see pkgmgrinfo_pkginfo_is_removable()
1347 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1350 pkgmgrinfo_cert_compare_result_type_e result;
1352 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1353 if (ret != PMINFO_R_OK) {
1356 printf("result: %d\n", result);
1361 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);
1364 * @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)
1365 * @brief This API compare the cert information from given app id
1367 * @par This API is for package-manager client application
1368 * @par Sync (or) Async : Synchronous API
1370 * @param[in] lhs_app_id pointer to first app ID
1371 * @param[in] rhs_app_id pointer to second app ID
1372 * @param[out] compare_result pointer to the compare result.
1373 * @return 0 if success, error code(<0) if fail
1374 * @retval PMINFO_R_OK success
1375 * @retval PMINFO_R_EINVAL invalid argument
1376 * @retval PMINFO_R_ERROR internal error
1378 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1379 * @see pkgmgrinfo_pkginfo_get_pkgid()
1380 * @see pkgmgrinfo_pkginfo_is_removable()
1382 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1385 pkgmgrinfo_cert_compare_result_type_e result;
1387 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1388 if (ret != PMINFO_R_OK) {
1391 printf("result: %d\n", result);
1396 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);
1399 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1400 * @brief This API gets the package 'removable' value from the package ID
1402 * @par This API is for package-manager client application
1403 * @par Sync (or) Async : Synchronous API
1405 * @param[in] handle pointer to package info handle
1406 * @param[out] removable pointer to hold package removable value
1407 * @return 0 if success, error code(<0) if fail
1408 * @retval PMINFO_R_OK success
1409 * @retval PMINFO_R_EINVAL invalid argument
1410 * @retval PMINFO_R_ERROR internal error
1411 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1412 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1413 * @see pkgmgrinfo_pkginfo_get_pkgid()
1414 * @see pkgmgrinfo_pkginfo_is_readonly()
1416 static int get_pkg_removable(const char *pkgid)
1420 pkgmgrinfo_pkginfo_h handle;
1421 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1422 if (ret != PMINFO_R_OK)
1424 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1425 if (ret != PMINFO_R_OK) {
1426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1429 printf("pkg removable: %d\n", removable);
1430 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1435 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1438 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1439 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1441 * @par This API is for package-manager client application
1442 * @par Sync (or) Async : Synchronous API
1444 * @param[in] handle pointer to package info handle
1445 * @param[out] movable pointer to hold package movable state
1446 * @return 0 if success, error code(<0) if fail
1447 * @retval PMINFO_R_OK success
1448 * @retval PMINFO_R_EINVAL invalid argument
1449 * @retval PMINFO_R_ERROR internal error
1450 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1451 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1452 * @see pkgmgrinfo_pkginfo_get_pkgid()
1454 static int get_pkg_movable(const char *pkgid)
1458 pkgmgrinfo_pkginfo_h handle;
1459 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1460 if (ret != PMINFO_R_OK)
1462 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1463 if (ret != PMINFO_R_OK) {
1464 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1467 printf("pkg movable: %d\n", movable);
1468 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1473 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1476 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1477 * @brief This API gets the package 'preload' value from the package ID
1479 * @par This API is for package-manager client application
1480 * @par Sync (or) Async : Synchronous API
1482 * @param[in] handle pointer to package info handle
1483 * @param[out] preload pointer to hold package preload value
1484 * @return 0 if success, error code(<0) if fail
1485 * @retval PMINFO_R_OK success
1486 * @retval PMINFO_R_EINVAL invalid argument
1487 * @retval PMINFO_R_ERROR internal error
1488 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1489 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1490 * @see pkgmgrinfo_pkginfo_get_pkgid()
1491 * @see pkgmgrinfo_pkginfo_is_readonly()
1493 static int get_pkg_preload(const char *pkgid)
1497 pkgmgrinfo_pkginfo_h handle;
1498 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1499 if (ret != PMINFO_R_OK)
1501 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1502 if (ret != PMINFO_R_OK) {
1503 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1506 printf("pkg preload: %d\n", preload);
1507 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1512 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1515 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1516 * @brief This API gets the value for given handle is system or not
1518 * @par This API is for package-manager client application
1519 * @par Sync (or) Async : Synchronous API
1521 * @param[in] handle pointer to package info handle
1522 * @param[out] system pointer to hold system is or not
1523 * @return 0 if success, error code(<0) if fail
1524 * @retval PMINFO_R_OK success
1525 * @retval PMINFO_R_EINVAL invalid argument
1526 * @retval PMINFO_R_ERROR internal error
1527 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1528 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1529 * @see pkgmgrinfo_pkginfo_get_pkgid()
1530 * @see pkgmgrinfo_pkginfo_is_readonly()
1532 static int get_pkg_system(const char *pkgid)
1535 bool system = false;
1536 pkgmgrinfo_pkginfo_h handle = NULL;
1537 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1538 if (ret != PMINFO_R_OK)
1540 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1541 if (ret != PMINFO_R_OK) {
1542 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1545 printf("pkg system: %d\n", system);
1546 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1551 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1554 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1555 * @brief This API gets the package 'readonly' value from the package ID
1557 * @par This API is for package-manager client application
1558 * @par Sync (or) Async : Synchronous API
1560 * @param[in] handle pointer to package info handle
1561 * @param[out] readonly pointer to hold package readonly value
1562 * @return 0 if success, error code(<0) if fail
1563 * @retval PMINFO_R_OK success
1564 * @retval PMINFO_R_EINVAL invalid argument
1565 * @retval PMINFO_R_ERROR internal error
1566 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1567 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1568 * @see pkgmgrinfo_pkginfo_get_pkgid()
1569 * @see pkgmgrinfo_pkginfo_is_removable()
1571 static int get_pkg_readonly(const char *pkgid)
1575 pkgmgrinfo_pkginfo_h handle;
1576 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1577 if (ret != PMINFO_R_OK)
1579 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1580 if (ret != PMINFO_R_OK) {
1581 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1584 printf("pkg readonly: %d\n", readonly);
1585 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1590 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1594 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1595 * @brief This API gets the package 'upate' value from the package ID
1597 * @par This API is for package-manager client application
1598 * @par Sync (or) Async : Synchronous API
1600 * @param[in] handle pointer to package info handle
1601 * @param[out] update pointer to hold package update value
1602 * @return 0 if success, error code(<0) if fail
1603 * @retval PMINFO_R_OK success
1604 * @retval PMINFO_R_EINVAL invalid argument
1605 * @retval PMINFO_R_ERROR internal error
1606 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1607 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1608 * @see pkgmgrinfo_pkginfo_get_pkgid()
1610 static int get_pkg_update(const char *pkgid)
1614 pkgmgrinfo_pkginfo_h handle;
1615 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1616 if (ret != PMINFO_R_OK)
1618 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1619 if (ret != PMINFO_R_OK) {
1620 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1623 printf("pkg update: %d\n", update);
1624 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1629 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1632 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1633 * @brief This API gets the package 'accessible' value from the package ID
1635 * @par This API is for package-manager client application
1636 * @par Sync (or) Async : Synchronous API
1638 * @param[in] handle pointer to package info handle
1639 * @param[out] accessible pointer to hold package accessible value
1640 * @return 0 if success, error code(<0) if fail
1641 * @retval PMINFO_R_OK success
1642 * @retval PMINFO_R_EINVAL invalid argument
1643 * @retval PMINFO_R_ERROR internal error
1644 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1645 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1646 * @see pkgmgrinfo_pkginfo_get_pkgid()
1647 * @see pkgmgrinfo_pkginfo_is_readonly()
1649 static int get_pkg_accessible(const char *pkgid)
1653 pkgmgrinfo_pkginfo_h handle;
1654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1655 if (ret != PMINFO_R_OK)
1657 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1658 if (ret != PMINFO_R_OK) {
1659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1662 printf("pkg accessible: %d\n", accessible);
1663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1668 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1671 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1672 * @brief This API destroys the package information handle freeing up all the resources
1674 * @par This API is for package-manager client application
1675 * @par Sync (or) Async : Synchronous API
1677 * @param[in] handle pointer to the package info handle
1678 * @return 0 if success, error code(<0) if fail
1679 * @retval PMINFO_R_OK success
1680 * @retval PMINFO_R_EINVAL invalid argument
1681 * @retval PMINFO_R_ERROR internal error
1682 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1684 * @see pkgmgrinfo_pkginfo_get_pkgid()
1685 * @see pkgmgrinfo_pkginfo_is_removable()
1687 static int get_pkg_type(const char *pkgid)
1691 pkgmgrinfo_pkginfo_h handle;
1692 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1693 if (ret != PMINFO_R_OK)
1695 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1696 if (ret != PMINFO_R_OK) {
1697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1700 printf("pkgtype: %s\n", type);
1701 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1706 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1709 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1710 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1711 The query will search the entire package information collected from the manifest file of all the installed packages
1713 * @par This API is for package-manager client application
1714 * @par Sync (or) Async : Synchronous API
1716 * @param[out] handle pointer to the package info filter handle.
1717 * @return 0 if success, error code(<0) if fail
1718 * @retval PMINFO_R_OK success
1719 * @retval PMINFO_R_EINVAL invalid argument
1720 * @retval PMINFO_R_ERROR internal error
1722 * @post pkgmgrinfo_pkginfo_filter_destroy()
1723 * @see pkgmgrinfo_pkginfo_filter_count()
1724 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1726 static int get_rpm_pkg_count()
1730 pkgmgrinfo_pkginfo_filter_h handle;
1731 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1732 if (ret != PMINFO_R_OK)
1734 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1735 if (ret != PMINFO_R_OK) {
1736 pkgmgrinfo_pkginfo_filter_destroy(handle);
1739 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1740 if (ret != PMINFO_R_OK) {
1741 pkgmgrinfo_pkginfo_filter_destroy(handle);
1744 printf("No of rpm pkgs: %d\n", count);
1745 pkgmgrinfo_pkginfo_filter_destroy(handle);
1750 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1753 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1754 * @brief This API destroys the package information filter handle freeing up all the resources
1756 * @par This API is for package-manager client application
1757 * @par Sync (or) Async : Synchronous API
1759 * @param[in] handle pointer to the package info filter handle.
1760 * @return 0 if success, error code(<0) if fail
1761 * @retval PMINFO_R_OK success
1762 * @retval PMINFO_R_EINVAL invalid argument
1763 * @retval PMINFO_R_ERROR internal error
1764 * @pre pkgmgrinfo_pkginfo_filter_create()
1766 * @see pkgmgrinfo_pkginfo_filter_count()
1767 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1769 static int get_rpm_pkg_count()
1773 pkgmgrinfo_pkginfo_filter_h handle;
1774 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1775 if (ret != PMINFO_R_OK)
1777 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1778 if (ret != PMINFO_R_OK) {
1779 pkgmgrinfo_pkginfo_filter_destroy(handle);
1782 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_filter_destroy(handle);
1787 printf("No of rpm pkgs: %d\n", count);
1788 pkgmgrinfo_pkginfo_filter_destroy(handle);
1793 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1796 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1797 * @brief This API adds a boolean filter property to the filter handle
1799 * @par This API is for package-manager client application
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] handle pointer to the package info filter handle.
1803 * @param[in] property boolean property name.
1804 * @param[in] value value corresponding to the property.
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
1809 * @pre pkgmgrinfo_pkginfo_filter_create()
1810 * @post pkgmgrinfo_pkginfo_filter_destroy()
1811 * @see pkgmgrinfo_pkginfo_filter_count()
1812 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1814 static int get_preload_pkg_count()
1818 pkgmgrinfo_pkginfo_filter_h handle;
1819 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1820 if (ret != PMINFO_R_OK)
1822 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1823 if (ret != PMINFO_R_OK) {
1824 pkgmgrinfo_pkginfo_filter_destroy(handle);
1827 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1828 if (ret != PMINFO_R_OK) {
1829 pkgmgrinfo_pkginfo_filter_destroy(handle);
1832 printf("No of preload pkgs: %d\n", count);
1833 pkgmgrinfo_pkginfo_filter_destroy(handle);
1838 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1839 const char *property, const bool value);
1842 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1843 * @brief This API adds an integer filter property to the filter handle
1845 * @par This API is for package-manager client application
1846 * @par Sync (or) Async : Synchronous API
1848 * @param[in] handle pointer to the package info filter handle.
1849 * @param[in] property integer property name.
1850 * @param[in] value value corresponding to the property.
1851 * @return 0 if success, error code(<0) if fail
1852 * @retval PMINFO_R_OK success
1853 * @retval PMINFO_R_EINVAL invalid argument
1854 * @retval PMINFO_R_ERROR internal error
1855 * @pre pkgmgrinfo_pkginfo_filter_create()
1856 * @post pkgmgrinfo_pkginfo_filter_destroy()
1857 * @see pkgmgrinfo_pkginfo_filter_count()
1858 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1860 static int get_pkg_count()
1864 pkgmgrinfo_pkginfo_filter_h handle;
1865 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1866 if (ret != PMINFO_R_OK)
1868 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1869 if (ret != PMINFO_R_OK) {
1870 pkgmgrinfo_pkginfo_filter_destroy(handle);
1873 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1874 if (ret != PMINFO_R_OK) {
1875 pkgmgrinfo_pkginfo_filter_destroy(handle);
1878 printf("No of preload pkgs: %d\n", count);
1879 pkgmgrinfo_pkginfo_filter_destroy(handle);
1884 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1885 const char *property, const int value);
1888 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1889 * @brief This API adds a string filter property to the filter handle
1891 * @par This API is for package-manager client application
1892 * @par Sync (or) Async : Synchronous API
1894 * @param[in] handle pointer to the package info filter handle.
1895 * @param[in] property string property name.
1896 * @param[in] value value corresponding to the property.
1897 * @return 0 if success, error code(<0) if fail
1898 * @retval PMINFO_R_OK success
1899 * @retval PMINFO_R_EINVAL invalid argument
1900 * @retval PMINFO_R_ERROR internal error
1901 * @pre pkgmgrinfo_pkginfo_filter_create()
1902 * @post pkgmgrinfo_pkginfo_filter_destroy()
1903 * @see pkgmgrinfo_pkginfo_filter_count()
1904 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1906 static int get_rpm_pkg_count()
1910 pkgmgrinfo_pkginfo_filter_h handle;
1911 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1912 if (ret != PMINFO_R_OK)
1914 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1915 if (ret != PMINFO_R_OK) {
1916 pkgmgrinfo_pkginfo_filter_destroy(handle);
1919 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1920 if (ret != PMINFO_R_OK) {
1921 pkgmgrinfo_pkginfo_filter_destroy(handle);
1924 printf("No of rpm pkgs: %d\n", count);
1925 pkgmgrinfo_pkginfo_filter_destroy(handle);
1930 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1931 const char *property, const char *value);
1934 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1935 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1937 * @par This API is for package-manager client application
1938 * @par Sync (or) Async : Synchronous API
1940 * @param[in] handle pointer to the package info filter handle.
1941 * @param[in] pkg_cb callback function.
1942 * @param[in] user_data user data to be passed to the callback function
1943 * @return 0 if success, error code(<0) if fail
1944 * @retval PMINFO_R_OK success
1945 * @retval PMINFO_R_EINVAL invalid argument
1946 * @retval PMINFO_R_ERROR internal error
1947 * @pre pkgmgrinfo_pkginfo_filter_create()
1948 * @post pkgmgrinfo_pkginfo_filter_destroy()
1949 * @see pkgmgrinfo_pkginfo_filter_count()
1951 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1954 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1955 printf("pkg id : %s\n", pkgid);
1959 static int get_rpm_pkg_list()
1962 pkgmgrinfo_pkginfo_filter_h handle;
1963 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1964 if (ret != PMINFO_R_OK)
1966 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1967 if (ret != PMINFO_R_OK) {
1968 pkgmgrinfo_pkginfo_filter_destroy(handle);
1971 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1972 if (ret != PMINFO_R_OK) {
1973 pkgmgrinfo_pkginfo_filter_destroy(handle);
1976 pkgmgrinfo_pkginfo_filter_destroy(handle);
1981 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1982 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1985 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1986 * @brief This API counts the package that satisfy the filter conditions
1988 * @par This API is for package-manager client application
1989 * @par Sync (or) Async : Synchronous API
1991 * @param[in] handle pointer to the package info filter handle.
1992 * @param[in] count pointer to store the count value.
1993 * @return 0 if success, error code(<0) if fail
1994 * @retval PMINFO_R_OK success
1995 * @retval PMINFO_R_EINVAL invalid argument
1996 * @retval PMINFO_R_ERROR internal error
1997 * @pre pkgmgrinfo_pkginfo_filter_create()
1998 * @post pkgmgrinfo_pkginfo_filter_destroy()
1999 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2001 static int get_rpm_pkg_count()
2005 pkgmgrinfo_pkginfo_filter_h handle;
2006 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2007 if (ret != PMINFO_R_OK)
2009 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2010 if (ret != PMINFO_R_OK) {
2011 pkgmgrinfo_pkginfo_filter_destroy(handle);
2014 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2015 if (ret != PMINFO_R_OK) {
2016 pkgmgrinfo_pkginfo_filter_destroy(handle);
2019 printf("No of rpm pkgs: %d\n", count);
2020 pkgmgrinfo_pkginfo_filter_destroy(handle);
2025 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2028 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2029 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2030 * @brief This API gets the list of privilege for a particular package
2032 * @par This API is for package-manager client application
2033 * @par Sync (or) Async : Synchronous API
2034 * @param[in] handle pointer to the package info handle.
2035 * @param[in] privilege_func callback function for list
2036 * @param[in] user_data user data to be passed to callback function
2037 * @return 0 if success, error code(<0) if fail
2038 * @retval PMINFO_R_OK success
2039 * @retval PMINFO_R_EINVAL invalid argument
2040 * @retval PMINFO_R_ERROR internal error
2041 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2042 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2044 int privilege_func(const char *name, void *user_data)
2046 if (strcmp(name, (char *)user_data) == 0)
2052 static int list_privilege(const char *package, char *privilege)
2055 pkgmgrinfo_pkginfo_h handle;
2056 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2057 if (ret != PMINFO_R_OK)
2059 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2060 if (ret != PMINFO_R_OK) {
2061 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2069 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2070 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2073 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2074 pkgmgrinfo_app_list_cb app_func, void *user_data)
2075 * @brief This API gets list of installed applications for a particular package
2077 * @par This API is for package-manager client application
2078 * @par Sync (or) Async : Synchronous API
2079 * @param[in] handle package info handle
2080 * @param[in] component application component
2081 * @param[in] app_func iteration function for list
2082 * @param[in] user_data user data to be passed to callback function
2083 * @return 0 if success, error code(<0) if fail
2084 * @retval PMINFO_R_OK success
2085 * @retval PMINFO_R_EINVAL invalid argument
2086 * @retval PMINFO_R_ERROR internal error
2087 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2088 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2090 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2093 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2094 printf("appid : %s\n", appid);
2098 static int list_apps(const char *pkgid)
2101 pkgmgrinfo_pkginfo_h handle;
2102 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2103 if (ret != PMINFO_R_OK)
2105 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2106 if (ret != PMINFO_R_OK) {
2107 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2110 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2115 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2116 pkgmgrinfo_app_list_cb app_func, void *user_data);
2118 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2119 * @brief This API gets list of installed applications from all packages with minimum informaion.
2121 * @par This API is for package-manager client application
2122 * @par Sync (or) Async : Synchronous API
2123 * @param[in] app_func iteration function for list
2124 * @param[in] user_data user data to be passed to callback function
2125 * @return 0 if success, error code(<0) if fail
2126 * @retval PMINFO_R_OK success
2127 * @retval PMINFO_R_EINVAL invalid argument
2128 * @retval PMINFO_R_ERROR internal error
2132 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2134 char *pkgid1 = NULL;
2135 char *pkgid2 = NULL;
2136 pkgid1 = (char *)user_data;
2137 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2138 if (strcmp(pkgid1, pkgid2) == 0) {
2145 static int list_apps()
2148 char *name = "helloworld";
2149 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2150 if (ret != PMINFO_R_OK) {
2157 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2160 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2161 * @brief This API gets list of installed applications from all packages.
2163 * @par This API is for package-manager client application
2164 * @par Sync (or) Async : Synchronous API
2165 * @param[in] app_func iteration function for list
2166 * @param[in] user_data user data to be passed to callback function
2167 * @return 0 if success, error code(<0) if fail
2168 * @retval PMINFO_R_OK success
2169 * @retval PMINFO_R_EINVAL invalid argument
2170 * @retval PMINFO_R_ERROR internal error
2174 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2176 char *pkgid1 = NULL;
2177 char *pkgid2 = NULL;
2178 pkgid1 = (char *)user_data;
2179 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2180 if (strcmp(pkgid1, pkgid2) == 0) {
2187 static int list_apps()
2190 char *name = "helloworld";
2191 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2192 if (ret != PMINFO_R_OK) {
2199 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2202 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2203 * @brief This API creates the application information handle from db
2205 * @par This API is for package-manager client application
2206 * @par Sync (or) Async : Synchronous API
2208 * @param[in] appid pointer to appid
2209 * @param[out] handle pointer to the application info handle.
2210 * @return 0 if success, error code(<0) if fail
2211 * @retval PMINFO_R_OK success
2212 * @retval PMINFO_R_EINVAL invalid argument
2213 * @retval PMINFO_R_ERROR internal error
2215 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2216 * @see pkgmgrinfo_appinfo_get_pkgid()
2217 * @see pkgmgrinfo_appinfo_is_multiple()
2219 static int get_app_type(const char *appid)
2223 pkgmgrinfo_appinfo_h handle;
2224 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2225 if (ret != PMINFO_R_OK)
2227 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2228 if (ret != PMINFO_R_OK) {
2229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2232 printf("apptype: %s\n", type);
2233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2238 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2241 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2242 * @brief This API gets the application ID
2244 * @par This API is for package-manager client application
2245 * @par Sync (or) Async : Synchronous API
2247 * @param[in] handle pointer to the application info handle.
2248 * @param[out] appid pointer to hold appid
2249 * @return 0 if success, error code(<0) if fail
2250 * @retval PMINFO_R_OK success
2251 * @retval PMINFO_R_EINVAL invalid argument
2252 * @retval PMINFO_R_ERROR internal error
2253 * @pre pkgmgrinfo_appinfo_get_appinfo()
2254 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2255 * @see pkgmgrinfo_appinfo_get_pkgid()
2256 * @see pkgmgrinfo_appinfo_is_multiple()
2258 static int get_app_id(const char *appid)
2261 char *app_id = NULL;
2262 pkgmgrinfo_appinfo_h handle;
2263 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2264 if (ret != PMINFO_R_OK)
2266 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2267 if (ret != PMINFO_R_OK) {
2268 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2271 printf("app id: %s\n", app_id);
2272 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2277 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2280 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2281 * @brief This API gets the package name of the application
2283 * @par This API is for package-manager client application
2284 * @par Sync (or) Async : Synchronous API
2286 * @param[in] handle pointer to the application info handle.
2287 * @param[out] pkg_name pointer to hold package name
2288 * @return 0 if success, error code(<0) if fail
2289 * @retval PMINFO_R_OK success
2290 * @retval PMINFO_R_EINVAL invalid argument
2291 * @retval PMINFO_R_ERROR internal error
2292 * @pre pkgmgrinfo_appinfo_get_appinfo()
2293 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2294 * @see pkgmgrinfo_appinfo_get_appid()
2295 * @see pkgmgrinfo_appinfo_is_multiple()
2297 static int get_app_pkgname(const char *appid)
2300 char *pkgname = NULL;
2301 pkgmgrinfo_appinfo_h handle;
2302 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2303 if (ret != PMINFO_R_OK)
2305 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2306 if (ret != PMINFO_R_OK) {
2307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2310 printf("pkg name: %s\n", pkgname);
2311 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2316 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2319 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2320 * @brief This API gets the package id of the application
2322 * @par This API is for package-manager client application
2323 * @par Sync (or) Async : Synchronous API
2325 * @param[in] handle pointer to the application info handle.
2326 * @param[out] pkgid pointer to hold package id
2327 * @return 0 if success, error code(<0) if fail
2328 * @retval PMINFO_R_OK success
2329 * @retval PMINFO_R_EINVAL invalid argument
2330 * @retval PMINFO_R_ERROR internal error
2331 * @pre pkgmgrinfo_appinfo_get_appinfo()
2332 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2333 * @see pkgmgrinfo_appinfo_get_appid()
2334 * @see pkgmgrinfo_appinfo_is_multiple()
2336 static int get_app_pkgid(const char *appid)
2340 pkgmgrinfo_appinfo_h handle;
2341 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2342 if (ret != PMINFO_R_OK)
2344 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2345 if (ret != PMINFO_R_OK) {
2346 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2349 printf("pkg id: %s\n", pkgid);
2350 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2355 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2358 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2359 * @brief This API gets the executable name of the application
2361 * @par This API is for package-manager client application
2362 * @par Sync (or) Async : Synchronous API
2364 * @param[in] handle pointer to the application info handle.
2365 * @param[out] exec pointer to hold app exec name
2366 * @return 0 if success, error code(<0) if fail
2367 * @retval PMINFO_R_OK success
2368 * @retval PMINFO_R_EINVAL invalid argument
2369 * @retval PMINFO_R_ERROR internal error
2370 * @pre pkgmgrinfo_appinfo_get_appinfo()
2371 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2372 * @see pkgmgrinfo_appinfo_get_appid()
2373 * @see pkgmgrinfo_appinfo_is_multiple()
2375 static int get_app_exec(const char *appid)
2379 pkgmgrinfo_appinfo_h handle;
2380 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2381 if (ret != PMINFO_R_OK)
2383 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2384 if (ret != PMINFO_R_OK) {
2385 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2388 printf("exec name: %s\n", exec);
2389 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2394 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2397 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2398 * @brief This API gets the icon name of the application
2400 * @par This API is for package-manager client application
2401 * @par Sync (or) Async : Synchronous API
2403 * @param[in] handle pointer to the application info handle.
2404 * @param[out] icon pointer to hold app icon name
2405 * @return 0 if success, error code(<0) if fail
2406 * @retval PMINFO_R_OK success
2407 * @retval PMINFO_R_EINVAL invalid argument
2408 * @retval PMINFO_R_ERROR internal error
2409 * @pre pkgmgrinfo_appinfo_get_appinfo()
2410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2411 * @see pkgmgrinfo_appinfo_get_appid()
2412 * @see pkgmgrinfo_appinfo_is_multiple()
2414 static int get_app_icon(const char *appid)
2418 pkgmgrinfo_appinfo_h handle;
2419 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2420 if (ret != PMINFO_R_OK)
2422 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2423 if (ret != PMINFO_R_OK) {
2424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2427 printf("icon name: %s\n", icon);
2428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2433 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2436 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2437 * @brief This API gets the label of the application
2439 * @par This API is for package-manager client application
2440 * @par Sync (or) Async : Synchronous API
2442 * @param[in] handle pointer to the application info handle.
2443 * @param[out] label pointer to hold app label
2444 * @return 0 if success, error code(<0) if fail
2445 * @retval PMINFO_R_OK success
2446 * @retval PMINFO_R_EINVAL invalid argument
2447 * @retval PMINFO_R_ERROR internal error
2448 * @pre pkgmgrinfo_appinfo_get_appinfo()
2449 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2450 * @see pkgmgrinfo_appinfo_get_appid()
2451 * @see pkgmgrinfo_appinfo_is_multiple()
2453 static int get_app_label(const char *appid)
2457 pkgmgrinfo_appinfo_h handle;
2458 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2459 if (ret != PMINFO_R_OK)
2461 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2462 if (ret != PMINFO_R_OK) {
2463 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2466 printf("label : %s\n", label);
2467 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2472 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2475 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2476 * @brief This API gets the component of the application
2478 * @par This API is for package-manager client application
2479 * @par Sync (or) Async : Synchronous API
2481 * @param[in] handle pointer to the application info handle.
2482 * @param[out] component pointer to hold app component
2483 * @return 0 if success, error code(<0) if fail
2484 * @retval PMINFO_R_OK success
2485 * @retval PMINFO_R_EINVAL invalid argument
2486 * @retval PMINFO_R_ERROR internal error
2487 * @pre pkgmgrinfo_appinfo_get_appinfo()
2488 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2489 * @see pkgmgrinfo_appinfo_get_appid()
2490 * @see pkgmgrinfo_appinfo_is_multiple()
2492 static int get_app_component(const char *appid)
2495 pkgmgrinfo_app_component component;
2496 pkgmgrinfo_appinfo_h handle;
2497 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2498 if (ret != PMINFO_R_OK)
2500 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2501 if (ret != PMINFO_R_OK) {
2502 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2505 printf("component : %s\n", component);
2506 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2511 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2514 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2515 * @brief This API gets the apptype of the application
2517 * @par This API is for package-manager client application
2518 * @par Sync (or) Async : Synchronous API
2520 * @param[in] handle pointer to the application info handle.
2521 * @param[out] app_type pointer to hold apptype
2522 * @return 0 if success, error code(<0) if fail
2523 * @retval PMINFO_R_OK success
2524 * @retval PMINFO_R_EINVAL invalid argument
2525 * @retval PMINFO_R_ERROR internal error
2526 * @pre pkgmgrinfo_appinfo_get_appinfo()
2527 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2528 * @see pkgmgrinfo_appinfo_get_appid()
2529 * @see pkgmgrinfo_appinfo_is_multiple()
2531 static int get_app_type(const char *appid)
2534 char *apptype = NULL;
2535 pkgmgrinfo_appinfo_h handle;
2536 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2537 if (ret != PMINFO_R_OK)
2539 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2540 if (ret != PMINFO_R_OK) {
2541 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2544 printf("apptype : %s\n", apptype);
2545 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2550 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2553 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2554 int *operation_count, char ***operation)
2555 * @brief This API gets the list of operation of the application
2557 * @par This API is for package-manager client application
2558 * @par Sync (or) Async : Synchronous API
2560 * @param[in] handle pointer to the appcontrol handle.
2561 * @param[out] operation_count pointer to hold number of operations
2562 * @param[out] operation pointer to hold list of operations
2563 * @return 0 if success, error code(<0) if fail
2564 * @retval PMINFO_R_OK success
2565 * @retval PMINFO_R_EINVAL invalid argument
2566 * @retval PMINFO_R_ERROR internal error
2567 * @pre pkgmgrinfo_appinfo_get_appinfo()
2568 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2569 * @see pkgmgrinfo_appinfo_get_uri()
2570 * @see pkgmgrinfo_appinfo_get_mime()
2572 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2577 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2578 for (i = 0; i < oc; i++) {
2579 if (strcmp(operation[i], (char *)user_data) == 0)
2586 static int check_operation(const char *appid, char *operation)
2589 pkgmgrinfo_appinfo_h handle;
2590 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2591 if (ret != PMINFO_R_OK)
2593 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2594 if (ret != PMINFO_R_OK) {
2595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2603 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2604 int *operation_count, char ***operation);
2607 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2608 int *uri_count, char ***uri)
2609 * @brief This API gets the list of uri of the application
2611 * @par This API is for package-manager client application
2612 * @par Sync (or) Async : Synchronous API
2614 * @param[in] handle pointer to the appcontrol handle.
2615 * @param[out] uri_count pointer to hold number of uris
2616 * @param[out] uri pointer to hold list of uris
2617 * @return 0 if success, error code(<0) if fail
2618 * @retval PMINFO_R_OK success
2619 * @retval PMINFO_R_EINVAL invalid argument
2620 * @retval PMINFO_R_ERROR internal error
2621 * @pre pkgmgrinfo_appinfo_get_appinfo()
2622 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2623 * @see pkgmgrinfo_appinfo_get_operation()
2624 * @see pkgmgrinfo_appinfo_get_mime()
2626 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2631 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2632 for (i = 0; i < uc; i++) {
2633 if (strcmp(uri[i], (char *)user_data) == 0)
2640 static int check_uri(const char *appid, char *uri)
2643 pkgmgrinfo_appinfo_h handle;
2644 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2645 if (ret != PMINFO_R_OK)
2647 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2648 if (ret != PMINFO_R_OK) {
2649 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2652 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2657 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2658 int *uri_count, char ***uri);
2661 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2662 int *mime_count, char ***mime)
2663 * @brief This API gets the list of mime of the application
2665 * @par This API is for package-manager client application
2666 * @par Sync (or) Async : Synchronous API
2668 * @param[in] handle pointer to the appcontrol handle.
2669 * @param[out] mime_count pointer to hold number of mimes
2670 * @param[out] mime pointer to hold list of mimes
2671 * @return 0 if success, error code(<0) if fail
2672 * @retval PMINFO_R_OK success
2673 * @retval PMINFO_R_EINVAL invalid argument
2674 * @retval PMINFO_R_ERROR internal error
2675 * @pre pkgmgrinfo_appinfo_get_appinfo()
2676 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2677 * @see pkgmgrinfo_appinfo_get_uri()
2678 * @see pkgmgrinfo_appinfo_get_operation()
2680 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2685 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2686 for (i = 0; i < mc; i++) {
2687 if (strcmp(mime[i], (char *)user_data) == 0)
2694 static int check_mime(const char *appid, char *mime)
2697 pkgmgrinfo_appinfo_h handle;
2698 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2699 if (ret != PMINFO_R_OK)
2701 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2702 if (ret != PMINFO_R_OK) {
2703 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2711 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2712 int *mime_count, char ***mime);
2715 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2716 int *subapp_count, char ***subapp)
2717 * @brief This API gets the list of subapp of the application
2719 * @par This API is for package-manager client application
2720 * @par Sync (or) Async : Synchronous API
2722 * @param[in] handle pointer to the appcontrol handle.
2723 * @param[out] subapp_count pointer to hold number of subapp
2724 * @param[out] subapp pointer to hold list of subapp
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_appinfo_get_appinfo()
2730 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2731 * @see pkgmgrinfo_appinfo_get_uri()
2732 * @see pkgmgrinfo_appinfo_get_operation()
2734 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2738 char **subapp = NULL;
2739 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2740 for (i = 0; i < sc; i++) {
2741 if (strcmp(subapp[i], (char *)user_data) == 0)
2748 static int check_subapp(const char *appid, char *subapp)
2751 pkgmgrinfo_appinfo_h handle = NULL;
2752 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2753 if (ret != PMINFO_R_OK)
2755 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2756 if (ret != PMINFO_R_OK) {
2757 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2760 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2765 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2766 int *subapp_count, char ***subapp);
2769 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2770 * @brief This API gets the notification icon of the application
2772 * @par This API is for package-manager client application
2773 * @par Sync (or) Async : Synchronous API
2775 * @param[in] handle pointer to the application info handle.
2776 * @param[out] path pointer to hold notification icon
2777 * @return 0 if success, error code(<0) if fail
2778 * @retval PMINFO_R_OK success
2779 * @retval PMINFO_R_EINVAL invalid argument
2780 * @retval PMINFO_R_ERROR internal error
2781 * @pre pkgmgrinfo_appinfo_get_appinfo()
2782 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2783 * @see pkgmgrinfo_appinfo_get_appid()
2784 * @see pkgmgrinfo_appinfo_is_multiple()
2786 static int get_app_notification_icon(const char *appid)
2789 char *notification_icon = NULL;
2790 pkgmgrinfo_appinfo_h handle;
2791 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2792 if (ret != PMINFO_R_OK)
2794 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2795 if (ret != PMINFO_R_OK) {
2796 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2799 printf("notification icon : %s\n", notification_icon);
2800 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2805 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2808 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2809 * @brief This API gets the setting icon of the application
2811 * @par This API is for package-manager client application
2812 * @par Sync (or) Async : Synchronous API
2814 * @param[in] handle pointer to the application info handle.
2815 * @param[out] path pointer to hold setting icon
2816 * @return 0 if success, error code(<0) if fail
2817 * @retval PMINFO_R_OK success
2818 * @retval PMINFO_R_EINVAL invalid argument
2819 * @retval PMINFO_R_ERROR internal error
2820 * @pre pkgmgrinfo_appinfo_get_appinfo()
2821 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2822 * @see pkgmgrinfo_appinfo_get_appid()
2823 * @see pkgmgrinfo_appinfo_is_multiple()
2825 static int get_app_setting_icon(const char *appid)
2828 char *setting_icon = NULL;
2829 pkgmgrinfo_appinfo_h handle;
2830 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2831 if (ret != PMINFO_R_OK)
2833 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2834 if (ret != PMINFO_R_OK) {
2835 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2838 printf("setting icon : %s\n", setting_icon);
2839 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2844 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2847 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2848 * @brief This API gets the type of recent image on app-tray
2850 * @par This API is for package-manager client application
2851 * @par Sync (or) Async : Synchronous API
2853 * @param[in] handle pointer to the application info handle.
2854 * @param[out] type pointer to hold image type
2855 * @return 0 if success, error code(<0) if fail
2856 * @retval PMINFO_R_OK success
2857 * @retval PMINFO_R_EINVAL invalid argument
2858 * @retval PMINFO_R_ERROR internal error
2859 * @pre pkgmgrinfo_appinfo_get_appinfo()
2860 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2861 * @see pkgmgrinfo_appinfo_get_appid()
2862 * @see pkgmgrinfo_appinfo_is_multiple()
2864 static int get_app_recent_image_type(const char *appid)
2867 pkgmgrinfo_app_recentimage type;
2868 pkgmgrinfo_appinfo_h handle;
2869 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2870 if (ret != PMINFO_R_OK)
2872 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2873 if (ret != PMINFO_R_OK) {
2874 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2877 printf("recent image type: %d\n", type);
2878 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2883 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2887 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2888 * @brief This API gets the preview image of application
2890 * @par Sync (or) Async : Synchronous API
2892 * @param[in] handle pointer to the application info handle.
2893 * @param[out] preview_img pointer to hold preview image path
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
2898 * @pre pkgmgrinfo_appinfo_get_appinfo()
2899 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2900 * @see pkgmgrinfo_appinfo_get_appid()
2902 static int get_app_previewimage(const char *appid)
2905 char *preview = NULL;
2906 pkgmgrinfo_appinfo_h handle = NULL;
2907 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2908 if (ret != PMINFO_R_OK)
2910 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2911 if (ret != PMINFO_R_OK) {
2912 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2915 printf("preview image path : %s\n", preview);
2916 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2921 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2925 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2926 * @brief This API gets the package permission type of the application
2928 * @par This API is for package-manager client application
2929 * @par Sync (or) Async : Synchronous API
2931 * @param[in] handle pointer to the application info handle.
2932 * @param[out] permission pointer to hold package permission
2933 * @return 0 if success, error code(<0) if fail
2934 * @retval PMINFO_R_OK success
2935 * @retval PMINFO_R_EINVAL invalid argument
2936 * @retval PMINFO_R_ERROR internal error
2937 * @pre pkgmgrinfo_appinfo_get_appinfo()
2938 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2939 * @see pkgmgrinfo_appinfo_get_appid()
2941 static int get_app_permission(const char *appid)
2944 pkgmgrinfo_permission_type permission = 0;
2945 pkgmgrinfo_appinfo_h handle;
2947 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2948 if (ret != PMINFO_R_OK)
2950 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2951 if (ret != PMINFO_R_OK) {
2952 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2955 printf("permission type: %d\n", permission);
2956 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2961 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2964 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2965 * @brief This API gets the component_type
2967 * @par This API is for package-manager client application
2968 * @par Sync (or) Async : Synchronous API
2970 * @param[in] handle pointer to the application info handle.
2971 * @param[out] component_type pointer to hold component_type
2972 * @return 0 if success, error code(<0) if fail
2973 * @retval PMINFO_R_OK success
2974 * @retval PMINFO_R_EINVAL invalid argument
2975 * @retval PMINFO_R_ERROR internal error
2976 * @pre pkgmgrinfo_appinfo_get_appinfo()
2977 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2978 * @see pkgmgrinfo_appinfo_get_pkgid()
2979 * @see pkgmgrinfo_appinfo_is_multiple()
2981 static int get_component_type(const char *appid)
2984 char *component_type = NULL;
2985 pkgmgrinfo_appinfo_h handle;
2986 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2987 if (ret != PMINFO_R_OK)
2989 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2990 if (ret != PMINFO_R_OK) {
2991 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2994 printf("component_type: %s\n", component_type);
2995 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3000 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3003 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3004 * @brief This API gets the application 'hwacceleration' value from the app ID
3006 * @par This API is for package-manager client application
3007 * @par Sync (or) Async : Synchronous API
3009 * @param[in] handle pointer to application info handle
3010 * @param[out] hwacceleration pointer to hold package hwacceleration value
3011 * @return 0 if success, error code(<0) if fail
3012 * @retval PMINFO_R_OK success
3013 * @retval PMINFO_R_EINVAL invalid argument
3014 * @retval PMINFO_R_ERROR internal error
3015 * @pre pkgmgrinfo_appinfo_get_appinfo()
3016 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3017 * @see pkgmgrinfo_appinfo_get_appid()
3018 * @see pkgmgrinfo_appinfo_is_multiple()
3020 static int get_app_hwacceleration(const char *appid)
3023 pkgmgrinfo_app_hwacceleration hwacceleration;
3024 pkgmgrinfo_appinfo_h handle;
3025 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3026 if (ret != PMINFO_R_OK)
3028 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3029 if (ret != PMINFO_R_OK) {
3030 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3033 printf("app hwacceleration: %d\n", hwacceleration);
3034 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3039 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3042 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3043 * @brief This API gets the application 'screenreader' value from the app ID
3045 * @par This API is for package-manager client application
3046 * @par Sync (or) Async : Synchronous API
3048 * @param[in] handle pointer to application info handle
3049 * @param[out] screenreader pointer to hold package accessibility value
3050 * @return 0 if success, error code(<0) if fail
3051 * @retval PMINFO_R_OK success
3052 * @retval PMINFO_R_EINVAL invalid argument
3053 * @retval PMINFO_R_ERROR internal error
3054 * @pre pkgmgrinfo_appinfo_get_appinfo()
3055 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3056 * @see pkgmgrinfo_appinfo_get_appid()
3057 * @see pkgmgrinfo_appinfo_is_multiple()
3059 static int get_app_screenreader(const char *appid)
3062 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3063 pkgmgrinfo_appinfo_h handle = NULL;
3064 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3065 if (ret != PMINFO_R_OK)
3067 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3068 if (ret != PMINFO_R_OK) {
3069 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072 printf("app screenreader: %d\n", screenreader);
3073 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3078 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3081 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3082 * @brief This API gets the application's landscape & portrait effect images
3084 * @par This API is for package-manager client application
3085 * @par Sync (or) Async : Synchronous API
3087 * @param[in] handle pointer to application info handle
3088 * @param[out] portrait_img contains portrait mode effect image
3089 * @param[out] landscape_img contains landscape mode effect image
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_nodisplay()
3099 static int get_app_effectimages(const char *appid)
3102 char *portraitimg = NULL;
3103 char *landscapeimg = NULL;
3104 pkgmgrinfo_appinfo_h handle;
3105 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3106 if (ret != PMINFO_R_OK)
3108 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3109 if (ret != PMINFO_R_OK) {
3110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3113 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3119 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3122 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3123 * @brief This API gets the submode_mainid of the application
3125 * @par This API is for package-manager client application
3126 * @par Sync (or) Async : Synchronous API
3128 * @param[in] handle pointer to the application info handle.
3129 * @param[out] submode_mainid pointer to hold package name
3130 * @return 0 if success, error code(<0) if fail
3131 * @retval PMINFO_R_OK success
3132 * @retval PMINFO_R_EINVAL invalid argument
3133 * @retval PMINFO_R_ERROR internal error
3134 * @pre pkgmgrinfo_appinfo_get_appinfo()
3135 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3136 * @see pkgmgrinfo_appinfo_get_appid()
3137 * @see pkgmgrinfo_appinfo_is_multiple()
3139 static int get_app_submode_mainid(const char *appid)
3142 char *submode_mainid = NULL;
3143 pkgmgrinfo_appinfo_h handle = NULL;
3144 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3145 if (ret != PMINFO_R_OK)
3147 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3148 if (ret != PMINFO_R_OK) {
3149 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3152 printf("submode_mainid: %s\n", submode_mainid);
3153 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3158 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3161 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3162 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3163 * @brief This API gets the list of permission for a particular application
3165 * @par This API is for package-manager client application
3166 * @par Sync (or) Async : Synchronous API
3167 * @param[in] handle pointer to the application info handle.
3168 * @param[in] permission_func callback function for list
3169 * @param[in] user_data user data to be passed to callback function
3170 * @return 0 if success, error code(<0) if fail
3171 * @retval PMINFO_R_OK success
3172 * @retval PMINFO_R_EINVAL invalid argument
3173 * @retval PMINFO_R_ERROR internal error
3174 * @pre pkgmgrinfo_appinfo_get_appinfo()
3175 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3177 int permission_func(const char *name, void *user_data)
3179 if (strcmp(name, (char *)user_data) == 0)
3185 static int list_permission(const char *appid, char *permission)
3188 pkgmgrinfo_appinfo_h handle;
3189 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3190 if (ret != PMINFO_R_OK)
3192 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3193 if (ret != PMINFO_R_OK) {
3194 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3202 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3203 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3206 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3207 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3208 * @brief This API gets the list of category for a particular application
3210 * @par This API is for package-manager client application
3211 * @par Sync (or) Async : Synchronous API
3212 * @param[in] handle pointer to the application info handle.
3213 * @param[in] category_func callback function for list
3214 * @param[in] user_data user data to be passed to callback function
3215 * @return 0 if success, error code(<0) if fail
3216 * @retval PMINFO_R_OK success
3217 * @retval PMINFO_R_EINVAL invalid argument
3218 * @retval PMINFO_R_ERROR internal error
3219 * @pre pkgmgrinfo_appinfo_get_appinfo()
3220 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3222 int category_func(const char *name, void *user_data)
3224 if (strcmp(name, (char *)user_data) == 0)
3230 static int list_category(const char *appid, char *category)
3233 pkgmgrinfo_appinfo_h handle;
3234 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3235 if (ret != PMINFO_R_OK)
3237 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3238 if (ret != PMINFO_R_OK) {
3239 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3242 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3247 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3248 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3251 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3252 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3253 * @brief This API gets the list of metadata for a particular application
3255 * @par This API is for package-manager client application
3256 * @par Sync (or) Async : Synchronous API
3257 * @param[in] handle pointer to the application info handle.
3258 * @param[in] metadata_func callback function for list
3259 * @param[in] user_data user data to be passed to callback function
3260 * @return 0 if success, error code(<0) if fail
3261 * @retval PMINFO_R_OK success
3262 * @retval PMINFO_R_EINVAL invalid argument
3263 * @retval PMINFO_R_ERROR internal error
3264 * @pre pkgmgrinfo_appinfo_get_appinfo()
3265 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3267 int metadata_func(const char *key, const char *value, void *user_data)
3269 if (strcmp(key, (char *)user_data) == 0) {
3270 printf("Value is %s\n", value);
3277 static int list_metadata(const char *appid, char *key)
3280 pkgmgrinfo_appinfo_h handle;
3281 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3282 if (ret != PMINFO_R_OK)
3284 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3285 if (ret != PMINFO_R_OK) {
3286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3289 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3294 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3295 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3299 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3300 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3301 * @brief This API gets the list of app-control for a particular application
3303 * @par This API is for package-manager client application
3304 * @par Sync (or) Async : Synchronous API
3305 * @param[in] handle pointer to the application info handle.
3306 * @param[in] appcontrol_func callback function for list
3307 * @param[in] user_data user data to be passed to callback function
3308 * @return 0 if success, error code(<0) if fail
3309 * @retval PMINFO_R_OK success
3310 * @retval PMINFO_R_EINVAL invalid argument
3311 * @retval PMINFO_R_ERROR internal error
3312 * @pre pkgmgrinfo_appinfo_get_appinfo()
3313 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3315 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3320 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3321 for (i = 0; i < oc; i++) {
3322 if (strcmp(operation[i], (char *)user_data) == 0)
3329 static int check_operation(const char *appid, char *operation)
3332 pkgmgrinfo_appinfo_h handle;
3333 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3334 if (ret != PMINFO_R_OK)
3336 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3337 if (ret != PMINFO_R_OK) {
3338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3347 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3350 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3351 * @brief This API gets the application 'nodisplay' value from the app ID
3353 * @par This API is for package-manager client application
3354 * @par Sync (or) Async : Synchronous API
3356 * @param[in] handle pointer to application info handle
3357 * @param[out] nodisplay pointer to hold package nodisplay value
3358 * @return 0 if success, error code(<0) if fail
3359 * @retval PMINFO_R_OK success
3360 * @retval PMINFO_R_EINVAL invalid argument
3361 * @retval PMINFO_R_ERROR internal error
3362 * @pre pkgmgrinfo_appinfo_get_appinfo()
3363 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3364 * @see pkgmgrinfo_appinfo_get_appid()
3365 * @see pkgmgrinfo_appinfo_is_multiple()
3367 static int get_app_nodisplay(const char *appid)
3371 pkgmgrinfo_appinfo_h handle;
3372 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3373 if (ret != PMINFO_R_OK)
3375 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3376 if (ret != PMINFO_R_OK) {
3377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3380 printf("app nodisplay: %d\n", nodisplay);
3381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3386 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3389 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3390 * @brief This API gets the application 'multiple' value from the app ID
3392 * @par This API is for package-manager client application
3393 * @par Sync (or) Async : Synchronous API
3395 * @param[in] handle pointer to application info handle
3396 * @param[out] multiple pointer to hold package multiple value
3397 * @return 0 if success, error code(<0) if fail
3398 * @retval PMINFO_R_OK success
3399 * @retval PMINFO_R_EINVAL invalid argument
3400 * @retval PMINFO_R_ERROR internal error
3401 * @pre pkgmgrinfo_appinfo_get_appinfo()
3402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3403 * @see pkgmgrinfo_appinfo_get_appid()
3404 * @see pkgmgrinfo_appinfo_is_nodisplay()
3406 static int get_app_multiple(const char *appid)
3410 pkgmgrinfo_appinfo_h handle;
3411 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3412 if (ret != PMINFO_R_OK)
3414 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3415 if (ret != PMINFO_R_OK) {
3416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3419 printf("app multiple: %d\n", multiple);
3420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3425 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3428 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3429 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3430 * application launching effect. If fales, indicator will be hidden during application launching effect
3432 * @par This API is for package-manager client application
3433 * @par Sync (or) Async : Synchronous API
3435 * @param[in] handle pointer to application info handle
3436 * @param[out] indicator_disp contains indicator display status for application launching effect
3437 * @return 0 if success, error code(<0) if fail
3438 * @retval PMINFO_R_OK success
3439 * @retval PMINFO_R_EINVAL invalid argument
3440 * @retval PMINFO_R_ERROR internal error
3441 * @pre pkgmgrinfo_appinfo_get_appinfo()
3442 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3443 * @see pkgmgrinfo_appinfo_get_appid()
3444 * @see pkgmgrinfo_appinfo_is_nodisplay()
3446 static int get_app_indicator_display(const char *appid)
3449 bool indicator_disp;
3450 pkgmgrinfo_appinfo_h handle;
3451 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3452 if (ret != PMINFO_R_OK)
3454 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3455 if (ret != PMINFO_R_OK){
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 printf("app indicator disp : %d\n", indicator_disp);
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3465 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3468 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3469 * @brief This API gets the application 'taskmanage' value from the app ID
3471 * @par This API is for package-manager client application
3472 * @par Sync (or) Async : Synchronous API
3474 * @param[in] handle pointer to application info handle
3475 * @param[out] taskmanage pointer to hold package taskmanage value
3476 * @return 0 if success, error code(<0) if fail
3477 * @retval PMINFO_R_OK success
3478 * @retval PMINFO_R_EINVAL invalid argument
3479 * @retval PMINFO_R_ERROR internal error
3480 * @pre pkgmgrinfo_appinfo_get_appinfo()
3481 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3482 * @see pkgmgrinfo_appinfo_get_appid()
3483 * @see pkgmgrinfo_appinfo_is_multiple()
3485 static int get_app_taskmanage(const char *appid)
3489 pkgmgrinfo_appinfo_h handle;
3490 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3491 if (ret != PMINFO_R_OK)
3493 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3494 if (ret != PMINFO_R_OK) {
3495 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498 printf("app taskmanage: %d\n", taskmanage);
3499 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3504 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3507 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3508 * @brief This API gets the application 'taskmanage' value from the app ID
3510 * @par This API is for package-manager client application
3511 * @par Sync (or) Async : Synchronous API
3513 * @param[in] handle pointer to application info handle
3514 * @param[out] enabled pointer to hold package enabled value
3515 * @return 0 if success, error code(<0) if fail
3516 * @retval PMINFO_R_OK success
3517 * @retval PMINFO_R_EINVAL invalid argument
3518 * @retval PMINFO_R_ERROR internal error
3519 * @pre pkgmgrinfo_appinfo_get_appinfo()
3520 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3521 * @see pkgmgrinfo_appinfo_get_appid()
3522 * @see pkgmgrinfo_appinfo_is_multiple()
3524 static int get_app_enabled(const char *appid)
3528 pkgmgrinfo_appinfo_h handle;
3529 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3530 if (ret != PMINFO_R_OK)
3532 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3533 if (ret != PMINFO_R_OK) {
3534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3537 printf("app enabled: %d\n", enabled);
3538 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3543 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3546 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3547 * @brief This API gets the application 'onboot' value from the app ID
3549 * @par This API is for package-manager client application
3550 * @par Sync (or) Async : Synchronous API
3552 * @param[in] handle pointer to application info handle
3553 * @param[out] onboot pointer to hold package onboot value
3554 * @return 0 if success, error code(<0) if fail
3555 * @retval PMINFO_R_OK success
3556 * @retval PMINFO_R_EINVAL invalid argument
3557 * @retval PMINFO_R_ERROR internal error
3558 * @pre pkgmgrinfo_appinfo_get_appinfo()
3559 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3560 * @see pkgmgrinfo_appinfo_get_appid()
3561 * @see pkgmgrinfo_appinfo_is_multiple()
3563 static int get_app_onboot(const char *appid)
3567 pkgmgrinfo_appinfo_h handle;
3568 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3569 if (ret != PMINFO_R_OK)
3571 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3572 if (ret != PMINFO_R_OK) {
3573 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3576 printf("app onboot: %d\n", onboot);
3577 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3582 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3585 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3586 * @brief This API gets the application 'autorestart' value from the app ID
3588 * @par This API is for package-manager client application
3589 * @par Sync (or) Async : Synchronous API
3591 * @param[in] handle pointer to application info handle
3592 * @param[out] autorestart pointer to hold package autorestart value
3593 * @return 0 if success, error code(<0) if fail
3594 * @retval PMINFO_R_OK success
3595 * @retval PMINFO_R_EINVAL invalid argument
3596 * @retval PMINFO_R_ERROR internal error
3597 * @pre pkgmgrinfo_appinfo_get_appinfo()
3598 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3599 * @see pkgmgrinfo_appinfo_get_appid()
3600 * @see pkgmgrinfo_appinfo_is_multiple()
3602 static int get_app_autorestart(const char *appid)
3606 pkgmgrinfo_appinfo_h handle;
3607 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3608 if (ret != PMINFO_R_OK)
3610 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3611 if (ret != PMINFO_R_OK) {
3612 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3615 printf("app autorestart: %d\n", autorestart);
3616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3621 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3624 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3625 * @brief This API gets the value for given application is main app or not from handle
3627 * @par This API is for package-manager client application
3628 * @par Sync (or) Async : Synchronous API
3630 * @param[in] handle pointer to application info handle
3631 * @param[out] mainapp pointer to hold package mainapp is or not
3632 * @return 0 if success, error code(<0) if fail
3633 * @retval PMINFO_R_OK success
3634 * @retval PMINFO_R_EINVAL invalid argument
3635 * @retval PMINFO_R_ERROR internal error
3636 * @pre pkgmgrinfo_appinfo_get_appinfo()
3637 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3638 * @see pkgmgrinfo_appinfo_get_appid()
3639 * @see pkgmgrinfo_appinfo_is_multiple()
3641 static int get_app_mainapp(const char *appid)
3645 pkgmgrinfo_appinfo_h handle;
3646 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3647 if (ret != PMINFO_R_OK)
3649 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3650 if (ret != PMINFO_R_OK) {
3651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3654 printf("mainapp: %d\n", mainapp);
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3660 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3664 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3665 * @brief This API gets the value for given application is preload or not from handle
3667 * @par This API is for package-manager client application
3668 * @par Sync (or) Async : Synchronous API
3670 * @param[in] handle pointer to application info handle
3671 * @param[out] preload pointer to hold preload is or not
3672 * @return 0 if success, error code(<0) if fail
3673 * @retval PMINFO_R_OK success
3674 * @retval PMINFO_R_EINVAL invalid argument
3675 * @retval PMINFO_R_ERROR internal error
3676 * @pre pkgmgrinfo_appinfo_get_appinfo()
3677 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3678 * @see pkgmgrinfo_appinfo_get_appid()
3679 * @see pkgmgrinfo_appinfo_is_multiple()
3681 static int get_app_preload(const char *appid)
3685 pkgmgrinfo_appinfo_h handle = NULL;
3686 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3687 if (ret != PMINFO_R_OK)
3689 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3690 if (ret != PMINFO_R_OK) {
3691 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3694 printf("preload: %d\n", preload);
3695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3700 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3703 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3704 * @brief This API gets the value for given application is submode or not from handle
3706 * @par This API is for package-manager client application
3707 * @par Sync (or) Async : Synchronous API
3709 * @param[in] handle pointer to application info handle
3710 * @param[out] submode pointer to hold submode is or not
3711 * @return 0 if success, error code(<0) if fail
3712 * @retval PMINFO_R_OK success
3713 * @retval PMINFO_R_EINVAL invalid argument
3714 * @retval PMINFO_R_ERROR internal error
3715 * @pre pkgmgrinfo_appinfo_get_appinfo()
3716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3717 * @see pkgmgrinfo_appinfo_get_appid()
3718 * @see pkgmgrinfo_appinfo_is_multiple()
3720 static int get_app_submode(const char *appid)
3724 pkgmgrinfo_appinfo_h handle = NULL;
3725 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3726 if (ret != PMINFO_R_OK)
3728 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3729 if (ret != PMINFO_R_OK) {
3730 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3733 printf("submode: %d\n", submode);
3734 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3739 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3742 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3743 * @brief This API destroys the application information handle freeing up all the resources
3745 * @par This API is for package-manager client application
3746 * @par Sync (or) Async : Synchronous API
3748 * @param[in] handle pointer to the application info handle.
3749 * @return 0 if success, error code(<0) if fail
3750 * @retval PMINFO_R_OK success
3751 * @retval PMINFO_R_EINVAL invalid argument
3752 * @retval PMINFO_R_ERROR internal error
3753 * @pre pkgmgrinfo_appinfo_get_appinfo()
3755 * @see pkgmgrinfo_appinfo_get_pkgid()
3756 * @see pkgmgrinfo_appinfo_is_multiple()
3758 static int get_app_type(const char *appid)
3762 pkgmgrinfo_appinfo_h handle;
3763 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3764 if (ret != PMINFO_R_OK)
3766 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3767 if (ret != PMINFO_R_OK) {
3768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3771 printf("apptype: %s\n", type);
3772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3777 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3780 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3781 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3782 The query will search the entire application information collected from the manifest file of all the installed packages
3784 * @par This API is for package-manager client application
3785 * @par Sync (or) Async : Synchronous API
3787 * @param[out] handle pointer to the application info filter handle.
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
3793 * @post pkgmgrinfo_appinfo_filter_destroy()
3794 * @see pkgmgrinfo_appinfo_filter_count()
3795 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3797 static int get_capp_count()
3801 pkgmgrinfo_appinfo_filter_h handle;
3802 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3803 if (ret != PMINFO_R_OK)
3805 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3806 if (ret != PMINFO_R_OK) {
3807 pkgmgrinfo_appinfo_filter_destroy(handle);
3810 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_filter_destroy(handle);
3815 printf("No of capp: %d\n", count);
3816 pkgmgrinfo_appinfo_filter_destroy(handle);
3821 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3824 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3825 * @brief This API destroys the application information filter handle freeing up all the resources
3827 * @par This API is for package-manager client application
3828 * @par Sync (or) Async : Synchronous API
3830 * @param[in] handle pointer to the application info filter handle.
3831 * @return 0 if success, error code(<0) if fail
3832 * @retval PMINFO_R_OK success
3833 * @retval PMINFO_R_EINVAL invalid argument
3834 * @retval PMINFO_R_ERROR internal error
3835 * @pre pkgmgrinfo_appinfo_filter_create()
3837 * @see pkgmgrinfo_appinfo_filter_count()
3838 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3840 static int get_capp_count()
3844 pkgmgrinfo_appinfo_filter_h handle;
3845 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3846 if (ret != PMINFO_R_OK)
3848 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3849 if (ret != PMINFO_R_OK) {
3850 pkgmgrinfo_appinfo_filter_destroy(handle);
3853 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3854 if (ret != PMINFO_R_OK) {
3855 pkgmgrinfo_appinfo_filter_destroy(handle);
3858 printf("No of capp: %d\n", count);
3859 pkgmgrinfo_appinfo_filter_destroy(handle);
3864 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3867 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3868 * @brief This API adds a boolean filter property to the filter handle
3870 * @par This API is for package-manager client application
3871 * @par Sync (or) Async : Synchronous API
3873 * @param[in] handle pointer to the application info filter handle.
3874 * @param[in] property boolean property name.
3875 * @param[in] value value corresponding to the property.
3876 * @return 0 if success, error code(<0) if fail
3877 * @retval PMINFO_R_OK success
3878 * @retval PMINFO_R_EINVAL invalid argument
3879 * @retval PMINFO_R_ERROR internal error
3880 * @pre pkgmgrinfo_appinfo_filter_create()
3881 * @post pkgmgrinfo_appinfo_filter_destroy()
3882 * @see pkgmgrinfo_appinfo_filter_count()
3883 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3885 static int get_taskmanageable_app_count()
3889 pkgmgrinfo_appinfo_filter_h handle;
3890 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3891 if (ret != PMINFO_R_OK)
3893 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3894 if (ret != PMINFO_R_OK) {
3895 pkgmgrinfo_appinfo_filter_destroy(handle);
3898 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3899 if (ret != PMINFO_R_OK) {
3900 pkgmgrinfo_appinfo_filter_destroy(handle);
3903 printf("No of taskmanageable apps: %d\n", count);
3904 pkgmgrinfo_appinfo_filter_destroy(handle);
3909 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3910 const char *property, const bool value);
3913 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3914 * @brief This API adds an integer filter property to the filter handle
3916 * @par This API is for package-manager client application
3917 * @par Sync (or) Async : Synchronous API
3919 * @param[in] handle pointer to the application info filter handle.
3920 * @param[in] property integer property name.
3921 * @param[in] value value corresponding to the property.
3922 * @return 0 if success, error code(<0) if fail
3923 * @retval PMINFO_R_OK success
3924 * @retval PMINFO_R_EINVAL invalid argument
3925 * @retval PMINFO_R_ERROR internal error
3926 * @pre pkgmgrinfo_appinfo_filter_create()
3927 * @post pkgmgrinfo_appinfo_filter_destroy()
3928 * @see pkgmgrinfo_appinfo_filter_count()
3929 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3931 static int get_taskmanageable_app_count()
3935 pkgmgrinfo_appinfo_filter_h handle;
3936 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3937 if (ret != PMINFO_R_OK)
3939 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3940 if (ret != PMINFO_R_OK) {
3941 pkgmgrinfo_appinfo_filter_destroy(handle);
3944 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3945 if (ret != PMINFO_R_OK) {
3946 pkgmgrinfo_appinfo_filter_destroy(handle);
3949 printf("No of apps: %d\n", count);
3950 pkgmgrinfo_appinfo_filter_destroy(handle);
3955 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3956 const char *property, const int value);
3959 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3960 * @brief This API adds a string filter property to the filter handle
3962 * @par This API is for package-manager client application
3963 * @par Sync (or) Async : Synchronous API
3965 * @param[in] handle pointer to the application info filter handle.
3966 * @param[in] property string property name.
3967 * @param[in] value value corresponding to the property.
3968 * @return 0 if success, error code(<0) if fail
3969 * @retval PMINFO_R_OK success
3970 * @retval PMINFO_R_EINVAL invalid argument
3971 * @retval PMINFO_R_ERROR internal error
3972 * @pre pkgmgrinfo_appinfo_filter_create()
3973 * @post pkgmgrinfo_appinfo_filter_destroy()
3974 * @see pkgmgrinfo_appinfo_filter_count()
3975 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3977 static int get_capp_count()
3981 pkgmgrinfo_appinfo_filter_h handle;
3982 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3983 if (ret != PMINFO_R_OK)
3985 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3986 if (ret != PMINFO_R_OK) {
3987 pkgmgrinfo_appinfo_filter_destroy(handle);
3990 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3991 if (ret != PMINFO_R_OK) {
3992 pkgmgrinfo_appinfo_filter_destroy(handle);
3995 printf("No of capp: %d\n", count);
3996 pkgmgrinfo_appinfo_filter_destroy(handle);
4001 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4002 const char *property, const char *value);
4005 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4006 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4008 * @par This API is for package-manager client application
4009 * @par Sync (or) Async : Synchronous API
4011 * @param[in] handle pointer to the application info filter handle.
4012 * @param[in] app_cb callback function.
4013 * @param[in] user_data user data to be passed to the callback function
4014 * @return 0 if success, error code(<0) if fail
4015 * @retval PMINFO_R_OK success
4016 * @retval PMINFO_R_EINVAL invalid argument
4017 * @retval PMINFO_R_ERROR internal error
4018 * @pre pkgmgrinfo_appinfo_filter_create()
4019 * @post pkgmgrinfo_appinfo_filter_destroy()
4020 * @see pkgmgrinfo_appinfo_filter_count()
4022 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4025 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4026 printf("appid : %s\n", appid);
4030 static int get_capp_list()
4033 pkgmgrinfo_appinfo_filter_h handle;
4034 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4035 if (ret != PMINFO_R_OK)
4037 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4038 if (ret != PMINFO_R_OK) {
4039 pkgmgrinfo_appinfo_filter_destroy(handle);
4042 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4043 if (ret != PMINFO_R_OK) {
4044 pkgmgrinfo_appinfo_filter_destroy(handle);
4047 pkgmgrinfo_appinfo_filter_destroy(handle);
4052 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4053 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4056 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4057 * @brief This API counts the application that satisfy the filter conditions
4059 * @par This API is for package-manager client application
4060 * @par Sync (or) Async : Synchronous API
4062 * @param[in] handle pointer to the application info filter handle.
4063 * @param[in] count pointer to store count value
4064 * @return 0 if success, error code(<0) if fail
4065 * @retval PMINFO_R_OK success
4066 * @retval PMINFO_R_EINVAL invalid argument
4067 * @retval PMINFO_R_ERROR internal error
4068 * @pre pkgmgrinfo_appinfo_filter_create()
4069 * @post pkgmgrinfo_appinfo_filter_destroy()
4070 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4072 static int get_capp_count()
4076 pkgmgrinfo_appinfo_filter_h handle;
4077 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4078 if (ret != PMINFO_R_OK)
4080 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4081 if (ret != PMINFO_R_OK) {
4082 pkgmgrinfo_appinfo_filter_destroy(handle);
4085 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4086 if (ret != PMINFO_R_OK) {
4087 pkgmgrinfo_appinfo_filter_destroy(handle);
4090 printf("No of capp: %d\n", count);
4091 pkgmgrinfo_appinfo_filter_destroy(handle);
4096 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4099 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4100 * @brief This API creates the application's metadata information filter handle from db.
4102 * @par This API is for package-manager client application
4103 * @par Sync (or) Async : Synchronous API
4105 * @param[out] handle pointer to the application metadata info filter handle.
4106 * @return 0 if success, error code(<0) if fail
4107 * @retval PMINFO_R_OK success
4108 * @retval PMINFO_R_EINVAL invalid argument
4109 * @retval PMINFO_R_ERROR internal error
4111 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4112 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4114 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4117 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4118 printf("appid : %s\n", appid);
4122 static int get_app_list(const char *mkey, const char *mvalue)
4125 pkgmgrinfo_appinfo_metadata_filter_h handle;
4126 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4127 if (ret != PMINFO_R_OK)
4129 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4130 if (ret != PMINFO_R_OK) {
4131 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4134 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4135 if (ret != PMINFO_R_OK) {
4136 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4139 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4144 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4147 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4148 * @brief This API destroys the application's metadata information filter handle.
4150 * @par This API is for package-manager client application
4151 * @par Sync (or) Async : Synchronous API
4153 * @param[in] handle pointer to the application metadata info filter handle.
4154 * @return 0 if success, error code(<0) if fail
4155 * @retval PMINFO_R_OK success
4156 * @retval PMINFO_R_EINVAL invalid argument
4157 * @retval PMINFO_R_ERROR internal error
4158 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4160 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4162 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4165 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4166 printf("appid : %s\n", appid);
4170 static int get_app_list(const char *mkey, const char *mvalue)
4173 pkgmgrinfo_appinfo_metadata_filter_h handle;
4174 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4175 if (ret != PMINFO_R_OK)
4177 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4178 if (ret != PMINFO_R_OK) {
4179 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4182 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4183 if (ret != PMINFO_R_OK) {
4184 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4187 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4192 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4195 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4196 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4197 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4199 * @par This API is for package-manager client application
4200 * @par Sync (or) Async : Synchronous API
4202 * @param[in] handle pointer to the application metadata info filter handle.
4203 * @param[in] key pointer to metadata key
4204 * @param[in] value pointer to metadata value
4205 * @return 0 if success, error code(<0) if fail
4206 * @retval PMINFO_R_OK success
4207 * @retval PMINFO_R_EINVAL invalid argument
4208 * @retval PMINFO_R_ERROR internal error
4209 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4210 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4211 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4213 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4216 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4217 printf("appid : %s\n", appid);
4221 static int get_app_list(const char *mkey, const char *mvalue)
4224 pkgmgrinfo_appinfo_metadata_filter_h handle;
4225 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4226 if (ret != PMINFO_R_OK)
4228 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4229 if (ret != PMINFO_R_OK) {
4230 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4233 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4234 if (ret != PMINFO_R_OK) {
4235 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4238 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4243 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4244 const char *key, const char *value);
4247 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4248 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4249 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4250 * negative value, no more callbacks will be called and API will return.
4252 * @par This API is for package-manager client application
4253 * @par Sync (or) Async : Synchronous API
4255 * @param[in] handle pointer to the application metadata info filter handle.
4256 * @param[in] app_cb function pointer to callback
4257 * @param[in] user_data pointer to user data
4258 * @return 0 if success, error code(<0) if fail
4259 * @retval PMINFO_R_OK success
4260 * @retval PMINFO_R_EINVAL invalid argument
4261 * @retval PMINFO_R_ERROR internal error
4262 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4263 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4265 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4268 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4269 printf("appid : %s\n", appid);
4273 static int get_app_list(const char *mkey, const char *mvalue)
4276 pkgmgrinfo_appinfo_metadata_filter_h handle;
4277 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4278 if (ret != PMINFO_R_OK)
4280 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4281 if (ret != PMINFO_R_OK) {
4282 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4285 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4286 if (ret != PMINFO_R_OK) {
4287 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4290 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4295 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4296 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4299 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4300 * @brief This API creates the package cert information handle to get data from db.
4302 * @par This API is for package-manager client application
4303 * @par Sync (or) Async : Synchronous API
4305 * @param[out] handle pointer to the package cert handle.
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4311 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4312 * @see pkgmgrinfo_pkginfo_get_cert_value()
4313 * @see pkgmgrinfo_pkginfo_load_certinfo()
4315 static int get_cert_info(const char *pkgid)
4318 pkgmgrinfo_certinfo_h handle;
4319 char *auth_cert = NULL;
4320 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4321 if (ret != PMINFO_R_OK)
4323 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4324 if (ret != PMINFO_R_OK) {
4325 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4328 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4329 if (ret != PMINFO_R_OK) {
4330 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4333 printf("Author root certificate: %s\n", auth_root);
4334 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4339 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4342 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4343 * @brief This API loads the package cert information handle with data from db.
4345 * @par This API is for package-manager client application
4346 * @par Sync (or) Async : Synchronous API
4348 * @param[in] pkgid pointer to the package ID.
4349 * @param[in] handle pointer to the package cert handle.
4350 * @return 0 if success, error code(<0) if fail
4351 * @retval PMINFO_R_OK success
4352 * @retval PMINFO_R_EINVAL invalid argument
4353 * @retval PMINFO_R_ERROR internal error
4354 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4355 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4356 * @see pkgmgrinfo_pkginfo_get_cert_value()
4358 static int get_cert_info(const char *pkgid)
4361 pkgmgrinfo_certinfo_h handle;
4362 char *auth_cert = NULL;
4363 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4364 if (ret != PMINFO_R_OK)
4366 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4367 if (ret != PMINFO_R_OK) {
4368 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4371 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4372 if (ret != PMINFO_R_OK) {
4373 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4376 printf("Author root certificate: %s\n", auth_root);
4377 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4382 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4385 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4386 * @brief This API gets the package cert information from the handle
4388 * @par This API is for package-manager client application
4389 * @par Sync (or) Async : Synchronous API
4391 * @param[in] handle pointer to the package cert handle.
4392 * @param[in] cert_type certificate type
4393 * @param[out] cert_value pointer to hold certificate value
4394 * @return 0 if success, error code(<0) if fail
4395 * @retval PMINFO_R_OK success
4396 * @retval PMINFO_R_EINVAL invalid argument
4397 * @retval PMINFO_R_ERROR internal error
4398 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4399 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4400 * @see pkgmgrinfo_pkginfo_load_certinfo()
4402 static int get_cert_info(const char *pkgid)
4405 pkgmgrinfo_certinfo_h handle;
4406 char *auth_cert = NULL;
4407 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4408 if (ret != PMINFO_R_OK)
4410 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4411 if (ret != PMINFO_R_OK) {
4412 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4415 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4416 if (ret != PMINFO_R_OK) {
4417 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4420 printf("Author root certificate: %s\n", auth_root);
4421 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4426 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4429 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4430 * @brief This API destroys the package cert information handle freeing up all the resources
4432 * @par This API is for package-manager client application
4433 * @par Sync (or) Async : Synchronous API
4435 * @param[in] handle pointer to the package cert handle.
4436 * @return 0 if success, error code(<0) if fail
4437 * @retval PMINFO_R_OK success
4438 * @retval PMINFO_R_EINVAL invalid argument
4439 * @retval PMINFO_R_ERROR internal error
4440 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4442 * @see pkgmgrinfo_pkginfo_load_certinfo()
4444 static int get_cert_info(const char *pkgid)
4447 pkgmgrinfo_certinfo_h handle;
4448 char *auth_cert = NULL;
4449 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4450 if (ret != PMINFO_R_OK)
4452 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4453 if (ret != PMINFO_R_OK) {
4454 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4457 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4458 if (ret != PMINFO_R_OK) {
4459 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4462 printf("Author root certificate: %s\n", auth_root);
4463 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4468 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4471 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4472 * @brief This API deletes the package cert information from DB
4474 * @par This API is for package-manager client application
4475 * @par Sync (or) Async : Synchronous API
4477 * @param[in] pkgid pointer to the package ID.
4478 * @return 0 if success, error code(<0) if fail
4479 * @retval PMINFO_R_OK success
4480 * @retval PMINFO_R_EINVAL invalid argument
4481 * @retval PMINFO_R_ERROR internal error
4485 static int delete_cert_info(const char *pkgid)
4488 ret = pkgmgrinfo_delete_certinfo(pkgid);
4489 if (ret != PMINFO_R_OK)
4495 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4498 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4499 * @brief This API creates the package db information handle to set data in db.
4501 * @par This API is for package-manager client application
4502 * @par Sync (or) Async : Synchronous API
4504 * @param[in] pkgid pointer to the package ID.
4505 * @param[out] handle pointer to the package db info handle.
4506 * @return 0 if success, error code(<0) if fail
4507 * @retval PMINFO_R_OK success
4508 * @retval PMINFO_R_EINVAL invalid argument
4509 * @retval PMINFO_R_ERROR internal error
4511 * @post pkgmgrinfo_destroy_pkgdbinfo()
4512 * @see pkgmgrinfo_save_pkgdbinfo()
4513 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4515 static int set_pkg_in_db(const char *pkgid)
4518 pkgmgrinfo_pkgdbinfo_h handle;
4519 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4520 if (ret != PMINFO_R_OK)
4522 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4523 if (ret != PMINFO_R_OK) {
4524 pkgmgrinfo_destroy_pkgdbinfo(handle);
4527 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4528 if (ret != PMINFO_R_OK) {
4529 pkgmgrinfo_destroy_pkgdbinfo(handle);
4532 pkgmgrinfo_destroy_pkgdbinfo(handle);
4537 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4540 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4541 * @brief This API sets the package type in db handle
4543 * @par This API is for package-manager client application
4544 * @par Sync (or) Async : Synchronous API
4546 * @param[in] handle pointer to the pkgdbinfo handle.
4547 * @param[in] type pointer to the package type.
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @retval PMINFO_R_ERROR internal error
4552 * @pre pkgmgrinfo_create_pkgdbinfo()
4553 * @post pkgmgrinfo_destroy_pkgdbinfo()
4554 * @see pkgmgrinfo_save_pkgdbinfo()
4555 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4557 static int set_pkg_type_in_db(const char *pkgid)
4560 pkgmgrinfo_pkgdbinfo_h handle;
4561 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4562 if (ret != PMINFO_R_OK)
4564 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4565 if (ret != PMINFO_R_OK) {
4566 pkgmgrinfo_destroy_pkgdbinfo(handle);
4569 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4570 if (ret != PMINFO_R_OK) {
4571 pkgmgrinfo_destroy_pkgdbinfo(handle);
4574 pkgmgrinfo_destroy_pkgdbinfo(handle);
4579 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4582 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4583 * @brief This API sets the package version in db handle
4585 * @par This API is for package-manager client application
4586 * @par Sync (or) Async : Synchronous API
4588 * @param[in] handle pointer to the pkgdbinfo handle.
4589 * @param[in] version pointer to the package version
4590 * @return 0 if success, error code(<0) if fail
4591 * @retval PMINFO_R_OK success
4592 * @retval PMINFO_R_EINVAL invalid argument
4593 * @retval PMINFO_R_ERROR internal error
4594 * @pre pkgmgrinfo_create_pkgdbinfo()
4595 * @post pkgmgrinfo_destroy_pkgdbinfo()
4596 * @see pkgmgrinfo_save_pkgdbinfo()
4597 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4599 static int set_pkg_version_in_db(const char *pkgid)
4602 pkgmgrinfo_pkgdbinfo_h handle;
4603 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4604 if (ret != PMINFO_R_OK)
4606 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4607 if (ret != PMINFO_R_OK) {
4608 pkgmgrinfo_destroy_pkgdbinfo(handle);
4611 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4612 if (ret != PMINFO_R_OK) {
4613 pkgmgrinfo_destroy_pkgdbinfo(handle);
4616 pkgmgrinfo_destroy_pkgdbinfo(handle);
4621 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4624 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4625 * @brief This API sets the package install location in db handle
4627 * @par This API is for package-manager client application
4628 * @par Sync (or) Async : Synchronous API
4630 * @param[in] handle pointer to the pkgdbinfo handle.
4631 * @param[in] location package install location
4632 * @return 0 if success, error code(<0) if fail
4633 * @retval PMINFO_R_OK success
4634 * @retval PMINFO_R_EINVAL invalid argument
4635 * @retval PMINFO_R_ERROR internal error
4636 * @pre pkgmgrinfo_create_pkgdbinfo()
4637 * @post pkgmgrinfo_destroy_pkgdbinfo()
4638 * @see pkgmgrinfo_save_pkgdbinfo()
4639 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4641 static int set_pkg_install_location_in_db(const char *pkgid)
4644 pkgmgrinfo_pkgdbinfo_h handle;
4645 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4646 if (ret != PMINFO_R_OK)
4648 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4649 if (ret != PMINFO_R_OK) {
4650 pkgmgrinfo_destroy_pkgdbinfo(handle);
4653 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4654 if (ret != PMINFO_R_OK) {
4655 pkgmgrinfo_destroy_pkgdbinfo(handle);
4658 pkgmgrinfo_destroy_pkgdbinfo(handle);
4663 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4666 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4667 * @brief This API sets the package size in db handle
4669 * @par This API is for package-manager client application
4670 * @par Sync (or) Async : Synchronous API
4672 * @param[in] handle pointer to the pkgdbinfo handle.
4673 * @param[in] size pointer to the package size
4674 * @return 0 if success, error code(<0) if fail
4675 * @retval PMINFO_R_OK success
4676 * @retval PMINFO_R_EINVAL invalid argument
4677 * @retval PMINFO_R_ERROR internal error
4678 * @pre pkgmgrinfo_create_pkgdbinfo()
4679 * @post pkgmgrinfo_destroy_pkgdbinfo()
4680 * @see pkgmgrinfo_save_pkgdbinfo()
4681 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4683 static int set_pkg_size_in_db(const char *pkgid)
4686 pkgmgrinfo_pkgdbinfo_h handle;
4687 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4688 if (ret != PMINFO_R_OK)
4690 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4691 if (ret != PMINFO_R_OK) {
4692 pkgmgrinfo_destroy_pkgdbinfo(handle);
4695 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4696 if (ret != PMINFO_R_OK) {
4697 pkgmgrinfo_destroy_pkgdbinfo(handle);
4700 pkgmgrinfo_destroy_pkgdbinfo(handle);
4705 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4708 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4709 * @brief This API sets the package label in db handle
4711 * @par This API is for package-manager client application
4712 * @par Sync (or) Async : Synchronous API
4714 * @param[in] handle pointer to the pkgdbinfo handle.
4715 * @param[in] label pointer to the package label
4716 * @param[in] locale pointer to the locale
4717 * @return 0 if success, error code(<0) if fail
4718 * @retval PMINFO_R_OK success
4719 * @retval PMINFO_R_EINVAL invalid argument
4720 * @retval PMINFO_R_ERROR internal error
4721 * @pre pkgmgrinfo_create_pkgdbinfo()
4722 * @post pkgmgrinfo_destroy_pkgdbinfo()
4723 * @see pkgmgrinfo_save_pkgdbinfo()
4724 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4726 static int set_pkg_label_in_db(const char *pkgid)
4729 pkgmgrinfo_pkgdbinfo_h handle;
4730 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4731 if (ret != PMINFO_R_OK)
4733 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_destroy_pkgdbinfo(handle);
4738 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4739 if (ret != PMINFO_R_OK) {
4740 pkgmgrinfo_destroy_pkgdbinfo(handle);
4743 pkgmgrinfo_destroy_pkgdbinfo(handle);
4748 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4751 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4752 * @brief This API sets the package icon in db handle
4754 * @par This API is for package-manager client application
4755 * @par Sync (or) Async : Synchronous API
4757 * @param[in] handle pointer to the pkgdbinfo handle.
4758 * @param[in] icon pointer to the package icon
4759 * @param[in] locale pointer to the locale
4760 * @return 0 if success, error code(<0) if fail
4761 * @retval PMINFO_R_OK success
4762 * @retval PMINFO_R_EINVAL invalid argument
4763 * @retval PMINFO_R_ERROR internal error
4764 * @pre pkgmgrinfo_create_pkgdbinfo()
4765 * @post pkgmgrinfo_destroy_pkgdbinfo()
4766 * @see pkgmgrinfo_save_pkgdbinfo()
4767 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4769 static int set_pkg_icon_in_db(const char *pkgid)
4772 pkgmgrinfo_pkgdbinfo_h handle;
4773 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4774 if (ret != PMINFO_R_OK)
4776 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4777 if (ret != PMINFO_R_OK) {
4778 pkgmgrinfo_destroy_pkgdbinfo(handle);
4781 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4782 if (ret != PMINFO_R_OK) {
4783 pkgmgrinfo_destroy_pkgdbinfo(handle);
4786 pkgmgrinfo_destroy_pkgdbinfo(handle);
4791 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4794 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4795 * @brief This API sets the package description in db handle
4797 * @par This API is for package-manager client application
4798 * @par Sync (or) Async : Synchronous API
4800 * @param[in] handle pointer to the pkgdbinfo handle.
4801 * @param[in] description pointer to the package description
4802 * @param[in] locale pointer to the locale
4803 * @return 0 if success, error code(<0) if fail
4804 * @retval PMINFO_R_OK success
4805 * @retval PMINFO_R_EINVAL invalid argument
4806 * @retval PMINFO_R_ERROR internal error
4807 * @pre pkgmgrinfo_create_pkgdbinfo()
4808 * @post pkgmgrinfo_destroy_pkgdbinfo()
4809 * @see pkgmgrinfo_save_pkgdbinfo()
4810 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4812 static int set_pkg_description_in_db(const char *pkgid)
4815 pkgmgrinfo_pkgdbinfo_h handle;
4816 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4817 if (ret != PMINFO_R_OK)
4819 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4820 if (ret != PMINFO_R_OK) {
4821 pkgmgrinfo_destroy_pkgdbinfo(handle);
4824 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4825 if (ret != PMINFO_R_OK) {
4826 pkgmgrinfo_destroy_pkgdbinfo(handle);
4829 pkgmgrinfo_destroy_pkgdbinfo(handle);
4834 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4837 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4838 const char *author_email, const char *author_href, const char *locale)
4839 * @brief This API sets the package author info in db handle
4841 * @par This API is for package-manager client application
4842 * @par Sync (or) Async : Synchronous API
4844 * @param[in] handle pointer to the pkgdbinfo handle.
4845 * @param[in] author_name pointer to the package author name
4846 * @param[in] author_email pointer to the package author email
4847 * @param[in] author_href pointer to the package author href
4848 * @param[in] locale pointer to the locale
4849 * @return 0 if success, error code(<0) if fail
4850 * @retval PMINFO_R_OK success
4851 * @retval PMINFO_R_EINVAL invalid argument
4852 * @retval PMINFO_R_ERROR internal error
4853 * @pre pkgmgrinfo_create_pkgdbinfo()
4854 * @post pkgmgrinfo_destroy_pkgdbinfo()
4855 * @see pkgmgrinfo_save_pkgdbinfo()
4856 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4858 static int set_pkg_author_in_db(const char *pkgid)
4861 pkgmgrinfo_pkgdbinfo_h handle;
4862 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4863 if (ret != PMINFO_R_OK)
4865 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4866 if (ret != PMINFO_R_OK) {
4867 pkgmgrinfo_destroy_pkgdbinfo(handle);
4870 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4871 if (ret != PMINFO_R_OK) {
4872 pkgmgrinfo_destroy_pkgdbinfo(handle);
4875 pkgmgrinfo_destroy_pkgdbinfo(handle);
4880 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4881 const char *author_email, const char *author_href, const char *locale);
4884 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4885 * @brief This API sets the package 'removable' value in db handle
4887 * @par This API is for package-manager client application
4888 * @par Sync (or) Async : Synchronous API
4890 * @param[in] handle pointer to the pkgdbinfo handle.
4891 * @param[in] removable package removable value
4892 * @return 0 if success, error code(<0) if fail
4893 * @retval PMINFO_R_OK success
4894 * @retval PMINFO_R_EINVAL invalid argument
4895 * @retval PMINFO_R_ERROR internal error
4896 * @pre pkgmgrinfo_create_pkgdbinfo()
4897 * @post pkgmgrinfo_destroy_pkgdbinfo()
4898 * @see pkgmgrinfo_save_pkgdbinfo()
4899 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4901 static int set_pkg_removable_in_db(const char *pkgid)
4904 pkgmgrinfo_pkgdbinfo_h handle;
4905 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4906 if (ret != PMINFO_R_OK)
4908 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4909 if (ret != PMINFO_R_OK) {
4910 pkgmgrinfo_destroy_pkgdbinfo(handle);
4913 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4914 if (ret != PMINFO_R_OK) {
4915 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 pkgmgrinfo_destroy_pkgdbinfo(handle);
4923 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4926 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4927 * @brief This API sets the package 'preload' value in db handle
4929 * @par This API is for package-manager client application
4930 * @par Sync (or) Async : Synchronous API
4932 * @param[in] handle pointer to the pkgdbinfo handle.
4933 * @param[in] preload package preload value
4934 * @return 0 if success, error code(<0) if fail
4935 * @retval PMINFO_R_OK success
4936 * @retval PMINFO_R_EINVAL invalid argument
4937 * @retval PMINFO_R_ERROR internal error
4938 * @pre pkgmgrinfo_create_pkgdbinfo()
4939 * @post pkgmgrinfo_destroy_pkgdbinfo()
4940 * @see pkgmgrinfo_save_pkgdbinfo()
4941 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4943 static int set_pkg_preload_in_db(const char *pkgid)
4946 pkgmgrinfo_pkgdbinfo_h handle;
4947 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4948 if (ret != PMINFO_R_OK)
4950 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4951 if (ret != PMINFO_R_OK) {
4952 pkgmgrinfo_destroy_pkgdbinfo(handle);
4955 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4956 if (ret != PMINFO_R_OK) {
4957 pkgmgrinfo_destroy_pkgdbinfo(handle);
4960 pkgmgrinfo_destroy_pkgdbinfo(handle);
4965 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4968 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4969 * @brief This API sets the package 'installed_storage' value in db handle
4971 * @par This API is for package-manager client application
4972 * @par Sync (or) Async : Synchronous API
4974 * @param[in] handle pointer to the pkgdbinfo handle.
4975 * @param[in] location installed_storage value
4976 * @return 0 if success, error code(<0) if fail
4977 * @retval PMINFO_R_OK success
4978 * @retval PMINFO_R_EINVAL invalid argument
4979 * @retval PMINFO_R_ERROR internal error
4980 * @pre pkgmgrinfo_create_pkgdbinfo()
4981 * @post pkgmgrinfo_destroy_pkgdbinfo()
4982 * @see pkgmgrinfo_save_pkgdbinfo()
4984 static int set_pkg_installed_storage_in_db(const char *pkgid)
4987 pkgmgrinfo_pkgdbinfo_h handle;
4988 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4989 if (ret != PMINFO_R_OK)
4991 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4992 if (ret != PMINFO_R_OK) {
4993 pkgmgrinfo_destroy_pkgdbinfo(handle);
4996 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4997 if (ret != PMINFO_R_OK) {
4998 pkgmgrinfo_destroy_pkgdbinfo(handle);
5001 pkgmgrinfo_destroy_pkgdbinfo(handle);
5006 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5009 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5010 * @brief This API saves all the information from the handle to the DB.
5012 * @par This API is for package-manager client application
5013 * @par Sync (or) Async : Synchronous API
5015 * @param[in] handle pointer to the package db info handle.
5016 * @return 0 if success, error code(<0) if fail
5017 * @retval PMINFO_R_OK success
5018 * @retval PMINFO_R_EINVAL invalid argument
5019 * @retval PMINFO_R_ERROR internal error
5020 * @pre pkgmgrinfo_create_pkgdbinfo()
5021 * @post pkgmgrinfo_destroy_pkgdbinfo()
5022 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5024 static int set_pkg_in_db(const char *pkgid)
5027 pkgmgrinfo_pkgdbinfo_h handle;
5028 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5029 if (ret != PMINFO_R_OK)
5031 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5032 if (ret != PMINFO_R_OK) {
5033 pkgmgrinfo_destroy_pkgdbinfo(handle);
5036 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5037 if (ret != PMINFO_R_OK) {
5038 pkgmgrinfo_destroy_pkgdbinfo(handle);
5041 pkgmgrinfo_destroy_pkgdbinfo(handle);
5046 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5049 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5050 * @brief This API destroys the package db information handle freeing up all the resources
5052 * @par This API is for package-manager client application
5053 * @par Sync (or) Async : Synchronous API
5055 * @param[in] handle pointer to the package db info handle.
5056 * @return 0 if success, error code(<0) if fail
5057 * @retval PMINFO_R_OK success
5058 * @retval PMINFO_R_EINVAL invalid argument
5059 * @retval PMINFO_R_ERROR internal error
5060 * @pre pkgmgrinfo_create_pkgdbinfo()
5062 * @see pkgmgrinfo_save_pkgdbinfo()
5063 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5065 static int set_pkg_in_db(const char *pkgid)
5068 pkgmgrinfo_pkgdbinfo_h handle;
5069 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5070 if (ret != PMINFO_R_OK)
5072 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5073 if (ret != PMINFO_R_OK) {
5074 pkgmgrinfo_destroy_pkgdbinfo(handle);
5077 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5078 if (ret != PMINFO_R_OK) {
5079 pkgmgrinfo_destroy_pkgdbinfo(handle);
5082 pkgmgrinfo_destroy_pkgdbinfo(handle);
5087 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5091 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5092 * @brief This API creates the package cert information handle to set data in db.
5094 * @par This API is for package-manager client application
5095 * @par Sync (or) Async : Synchronous API
5097 * @param[out] handle pointer to the package cert handle.
5098 * @return 0 if success, error code(<0) if fail
5099 * @retval PMINFO_R_OK success
5100 * @retval PMINFO_R_EINVAL invalid argument
5101 * @retval PMINFO_R_ERROR internal error
5103 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5104 * @see pkgmgrinfo_set_cert_value()
5105 * @see pkgmgrinfo_save_certinfo()
5107 static int set_cert_in_db(const char *pkgid)
5110 pkgmgrinfo_instcertinfo_h handle;
5111 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5112 if (ret != PMINFO_R_OK)
5114 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5115 if (ret != PMINFO_R_OK) {
5116 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5119 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5120 if (ret != PMINFO_R_OK) {
5121 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5124 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5129 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5132 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5133 * @brief This API sets the package cert information in the handle.
5135 * @par This API is for package-manager client application
5136 * @par Sync (or) Async : Synchronous API
5138 * @param[in] handle pointer to the package cert handle.
5139 * @param[in] cert_type certificate type.
5140 * @param[in] cert_value certificate value.
5141 * @return 0 if success, error code(<0) if fail
5142 * @retval PMINFO_R_OK success
5143 * @retval PMINFO_R_EINVAL invalid argument
5144 * @retval PMINFO_R_ERROR internal error
5145 * @pre pkgmgrinfo_create_certinfo_set_handle()
5146 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5147 * @see pkgmgrinfo_save_certinfo()
5149 static int set_cert_in_db(const char *pkgid)
5152 pkgmgrinfo_instcertinfo_h handle;
5153 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5154 if (ret != PMINFO_R_OK)
5156 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5157 if (ret != PMINFO_R_OK) {
5158 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5161 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5162 if (ret != PMINFO_R_OK) {
5163 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5166 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5171 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5174 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5175 * @brief This API saves the package cert information in the DB.
5177 * @par This API is for package-manager client application
5178 * @par Sync (or) Async : Synchronous API
5180 * @param[in] pkgid pointer to the package ID.
5181 * @param[in] handle pointer to the package cert handle.
5182 * @return 0 if success, error code(<0) if fail
5183 * @retval PMINFO_R_OK success
5184 * @retval PMINFO_R_EINVAL invalid argument
5185 * @retval PMINFO_R_ERROR internal error
5186 * @pre pkgmgrinfo_create_certinfo_set_handle()
5187 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5188 * @see pkgmgrinfo_save_certinfo()
5190 static int set_cert_in_db(const char *pkgid)
5193 pkgmgrinfo_instcertinfo_h handle;
5194 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5195 if (ret != PMINFO_R_OK)
5197 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5198 if (ret != PMINFO_R_OK) {
5199 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5202 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5203 if (ret != PMINFO_R_OK) {
5204 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5207 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5212 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5215 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5216 * @brief This API destroys the package cert information handle freeing up all the resources.
5218 * @par This API is for package-manager client application
5219 * @par Sync (or) Async : Synchronous API
5221 * @param[in] handle pointer to the package cert handle.
5222 * @return 0 if success, error code(<0) if fail
5223 * @retval PMINFO_R_OK success
5224 * @retval PMINFO_R_EINVAL invalid argument
5225 * @retval PMINFO_R_ERROR internal error
5226 * @pre pkgmgrinfo_create_certinfo_set_handle()
5228 * @see pkgmgrinfo_save_certinfo()
5230 static int set_cert_in_db(const char *pkgid)
5233 pkgmgrinfo_instcertinfo_h handle;
5234 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5235 if (ret != PMINFO_R_OK)
5237 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5238 if (ret != PMINFO_R_OK) {
5239 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5242 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5243 if (ret != PMINFO_R_OK) {
5244 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5247 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5252 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5255 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5256 * @brief This API gets the datacontrol info
5258 * @par This API is for package-manager client application
5259 * @par Sync (or) Async : Synchronous API
5261 * @param[in] providerid pointer to the providerid of dataconltrol.
5262 * @param[in] type pointer to the type of dataconltrol.
5263 * @param[out] appid pointer to hold appid, need to free after using
5264 * @param[out] access pointer to hold access, need to free after using
5265 * @return 0 if success, error code(<0) if fail
5266 * @retval PMINFO_R_OK success
5267 * @retval PMINFO_R_EINVAL invalid argument
5268 * @retval PMINFO_R_ERROR internal error
5271 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5274 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5275 * @brief This API gets the application 'guest mode visibility' value from the DB
5277 * @par This API is for package-manager client application
5278 * @par Sync (or) Async : Synchronous API
5280 * @param[in] handle pointer to application info handle
5281 * @param[out] status pointer to hold app guest mode visibility value
5282 * @return 0 if success, error code(<0) if fail
5283 * @retval PMINFO_R_OK success
5284 * @retval PMINFO_R_EINVAL invalid argument
5285 * @retval PMINFO_R_ERROR internal error
5286 * @pre pkgmgrinfo_appinfo_get_appinfo()
5287 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5288 * @see pkgmgrinfo_appinfo_get_appid()
5289 * @see pkgmgrinfo_appinfo_is_multiple()
5291 static int get_app_guestmode_visibility(const char *appid)
5295 pkgmgrinfo_appinfo_h handle;
5296 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5297 if (ret != PMINFO_R_OK)
5299 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5300 if (ret != PMINFO_R_OK) {
5301 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5304 printf("app guest mode visibility: %d\n", status);
5305 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5310 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5313 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5314 * @brief This API sets the application 'guest mode visibility' value in the DB
5316 * @par This API is for package-manager client application
5317 * @par Sync (or) Async : Synchronous API
5319 * @param[in] handle pointer to application info handle
5320 * @param[out] status app guest mode visibility value
5321 * @return 0 if success, error code(<0) if fail
5322 * @retval PMINFO_R_OK success
5323 * @retval PMINFO_R_EINVAL invalid argument
5324 * @retval PMINFO_R_ERROR internal error
5325 * @pre pkgmgrinfo_appinfo_get_appinfo()
5326 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5327 * @see pkgmgrinfo_appinfo_get_appid()
5328 * @see pkgmgrinfo_appinfo_is_multiple()
5330 static int set_app_guestmode_visibility(const char *appid, bool value)
5333 pkgmgrinfo_appinfo_h handle;
5334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5335 if (ret != PMINFO_R_OK)
5337 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5338 if (ret != PMINFO_R_OK) {
5339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5347 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5350 * @pkgmgrinfo client API
5354 * @brief listening status type in pkgmgrinfo.
5356 #define PMINFO_CLIENT_STATUS_ALL 0x00
5357 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5358 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5359 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5360 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5361 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5362 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5365 * @brief type definition.
5367 typedef void pkgmgrinfo_client;
5368 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5369 const char *pkgid, const char *key,
5370 const char *val, const void *pmsg, void *data);
5376 }pkgmgrinfo_client_type;
5379 * @brief This APIs provides pkgmgrinfo client listener
5381 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5382 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5383 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5384 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5385 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5388 * @pkgmgrinfo client API end
5396 #endif /* __PKG_INFO_H__ */