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_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
147 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
148 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
149 }pkgmgrinfo_app_recentimage;
152 * @brief A handle to get package information
154 typedef void* pkgmgrinfo_pkginfo_h;
157 * @brief A handle to get application information
159 typedef void* pkgmgrinfo_appinfo_h;
162 * @brief A handle to get certificate information
164 typedef void* pkgmgrinfo_certinfo_h;
167 * @brief A handle to insert package information
169 typedef void* pkgmgrinfo_pkgdbinfo_h;
172 * @brief A handle to filter package information
174 typedef void* pkgmgrinfo_pkginfo_filter_h;
177 * @brief A handle to filter application information
179 typedef void* pkgmgrinfo_appinfo_filter_h;
182 * @brief A handle to filter application metadata information
184 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
187 * @brief A handle to get appcontrol information
189 typedef void* pkgmgrinfo_appcontrol_h;
192 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
194 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
196 * @param[in] handle the pkginfo handle
197 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
199 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
201 * @see pkgmgrinfo_pkginfo_get_list()
202 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
204 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
208 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
210 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
212 * @param[in] handle the appinfo handle
213 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
215 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
217 * @see pkgmgrinfo_appinfo_get_list()
218 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
219 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
221 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
225 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
227 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
229 * @param[in] category_name the name of the category
230 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
232 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
234 * @see pkgmgrinfo_appinfo_foreach_category()
236 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
240 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
242 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
244 * @param[in] privilege_name the name of the privilege
245 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
247 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
249 * @see pkgmgrinfo_pkginfo_foreach_privilege()
251 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
255 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
257 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
259 * @param[in] metadata_name the name of the metadata
260 * @param[in] metadata_value the value of the metadata
261 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
263 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
265 * @see pkgmgrinfo_appinfo_foreach_metadata()
267 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
268 const char *metadata_value, void *user_data);
271 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
273 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
275 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
276 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
278 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
280 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
282 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
286 * @brief Install Location Types
289 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
290 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
291 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
292 }pkgmgrinfo_install_location;
295 * @brief Application Component Types
298 PMINFO_ALL_APP = 0, /**< All Application*/
299 PMINFO_UI_APP, /**< UI Application*/
300 PMINFO_SVC_APP, /**< Service Application*/
301 }pkgmgrinfo_app_component;
304 * @brief Application Storage Types
307 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
308 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
309 }pkgmgrinfo_installed_storage;
312 * @brief Certificate Types to be used for getting information
315 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
316 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
317 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
318 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
319 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
320 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
321 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
322 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
323 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
324 }pkgmgrinfo_cert_type;
327 * @brief Install Location Types to be used when setting data in DB
330 INSTALL_INTERNAL = 0, /**< Internal Installation*/
331 INSTALL_EXTERNAL, /**< External Installation*/
335 * @brief permission Types
338 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
339 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
340 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
341 }pkgmgrinfo_permission_type;
344 /** String property for filtering based on package info*/
345 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
346 /** String property for filtering based on package info*/
347 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
348 /** String property for filtering based on package info*/
349 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
350 /** String property for filtering based on package info*/
351 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
352 /** String property for filtering based on package info*/
353 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
354 /** String property for filtering based on package info*/
355 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
356 /** String property for filtering based on package info*/
357 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
358 /** String property for filtering based on package info*/
359 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
361 /** Boolean property for filtering based on package info*/
362 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
363 /** Boolean property for filtering based on package info*/
364 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
365 /** Boolean property for filtering based on package info*/
366 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
367 /** Boolean property for filtering based on package info*/
368 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
369 /** Boolean property for filtering based on package info*/
370 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
371 /** Boolean property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
374 /** Integer property for filtering based on package info*/
375 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
377 /** String property for filtering based on app info*/
378 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
379 /** String property for filtering based on app info*/
380 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
381 /** String property for filtering based on app info*/
382 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
383 /** String property for filtering based on app info*/
384 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
385 /** String property for filtering based on app info*/
386 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
387 /** String property for filtering based on app info*/
388 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
389 /** String property for filtering based on app info*/
390 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
391 /** String property for filtering based on app info*/
392 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
393 /** String property for filtering based on app info*/
394 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
395 /** String property for filtering based on app info*/
396 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
398 /** Boolean property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
400 /** Boolean property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
402 /** Boolean property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
404 /** Boolean property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
406 /** Boolean property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
408 /** Boolean property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
411 /** will be updated*/
412 /** string property for filtering based on pkg info*/
413 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
416 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
417 * @brief This API gets list of installed packages
419 * @par This API is for package-manager client application
420 * @par Sync (or) Async : Synchronous API
421 * @param[in] pkg_list_cb iteration function for list
422 * @param[in] user_data user data to be passed to callback function
423 * @return 0 if success, error code(<0) if fail
424 * @retval PMINFO_R_OK success
425 * @retval PMINFO_R_EINVAL invalid argument
426 * @retval PMINFO_R_ERROR internal error
430 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
434 pkgid1 = (char *)user_data;
435 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
436 if (strcmp(pkgid1, pkgid2) == 0) {
443 static int list_pkgs()
446 char *name = "helloworld";
447 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
448 if (ret != PMINFO_R_OK) {
455 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
458 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
459 * @brief This API creates the package information handle from db
461 * @par This API is for package-manager client application
462 * @par Sync (or) Async : Synchronous API
464 * @param[in] pkgid pointer to package ID
465 * @param[out] handle pointer to the package info handle.
466 * @return 0 if success, error code(<0) if fail
467 * @retval PMINFO_R_OK success
468 * @retval PMINFO_R_EINVAL invalid argument
469 * @retval PMINFO_R_ERROR internal error
471 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
472 * @see pkgmgrinfo_pkginfo_get_pkgid()
473 * @see pkgmgrinfo_pkginfo_is_removable()
475 static int get_pkg_type(const char *pkgid)
479 pkgmgrinfo_pkginfo_h handle;
480 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
481 if (ret != PMINFO_R_OK)
483 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
484 if (ret != PMINFO_R_OK) {
485 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
488 printf("pkgtype: %s\n", type);
489 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
494 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
497 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
498 * @brief This API gets the package name from the package ID
500 * @par This API is for package-manager client application
501 * @par Sync (or) Async : Synchronous API
503 * @param[in] handle pointer to package info handle
504 * @param[out] pkg_name pointer to hold package name
505 * @return 0 if success, error code(<0) if fail
506 * @retval PMINFO_R_OK success
507 * @retval PMINFO_R_EINVAL invalid argument
508 * @retval PMINFO_R_ERROR internal error
509 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
510 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
511 * @see pkgmgrinfo_pkginfo_get_type()
512 * @see pkgmgrinfo_pkginfo_is_removable()
514 static int get_pkg_name(const char *pkgid)
517 char *pkgname = NULL;
518 pkgmgrinfo_pkginfo_h handle;
519 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
520 if (ret != PMINFO_R_OK)
522 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
523 if (ret != PMINFO_R_OK) {
524 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
527 printf("pkgname: %s\n", pkgname);
528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
533 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
536 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
537 * @brief This API gets the package id from the package ID
539 * @par This API is for package-manager client application
540 * @par Sync (or) Async : Synchronous API
542 * @param[in] handle pointer to package info handle
543 * @param[out] pkgid pointer to hold package id
544 * @return 0 if success, error code(<0) if fail
545 * @retval PMINFO_R_OK success
546 * @retval PMINFO_R_EINVAL invalid argument
547 * @retval PMINFO_R_ERROR internal error
548 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
549 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
550 * @see pkgmgrinfo_pkginfo_get_type()
551 * @see pkgmgrinfo_pkginfo_is_removable()
553 static int get_pkgid(const char *pkgid)
557 pkgmgrinfo_pkginfo_h handle;
558 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
559 if (ret != PMINFO_R_OK)
561 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
562 if (ret != PMINFO_R_OK) {
563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
566 printf("pkg id: %s\n", pkg_id);
567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
572 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
575 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
576 * @brief This API gets the package type from the package ID
578 * @par This API is for package-manager client application
579 * @par Sync (or) Async : Synchronous API
581 * @param[in] handle pointer to package info handle
582 * @param[out] type pointer to hold package type
583 * @return 0 if success, error code(<0) if fail
584 * @retval PMINFO_R_OK success
585 * @retval PMINFO_R_EINVAL invalid argument
586 * @retval PMINFO_R_ERROR internal error
587 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
588 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
589 * @see pkgmgrinfo_pkginfo_get_pkgid()
590 * @see pkgmgrinfo_pkginfo_is_removable()
592 static int get_pkg_type(const char *pkgid)
596 pkgmgrinfo_pkginfo_h handle;
597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
598 if (ret != PMINFO_R_OK)
600 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
601 if (ret != PMINFO_R_OK) {
602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
605 printf("pkgtype: %s\n", type);
606 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
611 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
614 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
615 * @brief This API gets the package version from the package ID
617 * @par This API is for package-manager client application
618 * @par Sync (or) Async : Synchronous API
620 * @param[in] handle pointer to package info handle
621 * @param[out] version pointer to hold package version
622 * @return 0 if success, error code(<0) if fail
623 * @retval PMINFO_R_OK success
624 * @retval PMINFO_R_EINVAL invalid argument
625 * @retval PMINFO_R_ERROR internal error
626 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
627 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
628 * @see pkgmgrinfo_pkginfo_get_pkgid()
629 * @see pkgmgrinfo_pkginfo_is_removable()
631 static int get_pkg_version(const char *pkgid)
634 char *version = NULL;
635 pkgmgrinfo_pkginfo_h handle;
636 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
637 if (ret != PMINFO_R_OK)
639 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
640 if (ret != PMINFO_R_OK) {
641 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
644 printf("pkg version: %s\n", version);
645 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
650 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
653 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
654 * @brief This API gets the package install location from the package ID
656 * @par This API is for package-manager client application
657 * @par Sync (or) Async : Synchronous API
659 * @param[in] handle pointer to package info handle
660 * @param[out] location pointer to hold package install location
661 * @return 0 if success, error code(<0) if fail
662 * @retval PMINFO_R_OK success
663 * @retval PMINFO_R_EINVAL invalid argument
664 * @retval PMINFO_R_ERROR internal error
665 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
666 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
667 * @see pkgmgrinfo_pkginfo_get_pkgid()
668 * @see pkgmgrinfo_pkginfo_is_removable()
670 static int get_pkg_install_location(const char *pkgid)
673 pkgmgrinfo_install_location location;
674 pkgmgrinfo_pkginfo_h handle;
675 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
676 if (ret != PMINFO_R_OK)
678 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
679 if (ret != PMINFO_R_OK) {
680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
683 printf("pkg install location: %d\n", location);
684 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
689 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
692 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
693 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
694 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
695 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
697 * @par This API is for package-manager client application
698 * @par Sync (or) Async : Synchronous API
700 * @param[in] handle pointer to package info handle
701 * @param[out] size pointer to hold package size
702 * @return 0 if success, error code(<0) if fail
703 * @retval PMINFO_R_OK success
704 * @retval PMINFO_R_EINVAL invalid argument
705 * @retval PMINFO_R_ERROR internal error
706 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
707 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
708 * @see pkgmgrinfo_pkginfo_get_pkgid()
709 * @see pkgmgrinfo_pkginfo_is_removable()
711 static int get_pkg_size(const char *pkgid)
715 pkgmgrinfo_pkginfo_h handle;
716 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
717 if (ret != PMINFO_R_OK)
719 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
720 if (ret != PMINFO_R_OK) {
721 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
724 printf("pkgsize: %d\n", size);
725 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
730 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
733 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
734 * @brief This API gets the installed package total size on the target.
736 * @par This API is for package-manager client application
737 * @par Sync (or) Async : Synchronous API
739 * @param[in] handle pointer to package info handle
740 * @param[out] size pointer to hold package total size
741 * @return 0 if success, error code(<0) if fail
742 * @retval PMINFO_R_OK success
743 * @retval PMINFO_R_EINVAL invalid argument
744 * @retval PMINFO_R_ERROR internal error
746 static int get_pkg_total_size(const char *pkgid)
750 pkgmgrinfo_pkginfo_h handle;
751 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
752 if (ret != PMINFO_R_OK)
754 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
755 if (ret != PMINFO_R_OK) {
756 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
759 printf("pkg total size: %d\n", size);
760 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
765 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
768 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
769 * @brief This API gets the installed package data size on the target.
771 * @par This API is for package-manager client application
772 * @par Sync (or) Async : Synchronous API
774 * @param[in] handle pointer to package info handle
775 * @param[out] size pointer to hold package data size
776 * @return 0 if success, error code(<0) if fail
777 * @retval PMINFO_R_OK success
778 * @retval PMINFO_R_EINVAL invalid argument
779 * @retval PMINFO_R_ERROR internal error
781 static int get_pkg_data_size(const char *pkgid)
785 pkgmgrinfo_pkginfo_h handle;
786 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
787 if (ret != PMINFO_R_OK)
789 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
790 if (ret != PMINFO_R_OK) {
791 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
794 printf("pkg data size: %d\n", size);
795 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
800 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
803 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
804 * @brief This API gets the package icon from the package ID
806 * @par This API is for package-manager client application
807 * @par Sync (or) Async : Synchronous API
809 * @param[in] handle pointer to package info handle
810 * @param[out] icon pointer to hold package icon
811 * @return 0 if success, error code(<0) if fail
812 * @retval PMINFO_R_OK success
813 * @retval PMINFO_R_EINVAL invalid argument
814 * @retval PMINFO_R_ERROR internal error
815 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
816 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
817 * @see pkgmgrinfo_pkginfo_get_pkgid()
818 * @see pkgmgrinfo_pkginfo_is_removable()
820 static int get_pkg_icon(const char *pkgid)
824 pkgmgrinfo_pkginfo_h handle;
825 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
826 if (ret != PMINFO_R_OK)
828 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
829 if (ret != PMINFO_R_OK) {
830 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
833 printf("pkg icon: %s\n", icon);
834 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
839 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
842 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
843 * @brief This API gets the package label from the package ID
845 * @par This API is for package-manager client application
846 * @par Sync (or) Async : Synchronous API
848 * @param[in] handle pointer to package info handle
849 * @param[out] label pointer to hold package label
850 * @return 0 if success, error code(<0) if fail
851 * @retval PMINFO_R_OK success
852 * @retval PMINFO_R_EINVAL invalid argument
853 * @retval PMINFO_R_ERROR internal error
854 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
855 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
856 * @see pkgmgrinfo_pkginfo_get_pkgid()
857 * @see pkgmgrinfo_pkginfo_is_removable()
859 static int get_pkg_label(const char *pkgid)
863 pkgmgrinfo_pkginfo_h handle;
864 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
865 if (ret != PMINFO_R_OK)
867 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
868 if (ret != PMINFO_R_OK) {
869 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
872 printf("pkg label: %s\n", label);
873 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
878 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
881 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
882 * @brief This API gets the package description from the package ID
884 * @par This API is for package-manager client application
885 * @par Sync (or) Async : Synchronous API
887 * @param[in] handle pointer to package info handle
888 * @param[out] description pointer to hold package description
889 * @return 0 if success, error code(<0) if fail
890 * @retval PMINFO_R_OK success
891 * @retval PMINFO_R_EINVAL invalid argument
892 * @retval PMINFO_R_ERROR internal error
893 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
894 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
895 * @see pkgmgrinfo_pkginfo_get_pkgid()
896 * @see pkgmgrinfo_pkginfo_is_removable()
898 static int get_pkg_description(const char *pkgid)
901 char *description = NULL;
902 pkgmgrinfo_pkginfo_h handle;
903 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
904 if (ret != PMINFO_R_OK)
906 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
907 if (ret != PMINFO_R_OK) {
908 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
911 printf("pkg description: %s\n", description);
912 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
917 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
920 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
921 * @brief This API gets the package's author name from the package ID
923 * @par This API is for package-manager client application
924 * @par Sync (or) Async : Synchronous API
926 * @param[in] handle pointer to package info handle
927 * @param[out] author_name pointer to hold package author name
928 * @return 0 if success, error code(<0) if fail
929 * @retval PMINFO_R_OK success
930 * @retval PMINFO_R_EINVAL invalid argument
931 * @retval PMINFO_R_ERROR internal error
932 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
933 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
934 * @see pkgmgrinfo_pkginfo_get_pkgid()
935 * @see pkgmgrinfo_pkginfo_is_removable()
937 static int get_pkg_author_name(const char *pkgid)
940 char *author_name = NULL;
941 pkgmgrinfo_pkginfo_h handle;
942 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
943 if (ret != PMINFO_R_OK)
945 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
946 if (ret != PMINFO_R_OK) {
947 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
950 printf("pkg author name: %s\n", author_name);
951 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
956 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
959 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
960 * @brief This API gets the package's author email from the package ID
962 * @par This API is for package-manager client application
963 * @par Sync (or) Async : Synchronous API
965 * @param[in] handle pointer to package info handle
966 * @param[out] author_email pointer to hold package author email
967 * @return 0 if success, error code(<0) if fail
968 * @retval PMINFO_R_OK success
969 * @retval PMINFO_R_EINVAL invalid argument
970 * @retval PMINFO_R_ERROR internal error
971 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
972 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
973 * @see pkgmgrinfo_pkginfo_get_pkgid()
974 * @see pkgmgrinfo_pkginfo_is_removable()
976 static int get_pkg_author_email(const char *pkgid)
979 char *author_email = NULL;
980 pkgmgrinfo_pkginfo_h handle;
981 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
982 if (ret != PMINFO_R_OK)
984 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
985 if (ret != PMINFO_R_OK) {
986 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
989 printf("pkg author email: %s\n", author_email);
990 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
995 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
998 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
999 * @brief This API gets the package's author href from the package ID
1001 * @par This API is for package-manager client application
1002 * @par Sync (or) Async : Synchronous API
1004 * @param[in] handle pointer to package info handle
1005 * @param[out] author_href pointer to hold package author href
1006 * @return 0 if success, error code(<0) if fail
1007 * @retval PMINFO_R_OK success
1008 * @retval PMINFO_R_EINVAL invalid argument
1009 * @retval PMINFO_R_ERROR internal error
1010 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1011 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1012 * @see pkgmgrinfo_pkginfo_get_pkgid()
1013 * @see pkgmgrinfo_pkginfo_is_removable()
1015 static int get_pkg_author_href(const char *pkgid)
1018 char *author_href = NULL;
1019 pkgmgrinfo_pkginfo_h handle;
1020 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1021 if (ret != PMINFO_R_OK)
1023 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1024 if (ret != PMINFO_R_OK) {
1025 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1028 printf("pkg author href: %s\n", author_href);
1029 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1034 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1037 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1038 * @brief This API gets the package installed storagae value from the package ID
1040 * @par This API is for package-manager client application
1041 * @par Sync (or) Async : Synchronous API
1043 * @param[in] handle pointer to package info handle
1044 * @param[out] storage pointer to hold package installed storage
1045 * @return 0 if success, error code(<0) if fail
1046 * @retval PMINFO_R_OK success
1047 * @retval PMINFO_R_EINVAL invalid argument
1048 * @retval PMINFO_R_ERROR internal error
1049 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1050 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1051 * @see pkgmgrinfo_pkginfo_get_pkgid()
1052 * @see pkgmgrinfo_pkginfo_is_removable()
1054 static int get_pkg_installed_storage(const char *pkgid)
1057 pkgmgrinfo_installed_storage storage;
1058 pkgmgrinfo_pkginfo_h handle;
1059 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1060 if (ret != PMINFO_R_OK)
1062 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1063 if (ret != PMINFO_R_OK) {
1064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1067 printf("pkg installed storage: %d\n", storage);
1068 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1073 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1076 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1077 * @brief This API gets the installed time of package from the package ID
1079 * @par This API is for package-manager client application
1080 * @par Sync (or) Async : Synchronous API
1082 * @param[in] handle pointer to package info handle
1083 * @param[out] installed_time pointer to hold installed time of package
1084 * @return 0 if success, error code(<0) if fail
1085 * @retval PMINFO_R_OK success
1086 * @retval PMINFO_R_EINVAL invalid argument
1087 * @retval PMINFO_R_ERROR internal error
1088 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1089 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1090 * @see pkgmgrinfo_pkginfo_get_pkgid()
1091 * @see pkgmgrinfo_pkginfo_is_removable()
1093 static int get_pkg_installed_time(const char *pkgid)
1096 int installed_time = 0;
1097 pkgmgrinfo_pkginfo_h handle;
1098 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1099 if (ret != PMINFO_R_OK)
1101 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1102 if (ret != PMINFO_R_OK) {
1103 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1106 printf("installed_time: %d\n", installed_time);
1107 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1112 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1115 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1116 * @brief This API gets the store client id of package from the package ID
1118 * @par This API is for package-manager client application
1119 * @par Sync (or) Async : Synchronous API
1121 * @param[in] handle pointer to package info handle
1122 * @param[out] storeclientid pointer to hold store client id of package
1123 * @return 0 if success, error code(<0) if fail
1124 * @retval PMINFO_R_OK success
1125 * @retval PMINFO_R_EINVAL invalid argument
1126 * @retval PMINFO_R_ERROR internal error
1127 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1128 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1129 * @see pkgmgrinfo_pkginfo_get_pkgid()
1130 * @see pkgmgrinfo_pkginfo_is_removable()
1132 static int get_pkg_storeclientid(const char *pkgid)
1135 char *storeclientid = 0;
1136 pkgmgrinfo_pkginfo_h handle;
1137 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1138 if (ret != PMINFO_R_OK)
1140 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1141 if (ret != PMINFO_R_OK) {
1142 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1145 printf(store client id: %s\n", storeclientid);
1146 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1151 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1154 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1155 * @brief This API gets the main app id of package from the package ID
1157 * @par This API is for package-manager client application
1158 * @par Sync (or) Async : Synchronous API
1160 * @param[in] handle pointer to package info handle
1161 * @param[out] mainappid pointer to hold main app id of package
1162 * @return 0 if success, error code(<0) if fail
1163 * @retval PMINFO_R_OK success
1164 * @retval PMINFO_R_EINVAL invalid argument
1165 * @retval PMINFO_R_ERROR internal error
1166 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1167 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1168 * @see pkgmgrinfo_pkginfo_get_pkgid()
1169 * @see pkgmgrinfo_pkginfo_is_removable()
1171 static int get_pkg_mainappid(const char *pkgid)
1174 char *mainappid = 0;
1175 pkgmgrinfo_pkginfo_h handle;
1176 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1177 if (ret != PMINFO_R_OK)
1179 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1180 if (ret != PMINFO_R_OK) {
1181 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1184 printf(main app id: %s\n", mainappid);
1185 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1190 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1193 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1194 * @brief This API gets the url of package from the package ID
1196 * @par This API is for package-manager client application
1197 * @par Sync (or) Async : Synchronous API
1199 * @param[in] handle pointer to package info handle
1200 * @param[out] url pointer to hold url of package
1201 * @return 0 if success, error code(<0) if fail
1202 * @retval PMINFO_R_OK success
1203 * @retval PMINFO_R_EINVAL invalid argument
1204 * @retval PMINFO_R_ERROR internal error
1205 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1206 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1207 * @see pkgmgrinfo_pkginfo_get_pkgid()
1208 * @see pkgmgrinfo_pkginfo_is_removable()
1210 static int get_pkg_url(const char *pkgid)
1214 pkgmgrinfo_pkginfo_h handle;
1215 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1216 if (ret != PMINFO_R_OK)
1218 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1219 if (ret != PMINFO_R_OK) {
1220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1223 printf("url : %s\n", url);
1224 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1229 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1233 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1234 * @brief This API gets the root path of package
1236 * @par Sync (or) Async : Synchronous API
1238 * @param[in] handle pointer to package info handle
1239 * @param[out] path pointer to hold root path of package
1240 * @return 0 if success, error code(<0) if fail
1241 * @retval PMINFO_R_OK success
1242 * @retval PMINFO_R_EINVAL invalid argument
1243 * @retval PMINFO_R_ERROR internal error
1245 static int get_root_path(const char *pkgid)
1249 pkgmgrinfo_pkginfo_h handle;
1250 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1251 if (ret != PMINFO_R_OK)
1254 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1255 if (ret != PMINFO_R_OK) {
1256 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1259 printf("path : %s\n", path);
1260 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1266 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1269 * @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)
1270 * @brief This API compare the cert information from given package id
1272 * @par This API is for package-manager client application
1273 * @par Sync (or) Async : Synchronous API
1275 * @param[in] lhs_package_id pointer to first package ID
1276 * @param[in] rhs_package_id pointer to second package ID
1277 * @param[out] compare_result pointer to the compare result.
1278 * @return 0 if success, error code(<0) if fail
1279 * @retval PMINFO_R_OK success
1280 * @retval PMINFO_R_EINVAL invalid argument
1281 * @retval PMINFO_R_ERROR internal error
1283 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1284 * @see pkgmgrinfo_pkginfo_get_pkgid()
1285 * @see pkgmgrinfo_pkginfo_is_removable()
1287 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1290 pkgmgrinfo_cert_compare_result_type_e result;
1292 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1293 if (ret != PMINFO_R_OK) {
1296 printf("result: %d\n", result);
1301 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);
1304 * @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)
1305 * @brief This API compare the cert information from given app id
1307 * @par This API is for package-manager client application
1308 * @par Sync (or) Async : Synchronous API
1310 * @param[in] lhs_app_id pointer to first app ID
1311 * @param[in] rhs_app_id pointer to second app ID
1312 * @param[out] compare_result pointer to the compare result.
1313 * @return 0 if success, error code(<0) if fail
1314 * @retval PMINFO_R_OK success
1315 * @retval PMINFO_R_EINVAL invalid argument
1316 * @retval PMINFO_R_ERROR internal error
1318 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1319 * @see pkgmgrinfo_pkginfo_get_pkgid()
1320 * @see pkgmgrinfo_pkginfo_is_removable()
1322 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1325 pkgmgrinfo_cert_compare_result_type_e result;
1327 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1328 if (ret != PMINFO_R_OK) {
1331 printf("result: %d\n", result);
1336 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);
1339 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1340 * @brief This API gets the package 'removable' value from the package ID
1342 * @par This API is for package-manager client application
1343 * @par Sync (or) Async : Synchronous API
1345 * @param[in] handle pointer to package info handle
1346 * @param[out] removable pointer to hold package removable value
1347 * @return 0 if success, error code(<0) if fail
1348 * @retval PMINFO_R_OK success
1349 * @retval PMINFO_R_EINVAL invalid argument
1350 * @retval PMINFO_R_ERROR internal error
1351 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1352 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1353 * @see pkgmgrinfo_pkginfo_get_pkgid()
1354 * @see pkgmgrinfo_pkginfo_is_readonly()
1356 static int get_pkg_removable(const char *pkgid)
1360 pkgmgrinfo_pkginfo_h handle;
1361 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1362 if (ret != PMINFO_R_OK)
1364 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1365 if (ret != PMINFO_R_OK) {
1366 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1369 printf("pkg removable: %d\n", removable);
1370 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1375 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1378 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1379 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1381 * @par This API is for package-manager client application
1382 * @par Sync (or) Async : Synchronous API
1384 * @param[in] handle pointer to package info handle
1385 * @param[out] movable pointer to hold package movable state
1386 * @return 0 if success, error code(<0) if fail
1387 * @retval PMINFO_R_OK success
1388 * @retval PMINFO_R_EINVAL invalid argument
1389 * @retval PMINFO_R_ERROR internal error
1390 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1391 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1392 * @see pkgmgrinfo_pkginfo_get_pkgid()
1394 static int get_pkg_movable(const char *pkgid)
1398 pkgmgrinfo_pkginfo_h handle;
1399 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1400 if (ret != PMINFO_R_OK)
1402 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1403 if (ret != PMINFO_R_OK) {
1404 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1407 printf("pkg movable: %d\n", movable);
1408 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1413 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1416 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1417 * @brief This API gets the package 'preload' value from the package ID
1419 * @par This API is for package-manager client application
1420 * @par Sync (or) Async : Synchronous API
1422 * @param[in] handle pointer to package info handle
1423 * @param[out] preload pointer to hold package preload value
1424 * @return 0 if success, error code(<0) if fail
1425 * @retval PMINFO_R_OK success
1426 * @retval PMINFO_R_EINVAL invalid argument
1427 * @retval PMINFO_R_ERROR internal error
1428 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1429 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1430 * @see pkgmgrinfo_pkginfo_get_pkgid()
1431 * @see pkgmgrinfo_pkginfo_is_readonly()
1433 static int get_pkg_preload(const char *pkgid)
1437 pkgmgrinfo_pkginfo_h handle;
1438 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1439 if (ret != PMINFO_R_OK)
1441 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1442 if (ret != PMINFO_R_OK) {
1443 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 printf("pkg preload: %d\n", preload);
1447 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1452 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1455 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1456 * @brief This API gets the package 'readonly' value from the package ID
1458 * @par This API is for package-manager client application
1459 * @par Sync (or) Async : Synchronous API
1461 * @param[in] handle pointer to package info handle
1462 * @param[out] readonly pointer to hold package readonly value
1463 * @return 0 if success, error code(<0) if fail
1464 * @retval PMINFO_R_OK success
1465 * @retval PMINFO_R_EINVAL invalid argument
1466 * @retval PMINFO_R_ERROR internal error
1467 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1468 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1469 * @see pkgmgrinfo_pkginfo_get_pkgid()
1470 * @see pkgmgrinfo_pkginfo_is_removable()
1472 static int get_pkg_readonly(const char *pkgid)
1476 pkgmgrinfo_pkginfo_h handle;
1477 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1478 if (ret != PMINFO_R_OK)
1480 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1481 if (ret != PMINFO_R_OK) {
1482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1485 printf("pkg readonly: %d\n", readonly);
1486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1495 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1496 * @brief This API gets the package 'upate' value from the package ID
1498 * @par This API is for package-manager client application
1499 * @par Sync (or) Async : Synchronous API
1501 * @param[in] handle pointer to package info handle
1502 * @param[out] update pointer to hold package update value
1503 * @return 0 if success, error code(<0) if fail
1504 * @retval PMINFO_R_OK success
1505 * @retval PMINFO_R_EINVAL invalid argument
1506 * @retval PMINFO_R_ERROR internal error
1507 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1508 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1509 * @see pkgmgrinfo_pkginfo_get_pkgid()
1511 static int get_pkg_update(const char *pkgid)
1515 pkgmgrinfo_pkginfo_h handle;
1516 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1517 if (ret != PMINFO_R_OK)
1519 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1520 if (ret != PMINFO_R_OK) {
1521 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1524 printf("pkg update: %d\n", update);
1525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1530 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1533 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1534 * @brief This API gets the package 'accessible' value from the package ID
1536 * @par This API is for package-manager client application
1537 * @par Sync (or) Async : Synchronous API
1539 * @param[in] handle pointer to package info handle
1540 * @param[out] accessible pointer to hold package accessible value
1541 * @return 0 if success, error code(<0) if fail
1542 * @retval PMINFO_R_OK success
1543 * @retval PMINFO_R_EINVAL invalid argument
1544 * @retval PMINFO_R_ERROR internal error
1545 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1546 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1547 * @see pkgmgrinfo_pkginfo_get_pkgid()
1548 * @see pkgmgrinfo_pkginfo_is_readonly()
1550 static int get_pkg_accessible(const char *pkgid)
1554 pkgmgrinfo_pkginfo_h handle;
1555 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1556 if (ret != PMINFO_R_OK)
1558 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1559 if (ret != PMINFO_R_OK) {
1560 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1563 printf("pkg accessible: %d\n", accessible);
1564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1569 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1572 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1573 * @brief This API destroys the package information handle freeing up all the resources
1575 * @par This API is for package-manager client application
1576 * @par Sync (or) Async : Synchronous API
1578 * @param[in] handle pointer to the package info handle
1579 * @return 0 if success, error code(<0) if fail
1580 * @retval PMINFO_R_OK success
1581 * @retval PMINFO_R_EINVAL invalid argument
1582 * @retval PMINFO_R_ERROR internal error
1583 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1585 * @see pkgmgrinfo_pkginfo_get_pkgid()
1586 * @see pkgmgrinfo_pkginfo_is_removable()
1588 static int get_pkg_type(const char *pkgid)
1592 pkgmgrinfo_pkginfo_h handle;
1593 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1594 if (ret != PMINFO_R_OK)
1596 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1597 if (ret != PMINFO_R_OK) {
1598 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1601 printf("pkgtype: %s\n", type);
1602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1607 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1610 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1611 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1612 The query will search the entire package information collected from the manifest file of all the installed packages
1614 * @par This API is for package-manager client application
1615 * @par Sync (or) Async : Synchronous API
1617 * @param[out] handle pointer to the package info filter handle.
1618 * @return 0 if success, error code(<0) if fail
1619 * @retval PMINFO_R_OK success
1620 * @retval PMINFO_R_EINVAL invalid argument
1621 * @retval PMINFO_R_ERROR internal error
1623 * @post pkgmgrinfo_pkginfo_filter_destroy()
1624 * @see pkgmgrinfo_pkginfo_filter_count()
1625 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1627 static int get_rpm_pkg_count()
1631 pkgmgrinfo_pkginfo_filter_h handle;
1632 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1633 if (ret != PMINFO_R_OK)
1635 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1636 if (ret != PMINFO_R_OK) {
1637 pkgmgrinfo_pkginfo_filter_destroy(handle);
1640 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1641 if (ret != PMINFO_R_OK) {
1642 pkgmgrinfo_pkginfo_filter_destroy(handle);
1645 printf("No of rpm pkgs: %d\n", count);
1646 pkgmgrinfo_pkginfo_filter_destroy(handle);
1651 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1654 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1655 * @brief This API destroys the package information filter handle freeing up all the resources
1657 * @par This API is for package-manager client application
1658 * @par Sync (or) Async : Synchronous API
1660 * @param[in] handle pointer to the package info filter handle.
1661 * @return 0 if success, error code(<0) if fail
1662 * @retval PMINFO_R_OK success
1663 * @retval PMINFO_R_EINVAL invalid argument
1664 * @retval PMINFO_R_ERROR internal error
1665 * @pre pkgmgrinfo_pkginfo_filter_create()
1667 * @see pkgmgrinfo_pkginfo_filter_count()
1668 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1670 static int get_rpm_pkg_count()
1674 pkgmgrinfo_pkginfo_filter_h handle;
1675 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1676 if (ret != PMINFO_R_OK)
1678 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1679 if (ret != PMINFO_R_OK) {
1680 pkgmgrinfo_pkginfo_filter_destroy(handle);
1683 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1684 if (ret != PMINFO_R_OK) {
1685 pkgmgrinfo_pkginfo_filter_destroy(handle);
1688 printf("No of rpm pkgs: %d\n", count);
1689 pkgmgrinfo_pkginfo_filter_destroy(handle);
1694 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1697 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1698 * @brief This API adds a boolean filter property to the filter handle
1700 * @par This API is for package-manager client application
1701 * @par Sync (or) Async : Synchronous API
1703 * @param[in] handle pointer to the package info filter handle.
1704 * @param[in] property boolean property name.
1705 * @param[in] value value corresponding to the property.
1706 * @return 0 if success, error code(<0) if fail
1707 * @retval PMINFO_R_OK success
1708 * @retval PMINFO_R_EINVAL invalid argument
1709 * @retval PMINFO_R_ERROR internal error
1710 * @pre pkgmgrinfo_pkginfo_filter_create()
1711 * @post pkgmgrinfo_pkginfo_filter_destroy()
1712 * @see pkgmgrinfo_pkginfo_filter_count()
1713 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1715 static int get_preload_pkg_count()
1719 pkgmgrinfo_pkginfo_filter_h handle;
1720 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1721 if (ret != PMINFO_R_OK)
1723 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1724 if (ret != PMINFO_R_OK) {
1725 pkgmgrinfo_pkginfo_filter_destroy(handle);
1728 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1729 if (ret != PMINFO_R_OK) {
1730 pkgmgrinfo_pkginfo_filter_destroy(handle);
1733 printf("No of preload pkgs: %d\n", count);
1734 pkgmgrinfo_pkginfo_filter_destroy(handle);
1739 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1740 const char *property, const bool value);
1743 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1744 * @brief This API adds an integer filter property to the filter handle
1746 * @par This API is for package-manager client application
1747 * @par Sync (or) Async : Synchronous API
1749 * @param[in] handle pointer to the package info filter handle.
1750 * @param[in] property integer property name.
1751 * @param[in] value value corresponding to the property.
1752 * @return 0 if success, error code(<0) if fail
1753 * @retval PMINFO_R_OK success
1754 * @retval PMINFO_R_EINVAL invalid argument
1755 * @retval PMINFO_R_ERROR internal error
1756 * @pre pkgmgrinfo_pkginfo_filter_create()
1757 * @post pkgmgrinfo_pkginfo_filter_destroy()
1758 * @see pkgmgrinfo_pkginfo_filter_count()
1759 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1761 static int get_pkg_count()
1765 pkgmgrinfo_pkginfo_filter_h handle;
1766 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1767 if (ret != PMINFO_R_OK)
1769 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1770 if (ret != PMINFO_R_OK) {
1771 pkgmgrinfo_pkginfo_filter_destroy(handle);
1774 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1775 if (ret != PMINFO_R_OK) {
1776 pkgmgrinfo_pkginfo_filter_destroy(handle);
1779 printf("No of preload pkgs: %d\n", count);
1780 pkgmgrinfo_pkginfo_filter_destroy(handle);
1785 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1786 const char *property, const int value);
1789 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1790 * @brief This API adds a string filter property to the filter handle
1792 * @par This API is for package-manager client application
1793 * @par Sync (or) Async : Synchronous API
1795 * @param[in] handle pointer to the package info filter handle.
1796 * @param[in] property string property name.
1797 * @param[in] value value corresponding to the property.
1798 * @return 0 if success, error code(<0) if fail
1799 * @retval PMINFO_R_OK success
1800 * @retval PMINFO_R_EINVAL invalid argument
1801 * @retval PMINFO_R_ERROR internal error
1802 * @pre pkgmgrinfo_pkginfo_filter_create()
1803 * @post pkgmgrinfo_pkginfo_filter_destroy()
1804 * @see pkgmgrinfo_pkginfo_filter_count()
1805 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1807 static int get_rpm_pkg_count()
1811 pkgmgrinfo_pkginfo_filter_h handle;
1812 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1813 if (ret != PMINFO_R_OK)
1815 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1816 if (ret != PMINFO_R_OK) {
1817 pkgmgrinfo_pkginfo_filter_destroy(handle);
1820 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1821 if (ret != PMINFO_R_OK) {
1822 pkgmgrinfo_pkginfo_filter_destroy(handle);
1825 printf("No of rpm pkgs: %d\n", count);
1826 pkgmgrinfo_pkginfo_filter_destroy(handle);
1831 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1832 const char *property, const char *value);
1835 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1836 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1838 * @par This API is for package-manager client application
1839 * @par Sync (or) Async : Synchronous API
1841 * @param[in] handle pointer to the package info filter handle.
1842 * @param[in] pkg_cb callback function.
1843 * @param[in] user_data user data to be passed to the callback function
1844 * @return 0 if success, error code(<0) if fail
1845 * @retval PMINFO_R_OK success
1846 * @retval PMINFO_R_EINVAL invalid argument
1847 * @retval PMINFO_R_ERROR internal error
1848 * @pre pkgmgrinfo_pkginfo_filter_create()
1849 * @post pkgmgrinfo_pkginfo_filter_destroy()
1850 * @see pkgmgrinfo_pkginfo_filter_count()
1852 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1855 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1856 printf("pkg id : %s\n", pkgid);
1860 static int get_rpm_pkg_list()
1863 pkgmgrinfo_pkginfo_filter_h handle;
1864 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1865 if (ret != PMINFO_R_OK)
1867 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1868 if (ret != PMINFO_R_OK) {
1869 pkgmgrinfo_pkginfo_filter_destroy(handle);
1872 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1873 if (ret != PMINFO_R_OK) {
1874 pkgmgrinfo_pkginfo_filter_destroy(handle);
1877 pkgmgrinfo_pkginfo_filter_destroy(handle);
1882 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1883 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1886 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1887 * @brief This API counts the package that satisfy the filter conditions
1889 * @par This API is for package-manager client application
1890 * @par Sync (or) Async : Synchronous API
1892 * @param[in] handle pointer to the package info filter handle.
1893 * @param[in] count pointer to store the count value.
1894 * @return 0 if success, error code(<0) if fail
1895 * @retval PMINFO_R_OK success
1896 * @retval PMINFO_R_EINVAL invalid argument
1897 * @retval PMINFO_R_ERROR internal error
1898 * @pre pkgmgrinfo_pkginfo_filter_create()
1899 * @post pkgmgrinfo_pkginfo_filter_destroy()
1900 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1902 static int get_rpm_pkg_count()
1906 pkgmgrinfo_pkginfo_filter_h handle;
1907 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1908 if (ret != PMINFO_R_OK)
1910 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1911 if (ret != PMINFO_R_OK) {
1912 pkgmgrinfo_pkginfo_filter_destroy(handle);
1915 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1916 if (ret != PMINFO_R_OK) {
1917 pkgmgrinfo_pkginfo_filter_destroy(handle);
1920 printf("No of rpm pkgs: %d\n", count);
1921 pkgmgrinfo_pkginfo_filter_destroy(handle);
1926 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1929 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1930 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1931 * @brief This API gets the list of privilege for a particular package
1933 * @par This API is for package-manager client application
1934 * @par Sync (or) Async : Synchronous API
1935 * @param[in] handle pointer to the package info handle.
1936 * @param[in] privilege_func callback function for list
1937 * @param[in] user_data user data to be passed to callback function
1938 * @return 0 if success, error code(<0) if fail
1939 * @retval PMINFO_R_OK success
1940 * @retval PMINFO_R_EINVAL invalid argument
1941 * @retval PMINFO_R_ERROR internal error
1942 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1943 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1945 int privilege_func(const char *name, void *user_data)
1947 if (strcmp(name, (char *)user_data) == 0)
1953 static int list_privilege(const char *package, char *privilege)
1956 pkgmgrinfo_pkginfo_h handle;
1957 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1958 if (ret != PMINFO_R_OK)
1960 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1961 if (ret != PMINFO_R_OK) {
1962 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1965 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1970 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1971 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1974 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1975 pkgmgrinfo_app_list_cb app_func, void *user_data)
1976 * @brief This API gets list of installed applications for a particular package
1978 * @par This API is for package-manager client application
1979 * @par Sync (or) Async : Synchronous API
1980 * @param[in] handle package info handle
1981 * @param[in] component application component
1982 * @param[in] app_func iteration function for list
1983 * @param[in] user_data user data to be passed to callback function
1984 * @return 0 if success, error code(<0) if fail
1985 * @retval PMINFO_R_OK success
1986 * @retval PMINFO_R_EINVAL invalid argument
1987 * @retval PMINFO_R_ERROR internal error
1988 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1989 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1991 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1994 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1995 printf("appid : %s\n", appid);
1999 static int list_apps(const char *pkgid)
2002 pkgmgrinfo_pkginfo_h handle;
2003 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2004 if (ret != PMINFO_R_OK)
2006 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2007 if (ret != PMINFO_R_OK) {
2008 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2016 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2017 pkgmgrinfo_app_list_cb app_func, void *user_data);
2020 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2021 * @brief This API gets list of installed applications from all packages.
2023 * @par This API is for package-manager client application
2024 * @par Sync (or) Async : Synchronous API
2025 * @param[in] app_func iteration function for list
2026 * @param[in] user_data user data to be passed to callback function
2027 * @return 0 if success, error code(<0) if fail
2028 * @retval PMINFO_R_OK success
2029 * @retval PMINFO_R_EINVAL invalid argument
2030 * @retval PMINFO_R_ERROR internal error
2034 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2036 char *pkgid1 = NULL;
2037 char *pkgid2 = NULL;
2038 pkgid1 = (char *)user_data;
2039 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2040 if (strcmp(pkgid1, pkgid2) == 0) {
2047 static int list_apps()
2050 char *name = "helloworld";
2051 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2052 if (ret != PMINFO_R_OK) {
2059 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2062 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2063 * @brief This API creates the application information handle from db
2065 * @par This API is for package-manager client application
2066 * @par Sync (or) Async : Synchronous API
2068 * @param[in] appid pointer to appid
2069 * @param[out] handle pointer to the application info handle.
2070 * @return 0 if success, error code(<0) if fail
2071 * @retval PMINFO_R_OK success
2072 * @retval PMINFO_R_EINVAL invalid argument
2073 * @retval PMINFO_R_ERROR internal error
2075 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2076 * @see pkgmgrinfo_appinfo_get_pkgid()
2077 * @see pkgmgrinfo_appinfo_is_multiple()
2079 static int get_app_type(const char *appid)
2083 pkgmgrinfo_appinfo_h handle;
2084 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2085 if (ret != PMINFO_R_OK)
2087 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2088 if (ret != PMINFO_R_OK) {
2089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2092 printf("apptype: %s\n", type);
2093 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2098 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2101 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2102 * @brief This API gets the application ID
2104 * @par This API is for package-manager client application
2105 * @par Sync (or) Async : Synchronous API
2107 * @param[in] handle pointer to the application info handle.
2108 * @param[out] appid pointer to hold appid
2109 * @return 0 if success, error code(<0) if fail
2110 * @retval PMINFO_R_OK success
2111 * @retval PMINFO_R_EINVAL invalid argument
2112 * @retval PMINFO_R_ERROR internal error
2113 * @pre pkgmgrinfo_appinfo_get_appinfo()
2114 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2115 * @see pkgmgrinfo_appinfo_get_pkgid()
2116 * @see pkgmgrinfo_appinfo_is_multiple()
2118 static int get_app_id(const char *appid)
2121 char *app_id = NULL;
2122 pkgmgrinfo_appinfo_h handle;
2123 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2124 if (ret != PMINFO_R_OK)
2126 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2127 if (ret != PMINFO_R_OK) {
2128 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2131 printf("app id: %s\n", app_id);
2132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2137 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2140 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2141 * @brief This API gets the package name of the application
2143 * @par This API is for package-manager client application
2144 * @par Sync (or) Async : Synchronous API
2146 * @param[in] handle pointer to the application info handle.
2147 * @param[out] pkg_name pointer to hold package name
2148 * @return 0 if success, error code(<0) if fail
2149 * @retval PMINFO_R_OK success
2150 * @retval PMINFO_R_EINVAL invalid argument
2151 * @retval PMINFO_R_ERROR internal error
2152 * @pre pkgmgrinfo_appinfo_get_appinfo()
2153 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2154 * @see pkgmgrinfo_appinfo_get_appid()
2155 * @see pkgmgrinfo_appinfo_is_multiple()
2157 static int get_app_pkgname(const char *appid)
2160 char *pkgname = NULL;
2161 pkgmgrinfo_appinfo_h handle;
2162 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2163 if (ret != PMINFO_R_OK)
2165 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2166 if (ret != PMINFO_R_OK) {
2167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2170 printf("pkg name: %s\n", pkgname);
2171 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2176 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2179 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2180 * @brief This API gets the package id of the application
2182 * @par This API is for package-manager client application
2183 * @par Sync (or) Async : Synchronous API
2185 * @param[in] handle pointer to the application info handle.
2186 * @param[out] pkgid pointer to hold package id
2187 * @return 0 if success, error code(<0) if fail
2188 * @retval PMINFO_R_OK success
2189 * @retval PMINFO_R_EINVAL invalid argument
2190 * @retval PMINFO_R_ERROR internal error
2191 * @pre pkgmgrinfo_appinfo_get_appinfo()
2192 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2193 * @see pkgmgrinfo_appinfo_get_appid()
2194 * @see pkgmgrinfo_appinfo_is_multiple()
2196 static int get_app_pkgid(const char *appid)
2200 pkgmgrinfo_appinfo_h handle;
2201 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2202 if (ret != PMINFO_R_OK)
2204 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2205 if (ret != PMINFO_R_OK) {
2206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2209 printf("pkg id: %s\n", pkgid);
2210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2215 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2218 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2219 * @brief This API gets the executable name of the application
2221 * @par This API is for package-manager client application
2222 * @par Sync (or) Async : Synchronous API
2224 * @param[in] handle pointer to the application info handle.
2225 * @param[out] exec pointer to hold app exec name
2226 * @return 0 if success, error code(<0) if fail
2227 * @retval PMINFO_R_OK success
2228 * @retval PMINFO_R_EINVAL invalid argument
2229 * @retval PMINFO_R_ERROR internal error
2230 * @pre pkgmgrinfo_appinfo_get_appinfo()
2231 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2232 * @see pkgmgrinfo_appinfo_get_appid()
2233 * @see pkgmgrinfo_appinfo_is_multiple()
2235 static int get_app_exec(const char *appid)
2239 pkgmgrinfo_appinfo_h handle;
2240 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2241 if (ret != PMINFO_R_OK)
2243 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2244 if (ret != PMINFO_R_OK) {
2245 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2248 printf("exec name: %s\n", exec);
2249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2254 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2257 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2258 * @brief This API gets the icon name of the application
2260 * @par This API is for package-manager client application
2261 * @par Sync (or) Async : Synchronous API
2263 * @param[in] handle pointer to the application info handle.
2264 * @param[out] icon pointer to hold app icon name
2265 * @return 0 if success, error code(<0) if fail
2266 * @retval PMINFO_R_OK success
2267 * @retval PMINFO_R_EINVAL invalid argument
2268 * @retval PMINFO_R_ERROR internal error
2269 * @pre pkgmgrinfo_appinfo_get_appinfo()
2270 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2271 * @see pkgmgrinfo_appinfo_get_appid()
2272 * @see pkgmgrinfo_appinfo_is_multiple()
2274 static int get_app_icon(const char *appid)
2278 pkgmgrinfo_appinfo_h handle;
2279 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2280 if (ret != PMINFO_R_OK)
2282 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2283 if (ret != PMINFO_R_OK) {
2284 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2287 printf("icon name: %s\n", icon);
2288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2293 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2296 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2297 * @brief This API gets the label of the application
2299 * @par This API is for package-manager client application
2300 * @par Sync (or) Async : Synchronous API
2302 * @param[in] handle pointer to the application info handle.
2303 * @param[out] label pointer to hold app label
2304 * @return 0 if success, error code(<0) if fail
2305 * @retval PMINFO_R_OK success
2306 * @retval PMINFO_R_EINVAL invalid argument
2307 * @retval PMINFO_R_ERROR internal error
2308 * @pre pkgmgrinfo_appinfo_get_appinfo()
2309 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2310 * @see pkgmgrinfo_appinfo_get_appid()
2311 * @see pkgmgrinfo_appinfo_is_multiple()
2313 static int get_app_label(const char *appid)
2317 pkgmgrinfo_appinfo_h handle;
2318 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2319 if (ret != PMINFO_R_OK)
2321 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2322 if (ret != PMINFO_R_OK) {
2323 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2326 printf("label : %s\n", label);
2327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2332 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2335 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2336 * @brief This API gets the component of the application
2338 * @par This API is for package-manager client application
2339 * @par Sync (or) Async : Synchronous API
2341 * @param[in] handle pointer to the application info handle.
2342 * @param[out] component pointer to hold app component
2343 * @return 0 if success, error code(<0) if fail
2344 * @retval PMINFO_R_OK success
2345 * @retval PMINFO_R_EINVAL invalid argument
2346 * @retval PMINFO_R_ERROR internal error
2347 * @pre pkgmgrinfo_appinfo_get_appinfo()
2348 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2349 * @see pkgmgrinfo_appinfo_get_appid()
2350 * @see pkgmgrinfo_appinfo_is_multiple()
2352 static int get_app_component(const char *appid)
2355 pkgmgrinfo_app_component component;
2356 pkgmgrinfo_appinfo_h handle;
2357 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2358 if (ret != PMINFO_R_OK)
2360 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2361 if (ret != PMINFO_R_OK) {
2362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2365 printf("component : %s\n", component);
2366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2371 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2374 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2375 * @brief This API gets the apptype of the application
2377 * @par This API is for package-manager client application
2378 * @par Sync (or) Async : Synchronous API
2380 * @param[in] handle pointer to the application info handle.
2381 * @param[out] app_type pointer to hold apptype
2382 * @return 0 if success, error code(<0) if fail
2383 * @retval PMINFO_R_OK success
2384 * @retval PMINFO_R_EINVAL invalid argument
2385 * @retval PMINFO_R_ERROR internal error
2386 * @pre pkgmgrinfo_appinfo_get_appinfo()
2387 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2388 * @see pkgmgrinfo_appinfo_get_appid()
2389 * @see pkgmgrinfo_appinfo_is_multiple()
2391 static int get_app_type(const char *appid)
2394 char *apptype = NULL;
2395 pkgmgrinfo_appinfo_h handle;
2396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2397 if (ret != PMINFO_R_OK)
2399 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2400 if (ret != PMINFO_R_OK) {
2401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2404 printf("apptype : %s\n", apptype);
2405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2410 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2413 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2414 int *operation_count, char ***operation)
2415 * @brief This API gets the list of operation of the application
2417 * @par This API is for package-manager client application
2418 * @par Sync (or) Async : Synchronous API
2420 * @param[in] handle pointer to the appcontrol handle.
2421 * @param[out] operation_count pointer to hold number of operations
2422 * @param[out] operation pointer to hold list of operations
2423 * @return 0 if success, error code(<0) if fail
2424 * @retval PMINFO_R_OK success
2425 * @retval PMINFO_R_EINVAL invalid argument
2426 * @retval PMINFO_R_ERROR internal error
2427 * @pre pkgmgrinfo_appinfo_get_appinfo()
2428 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2429 * @see pkgmgrinfo_appinfo_get_uri()
2430 * @see pkgmgrinfo_appinfo_get_mime()
2432 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2437 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2438 for (i = 0; i < oc; i++) {
2439 if (strcmp(operation[i], (char *)user_data) == 0)
2446 static int check_operation(const char *appid, char *operation)
2449 pkgmgrinfo_appinfo_h handle;
2450 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2451 if (ret != PMINFO_R_OK)
2453 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2454 if (ret != PMINFO_R_OK) {
2455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2458 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2463 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2464 int *operation_count, char ***operation);
2467 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2468 int *uri_count, char ***uri)
2469 * @brief This API gets the list of uri of the application
2471 * @par This API is for package-manager client application
2472 * @par Sync (or) Async : Synchronous API
2474 * @param[in] handle pointer to the appcontrol handle.
2475 * @param[out] uri_count pointer to hold number of uris
2476 * @param[out] uri pointer to hold list of uris
2477 * @return 0 if success, error code(<0) if fail
2478 * @retval PMINFO_R_OK success
2479 * @retval PMINFO_R_EINVAL invalid argument
2480 * @retval PMINFO_R_ERROR internal error
2481 * @pre pkgmgrinfo_appinfo_get_appinfo()
2482 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2483 * @see pkgmgrinfo_appinfo_get_operation()
2484 * @see pkgmgrinfo_appinfo_get_mime()
2486 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2491 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2492 for (i = 0; i < uc; i++) {
2493 if (strcmp(uri[i], (char *)user_data) == 0)
2500 static int check_uri(const char *appid, char *uri)
2503 pkgmgrinfo_appinfo_h handle;
2504 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2505 if (ret != PMINFO_R_OK)
2507 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2508 if (ret != PMINFO_R_OK) {
2509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2517 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2518 int *uri_count, char ***uri);
2521 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2522 int *mime_count, char ***mime)
2523 * @brief This API gets the list of mime of the application
2525 * @par This API is for package-manager client application
2526 * @par Sync (or) Async : Synchronous API
2528 * @param[in] handle pointer to the appcontrol handle.
2529 * @param[out] mime_count pointer to hold number of mimes
2530 * @param[out] mime pointer to hold list of mimes
2531 * @return 0 if success, error code(<0) if fail
2532 * @retval PMINFO_R_OK success
2533 * @retval PMINFO_R_EINVAL invalid argument
2534 * @retval PMINFO_R_ERROR internal error
2535 * @pre pkgmgrinfo_appinfo_get_appinfo()
2536 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2537 * @see pkgmgrinfo_appinfo_get_uri()
2538 * @see pkgmgrinfo_appinfo_get_operation()
2540 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2545 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2546 for (i = 0; i < mc; i++) {
2547 if (strcmp(mime[i], (char *)user_data) == 0)
2554 static int check_mime(const char *appid, char *mime)
2557 pkgmgrinfo_appinfo_h handle;
2558 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2559 if (ret != PMINFO_R_OK)
2561 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2562 if (ret != PMINFO_R_OK) {
2563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2566 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2571 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2572 int *mime_count, char ***mime);
2575 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2576 * @brief This API gets the notification icon of the application
2578 * @par This API is for package-manager client application
2579 * @par Sync (or) Async : Synchronous API
2581 * @param[in] handle pointer to the application info handle.
2582 * @param[out] path pointer to hold notification icon
2583 * @return 0 if success, error code(<0) if fail
2584 * @retval PMINFO_R_OK success
2585 * @retval PMINFO_R_EINVAL invalid argument
2586 * @retval PMINFO_R_ERROR internal error
2587 * @pre pkgmgrinfo_appinfo_get_appinfo()
2588 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2589 * @see pkgmgrinfo_appinfo_get_appid()
2590 * @see pkgmgrinfo_appinfo_is_multiple()
2592 static int get_app_notification_icon(const char *appid)
2595 char *notification_icon = NULL;
2596 pkgmgrinfo_appinfo_h handle;
2597 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2598 if (ret != PMINFO_R_OK)
2600 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2601 if (ret != PMINFO_R_OK) {
2602 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605 printf("notification icon : %s\n", notification_icon);
2606 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2611 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2614 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2615 * @brief This API gets the setting icon of the application
2617 * @par This API is for package-manager client application
2618 * @par Sync (or) Async : Synchronous API
2620 * @param[in] handle pointer to the application info handle.
2621 * @param[out] path pointer to hold setting icon
2622 * @return 0 if success, error code(<0) if fail
2623 * @retval PMINFO_R_OK success
2624 * @retval PMINFO_R_EINVAL invalid argument
2625 * @retval PMINFO_R_ERROR internal error
2626 * @pre pkgmgrinfo_appinfo_get_appinfo()
2627 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2628 * @see pkgmgrinfo_appinfo_get_appid()
2629 * @see pkgmgrinfo_appinfo_is_multiple()
2631 static int get_app_setting_icon(const char *appid)
2634 char *setting_icon = NULL;
2635 pkgmgrinfo_appinfo_h handle;
2636 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2637 if (ret != PMINFO_R_OK)
2639 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2640 if (ret != PMINFO_R_OK) {
2641 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2644 printf("setting icon : %s\n", setting_icon);
2645 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2650 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2653 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2654 * @brief This API gets the type of recent image on app-tray
2656 * @par This API is for package-manager client application
2657 * @par Sync (or) Async : Synchronous API
2659 * @param[in] handle pointer to the application info handle.
2660 * @param[out] type pointer to hold image type
2661 * @return 0 if success, error code(<0) if fail
2662 * @retval PMINFO_R_OK success
2663 * @retval PMINFO_R_EINVAL invalid argument
2664 * @retval PMINFO_R_ERROR internal error
2665 * @pre pkgmgrinfo_appinfo_get_appinfo()
2666 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2667 * @see pkgmgrinfo_appinfo_get_appid()
2668 * @see pkgmgrinfo_appinfo_is_multiple()
2670 static int get_app_recent_image_type(const char *appid)
2673 pkgmgrinfo_app_recentimage type;
2674 pkgmgrinfo_appinfo_h handle;
2675 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2676 if (ret != PMINFO_R_OK)
2678 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2679 if (ret != PMINFO_R_OK) {
2680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2683 printf("recent image type: %d\n", type);
2684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2689 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2693 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2694 * @brief This API gets the preview image of application
2696 * @par Sync (or) Async : Synchronous API
2698 * @param[in] handle pointer to the application info handle.
2699 * @param[out] preview_img pointer to hold preview image path
2700 * @return 0 if success, error code(<0) if fail
2701 * @retval PMINFO_R_OK success
2702 * @retval PMINFO_R_EINVAL invalid argument
2703 * @retval PMINFO_R_ERROR internal error
2704 * @pre pkgmgrinfo_appinfo_get_appinfo()
2705 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2706 * @see pkgmgrinfo_appinfo_get_appid()
2708 static int get_app_previewimage(const char *appid)
2711 char *preview = NULL;
2712 pkgmgrinfo_appinfo_h handle = NULL;
2713 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2714 if (ret != PMINFO_R_OK)
2716 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2717 if (ret != PMINFO_R_OK) {
2718 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2721 printf("preview image path : %s\n", preview);
2722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2727 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2731 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2732 * @brief This API gets the package permission type of the application
2734 * @par This API is for package-manager client application
2735 * @par Sync (or) Async : Synchronous API
2737 * @param[in] handle pointer to the application info handle.
2738 * @param[out] permission pointer to hold package permission
2739 * @return 0 if success, error code(<0) if fail
2740 * @retval PMINFO_R_OK success
2741 * @retval PMINFO_R_EINVAL invalid argument
2742 * @retval PMINFO_R_ERROR internal error
2743 * @pre pkgmgrinfo_appinfo_get_appinfo()
2744 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2745 * @see pkgmgrinfo_appinfo_get_appid()
2747 static int get_app_permission(const char *appid)
2750 pkgmgrinfo_permission_type permission = 0;
2751 pkgmgrinfo_appinfo_h handle;
2753 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2754 if (ret != PMINFO_R_OK)
2756 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2757 if (ret != PMINFO_R_OK) {
2758 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2761 printf("permission type: %d\n", permission);
2762 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2767 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2770 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2771 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2772 * @brief This API gets the list of category for a particular application
2774 * @par This API is for package-manager client application
2775 * @par Sync (or) Async : Synchronous API
2776 * @param[in] handle pointer to the application info handle.
2777 * @param[in] category_func callback function for list
2778 * @param[in] user_data user data to be passed to callback function
2779 * @return 0 if success, error code(<0) if fail
2780 * @retval PMINFO_R_OK success
2781 * @retval PMINFO_R_EINVAL invalid argument
2782 * @retval PMINFO_R_ERROR internal error
2783 * @pre pkgmgrinfo_appinfo_get_appinfo()
2784 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2786 int category_func(const char *name, void *user_data)
2788 if (strcmp(name, (char *)user_data) == 0)
2794 static int list_category(const char *appid, char *category)
2797 pkgmgrinfo_appinfo_h handle;
2798 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2799 if (ret != PMINFO_R_OK)
2801 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2802 if (ret != PMINFO_R_OK) {
2803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2811 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2812 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2815 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2816 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2817 * @brief This API gets the list of metadata for a particular application
2819 * @par This API is for package-manager client application
2820 * @par Sync (or) Async : Synchronous API
2821 * @param[in] handle pointer to the application info handle.
2822 * @param[in] metadata_func callback function for list
2823 * @param[in] user_data user data to be passed to callback function
2824 * @return 0 if success, error code(<0) if fail
2825 * @retval PMINFO_R_OK success
2826 * @retval PMINFO_R_EINVAL invalid argument
2827 * @retval PMINFO_R_ERROR internal error
2828 * @pre pkgmgrinfo_appinfo_get_appinfo()
2829 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2831 int metadata_func(const char *key, const char *value, void *user_data)
2833 if (strcmp(key, (char *)user_data) == 0) {
2834 printf("Value is %s\n", value);
2841 static int list_metadata(const char *appid, char *key)
2844 pkgmgrinfo_appinfo_h handle;
2845 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2846 if (ret != PMINFO_R_OK)
2848 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
2849 if (ret != PMINFO_R_OK) {
2850 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2853 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2858 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2859 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2863 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2864 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2865 * @brief This API gets the list of app-control for a particular application
2867 * @par This API is for package-manager client application
2868 * @par Sync (or) Async : Synchronous API
2869 * @param[in] handle pointer to the application info handle.
2870 * @param[in] appcontrol_func callback function for list
2871 * @param[in] user_data user data to be passed to callback function
2872 * @return 0 if success, error code(<0) if fail
2873 * @retval PMINFO_R_OK success
2874 * @retval PMINFO_R_EINVAL invalid argument
2875 * @retval PMINFO_R_ERROR internal error
2876 * @pre pkgmgrinfo_appinfo_get_appinfo()
2877 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2879 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2884 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2885 for (i = 0; i < oc; i++) {
2886 if (strcmp(operation[i], (char *)user_data) == 0)
2893 static int check_operation(const char *appid, char *operation)
2896 pkgmgrinfo_appinfo_h handle;
2897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2898 if (ret != PMINFO_R_OK)
2900 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2901 if (ret != PMINFO_R_OK) {
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2911 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2914 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2915 * @brief This API gets the application 'nodisplay' value from the app ID
2917 * @par This API is for package-manager client application
2918 * @par Sync (or) Async : Synchronous API
2920 * @param[in] handle pointer to application info handle
2921 * @param[out] nodisplay pointer to hold package nodisplay value
2922 * @return 0 if success, error code(<0) if fail
2923 * @retval PMINFO_R_OK success
2924 * @retval PMINFO_R_EINVAL invalid argument
2925 * @retval PMINFO_R_ERROR internal error
2926 * @pre pkgmgrinfo_appinfo_get_appinfo()
2927 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2928 * @see pkgmgrinfo_appinfo_get_appid()
2929 * @see pkgmgrinfo_appinfo_is_multiple()
2931 static int get_app_nodisplay(const char *appid)
2935 pkgmgrinfo_appinfo_h handle;
2936 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2937 if (ret != PMINFO_R_OK)
2939 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2940 if (ret != PMINFO_R_OK) {
2941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2944 printf("app nodisplay: %d\n", nodisplay);
2945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2950 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2953 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2954 * @brief This API gets the application 'multiple' value from the app ID
2956 * @par This API is for package-manager client application
2957 * @par Sync (or) Async : Synchronous API
2959 * @param[in] handle pointer to application info handle
2960 * @param[out] multiple pointer to hold package multiple value
2961 * @return 0 if success, error code(<0) if fail
2962 * @retval PMINFO_R_OK success
2963 * @retval PMINFO_R_EINVAL invalid argument
2964 * @retval PMINFO_R_ERROR internal error
2965 * @pre pkgmgrinfo_appinfo_get_appinfo()
2966 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2967 * @see pkgmgrinfo_appinfo_get_appid()
2968 * @see pkgmgrinfo_appinfo_is_nodisplay()
2970 static int get_app_multiple(const char *appid)
2974 pkgmgrinfo_appinfo_h handle;
2975 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2976 if (ret != PMINFO_R_OK)
2978 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2979 if (ret != PMINFO_R_OK) {
2980 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2983 printf("app multiple: %d\n", multiple);
2984 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2989 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2992 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
2993 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
2994 * application launching effect. If fales, indicator will be hidden during application launching effect
2996 * @par This API is for package-manager client application
2997 * @par Sync (or) Async : Synchronous API
2999 * @param[in] handle pointer to application info handle
3000 * @param[out] indicator_disp contains indicator display status for application launching effect
3001 * @return 0 if success, error code(<0) if fail
3002 * @retval PMINFO_R_OK success
3003 * @retval PMINFO_R_EINVAL invalid argument
3004 * @retval PMINFO_R_ERROR internal error
3005 * @pre pkgmgrinfo_appinfo_get_appinfo()
3006 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3007 * @see pkgmgrinfo_appinfo_get_appid()
3008 * @see pkgmgrinfo_appinfo_is_nodisplay()
3010 static int get_app_indicator_display(const char *appid)
3013 bool indicator_disp;
3014 pkgmgrinfo_appinfo_h handle;
3015 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3016 if (ret != PMINFO_R_OK)
3018 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3019 if (ret != PMINFO_R_OK){
3020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3023 printf("app indicator disp : %d\n", indicator_disp);
3024 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3029 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3032 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3033 * @brief This API gets the application's landscape & portrait effect images
3035 * @par This API is for package-manager client application
3036 * @par Sync (or) Async : Synchronous API
3038 * @param[in] handle pointer to application info handle
3039 * @param[out] portrait_img contains portrait mode effect image
3040 * @param[out] landscape_img contains landscape mode effect image
3041 * @return 0 if success, error code(<0) if fail
3042 * @retval PMINFO_R_OK success
3043 * @retval PMINFO_R_EINVAL invalid argument
3044 * @retval PMINFO_R_ERROR internal error
3045 * @pre pkgmgrinfo_appinfo_get_appinfo()
3046 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3047 * @see pkgmgrinfo_appinfo_get_appid()
3048 * @see pkgmgrinfo_appinfo_is_nodisplay()
3050 static int get_app_effectimages(const char *appid)
3053 char *portraitimg = NULL;
3054 char *landscapeimg = NULL;
3055 pkgmgrinfo_appinfo_h handle;
3056 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3057 if (ret != PMINFO_R_OK)
3059 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3060 if (ret != PMINFO_R_OK) {
3061 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3064 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3073 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3074 * @brief This API gets the application 'taskmanage' value from the app ID
3076 * @par This API is for package-manager client application
3077 * @par Sync (or) Async : Synchronous API
3079 * @param[in] handle pointer to application info handle
3080 * @param[out] taskmanage pointer to hold package taskmanage value
3081 * @return 0 if success, error code(<0) if fail
3082 * @retval PMINFO_R_OK success
3083 * @retval PMINFO_R_EINVAL invalid argument
3084 * @retval PMINFO_R_ERROR internal error
3085 * @pre pkgmgrinfo_appinfo_get_appinfo()
3086 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3087 * @see pkgmgrinfo_appinfo_get_appid()
3088 * @see pkgmgrinfo_appinfo_is_multiple()
3090 static int get_app_taskmanage(const char *appid)
3094 pkgmgrinfo_appinfo_h handle;
3095 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3096 if (ret != PMINFO_R_OK)
3098 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3099 if (ret != PMINFO_R_OK) {
3100 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3103 printf("app taskmanage: %d\n", taskmanage);
3104 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3109 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3112 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3113 * @brief This API gets the application 'taskmanage' value from the app ID
3115 * @par This API is for package-manager client application
3116 * @par Sync (or) Async : Synchronous API
3118 * @param[in] handle pointer to application info handle
3119 * @param[out] enabled pointer to hold package enabled value
3120 * @return 0 if success, error code(<0) if fail
3121 * @retval PMINFO_R_OK success
3122 * @retval PMINFO_R_EINVAL invalid argument
3123 * @retval PMINFO_R_ERROR internal error
3124 * @pre pkgmgrinfo_appinfo_get_appinfo()
3125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3126 * @see pkgmgrinfo_appinfo_get_appid()
3127 * @see pkgmgrinfo_appinfo_is_multiple()
3129 static int get_app_enabled(const char *appid)
3133 pkgmgrinfo_appinfo_h handle;
3134 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3135 if (ret != PMINFO_R_OK)
3137 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3138 if (ret != PMINFO_R_OK) {
3139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3142 printf("app enabled: %d\n", enabled);
3143 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3148 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3151 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3152 * @brief This API gets the application 'hwacceleration' value from the app ID
3154 * @par This API is for package-manager client application
3155 * @par Sync (or) Async : Synchronous API
3157 * @param[in] handle pointer to application info handle
3158 * @param[out] hwacceleration pointer to hold package hwacceleration value
3159 * @return 0 if success, error code(<0) if fail
3160 * @retval PMINFO_R_OK success
3161 * @retval PMINFO_R_EINVAL invalid argument
3162 * @retval PMINFO_R_ERROR internal error
3163 * @pre pkgmgrinfo_appinfo_get_appinfo()
3164 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3165 * @see pkgmgrinfo_appinfo_get_appid()
3166 * @see pkgmgrinfo_appinfo_is_multiple()
3168 static int get_app_hwacceleration(const char *appid)
3171 pkgmgrinfo_app_hwacceleration hwacceleration;
3172 pkgmgrinfo_appinfo_h handle;
3173 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3174 if (ret != PMINFO_R_OK)
3176 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3177 if (ret != PMINFO_R_OK) {
3178 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3181 printf("app hwacceleration: %d\n", hwacceleration);
3182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3187 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3190 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3191 * @brief This API gets the application 'onboot' value from the app ID
3193 * @par This API is for package-manager client application
3194 * @par Sync (or) Async : Synchronous API
3196 * @param[in] handle pointer to application info handle
3197 * @param[out] onboot pointer to hold package onboot value
3198 * @return 0 if success, error code(<0) if fail
3199 * @retval PMINFO_R_OK success
3200 * @retval PMINFO_R_EINVAL invalid argument
3201 * @retval PMINFO_R_ERROR internal error
3202 * @pre pkgmgrinfo_appinfo_get_appinfo()
3203 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3204 * @see pkgmgrinfo_appinfo_get_appid()
3205 * @see pkgmgrinfo_appinfo_is_multiple()
3207 static int get_app_onboot(const char *appid)
3211 pkgmgrinfo_appinfo_h handle;
3212 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3213 if (ret != PMINFO_R_OK)
3215 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3216 if (ret != PMINFO_R_OK) {
3217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 printf("app onboot: %d\n", onboot);
3221 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3226 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3229 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3230 * @brief This API gets the application 'autorestart' value from the app ID
3232 * @par This API is for package-manager client application
3233 * @par Sync (or) Async : Synchronous API
3235 * @param[in] handle pointer to application info handle
3236 * @param[out] autorestart pointer to hold package autorestart value
3237 * @return 0 if success, error code(<0) if fail
3238 * @retval PMINFO_R_OK success
3239 * @retval PMINFO_R_EINVAL invalid argument
3240 * @retval PMINFO_R_ERROR internal error
3241 * @pre pkgmgrinfo_appinfo_get_appinfo()
3242 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3243 * @see pkgmgrinfo_appinfo_get_appid()
3244 * @see pkgmgrinfo_appinfo_is_multiple()
3246 static int get_app_autorestart(const char *appid)
3250 pkgmgrinfo_appinfo_h handle;
3251 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3252 if (ret != PMINFO_R_OK)
3254 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3255 if (ret != PMINFO_R_OK) {
3256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3259 printf("app autorestart: %d\n", autorestart);
3260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3265 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3268 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3269 * @brief This API gets the value for given application is main app or not from handle
3271 * @par This API is for package-manager client application
3272 * @par Sync (or) Async : Synchronous API
3274 * @param[in] handle pointer to application info handle
3275 * @param[out] mainapp pointer to hold package mainapp is or not
3276 * @return 0 if success, error code(<0) if fail
3277 * @retval PMINFO_R_OK success
3278 * @retval PMINFO_R_EINVAL invalid argument
3279 * @retval PMINFO_R_ERROR internal error
3280 * @pre pkgmgrinfo_appinfo_get_appinfo()
3281 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3282 * @see pkgmgrinfo_appinfo_get_appid()
3283 * @see pkgmgrinfo_appinfo_is_multiple()
3285 static int get_app_mainapp(const char *appid)
3289 pkgmgrinfo_appinfo_h handle;
3290 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3291 if (ret != PMINFO_R_OK)
3293 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3294 if (ret != PMINFO_R_OK) {
3295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3298 printf("mainapp: %d\n", mainapp);
3299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3304 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3307 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3308 * @brief This API destroys the application information handle freeing up all the resources
3310 * @par This API is for package-manager client application
3311 * @par Sync (or) Async : Synchronous API
3313 * @param[in] handle pointer to the application info handle.
3314 * @return 0 if success, error code(<0) if fail
3315 * @retval PMINFO_R_OK success
3316 * @retval PMINFO_R_EINVAL invalid argument
3317 * @retval PMINFO_R_ERROR internal error
3318 * @pre pkgmgrinfo_appinfo_get_appinfo()
3320 * @see pkgmgrinfo_appinfo_get_pkgid()
3321 * @see pkgmgrinfo_appinfo_is_multiple()
3323 static int get_app_type(const char *appid)
3327 pkgmgrinfo_appinfo_h handle;
3328 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3329 if (ret != PMINFO_R_OK)
3331 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3332 if (ret != PMINFO_R_OK) {
3333 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3336 printf("apptype: %s\n", type);
3337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3345 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3346 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3347 The query will search the entire application information collected from the manifest file of all the installed packages
3349 * @par This API is for package-manager client application
3350 * @par Sync (or) Async : Synchronous API
3352 * @param[out] handle pointer to the application info filter handle.
3353 * @return 0 if success, error code(<0) if fail
3354 * @retval PMINFO_R_OK success
3355 * @retval PMINFO_R_EINVAL invalid argument
3356 * @retval PMINFO_R_ERROR internal error
3358 * @post pkgmgrinfo_appinfo_filter_destroy()
3359 * @see pkgmgrinfo_appinfo_filter_count()
3360 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3362 static int get_capp_count()
3366 pkgmgrinfo_appinfo_filter_h handle;
3367 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3368 if (ret != PMINFO_R_OK)
3370 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3371 if (ret != PMINFO_R_OK) {
3372 pkgmgrinfo_appinfo_filter_destroy(handle);
3375 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3376 if (ret != PMINFO_R_OK) {
3377 pkgmgrinfo_appinfo_filter_destroy(handle);
3380 printf("No of capp: %d\n", count);
3381 pkgmgrinfo_appinfo_filter_destroy(handle);
3386 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3389 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3390 * @brief This API destroys the application information filter handle freeing up all the resources
3392 * @par This API is for package-manager client application
3393 * @par Sync (or) Async : Synchronous API
3395 * @param[in] handle pointer to the application info filter handle.
3396 * @return 0 if success, error code(<0) if fail
3397 * @retval PMINFO_R_OK success
3398 * @retval PMINFO_R_EINVAL invalid argument
3399 * @retval PMINFO_R_ERROR internal error
3400 * @pre pkgmgrinfo_appinfo_filter_create()
3402 * @see pkgmgrinfo_appinfo_filter_count()
3403 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3405 static int get_capp_count()
3409 pkgmgrinfo_appinfo_filter_h handle;
3410 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3411 if (ret != PMINFO_R_OK)
3413 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3414 if (ret != PMINFO_R_OK) {
3415 pkgmgrinfo_appinfo_filter_destroy(handle);
3418 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3419 if (ret != PMINFO_R_OK) {
3420 pkgmgrinfo_appinfo_filter_destroy(handle);
3423 printf("No of capp: %d\n", count);
3424 pkgmgrinfo_appinfo_filter_destroy(handle);
3429 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3432 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3433 * @brief This API adds a boolean filter property to the filter handle
3435 * @par This API is for package-manager client application
3436 * @par Sync (or) Async : Synchronous API
3438 * @param[in] handle pointer to the application info filter handle.
3439 * @param[in] property boolean property name.
3440 * @param[in] value value corresponding to the property.
3441 * @return 0 if success, error code(<0) if fail
3442 * @retval PMINFO_R_OK success
3443 * @retval PMINFO_R_EINVAL invalid argument
3444 * @retval PMINFO_R_ERROR internal error
3445 * @pre pkgmgrinfo_appinfo_filter_create()
3446 * @post pkgmgrinfo_appinfo_filter_destroy()
3447 * @see pkgmgrinfo_appinfo_filter_count()
3448 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3450 static int get_taskmanageable_app_count()
3454 pkgmgrinfo_appinfo_filter_h handle;
3455 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3456 if (ret != PMINFO_R_OK)
3458 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3459 if (ret != PMINFO_R_OK) {
3460 pkgmgrinfo_appinfo_filter_destroy(handle);
3463 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3464 if (ret != PMINFO_R_OK) {
3465 pkgmgrinfo_appinfo_filter_destroy(handle);
3468 printf("No of taskmanageable apps: %d\n", count);
3469 pkgmgrinfo_appinfo_filter_destroy(handle);
3474 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3475 const char *property, const bool value);
3478 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3479 * @brief This API adds an integer filter property to the filter handle
3481 * @par This API is for package-manager client application
3482 * @par Sync (or) Async : Synchronous API
3484 * @param[in] handle pointer to the application info filter handle.
3485 * @param[in] property integer property name.
3486 * @param[in] value value corresponding to the property.
3487 * @return 0 if success, error code(<0) if fail
3488 * @retval PMINFO_R_OK success
3489 * @retval PMINFO_R_EINVAL invalid argument
3490 * @retval PMINFO_R_ERROR internal error
3491 * @pre pkgmgrinfo_appinfo_filter_create()
3492 * @post pkgmgrinfo_appinfo_filter_destroy()
3493 * @see pkgmgrinfo_appinfo_filter_count()
3494 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3496 static int get_taskmanageable_app_count()
3500 pkgmgrinfo_appinfo_filter_h handle;
3501 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3502 if (ret != PMINFO_R_OK)
3504 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3505 if (ret != PMINFO_R_OK) {
3506 pkgmgrinfo_appinfo_filter_destroy(handle);
3509 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3510 if (ret != PMINFO_R_OK) {
3511 pkgmgrinfo_appinfo_filter_destroy(handle);
3514 printf("No of apps: %d\n", count);
3515 pkgmgrinfo_appinfo_filter_destroy(handle);
3520 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3521 const char *property, const int value);
3524 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3525 * @brief This API adds a string filter property to the filter handle
3527 * @par This API is for package-manager client application
3528 * @par Sync (or) Async : Synchronous API
3530 * @param[in] handle pointer to the application info filter handle.
3531 * @param[in] property string property name.
3532 * @param[in] value value corresponding to the property.
3533 * @return 0 if success, error code(<0) if fail
3534 * @retval PMINFO_R_OK success
3535 * @retval PMINFO_R_EINVAL invalid argument
3536 * @retval PMINFO_R_ERROR internal error
3537 * @pre pkgmgrinfo_appinfo_filter_create()
3538 * @post pkgmgrinfo_appinfo_filter_destroy()
3539 * @see pkgmgrinfo_appinfo_filter_count()
3540 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3542 static int get_capp_count()
3546 pkgmgrinfo_appinfo_filter_h handle;
3547 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3548 if (ret != PMINFO_R_OK)
3550 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3551 if (ret != PMINFO_R_OK) {
3552 pkgmgrinfo_appinfo_filter_destroy(handle);
3555 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3556 if (ret != PMINFO_R_OK) {
3557 pkgmgrinfo_appinfo_filter_destroy(handle);
3560 printf("No of capp: %d\n", count);
3561 pkgmgrinfo_appinfo_filter_destroy(handle);
3566 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3567 const char *property, const char *value);
3570 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3571 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3573 * @par This API is for package-manager client application
3574 * @par Sync (or) Async : Synchronous API
3576 * @param[in] handle pointer to the application info filter handle.
3577 * @param[in] app_cb callback function.
3578 * @param[in] user_data user data to be passed to the callback function
3579 * @return 0 if success, error code(<0) if fail
3580 * @retval PMINFO_R_OK success
3581 * @retval PMINFO_R_EINVAL invalid argument
3582 * @retval PMINFO_R_ERROR internal error
3583 * @pre pkgmgrinfo_appinfo_filter_create()
3584 * @post pkgmgrinfo_appinfo_filter_destroy()
3585 * @see pkgmgrinfo_appinfo_filter_count()
3587 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3590 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3591 printf("appid : %s\n", appid);
3595 static int get_capp_list()
3598 pkgmgrinfo_appinfo_filter_h handle;
3599 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3600 if (ret != PMINFO_R_OK)
3602 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3603 if (ret != PMINFO_R_OK) {
3604 pkgmgrinfo_appinfo_filter_destroy(handle);
3607 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3608 if (ret != PMINFO_R_OK) {
3609 pkgmgrinfo_appinfo_filter_destroy(handle);
3612 pkgmgrinfo_appinfo_filter_destroy(handle);
3617 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3618 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3621 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3622 * @brief This API counts the application that satisfy the filter conditions
3624 * @par This API is for package-manager client application
3625 * @par Sync (or) Async : Synchronous API
3627 * @param[in] handle pointer to the application info filter handle.
3628 * @param[in] count pointer to store count value
3629 * @return 0 if success, error code(<0) if fail
3630 * @retval PMINFO_R_OK success
3631 * @retval PMINFO_R_EINVAL invalid argument
3632 * @retval PMINFO_R_ERROR internal error
3633 * @pre pkgmgrinfo_appinfo_filter_create()
3634 * @post pkgmgrinfo_appinfo_filter_destroy()
3635 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3637 static int get_capp_count()
3641 pkgmgrinfo_appinfo_filter_h handle;
3642 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3643 if (ret != PMINFO_R_OK)
3645 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3646 if (ret != PMINFO_R_OK) {
3647 pkgmgrinfo_appinfo_filter_destroy(handle);
3650 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3651 if (ret != PMINFO_R_OK) {
3652 pkgmgrinfo_appinfo_filter_destroy(handle);
3655 printf("No of capp: %d\n", count);
3656 pkgmgrinfo_appinfo_filter_destroy(handle);
3661 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3664 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
3665 * @brief This API creates the application's metadata information filter handle from db.
3667 * @par This API is for package-manager client application
3668 * @par Sync (or) Async : Synchronous API
3670 * @param[out] handle pointer to the application metadata info filter handle.
3671 * @return 0 if success, error code(<0) if fail
3672 * @retval PMINFO_R_OK success
3673 * @retval PMINFO_R_EINVAL invalid argument
3674 * @retval PMINFO_R_ERROR internal error
3676 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3677 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3679 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3682 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3683 printf("appid : %s\n", appid);
3687 static int get_app_list(const char *mkey, const char *mvalue)
3690 pkgmgrinfo_appinfo_metadata_filter_h handle;
3691 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3692 if (ret != PMINFO_R_OK)
3694 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3695 if (ret != PMINFO_R_OK) {
3696 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3699 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3700 if (ret != PMINFO_R_OK) {
3701 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3704 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3709 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
3712 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
3713 * @brief This API destroys the application's metadata information filter handle.
3715 * @par This API is for package-manager client application
3716 * @par Sync (or) Async : Synchronous API
3718 * @param[in] handle pointer to the application metadata info filter handle.
3719 * @return 0 if success, error code(<0) if fail
3720 * @retval PMINFO_R_OK success
3721 * @retval PMINFO_R_EINVAL invalid argument
3722 * @retval PMINFO_R_ERROR internal error
3723 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3725 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3727 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3730 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3731 printf("appid : %s\n", appid);
3735 static int get_app_list(const char *mkey, const char *mvalue)
3738 pkgmgrinfo_appinfo_metadata_filter_h handle;
3739 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3740 if (ret != PMINFO_R_OK)
3742 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3743 if (ret != PMINFO_R_OK) {
3744 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3747 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3748 if (ret != PMINFO_R_OK) {
3749 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3752 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3757 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
3760 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
3761 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
3762 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
3764 * @par This API is for package-manager client application
3765 * @par Sync (or) Async : Synchronous API
3767 * @param[in] handle pointer to the application metadata info filter handle.
3768 * @param[in] key pointer to metadata key
3769 * @param[in] value pointer to metadata value
3770 * @return 0 if success, error code(<0) if fail
3771 * @retval PMINFO_R_OK success
3772 * @retval PMINFO_R_EINVAL invalid argument
3773 * @retval PMINFO_R_ERROR internal error
3774 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3775 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
3776 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3778 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3781 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3782 printf("appid : %s\n", appid);
3786 static int get_app_list(const char *mkey, const char *mvalue)
3789 pkgmgrinfo_appinfo_metadata_filter_h handle;
3790 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3791 if (ret != PMINFO_R_OK)
3793 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3794 if (ret != PMINFO_R_OK) {
3795 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3798 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3799 if (ret != PMINFO_R_OK) {
3800 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3803 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3808 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
3809 const char *key, const char *value);
3812 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3813 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
3814 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
3815 * negative value, no more callbacks will be called and API will return.
3817 * @par This API is for package-manager client application
3818 * @par Sync (or) Async : Synchronous API
3820 * @param[in] handle pointer to the application metadata info filter handle.
3821 * @param[in] app_cb function pointer to callback
3822 * @param[in] user_data pointer to user data
3823 * @return 0 if success, error code(<0) if fail
3824 * @retval PMINFO_R_OK success
3825 * @retval PMINFO_R_EINVAL invalid argument
3826 * @retval PMINFO_R_ERROR internal error
3827 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3828 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3830 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3833 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3834 printf("appid : %s\n", appid);
3838 static int get_app_list(const char *mkey, const char *mvalue)
3841 pkgmgrinfo_appinfo_metadata_filter_h handle;
3842 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3843 if (ret != PMINFO_R_OK)
3845 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3846 if (ret != PMINFO_R_OK) {
3847 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3850 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3851 if (ret != PMINFO_R_OK) {
3852 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3855 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3860 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
3861 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3864 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3865 * @brief This API creates the package cert information handle to get data from db.
3867 * @par This API is for package-manager client application
3868 * @par Sync (or) Async : Synchronous API
3870 * @param[out] handle pointer to the package cert handle.
3871 * @return 0 if success, error code(<0) if fail
3872 * @retval PMINFO_R_OK success
3873 * @retval PMINFO_R_EINVAL invalid argument
3874 * @retval PMINFO_R_ERROR internal error
3876 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3877 * @see pkgmgrinfo_pkginfo_get_cert_value()
3878 * @see pkgmgrinfo_pkginfo_load_certinfo()
3880 static int get_cert_info(const char *pkgid)
3883 pkgmgrinfo_certinfo_h handle;
3884 char *auth_cert = NULL;
3885 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3886 if (ret != PMINFO_R_OK)
3888 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3889 if (ret != PMINFO_R_OK) {
3890 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3893 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3894 if (ret != PMINFO_R_OK) {
3895 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3898 printf("Author root certificate: %s\n", auth_root);
3899 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3904 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3907 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3908 * @brief This API loads the package cert information handle with data from db.
3910 * @par This API is for package-manager client application
3911 * @par Sync (or) Async : Synchronous API
3913 * @param[in] pkgid pointer to the package ID.
3914 * @param[in] handle pointer to the package cert handle.
3915 * @return 0 if success, error code(<0) if fail
3916 * @retval PMINFO_R_OK success
3917 * @retval PMINFO_R_EINVAL invalid argument
3918 * @retval PMINFO_R_ERROR internal error
3919 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3920 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3921 * @see pkgmgrinfo_pkginfo_get_cert_value()
3923 static int get_cert_info(const char *pkgid)
3926 pkgmgrinfo_certinfo_h handle;
3927 char *auth_cert = NULL;
3928 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3929 if (ret != PMINFO_R_OK)
3931 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3932 if (ret != PMINFO_R_OK) {
3933 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3936 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3937 if (ret != PMINFO_R_OK) {
3938 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3941 printf("Author root certificate: %s\n", auth_root);
3942 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3947 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3950 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3951 * @brief This API gets the package cert information from the handle
3953 * @par This API is for package-manager client application
3954 * @par Sync (or) Async : Synchronous API
3956 * @param[in] handle pointer to the package cert handle.
3957 * @param[in] cert_type certificate type
3958 * @param[out] cert_value pointer to hold certificate value
3959 * @return 0 if success, error code(<0) if fail
3960 * @retval PMINFO_R_OK success
3961 * @retval PMINFO_R_EINVAL invalid argument
3962 * @retval PMINFO_R_ERROR internal error
3963 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3964 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3965 * @see pkgmgrinfo_pkginfo_load_certinfo()
3967 static int get_cert_info(const char *pkgid)
3970 pkgmgrinfo_certinfo_h handle;
3971 char *auth_cert = NULL;
3972 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3973 if (ret != PMINFO_R_OK)
3975 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3976 if (ret != PMINFO_R_OK) {
3977 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3980 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3981 if (ret != PMINFO_R_OK) {
3982 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3985 printf("Author root certificate: %s\n", auth_root);
3986 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3991 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3994 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3995 * @brief This API destroys the package cert information handle freeing up all the resources
3997 * @par This API is for package-manager client application
3998 * @par Sync (or) Async : Synchronous API
4000 * @param[in] handle pointer to the package cert handle.
4001 * @return 0 if success, error code(<0) if fail
4002 * @retval PMINFO_R_OK success
4003 * @retval PMINFO_R_EINVAL invalid argument
4004 * @retval PMINFO_R_ERROR internal error
4005 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4007 * @see pkgmgrinfo_pkginfo_load_certinfo()
4009 static int get_cert_info(const char *pkgid)
4012 pkgmgrinfo_certinfo_h handle;
4013 char *auth_cert = NULL;
4014 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4015 if (ret != PMINFO_R_OK)
4017 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4018 if (ret != PMINFO_R_OK) {
4019 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4022 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4023 if (ret != PMINFO_R_OK) {
4024 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4027 printf("Author root certificate: %s\n", auth_root);
4028 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4033 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4036 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4037 * @brief This API deletes the package cert information from DB
4039 * @par This API is for package-manager client application
4040 * @par Sync (or) Async : Synchronous API
4042 * @param[in] pkgid pointer to the package ID.
4043 * @return 0 if success, error code(<0) if fail
4044 * @retval PMINFO_R_OK success
4045 * @retval PMINFO_R_EINVAL invalid argument
4046 * @retval PMINFO_R_ERROR internal error
4050 static int delete_cert_info(const char *pkgid)
4053 ret = pkgmgrinfo_delete_certinfo(pkgid);
4054 if (ret != PMINFO_R_OK)
4060 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4063 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4064 * @brief This API creates the package db information handle to set data in db.
4066 * @par This API is for package-manager client application
4067 * @par Sync (or) Async : Synchronous API
4069 * @param[in] pkgid pointer to the package ID.
4070 * @param[out] handle pointer to the package db info handle.
4071 * @return 0 if success, error code(<0) if fail
4072 * @retval PMINFO_R_OK success
4073 * @retval PMINFO_R_EINVAL invalid argument
4074 * @retval PMINFO_R_ERROR internal error
4076 * @post pkgmgrinfo_destroy_pkgdbinfo()
4077 * @see pkgmgrinfo_save_pkgdbinfo()
4078 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4080 static int set_pkg_in_db(const char *pkgid)
4083 pkgmgrinfo_pkgdbinfo_h handle;
4084 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4085 if (ret != PMINFO_R_OK)
4087 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4088 if (ret != PMINFO_R_OK) {
4089 pkgmgrinfo_destroy_pkgdbinfo(handle);
4092 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4093 if (ret != PMINFO_R_OK) {
4094 pkgmgrinfo_destroy_pkgdbinfo(handle);
4097 pkgmgrinfo_destroy_pkgdbinfo(handle);
4102 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4105 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4106 * @brief This API sets the package type in db handle
4108 * @par This API is for package-manager client application
4109 * @par Sync (or) Async : Synchronous API
4111 * @param[in] handle pointer to the pkgdbinfo handle.
4112 * @param[in] type pointer to the package type.
4113 * @return 0 if success, error code(<0) if fail
4114 * @retval PMINFO_R_OK success
4115 * @retval PMINFO_R_EINVAL invalid argument
4116 * @retval PMINFO_R_ERROR internal error
4117 * @pre pkgmgrinfo_create_pkgdbinfo()
4118 * @post pkgmgrinfo_destroy_pkgdbinfo()
4119 * @see pkgmgrinfo_save_pkgdbinfo()
4120 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4122 static int set_pkg_type_in_db(const char *pkgid)
4125 pkgmgrinfo_pkgdbinfo_h handle;
4126 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4127 if (ret != PMINFO_R_OK)
4129 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4130 if (ret != PMINFO_R_OK) {
4131 pkgmgrinfo_destroy_pkgdbinfo(handle);
4134 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4135 if (ret != PMINFO_R_OK) {
4136 pkgmgrinfo_destroy_pkgdbinfo(handle);
4139 pkgmgrinfo_destroy_pkgdbinfo(handle);
4144 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4147 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4148 * @brief This API sets the package version in db 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 pkgdbinfo handle.
4154 * @param[in] version pointer to the package version
4155 * @return 0 if success, error code(<0) if fail
4156 * @retval PMINFO_R_OK success
4157 * @retval PMINFO_R_EINVAL invalid argument
4158 * @retval PMINFO_R_ERROR internal error
4159 * @pre pkgmgrinfo_create_pkgdbinfo()
4160 * @post pkgmgrinfo_destroy_pkgdbinfo()
4161 * @see pkgmgrinfo_save_pkgdbinfo()
4162 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4164 static int set_pkg_version_in_db(const char *pkgid)
4167 pkgmgrinfo_pkgdbinfo_h handle;
4168 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4169 if (ret != PMINFO_R_OK)
4171 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4172 if (ret != PMINFO_R_OK) {
4173 pkgmgrinfo_destroy_pkgdbinfo(handle);
4176 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4177 if (ret != PMINFO_R_OK) {
4178 pkgmgrinfo_destroy_pkgdbinfo(handle);
4181 pkgmgrinfo_destroy_pkgdbinfo(handle);
4186 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4189 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4190 * @brief This API sets the package install location in db handle
4192 * @par This API is for package-manager client application
4193 * @par Sync (or) Async : Synchronous API
4195 * @param[in] handle pointer to the pkgdbinfo handle.
4196 * @param[in] location package install location
4197 * @return 0 if success, error code(<0) if fail
4198 * @retval PMINFO_R_OK success
4199 * @retval PMINFO_R_EINVAL invalid argument
4200 * @retval PMINFO_R_ERROR internal error
4201 * @pre pkgmgrinfo_create_pkgdbinfo()
4202 * @post pkgmgrinfo_destroy_pkgdbinfo()
4203 * @see pkgmgrinfo_save_pkgdbinfo()
4204 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4206 static int set_pkg_install_location_in_db(const char *pkgid)
4209 pkgmgrinfo_pkgdbinfo_h handle;
4210 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4211 if (ret != PMINFO_R_OK)
4213 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4214 if (ret != PMINFO_R_OK) {
4215 pkgmgrinfo_destroy_pkgdbinfo(handle);
4218 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4219 if (ret != PMINFO_R_OK) {
4220 pkgmgrinfo_destroy_pkgdbinfo(handle);
4223 pkgmgrinfo_destroy_pkgdbinfo(handle);
4228 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4231 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4232 * @brief This API sets the package size in db handle
4234 * @par This API is for package-manager client application
4235 * @par Sync (or) Async : Synchronous API
4237 * @param[in] handle pointer to the pkgdbinfo handle.
4238 * @param[in] size pointer to the package size
4239 * @return 0 if success, error code(<0) if fail
4240 * @retval PMINFO_R_OK success
4241 * @retval PMINFO_R_EINVAL invalid argument
4242 * @retval PMINFO_R_ERROR internal error
4243 * @pre pkgmgrinfo_create_pkgdbinfo()
4244 * @post pkgmgrinfo_destroy_pkgdbinfo()
4245 * @see pkgmgrinfo_save_pkgdbinfo()
4246 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4248 static int set_pkg_size_in_db(const char *pkgid)
4251 pkgmgrinfo_pkgdbinfo_h handle;
4252 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4253 if (ret != PMINFO_R_OK)
4255 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4256 if (ret != PMINFO_R_OK) {
4257 pkgmgrinfo_destroy_pkgdbinfo(handle);
4260 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4261 if (ret != PMINFO_R_OK) {
4262 pkgmgrinfo_destroy_pkgdbinfo(handle);
4265 pkgmgrinfo_destroy_pkgdbinfo(handle);
4270 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4273 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4274 * @brief This API sets the package label in db handle
4276 * @par This API is for package-manager client application
4277 * @par Sync (or) Async : Synchronous API
4279 * @param[in] handle pointer to the pkgdbinfo handle.
4280 * @param[in] label pointer to the package label
4281 * @param[in] locale pointer to the locale
4282 * @return 0 if success, error code(<0) if fail
4283 * @retval PMINFO_R_OK success
4284 * @retval PMINFO_R_EINVAL invalid argument
4285 * @retval PMINFO_R_ERROR internal error
4286 * @pre pkgmgrinfo_create_pkgdbinfo()
4287 * @post pkgmgrinfo_destroy_pkgdbinfo()
4288 * @see pkgmgrinfo_save_pkgdbinfo()
4289 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4291 static int set_pkg_label_in_db(const char *pkgid)
4294 pkgmgrinfo_pkgdbinfo_h handle;
4295 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4296 if (ret != PMINFO_R_OK)
4298 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4299 if (ret != PMINFO_R_OK) {
4300 pkgmgrinfo_destroy_pkgdbinfo(handle);
4303 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4304 if (ret != PMINFO_R_OK) {
4305 pkgmgrinfo_destroy_pkgdbinfo(handle);
4308 pkgmgrinfo_destroy_pkgdbinfo(handle);
4313 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4316 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4317 * @brief This API sets the package icon in db handle
4319 * @par This API is for package-manager client application
4320 * @par Sync (or) Async : Synchronous API
4322 * @param[in] handle pointer to the pkgdbinfo handle.
4323 * @param[in] icon pointer to the package icon
4324 * @param[in] locale pointer to the locale
4325 * @return 0 if success, error code(<0) if fail
4326 * @retval PMINFO_R_OK success
4327 * @retval PMINFO_R_EINVAL invalid argument
4328 * @retval PMINFO_R_ERROR internal error
4329 * @pre pkgmgrinfo_create_pkgdbinfo()
4330 * @post pkgmgrinfo_destroy_pkgdbinfo()
4331 * @see pkgmgrinfo_save_pkgdbinfo()
4332 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4334 static int set_pkg_icon_in_db(const char *pkgid)
4337 pkgmgrinfo_pkgdbinfo_h handle;
4338 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4339 if (ret != PMINFO_R_OK)
4341 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4342 if (ret != PMINFO_R_OK) {
4343 pkgmgrinfo_destroy_pkgdbinfo(handle);
4346 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4347 if (ret != PMINFO_R_OK) {
4348 pkgmgrinfo_destroy_pkgdbinfo(handle);
4351 pkgmgrinfo_destroy_pkgdbinfo(handle);
4356 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4359 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4360 * @brief This API sets the package description in db handle
4362 * @par This API is for package-manager client application
4363 * @par Sync (or) Async : Synchronous API
4365 * @param[in] handle pointer to the pkgdbinfo handle.
4366 * @param[in] description pointer to the package description
4367 * @param[in] locale pointer to the locale
4368 * @return 0 if success, error code(<0) if fail
4369 * @retval PMINFO_R_OK success
4370 * @retval PMINFO_R_EINVAL invalid argument
4371 * @retval PMINFO_R_ERROR internal error
4372 * @pre pkgmgrinfo_create_pkgdbinfo()
4373 * @post pkgmgrinfo_destroy_pkgdbinfo()
4374 * @see pkgmgrinfo_save_pkgdbinfo()
4375 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4377 static int set_pkg_description_in_db(const char *pkgid)
4380 pkgmgrinfo_pkgdbinfo_h handle;
4381 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4382 if (ret != PMINFO_R_OK)
4384 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4385 if (ret != PMINFO_R_OK) {
4386 pkgmgrinfo_destroy_pkgdbinfo(handle);
4389 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4390 if (ret != PMINFO_R_OK) {
4391 pkgmgrinfo_destroy_pkgdbinfo(handle);
4394 pkgmgrinfo_destroy_pkgdbinfo(handle);
4399 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4402 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4403 const char *author_email, const char *author_href, const char *locale)
4404 * @brief This API sets the package author info in db handle
4406 * @par This API is for package-manager client application
4407 * @par Sync (or) Async : Synchronous API
4409 * @param[in] handle pointer to the pkgdbinfo handle.
4410 * @param[in] author_name pointer to the package author name
4411 * @param[in] author_email pointer to the package author email
4412 * @param[in] author_href pointer to the package author href
4413 * @param[in] locale pointer to the locale
4414 * @return 0 if success, error code(<0) if fail
4415 * @retval PMINFO_R_OK success
4416 * @retval PMINFO_R_EINVAL invalid argument
4417 * @retval PMINFO_R_ERROR internal error
4418 * @pre pkgmgrinfo_create_pkgdbinfo()
4419 * @post pkgmgrinfo_destroy_pkgdbinfo()
4420 * @see pkgmgrinfo_save_pkgdbinfo()
4421 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4423 static int set_pkg_author_in_db(const char *pkgid)
4426 pkgmgrinfo_pkgdbinfo_h handle;
4427 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4428 if (ret != PMINFO_R_OK)
4430 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4431 if (ret != PMINFO_R_OK) {
4432 pkgmgrinfo_destroy_pkgdbinfo(handle);
4435 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4436 if (ret != PMINFO_R_OK) {
4437 pkgmgrinfo_destroy_pkgdbinfo(handle);
4440 pkgmgrinfo_destroy_pkgdbinfo(handle);
4445 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4446 const char *author_email, const char *author_href, const char *locale);
4449 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4450 * @brief This API sets the package 'removable' value in db handle
4452 * @par This API is for package-manager client application
4453 * @par Sync (or) Async : Synchronous API
4455 * @param[in] handle pointer to the pkgdbinfo handle.
4456 * @param[in] removable package removable value
4457 * @return 0 if success, error code(<0) if fail
4458 * @retval PMINFO_R_OK success
4459 * @retval PMINFO_R_EINVAL invalid argument
4460 * @retval PMINFO_R_ERROR internal error
4461 * @pre pkgmgrinfo_create_pkgdbinfo()
4462 * @post pkgmgrinfo_destroy_pkgdbinfo()
4463 * @see pkgmgrinfo_save_pkgdbinfo()
4464 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4466 static int set_pkg_removable_in_db(const char *pkgid)
4469 pkgmgrinfo_pkgdbinfo_h handle;
4470 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4471 if (ret != PMINFO_R_OK)
4473 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4474 if (ret != PMINFO_R_OK) {
4475 pkgmgrinfo_destroy_pkgdbinfo(handle);
4478 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4479 if (ret != PMINFO_R_OK) {
4480 pkgmgrinfo_destroy_pkgdbinfo(handle);
4483 pkgmgrinfo_destroy_pkgdbinfo(handle);
4488 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4491 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4492 * @brief This API sets the package 'preload' value in db handle
4494 * @par This API is for package-manager client application
4495 * @par Sync (or) Async : Synchronous API
4497 * @param[in] handle pointer to the pkgdbinfo handle.
4498 * @param[in] preload package preload value
4499 * @return 0 if success, error code(<0) if fail
4500 * @retval PMINFO_R_OK success
4501 * @retval PMINFO_R_EINVAL invalid argument
4502 * @retval PMINFO_R_ERROR internal error
4503 * @pre pkgmgrinfo_create_pkgdbinfo()
4504 * @post pkgmgrinfo_destroy_pkgdbinfo()
4505 * @see pkgmgrinfo_save_pkgdbinfo()
4506 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4508 static int set_pkg_preload_in_db(const char *pkgid)
4511 pkgmgrinfo_pkgdbinfo_h handle;
4512 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4513 if (ret != PMINFO_R_OK)
4515 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4516 if (ret != PMINFO_R_OK) {
4517 pkgmgrinfo_destroy_pkgdbinfo(handle);
4520 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4521 if (ret != PMINFO_R_OK) {
4522 pkgmgrinfo_destroy_pkgdbinfo(handle);
4525 pkgmgrinfo_destroy_pkgdbinfo(handle);
4530 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4533 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4534 * @brief This API sets the package 'installed_storage' value in db handle
4536 * @par This API is for package-manager client application
4537 * @par Sync (or) Async : Synchronous API
4539 * @param[in] handle pointer to the pkgdbinfo handle.
4540 * @param[in] location installed_storage value
4541 * @return 0 if success, error code(<0) if fail
4542 * @retval PMINFO_R_OK success
4543 * @retval PMINFO_R_EINVAL invalid argument
4544 * @retval PMINFO_R_ERROR internal error
4545 * @pre pkgmgrinfo_create_pkgdbinfo()
4546 * @post pkgmgrinfo_destroy_pkgdbinfo()
4547 * @see pkgmgrinfo_save_pkgdbinfo()
4549 static int set_pkg_installed_storage_in_db(const char *pkgid)
4552 pkgmgrinfo_pkgdbinfo_h handle;
4553 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4554 if (ret != PMINFO_R_OK)
4556 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4557 if (ret != PMINFO_R_OK) {
4558 pkgmgrinfo_destroy_pkgdbinfo(handle);
4561 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4562 if (ret != PMINFO_R_OK) {
4563 pkgmgrinfo_destroy_pkgdbinfo(handle);
4566 pkgmgrinfo_destroy_pkgdbinfo(handle);
4571 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4574 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4575 * @brief This API saves all the information from the handle to the DB.
4577 * @par This API is for package-manager client application
4578 * @par Sync (or) Async : Synchronous API
4580 * @param[in] handle pointer to the package db info handle.
4581 * @return 0 if success, error code(<0) if fail
4582 * @retval PMINFO_R_OK success
4583 * @retval PMINFO_R_EINVAL invalid argument
4584 * @retval PMINFO_R_ERROR internal error
4585 * @pre pkgmgrinfo_create_pkgdbinfo()
4586 * @post pkgmgrinfo_destroy_pkgdbinfo()
4587 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4589 static int set_pkg_in_db(const char *pkgid)
4592 pkgmgrinfo_pkgdbinfo_h handle;
4593 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4594 if (ret != PMINFO_R_OK)
4596 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4597 if (ret != PMINFO_R_OK) {
4598 pkgmgrinfo_destroy_pkgdbinfo(handle);
4601 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4602 if (ret != PMINFO_R_OK) {
4603 pkgmgrinfo_destroy_pkgdbinfo(handle);
4606 pkgmgrinfo_destroy_pkgdbinfo(handle);
4611 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4614 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4615 * @brief This API destroys the package db information handle freeing up all the resources
4617 * @par This API is for package-manager client application
4618 * @par Sync (or) Async : Synchronous API
4620 * @param[in] handle pointer to the package db info handle.
4621 * @return 0 if success, error code(<0) if fail
4622 * @retval PMINFO_R_OK success
4623 * @retval PMINFO_R_EINVAL invalid argument
4624 * @retval PMINFO_R_ERROR internal error
4625 * @pre pkgmgrinfo_create_pkgdbinfo()
4627 * @see pkgmgrinfo_save_pkgdbinfo()
4628 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4630 static int set_pkg_in_db(const char *pkgid)
4633 pkgmgrinfo_pkgdbinfo_h handle;
4634 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4635 if (ret != PMINFO_R_OK)
4637 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4638 if (ret != PMINFO_R_OK) {
4639 pkgmgrinfo_destroy_pkgdbinfo(handle);
4642 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4643 if (ret != PMINFO_R_OK) {
4644 pkgmgrinfo_destroy_pkgdbinfo(handle);
4647 pkgmgrinfo_destroy_pkgdbinfo(handle);
4652 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4656 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4657 * @brief This API creates the package cert information handle to set data in db.
4659 * @par This API is for package-manager client application
4660 * @par Sync (or) Async : Synchronous API
4662 * @param[out] handle pointer to the package cert handle.
4663 * @return 0 if success, error code(<0) if fail
4664 * @retval PMINFO_R_OK success
4665 * @retval PMINFO_R_EINVAL invalid argument
4666 * @retval PMINFO_R_ERROR internal error
4668 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4669 * @see pkgmgrinfo_set_cert_value()
4670 * @see pkgmgrinfo_save_certinfo()
4672 static int set_cert_in_db(const char *pkgid)
4675 pkgmgrinfo_instcertinfo_h handle;
4676 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4677 if (ret != PMINFO_R_OK)
4679 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4680 if (ret != PMINFO_R_OK) {
4681 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4684 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4685 if (ret != PMINFO_R_OK) {
4686 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4689 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4694 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4697 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4698 * @brief This API sets the package cert information in the handle.
4700 * @par This API is for package-manager client application
4701 * @par Sync (or) Async : Synchronous API
4703 * @param[in] handle pointer to the package cert handle.
4704 * @param[in] cert_type certificate type.
4705 * @param[in] cert_value certificate value.
4706 * @return 0 if success, error code(<0) if fail
4707 * @retval PMINFO_R_OK success
4708 * @retval PMINFO_R_EINVAL invalid argument
4709 * @retval PMINFO_R_ERROR internal error
4710 * @pre pkgmgrinfo_create_certinfo_set_handle()
4711 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4712 * @see pkgmgrinfo_save_certinfo()
4714 static int set_cert_in_db(const char *pkgid)
4717 pkgmgrinfo_instcertinfo_h handle;
4718 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4719 if (ret != PMINFO_R_OK)
4721 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4722 if (ret != PMINFO_R_OK) {
4723 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4726 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4727 if (ret != PMINFO_R_OK) {
4728 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4731 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4736 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4739 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4740 * @brief This API saves the package cert information in the DB.
4742 * @par This API is for package-manager client application
4743 * @par Sync (or) Async : Synchronous API
4745 * @param[in] pkgid pointer to the package ID.
4746 * @param[in] handle pointer to the package cert handle.
4747 * @return 0 if success, error code(<0) if fail
4748 * @retval PMINFO_R_OK success
4749 * @retval PMINFO_R_EINVAL invalid argument
4750 * @retval PMINFO_R_ERROR internal error
4751 * @pre pkgmgrinfo_create_certinfo_set_handle()
4752 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4753 * @see pkgmgrinfo_save_certinfo()
4755 static int set_cert_in_db(const char *pkgid)
4758 pkgmgrinfo_instcertinfo_h handle;
4759 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4760 if (ret != PMINFO_R_OK)
4762 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4763 if (ret != PMINFO_R_OK) {
4764 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4767 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4768 if (ret != PMINFO_R_OK) {
4769 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4772 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4777 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4780 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4781 * @brief This API destroys the package cert information handle freeing up all the resources.
4783 * @par This API is for package-manager client application
4784 * @par Sync (or) Async : Synchronous API
4786 * @param[in] handle pointer to the package cert handle.
4787 * @return 0 if success, error code(<0) if fail
4788 * @retval PMINFO_R_OK success
4789 * @retval PMINFO_R_EINVAL invalid argument
4790 * @retval PMINFO_R_ERROR internal error
4791 * @pre pkgmgrinfo_create_certinfo_set_handle()
4793 * @see pkgmgrinfo_save_certinfo()
4795 static int set_cert_in_db(const char *pkgid)
4798 pkgmgrinfo_instcertinfo_h handle;
4799 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4800 if (ret != PMINFO_R_OK)
4802 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4803 if (ret != PMINFO_R_OK) {
4804 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4807 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4808 if (ret != PMINFO_R_OK) {
4809 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4812 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4817 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4820 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4821 * @brief This API gets the datacontrol info
4823 * @par This API is for package-manager client application
4824 * @par Sync (or) Async : Synchronous API
4826 * @param[in] providerid pointer to the providerid of dataconltrol.
4827 * @param[in] type pointer to the type of dataconltrol.
4828 * @param[out] appid pointer to hold appid, need to free after using
4829 * @param[out] access pointer to hold access, need to free after using
4830 * @return 0 if success, error code(<0) if fail
4831 * @retval PMINFO_R_OK success
4832 * @retval PMINFO_R_EINVAL invalid argument
4833 * @retval PMINFO_R_ERROR internal error
4836 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4839 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
4840 * @brief This API gets the application 'guest mode visibility' value from the DB
4842 * @par This API is for package-manager client application
4843 * @par Sync (or) Async : Synchronous API
4845 * @param[in] handle pointer to application info handle
4846 * @param[out] status pointer to hold app guest mode visibility value
4847 * @return 0 if success, error code(<0) if fail
4848 * @retval PMINFO_R_OK success
4849 * @retval PMINFO_R_EINVAL invalid argument
4850 * @retval PMINFO_R_ERROR internal error
4851 * @pre pkgmgrinfo_appinfo_get_appinfo()
4852 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4853 * @see pkgmgrinfo_appinfo_get_appid()
4854 * @see pkgmgrinfo_appinfo_is_multiple()
4856 static int get_app_guestmode_visibility(const char *appid)
4860 pkgmgrinfo_appinfo_h handle;
4861 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4862 if (ret != PMINFO_R_OK)
4864 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
4865 if (ret != PMINFO_R_OK) {
4866 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4869 printf("app guest mode visibility: %d\n", status);
4870 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4875 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
4878 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
4879 * @brief This API sets the application 'guest mode visibility' value in the DB
4881 * @par This API is for package-manager client application
4882 * @par Sync (or) Async : Synchronous API
4884 * @param[in] handle pointer to application info handle
4885 * @param[out] status app guest mode visibility value
4886 * @return 0 if success, error code(<0) if fail
4887 * @retval PMINFO_R_OK success
4888 * @retval PMINFO_R_EINVAL invalid argument
4889 * @retval PMINFO_R_ERROR internal error
4890 * @pre pkgmgrinfo_appinfo_get_appinfo()
4891 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4892 * @see pkgmgrinfo_appinfo_get_appid()
4893 * @see pkgmgrinfo_appinfo_is_multiple()
4895 static int set_app_guestmode_visibility(const char *appid, bool value)
4898 pkgmgrinfo_appinfo_h handle;
4899 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4900 if (ret != PMINFO_R_OK)
4902 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
4903 if (ret != PMINFO_R_OK) {
4904 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4912 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
4919 #endif /* __PKG_INFO_H__ */