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"
372 /** Integer property for filtering based on package info*/
373 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
375 /** String property for filtering based on app info*/
376 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
377 /** String property for filtering based on app info*/
378 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
379 /** String property for filtering based on app info*/
380 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
381 /** String property for filtering based on app info*/
382 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
383 /** String property for filtering based on app info*/
384 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
385 /** String property for filtering based on app info*/
386 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
387 /** String property for filtering based on app info*/
388 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
389 /** String property for filtering based on app info*/
390 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
391 /** String property for filtering based on app info*/
392 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
393 /** String property for filtering based on app info*/
394 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
396 /** Boolean property for filtering based on app info*/
397 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
398 /** Boolean property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
400 /** Boolean property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
402 /** Boolean property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
404 /** Boolean property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
408 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
409 * @brief This API gets list of installed packages
411 * @par This API is for package-manager client application
412 * @par Sync (or) Async : Synchronous API
413 * @param[in] pkg_list_cb iteration function for list
414 * @param[in] user_data user data to be passed to callback function
415 * @return 0 if success, error code(<0) if fail
416 * @retval PMINFO_R_OK success
417 * @retval PMINFO_R_EINVAL invalid argument
418 * @retval PMINFO_R_ERROR internal error
422 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
426 pkgid1 = (char *)user_data;
427 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
428 if (strcmp(pkgid1, pkgid2) == 0) {
435 static int list_pkgs()
438 char *name = "helloworld";
439 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
440 if (ret != PMINFO_R_OK) {
447 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
450 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
451 * @brief This API creates the package information handle from db
453 * @par This API is for package-manager client application
454 * @par Sync (or) Async : Synchronous API
456 * @param[in] pkgid pointer to package ID
457 * @param[out] handle pointer to the package info handle.
458 * @return 0 if success, error code(<0) if fail
459 * @retval PMINFO_R_OK success
460 * @retval PMINFO_R_EINVAL invalid argument
461 * @retval PMINFO_R_ERROR internal error
463 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
464 * @see pkgmgrinfo_pkginfo_get_pkgid()
465 * @see pkgmgrinfo_pkginfo_is_removable()
467 static int get_pkg_type(const char *pkgid)
471 pkgmgrinfo_pkginfo_h handle;
472 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
473 if (ret != PMINFO_R_OK)
475 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
476 if (ret != PMINFO_R_OK) {
477 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
480 printf("pkgtype: %s\n", type);
481 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
486 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
489 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
490 * @brief This API gets the package name from the package ID
492 * @par This API is for package-manager client application
493 * @par Sync (or) Async : Synchronous API
495 * @param[in] handle pointer to package info handle
496 * @param[out] pkg_name pointer to hold package name
497 * @return 0 if success, error code(<0) if fail
498 * @retval PMINFO_R_OK success
499 * @retval PMINFO_R_EINVAL invalid argument
500 * @retval PMINFO_R_ERROR internal error
501 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
502 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
503 * @see pkgmgrinfo_pkginfo_get_type()
504 * @see pkgmgrinfo_pkginfo_is_removable()
506 static int get_pkg_name(const char *pkgid)
509 char *pkgname = NULL;
510 pkgmgrinfo_pkginfo_h handle;
511 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
512 if (ret != PMINFO_R_OK)
514 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
515 if (ret != PMINFO_R_OK) {
516 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
519 printf("pkgname: %s\n", pkgname);
520 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
525 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
528 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
529 * @brief This API gets the package id from the package ID
531 * @par This API is for package-manager client application
532 * @par Sync (or) Async : Synchronous API
534 * @param[in] handle pointer to package info handle
535 * @param[out] pkgid pointer to hold package id
536 * @return 0 if success, error code(<0) if fail
537 * @retval PMINFO_R_OK success
538 * @retval PMINFO_R_EINVAL invalid argument
539 * @retval PMINFO_R_ERROR internal error
540 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
541 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
542 * @see pkgmgrinfo_pkginfo_get_type()
543 * @see pkgmgrinfo_pkginfo_is_removable()
545 static int get_pkgid(const char *pkgid)
549 pkgmgrinfo_pkginfo_h handle;
550 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
551 if (ret != PMINFO_R_OK)
553 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
554 if (ret != PMINFO_R_OK) {
555 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
558 printf("pkg id: %s\n", pkg_id);
559 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
564 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
567 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
568 * @brief This API gets the package type from the package ID
570 * @par This API is for package-manager client application
571 * @par Sync (or) Async : Synchronous API
573 * @param[in] handle pointer to package info handle
574 * @param[out] type pointer to hold package type
575 * @return 0 if success, error code(<0) if fail
576 * @retval PMINFO_R_OK success
577 * @retval PMINFO_R_EINVAL invalid argument
578 * @retval PMINFO_R_ERROR internal error
579 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
580 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
581 * @see pkgmgrinfo_pkginfo_get_pkgid()
582 * @see pkgmgrinfo_pkginfo_is_removable()
584 static int get_pkg_type(const char *pkgid)
588 pkgmgrinfo_pkginfo_h handle;
589 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
590 if (ret != PMINFO_R_OK)
592 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
593 if (ret != PMINFO_R_OK) {
594 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
597 printf("pkgtype: %s\n", type);
598 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
603 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
606 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
607 * @brief This API gets the package version from the package ID
609 * @par This API is for package-manager client application
610 * @par Sync (or) Async : Synchronous API
612 * @param[in] handle pointer to package info handle
613 * @param[out] version pointer to hold package version
614 * @return 0 if success, error code(<0) if fail
615 * @retval PMINFO_R_OK success
616 * @retval PMINFO_R_EINVAL invalid argument
617 * @retval PMINFO_R_ERROR internal error
618 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
619 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
620 * @see pkgmgrinfo_pkginfo_get_pkgid()
621 * @see pkgmgrinfo_pkginfo_is_removable()
623 static int get_pkg_version(const char *pkgid)
626 char *version = NULL;
627 pkgmgrinfo_pkginfo_h handle;
628 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
629 if (ret != PMINFO_R_OK)
631 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
632 if (ret != PMINFO_R_OK) {
633 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
636 printf("pkg version: %s\n", version);
637 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
642 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
645 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
646 * @brief This API gets the package install location from the package ID
648 * @par This API is for package-manager client application
649 * @par Sync (or) Async : Synchronous API
651 * @param[in] handle pointer to package info handle
652 * @param[out] location pointer to hold package install location
653 * @return 0 if success, error code(<0) if fail
654 * @retval PMINFO_R_OK success
655 * @retval PMINFO_R_EINVAL invalid argument
656 * @retval PMINFO_R_ERROR internal error
657 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
658 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
659 * @see pkgmgrinfo_pkginfo_get_pkgid()
660 * @see pkgmgrinfo_pkginfo_is_removable()
662 static int get_pkg_install_location(const char *pkgid)
665 pkgmgrinfo_install_location location;
666 pkgmgrinfo_pkginfo_h handle;
667 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
668 if (ret != PMINFO_R_OK)
670 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
671 if (ret != PMINFO_R_OK) {
672 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
675 printf("pkg install location: %d\n", location);
676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
681 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
684 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
685 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
686 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
687 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
689 * @par This API is for package-manager client application
690 * @par Sync (or) Async : Synchronous API
692 * @param[in] handle pointer to package info handle
693 * @param[out] size pointer to hold package size
694 * @return 0 if success, error code(<0) if fail
695 * @retval PMINFO_R_OK success
696 * @retval PMINFO_R_EINVAL invalid argument
697 * @retval PMINFO_R_ERROR internal error
698 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
699 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
700 * @see pkgmgrinfo_pkginfo_get_pkgid()
701 * @see pkgmgrinfo_pkginfo_is_removable()
703 static int get_pkg_size(const char *pkgid)
707 pkgmgrinfo_pkginfo_h handle;
708 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
709 if (ret != PMINFO_R_OK)
711 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
712 if (ret != PMINFO_R_OK) {
713 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
716 printf("pkgsize: %d\n", size);
717 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
722 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
725 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
726 * @brief This API gets the installed package total size on the target.
728 * @par This API is for package-manager client application
729 * @par Sync (or) Async : Synchronous API
731 * @param[in] handle pointer to package info handle
732 * @param[out] size pointer to hold package total size
733 * @return 0 if success, error code(<0) if fail
734 * @retval PMINFO_R_OK success
735 * @retval PMINFO_R_EINVAL invalid argument
736 * @retval PMINFO_R_ERROR internal error
738 static int get_pkg_total_size(const char *pkgid)
742 pkgmgrinfo_pkginfo_h handle;
743 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
744 if (ret != PMINFO_R_OK)
746 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
747 if (ret != PMINFO_R_OK) {
748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
751 printf("pkg total size: %d\n", size);
752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
757 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
760 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
761 * @brief This API gets the installed package data size on the target.
763 * @par This API is for package-manager client application
764 * @par Sync (or) Async : Synchronous API
766 * @param[in] handle pointer to package info handle
767 * @param[out] size pointer to hold package data size
768 * @return 0 if success, error code(<0) if fail
769 * @retval PMINFO_R_OK success
770 * @retval PMINFO_R_EINVAL invalid argument
771 * @retval PMINFO_R_ERROR internal error
773 static int get_pkg_data_size(const char *pkgid)
777 pkgmgrinfo_pkginfo_h handle;
778 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
779 if (ret != PMINFO_R_OK)
781 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
782 if (ret != PMINFO_R_OK) {
783 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
786 printf("pkg data size: %d\n", size);
787 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
792 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
795 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
796 * @brief This API gets the package icon from the package ID
798 * @par This API is for package-manager client application
799 * @par Sync (or) Async : Synchronous API
801 * @param[in] handle pointer to package info handle
802 * @param[out] icon pointer to hold package icon
803 * @return 0 if success, error code(<0) if fail
804 * @retval PMINFO_R_OK success
805 * @retval PMINFO_R_EINVAL invalid argument
806 * @retval PMINFO_R_ERROR internal error
807 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
808 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
809 * @see pkgmgrinfo_pkginfo_get_pkgid()
810 * @see pkgmgrinfo_pkginfo_is_removable()
812 static int get_pkg_icon(const char *pkgid)
816 pkgmgrinfo_pkginfo_h handle;
817 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
818 if (ret != PMINFO_R_OK)
820 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
821 if (ret != PMINFO_R_OK) {
822 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
825 printf("pkg icon: %s\n", icon);
826 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
831 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
834 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
835 * @brief This API gets the package label from the package ID
837 * @par This API is for package-manager client application
838 * @par Sync (or) Async : Synchronous API
840 * @param[in] handle pointer to package info handle
841 * @param[out] label pointer to hold package label
842 * @return 0 if success, error code(<0) if fail
843 * @retval PMINFO_R_OK success
844 * @retval PMINFO_R_EINVAL invalid argument
845 * @retval PMINFO_R_ERROR internal error
846 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
847 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
848 * @see pkgmgrinfo_pkginfo_get_pkgid()
849 * @see pkgmgrinfo_pkginfo_is_removable()
851 static int get_pkg_label(const char *pkgid)
855 pkgmgrinfo_pkginfo_h handle;
856 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
857 if (ret != PMINFO_R_OK)
859 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
860 if (ret != PMINFO_R_OK) {
861 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
864 printf("pkg label: %s\n", label);
865 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
870 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
873 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
874 * @brief This API gets the package description from the package ID
876 * @par This API is for package-manager client application
877 * @par Sync (or) Async : Synchronous API
879 * @param[in] handle pointer to package info handle
880 * @param[out] description pointer to hold package description
881 * @return 0 if success, error code(<0) if fail
882 * @retval PMINFO_R_OK success
883 * @retval PMINFO_R_EINVAL invalid argument
884 * @retval PMINFO_R_ERROR internal error
885 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
886 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
887 * @see pkgmgrinfo_pkginfo_get_pkgid()
888 * @see pkgmgrinfo_pkginfo_is_removable()
890 static int get_pkg_description(const char *pkgid)
893 char *description = NULL;
894 pkgmgrinfo_pkginfo_h handle;
895 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
896 if (ret != PMINFO_R_OK)
898 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
899 if (ret != PMINFO_R_OK) {
900 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
903 printf("pkg description: %s\n", description);
904 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
909 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
912 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
913 * @brief This API gets the package's author name from the package ID
915 * @par This API is for package-manager client application
916 * @par Sync (or) Async : Synchronous API
918 * @param[in] handle pointer to package info handle
919 * @param[out] author_name pointer to hold package author name
920 * @return 0 if success, error code(<0) if fail
921 * @retval PMINFO_R_OK success
922 * @retval PMINFO_R_EINVAL invalid argument
923 * @retval PMINFO_R_ERROR internal error
924 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
925 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
926 * @see pkgmgrinfo_pkginfo_get_pkgid()
927 * @see pkgmgrinfo_pkginfo_is_removable()
929 static int get_pkg_author_name(const char *pkgid)
932 char *author_name = NULL;
933 pkgmgrinfo_pkginfo_h handle;
934 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
935 if (ret != PMINFO_R_OK)
937 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
938 if (ret != PMINFO_R_OK) {
939 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
942 printf("pkg author name: %s\n", author_name);
943 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
948 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
951 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
952 * @brief This API gets the package's author email from the package ID
954 * @par This API is for package-manager client application
955 * @par Sync (or) Async : Synchronous API
957 * @param[in] handle pointer to package info handle
958 * @param[out] author_email pointer to hold package author email
959 * @return 0 if success, error code(<0) if fail
960 * @retval PMINFO_R_OK success
961 * @retval PMINFO_R_EINVAL invalid argument
962 * @retval PMINFO_R_ERROR internal error
963 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
964 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
965 * @see pkgmgrinfo_pkginfo_get_pkgid()
966 * @see pkgmgrinfo_pkginfo_is_removable()
968 static int get_pkg_author_email(const char *pkgid)
971 char *author_email = NULL;
972 pkgmgrinfo_pkginfo_h handle;
973 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
974 if (ret != PMINFO_R_OK)
976 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
977 if (ret != PMINFO_R_OK) {
978 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
981 printf("pkg author email: %s\n", author_email);
982 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
987 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
990 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
991 * @brief This API gets the package's author href from the package ID
993 * @par This API is for package-manager client application
994 * @par Sync (or) Async : Synchronous API
996 * @param[in] handle pointer to package info handle
997 * @param[out] author_href pointer to hold package author href
998 * @return 0 if success, error code(<0) if fail
999 * @retval PMINFO_R_OK success
1000 * @retval PMINFO_R_EINVAL invalid argument
1001 * @retval PMINFO_R_ERROR internal error
1002 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1003 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1004 * @see pkgmgrinfo_pkginfo_get_pkgid()
1005 * @see pkgmgrinfo_pkginfo_is_removable()
1007 static int get_pkg_author_href(const char *pkgid)
1010 char *author_href = NULL;
1011 pkgmgrinfo_pkginfo_h handle;
1012 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1013 if (ret != PMINFO_R_OK)
1015 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1016 if (ret != PMINFO_R_OK) {
1017 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1020 printf("pkg author href: %s\n", author_href);
1021 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1026 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1029 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1030 * @brief This API gets the package installed storagae value from the package ID
1032 * @par This API is for package-manager client application
1033 * @par Sync (or) Async : Synchronous API
1035 * @param[in] handle pointer to package info handle
1036 * @param[out] storage pointer to hold package installed storage
1037 * @return 0 if success, error code(<0) if fail
1038 * @retval PMINFO_R_OK success
1039 * @retval PMINFO_R_EINVAL invalid argument
1040 * @retval PMINFO_R_ERROR internal error
1041 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1042 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1043 * @see pkgmgrinfo_pkginfo_get_pkgid()
1044 * @see pkgmgrinfo_pkginfo_is_removable()
1046 static int get_pkg_installed_storage(const char *pkgid)
1049 pkgmgrinfo_installed_storage storage;
1050 pkgmgrinfo_pkginfo_h handle;
1051 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1052 if (ret != PMINFO_R_OK)
1054 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1055 if (ret != PMINFO_R_OK) {
1056 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1059 printf("pkg installed storage: %d\n", storage);
1060 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1065 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1068 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1069 * @brief This API gets the installed time of package from the package ID
1071 * @par This API is for package-manager client application
1072 * @par Sync (or) Async : Synchronous API
1074 * @param[in] handle pointer to package info handle
1075 * @param[out] installed_time pointer to hold installed time of package
1076 * @return 0 if success, error code(<0) if fail
1077 * @retval PMINFO_R_OK success
1078 * @retval PMINFO_R_EINVAL invalid argument
1079 * @retval PMINFO_R_ERROR internal error
1080 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1081 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1082 * @see pkgmgrinfo_pkginfo_get_pkgid()
1083 * @see pkgmgrinfo_pkginfo_is_removable()
1085 static int get_pkg_installed_time(const char *pkgid)
1088 int installed_time = 0;
1089 pkgmgrinfo_pkginfo_h handle;
1090 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1091 if (ret != PMINFO_R_OK)
1093 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1094 if (ret != PMINFO_R_OK) {
1095 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1098 printf("installed_time: %d\n", installed_time);
1099 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1104 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1107 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1108 * @brief This API gets the store client id of package from the package ID
1110 * @par This API is for package-manager client application
1111 * @par Sync (or) Async : Synchronous API
1113 * @param[in] handle pointer to package info handle
1114 * @param[out] storeclientid pointer to hold store client id of package
1115 * @return 0 if success, error code(<0) if fail
1116 * @retval PMINFO_R_OK success
1117 * @retval PMINFO_R_EINVAL invalid argument
1118 * @retval PMINFO_R_ERROR internal error
1119 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1120 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1121 * @see pkgmgrinfo_pkginfo_get_pkgid()
1122 * @see pkgmgrinfo_pkginfo_is_removable()
1124 static int get_pkg_storeclientid(const char *pkgid)
1127 char *storeclientid = 0;
1128 pkgmgrinfo_pkginfo_h handle;
1129 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1130 if (ret != PMINFO_R_OK)
1132 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1133 if (ret != PMINFO_R_OK) {
1134 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1137 printf(store client id: %s\n", storeclientid);
1138 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1143 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1146 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1147 * @brief This API gets the main app id of package from the package ID
1149 * @par This API is for package-manager client application
1150 * @par Sync (or) Async : Synchronous API
1152 * @param[in] handle pointer to package info handle
1153 * @param[out] mainappid pointer to hold main app id of package
1154 * @return 0 if success, error code(<0) if fail
1155 * @retval PMINFO_R_OK success
1156 * @retval PMINFO_R_EINVAL invalid argument
1157 * @retval PMINFO_R_ERROR internal error
1158 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1159 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1160 * @see pkgmgrinfo_pkginfo_get_pkgid()
1161 * @see pkgmgrinfo_pkginfo_is_removable()
1163 static int get_pkg_mainappid(const char *pkgid)
1166 char *mainappid = 0;
1167 pkgmgrinfo_pkginfo_h handle;
1168 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1169 if (ret != PMINFO_R_OK)
1171 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1172 if (ret != PMINFO_R_OK) {
1173 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1176 printf(main app id: %s\n", mainappid);
1177 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1182 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1185 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1186 * @brief This API gets the url of package from the package ID
1188 * @par This API is for package-manager client application
1189 * @par Sync (or) Async : Synchronous API
1191 * @param[in] handle pointer to package info handle
1192 * @param[out] url pointer to hold url of package
1193 * @return 0 if success, error code(<0) if fail
1194 * @retval PMINFO_R_OK success
1195 * @retval PMINFO_R_EINVAL invalid argument
1196 * @retval PMINFO_R_ERROR internal error
1197 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1198 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1199 * @see pkgmgrinfo_pkginfo_get_pkgid()
1200 * @see pkgmgrinfo_pkginfo_is_removable()
1202 static int get_pkg_url(const char *pkgid)
1206 pkgmgrinfo_pkginfo_h handle;
1207 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1208 if (ret != PMINFO_R_OK)
1210 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1211 if (ret != PMINFO_R_OK) {
1212 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1215 printf("url : %s\n", url);
1216 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1221 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1225 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1226 * @brief This API gets the root path of package
1228 * @par Sync (or) Async : Synchronous API
1230 * @param[in] handle pointer to package info handle
1231 * @param[out] path pointer to hold root path of package
1232 * @return 0 if success, error code(<0) if fail
1233 * @retval PMINFO_R_OK success
1234 * @retval PMINFO_R_EINVAL invalid argument
1235 * @retval PMINFO_R_ERROR internal error
1237 static int get_root_path(const char *pkgid)
1241 pkgmgrinfo_pkginfo_h handle;
1242 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1243 if (ret != PMINFO_R_OK)
1246 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1247 if (ret != PMINFO_R_OK) {
1248 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1251 printf("path : %s\n", path);
1252 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1258 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1261 * @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)
1262 * @brief This API compare the cert information from given package id
1264 * @par This API is for package-manager client application
1265 * @par Sync (or) Async : Synchronous API
1267 * @param[in] lhs_package_id pointer to first package ID
1268 * @param[in] rhs_package_id pointer to second package ID
1269 * @param[out] compare_result pointer to the compare result.
1270 * @return 0 if success, error code(<0) if fail
1271 * @retval PMINFO_R_OK success
1272 * @retval PMINFO_R_EINVAL invalid argument
1273 * @retval PMINFO_R_ERROR internal error
1275 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1276 * @see pkgmgrinfo_pkginfo_get_pkgid()
1277 * @see pkgmgrinfo_pkginfo_is_removable()
1279 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1282 pkgmgrinfo_cert_compare_result_type_e result;
1284 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1285 if (ret != PMINFO_R_OK) {
1288 printf("result: %d\n", result);
1293 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);
1296 * @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)
1297 * @brief This API compare the cert information from given app id
1299 * @par This API is for package-manager client application
1300 * @par Sync (or) Async : Synchronous API
1302 * @param[in] lhs_app_id pointer to first app ID
1303 * @param[in] rhs_app_id pointer to second app ID
1304 * @param[out] compare_result pointer to the compare result.
1305 * @return 0 if success, error code(<0) if fail
1306 * @retval PMINFO_R_OK success
1307 * @retval PMINFO_R_EINVAL invalid argument
1308 * @retval PMINFO_R_ERROR internal error
1310 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1311 * @see pkgmgrinfo_pkginfo_get_pkgid()
1312 * @see pkgmgrinfo_pkginfo_is_removable()
1314 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1317 pkgmgrinfo_cert_compare_result_type_e result;
1319 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1320 if (ret != PMINFO_R_OK) {
1323 printf("result: %d\n", result);
1328 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);
1331 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1332 * @brief This API gets the package 'removable' value from the package ID
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] handle pointer to package info handle
1338 * @param[out] removable pointer to hold package removable value
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1343 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1344 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1345 * @see pkgmgrinfo_pkginfo_get_pkgid()
1346 * @see pkgmgrinfo_pkginfo_is_readonly()
1348 static int get_pkg_removable(const char *pkgid)
1352 pkgmgrinfo_pkginfo_h handle;
1353 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1354 if (ret != PMINFO_R_OK)
1356 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1357 if (ret != PMINFO_R_OK) {
1358 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1361 printf("pkg removable: %d\n", removable);
1362 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1367 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1370 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1371 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1373 * @par This API is for package-manager client application
1374 * @par Sync (or) Async : Synchronous API
1376 * @param[in] handle pointer to package info handle
1377 * @param[out] movable pointer to hold package movable state
1378 * @return 0 if success, error code(<0) if fail
1379 * @retval PMINFO_R_OK success
1380 * @retval PMINFO_R_EINVAL invalid argument
1381 * @retval PMINFO_R_ERROR internal error
1382 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1383 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1384 * @see pkgmgrinfo_pkginfo_get_pkgid()
1386 static int get_pkg_movable(const char *pkgid)
1390 pkgmgrinfo_pkginfo_h handle;
1391 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1392 if (ret != PMINFO_R_OK)
1394 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1395 if (ret != PMINFO_R_OK) {
1396 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1399 printf("pkg movable: %d\n", movable);
1400 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1405 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1408 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1409 * @brief This API gets the package 'preload' value from the package ID
1411 * @par This API is for package-manager client application
1412 * @par Sync (or) Async : Synchronous API
1414 * @param[in] handle pointer to package info handle
1415 * @param[out] preload pointer to hold package preload value
1416 * @return 0 if success, error code(<0) if fail
1417 * @retval PMINFO_R_OK success
1418 * @retval PMINFO_R_EINVAL invalid argument
1419 * @retval PMINFO_R_ERROR internal error
1420 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1421 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1422 * @see pkgmgrinfo_pkginfo_get_pkgid()
1423 * @see pkgmgrinfo_pkginfo_is_readonly()
1425 static int get_pkg_preload(const char *pkgid)
1429 pkgmgrinfo_pkginfo_h handle;
1430 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1431 if (ret != PMINFO_R_OK)
1433 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1434 if (ret != PMINFO_R_OK) {
1435 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1438 printf("pkg preload: %d\n", preload);
1439 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1444 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1447 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1448 * @brief This API gets the package 'readonly' value from the package ID
1450 * @par This API is for package-manager client application
1451 * @par Sync (or) Async : Synchronous API
1453 * @param[in] handle pointer to package info handle
1454 * @param[out] readonly pointer to hold package readonly value
1455 * @return 0 if success, error code(<0) if fail
1456 * @retval PMINFO_R_OK success
1457 * @retval PMINFO_R_EINVAL invalid argument
1458 * @retval PMINFO_R_ERROR internal error
1459 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1460 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1461 * @see pkgmgrinfo_pkginfo_get_pkgid()
1462 * @see pkgmgrinfo_pkginfo_is_removable()
1464 static int get_pkg_readonly(const char *pkgid)
1468 pkgmgrinfo_pkginfo_h handle;
1469 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1470 if (ret != PMINFO_R_OK)
1472 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1473 if (ret != PMINFO_R_OK) {
1474 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1477 printf("pkg readonly: %d\n", readonly);
1478 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1483 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1487 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1488 * @brief This API gets the package 'upate' value from the package ID
1490 * @par This API is for package-manager client application
1491 * @par Sync (or) Async : Synchronous API
1493 * @param[in] handle pointer to package info handle
1494 * @param[out] update pointer to hold package update value
1495 * @return 0 if success, error code(<0) if fail
1496 * @retval PMINFO_R_OK success
1497 * @retval PMINFO_R_EINVAL invalid argument
1498 * @retval PMINFO_R_ERROR internal error
1499 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1500 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1501 * @see pkgmgrinfo_pkginfo_get_pkgid()
1503 static int get_pkg_update(const char *pkgid)
1507 pkgmgrinfo_pkginfo_h handle;
1508 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1509 if (ret != PMINFO_R_OK)
1511 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1512 if (ret != PMINFO_R_OK) {
1513 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1516 printf("pkg update: %d\n", update);
1517 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1522 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1525 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1526 * @brief This API gets the package 'accessible' value from the package ID
1528 * @par This API is for package-manager client application
1529 * @par Sync (or) Async : Synchronous API
1531 * @param[in] handle pointer to package info handle
1532 * @param[out] accessible pointer to hold package accessible value
1533 * @return 0 if success, error code(<0) if fail
1534 * @retval PMINFO_R_OK success
1535 * @retval PMINFO_R_EINVAL invalid argument
1536 * @retval PMINFO_R_ERROR internal error
1537 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1538 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1539 * @see pkgmgrinfo_pkginfo_get_pkgid()
1540 * @see pkgmgrinfo_pkginfo_is_readonly()
1542 static int get_pkg_accessible(const char *pkgid)
1546 pkgmgrinfo_pkginfo_h handle;
1547 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1548 if (ret != PMINFO_R_OK)
1550 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1551 if (ret != PMINFO_R_OK) {
1552 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1555 printf("pkg accessible: %d\n", accessible);
1556 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1561 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1564 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1565 * @brief This API destroys the package information handle freeing up all the resources
1567 * @par This API is for package-manager client application
1568 * @par Sync (or) Async : Synchronous API
1570 * @param[in] handle pointer to the package info handle
1571 * @return 0 if success, error code(<0) if fail
1572 * @retval PMINFO_R_OK success
1573 * @retval PMINFO_R_EINVAL invalid argument
1574 * @retval PMINFO_R_ERROR internal error
1575 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1577 * @see pkgmgrinfo_pkginfo_get_pkgid()
1578 * @see pkgmgrinfo_pkginfo_is_removable()
1580 static int get_pkg_type(const char *pkgid)
1584 pkgmgrinfo_pkginfo_h handle;
1585 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1586 if (ret != PMINFO_R_OK)
1588 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1589 if (ret != PMINFO_R_OK) {
1590 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1593 printf("pkgtype: %s\n", type);
1594 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1599 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1602 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1603 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1604 The query will search the entire package information collected from the manifest file of all the installed packages
1606 * @par This API is for package-manager client application
1607 * @par Sync (or) Async : Synchronous API
1609 * @param[out] handle pointer to the package info filter handle.
1610 * @return 0 if success, error code(<0) if fail
1611 * @retval PMINFO_R_OK success
1612 * @retval PMINFO_R_EINVAL invalid argument
1613 * @retval PMINFO_R_ERROR internal error
1615 * @post pkgmgrinfo_pkginfo_filter_destroy()
1616 * @see pkgmgrinfo_pkginfo_filter_count()
1617 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1619 static int get_rpm_pkg_count()
1623 pkgmgrinfo_pkginfo_filter_h handle;
1624 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1625 if (ret != PMINFO_R_OK)
1627 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1628 if (ret != PMINFO_R_OK) {
1629 pkgmgrinfo_pkginfo_filter_destroy(handle);
1632 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1633 if (ret != PMINFO_R_OK) {
1634 pkgmgrinfo_pkginfo_filter_destroy(handle);
1637 printf("No of rpm pkgs: %d\n", count);
1638 pkgmgrinfo_pkginfo_filter_destroy(handle);
1643 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1646 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1647 * @brief This API destroys the package information filter handle freeing up all the resources
1649 * @par This API is for package-manager client application
1650 * @par Sync (or) Async : Synchronous API
1652 * @param[in] handle pointer to the package info filter handle.
1653 * @return 0 if success, error code(<0) if fail
1654 * @retval PMINFO_R_OK success
1655 * @retval PMINFO_R_EINVAL invalid argument
1656 * @retval PMINFO_R_ERROR internal error
1657 * @pre pkgmgrinfo_pkginfo_filter_create()
1659 * @see pkgmgrinfo_pkginfo_filter_count()
1660 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1662 static int get_rpm_pkg_count()
1666 pkgmgrinfo_pkginfo_filter_h handle;
1667 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1668 if (ret != PMINFO_R_OK)
1670 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1671 if (ret != PMINFO_R_OK) {
1672 pkgmgrinfo_pkginfo_filter_destroy(handle);
1675 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1676 if (ret != PMINFO_R_OK) {
1677 pkgmgrinfo_pkginfo_filter_destroy(handle);
1680 printf("No of rpm pkgs: %d\n", count);
1681 pkgmgrinfo_pkginfo_filter_destroy(handle);
1686 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1689 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1690 * @brief This API adds a boolean filter property to the filter handle
1692 * @par This API is for package-manager client application
1693 * @par Sync (or) Async : Synchronous API
1695 * @param[in] handle pointer to the package info filter handle.
1696 * @param[in] property boolean property name.
1697 * @param[in] value value corresponding to the property.
1698 * @return 0 if success, error code(<0) if fail
1699 * @retval PMINFO_R_OK success
1700 * @retval PMINFO_R_EINVAL invalid argument
1701 * @retval PMINFO_R_ERROR internal error
1702 * @pre pkgmgrinfo_pkginfo_filter_create()
1703 * @post pkgmgrinfo_pkginfo_filter_destroy()
1704 * @see pkgmgrinfo_pkginfo_filter_count()
1705 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1707 static int get_preload_pkg_count()
1711 pkgmgrinfo_pkginfo_filter_h handle;
1712 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1713 if (ret != PMINFO_R_OK)
1715 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1716 if (ret != PMINFO_R_OK) {
1717 pkgmgrinfo_pkginfo_filter_destroy(handle);
1720 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1721 if (ret != PMINFO_R_OK) {
1722 pkgmgrinfo_pkginfo_filter_destroy(handle);
1725 printf("No of preload pkgs: %d\n", count);
1726 pkgmgrinfo_pkginfo_filter_destroy(handle);
1731 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1732 const char *property, const bool value);
1735 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1736 * @brief This API adds an integer filter property to the filter handle
1738 * @par This API is for package-manager client application
1739 * @par Sync (or) Async : Synchronous API
1741 * @param[in] handle pointer to the package info filter handle.
1742 * @param[in] property integer property name.
1743 * @param[in] value value corresponding to the property.
1744 * @return 0 if success, error code(<0) if fail
1745 * @retval PMINFO_R_OK success
1746 * @retval PMINFO_R_EINVAL invalid argument
1747 * @retval PMINFO_R_ERROR internal error
1748 * @pre pkgmgrinfo_pkginfo_filter_create()
1749 * @post pkgmgrinfo_pkginfo_filter_destroy()
1750 * @see pkgmgrinfo_pkginfo_filter_count()
1751 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1753 static int get_pkg_count()
1757 pkgmgrinfo_pkginfo_filter_h handle;
1758 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1759 if (ret != PMINFO_R_OK)
1761 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1762 if (ret != PMINFO_R_OK) {
1763 pkgmgrinfo_pkginfo_filter_destroy(handle);
1766 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1767 if (ret != PMINFO_R_OK) {
1768 pkgmgrinfo_pkginfo_filter_destroy(handle);
1771 printf("No of preload pkgs: %d\n", count);
1772 pkgmgrinfo_pkginfo_filter_destroy(handle);
1777 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1778 const char *property, const int value);
1781 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1782 * @brief This API adds a string filter property to the filter handle
1784 * @par This API is for package-manager client application
1785 * @par Sync (or) Async : Synchronous API
1787 * @param[in] handle pointer to the package info filter handle.
1788 * @param[in] property string property name.
1789 * @param[in] value value corresponding to the property.
1790 * @return 0 if success, error code(<0) if fail
1791 * @retval PMINFO_R_OK success
1792 * @retval PMINFO_R_EINVAL invalid argument
1793 * @retval PMINFO_R_ERROR internal error
1794 * @pre pkgmgrinfo_pkginfo_filter_create()
1795 * @post pkgmgrinfo_pkginfo_filter_destroy()
1796 * @see pkgmgrinfo_pkginfo_filter_count()
1797 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1799 static int get_rpm_pkg_count()
1803 pkgmgrinfo_pkginfo_filter_h handle;
1804 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1805 if (ret != PMINFO_R_OK)
1807 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1808 if (ret != PMINFO_R_OK) {
1809 pkgmgrinfo_pkginfo_filter_destroy(handle);
1812 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1813 if (ret != PMINFO_R_OK) {
1814 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 printf("No of rpm pkgs: %d\n", count);
1818 pkgmgrinfo_pkginfo_filter_destroy(handle);
1823 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1824 const char *property, const char *value);
1827 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1828 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1830 * @par This API is for package-manager client application
1831 * @par Sync (or) Async : Synchronous API
1833 * @param[in] handle pointer to the package info filter handle.
1834 * @param[in] pkg_cb callback function.
1835 * @param[in] user_data user data to be passed to the callback function
1836 * @return 0 if success, error code(<0) if fail
1837 * @retval PMINFO_R_OK success
1838 * @retval PMINFO_R_EINVAL invalid argument
1839 * @retval PMINFO_R_ERROR internal error
1840 * @pre pkgmgrinfo_pkginfo_filter_create()
1841 * @post pkgmgrinfo_pkginfo_filter_destroy()
1842 * @see pkgmgrinfo_pkginfo_filter_count()
1844 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1847 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1848 printf("pkg id : %s\n", pkgid);
1852 static int get_rpm_pkg_list()
1855 pkgmgrinfo_pkginfo_filter_h handle;
1856 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1857 if (ret != PMINFO_R_OK)
1859 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1860 if (ret != PMINFO_R_OK) {
1861 pkgmgrinfo_pkginfo_filter_destroy(handle);
1864 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1865 if (ret != PMINFO_R_OK) {
1866 pkgmgrinfo_pkginfo_filter_destroy(handle);
1869 pkgmgrinfo_pkginfo_filter_destroy(handle);
1874 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1875 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1878 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1879 * @brief This API counts the package that satisfy the filter conditions
1881 * @par This API is for package-manager client application
1882 * @par Sync (or) Async : Synchronous API
1884 * @param[in] handle pointer to the package info filter handle.
1885 * @param[in] count pointer to store the count value.
1886 * @return 0 if success, error code(<0) if fail
1887 * @retval PMINFO_R_OK success
1888 * @retval PMINFO_R_EINVAL invalid argument
1889 * @retval PMINFO_R_ERROR internal error
1890 * @pre pkgmgrinfo_pkginfo_filter_create()
1891 * @post pkgmgrinfo_pkginfo_filter_destroy()
1892 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1894 static int get_rpm_pkg_count()
1898 pkgmgrinfo_pkginfo_filter_h handle;
1899 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1900 if (ret != PMINFO_R_OK)
1902 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1903 if (ret != PMINFO_R_OK) {
1904 pkgmgrinfo_pkginfo_filter_destroy(handle);
1907 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1908 if (ret != PMINFO_R_OK) {
1909 pkgmgrinfo_pkginfo_filter_destroy(handle);
1912 printf("No of rpm pkgs: %d\n", count);
1913 pkgmgrinfo_pkginfo_filter_destroy(handle);
1918 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1921 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1922 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1923 * @brief This API gets the list of privilege for a particular package
1925 * @par This API is for package-manager client application
1926 * @par Sync (or) Async : Synchronous API
1927 * @param[in] handle pointer to the package info handle.
1928 * @param[in] privilege_func callback function for list
1929 * @param[in] user_data user data to be passed to callback function
1930 * @return 0 if success, error code(<0) if fail
1931 * @retval PMINFO_R_OK success
1932 * @retval PMINFO_R_EINVAL invalid argument
1933 * @retval PMINFO_R_ERROR internal error
1934 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1935 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1937 int privilege_func(const char *name, void *user_data)
1939 if (strcmp(name, (char *)user_data) == 0)
1945 static int list_privilege(const char *package, char *privilege)
1948 pkgmgrinfo_pkginfo_h handle;
1949 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1950 if (ret != PMINFO_R_OK)
1952 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1953 if (ret != PMINFO_R_OK) {
1954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1957 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1962 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1963 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1966 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1967 pkgmgrinfo_app_list_cb app_func, void *user_data)
1968 * @brief This API gets list of installed applications for a particular package
1970 * @par This API is for package-manager client application
1971 * @par Sync (or) Async : Synchronous API
1972 * @param[in] handle package info handle
1973 * @param[in] component application component
1974 * @param[in] app_func iteration function for list
1975 * @param[in] user_data user data to be passed to callback function
1976 * @return 0 if success, error code(<0) if fail
1977 * @retval PMINFO_R_OK success
1978 * @retval PMINFO_R_EINVAL invalid argument
1979 * @retval PMINFO_R_ERROR internal error
1980 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1981 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1983 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1986 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1987 printf("appid : %s\n", appid);
1991 static int list_apps(const char *pkgid)
1994 pkgmgrinfo_pkginfo_h handle;
1995 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1996 if (ret != PMINFO_R_OK)
1998 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1999 if (ret != PMINFO_R_OK) {
2000 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2003 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2008 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2009 pkgmgrinfo_app_list_cb app_func, void *user_data);
2012 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2013 * @brief This API gets list of installed applications from all packages.
2015 * @par This API is for package-manager client application
2016 * @par Sync (or) Async : Synchronous API
2017 * @param[in] app_func iteration function for list
2018 * @param[in] user_data user data to be passed to callback function
2019 * @return 0 if success, error code(<0) if fail
2020 * @retval PMINFO_R_OK success
2021 * @retval PMINFO_R_EINVAL invalid argument
2022 * @retval PMINFO_R_ERROR internal error
2026 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2028 char *pkgid1 = NULL;
2029 char *pkgid2 = NULL;
2030 pkgid1 = (char *)user_data;
2031 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2032 if (strcmp(pkgid1, pkgid2) == 0) {
2039 static int list_apps()
2042 char *name = "helloworld";
2043 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2044 if (ret != PMINFO_R_OK) {
2051 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2054 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2055 * @brief This API creates the application information handle from db
2057 * @par This API is for package-manager client application
2058 * @par Sync (or) Async : Synchronous API
2060 * @param[in] appid pointer to appid
2061 * @param[out] handle pointer to the application info handle.
2062 * @return 0 if success, error code(<0) if fail
2063 * @retval PMINFO_R_OK success
2064 * @retval PMINFO_R_EINVAL invalid argument
2065 * @retval PMINFO_R_ERROR internal error
2067 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2068 * @see pkgmgrinfo_appinfo_get_pkgid()
2069 * @see pkgmgrinfo_appinfo_is_multiple()
2071 static int get_app_type(const char *appid)
2075 pkgmgrinfo_appinfo_h handle;
2076 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2077 if (ret != PMINFO_R_OK)
2079 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2080 if (ret != PMINFO_R_OK) {
2081 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2084 printf("apptype: %s\n", type);
2085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2090 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2093 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2094 * @brief This API gets the application ID
2096 * @par This API is for package-manager client application
2097 * @par Sync (or) Async : Synchronous API
2099 * @param[in] handle pointer to the application info handle.
2100 * @param[out] appid pointer to hold appid
2101 * @return 0 if success, error code(<0) if fail
2102 * @retval PMINFO_R_OK success
2103 * @retval PMINFO_R_EINVAL invalid argument
2104 * @retval PMINFO_R_ERROR internal error
2105 * @pre pkgmgrinfo_appinfo_get_appinfo()
2106 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2107 * @see pkgmgrinfo_appinfo_get_pkgid()
2108 * @see pkgmgrinfo_appinfo_is_multiple()
2110 static int get_app_id(const char *appid)
2113 char *app_id = NULL;
2114 pkgmgrinfo_appinfo_h handle;
2115 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2116 if (ret != PMINFO_R_OK)
2118 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2119 if (ret != PMINFO_R_OK) {
2120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2123 printf("app id: %s\n", app_id);
2124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2129 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2132 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2133 * @brief This API gets the package name of the application
2135 * @par This API is for package-manager client application
2136 * @par Sync (or) Async : Synchronous API
2138 * @param[in] handle pointer to the application info handle.
2139 * @param[out] pkg_name pointer to hold package name
2140 * @return 0 if success, error code(<0) if fail
2141 * @retval PMINFO_R_OK success
2142 * @retval PMINFO_R_EINVAL invalid argument
2143 * @retval PMINFO_R_ERROR internal error
2144 * @pre pkgmgrinfo_appinfo_get_appinfo()
2145 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2146 * @see pkgmgrinfo_appinfo_get_appid()
2147 * @see pkgmgrinfo_appinfo_is_multiple()
2149 static int get_app_pkgname(const char *appid)
2152 char *pkgname = NULL;
2153 pkgmgrinfo_appinfo_h handle;
2154 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2155 if (ret != PMINFO_R_OK)
2157 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2158 if (ret != PMINFO_R_OK) {
2159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2162 printf("pkg name: %s\n", pkgname);
2163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2168 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2171 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2172 * @brief This API gets the package id of the application
2174 * @par This API is for package-manager client application
2175 * @par Sync (or) Async : Synchronous API
2177 * @param[in] handle pointer to the application info handle.
2178 * @param[out] pkgid pointer to hold package id
2179 * @return 0 if success, error code(<0) if fail
2180 * @retval PMINFO_R_OK success
2181 * @retval PMINFO_R_EINVAL invalid argument
2182 * @retval PMINFO_R_ERROR internal error
2183 * @pre pkgmgrinfo_appinfo_get_appinfo()
2184 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2185 * @see pkgmgrinfo_appinfo_get_appid()
2186 * @see pkgmgrinfo_appinfo_is_multiple()
2188 static int get_app_pkgid(const char *appid)
2192 pkgmgrinfo_appinfo_h handle;
2193 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2194 if (ret != PMINFO_R_OK)
2196 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2197 if (ret != PMINFO_R_OK) {
2198 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2201 printf("pkg id: %s\n", pkgid);
2202 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2207 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2210 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2211 * @brief This API gets the executable name of the application
2213 * @par This API is for package-manager client application
2214 * @par Sync (or) Async : Synchronous API
2216 * @param[in] handle pointer to the application info handle.
2217 * @param[out] exec pointer to hold app exec name
2218 * @return 0 if success, error code(<0) if fail
2219 * @retval PMINFO_R_OK success
2220 * @retval PMINFO_R_EINVAL invalid argument
2221 * @retval PMINFO_R_ERROR internal error
2222 * @pre pkgmgrinfo_appinfo_get_appinfo()
2223 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2224 * @see pkgmgrinfo_appinfo_get_appid()
2225 * @see pkgmgrinfo_appinfo_is_multiple()
2227 static int get_app_exec(const char *appid)
2231 pkgmgrinfo_appinfo_h handle;
2232 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2233 if (ret != PMINFO_R_OK)
2235 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2236 if (ret != PMINFO_R_OK) {
2237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2240 printf("exec name: %s\n", exec);
2241 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2246 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2249 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2250 * @brief This API gets the icon name of the application
2252 * @par This API is for package-manager client application
2253 * @par Sync (or) Async : Synchronous API
2255 * @param[in] handle pointer to the application info handle.
2256 * @param[out] icon pointer to hold app icon name
2257 * @return 0 if success, error code(<0) if fail
2258 * @retval PMINFO_R_OK success
2259 * @retval PMINFO_R_EINVAL invalid argument
2260 * @retval PMINFO_R_ERROR internal error
2261 * @pre pkgmgrinfo_appinfo_get_appinfo()
2262 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2263 * @see pkgmgrinfo_appinfo_get_appid()
2264 * @see pkgmgrinfo_appinfo_is_multiple()
2266 static int get_app_icon(const char *appid)
2270 pkgmgrinfo_appinfo_h handle;
2271 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2272 if (ret != PMINFO_R_OK)
2274 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2275 if (ret != PMINFO_R_OK) {
2276 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2279 printf("icon name: %s\n", icon);
2280 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2285 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2288 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2289 * @brief This API gets the label of the application
2291 * @par This API is for package-manager client application
2292 * @par Sync (or) Async : Synchronous API
2294 * @param[in] handle pointer to the application info handle.
2295 * @param[out] label pointer to hold app label
2296 * @return 0 if success, error code(<0) if fail
2297 * @retval PMINFO_R_OK success
2298 * @retval PMINFO_R_EINVAL invalid argument
2299 * @retval PMINFO_R_ERROR internal error
2300 * @pre pkgmgrinfo_appinfo_get_appinfo()
2301 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2302 * @see pkgmgrinfo_appinfo_get_appid()
2303 * @see pkgmgrinfo_appinfo_is_multiple()
2305 static int get_app_label(const char *appid)
2309 pkgmgrinfo_appinfo_h handle;
2310 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2311 if (ret != PMINFO_R_OK)
2313 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2314 if (ret != PMINFO_R_OK) {
2315 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2318 printf("label : %s\n", label);
2319 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2324 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2327 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2328 * @brief This API gets the component of the application
2330 * @par This API is for package-manager client application
2331 * @par Sync (or) Async : Synchronous API
2333 * @param[in] handle pointer to the application info handle.
2334 * @param[out] component pointer to hold app component
2335 * @return 0 if success, error code(<0) if fail
2336 * @retval PMINFO_R_OK success
2337 * @retval PMINFO_R_EINVAL invalid argument
2338 * @retval PMINFO_R_ERROR internal error
2339 * @pre pkgmgrinfo_appinfo_get_appinfo()
2340 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2341 * @see pkgmgrinfo_appinfo_get_appid()
2342 * @see pkgmgrinfo_appinfo_is_multiple()
2344 static int get_app_component(const char *appid)
2347 pkgmgrinfo_app_component component;
2348 pkgmgrinfo_appinfo_h handle;
2349 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2350 if (ret != PMINFO_R_OK)
2352 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2353 if (ret != PMINFO_R_OK) {
2354 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2357 printf("component : %s\n", component);
2358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2363 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2366 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2367 * @brief This API gets the apptype of the application
2369 * @par This API is for package-manager client application
2370 * @par Sync (or) Async : Synchronous API
2372 * @param[in] handle pointer to the application info handle.
2373 * @param[out] app_type pointer to hold apptype
2374 * @return 0 if success, error code(<0) if fail
2375 * @retval PMINFO_R_OK success
2376 * @retval PMINFO_R_EINVAL invalid argument
2377 * @retval PMINFO_R_ERROR internal error
2378 * @pre pkgmgrinfo_appinfo_get_appinfo()
2379 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2380 * @see pkgmgrinfo_appinfo_get_appid()
2381 * @see pkgmgrinfo_appinfo_is_multiple()
2383 static int get_app_type(const char *appid)
2386 char *apptype = NULL;
2387 pkgmgrinfo_appinfo_h handle;
2388 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2389 if (ret != PMINFO_R_OK)
2391 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2392 if (ret != PMINFO_R_OK) {
2393 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2396 printf("apptype : %s\n", apptype);
2397 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2402 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2405 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2406 int *operation_count, char ***operation)
2407 * @brief This API gets the list of operation of the application
2409 * @par This API is for package-manager client application
2410 * @par Sync (or) Async : Synchronous API
2412 * @param[in] handle pointer to the appcontrol handle.
2413 * @param[out] operation_count pointer to hold number of operations
2414 * @param[out] operation pointer to hold list of operations
2415 * @return 0 if success, error code(<0) if fail
2416 * @retval PMINFO_R_OK success
2417 * @retval PMINFO_R_EINVAL invalid argument
2418 * @retval PMINFO_R_ERROR internal error
2419 * @pre pkgmgrinfo_appinfo_get_appinfo()
2420 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2421 * @see pkgmgrinfo_appinfo_get_uri()
2422 * @see pkgmgrinfo_appinfo_get_mime()
2424 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2429 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2430 for (i = 0; i < oc; i++) {
2431 if (strcmp(operation[i], (char *)user_data) == 0)
2438 static int check_operation(const char *appid, char *operation)
2441 pkgmgrinfo_appinfo_h handle;
2442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2443 if (ret != PMINFO_R_OK)
2445 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2446 if (ret != PMINFO_R_OK) {
2447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2450 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2455 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2456 int *operation_count, char ***operation);
2459 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2460 int *uri_count, char ***uri)
2461 * @brief This API gets the list of uri of the application
2463 * @par This API is for package-manager client application
2464 * @par Sync (or) Async : Synchronous API
2466 * @param[in] handle pointer to the appcontrol handle.
2467 * @param[out] uri_count pointer to hold number of uris
2468 * @param[out] uri pointer to hold list of uris
2469 * @return 0 if success, error code(<0) if fail
2470 * @retval PMINFO_R_OK success
2471 * @retval PMINFO_R_EINVAL invalid argument
2472 * @retval PMINFO_R_ERROR internal error
2473 * @pre pkgmgrinfo_appinfo_get_appinfo()
2474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2475 * @see pkgmgrinfo_appinfo_get_operation()
2476 * @see pkgmgrinfo_appinfo_get_mime()
2478 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2483 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2484 for (i = 0; i < uc; i++) {
2485 if (strcmp(uri[i], (char *)user_data) == 0)
2492 static int check_uri(const char *appid, char *uri)
2495 pkgmgrinfo_appinfo_h handle;
2496 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2497 if (ret != PMINFO_R_OK)
2499 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2500 if (ret != PMINFO_R_OK) {
2501 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2509 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2510 int *uri_count, char ***uri);
2513 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2514 int *mime_count, char ***mime)
2515 * @brief This API gets the list of mime of the application
2517 * @par This API is for package-manager client application
2518 * @par Sync (or) Async : Synchronous API
2520 * @param[in] handle pointer to the appcontrol handle.
2521 * @param[out] mime_count pointer to hold number of mimes
2522 * @param[out] mime pointer to hold list of mimes
2523 * @return 0 if success, error code(<0) if fail
2524 * @retval PMINFO_R_OK success
2525 * @retval PMINFO_R_EINVAL invalid argument
2526 * @retval PMINFO_R_ERROR internal error
2527 * @pre pkgmgrinfo_appinfo_get_appinfo()
2528 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2529 * @see pkgmgrinfo_appinfo_get_uri()
2530 * @see pkgmgrinfo_appinfo_get_operation()
2532 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2537 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2538 for (i = 0; i < mc; i++) {
2539 if (strcmp(mime[i], (char *)user_data) == 0)
2546 static int check_mime(const char *appid, char *mime)
2549 pkgmgrinfo_appinfo_h handle;
2550 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2551 if (ret != PMINFO_R_OK)
2553 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2554 if (ret != PMINFO_R_OK) {
2555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2558 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2563 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2564 int *mime_count, char ***mime);
2567 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2568 * @brief This API gets the notification icon of the application
2570 * @par This API is for package-manager client application
2571 * @par Sync (or) Async : Synchronous API
2573 * @param[in] handle pointer to the application info handle.
2574 * @param[out] path pointer to hold notification icon
2575 * @return 0 if success, error code(<0) if fail
2576 * @retval PMINFO_R_OK success
2577 * @retval PMINFO_R_EINVAL invalid argument
2578 * @retval PMINFO_R_ERROR internal error
2579 * @pre pkgmgrinfo_appinfo_get_appinfo()
2580 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2581 * @see pkgmgrinfo_appinfo_get_appid()
2582 * @see pkgmgrinfo_appinfo_is_multiple()
2584 static int get_app_notification_icon(const char *appid)
2587 char *notification_icon = NULL;
2588 pkgmgrinfo_appinfo_h handle;
2589 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2590 if (ret != PMINFO_R_OK)
2592 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2593 if (ret != PMINFO_R_OK) {
2594 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2597 printf("notification icon : %s\n", notification_icon);
2598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2603 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2606 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2607 * @brief This API gets the setting icon of the application
2609 * @par This API is for package-manager client application
2610 * @par Sync (or) Async : Synchronous API
2612 * @param[in] handle pointer to the application info handle.
2613 * @param[out] path pointer to hold setting icon
2614 * @return 0 if success, error code(<0) if fail
2615 * @retval PMINFO_R_OK success
2616 * @retval PMINFO_R_EINVAL invalid argument
2617 * @retval PMINFO_R_ERROR internal error
2618 * @pre pkgmgrinfo_appinfo_get_appinfo()
2619 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2620 * @see pkgmgrinfo_appinfo_get_appid()
2621 * @see pkgmgrinfo_appinfo_is_multiple()
2623 static int get_app_setting_icon(const char *appid)
2626 char *setting_icon = NULL;
2627 pkgmgrinfo_appinfo_h handle;
2628 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2629 if (ret != PMINFO_R_OK)
2631 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2632 if (ret != PMINFO_R_OK) {
2633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2636 printf("setting icon : %s\n", setting_icon);
2637 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2642 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2645 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2646 * @brief This API gets the type of recent image on app-tray
2648 * @par This API is for package-manager client application
2649 * @par Sync (or) Async : Synchronous API
2651 * @param[in] handle pointer to the application info handle.
2652 * @param[out] type pointer to hold image type
2653 * @return 0 if success, error code(<0) if fail
2654 * @retval PMINFO_R_OK success
2655 * @retval PMINFO_R_EINVAL invalid argument
2656 * @retval PMINFO_R_ERROR internal error
2657 * @pre pkgmgrinfo_appinfo_get_appinfo()
2658 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2659 * @see pkgmgrinfo_appinfo_get_appid()
2660 * @see pkgmgrinfo_appinfo_is_multiple()
2662 static int get_app_recent_image_type(const char *appid)
2665 pkgmgrinfo_app_recentimage type;
2666 pkgmgrinfo_appinfo_h handle;
2667 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2668 if (ret != PMINFO_R_OK)
2670 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2671 if (ret != PMINFO_R_OK) {
2672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2675 printf("recent image type: %d\n", type);
2676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2681 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2685 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2686 * @brief This API gets the preview image of application
2688 * @par Sync (or) Async : Synchronous API
2690 * @param[in] handle pointer to the application info handle.
2691 * @param[out] preview_img pointer to hold preview image path
2692 * @return 0 if success, error code(<0) if fail
2693 * @retval PMINFO_R_OK success
2694 * @retval PMINFO_R_EINVAL invalid argument
2695 * @retval PMINFO_R_ERROR internal error
2696 * @pre pkgmgrinfo_appinfo_get_appinfo()
2697 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2698 * @see pkgmgrinfo_appinfo_get_appid()
2700 static int get_app_previewimage(const char *appid)
2703 char *preview = NULL;
2704 pkgmgrinfo_appinfo_h handle = NULL;
2705 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2706 if (ret != PMINFO_R_OK)
2708 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2709 if (ret != PMINFO_R_OK) {
2710 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2713 printf("preview image path : %s\n", preview);
2714 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2719 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2723 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2724 * @brief This API gets the package permission type of the application
2726 * @par This API is for package-manager client application
2727 * @par Sync (or) Async : Synchronous API
2729 * @param[in] handle pointer to the application info handle.
2730 * @param[out] permission pointer to hold package permission
2731 * @return 0 if success, error code(<0) if fail
2732 * @retval PMINFO_R_OK success
2733 * @retval PMINFO_R_EINVAL invalid argument
2734 * @retval PMINFO_R_ERROR internal error
2735 * @pre pkgmgrinfo_appinfo_get_appinfo()
2736 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2737 * @see pkgmgrinfo_appinfo_get_appid()
2739 static int get_app_permission(const char *appid)
2742 pkgmgrinfo_permission_type permission = 0;
2743 pkgmgrinfo_appinfo_h handle;
2745 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2746 if (ret != PMINFO_R_OK)
2748 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2749 if (ret != PMINFO_R_OK) {
2750 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2753 printf("permission type: %d\n", permission);
2754 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2759 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2762 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2763 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2764 * @brief This API gets the list of category for a particular application
2766 * @par This API is for package-manager client application
2767 * @par Sync (or) Async : Synchronous API
2768 * @param[in] handle pointer to the application info handle.
2769 * @param[in] category_func callback function for list
2770 * @param[in] user_data user data to be passed to callback function
2771 * @return 0 if success, error code(<0) if fail
2772 * @retval PMINFO_R_OK success
2773 * @retval PMINFO_R_EINVAL invalid argument
2774 * @retval PMINFO_R_ERROR internal error
2775 * @pre pkgmgrinfo_appinfo_get_appinfo()
2776 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2778 int category_func(const char *name, void *user_data)
2780 if (strcmp(name, (char *)user_data) == 0)
2786 static int list_category(const char *appid, char *category)
2789 pkgmgrinfo_appinfo_h handle;
2790 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2791 if (ret != PMINFO_R_OK)
2793 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2794 if (ret != PMINFO_R_OK) {
2795 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2798 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2803 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2804 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2807 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2808 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2809 * @brief This API gets the list of metadata for a particular application
2811 * @par This API is for package-manager client application
2812 * @par Sync (or) Async : Synchronous API
2813 * @param[in] handle pointer to the application info handle.
2814 * @param[in] metadata_func callback function for list
2815 * @param[in] user_data user data to be passed to callback function
2816 * @return 0 if success, error code(<0) if fail
2817 * @retval PMINFO_R_OK success
2818 * @retval PMINFO_R_EINVAL invalid argument
2819 * @retval PMINFO_R_ERROR internal error
2820 * @pre pkgmgrinfo_appinfo_get_appinfo()
2821 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2823 int metadata_func(const char *key, const char *value, void *user_data)
2825 if (strcmp(key, (char *)user_data) == 0) {
2826 printf("Value is %s\n", value);
2833 static int list_metadata(const char *appid, char *key)
2836 pkgmgrinfo_appinfo_h handle;
2837 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2838 if (ret != PMINFO_R_OK)
2840 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
2841 if (ret != PMINFO_R_OK) {
2842 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2845 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2850 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2851 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2855 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2856 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2857 * @brief This API gets the list of app-control for a particular application
2859 * @par This API is for package-manager client application
2860 * @par Sync (or) Async : Synchronous API
2861 * @param[in] handle pointer to the application info handle.
2862 * @param[in] appcontrol_func callback function for list
2863 * @param[in] user_data user data to be passed to callback function
2864 * @return 0 if success, error code(<0) if fail
2865 * @retval PMINFO_R_OK success
2866 * @retval PMINFO_R_EINVAL invalid argument
2867 * @retval PMINFO_R_ERROR internal error
2868 * @pre pkgmgrinfo_appinfo_get_appinfo()
2869 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2871 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2876 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2877 for (i = 0; i < oc; i++) {
2878 if (strcmp(operation[i], (char *)user_data) == 0)
2885 static int check_operation(const char *appid, char *operation)
2888 pkgmgrinfo_appinfo_h handle;
2889 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2890 if (ret != PMINFO_R_OK)
2892 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2893 if (ret != PMINFO_R_OK) {
2894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2897 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2902 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2903 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2906 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2907 * @brief This API gets the application 'nodisplay' value from the app ID
2909 * @par This API is for package-manager client application
2910 * @par Sync (or) Async : Synchronous API
2912 * @param[in] handle pointer to application info handle
2913 * @param[out] nodisplay pointer to hold package nodisplay value
2914 * @return 0 if success, error code(<0) if fail
2915 * @retval PMINFO_R_OK success
2916 * @retval PMINFO_R_EINVAL invalid argument
2917 * @retval PMINFO_R_ERROR internal error
2918 * @pre pkgmgrinfo_appinfo_get_appinfo()
2919 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2920 * @see pkgmgrinfo_appinfo_get_appid()
2921 * @see pkgmgrinfo_appinfo_is_multiple()
2923 static int get_app_nodisplay(const char *appid)
2927 pkgmgrinfo_appinfo_h handle;
2928 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2929 if (ret != PMINFO_R_OK)
2931 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2932 if (ret != PMINFO_R_OK) {
2933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2936 printf("app nodisplay: %d\n", nodisplay);
2937 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2942 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2945 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2946 * @brief This API gets the application 'multiple' value from the app ID
2948 * @par This API is for package-manager client application
2949 * @par Sync (or) Async : Synchronous API
2951 * @param[in] handle pointer to application info handle
2952 * @param[out] multiple pointer to hold package multiple value
2953 * @return 0 if success, error code(<0) if fail
2954 * @retval PMINFO_R_OK success
2955 * @retval PMINFO_R_EINVAL invalid argument
2956 * @retval PMINFO_R_ERROR internal error
2957 * @pre pkgmgrinfo_appinfo_get_appinfo()
2958 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2959 * @see pkgmgrinfo_appinfo_get_appid()
2960 * @see pkgmgrinfo_appinfo_is_nodisplay()
2962 static int get_app_multiple(const char *appid)
2966 pkgmgrinfo_appinfo_h handle;
2967 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2968 if (ret != PMINFO_R_OK)
2970 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2971 if (ret != PMINFO_R_OK) {
2972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2975 printf("app multiple: %d\n", multiple);
2976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2981 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2984 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
2985 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
2986 * application launching effect. If fales, indicator will be hidden during application launching effect
2988 * @par This API is for package-manager client application
2989 * @par Sync (or) Async : Synchronous API
2991 * @param[in] handle pointer to application info handle
2992 * @param[out] indicator_disp contains indicator display status for application launching effect
2993 * @return 0 if success, error code(<0) if fail
2994 * @retval PMINFO_R_OK success
2995 * @retval PMINFO_R_EINVAL invalid argument
2996 * @retval PMINFO_R_ERROR internal error
2997 * @pre pkgmgrinfo_appinfo_get_appinfo()
2998 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2999 * @see pkgmgrinfo_appinfo_get_appid()
3000 * @see pkgmgrinfo_appinfo_is_nodisplay()
3002 static int get_app_indicator_display(const char *appid)
3005 bool indicator_disp;
3006 pkgmgrinfo_appinfo_h handle;
3007 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3008 if (ret != PMINFO_R_OK)
3010 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3011 if (ret != PMINFO_R_OK){
3012 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3015 printf("app indicator disp : %d\n", indicator_disp);
3016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3021 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3024 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3025 * @brief This API gets the application's landscape & portrait effect images
3027 * @par This API is for package-manager client application
3028 * @par Sync (or) Async : Synchronous API
3030 * @param[in] handle pointer to application info handle
3031 * @param[out] portrait_img contains portrait mode effect image
3032 * @param[out] landscape_img contains landscape mode effect image
3033 * @return 0 if success, error code(<0) if fail
3034 * @retval PMINFO_R_OK success
3035 * @retval PMINFO_R_EINVAL invalid argument
3036 * @retval PMINFO_R_ERROR internal error
3037 * @pre pkgmgrinfo_appinfo_get_appinfo()
3038 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3039 * @see pkgmgrinfo_appinfo_get_appid()
3040 * @see pkgmgrinfo_appinfo_is_nodisplay()
3042 static int get_app_effectimages(const char *appid)
3045 char *portraitimg = NULL;
3046 char *landscapeimg = NULL;
3047 pkgmgrinfo_appinfo_h handle;
3048 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3049 if (ret != PMINFO_R_OK)
3051 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3052 if (ret != PMINFO_R_OK) {
3053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3056 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3062 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3065 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3066 * @brief This API gets the application 'taskmanage' value from the app ID
3068 * @par This API is for package-manager client application
3069 * @par Sync (or) Async : Synchronous API
3071 * @param[in] handle pointer to application info handle
3072 * @param[out] taskmanage pointer to hold package taskmanage value
3073 * @return 0 if success, error code(<0) if fail
3074 * @retval PMINFO_R_OK success
3075 * @retval PMINFO_R_EINVAL invalid argument
3076 * @retval PMINFO_R_ERROR internal error
3077 * @pre pkgmgrinfo_appinfo_get_appinfo()
3078 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3079 * @see pkgmgrinfo_appinfo_get_appid()
3080 * @see pkgmgrinfo_appinfo_is_multiple()
3082 static int get_app_taskmanage(const char *appid)
3086 pkgmgrinfo_appinfo_h handle;
3087 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3088 if (ret != PMINFO_R_OK)
3090 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3091 if (ret != PMINFO_R_OK) {
3092 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3095 printf("app taskmanage: %d\n", taskmanage);
3096 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3101 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3104 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3105 * @brief This API gets the application 'taskmanage' value from the app ID
3107 * @par This API is for package-manager client application
3108 * @par Sync (or) Async : Synchronous API
3110 * @param[in] handle pointer to application info handle
3111 * @param[out] enabled pointer to hold package enabled value
3112 * @return 0 if success, error code(<0) if fail
3113 * @retval PMINFO_R_OK success
3114 * @retval PMINFO_R_EINVAL invalid argument
3115 * @retval PMINFO_R_ERROR internal error
3116 * @pre pkgmgrinfo_appinfo_get_appinfo()
3117 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3118 * @see pkgmgrinfo_appinfo_get_appid()
3119 * @see pkgmgrinfo_appinfo_is_multiple()
3121 static int get_app_enabled(const char *appid)
3125 pkgmgrinfo_appinfo_h handle;
3126 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3127 if (ret != PMINFO_R_OK)
3129 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3130 if (ret != PMINFO_R_OK) {
3131 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3134 printf("app enabled: %d\n", enabled);
3135 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3140 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3143 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3144 * @brief This API gets the application 'hwacceleration' value from the app ID
3146 * @par This API is for package-manager client application
3147 * @par Sync (or) Async : Synchronous API
3149 * @param[in] handle pointer to application info handle
3150 * @param[out] hwacceleration pointer to hold package hwacceleration value
3151 * @return 0 if success, error code(<0) if fail
3152 * @retval PMINFO_R_OK success
3153 * @retval PMINFO_R_EINVAL invalid argument
3154 * @retval PMINFO_R_ERROR internal error
3155 * @pre pkgmgrinfo_appinfo_get_appinfo()
3156 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3157 * @see pkgmgrinfo_appinfo_get_appid()
3158 * @see pkgmgrinfo_appinfo_is_multiple()
3160 static int get_app_hwacceleration(const char *appid)
3163 pkgmgrinfo_app_hwacceleration hwacceleration;
3164 pkgmgrinfo_appinfo_h handle;
3165 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3166 if (ret != PMINFO_R_OK)
3168 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3169 if (ret != PMINFO_R_OK) {
3170 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3173 printf("app hwacceleration: %d\n", hwacceleration);
3174 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3179 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3182 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3183 * @brief This API gets the application 'onboot' value from the app ID
3185 * @par This API is for package-manager client application
3186 * @par Sync (or) Async : Synchronous API
3188 * @param[in] handle pointer to application info handle
3189 * @param[out] onboot pointer to hold package onboot value
3190 * @return 0 if success, error code(<0) if fail
3191 * @retval PMINFO_R_OK success
3192 * @retval PMINFO_R_EINVAL invalid argument
3193 * @retval PMINFO_R_ERROR internal error
3194 * @pre pkgmgrinfo_appinfo_get_appinfo()
3195 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3196 * @see pkgmgrinfo_appinfo_get_appid()
3197 * @see pkgmgrinfo_appinfo_is_multiple()
3199 static int get_app_onboot(const char *appid)
3203 pkgmgrinfo_appinfo_h handle;
3204 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3205 if (ret != PMINFO_R_OK)
3207 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3208 if (ret != PMINFO_R_OK) {
3209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3212 printf("app onboot: %d\n", onboot);
3213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3218 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3221 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3222 * @brief This API gets the application 'autorestart' value from the app ID
3224 * @par This API is for package-manager client application
3225 * @par Sync (or) Async : Synchronous API
3227 * @param[in] handle pointer to application info handle
3228 * @param[out] autorestart pointer to hold package autorestart value
3229 * @return 0 if success, error code(<0) if fail
3230 * @retval PMINFO_R_OK success
3231 * @retval PMINFO_R_EINVAL invalid argument
3232 * @retval PMINFO_R_ERROR internal error
3233 * @pre pkgmgrinfo_appinfo_get_appinfo()
3234 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3235 * @see pkgmgrinfo_appinfo_get_appid()
3236 * @see pkgmgrinfo_appinfo_is_multiple()
3238 static int get_app_autorestart(const char *appid)
3242 pkgmgrinfo_appinfo_h handle;
3243 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3244 if (ret != PMINFO_R_OK)
3246 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3247 if (ret != PMINFO_R_OK) {
3248 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3251 printf("app autorestart: %d\n", autorestart);
3252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3257 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3260 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3261 * @brief This API gets the value for given application is main app or not from handle
3263 * @par This API is for package-manager client application
3264 * @par Sync (or) Async : Synchronous API
3266 * @param[in] handle pointer to application info handle
3267 * @param[out] mainapp pointer to hold package mainapp is or not
3268 * @return 0 if success, error code(<0) if fail
3269 * @retval PMINFO_R_OK success
3270 * @retval PMINFO_R_EINVAL invalid argument
3271 * @retval PMINFO_R_ERROR internal error
3272 * @pre pkgmgrinfo_appinfo_get_appinfo()
3273 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3274 * @see pkgmgrinfo_appinfo_get_appid()
3275 * @see pkgmgrinfo_appinfo_is_multiple()
3277 static int get_app_mainapp(const char *appid)
3281 pkgmgrinfo_appinfo_h handle;
3282 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3283 if (ret != PMINFO_R_OK)
3285 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3286 if (ret != PMINFO_R_OK) {
3287 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3290 printf("mainapp: %d\n", mainapp);
3291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3296 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3299 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3300 * @brief This API destroys the application information handle freeing up all the resources
3302 * @par This API is for package-manager client application
3303 * @par Sync (or) Async : Synchronous API
3305 * @param[in] handle pointer to the application info handle.
3306 * @return 0 if success, error code(<0) if fail
3307 * @retval PMINFO_R_OK success
3308 * @retval PMINFO_R_EINVAL invalid argument
3309 * @retval PMINFO_R_ERROR internal error
3310 * @pre pkgmgrinfo_appinfo_get_appinfo()
3312 * @see pkgmgrinfo_appinfo_get_pkgid()
3313 * @see pkgmgrinfo_appinfo_is_multiple()
3315 static int get_app_type(const char *appid)
3319 pkgmgrinfo_appinfo_h handle;
3320 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3321 if (ret != PMINFO_R_OK)
3323 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3324 if (ret != PMINFO_R_OK) {
3325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3328 printf("apptype: %s\n", type);
3329 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3334 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3337 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3338 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3339 The query will search the entire application information collected from the manifest file of all the installed packages
3341 * @par This API is for package-manager client application
3342 * @par Sync (or) Async : Synchronous API
3344 * @param[out] handle pointer to the application info filter handle.
3345 * @return 0 if success, error code(<0) if fail
3346 * @retval PMINFO_R_OK success
3347 * @retval PMINFO_R_EINVAL invalid argument
3348 * @retval PMINFO_R_ERROR internal error
3350 * @post pkgmgrinfo_appinfo_filter_destroy()
3351 * @see pkgmgrinfo_appinfo_filter_count()
3352 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3354 static int get_capp_count()
3358 pkgmgrinfo_appinfo_filter_h handle;
3359 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3360 if (ret != PMINFO_R_OK)
3362 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3363 if (ret != PMINFO_R_OK) {
3364 pkgmgrinfo_appinfo_filter_destroy(handle);
3367 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3368 if (ret != PMINFO_R_OK) {
3369 pkgmgrinfo_appinfo_filter_destroy(handle);
3372 printf("No of capp: %d\n", count);
3373 pkgmgrinfo_appinfo_filter_destroy(handle);
3378 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3381 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3382 * @brief This API destroys the application information filter handle freeing up all the resources
3384 * @par This API is for package-manager client application
3385 * @par Sync (or) Async : Synchronous API
3387 * @param[in] handle pointer to the application info filter handle.
3388 * @return 0 if success, error code(<0) if fail
3389 * @retval PMINFO_R_OK success
3390 * @retval PMINFO_R_EINVAL invalid argument
3391 * @retval PMINFO_R_ERROR internal error
3392 * @pre pkgmgrinfo_appinfo_filter_create()
3394 * @see pkgmgrinfo_appinfo_filter_count()
3395 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3397 static int get_capp_count()
3401 pkgmgrinfo_appinfo_filter_h handle;
3402 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3403 if (ret != PMINFO_R_OK)
3405 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3406 if (ret != PMINFO_R_OK) {
3407 pkgmgrinfo_appinfo_filter_destroy(handle);
3410 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3411 if (ret != PMINFO_R_OK) {
3412 pkgmgrinfo_appinfo_filter_destroy(handle);
3415 printf("No of capp: %d\n", count);
3416 pkgmgrinfo_appinfo_filter_destroy(handle);
3421 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3424 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3425 * @brief This API adds a boolean filter property to the filter handle
3427 * @par This API is for package-manager client application
3428 * @par Sync (or) Async : Synchronous API
3430 * @param[in] handle pointer to the application info filter handle.
3431 * @param[in] property boolean property name.
3432 * @param[in] value value corresponding to the property.
3433 * @return 0 if success, error code(<0) if fail
3434 * @retval PMINFO_R_OK success
3435 * @retval PMINFO_R_EINVAL invalid argument
3436 * @retval PMINFO_R_ERROR internal error
3437 * @pre pkgmgrinfo_appinfo_filter_create()
3438 * @post pkgmgrinfo_appinfo_filter_destroy()
3439 * @see pkgmgrinfo_appinfo_filter_count()
3440 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3442 static int get_taskmanageable_app_count()
3446 pkgmgrinfo_appinfo_filter_h handle;
3447 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3448 if (ret != PMINFO_R_OK)
3450 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3451 if (ret != PMINFO_R_OK) {
3452 pkgmgrinfo_appinfo_filter_destroy(handle);
3455 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3456 if (ret != PMINFO_R_OK) {
3457 pkgmgrinfo_appinfo_filter_destroy(handle);
3460 printf("No of taskmanageable apps: %d\n", count);
3461 pkgmgrinfo_appinfo_filter_destroy(handle);
3466 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3467 const char *property, const bool value);
3470 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3471 * @brief This API adds an integer filter property to the filter handle
3473 * @par This API is for package-manager client application
3474 * @par Sync (or) Async : Synchronous API
3476 * @param[in] handle pointer to the application info filter handle.
3477 * @param[in] property integer property name.
3478 * @param[in] value value corresponding to the property.
3479 * @return 0 if success, error code(<0) if fail
3480 * @retval PMINFO_R_OK success
3481 * @retval PMINFO_R_EINVAL invalid argument
3482 * @retval PMINFO_R_ERROR internal error
3483 * @pre pkgmgrinfo_appinfo_filter_create()
3484 * @post pkgmgrinfo_appinfo_filter_destroy()
3485 * @see pkgmgrinfo_appinfo_filter_count()
3486 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3488 static int get_taskmanageable_app_count()
3492 pkgmgrinfo_appinfo_filter_h handle;
3493 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3494 if (ret != PMINFO_R_OK)
3496 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3497 if (ret != PMINFO_R_OK) {
3498 pkgmgrinfo_appinfo_filter_destroy(handle);
3501 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3502 if (ret != PMINFO_R_OK) {
3503 pkgmgrinfo_appinfo_filter_destroy(handle);
3506 printf("No of apps: %d\n", count);
3507 pkgmgrinfo_appinfo_filter_destroy(handle);
3512 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3513 const char *property, const int value);
3516 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3517 * @brief This API adds a string filter property to the filter handle
3519 * @par This API is for package-manager client application
3520 * @par Sync (or) Async : Synchronous API
3522 * @param[in] handle pointer to the application info filter handle.
3523 * @param[in] property string property name.
3524 * @param[in] value value corresponding to the property.
3525 * @return 0 if success, error code(<0) if fail
3526 * @retval PMINFO_R_OK success
3527 * @retval PMINFO_R_EINVAL invalid argument
3528 * @retval PMINFO_R_ERROR internal error
3529 * @pre pkgmgrinfo_appinfo_filter_create()
3530 * @post pkgmgrinfo_appinfo_filter_destroy()
3531 * @see pkgmgrinfo_appinfo_filter_count()
3532 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3534 static int get_capp_count()
3538 pkgmgrinfo_appinfo_filter_h handle;
3539 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3540 if (ret != PMINFO_R_OK)
3542 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3543 if (ret != PMINFO_R_OK) {
3544 pkgmgrinfo_appinfo_filter_destroy(handle);
3547 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3548 if (ret != PMINFO_R_OK) {
3549 pkgmgrinfo_appinfo_filter_destroy(handle);
3552 printf("No of capp: %d\n", count);
3553 pkgmgrinfo_appinfo_filter_destroy(handle);
3558 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3559 const char *property, const char *value);
3562 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3563 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3565 * @par This API is for package-manager client application
3566 * @par Sync (or) Async : Synchronous API
3568 * @param[in] handle pointer to the application info filter handle.
3569 * @param[in] app_cb callback function.
3570 * @param[in] user_data user data to be passed to the callback function
3571 * @return 0 if success, error code(<0) if fail
3572 * @retval PMINFO_R_OK success
3573 * @retval PMINFO_R_EINVAL invalid argument
3574 * @retval PMINFO_R_ERROR internal error
3575 * @pre pkgmgrinfo_appinfo_filter_create()
3576 * @post pkgmgrinfo_appinfo_filter_destroy()
3577 * @see pkgmgrinfo_appinfo_filter_count()
3579 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3582 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3583 printf("appid : %s\n", appid);
3587 static int get_capp_list()
3590 pkgmgrinfo_appinfo_filter_h handle;
3591 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3592 if (ret != PMINFO_R_OK)
3594 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3595 if (ret != PMINFO_R_OK) {
3596 pkgmgrinfo_appinfo_filter_destroy(handle);
3599 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3600 if (ret != PMINFO_R_OK) {
3601 pkgmgrinfo_appinfo_filter_destroy(handle);
3604 pkgmgrinfo_appinfo_filter_destroy(handle);
3609 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3610 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3613 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3614 * @brief This API counts the application that satisfy the filter conditions
3616 * @par This API is for package-manager client application
3617 * @par Sync (or) Async : Synchronous API
3619 * @param[in] handle pointer to the application info filter handle.
3620 * @param[in] count pointer to store count value
3621 * @return 0 if success, error code(<0) if fail
3622 * @retval PMINFO_R_OK success
3623 * @retval PMINFO_R_EINVAL invalid argument
3624 * @retval PMINFO_R_ERROR internal error
3625 * @pre pkgmgrinfo_appinfo_filter_create()
3626 * @post pkgmgrinfo_appinfo_filter_destroy()
3627 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3629 static int get_capp_count()
3633 pkgmgrinfo_appinfo_filter_h handle;
3634 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3635 if (ret != PMINFO_R_OK)
3637 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3638 if (ret != PMINFO_R_OK) {
3639 pkgmgrinfo_appinfo_filter_destroy(handle);
3642 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3643 if (ret != PMINFO_R_OK) {
3644 pkgmgrinfo_appinfo_filter_destroy(handle);
3647 printf("No of capp: %d\n", count);
3648 pkgmgrinfo_appinfo_filter_destroy(handle);
3653 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3656 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
3657 * @brief This API creates the application's metadata information filter handle from db.
3659 * @par This API is for package-manager client application
3660 * @par Sync (or) Async : Synchronous API
3662 * @param[out] handle pointer to the application metadata info filter handle.
3663 * @return 0 if success, error code(<0) if fail
3664 * @retval PMINFO_R_OK success
3665 * @retval PMINFO_R_EINVAL invalid argument
3666 * @retval PMINFO_R_ERROR internal error
3668 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3669 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3671 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3674 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3675 printf("appid : %s\n", appid);
3679 static int get_app_list(const char *mkey, const char *mvalue)
3682 pkgmgrinfo_appinfo_metadata_filter_h handle;
3683 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3684 if (ret != PMINFO_R_OK)
3686 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3687 if (ret != PMINFO_R_OK) {
3688 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3691 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3692 if (ret != PMINFO_R_OK) {
3693 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3696 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3701 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
3704 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
3705 * @brief This API destroys the application's metadata information filter handle.
3707 * @par This API is for package-manager client application
3708 * @par Sync (or) Async : Synchronous API
3710 * @param[in] handle pointer to the application metadata info filter handle.
3711 * @return 0 if success, error code(<0) if fail
3712 * @retval PMINFO_R_OK success
3713 * @retval PMINFO_R_EINVAL invalid argument
3714 * @retval PMINFO_R_ERROR internal error
3715 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3717 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3719 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3722 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3723 printf("appid : %s\n", appid);
3727 static int get_app_list(const char *mkey, const char *mvalue)
3730 pkgmgrinfo_appinfo_metadata_filter_h handle;
3731 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3732 if (ret != PMINFO_R_OK)
3734 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3735 if (ret != PMINFO_R_OK) {
3736 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3739 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3740 if (ret != PMINFO_R_OK) {
3741 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3744 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3749 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
3752 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
3753 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
3754 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
3756 * @par This API is for package-manager client application
3757 * @par Sync (or) Async : Synchronous API
3759 * @param[in] handle pointer to the application metadata info filter handle.
3760 * @param[in] key pointer to metadata key
3761 * @param[in] value pointer to metadata value
3762 * @return 0 if success, error code(<0) if fail
3763 * @retval PMINFO_R_OK success
3764 * @retval PMINFO_R_EINVAL invalid argument
3765 * @retval PMINFO_R_ERROR internal error
3766 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3767 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
3768 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3770 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3773 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3774 printf("appid : %s\n", appid);
3778 static int get_app_list(const char *mkey, const char *mvalue)
3781 pkgmgrinfo_appinfo_metadata_filter_h handle;
3782 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3783 if (ret != PMINFO_R_OK)
3785 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3786 if (ret != PMINFO_R_OK) {
3787 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3790 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3791 if (ret != PMINFO_R_OK) {
3792 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3795 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3800 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
3801 const char *key, const char *value);
3804 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3805 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
3806 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
3807 * negative value, no more callbacks will be called and API will return.
3809 * @par This API is for package-manager client application
3810 * @par Sync (or) Async : Synchronous API
3812 * @param[in] handle pointer to the application metadata info filter handle.
3813 * @param[in] app_cb function pointer to callback
3814 * @param[in] user_data pointer to user data
3815 * @return 0 if success, error code(<0) if fail
3816 * @retval PMINFO_R_OK success
3817 * @retval PMINFO_R_EINVAL invalid argument
3818 * @retval PMINFO_R_ERROR internal error
3819 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3820 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3822 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3825 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3826 printf("appid : %s\n", appid);
3830 static int get_app_list(const char *mkey, const char *mvalue)
3833 pkgmgrinfo_appinfo_metadata_filter_h handle;
3834 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3835 if (ret != PMINFO_R_OK)
3837 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3838 if (ret != PMINFO_R_OK) {
3839 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3842 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3843 if (ret != PMINFO_R_OK) {
3844 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3847 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3852 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
3853 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3856 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3857 * @brief This API creates the package cert information handle to get data from db.
3859 * @par This API is for package-manager client application
3860 * @par Sync (or) Async : Synchronous API
3862 * @param[out] handle pointer to the package cert handle.
3863 * @return 0 if success, error code(<0) if fail
3864 * @retval PMINFO_R_OK success
3865 * @retval PMINFO_R_EINVAL invalid argument
3866 * @retval PMINFO_R_ERROR internal error
3868 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3869 * @see pkgmgrinfo_pkginfo_get_cert_value()
3870 * @see pkgmgrinfo_pkginfo_load_certinfo()
3872 static int get_cert_info(const char *pkgid)
3875 pkgmgrinfo_certinfo_h handle;
3876 char *auth_cert = NULL;
3877 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3878 if (ret != PMINFO_R_OK)
3880 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3881 if (ret != PMINFO_R_OK) {
3882 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3885 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3886 if (ret != PMINFO_R_OK) {
3887 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3890 printf("Author root certificate: %s\n", auth_root);
3891 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3896 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3899 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3900 * @brief This API loads the package cert information handle with data from db.
3902 * @par This API is for package-manager client application
3903 * @par Sync (or) Async : Synchronous API
3905 * @param[in] pkgid pointer to the package ID.
3906 * @param[in] handle pointer to the package cert handle.
3907 * @return 0 if success, error code(<0) if fail
3908 * @retval PMINFO_R_OK success
3909 * @retval PMINFO_R_EINVAL invalid argument
3910 * @retval PMINFO_R_ERROR internal error
3911 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3912 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3913 * @see pkgmgrinfo_pkginfo_get_cert_value()
3915 static int get_cert_info(const char *pkgid)
3918 pkgmgrinfo_certinfo_h handle;
3919 char *auth_cert = NULL;
3920 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3921 if (ret != PMINFO_R_OK)
3923 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3924 if (ret != PMINFO_R_OK) {
3925 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3928 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3929 if (ret != PMINFO_R_OK) {
3930 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3933 printf("Author root certificate: %s\n", auth_root);
3934 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3939 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3942 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3943 * @brief This API gets the package cert information from the handle
3945 * @par This API is for package-manager client application
3946 * @par Sync (or) Async : Synchronous API
3948 * @param[in] handle pointer to the package cert handle.
3949 * @param[in] cert_type certificate type
3950 * @param[out] cert_value pointer to hold certificate value
3951 * @return 0 if success, error code(<0) if fail
3952 * @retval PMINFO_R_OK success
3953 * @retval PMINFO_R_EINVAL invalid argument
3954 * @retval PMINFO_R_ERROR internal error
3955 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3956 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3957 * @see pkgmgrinfo_pkginfo_load_certinfo()
3959 static int get_cert_info(const char *pkgid)
3962 pkgmgrinfo_certinfo_h handle;
3963 char *auth_cert = NULL;
3964 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3965 if (ret != PMINFO_R_OK)
3967 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3968 if (ret != PMINFO_R_OK) {
3969 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3972 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3973 if (ret != PMINFO_R_OK) {
3974 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3977 printf("Author root certificate: %s\n", auth_root);
3978 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3983 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3986 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3987 * @brief This API destroys the package cert information handle freeing up all the resources
3989 * @par This API is for package-manager client application
3990 * @par Sync (or) Async : Synchronous API
3992 * @param[in] handle pointer to the package cert handle.
3993 * @return 0 if success, error code(<0) if fail
3994 * @retval PMINFO_R_OK success
3995 * @retval PMINFO_R_EINVAL invalid argument
3996 * @retval PMINFO_R_ERROR internal error
3997 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3999 * @see pkgmgrinfo_pkginfo_load_certinfo()
4001 static int get_cert_info(const char *pkgid)
4004 pkgmgrinfo_certinfo_h handle;
4005 char *auth_cert = NULL;
4006 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4007 if (ret != PMINFO_R_OK)
4009 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4010 if (ret != PMINFO_R_OK) {
4011 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4014 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4015 if (ret != PMINFO_R_OK) {
4016 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4019 printf("Author root certificate: %s\n", auth_root);
4020 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4025 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4028 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4029 * @brief This API deletes the package cert information from DB
4031 * @par This API is for package-manager client application
4032 * @par Sync (or) Async : Synchronous API
4034 * @param[in] pkgid pointer to the package ID.
4035 * @return 0 if success, error code(<0) if fail
4036 * @retval PMINFO_R_OK success
4037 * @retval PMINFO_R_EINVAL invalid argument
4038 * @retval PMINFO_R_ERROR internal error
4042 static int delete_cert_info(const char *pkgid)
4045 ret = pkgmgrinfo_delete_certinfo(pkgid);
4046 if (ret != PMINFO_R_OK)
4052 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4055 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4056 * @brief This API creates the package db information handle to set data in db.
4058 * @par This API is for package-manager client application
4059 * @par Sync (or) Async : Synchronous API
4061 * @param[in] pkgid pointer to the package ID.
4062 * @param[out] handle pointer to the package db info handle.
4063 * @return 0 if success, error code(<0) if fail
4064 * @retval PMINFO_R_OK success
4065 * @retval PMINFO_R_EINVAL invalid argument
4066 * @retval PMINFO_R_ERROR internal error
4068 * @post pkgmgrinfo_destroy_pkgdbinfo()
4069 * @see pkgmgrinfo_save_pkgdbinfo()
4070 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4072 static int set_pkg_in_db(const char *pkgid)
4075 pkgmgrinfo_pkgdbinfo_h handle;
4076 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4077 if (ret != PMINFO_R_OK)
4079 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4080 if (ret != PMINFO_R_OK) {
4081 pkgmgrinfo_destroy_pkgdbinfo(handle);
4084 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4085 if (ret != PMINFO_R_OK) {
4086 pkgmgrinfo_destroy_pkgdbinfo(handle);
4089 pkgmgrinfo_destroy_pkgdbinfo(handle);
4094 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4097 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4098 * @brief This API sets the package type in db handle
4100 * @par This API is for package-manager client application
4101 * @par Sync (or) Async : Synchronous API
4103 * @param[in] handle pointer to the pkgdbinfo handle.
4104 * @param[in] type pointer to the package type.
4105 * @return 0 if success, error code(<0) if fail
4106 * @retval PMINFO_R_OK success
4107 * @retval PMINFO_R_EINVAL invalid argument
4108 * @retval PMINFO_R_ERROR internal error
4109 * @pre pkgmgrinfo_create_pkgdbinfo()
4110 * @post pkgmgrinfo_destroy_pkgdbinfo()
4111 * @see pkgmgrinfo_save_pkgdbinfo()
4112 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4114 static int set_pkg_type_in_db(const char *pkgid)
4117 pkgmgrinfo_pkgdbinfo_h handle;
4118 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4119 if (ret != PMINFO_R_OK)
4121 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4122 if (ret != PMINFO_R_OK) {
4123 pkgmgrinfo_destroy_pkgdbinfo(handle);
4126 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4127 if (ret != PMINFO_R_OK) {
4128 pkgmgrinfo_destroy_pkgdbinfo(handle);
4131 pkgmgrinfo_destroy_pkgdbinfo(handle);
4136 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4139 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4140 * @brief This API sets the package version in db handle
4142 * @par This API is for package-manager client application
4143 * @par Sync (or) Async : Synchronous API
4145 * @param[in] handle pointer to the pkgdbinfo handle.
4146 * @param[in] version pointer to the package version
4147 * @return 0 if success, error code(<0) if fail
4148 * @retval PMINFO_R_OK success
4149 * @retval PMINFO_R_EINVAL invalid argument
4150 * @retval PMINFO_R_ERROR internal error
4151 * @pre pkgmgrinfo_create_pkgdbinfo()
4152 * @post pkgmgrinfo_destroy_pkgdbinfo()
4153 * @see pkgmgrinfo_save_pkgdbinfo()
4154 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4156 static int set_pkg_version_in_db(const char *pkgid)
4159 pkgmgrinfo_pkgdbinfo_h handle;
4160 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4161 if (ret != PMINFO_R_OK)
4163 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4164 if (ret != PMINFO_R_OK) {
4165 pkgmgrinfo_destroy_pkgdbinfo(handle);
4168 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4169 if (ret != PMINFO_R_OK) {
4170 pkgmgrinfo_destroy_pkgdbinfo(handle);
4173 pkgmgrinfo_destroy_pkgdbinfo(handle);
4178 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4181 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4182 * @brief This API sets the package install location in db handle
4184 * @par This API is for package-manager client application
4185 * @par Sync (or) Async : Synchronous API
4187 * @param[in] handle pointer to the pkgdbinfo handle.
4188 * @param[in] location package install location
4189 * @return 0 if success, error code(<0) if fail
4190 * @retval PMINFO_R_OK success
4191 * @retval PMINFO_R_EINVAL invalid argument
4192 * @retval PMINFO_R_ERROR internal error
4193 * @pre pkgmgrinfo_create_pkgdbinfo()
4194 * @post pkgmgrinfo_destroy_pkgdbinfo()
4195 * @see pkgmgrinfo_save_pkgdbinfo()
4196 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4198 static int set_pkg_install_location_in_db(const char *pkgid)
4201 pkgmgrinfo_pkgdbinfo_h handle;
4202 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4203 if (ret != PMINFO_R_OK)
4205 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4206 if (ret != PMINFO_R_OK) {
4207 pkgmgrinfo_destroy_pkgdbinfo(handle);
4210 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4211 if (ret != PMINFO_R_OK) {
4212 pkgmgrinfo_destroy_pkgdbinfo(handle);
4215 pkgmgrinfo_destroy_pkgdbinfo(handle);
4220 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4223 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4224 * @brief This API sets the package size in db handle
4226 * @par This API is for package-manager client application
4227 * @par Sync (or) Async : Synchronous API
4229 * @param[in] handle pointer to the pkgdbinfo handle.
4230 * @param[in] size pointer to the package size
4231 * @return 0 if success, error code(<0) if fail
4232 * @retval PMINFO_R_OK success
4233 * @retval PMINFO_R_EINVAL invalid argument
4234 * @retval PMINFO_R_ERROR internal error
4235 * @pre pkgmgrinfo_create_pkgdbinfo()
4236 * @post pkgmgrinfo_destroy_pkgdbinfo()
4237 * @see pkgmgrinfo_save_pkgdbinfo()
4238 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4240 static int set_pkg_size_in_db(const char *pkgid)
4243 pkgmgrinfo_pkgdbinfo_h handle;
4244 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4245 if (ret != PMINFO_R_OK)
4247 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_destroy_pkgdbinfo(handle);
4252 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4253 if (ret != PMINFO_R_OK) {
4254 pkgmgrinfo_destroy_pkgdbinfo(handle);
4257 pkgmgrinfo_destroy_pkgdbinfo(handle);
4262 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4265 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4266 * @brief This API sets the package label in db handle
4268 * @par This API is for package-manager client application
4269 * @par Sync (or) Async : Synchronous API
4271 * @param[in] handle pointer to the pkgdbinfo handle.
4272 * @param[in] label pointer to the package label
4273 * @param[in] locale pointer to the locale
4274 * @return 0 if success, error code(<0) if fail
4275 * @retval PMINFO_R_OK success
4276 * @retval PMINFO_R_EINVAL invalid argument
4277 * @retval PMINFO_R_ERROR internal error
4278 * @pre pkgmgrinfo_create_pkgdbinfo()
4279 * @post pkgmgrinfo_destroy_pkgdbinfo()
4280 * @see pkgmgrinfo_save_pkgdbinfo()
4281 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4283 static int set_pkg_label_in_db(const char *pkgid)
4286 pkgmgrinfo_pkgdbinfo_h handle;
4287 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4288 if (ret != PMINFO_R_OK)
4290 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4291 if (ret != PMINFO_R_OK) {
4292 pkgmgrinfo_destroy_pkgdbinfo(handle);
4295 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4296 if (ret != PMINFO_R_OK) {
4297 pkgmgrinfo_destroy_pkgdbinfo(handle);
4300 pkgmgrinfo_destroy_pkgdbinfo(handle);
4305 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4308 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4309 * @brief This API sets the package icon in db handle
4311 * @par This API is for package-manager client application
4312 * @par Sync (or) Async : Synchronous API
4314 * @param[in] handle pointer to the pkgdbinfo handle.
4315 * @param[in] icon pointer to the package icon
4316 * @param[in] locale pointer to the locale
4317 * @return 0 if success, error code(<0) if fail
4318 * @retval PMINFO_R_OK success
4319 * @retval PMINFO_R_EINVAL invalid argument
4320 * @retval PMINFO_R_ERROR internal error
4321 * @pre pkgmgrinfo_create_pkgdbinfo()
4322 * @post pkgmgrinfo_destroy_pkgdbinfo()
4323 * @see pkgmgrinfo_save_pkgdbinfo()
4324 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4326 static int set_pkg_icon_in_db(const char *pkgid)
4329 pkgmgrinfo_pkgdbinfo_h handle;
4330 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4331 if (ret != PMINFO_R_OK)
4333 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4334 if (ret != PMINFO_R_OK) {
4335 pkgmgrinfo_destroy_pkgdbinfo(handle);
4338 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4339 if (ret != PMINFO_R_OK) {
4340 pkgmgrinfo_destroy_pkgdbinfo(handle);
4343 pkgmgrinfo_destroy_pkgdbinfo(handle);
4348 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4351 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4352 * @brief This API sets the package description in db handle
4354 * @par This API is for package-manager client application
4355 * @par Sync (or) Async : Synchronous API
4357 * @param[in] handle pointer to the pkgdbinfo handle.
4358 * @param[in] description pointer to the package description
4359 * @param[in] locale pointer to the locale
4360 * @return 0 if success, error code(<0) if fail
4361 * @retval PMINFO_R_OK success
4362 * @retval PMINFO_R_EINVAL invalid argument
4363 * @retval PMINFO_R_ERROR internal error
4364 * @pre pkgmgrinfo_create_pkgdbinfo()
4365 * @post pkgmgrinfo_destroy_pkgdbinfo()
4366 * @see pkgmgrinfo_save_pkgdbinfo()
4367 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4369 static int set_pkg_description_in_db(const char *pkgid)
4372 pkgmgrinfo_pkgdbinfo_h handle;
4373 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4374 if (ret != PMINFO_R_OK)
4376 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4377 if (ret != PMINFO_R_OK) {
4378 pkgmgrinfo_destroy_pkgdbinfo(handle);
4381 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4382 if (ret != PMINFO_R_OK) {
4383 pkgmgrinfo_destroy_pkgdbinfo(handle);
4386 pkgmgrinfo_destroy_pkgdbinfo(handle);
4391 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4394 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4395 const char *author_email, const char *author_href, const char *locale)
4396 * @brief This API sets the package author info in db handle
4398 * @par This API is for package-manager client application
4399 * @par Sync (or) Async : Synchronous API
4401 * @param[in] handle pointer to the pkgdbinfo handle.
4402 * @param[in] author_name pointer to the package author name
4403 * @param[in] author_email pointer to the package author email
4404 * @param[in] author_href pointer to the package author href
4405 * @param[in] locale pointer to the locale
4406 * @return 0 if success, error code(<0) if fail
4407 * @retval PMINFO_R_OK success
4408 * @retval PMINFO_R_EINVAL invalid argument
4409 * @retval PMINFO_R_ERROR internal error
4410 * @pre pkgmgrinfo_create_pkgdbinfo()
4411 * @post pkgmgrinfo_destroy_pkgdbinfo()
4412 * @see pkgmgrinfo_save_pkgdbinfo()
4413 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4415 static int set_pkg_author_in_db(const char *pkgid)
4418 pkgmgrinfo_pkgdbinfo_h handle;
4419 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4420 if (ret != PMINFO_R_OK)
4422 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4423 if (ret != PMINFO_R_OK) {
4424 pkgmgrinfo_destroy_pkgdbinfo(handle);
4427 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4428 if (ret != PMINFO_R_OK) {
4429 pkgmgrinfo_destroy_pkgdbinfo(handle);
4432 pkgmgrinfo_destroy_pkgdbinfo(handle);
4437 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4438 const char *author_email, const char *author_href, const char *locale);
4441 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4442 * @brief This API sets the package 'removable' value in db handle
4444 * @par This API is for package-manager client application
4445 * @par Sync (or) Async : Synchronous API
4447 * @param[in] handle pointer to the pkgdbinfo handle.
4448 * @param[in] removable package removable value
4449 * @return 0 if success, error code(<0) if fail
4450 * @retval PMINFO_R_OK success
4451 * @retval PMINFO_R_EINVAL invalid argument
4452 * @retval PMINFO_R_ERROR internal error
4453 * @pre pkgmgrinfo_create_pkgdbinfo()
4454 * @post pkgmgrinfo_destroy_pkgdbinfo()
4455 * @see pkgmgrinfo_save_pkgdbinfo()
4456 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4458 static int set_pkg_removable_in_db(const char *pkgid)
4461 pkgmgrinfo_pkgdbinfo_h handle;
4462 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4463 if (ret != PMINFO_R_OK)
4465 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4466 if (ret != PMINFO_R_OK) {
4467 pkgmgrinfo_destroy_pkgdbinfo(handle);
4470 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4471 if (ret != PMINFO_R_OK) {
4472 pkgmgrinfo_destroy_pkgdbinfo(handle);
4475 pkgmgrinfo_destroy_pkgdbinfo(handle);
4480 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4483 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4484 * @brief This API sets the package 'preload' value in db handle
4486 * @par This API is for package-manager client application
4487 * @par Sync (or) Async : Synchronous API
4489 * @param[in] handle pointer to the pkgdbinfo handle.
4490 * @param[in] preload package preload value
4491 * @return 0 if success, error code(<0) if fail
4492 * @retval PMINFO_R_OK success
4493 * @retval PMINFO_R_EINVAL invalid argument
4494 * @retval PMINFO_R_ERROR internal error
4495 * @pre pkgmgrinfo_create_pkgdbinfo()
4496 * @post pkgmgrinfo_destroy_pkgdbinfo()
4497 * @see pkgmgrinfo_save_pkgdbinfo()
4498 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4500 static int set_pkg_preload_in_db(const char *pkgid)
4503 pkgmgrinfo_pkgdbinfo_h handle;
4504 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4505 if (ret != PMINFO_R_OK)
4507 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4508 if (ret != PMINFO_R_OK) {
4509 pkgmgrinfo_destroy_pkgdbinfo(handle);
4512 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4513 if (ret != PMINFO_R_OK) {
4514 pkgmgrinfo_destroy_pkgdbinfo(handle);
4517 pkgmgrinfo_destroy_pkgdbinfo(handle);
4522 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4525 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4526 * @brief This API sets the package 'installed_storage' value in db handle
4528 * @par This API is for package-manager client application
4529 * @par Sync (or) Async : Synchronous API
4531 * @param[in] handle pointer to the pkgdbinfo handle.
4532 * @param[in] location installed_storage value
4533 * @return 0 if success, error code(<0) if fail
4534 * @retval PMINFO_R_OK success
4535 * @retval PMINFO_R_EINVAL invalid argument
4536 * @retval PMINFO_R_ERROR internal error
4537 * @pre pkgmgrinfo_create_pkgdbinfo()
4538 * @post pkgmgrinfo_destroy_pkgdbinfo()
4539 * @see pkgmgrinfo_save_pkgdbinfo()
4541 static int set_pkg_installed_storage_in_db(const char *pkgid)
4544 pkgmgrinfo_pkgdbinfo_h handle;
4545 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4546 if (ret != PMINFO_R_OK)
4548 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4549 if (ret != PMINFO_R_OK) {
4550 pkgmgrinfo_destroy_pkgdbinfo(handle);
4553 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4554 if (ret != PMINFO_R_OK) {
4555 pkgmgrinfo_destroy_pkgdbinfo(handle);
4558 pkgmgrinfo_destroy_pkgdbinfo(handle);
4563 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4566 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4567 * @brief This API saves all the information from the handle to the DB.
4569 * @par This API is for package-manager client application
4570 * @par Sync (or) Async : Synchronous API
4572 * @param[in] handle pointer to the package db info handle.
4573 * @return 0 if success, error code(<0) if fail
4574 * @retval PMINFO_R_OK success
4575 * @retval PMINFO_R_EINVAL invalid argument
4576 * @retval PMINFO_R_ERROR internal error
4577 * @pre pkgmgrinfo_create_pkgdbinfo()
4578 * @post pkgmgrinfo_destroy_pkgdbinfo()
4579 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4581 static int set_pkg_in_db(const char *pkgid)
4584 pkgmgrinfo_pkgdbinfo_h handle;
4585 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4586 if (ret != PMINFO_R_OK)
4588 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4589 if (ret != PMINFO_R_OK) {
4590 pkgmgrinfo_destroy_pkgdbinfo(handle);
4593 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4594 if (ret != PMINFO_R_OK) {
4595 pkgmgrinfo_destroy_pkgdbinfo(handle);
4598 pkgmgrinfo_destroy_pkgdbinfo(handle);
4603 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4606 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4607 * @brief This API destroys the package db information handle freeing up all the resources
4609 * @par This API is for package-manager client application
4610 * @par Sync (or) Async : Synchronous API
4612 * @param[in] handle pointer to the package db info handle.
4613 * @return 0 if success, error code(<0) if fail
4614 * @retval PMINFO_R_OK success
4615 * @retval PMINFO_R_EINVAL invalid argument
4616 * @retval PMINFO_R_ERROR internal error
4617 * @pre pkgmgrinfo_create_pkgdbinfo()
4619 * @see pkgmgrinfo_save_pkgdbinfo()
4620 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4622 static int set_pkg_in_db(const char *pkgid)
4625 pkgmgrinfo_pkgdbinfo_h handle;
4626 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4627 if (ret != PMINFO_R_OK)
4629 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4630 if (ret != PMINFO_R_OK) {
4631 pkgmgrinfo_destroy_pkgdbinfo(handle);
4634 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4635 if (ret != PMINFO_R_OK) {
4636 pkgmgrinfo_destroy_pkgdbinfo(handle);
4639 pkgmgrinfo_destroy_pkgdbinfo(handle);
4644 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4648 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4649 * @brief This API creates the package cert information handle to set data in db.
4651 * @par This API is for package-manager client application
4652 * @par Sync (or) Async : Synchronous API
4654 * @param[out] handle pointer to the package cert handle.
4655 * @return 0 if success, error code(<0) if fail
4656 * @retval PMINFO_R_OK success
4657 * @retval PMINFO_R_EINVAL invalid argument
4658 * @retval PMINFO_R_ERROR internal error
4660 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4661 * @see pkgmgrinfo_set_cert_value()
4662 * @see pkgmgrinfo_save_certinfo()
4664 static int set_cert_in_db(const char *pkgid)
4667 pkgmgrinfo_instcertinfo_h handle;
4668 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4669 if (ret != PMINFO_R_OK)
4671 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4672 if (ret != PMINFO_R_OK) {
4673 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4676 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4677 if (ret != PMINFO_R_OK) {
4678 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4681 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4686 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4689 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4690 * @brief This API sets the package cert information in the handle.
4692 * @par This API is for package-manager client application
4693 * @par Sync (or) Async : Synchronous API
4695 * @param[in] handle pointer to the package cert handle.
4696 * @param[in] cert_type certificate type.
4697 * @param[in] cert_value certificate value.
4698 * @return 0 if success, error code(<0) if fail
4699 * @retval PMINFO_R_OK success
4700 * @retval PMINFO_R_EINVAL invalid argument
4701 * @retval PMINFO_R_ERROR internal error
4702 * @pre pkgmgrinfo_create_certinfo_set_handle()
4703 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4704 * @see pkgmgrinfo_save_certinfo()
4706 static int set_cert_in_db(const char *pkgid)
4709 pkgmgrinfo_instcertinfo_h handle;
4710 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4711 if (ret != PMINFO_R_OK)
4713 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4714 if (ret != PMINFO_R_OK) {
4715 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4718 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4719 if (ret != PMINFO_R_OK) {
4720 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4723 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4728 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4731 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4732 * @brief This API saves the package cert information in the DB.
4734 * @par This API is for package-manager client application
4735 * @par Sync (or) Async : Synchronous API
4737 * @param[in] pkgid pointer to the package ID.
4738 * @param[in] handle pointer to the package cert handle.
4739 * @return 0 if success, error code(<0) if fail
4740 * @retval PMINFO_R_OK success
4741 * @retval PMINFO_R_EINVAL invalid argument
4742 * @retval PMINFO_R_ERROR internal error
4743 * @pre pkgmgrinfo_create_certinfo_set_handle()
4744 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4745 * @see pkgmgrinfo_save_certinfo()
4747 static int set_cert_in_db(const char *pkgid)
4750 pkgmgrinfo_instcertinfo_h handle;
4751 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4752 if (ret != PMINFO_R_OK)
4754 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4755 if (ret != PMINFO_R_OK) {
4756 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4759 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4760 if (ret != PMINFO_R_OK) {
4761 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4764 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4769 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4772 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4773 * @brief This API destroys the package cert information handle freeing up all the resources.
4775 * @par This API is for package-manager client application
4776 * @par Sync (or) Async : Synchronous API
4778 * @param[in] handle pointer to the package cert handle.
4779 * @return 0 if success, error code(<0) if fail
4780 * @retval PMINFO_R_OK success
4781 * @retval PMINFO_R_EINVAL invalid argument
4782 * @retval PMINFO_R_ERROR internal error
4783 * @pre pkgmgrinfo_create_certinfo_set_handle()
4785 * @see pkgmgrinfo_save_certinfo()
4787 static int set_cert_in_db(const char *pkgid)
4790 pkgmgrinfo_instcertinfo_h handle;
4791 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4792 if (ret != PMINFO_R_OK)
4794 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4795 if (ret != PMINFO_R_OK) {
4796 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4799 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4800 if (ret != PMINFO_R_OK) {
4801 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4804 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4809 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4812 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4813 * @brief This API gets the datacontrol info
4815 * @par This API is for package-manager client application
4816 * @par Sync (or) Async : Synchronous API
4818 * @param[in] providerid pointer to the providerid of dataconltrol.
4819 * @param[in] type pointer to the type of dataconltrol.
4820 * @param[out] appid pointer to hold appid, need to free after using
4821 * @param[out] access pointer to hold access, need to free after using
4822 * @return 0 if success, error code(<0) if fail
4823 * @retval PMINFO_R_OK success
4824 * @retval PMINFO_R_EINVAL invalid argument
4825 * @retval PMINFO_R_ERROR internal error
4828 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4831 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
4832 * @brief This API gets the application 'guest mode visibility' value from the DB
4834 * @par This API is for package-manager client application
4835 * @par Sync (or) Async : Synchronous API
4837 * @param[in] handle pointer to application info handle
4838 * @param[out] status pointer to hold app guest mode visibility value
4839 * @return 0 if success, error code(<0) if fail
4840 * @retval PMINFO_R_OK success
4841 * @retval PMINFO_R_EINVAL invalid argument
4842 * @retval PMINFO_R_ERROR internal error
4843 * @pre pkgmgrinfo_appinfo_get_appinfo()
4844 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4845 * @see pkgmgrinfo_appinfo_get_appid()
4846 * @see pkgmgrinfo_appinfo_is_multiple()
4848 static int get_app_guestmode_visibility(const char *appid)
4852 pkgmgrinfo_appinfo_h handle;
4853 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4854 if (ret != PMINFO_R_OK)
4856 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
4857 if (ret != PMINFO_R_OK) {
4858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4861 printf("app guest mode visibility: %d\n", status);
4862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4867 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
4870 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
4871 * @brief This API sets the application 'guest mode visibility' value in the DB
4873 * @par This API is for package-manager client application
4874 * @par Sync (or) Async : Synchronous API
4876 * @param[in] handle pointer to application info handle
4877 * @param[out] status app guest mode visibility value
4878 * @return 0 if success, error code(<0) if fail
4879 * @retval PMINFO_R_OK success
4880 * @retval PMINFO_R_EINVAL invalid argument
4881 * @retval PMINFO_R_ERROR internal error
4882 * @pre pkgmgrinfo_appinfo_get_appinfo()
4883 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4884 * @see pkgmgrinfo_appinfo_get_appid()
4885 * @see pkgmgrinfo_appinfo_is_multiple()
4887 static int set_app_guestmode_visibility(const char *appid, bool value)
4890 pkgmgrinfo_appinfo_h handle;
4891 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4892 if (ret != PMINFO_R_OK)
4894 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4899 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4904 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
4911 #endif /* __PKG_INFO_H__ */