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_app_permission_list_cb ) (const char *permission_type, void *user_data)
242 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
244 * @param[in] permission_name the name of the permission
245 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
247 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
249 * @see pkgmgrinfo_appinfo_foreach_category()
251 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
255 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
257 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
259 * @param[in] privilege_name the name of the privilege
260 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
262 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
264 * @see pkgmgrinfo_pkginfo_foreach_privilege()
266 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
270 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
272 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
274 * @param[in] metadata_name the name of the metadata
275 * @param[in] metadata_value the value of the metadata
276 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
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_metadata()
282 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
283 const char *metadata_value, void *user_data);
286 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
288 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
290 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
291 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
293 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
295 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
297 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
301 * @brief Install Location Types
304 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
305 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
306 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
307 }pkgmgrinfo_install_location;
310 * @brief Application Component Types
313 PMINFO_ALL_APP = 0, /**< All Application*/
314 PMINFO_UI_APP, /**< UI Application*/
315 PMINFO_SVC_APP, /**< Service Application*/
316 }pkgmgrinfo_app_component;
319 * @brief Application Storage Types
322 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
323 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
324 }pkgmgrinfo_installed_storage;
327 * @brief Certificate Types to be used for getting information
330 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
331 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
332 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
333 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
334 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
335 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
336 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
337 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
338 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
339 }pkgmgrinfo_cert_type;
342 * @brief Install Location Types to be used when setting data in DB
345 INSTALL_INTERNAL = 0, /**< Internal Installation*/
346 INSTALL_EXTERNAL, /**< External Installation*/
350 * @brief permission Types
353 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
354 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
355 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
356 }pkgmgrinfo_permission_type;
359 /** String property for filtering based on package info*/
360 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
361 /** String property for filtering based on package info*/
362 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
363 /** String property for filtering based on package info*/
364 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
365 /** String property for filtering based on package info*/
366 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
367 /** String property for filtering based on package info*/
368 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
369 /** String property for filtering based on package info*/
370 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
376 /** Boolean property for filtering based on package info*/
377 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
378 /** Boolean property for filtering based on package info*/
379 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
380 /** Boolean property for filtering based on package info*/
381 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
382 /** Boolean property for filtering based on package info*/
383 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
384 /** Boolean property for filtering based on package info*/
385 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
386 /** Boolean property for filtering based on package info*/
387 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
389 /** Integer property for filtering based on package info*/
390 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
392 /** String property for filtering based on app info*/
393 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
394 /** String property for filtering based on app info*/
395 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
396 /** String property for filtering based on app info*/
397 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
398 /** String property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
400 /** String property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
402 /** String property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
413 /** Boolean property for filtering based on app info*/
414 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
415 /** Boolean property for filtering based on app info*/
416 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
417 /** Boolean property for filtering based on app info*/
418 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
419 /** Boolean property for filtering based on app info*/
420 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
421 /** Boolean property for filtering based on app info*/
422 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
423 /** Boolean property for filtering based on app info*/
424 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
426 /** will be updated*/
427 /** string property for filtering based on pkg info*/
428 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
431 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
432 * @brief This API gets list of installed packages
434 * @par This API is for package-manager client application
435 * @par Sync (or) Async : Synchronous API
436 * @param[in] pkg_list_cb iteration function for list
437 * @param[in] user_data user data to be passed to callback function
438 * @return 0 if success, error code(<0) if fail
439 * @retval PMINFO_R_OK success
440 * @retval PMINFO_R_EINVAL invalid argument
441 * @retval PMINFO_R_ERROR internal error
445 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
449 pkgid1 = (char *)user_data;
450 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
451 if (strcmp(pkgid1, pkgid2) == 0) {
458 static int list_pkgs()
461 char *name = "helloworld";
462 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
463 if (ret != PMINFO_R_OK) {
470 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
473 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
474 * @brief This API creates the package information handle from db
476 * @par This API is for package-manager client application
477 * @par Sync (or) Async : Synchronous API
479 * @param[in] pkgid pointer to package ID
480 * @param[out] handle pointer to the package info handle.
481 * @return 0 if success, error code(<0) if fail
482 * @retval PMINFO_R_OK success
483 * @retval PMINFO_R_EINVAL invalid argument
484 * @retval PMINFO_R_ERROR internal error
486 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
487 * @see pkgmgrinfo_pkginfo_get_pkgid()
488 * @see pkgmgrinfo_pkginfo_is_removable()
490 static int get_pkg_type(const char *pkgid)
494 pkgmgrinfo_pkginfo_h handle;
495 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
496 if (ret != PMINFO_R_OK)
498 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
499 if (ret != PMINFO_R_OK) {
500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 printf("pkgtype: %s\n", type);
504 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
509 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
512 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
513 * @brief This API gets the package name from the package ID
515 * @par This API is for package-manager client application
516 * @par Sync (or) Async : Synchronous API
518 * @param[in] handle pointer to package info handle
519 * @param[out] pkg_name pointer to hold package name
520 * @return 0 if success, error code(<0) if fail
521 * @retval PMINFO_R_OK success
522 * @retval PMINFO_R_EINVAL invalid argument
523 * @retval PMINFO_R_ERROR internal error
524 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
525 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
526 * @see pkgmgrinfo_pkginfo_get_type()
527 * @see pkgmgrinfo_pkginfo_is_removable()
529 static int get_pkg_name(const char *pkgid)
532 char *pkgname = NULL;
533 pkgmgrinfo_pkginfo_h handle;
534 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
535 if (ret != PMINFO_R_OK)
537 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
538 if (ret != PMINFO_R_OK) {
539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 printf("pkgname: %s\n", pkgname);
543 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
548 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
551 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
552 * @brief This API gets the package id from the package ID
554 * @par This API is for package-manager client application
555 * @par Sync (or) Async : Synchronous API
557 * @param[in] handle pointer to package info handle
558 * @param[out] pkgid pointer to hold package id
559 * @return 0 if success, error code(<0) if fail
560 * @retval PMINFO_R_OK success
561 * @retval PMINFO_R_EINVAL invalid argument
562 * @retval PMINFO_R_ERROR internal error
563 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
564 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
565 * @see pkgmgrinfo_pkginfo_get_type()
566 * @see pkgmgrinfo_pkginfo_is_removable()
568 static int get_pkgid(const char *pkgid)
572 pkgmgrinfo_pkginfo_h handle;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("pkg id: %s\n", pkg_id);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
590 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
591 * @brief This API gets the package type from the package ID
593 * @par This API is for package-manager client application
594 * @par Sync (or) Async : Synchronous API
596 * @param[in] handle pointer to package info handle
597 * @param[out] type pointer to hold package type
598 * @return 0 if success, error code(<0) if fail
599 * @retval PMINFO_R_OK success
600 * @retval PMINFO_R_EINVAL invalid argument
601 * @retval PMINFO_R_ERROR internal error
602 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
603 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
604 * @see pkgmgrinfo_pkginfo_get_pkgid()
605 * @see pkgmgrinfo_pkginfo_is_removable()
607 static int get_pkg_type(const char *pkgid)
611 pkgmgrinfo_pkginfo_h handle;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 printf("pkgtype: %s\n", type);
621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
626 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
629 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
630 * @brief This API gets the package version from the package ID
632 * @par This API is for package-manager client application
633 * @par Sync (or) Async : Synchronous API
635 * @param[in] handle pointer to package info handle
636 * @param[out] version pointer to hold package version
637 * @return 0 if success, error code(<0) if fail
638 * @retval PMINFO_R_OK success
639 * @retval PMINFO_R_EINVAL invalid argument
640 * @retval PMINFO_R_ERROR internal error
641 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
642 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
643 * @see pkgmgrinfo_pkginfo_get_pkgid()
644 * @see pkgmgrinfo_pkginfo_is_removable()
646 static int get_pkg_version(const char *pkgid)
649 char *version = NULL;
650 pkgmgrinfo_pkginfo_h handle;
651 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
652 if (ret != PMINFO_R_OK)
654 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
655 if (ret != PMINFO_R_OK) {
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659 printf("pkg version: %s\n", version);
660 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
665 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
668 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
669 * @brief This API gets the package install location from the package ID
671 * @par This API is for package-manager client application
672 * @par Sync (or) Async : Synchronous API
674 * @param[in] handle pointer to package info handle
675 * @param[out] location pointer to hold package install location
676 * @return 0 if success, error code(<0) if fail
677 * @retval PMINFO_R_OK success
678 * @retval PMINFO_R_EINVAL invalid argument
679 * @retval PMINFO_R_ERROR internal error
680 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
681 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
682 * @see pkgmgrinfo_pkginfo_get_pkgid()
683 * @see pkgmgrinfo_pkginfo_is_removable()
685 static int get_pkg_install_location(const char *pkgid)
688 pkgmgrinfo_install_location location;
689 pkgmgrinfo_pkginfo_h handle;
690 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
691 if (ret != PMINFO_R_OK)
693 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
694 if (ret != PMINFO_R_OK) {
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
698 printf("pkg install location: %d\n", location);
699 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
704 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
707 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
708 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
709 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
710 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
712 * @par This API is for package-manager client application
713 * @par Sync (or) Async : Synchronous API
715 * @param[in] handle pointer to package info handle
716 * @param[out] size pointer to hold package size
717 * @return 0 if success, error code(<0) if fail
718 * @retval PMINFO_R_OK success
719 * @retval PMINFO_R_EINVAL invalid argument
720 * @retval PMINFO_R_ERROR internal error
721 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
722 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
723 * @see pkgmgrinfo_pkginfo_get_pkgid()
724 * @see pkgmgrinfo_pkginfo_is_removable()
726 static int get_pkg_size(const char *pkgid)
730 pkgmgrinfo_pkginfo_h handle;
731 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
732 if (ret != PMINFO_R_OK)
734 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
735 if (ret != PMINFO_R_OK) {
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739 printf("pkgsize: %d\n", size);
740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
745 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
748 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
749 * @brief This API gets the installed package total size on the target.
751 * @par This API is for package-manager client application
752 * @par Sync (or) Async : Synchronous API
754 * @param[in] handle pointer to package info handle
755 * @param[out] size pointer to hold package total size
756 * @return 0 if success, error code(<0) if fail
757 * @retval PMINFO_R_OK success
758 * @retval PMINFO_R_EINVAL invalid argument
759 * @retval PMINFO_R_ERROR internal error
761 static int get_pkg_total_size(const char *pkgid)
765 pkgmgrinfo_pkginfo_h handle;
766 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
767 if (ret != PMINFO_R_OK)
769 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
770 if (ret != PMINFO_R_OK) {
771 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
774 printf("pkg total size: %d\n", size);
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
783 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
784 * @brief This API gets the installed package data size on the target.
786 * @par This API is for package-manager client application
787 * @par Sync (or) Async : Synchronous API
789 * @param[in] handle pointer to package info handle
790 * @param[out] size pointer to hold package data size
791 * @return 0 if success, error code(<0) if fail
792 * @retval PMINFO_R_OK success
793 * @retval PMINFO_R_EINVAL invalid argument
794 * @retval PMINFO_R_ERROR internal error
796 static int get_pkg_data_size(const char *pkgid)
800 pkgmgrinfo_pkginfo_h handle;
801 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
802 if (ret != PMINFO_R_OK)
804 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
805 if (ret != PMINFO_R_OK) {
806 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
809 printf("pkg data size: %d\n", size);
810 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
815 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
818 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
819 * @brief This API gets the package icon from the package ID
821 * @par This API is for package-manager client application
822 * @par Sync (or) Async : Synchronous API
824 * @param[in] handle pointer to package info handle
825 * @param[out] icon pointer to hold package icon
826 * @return 0 if success, error code(<0) if fail
827 * @retval PMINFO_R_OK success
828 * @retval PMINFO_R_EINVAL invalid argument
829 * @retval PMINFO_R_ERROR internal error
830 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
831 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
832 * @see pkgmgrinfo_pkginfo_get_pkgid()
833 * @see pkgmgrinfo_pkginfo_is_removable()
835 static int get_pkg_icon(const char *pkgid)
839 pkgmgrinfo_pkginfo_h handle;
840 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
841 if (ret != PMINFO_R_OK)
843 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
844 if (ret != PMINFO_R_OK) {
845 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
848 printf("pkg icon: %s\n", icon);
849 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
854 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
857 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
858 * @brief This API gets the package label from the package ID
860 * @par This API is for package-manager client application
861 * @par Sync (or) Async : Synchronous API
863 * @param[in] handle pointer to package info handle
864 * @param[out] label pointer to hold package label
865 * @return 0 if success, error code(<0) if fail
866 * @retval PMINFO_R_OK success
867 * @retval PMINFO_R_EINVAL invalid argument
868 * @retval PMINFO_R_ERROR internal error
869 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
870 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
871 * @see pkgmgrinfo_pkginfo_get_pkgid()
872 * @see pkgmgrinfo_pkginfo_is_removable()
874 static int get_pkg_label(const char *pkgid)
878 pkgmgrinfo_pkginfo_h handle;
879 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
880 if (ret != PMINFO_R_OK)
882 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
883 if (ret != PMINFO_R_OK) {
884 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
887 printf("pkg label: %s\n", label);
888 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
893 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
896 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
897 * @brief This API gets the package description from the package ID
899 * @par This API is for package-manager client application
900 * @par Sync (or) Async : Synchronous API
902 * @param[in] handle pointer to package info handle
903 * @param[out] description pointer to hold package description
904 * @return 0 if success, error code(<0) if fail
905 * @retval PMINFO_R_OK success
906 * @retval PMINFO_R_EINVAL invalid argument
907 * @retval PMINFO_R_ERROR internal error
908 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
909 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
910 * @see pkgmgrinfo_pkginfo_get_pkgid()
911 * @see pkgmgrinfo_pkginfo_is_removable()
913 static int get_pkg_description(const char *pkgid)
916 char *description = NULL;
917 pkgmgrinfo_pkginfo_h handle;
918 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
919 if (ret != PMINFO_R_OK)
921 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
922 if (ret != PMINFO_R_OK) {
923 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
926 printf("pkg description: %s\n", description);
927 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
932 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
935 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
936 * @brief This API gets the package's author name from the package ID
938 * @par This API is for package-manager client application
939 * @par Sync (or) Async : Synchronous API
941 * @param[in] handle pointer to package info handle
942 * @param[out] author_name pointer to hold package author name
943 * @return 0 if success, error code(<0) if fail
944 * @retval PMINFO_R_OK success
945 * @retval PMINFO_R_EINVAL invalid argument
946 * @retval PMINFO_R_ERROR internal error
947 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
948 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
949 * @see pkgmgrinfo_pkginfo_get_pkgid()
950 * @see pkgmgrinfo_pkginfo_is_removable()
952 static int get_pkg_author_name(const char *pkgid)
955 char *author_name = NULL;
956 pkgmgrinfo_pkginfo_h handle;
957 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
958 if (ret != PMINFO_R_OK)
960 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
961 if (ret != PMINFO_R_OK) {
962 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
965 printf("pkg author name: %s\n", author_name);
966 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
971 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
974 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
975 * @brief This API gets the package's author email from the package ID
977 * @par This API is for package-manager client application
978 * @par Sync (or) Async : Synchronous API
980 * @param[in] handle pointer to package info handle
981 * @param[out] author_email pointer to hold package author email
982 * @return 0 if success, error code(<0) if fail
983 * @retval PMINFO_R_OK success
984 * @retval PMINFO_R_EINVAL invalid argument
985 * @retval PMINFO_R_ERROR internal error
986 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
987 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
988 * @see pkgmgrinfo_pkginfo_get_pkgid()
989 * @see pkgmgrinfo_pkginfo_is_removable()
991 static int get_pkg_author_email(const char *pkgid)
994 char *author_email = NULL;
995 pkgmgrinfo_pkginfo_h handle;
996 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
997 if (ret != PMINFO_R_OK)
999 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1000 if (ret != PMINFO_R_OK) {
1001 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1004 printf("pkg author email: %s\n", author_email);
1005 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1010 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1013 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1014 * @brief This API gets the package's author href from the package ID
1016 * @par This API is for package-manager client application
1017 * @par Sync (or) Async : Synchronous API
1019 * @param[in] handle pointer to package info handle
1020 * @param[out] author_href pointer to hold package author href
1021 * @return 0 if success, error code(<0) if fail
1022 * @retval PMINFO_R_OK success
1023 * @retval PMINFO_R_EINVAL invalid argument
1024 * @retval PMINFO_R_ERROR internal error
1025 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1026 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1027 * @see pkgmgrinfo_pkginfo_get_pkgid()
1028 * @see pkgmgrinfo_pkginfo_is_removable()
1030 static int get_pkg_author_href(const char *pkgid)
1033 char *author_href = NULL;
1034 pkgmgrinfo_pkginfo_h handle;
1035 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1036 if (ret != PMINFO_R_OK)
1038 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1039 if (ret != PMINFO_R_OK) {
1040 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1043 printf("pkg author href: %s\n", author_href);
1044 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1049 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1052 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1053 * @brief This API gets the package installed storagae value from the package ID
1055 * @par This API is for package-manager client application
1056 * @par Sync (or) Async : Synchronous API
1058 * @param[in] handle pointer to package info handle
1059 * @param[out] storage pointer to hold package installed storage
1060 * @return 0 if success, error code(<0) if fail
1061 * @retval PMINFO_R_OK success
1062 * @retval PMINFO_R_EINVAL invalid argument
1063 * @retval PMINFO_R_ERROR internal error
1064 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1065 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1066 * @see pkgmgrinfo_pkginfo_get_pkgid()
1067 * @see pkgmgrinfo_pkginfo_is_removable()
1069 static int get_pkg_installed_storage(const char *pkgid)
1072 pkgmgrinfo_installed_storage storage;
1073 pkgmgrinfo_pkginfo_h handle;
1074 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1075 if (ret != PMINFO_R_OK)
1077 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1078 if (ret != PMINFO_R_OK) {
1079 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1082 printf("pkg installed storage: %d\n", storage);
1083 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1088 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1091 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1092 * @brief This API gets the installed time of package from the package ID
1094 * @par This API is for package-manager client application
1095 * @par Sync (or) Async : Synchronous API
1097 * @param[in] handle pointer to package info handle
1098 * @param[out] installed_time pointer to hold installed time of package
1099 * @return 0 if success, error code(<0) if fail
1100 * @retval PMINFO_R_OK success
1101 * @retval PMINFO_R_EINVAL invalid argument
1102 * @retval PMINFO_R_ERROR internal error
1103 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1104 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1105 * @see pkgmgrinfo_pkginfo_get_pkgid()
1106 * @see pkgmgrinfo_pkginfo_is_removable()
1108 static int get_pkg_installed_time(const char *pkgid)
1111 int installed_time = 0;
1112 pkgmgrinfo_pkginfo_h handle;
1113 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1114 if (ret != PMINFO_R_OK)
1116 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1117 if (ret != PMINFO_R_OK) {
1118 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1121 printf("installed_time: %d\n", installed_time);
1122 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1127 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1130 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1131 * @brief This API gets the store client id of package from the package ID
1133 * @par This API is for package-manager client application
1134 * @par Sync (or) Async : Synchronous API
1136 * @param[in] handle pointer to package info handle
1137 * @param[out] storeclientid pointer to hold store client id of package
1138 * @return 0 if success, error code(<0) if fail
1139 * @retval PMINFO_R_OK success
1140 * @retval PMINFO_R_EINVAL invalid argument
1141 * @retval PMINFO_R_ERROR internal error
1142 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1143 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1144 * @see pkgmgrinfo_pkginfo_get_pkgid()
1145 * @see pkgmgrinfo_pkginfo_is_removable()
1147 static int get_pkg_storeclientid(const char *pkgid)
1150 char *storeclientid = 0;
1151 pkgmgrinfo_pkginfo_h handle;
1152 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1153 if (ret != PMINFO_R_OK)
1155 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1156 if (ret != PMINFO_R_OK) {
1157 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1160 printf(store client id: %s\n", storeclientid);
1161 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1166 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1169 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1170 * @brief This API gets the main app id of package from the package ID
1172 * @par This API is for package-manager client application
1173 * @par Sync (or) Async : Synchronous API
1175 * @param[in] handle pointer to package info handle
1176 * @param[out] mainappid pointer to hold main app id of package
1177 * @return 0 if success, error code(<0) if fail
1178 * @retval PMINFO_R_OK success
1179 * @retval PMINFO_R_EINVAL invalid argument
1180 * @retval PMINFO_R_ERROR internal error
1181 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1182 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1183 * @see pkgmgrinfo_pkginfo_get_pkgid()
1184 * @see pkgmgrinfo_pkginfo_is_removable()
1186 static int get_pkg_mainappid(const char *pkgid)
1189 char *mainappid = 0;
1190 pkgmgrinfo_pkginfo_h handle;
1191 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1192 if (ret != PMINFO_R_OK)
1194 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1195 if (ret != PMINFO_R_OK) {
1196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1199 printf(main app id: %s\n", mainappid);
1200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1205 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1208 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1209 * @brief This API gets the url of package from the package ID
1211 * @par This API is for package-manager client application
1212 * @par Sync (or) Async : Synchronous API
1214 * @param[in] handle pointer to package info handle
1215 * @param[out] url pointer to hold url of package
1216 * @return 0 if success, error code(<0) if fail
1217 * @retval PMINFO_R_OK success
1218 * @retval PMINFO_R_EINVAL invalid argument
1219 * @retval PMINFO_R_ERROR internal error
1220 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1221 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1222 * @see pkgmgrinfo_pkginfo_get_pkgid()
1223 * @see pkgmgrinfo_pkginfo_is_removable()
1225 static int get_pkg_url(const char *pkgid)
1229 pkgmgrinfo_pkginfo_h handle;
1230 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1231 if (ret != PMINFO_R_OK)
1233 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1234 if (ret != PMINFO_R_OK) {
1235 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1238 printf("url : %s\n", url);
1239 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1244 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1248 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1249 * @brief This API gets the root path of package
1251 * @par Sync (or) Async : Synchronous API
1253 * @param[in] handle pointer to package info handle
1254 * @param[out] path pointer to hold root path of package
1255 * @return 0 if success, error code(<0) if fail
1256 * @retval PMINFO_R_OK success
1257 * @retval PMINFO_R_EINVAL invalid argument
1258 * @retval PMINFO_R_ERROR internal error
1260 static int get_root_path(const char *pkgid)
1264 pkgmgrinfo_pkginfo_h handle;
1265 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1266 if (ret != PMINFO_R_OK)
1269 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1270 if (ret != PMINFO_R_OK) {
1271 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1274 printf("path : %s\n", path);
1275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1281 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1285 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1286 * @brief This API gets the csc path of package
1288 * @par Sync (or) Async : Synchronous API
1290 * @param[in] handle pointer to package info handle
1291 * @param[out] path pointer to hold csc path of package
1292 * @return 0 if success, error code(<0) if fail
1293 * @retval PMINFO_R_OK success
1294 * @retval PMINFO_R_EINVAL invalid argument
1295 * @retval PMINFO_R_ERROR internal error
1297 static int get_csc_path(const char *pkgid)
1301 pkgmgrinfo_pkginfo_h handle;
1302 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1303 if (ret != PMINFO_R_OK)
1306 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1307 if (ret != PMINFO_R_OK) {
1308 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1311 printf("path : %s\n", path);
1312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1318 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1321 * @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)
1322 * @brief This API compare the cert information from given package id
1324 * @par This API is for package-manager client application
1325 * @par Sync (or) Async : Synchronous API
1327 * @param[in] lhs_package_id pointer to first package ID
1328 * @param[in] rhs_package_id pointer to second package ID
1329 * @param[out] compare_result pointer to the compare result.
1330 * @return 0 if success, error code(<0) if fail
1331 * @retval PMINFO_R_OK success
1332 * @retval PMINFO_R_EINVAL invalid argument
1333 * @retval PMINFO_R_ERROR internal error
1335 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1336 * @see pkgmgrinfo_pkginfo_get_pkgid()
1337 * @see pkgmgrinfo_pkginfo_is_removable()
1339 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1342 pkgmgrinfo_cert_compare_result_type_e result;
1344 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1345 if (ret != PMINFO_R_OK) {
1348 printf("result: %d\n", result);
1353 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);
1356 * @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)
1357 * @brief This API compare the cert information from given app id
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] lhs_app_id pointer to first app ID
1363 * @param[in] rhs_app_id pointer to second app ID
1364 * @param[out] compare_result pointer to the compare result.
1365 * @return 0 if success, error code(<0) if fail
1366 * @retval PMINFO_R_OK success
1367 * @retval PMINFO_R_EINVAL invalid argument
1368 * @retval PMINFO_R_ERROR internal error
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_removable()
1374 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1377 pkgmgrinfo_cert_compare_result_type_e result;
1379 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1380 if (ret != PMINFO_R_OK) {
1383 printf("result: %d\n", result);
1388 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);
1391 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1392 * @brief This API gets the package 'removable' value from the package ID
1394 * @par This API is for package-manager client application
1395 * @par Sync (or) Async : Synchronous API
1397 * @param[in] handle pointer to package info handle
1398 * @param[out] removable pointer to hold package removable value
1399 * @return 0 if success, error code(<0) if fail
1400 * @retval PMINFO_R_OK success
1401 * @retval PMINFO_R_EINVAL invalid argument
1402 * @retval PMINFO_R_ERROR internal error
1403 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1404 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1405 * @see pkgmgrinfo_pkginfo_get_pkgid()
1406 * @see pkgmgrinfo_pkginfo_is_readonly()
1408 static int get_pkg_removable(const char *pkgid)
1412 pkgmgrinfo_pkginfo_h handle;
1413 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1414 if (ret != PMINFO_R_OK)
1416 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1417 if (ret != PMINFO_R_OK) {
1418 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1421 printf("pkg removable: %d\n", removable);
1422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1427 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1430 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1431 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1433 * @par This API is for package-manager client application
1434 * @par Sync (or) Async : Synchronous API
1436 * @param[in] handle pointer to package info handle
1437 * @param[out] movable pointer to hold package movable state
1438 * @return 0 if success, error code(<0) if fail
1439 * @retval PMINFO_R_OK success
1440 * @retval PMINFO_R_EINVAL invalid argument
1441 * @retval PMINFO_R_ERROR internal error
1442 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1443 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1444 * @see pkgmgrinfo_pkginfo_get_pkgid()
1446 static int get_pkg_movable(const char *pkgid)
1450 pkgmgrinfo_pkginfo_h handle;
1451 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1452 if (ret != PMINFO_R_OK)
1454 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1455 if (ret != PMINFO_R_OK) {
1456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1459 printf("pkg movable: %d\n", movable);
1460 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1465 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1468 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1469 * @brief This API gets the package 'preload' value from the package ID
1471 * @par This API is for package-manager client application
1472 * @par Sync (or) Async : Synchronous API
1474 * @param[in] handle pointer to package info handle
1475 * @param[out] preload pointer to hold package preload value
1476 * @return 0 if success, error code(<0) if fail
1477 * @retval PMINFO_R_OK success
1478 * @retval PMINFO_R_EINVAL invalid argument
1479 * @retval PMINFO_R_ERROR internal error
1480 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1481 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1482 * @see pkgmgrinfo_pkginfo_get_pkgid()
1483 * @see pkgmgrinfo_pkginfo_is_readonly()
1485 static int get_pkg_preload(const char *pkgid)
1489 pkgmgrinfo_pkginfo_h handle;
1490 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1491 if (ret != PMINFO_R_OK)
1493 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1494 if (ret != PMINFO_R_OK) {
1495 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1498 printf("pkg preload: %d\n", preload);
1499 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1504 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1507 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1508 * @brief This API gets the package 'readonly' value from the package ID
1510 * @par This API is for package-manager client application
1511 * @par Sync (or) Async : Synchronous API
1513 * @param[in] handle pointer to package info handle
1514 * @param[out] readonly pointer to hold package readonly value
1515 * @return 0 if success, error code(<0) if fail
1516 * @retval PMINFO_R_OK success
1517 * @retval PMINFO_R_EINVAL invalid argument
1518 * @retval PMINFO_R_ERROR internal error
1519 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1520 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1521 * @see pkgmgrinfo_pkginfo_get_pkgid()
1522 * @see pkgmgrinfo_pkginfo_is_removable()
1524 static int get_pkg_readonly(const char *pkgid)
1528 pkgmgrinfo_pkginfo_h handle;
1529 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1530 if (ret != PMINFO_R_OK)
1532 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1533 if (ret != PMINFO_R_OK) {
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1537 printf("pkg readonly: %d\n", readonly);
1538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1543 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1547 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1548 * @brief This API gets the package 'upate' value from the package ID
1550 * @par This API is for package-manager client application
1551 * @par Sync (or) Async : Synchronous API
1553 * @param[in] handle pointer to package info handle
1554 * @param[out] update pointer to hold package update value
1555 * @return 0 if success, error code(<0) if fail
1556 * @retval PMINFO_R_OK success
1557 * @retval PMINFO_R_EINVAL invalid argument
1558 * @retval PMINFO_R_ERROR internal error
1559 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1560 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1561 * @see pkgmgrinfo_pkginfo_get_pkgid()
1563 static int get_pkg_update(const char *pkgid)
1567 pkgmgrinfo_pkginfo_h handle;
1568 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1569 if (ret != PMINFO_R_OK)
1571 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1572 if (ret != PMINFO_R_OK) {
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1576 printf("pkg update: %d\n", update);
1577 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1582 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1585 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1586 * @brief This API gets the package 'accessible' value from the package ID
1588 * @par This API is for package-manager client application
1589 * @par Sync (or) Async : Synchronous API
1591 * @param[in] handle pointer to package info handle
1592 * @param[out] accessible pointer to hold package accessible value
1593 * @return 0 if success, error code(<0) if fail
1594 * @retval PMINFO_R_OK success
1595 * @retval PMINFO_R_EINVAL invalid argument
1596 * @retval PMINFO_R_ERROR internal error
1597 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1598 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1599 * @see pkgmgrinfo_pkginfo_get_pkgid()
1600 * @see pkgmgrinfo_pkginfo_is_readonly()
1602 static int get_pkg_accessible(const char *pkgid)
1606 pkgmgrinfo_pkginfo_h handle;
1607 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1608 if (ret != PMINFO_R_OK)
1610 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1611 if (ret != PMINFO_R_OK) {
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1615 printf("pkg accessible: %d\n", accessible);
1616 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1621 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1624 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1625 * @brief This API destroys the package information handle freeing up all the resources
1627 * @par This API is for package-manager client application
1628 * @par Sync (or) Async : Synchronous API
1630 * @param[in] handle pointer to the package info handle
1631 * @return 0 if success, error code(<0) if fail
1632 * @retval PMINFO_R_OK success
1633 * @retval PMINFO_R_EINVAL invalid argument
1634 * @retval PMINFO_R_ERROR internal error
1635 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1637 * @see pkgmgrinfo_pkginfo_get_pkgid()
1638 * @see pkgmgrinfo_pkginfo_is_removable()
1640 static int get_pkg_type(const char *pkgid)
1644 pkgmgrinfo_pkginfo_h handle;
1645 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1646 if (ret != PMINFO_R_OK)
1648 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1649 if (ret != PMINFO_R_OK) {
1650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1653 printf("pkgtype: %s\n", type);
1654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1659 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1662 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1663 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1664 The query will search the entire package information collected from the manifest file of all the installed packages
1666 * @par This API is for package-manager client application
1667 * @par Sync (or) Async : Synchronous API
1669 * @param[out] handle pointer to the package info filter handle.
1670 * @return 0 if success, error code(<0) if fail
1671 * @retval PMINFO_R_OK success
1672 * @retval PMINFO_R_EINVAL invalid argument
1673 * @retval PMINFO_R_ERROR internal error
1675 * @post pkgmgrinfo_pkginfo_filter_destroy()
1676 * @see pkgmgrinfo_pkginfo_filter_count()
1677 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1679 static int get_rpm_pkg_count()
1683 pkgmgrinfo_pkginfo_filter_h handle;
1684 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1685 if (ret != PMINFO_R_OK)
1687 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1688 if (ret != PMINFO_R_OK) {
1689 pkgmgrinfo_pkginfo_filter_destroy(handle);
1692 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1693 if (ret != PMINFO_R_OK) {
1694 pkgmgrinfo_pkginfo_filter_destroy(handle);
1697 printf("No of rpm pkgs: %d\n", count);
1698 pkgmgrinfo_pkginfo_filter_destroy(handle);
1703 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1706 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1707 * @brief This API destroys the package information filter handle freeing up all the resources
1709 * @par This API is for package-manager client application
1710 * @par Sync (or) Async : Synchronous API
1712 * @param[in] handle pointer to the package info filter handle.
1713 * @return 0 if success, error code(<0) if fail
1714 * @retval PMINFO_R_OK success
1715 * @retval PMINFO_R_EINVAL invalid argument
1716 * @retval PMINFO_R_ERROR internal error
1717 * @pre pkgmgrinfo_pkginfo_filter_create()
1719 * @see pkgmgrinfo_pkginfo_filter_count()
1720 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1722 static int get_rpm_pkg_count()
1726 pkgmgrinfo_pkginfo_filter_h handle;
1727 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1728 if (ret != PMINFO_R_OK)
1730 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1731 if (ret != PMINFO_R_OK) {
1732 pkgmgrinfo_pkginfo_filter_destroy(handle);
1735 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1736 if (ret != PMINFO_R_OK) {
1737 pkgmgrinfo_pkginfo_filter_destroy(handle);
1740 printf("No of rpm pkgs: %d\n", count);
1741 pkgmgrinfo_pkginfo_filter_destroy(handle);
1746 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1749 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1750 * @brief This API adds a boolean filter property to the filter handle
1752 * @par This API is for package-manager client application
1753 * @par Sync (or) Async : Synchronous API
1755 * @param[in] handle pointer to the package info filter handle.
1756 * @param[in] property boolean property name.
1757 * @param[in] value value corresponding to the property.
1758 * @return 0 if success, error code(<0) if fail
1759 * @retval PMINFO_R_OK success
1760 * @retval PMINFO_R_EINVAL invalid argument
1761 * @retval PMINFO_R_ERROR internal error
1762 * @pre pkgmgrinfo_pkginfo_filter_create()
1763 * @post pkgmgrinfo_pkginfo_filter_destroy()
1764 * @see pkgmgrinfo_pkginfo_filter_count()
1765 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1767 static int get_preload_pkg_count()
1771 pkgmgrinfo_pkginfo_filter_h handle;
1772 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1773 if (ret != PMINFO_R_OK)
1775 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1776 if (ret != PMINFO_R_OK) {
1777 pkgmgrinfo_pkginfo_filter_destroy(handle);
1780 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1781 if (ret != PMINFO_R_OK) {
1782 pkgmgrinfo_pkginfo_filter_destroy(handle);
1785 printf("No of preload pkgs: %d\n", count);
1786 pkgmgrinfo_pkginfo_filter_destroy(handle);
1791 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1792 const char *property, const bool value);
1795 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1796 * @brief This API adds an integer filter property to the filter handle
1798 * @par This API is for package-manager client application
1799 * @par Sync (or) Async : Synchronous API
1801 * @param[in] handle pointer to the package info filter handle.
1802 * @param[in] property integer property name.
1803 * @param[in] value value corresponding to the property.
1804 * @return 0 if success, error code(<0) if fail
1805 * @retval PMINFO_R_OK success
1806 * @retval PMINFO_R_EINVAL invalid argument
1807 * @retval PMINFO_R_ERROR internal error
1808 * @pre pkgmgrinfo_pkginfo_filter_create()
1809 * @post pkgmgrinfo_pkginfo_filter_destroy()
1810 * @see pkgmgrinfo_pkginfo_filter_count()
1811 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1813 static int get_pkg_count()
1817 pkgmgrinfo_pkginfo_filter_h handle;
1818 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1819 if (ret != PMINFO_R_OK)
1821 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1822 if (ret != PMINFO_R_OK) {
1823 pkgmgrinfo_pkginfo_filter_destroy(handle);
1826 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1827 if (ret != PMINFO_R_OK) {
1828 pkgmgrinfo_pkginfo_filter_destroy(handle);
1831 printf("No of preload pkgs: %d\n", count);
1832 pkgmgrinfo_pkginfo_filter_destroy(handle);
1837 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1838 const char *property, const int value);
1841 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1842 * @brief This API adds a string filter property to the filter handle
1844 * @par This API is for package-manager client application
1845 * @par Sync (or) Async : Synchronous API
1847 * @param[in] handle pointer to the package info filter handle.
1848 * @param[in] property string property name.
1849 * @param[in] value value corresponding to the property.
1850 * @return 0 if success, error code(<0) if fail
1851 * @retval PMINFO_R_OK success
1852 * @retval PMINFO_R_EINVAL invalid argument
1853 * @retval PMINFO_R_ERROR internal error
1854 * @pre pkgmgrinfo_pkginfo_filter_create()
1855 * @post pkgmgrinfo_pkginfo_filter_destroy()
1856 * @see pkgmgrinfo_pkginfo_filter_count()
1857 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1859 static int get_rpm_pkg_count()
1863 pkgmgrinfo_pkginfo_filter_h handle;
1864 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1865 if (ret != PMINFO_R_OK)
1867 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1868 if (ret != PMINFO_R_OK) {
1869 pkgmgrinfo_pkginfo_filter_destroy(handle);
1872 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1873 if (ret != PMINFO_R_OK) {
1874 pkgmgrinfo_pkginfo_filter_destroy(handle);
1877 printf("No of rpm pkgs: %d\n", count);
1878 pkgmgrinfo_pkginfo_filter_destroy(handle);
1883 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1884 const char *property, const char *value);
1887 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1888 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1890 * @par This API is for package-manager client application
1891 * @par Sync (or) Async : Synchronous API
1893 * @param[in] handle pointer to the package info filter handle.
1894 * @param[in] pkg_cb callback function.
1895 * @param[in] user_data user data to be passed to the callback function
1896 * @return 0 if success, error code(<0) if fail
1897 * @retval PMINFO_R_OK success
1898 * @retval PMINFO_R_EINVAL invalid argument
1899 * @retval PMINFO_R_ERROR internal error
1900 * @pre pkgmgrinfo_pkginfo_filter_create()
1901 * @post pkgmgrinfo_pkginfo_filter_destroy()
1902 * @see pkgmgrinfo_pkginfo_filter_count()
1904 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1907 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1908 printf("pkg id : %s\n", pkgid);
1912 static int get_rpm_pkg_list()
1915 pkgmgrinfo_pkginfo_filter_h handle;
1916 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1917 if (ret != PMINFO_R_OK)
1919 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1920 if (ret != PMINFO_R_OK) {
1921 pkgmgrinfo_pkginfo_filter_destroy(handle);
1924 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1925 if (ret != PMINFO_R_OK) {
1926 pkgmgrinfo_pkginfo_filter_destroy(handle);
1929 pkgmgrinfo_pkginfo_filter_destroy(handle);
1934 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1935 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1938 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1939 * @brief This API counts the package that satisfy the filter conditions
1941 * @par This API is for package-manager client application
1942 * @par Sync (or) Async : Synchronous API
1944 * @param[in] handle pointer to the package info filter handle.
1945 * @param[in] count pointer to store the count value.
1946 * @return 0 if success, error code(<0) if fail
1947 * @retval PMINFO_R_OK success
1948 * @retval PMINFO_R_EINVAL invalid argument
1949 * @retval PMINFO_R_ERROR internal error
1950 * @pre pkgmgrinfo_pkginfo_filter_create()
1951 * @post pkgmgrinfo_pkginfo_filter_destroy()
1952 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1954 static int get_rpm_pkg_count()
1958 pkgmgrinfo_pkginfo_filter_h handle;
1959 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1960 if (ret != PMINFO_R_OK)
1962 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1963 if (ret != PMINFO_R_OK) {
1964 pkgmgrinfo_pkginfo_filter_destroy(handle);
1967 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1968 if (ret != PMINFO_R_OK) {
1969 pkgmgrinfo_pkginfo_filter_destroy(handle);
1972 printf("No of rpm pkgs: %d\n", count);
1973 pkgmgrinfo_pkginfo_filter_destroy(handle);
1978 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1981 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1982 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1983 * @brief This API gets the list of privilege for a particular package
1985 * @par This API is for package-manager client application
1986 * @par Sync (or) Async : Synchronous API
1987 * @param[in] handle pointer to the package info handle.
1988 * @param[in] privilege_func callback function for list
1989 * @param[in] user_data user data to be passed to callback function
1990 * @return 0 if success, error code(<0) if fail
1991 * @retval PMINFO_R_OK success
1992 * @retval PMINFO_R_EINVAL invalid argument
1993 * @retval PMINFO_R_ERROR internal error
1994 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1995 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1997 int privilege_func(const char *name, void *user_data)
1999 if (strcmp(name, (char *)user_data) == 0)
2005 static int list_privilege(const char *package, char *privilege)
2008 pkgmgrinfo_pkginfo_h handle;
2009 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2010 if (ret != PMINFO_R_OK)
2012 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2013 if (ret != PMINFO_R_OK) {
2014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2017 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2022 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2023 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2026 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2027 pkgmgrinfo_app_list_cb app_func, void *user_data)
2028 * @brief This API gets list of installed applications for a particular package
2030 * @par This API is for package-manager client application
2031 * @par Sync (or) Async : Synchronous API
2032 * @param[in] handle package info handle
2033 * @param[in] component application component
2034 * @param[in] app_func iteration function for list
2035 * @param[in] user_data user data to be passed to callback function
2036 * @return 0 if success, error code(<0) if fail
2037 * @retval PMINFO_R_OK success
2038 * @retval PMINFO_R_EINVAL invalid argument
2039 * @retval PMINFO_R_ERROR internal error
2040 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2041 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2043 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2046 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2047 printf("appid : %s\n", appid);
2051 static int list_apps(const char *pkgid)
2054 pkgmgrinfo_pkginfo_h handle;
2055 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2056 if (ret != PMINFO_R_OK)
2058 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2059 if (ret != PMINFO_R_OK) {
2060 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2063 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2068 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2069 pkgmgrinfo_app_list_cb app_func, void *user_data);
2071 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2072 * @brief This API gets list of installed applications from all packages with minimum informaion.
2074 * @par This API is for package-manager client application
2075 * @par Sync (or) Async : Synchronous API
2076 * @param[in] app_func iteration function for list
2077 * @param[in] user_data user data to be passed to callback function
2078 * @return 0 if success, error code(<0) if fail
2079 * @retval PMINFO_R_OK success
2080 * @retval PMINFO_R_EINVAL invalid argument
2081 * @retval PMINFO_R_ERROR internal error
2085 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2087 char *pkgid1 = NULL;
2088 char *pkgid2 = NULL;
2089 pkgid1 = (char *)user_data;
2090 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2091 if (strcmp(pkgid1, pkgid2) == 0) {
2098 static int list_apps()
2101 char *name = "helloworld";
2102 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2103 if (ret != PMINFO_R_OK) {
2110 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2113 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2114 * @brief This API gets list of installed applications from all packages.
2116 * @par This API is for package-manager client application
2117 * @par Sync (or) Async : Synchronous API
2118 * @param[in] app_func iteration function for list
2119 * @param[in] user_data user data to be passed to callback function
2120 * @return 0 if success, error code(<0) if fail
2121 * @retval PMINFO_R_OK success
2122 * @retval PMINFO_R_EINVAL invalid argument
2123 * @retval PMINFO_R_ERROR internal error
2127 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2129 char *pkgid1 = NULL;
2130 char *pkgid2 = NULL;
2131 pkgid1 = (char *)user_data;
2132 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2133 if (strcmp(pkgid1, pkgid2) == 0) {
2140 static int list_apps()
2143 char *name = "helloworld";
2144 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2145 if (ret != PMINFO_R_OK) {
2152 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2155 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2156 * @brief This API creates the application information handle from db
2158 * @par This API is for package-manager client application
2159 * @par Sync (or) Async : Synchronous API
2161 * @param[in] appid pointer to appid
2162 * @param[out] handle pointer to the application info handle.
2163 * @return 0 if success, error code(<0) if fail
2164 * @retval PMINFO_R_OK success
2165 * @retval PMINFO_R_EINVAL invalid argument
2166 * @retval PMINFO_R_ERROR internal error
2168 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2169 * @see pkgmgrinfo_appinfo_get_pkgid()
2170 * @see pkgmgrinfo_appinfo_is_multiple()
2172 static int get_app_type(const char *appid)
2176 pkgmgrinfo_appinfo_h handle;
2177 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2178 if (ret != PMINFO_R_OK)
2180 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2181 if (ret != PMINFO_R_OK) {
2182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2185 printf("apptype: %s\n", type);
2186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2191 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2194 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2195 * @brief This API gets the application ID
2197 * @par This API is for package-manager client application
2198 * @par Sync (or) Async : Synchronous API
2200 * @param[in] handle pointer to the application info handle.
2201 * @param[out] appid pointer to hold appid
2202 * @return 0 if success, error code(<0) if fail
2203 * @retval PMINFO_R_OK success
2204 * @retval PMINFO_R_EINVAL invalid argument
2205 * @retval PMINFO_R_ERROR internal error
2206 * @pre pkgmgrinfo_appinfo_get_appinfo()
2207 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2208 * @see pkgmgrinfo_appinfo_get_pkgid()
2209 * @see pkgmgrinfo_appinfo_is_multiple()
2211 static int get_app_id(const char *appid)
2214 char *app_id = NULL;
2215 pkgmgrinfo_appinfo_h handle;
2216 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2217 if (ret != PMINFO_R_OK)
2219 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2220 if (ret != PMINFO_R_OK) {
2221 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2224 printf("app id: %s\n", app_id);
2225 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2230 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2233 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2234 * @brief This API gets the package name of the application
2236 * @par This API is for package-manager client application
2237 * @par Sync (or) Async : Synchronous API
2239 * @param[in] handle pointer to the application info handle.
2240 * @param[out] pkg_name pointer to hold package name
2241 * @return 0 if success, error code(<0) if fail
2242 * @retval PMINFO_R_OK success
2243 * @retval PMINFO_R_EINVAL invalid argument
2244 * @retval PMINFO_R_ERROR internal error
2245 * @pre pkgmgrinfo_appinfo_get_appinfo()
2246 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2247 * @see pkgmgrinfo_appinfo_get_appid()
2248 * @see pkgmgrinfo_appinfo_is_multiple()
2250 static int get_app_pkgname(const char *appid)
2253 char *pkgname = NULL;
2254 pkgmgrinfo_appinfo_h handle;
2255 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2256 if (ret != PMINFO_R_OK)
2258 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2259 if (ret != PMINFO_R_OK) {
2260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2263 printf("pkg name: %s\n", pkgname);
2264 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2269 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2272 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2273 * @brief This API gets the package id of the application
2275 * @par This API is for package-manager client application
2276 * @par Sync (or) Async : Synchronous API
2278 * @param[in] handle pointer to the application info handle.
2279 * @param[out] pkgid pointer to hold package id
2280 * @return 0 if success, error code(<0) if fail
2281 * @retval PMINFO_R_OK success
2282 * @retval PMINFO_R_EINVAL invalid argument
2283 * @retval PMINFO_R_ERROR internal error
2284 * @pre pkgmgrinfo_appinfo_get_appinfo()
2285 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2286 * @see pkgmgrinfo_appinfo_get_appid()
2287 * @see pkgmgrinfo_appinfo_is_multiple()
2289 static int get_app_pkgid(const char *appid)
2293 pkgmgrinfo_appinfo_h handle;
2294 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2295 if (ret != PMINFO_R_OK)
2297 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2298 if (ret != PMINFO_R_OK) {
2299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2302 printf("pkg id: %s\n", pkgid);
2303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2308 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2311 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2312 * @brief This API gets the executable name of the application
2314 * @par This API is for package-manager client application
2315 * @par Sync (or) Async : Synchronous API
2317 * @param[in] handle pointer to the application info handle.
2318 * @param[out] exec pointer to hold app exec name
2319 * @return 0 if success, error code(<0) if fail
2320 * @retval PMINFO_R_OK success
2321 * @retval PMINFO_R_EINVAL invalid argument
2322 * @retval PMINFO_R_ERROR internal error
2323 * @pre pkgmgrinfo_appinfo_get_appinfo()
2324 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2325 * @see pkgmgrinfo_appinfo_get_appid()
2326 * @see pkgmgrinfo_appinfo_is_multiple()
2328 static int get_app_exec(const char *appid)
2332 pkgmgrinfo_appinfo_h handle;
2333 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2334 if (ret != PMINFO_R_OK)
2336 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2337 if (ret != PMINFO_R_OK) {
2338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2341 printf("exec name: %s\n", exec);
2342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2347 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2350 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2351 * @brief This API gets the icon name of the application
2353 * @par This API is for package-manager client application
2354 * @par Sync (or) Async : Synchronous API
2356 * @param[in] handle pointer to the application info handle.
2357 * @param[out] icon pointer to hold app icon name
2358 * @return 0 if success, error code(<0) if fail
2359 * @retval PMINFO_R_OK success
2360 * @retval PMINFO_R_EINVAL invalid argument
2361 * @retval PMINFO_R_ERROR internal error
2362 * @pre pkgmgrinfo_appinfo_get_appinfo()
2363 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2364 * @see pkgmgrinfo_appinfo_get_appid()
2365 * @see pkgmgrinfo_appinfo_is_multiple()
2367 static int get_app_icon(const char *appid)
2371 pkgmgrinfo_appinfo_h handle;
2372 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2373 if (ret != PMINFO_R_OK)
2375 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2376 if (ret != PMINFO_R_OK) {
2377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2380 printf("icon name: %s\n", icon);
2381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2386 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2389 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2390 * @brief This API gets the label of the application
2392 * @par This API is for package-manager client application
2393 * @par Sync (or) Async : Synchronous API
2395 * @param[in] handle pointer to the application info handle.
2396 * @param[out] label pointer to hold app label
2397 * @return 0 if success, error code(<0) if fail
2398 * @retval PMINFO_R_OK success
2399 * @retval PMINFO_R_EINVAL invalid argument
2400 * @retval PMINFO_R_ERROR internal error
2401 * @pre pkgmgrinfo_appinfo_get_appinfo()
2402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2403 * @see pkgmgrinfo_appinfo_get_appid()
2404 * @see pkgmgrinfo_appinfo_is_multiple()
2406 static int get_app_label(const char *appid)
2410 pkgmgrinfo_appinfo_h handle;
2411 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2412 if (ret != PMINFO_R_OK)
2414 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2415 if (ret != PMINFO_R_OK) {
2416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2419 printf("label : %s\n", label);
2420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2425 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2428 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2429 * @brief This API gets the component of the application
2431 * @par This API is for package-manager client application
2432 * @par Sync (or) Async : Synchronous API
2434 * @param[in] handle pointer to the application info handle.
2435 * @param[out] component pointer to hold app component
2436 * @return 0 if success, error code(<0) if fail
2437 * @retval PMINFO_R_OK success
2438 * @retval PMINFO_R_EINVAL invalid argument
2439 * @retval PMINFO_R_ERROR internal error
2440 * @pre pkgmgrinfo_appinfo_get_appinfo()
2441 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2442 * @see pkgmgrinfo_appinfo_get_appid()
2443 * @see pkgmgrinfo_appinfo_is_multiple()
2445 static int get_app_component(const char *appid)
2448 pkgmgrinfo_app_component component;
2449 pkgmgrinfo_appinfo_h handle;
2450 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2451 if (ret != PMINFO_R_OK)
2453 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2454 if (ret != PMINFO_R_OK) {
2455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2458 printf("component : %s\n", component);
2459 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2464 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2467 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2468 * @brief This API gets the apptype of the application
2470 * @par This API is for package-manager client application
2471 * @par Sync (or) Async : Synchronous API
2473 * @param[in] handle pointer to the application info handle.
2474 * @param[out] app_type pointer to hold apptype
2475 * @return 0 if success, error code(<0) if fail
2476 * @retval PMINFO_R_OK success
2477 * @retval PMINFO_R_EINVAL invalid argument
2478 * @retval PMINFO_R_ERROR internal error
2479 * @pre pkgmgrinfo_appinfo_get_appinfo()
2480 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2481 * @see pkgmgrinfo_appinfo_get_appid()
2482 * @see pkgmgrinfo_appinfo_is_multiple()
2484 static int get_app_type(const char *appid)
2487 char *apptype = NULL;
2488 pkgmgrinfo_appinfo_h handle;
2489 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2490 if (ret != PMINFO_R_OK)
2492 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2493 if (ret != PMINFO_R_OK) {
2494 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2497 printf("apptype : %s\n", apptype);
2498 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2503 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2506 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2507 int *operation_count, char ***operation)
2508 * @brief This API gets the list of operation of the application
2510 * @par This API is for package-manager client application
2511 * @par Sync (or) Async : Synchronous API
2513 * @param[in] handle pointer to the appcontrol handle.
2514 * @param[out] operation_count pointer to hold number of operations
2515 * @param[out] operation pointer to hold list of operations
2516 * @return 0 if success, error code(<0) if fail
2517 * @retval PMINFO_R_OK success
2518 * @retval PMINFO_R_EINVAL invalid argument
2519 * @retval PMINFO_R_ERROR internal error
2520 * @pre pkgmgrinfo_appinfo_get_appinfo()
2521 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2522 * @see pkgmgrinfo_appinfo_get_uri()
2523 * @see pkgmgrinfo_appinfo_get_mime()
2525 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2530 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2531 for (i = 0; i < oc; i++) {
2532 if (strcmp(operation[i], (char *)user_data) == 0)
2539 static int check_operation(const char *appid, char *operation)
2542 pkgmgrinfo_appinfo_h handle;
2543 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2544 if (ret != PMINFO_R_OK)
2546 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2547 if (ret != PMINFO_R_OK) {
2548 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2556 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2557 int *operation_count, char ***operation);
2560 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2561 int *uri_count, char ***uri)
2562 * @brief This API gets the list of uri of the application
2564 * @par This API is for package-manager client application
2565 * @par Sync (or) Async : Synchronous API
2567 * @param[in] handle pointer to the appcontrol handle.
2568 * @param[out] uri_count pointer to hold number of uris
2569 * @param[out] uri pointer to hold list of uris
2570 * @return 0 if success, error code(<0) if fail
2571 * @retval PMINFO_R_OK success
2572 * @retval PMINFO_R_EINVAL invalid argument
2573 * @retval PMINFO_R_ERROR internal error
2574 * @pre pkgmgrinfo_appinfo_get_appinfo()
2575 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2576 * @see pkgmgrinfo_appinfo_get_operation()
2577 * @see pkgmgrinfo_appinfo_get_mime()
2579 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2584 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2585 for (i = 0; i < uc; i++) {
2586 if (strcmp(uri[i], (char *)user_data) == 0)
2593 static int check_uri(const char *appid, char *uri)
2596 pkgmgrinfo_appinfo_h handle;
2597 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2598 if (ret != PMINFO_R_OK)
2600 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2601 if (ret != PMINFO_R_OK) {
2602 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2610 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2611 int *uri_count, char ***uri);
2614 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2615 int *mime_count, char ***mime)
2616 * @brief This API gets the list of mime of the application
2618 * @par This API is for package-manager client application
2619 * @par Sync (or) Async : Synchronous API
2621 * @param[in] handle pointer to the appcontrol handle.
2622 * @param[out] mime_count pointer to hold number of mimes
2623 * @param[out] mime pointer to hold list of mimes
2624 * @return 0 if success, error code(<0) if fail
2625 * @retval PMINFO_R_OK success
2626 * @retval PMINFO_R_EINVAL invalid argument
2627 * @retval PMINFO_R_ERROR internal error
2628 * @pre pkgmgrinfo_appinfo_get_appinfo()
2629 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2630 * @see pkgmgrinfo_appinfo_get_uri()
2631 * @see pkgmgrinfo_appinfo_get_operation()
2633 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2638 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2639 for (i = 0; i < mc; i++) {
2640 if (strcmp(mime[i], (char *)user_data) == 0)
2647 static int check_mime(const char *appid, char *mime)
2650 pkgmgrinfo_appinfo_h handle;
2651 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2652 if (ret != PMINFO_R_OK)
2654 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2655 if (ret != PMINFO_R_OK) {
2656 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2664 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2665 int *mime_count, char ***mime);
2668 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2669 int *subapp_count, char ***subapp)
2670 * @brief This API gets the list of subapp of the application
2672 * @par This API is for package-manager client application
2673 * @par Sync (or) Async : Synchronous API
2675 * @param[in] handle pointer to the appcontrol handle.
2676 * @param[out] subapp_count pointer to hold number of subapp
2677 * @param[out] subapp pointer to hold list of subapp
2678 * @return 0 if success, error code(<0) if fail
2679 * @retval PMINFO_R_OK success
2680 * @retval PMINFO_R_EINVAL invalid argument
2681 * @retval PMINFO_R_ERROR internal error
2682 * @pre pkgmgrinfo_appinfo_get_appinfo()
2683 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2684 * @see pkgmgrinfo_appinfo_get_uri()
2685 * @see pkgmgrinfo_appinfo_get_operation()
2687 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2691 char **subapp = NULL;
2692 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2693 for (i = 0; i < sc; i++) {
2694 if (strcmp(subapp[i], (char *)user_data) == 0)
2701 static int check_subapp(const char *appid, char *subapp)
2704 pkgmgrinfo_appinfo_h handle = NULL;
2705 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2706 if (ret != PMINFO_R_OK)
2708 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2709 if (ret != PMINFO_R_OK) {
2710 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2713 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2718 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2719 int *subapp_count, char ***subapp);
2722 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2723 * @brief This API gets the notification icon of the application
2725 * @par This API is for package-manager client application
2726 * @par Sync (or) Async : Synchronous API
2728 * @param[in] handle pointer to the application info handle.
2729 * @param[out] path pointer to hold notification icon
2730 * @return 0 if success, error code(<0) if fail
2731 * @retval PMINFO_R_OK success
2732 * @retval PMINFO_R_EINVAL invalid argument
2733 * @retval PMINFO_R_ERROR internal error
2734 * @pre pkgmgrinfo_appinfo_get_appinfo()
2735 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2736 * @see pkgmgrinfo_appinfo_get_appid()
2737 * @see pkgmgrinfo_appinfo_is_multiple()
2739 static int get_app_notification_icon(const char *appid)
2742 char *notification_icon = NULL;
2743 pkgmgrinfo_appinfo_h handle;
2744 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2745 if (ret != PMINFO_R_OK)
2747 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2748 if (ret != PMINFO_R_OK) {
2749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2752 printf("notification icon : %s\n", notification_icon);
2753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2758 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2761 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2762 * @brief This API gets the setting icon of the application
2764 * @par This API is for package-manager client application
2765 * @par Sync (or) Async : Synchronous API
2767 * @param[in] handle pointer to the application info handle.
2768 * @param[out] path pointer to hold setting icon
2769 * @return 0 if success, error code(<0) if fail
2770 * @retval PMINFO_R_OK success
2771 * @retval PMINFO_R_EINVAL invalid argument
2772 * @retval PMINFO_R_ERROR internal error
2773 * @pre pkgmgrinfo_appinfo_get_appinfo()
2774 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2775 * @see pkgmgrinfo_appinfo_get_appid()
2776 * @see pkgmgrinfo_appinfo_is_multiple()
2778 static int get_app_setting_icon(const char *appid)
2781 char *setting_icon = NULL;
2782 pkgmgrinfo_appinfo_h handle;
2783 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2784 if (ret != PMINFO_R_OK)
2786 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2787 if (ret != PMINFO_R_OK) {
2788 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2791 printf("setting icon : %s\n", setting_icon);
2792 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2800 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2801 * @brief This API gets the type of recent image on app-tray
2803 * @par This API is for package-manager client application
2804 * @par Sync (or) Async : Synchronous API
2806 * @param[in] handle pointer to the application info handle.
2807 * @param[out] type pointer to hold image type
2808 * @return 0 if success, error code(<0) if fail
2809 * @retval PMINFO_R_OK success
2810 * @retval PMINFO_R_EINVAL invalid argument
2811 * @retval PMINFO_R_ERROR internal error
2812 * @pre pkgmgrinfo_appinfo_get_appinfo()
2813 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2814 * @see pkgmgrinfo_appinfo_get_appid()
2815 * @see pkgmgrinfo_appinfo_is_multiple()
2817 static int get_app_recent_image_type(const char *appid)
2820 pkgmgrinfo_app_recentimage type;
2821 pkgmgrinfo_appinfo_h handle;
2822 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2823 if (ret != PMINFO_R_OK)
2825 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2826 if (ret != PMINFO_R_OK) {
2827 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2830 printf("recent image type: %d\n", type);
2831 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2836 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2840 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2841 * @brief This API gets the preview image of application
2843 * @par Sync (or) Async : Synchronous API
2845 * @param[in] handle pointer to the application info handle.
2846 * @param[out] preview_img pointer to hold preview image path
2847 * @return 0 if success, error code(<0) if fail
2848 * @retval PMINFO_R_OK success
2849 * @retval PMINFO_R_EINVAL invalid argument
2850 * @retval PMINFO_R_ERROR internal error
2851 * @pre pkgmgrinfo_appinfo_get_appinfo()
2852 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2853 * @see pkgmgrinfo_appinfo_get_appid()
2855 static int get_app_previewimage(const char *appid)
2858 char *preview = NULL;
2859 pkgmgrinfo_appinfo_h handle = NULL;
2860 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2861 if (ret != PMINFO_R_OK)
2863 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2864 if (ret != PMINFO_R_OK) {
2865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2868 printf("preview image path : %s\n", preview);
2869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2874 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2878 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2879 * @brief This API gets the package permission type of the application
2881 * @par This API is for package-manager client application
2882 * @par Sync (or) Async : Synchronous API
2884 * @param[in] handle pointer to the application info handle.
2885 * @param[out] permission pointer to hold package permission
2886 * @return 0 if success, error code(<0) if fail
2887 * @retval PMINFO_R_OK success
2888 * @retval PMINFO_R_EINVAL invalid argument
2889 * @retval PMINFO_R_ERROR internal error
2890 * @pre pkgmgrinfo_appinfo_get_appinfo()
2891 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2892 * @see pkgmgrinfo_appinfo_get_appid()
2894 static int get_app_permission(const char *appid)
2897 pkgmgrinfo_permission_type permission = 0;
2898 pkgmgrinfo_appinfo_h handle;
2900 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2901 if (ret != PMINFO_R_OK)
2903 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2904 if (ret != PMINFO_R_OK) {
2905 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2908 printf("permission type: %d\n", permission);
2909 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2914 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2917 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2918 * @brief This API gets the component_type
2920 * @par This API is for package-manager client application
2921 * @par Sync (or) Async : Synchronous API
2923 * @param[in] handle pointer to the application info handle.
2924 * @param[out] component_type pointer to hold component_type
2925 * @return 0 if success, error code(<0) if fail
2926 * @retval PMINFO_R_OK success
2927 * @retval PMINFO_R_EINVAL invalid argument
2928 * @retval PMINFO_R_ERROR internal error
2929 * @pre pkgmgrinfo_appinfo_get_appinfo()
2930 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2931 * @see pkgmgrinfo_appinfo_get_pkgid()
2932 * @see pkgmgrinfo_appinfo_is_multiple()
2934 static int get_component_type(const char *appid)
2937 char *component_type = NULL;
2938 pkgmgrinfo_appinfo_h handle;
2939 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2940 if (ret != PMINFO_R_OK)
2942 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2943 if (ret != PMINFO_R_OK) {
2944 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2947 printf("component_type: %s\n", component_type);
2948 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2953 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2957 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
2958 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
2959 * @brief This API gets the list of permission for a particular application
2961 * @par This API is for package-manager client application
2962 * @par Sync (or) Async : Synchronous API
2963 * @param[in] handle pointer to the application info handle.
2964 * @param[in] permission_func callback function for list
2965 * @param[in] user_data user data to be passed to callback function
2966 * @return 0 if success, error code(<0) if fail
2967 * @retval PMINFO_R_OK success
2968 * @retval PMINFO_R_EINVAL invalid argument
2969 * @retval PMINFO_R_ERROR internal error
2970 * @pre pkgmgrinfo_appinfo_get_appinfo()
2971 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2973 int permission_func(const char *name, void *user_data)
2975 if (strcmp(name, (char *)user_data) == 0)
2981 static int list_permission(const char *appid, char *permission)
2984 pkgmgrinfo_appinfo_h handle;
2985 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2986 if (ret != PMINFO_R_OK)
2988 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
2989 if (ret != PMINFO_R_OK) {
2990 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2998 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
2999 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3002 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3003 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3004 * @brief This API gets the list of category for a particular application
3006 * @par This API is for package-manager client application
3007 * @par Sync (or) Async : Synchronous API
3008 * @param[in] handle pointer to the application info handle.
3009 * @param[in] category_func callback function for list
3010 * @param[in] user_data user data to be passed to callback function
3011 * @return 0 if success, error code(<0) if fail
3012 * @retval PMINFO_R_OK success
3013 * @retval PMINFO_R_EINVAL invalid argument
3014 * @retval PMINFO_R_ERROR internal error
3015 * @pre pkgmgrinfo_appinfo_get_appinfo()
3016 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3018 int category_func(const char *name, void *user_data)
3020 if (strcmp(name, (char *)user_data) == 0)
3026 static int list_category(const char *appid, char *category)
3029 pkgmgrinfo_appinfo_h handle;
3030 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3031 if (ret != PMINFO_R_OK)
3033 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3034 if (ret != PMINFO_R_OK) {
3035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3038 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3043 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3044 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3047 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3048 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3049 * @brief This API gets the list of metadata for a particular application
3051 * @par This API is for package-manager client application
3052 * @par Sync (or) Async : Synchronous API
3053 * @param[in] handle pointer to the application info handle.
3054 * @param[in] metadata_func callback function for list
3055 * @param[in] user_data user data to be passed to callback function
3056 * @return 0 if success, error code(<0) if fail
3057 * @retval PMINFO_R_OK success
3058 * @retval PMINFO_R_EINVAL invalid argument
3059 * @retval PMINFO_R_ERROR internal error
3060 * @pre pkgmgrinfo_appinfo_get_appinfo()
3061 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3063 int metadata_func(const char *key, const char *value, void *user_data)
3065 if (strcmp(key, (char *)user_data) == 0) {
3066 printf("Value is %s\n", value);
3073 static int list_metadata(const char *appid, char *key)
3076 pkgmgrinfo_appinfo_h handle;
3077 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3078 if (ret != PMINFO_R_OK)
3080 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3081 if (ret != PMINFO_R_OK) {
3082 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3090 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3091 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3095 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3096 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3097 * @brief This API gets the list of app-control for a particular application
3099 * @par This API is for package-manager client application
3100 * @par Sync (or) Async : Synchronous API
3101 * @param[in] handle pointer to the application info handle.
3102 * @param[in] appcontrol_func callback function for list
3103 * @param[in] user_data user data to be passed to callback function
3104 * @return 0 if success, error code(<0) if fail
3105 * @retval PMINFO_R_OK success
3106 * @retval PMINFO_R_EINVAL invalid argument
3107 * @retval PMINFO_R_ERROR internal error
3108 * @pre pkgmgrinfo_appinfo_get_appinfo()
3109 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3111 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3116 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3117 for (i = 0; i < oc; i++) {
3118 if (strcmp(operation[i], (char *)user_data) == 0)
3125 static int check_operation(const char *appid, char *operation)
3128 pkgmgrinfo_appinfo_h handle;
3129 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3130 if (ret != PMINFO_R_OK)
3132 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3133 if (ret != PMINFO_R_OK) {
3134 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3142 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3143 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3146 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3147 * @brief This API gets the application 'nodisplay' value from the app ID
3149 * @par This API is for package-manager client application
3150 * @par Sync (or) Async : Synchronous API
3152 * @param[in] handle pointer to application info handle
3153 * @param[out] nodisplay pointer to hold package nodisplay value
3154 * @return 0 if success, error code(<0) if fail
3155 * @retval PMINFO_R_OK success
3156 * @retval PMINFO_R_EINVAL invalid argument
3157 * @retval PMINFO_R_ERROR internal error
3158 * @pre pkgmgrinfo_appinfo_get_appinfo()
3159 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3160 * @see pkgmgrinfo_appinfo_get_appid()
3161 * @see pkgmgrinfo_appinfo_is_multiple()
3163 static int get_app_nodisplay(const char *appid)
3167 pkgmgrinfo_appinfo_h handle;
3168 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3169 if (ret != PMINFO_R_OK)
3171 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3172 if (ret != PMINFO_R_OK) {
3173 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3176 printf("app nodisplay: %d\n", nodisplay);
3177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3182 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3185 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3186 * @brief This API gets the application 'multiple' value from the app ID
3188 * @par This API is for package-manager client application
3189 * @par Sync (or) Async : Synchronous API
3191 * @param[in] handle pointer to application info handle
3192 * @param[out] multiple pointer to hold package multiple value
3193 * @return 0 if success, error code(<0) if fail
3194 * @retval PMINFO_R_OK success
3195 * @retval PMINFO_R_EINVAL invalid argument
3196 * @retval PMINFO_R_ERROR internal error
3197 * @pre pkgmgrinfo_appinfo_get_appinfo()
3198 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3199 * @see pkgmgrinfo_appinfo_get_appid()
3200 * @see pkgmgrinfo_appinfo_is_nodisplay()
3202 static int get_app_multiple(const char *appid)
3206 pkgmgrinfo_appinfo_h handle;
3207 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3208 if (ret != PMINFO_R_OK)
3210 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3211 if (ret != PMINFO_R_OK) {
3212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3215 printf("app multiple: %d\n", multiple);
3216 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3221 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3224 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3225 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3226 * application launching effect. If fales, indicator will be hidden during application launching effect
3228 * @par This API is for package-manager client application
3229 * @par Sync (or) Async : Synchronous API
3231 * @param[in] handle pointer to application info handle
3232 * @param[out] indicator_disp contains indicator display status for application launching effect
3233 * @return 0 if success, error code(<0) if fail
3234 * @retval PMINFO_R_OK success
3235 * @retval PMINFO_R_EINVAL invalid argument
3236 * @retval PMINFO_R_ERROR internal error
3237 * @pre pkgmgrinfo_appinfo_get_appinfo()
3238 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3239 * @see pkgmgrinfo_appinfo_get_appid()
3240 * @see pkgmgrinfo_appinfo_is_nodisplay()
3242 static int get_app_indicator_display(const char *appid)
3245 bool indicator_disp;
3246 pkgmgrinfo_appinfo_h handle;
3247 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3248 if (ret != PMINFO_R_OK)
3250 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3251 if (ret != PMINFO_R_OK){
3252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3255 printf("app indicator disp : %d\n", indicator_disp);
3256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3261 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3264 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3265 * @brief This API gets the application's landscape & portrait effect images
3267 * @par This API is for package-manager client application
3268 * @par Sync (or) Async : Synchronous API
3270 * @param[in] handle pointer to application info handle
3271 * @param[out] portrait_img contains portrait mode effect image
3272 * @param[out] landscape_img contains landscape mode effect image
3273 * @return 0 if success, error code(<0) if fail
3274 * @retval PMINFO_R_OK success
3275 * @retval PMINFO_R_EINVAL invalid argument
3276 * @retval PMINFO_R_ERROR internal error
3277 * @pre pkgmgrinfo_appinfo_get_appinfo()
3278 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3279 * @see pkgmgrinfo_appinfo_get_appid()
3280 * @see pkgmgrinfo_appinfo_is_nodisplay()
3282 static int get_app_effectimages(const char *appid)
3285 char *portraitimg = NULL;
3286 char *landscapeimg = NULL;
3287 pkgmgrinfo_appinfo_h handle;
3288 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3289 if (ret != PMINFO_R_OK)
3291 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3292 if (ret != PMINFO_R_OK) {
3293 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3296 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3302 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3305 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3306 * @brief This API gets the application 'taskmanage' value from the app ID
3308 * @par This API is for package-manager client application
3309 * @par Sync (or) Async : Synchronous API
3311 * @param[in] handle pointer to application info handle
3312 * @param[out] taskmanage pointer to hold package taskmanage value
3313 * @return 0 if success, error code(<0) if fail
3314 * @retval PMINFO_R_OK success
3315 * @retval PMINFO_R_EINVAL invalid argument
3316 * @retval PMINFO_R_ERROR internal error
3317 * @pre pkgmgrinfo_appinfo_get_appinfo()
3318 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3319 * @see pkgmgrinfo_appinfo_get_appid()
3320 * @see pkgmgrinfo_appinfo_is_multiple()
3322 static int get_app_taskmanage(const char *appid)
3326 pkgmgrinfo_appinfo_h handle;
3327 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3328 if (ret != PMINFO_R_OK)
3330 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3331 if (ret != PMINFO_R_OK) {
3332 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3335 printf("app taskmanage: %d\n", taskmanage);
3336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3341 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3344 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3345 * @brief This API gets the application 'taskmanage' value from the app ID
3347 * @par This API is for package-manager client application
3348 * @par Sync (or) Async : Synchronous API
3350 * @param[in] handle pointer to application info handle
3351 * @param[out] enabled pointer to hold package enabled value
3352 * @return 0 if success, error code(<0) if fail
3353 * @retval PMINFO_R_OK success
3354 * @retval PMINFO_R_EINVAL invalid argument
3355 * @retval PMINFO_R_ERROR internal error
3356 * @pre pkgmgrinfo_appinfo_get_appinfo()
3357 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3358 * @see pkgmgrinfo_appinfo_get_appid()
3359 * @see pkgmgrinfo_appinfo_is_multiple()
3361 static int get_app_enabled(const char *appid)
3365 pkgmgrinfo_appinfo_h handle;
3366 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3367 if (ret != PMINFO_R_OK)
3369 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3370 if (ret != PMINFO_R_OK) {
3371 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3374 printf("app enabled: %d\n", enabled);
3375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3380 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3383 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3384 * @brief This API gets the application 'hwacceleration' value from the app ID
3386 * @par This API is for package-manager client application
3387 * @par Sync (or) Async : Synchronous API
3389 * @param[in] handle pointer to application info handle
3390 * @param[out] hwacceleration pointer to hold package hwacceleration value
3391 * @return 0 if success, error code(<0) if fail
3392 * @retval PMINFO_R_OK success
3393 * @retval PMINFO_R_EINVAL invalid argument
3394 * @retval PMINFO_R_ERROR internal error
3395 * @pre pkgmgrinfo_appinfo_get_appinfo()
3396 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3397 * @see pkgmgrinfo_appinfo_get_appid()
3398 * @see pkgmgrinfo_appinfo_is_multiple()
3400 static int get_app_hwacceleration(const char *appid)
3403 pkgmgrinfo_app_hwacceleration hwacceleration;
3404 pkgmgrinfo_appinfo_h handle;
3405 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3406 if (ret != PMINFO_R_OK)
3408 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3409 if (ret != PMINFO_R_OK) {
3410 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413 printf("app hwacceleration: %d\n", hwacceleration);
3414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3419 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3422 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3423 * @brief This API gets the application 'onboot' value from the app ID
3425 * @par This API is for package-manager client application
3426 * @par Sync (or) Async : Synchronous API
3428 * @param[in] handle pointer to application info handle
3429 * @param[out] onboot pointer to hold package onboot value
3430 * @return 0 if success, error code(<0) if fail
3431 * @retval PMINFO_R_OK success
3432 * @retval PMINFO_R_EINVAL invalid argument
3433 * @retval PMINFO_R_ERROR internal error
3434 * @pre pkgmgrinfo_appinfo_get_appinfo()
3435 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3436 * @see pkgmgrinfo_appinfo_get_appid()
3437 * @see pkgmgrinfo_appinfo_is_multiple()
3439 static int get_app_onboot(const char *appid)
3443 pkgmgrinfo_appinfo_h handle;
3444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3445 if (ret != PMINFO_R_OK)
3447 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3448 if (ret != PMINFO_R_OK) {
3449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452 printf("app onboot: %d\n", onboot);
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3458 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3461 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3462 * @brief This API gets the application 'autorestart' value from the app ID
3464 * @par This API is for package-manager client application
3465 * @par Sync (or) Async : Synchronous API
3467 * @param[in] handle pointer to application info handle
3468 * @param[out] autorestart pointer to hold package autorestart value
3469 * @return 0 if success, error code(<0) if fail
3470 * @retval PMINFO_R_OK success
3471 * @retval PMINFO_R_EINVAL invalid argument
3472 * @retval PMINFO_R_ERROR internal error
3473 * @pre pkgmgrinfo_appinfo_get_appinfo()
3474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3475 * @see pkgmgrinfo_appinfo_get_appid()
3476 * @see pkgmgrinfo_appinfo_is_multiple()
3478 static int get_app_autorestart(const char *appid)
3482 pkgmgrinfo_appinfo_h handle;
3483 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3484 if (ret != PMINFO_R_OK)
3486 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3487 if (ret != PMINFO_R_OK) {
3488 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3491 printf("app autorestart: %d\n", autorestart);
3492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3497 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3500 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3501 * @brief This API gets the value for given application is main app or not from handle
3503 * @par This API is for package-manager client application
3504 * @par Sync (or) Async : Synchronous API
3506 * @param[in] handle pointer to application info handle
3507 * @param[out] mainapp pointer to hold package mainapp is or not
3508 * @return 0 if success, error code(<0) if fail
3509 * @retval PMINFO_R_OK success
3510 * @retval PMINFO_R_EINVAL invalid argument
3511 * @retval PMINFO_R_ERROR internal error
3512 * @pre pkgmgrinfo_appinfo_get_appinfo()
3513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3514 * @see pkgmgrinfo_appinfo_get_appid()
3515 * @see pkgmgrinfo_appinfo_is_multiple()
3517 static int get_app_mainapp(const char *appid)
3521 pkgmgrinfo_appinfo_h handle;
3522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3523 if (ret != PMINFO_R_OK)
3525 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3526 if (ret != PMINFO_R_OK) {
3527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530 printf("mainapp: %d\n", mainapp);
3531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3536 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3540 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3541 * @brief This API gets the value for given application is preload or not from handle
3543 * @par This API is for package-manager client application
3544 * @par Sync (or) Async : Synchronous API
3546 * @param[in] handle pointer to application info handle
3547 * @param[out] preload pointer to hold preload is or not
3548 * @return 0 if success, error code(<0) if fail
3549 * @retval PMINFO_R_OK success
3550 * @retval PMINFO_R_EINVAL invalid argument
3551 * @retval PMINFO_R_ERROR internal error
3552 * @pre pkgmgrinfo_appinfo_get_appinfo()
3553 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3554 * @see pkgmgrinfo_appinfo_get_appid()
3555 * @see pkgmgrinfo_appinfo_is_multiple()
3557 static int get_app_preload(const char *appid)
3561 pkgmgrinfo_appinfo_h handle = NULL;
3562 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3563 if (ret != PMINFO_R_OK)
3565 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3566 if (ret != PMINFO_R_OK) {
3567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3570 printf("preload: %d\n", preload);
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3576 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3579 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3580 * @brief This API destroys the application information handle freeing up all the resources
3582 * @par This API is for package-manager client application
3583 * @par Sync (or) Async : Synchronous API
3585 * @param[in] handle pointer to the application info handle.
3586 * @return 0 if success, error code(<0) if fail
3587 * @retval PMINFO_R_OK success
3588 * @retval PMINFO_R_EINVAL invalid argument
3589 * @retval PMINFO_R_ERROR internal error
3590 * @pre pkgmgrinfo_appinfo_get_appinfo()
3592 * @see pkgmgrinfo_appinfo_get_pkgid()
3593 * @see pkgmgrinfo_appinfo_is_multiple()
3595 static int get_app_type(const char *appid)
3599 pkgmgrinfo_appinfo_h handle;
3600 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3601 if (ret != PMINFO_R_OK)
3603 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3604 if (ret != PMINFO_R_OK) {
3605 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3608 printf("apptype: %s\n", type);
3609 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3614 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3617 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3618 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3619 The query will search the entire application information collected from the manifest file of all the installed packages
3621 * @par This API is for package-manager client application
3622 * @par Sync (or) Async : Synchronous API
3624 * @param[out] handle pointer to the application info filter handle.
3625 * @return 0 if success, error code(<0) if fail
3626 * @retval PMINFO_R_OK success
3627 * @retval PMINFO_R_EINVAL invalid argument
3628 * @retval PMINFO_R_ERROR internal error
3630 * @post pkgmgrinfo_appinfo_filter_destroy()
3631 * @see pkgmgrinfo_appinfo_filter_count()
3632 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3634 static int get_capp_count()
3638 pkgmgrinfo_appinfo_filter_h handle;
3639 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3640 if (ret != PMINFO_R_OK)
3642 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3643 if (ret != PMINFO_R_OK) {
3644 pkgmgrinfo_appinfo_filter_destroy(handle);
3647 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3648 if (ret != PMINFO_R_OK) {
3649 pkgmgrinfo_appinfo_filter_destroy(handle);
3652 printf("No of capp: %d\n", count);
3653 pkgmgrinfo_appinfo_filter_destroy(handle);
3658 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3661 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3662 * @brief This API destroys the application information filter handle freeing up all the resources
3664 * @par This API is for package-manager client application
3665 * @par Sync (or) Async : Synchronous API
3667 * @param[in] handle pointer to the application info filter handle.
3668 * @return 0 if success, error code(<0) if fail
3669 * @retval PMINFO_R_OK success
3670 * @retval PMINFO_R_EINVAL invalid argument
3671 * @retval PMINFO_R_ERROR internal error
3672 * @pre pkgmgrinfo_appinfo_filter_create()
3674 * @see pkgmgrinfo_appinfo_filter_count()
3675 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3677 static int get_capp_count()
3681 pkgmgrinfo_appinfo_filter_h handle;
3682 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3683 if (ret != PMINFO_R_OK)
3685 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3686 if (ret != PMINFO_R_OK) {
3687 pkgmgrinfo_appinfo_filter_destroy(handle);
3690 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3691 if (ret != PMINFO_R_OK) {
3692 pkgmgrinfo_appinfo_filter_destroy(handle);
3695 printf("No of capp: %d\n", count);
3696 pkgmgrinfo_appinfo_filter_destroy(handle);
3701 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3704 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3705 * @brief This API adds a boolean filter property to the 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 info filter handle.
3711 * @param[in] property boolean property name.
3712 * @param[in] value value corresponding to the property.
3713 * @return 0 if success, error code(<0) if fail
3714 * @retval PMINFO_R_OK success
3715 * @retval PMINFO_R_EINVAL invalid argument
3716 * @retval PMINFO_R_ERROR internal error
3717 * @pre pkgmgrinfo_appinfo_filter_create()
3718 * @post pkgmgrinfo_appinfo_filter_destroy()
3719 * @see pkgmgrinfo_appinfo_filter_count()
3720 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3722 static int get_taskmanageable_app_count()
3726 pkgmgrinfo_appinfo_filter_h handle;
3727 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3728 if (ret != PMINFO_R_OK)
3730 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3731 if (ret != PMINFO_R_OK) {
3732 pkgmgrinfo_appinfo_filter_destroy(handle);
3735 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3736 if (ret != PMINFO_R_OK) {
3737 pkgmgrinfo_appinfo_filter_destroy(handle);
3740 printf("No of taskmanageable apps: %d\n", count);
3741 pkgmgrinfo_appinfo_filter_destroy(handle);
3746 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3747 const char *property, const bool value);
3750 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3751 * @brief This API adds an integer filter property to the filter handle
3753 * @par This API is for package-manager client application
3754 * @par Sync (or) Async : Synchronous API
3756 * @param[in] handle pointer to the application info filter handle.
3757 * @param[in] property integer property name.
3758 * @param[in] value value corresponding to the property.
3759 * @return 0 if success, error code(<0) if fail
3760 * @retval PMINFO_R_OK success
3761 * @retval PMINFO_R_EINVAL invalid argument
3762 * @retval PMINFO_R_ERROR internal error
3763 * @pre pkgmgrinfo_appinfo_filter_create()
3764 * @post pkgmgrinfo_appinfo_filter_destroy()
3765 * @see pkgmgrinfo_appinfo_filter_count()
3766 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3768 static int get_taskmanageable_app_count()
3772 pkgmgrinfo_appinfo_filter_h handle;
3773 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3774 if (ret != PMINFO_R_OK)
3776 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3777 if (ret != PMINFO_R_OK) {
3778 pkgmgrinfo_appinfo_filter_destroy(handle);
3781 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3782 if (ret != PMINFO_R_OK) {
3783 pkgmgrinfo_appinfo_filter_destroy(handle);
3786 printf("No of apps: %d\n", count);
3787 pkgmgrinfo_appinfo_filter_destroy(handle);
3792 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3793 const char *property, const int value);
3796 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3797 * @brief This API adds a string filter property to the filter handle
3799 * @par This API is for package-manager client application
3800 * @par Sync (or) Async : Synchronous API
3802 * @param[in] handle pointer to the application info filter handle.
3803 * @param[in] property string property name.
3804 * @param[in] value value corresponding to the property.
3805 * @return 0 if success, error code(<0) if fail
3806 * @retval PMINFO_R_OK success
3807 * @retval PMINFO_R_EINVAL invalid argument
3808 * @retval PMINFO_R_ERROR internal error
3809 * @pre pkgmgrinfo_appinfo_filter_create()
3810 * @post pkgmgrinfo_appinfo_filter_destroy()
3811 * @see pkgmgrinfo_appinfo_filter_count()
3812 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3814 static int get_capp_count()
3818 pkgmgrinfo_appinfo_filter_h handle;
3819 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3820 if (ret != PMINFO_R_OK)
3822 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3823 if (ret != PMINFO_R_OK) {
3824 pkgmgrinfo_appinfo_filter_destroy(handle);
3827 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3828 if (ret != PMINFO_R_OK) {
3829 pkgmgrinfo_appinfo_filter_destroy(handle);
3832 printf("No of capp: %d\n", count);
3833 pkgmgrinfo_appinfo_filter_destroy(handle);
3838 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3839 const char *property, const char *value);
3842 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3843 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3845 * @par This API is for package-manager client application
3846 * @par Sync (or) Async : Synchronous API
3848 * @param[in] handle pointer to the application info filter handle.
3849 * @param[in] app_cb callback function.
3850 * @param[in] user_data user data to be passed to the callback function
3851 * @return 0 if success, error code(<0) if fail
3852 * @retval PMINFO_R_OK success
3853 * @retval PMINFO_R_EINVAL invalid argument
3854 * @retval PMINFO_R_ERROR internal error
3855 * @pre pkgmgrinfo_appinfo_filter_create()
3856 * @post pkgmgrinfo_appinfo_filter_destroy()
3857 * @see pkgmgrinfo_appinfo_filter_count()
3859 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3862 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3863 printf("appid : %s\n", appid);
3867 static int get_capp_list()
3870 pkgmgrinfo_appinfo_filter_h handle;
3871 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3872 if (ret != PMINFO_R_OK)
3874 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3875 if (ret != PMINFO_R_OK) {
3876 pkgmgrinfo_appinfo_filter_destroy(handle);
3879 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3880 if (ret != PMINFO_R_OK) {
3881 pkgmgrinfo_appinfo_filter_destroy(handle);
3884 pkgmgrinfo_appinfo_filter_destroy(handle);
3889 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3890 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3893 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3894 * @brief This API counts the application that satisfy the filter conditions
3896 * @par This API is for package-manager client application
3897 * @par Sync (or) Async : Synchronous API
3899 * @param[in] handle pointer to the application info filter handle.
3900 * @param[in] count pointer to store count value
3901 * @return 0 if success, error code(<0) if fail
3902 * @retval PMINFO_R_OK success
3903 * @retval PMINFO_R_EINVAL invalid argument
3904 * @retval PMINFO_R_ERROR internal error
3905 * @pre pkgmgrinfo_appinfo_filter_create()
3906 * @post pkgmgrinfo_appinfo_filter_destroy()
3907 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3909 static int get_capp_count()
3913 pkgmgrinfo_appinfo_filter_h handle;
3914 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3915 if (ret != PMINFO_R_OK)
3917 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3918 if (ret != PMINFO_R_OK) {
3919 pkgmgrinfo_appinfo_filter_destroy(handle);
3922 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3923 if (ret != PMINFO_R_OK) {
3924 pkgmgrinfo_appinfo_filter_destroy(handle);
3927 printf("No of capp: %d\n", count);
3928 pkgmgrinfo_appinfo_filter_destroy(handle);
3933 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3936 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
3937 * @brief This API creates the application's metadata information filter handle from db.
3939 * @par This API is for package-manager client application
3940 * @par Sync (or) Async : Synchronous API
3942 * @param[out] handle pointer to the application metadata info filter handle.
3943 * @return 0 if success, error code(<0) if fail
3944 * @retval PMINFO_R_OK success
3945 * @retval PMINFO_R_EINVAL invalid argument
3946 * @retval PMINFO_R_ERROR internal error
3948 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3949 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3951 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3954 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3955 printf("appid : %s\n", appid);
3959 static int get_app_list(const char *mkey, const char *mvalue)
3962 pkgmgrinfo_appinfo_metadata_filter_h handle;
3963 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3964 if (ret != PMINFO_R_OK)
3966 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3967 if (ret != PMINFO_R_OK) {
3968 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3971 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3972 if (ret != PMINFO_R_OK) {
3973 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3976 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3981 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
3984 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
3985 * @brief This API destroys the application's metadata information filter handle.
3987 * @par This API is for package-manager client application
3988 * @par Sync (or) Async : Synchronous API
3990 * @param[in] handle pointer to the application metadata info filter handle.
3991 * @return 0 if success, error code(<0) if fail
3992 * @retval PMINFO_R_OK success
3993 * @retval PMINFO_R_EINVAL invalid argument
3994 * @retval PMINFO_R_ERROR internal error
3995 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3997 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3999 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4002 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4003 printf("appid : %s\n", appid);
4007 static int get_app_list(const char *mkey, const char *mvalue)
4010 pkgmgrinfo_appinfo_metadata_filter_h handle;
4011 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4012 if (ret != PMINFO_R_OK)
4014 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4015 if (ret != PMINFO_R_OK) {
4016 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4019 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4020 if (ret != PMINFO_R_OK) {
4021 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4024 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4029 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4032 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4033 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4034 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4036 * @par This API is for package-manager client application
4037 * @par Sync (or) Async : Synchronous API
4039 * @param[in] handle pointer to the application metadata info filter handle.
4040 * @param[in] key pointer to metadata key
4041 * @param[in] value pointer to metadata value
4042 * @return 0 if success, error code(<0) if fail
4043 * @retval PMINFO_R_OK success
4044 * @retval PMINFO_R_EINVAL invalid argument
4045 * @retval PMINFO_R_ERROR internal error
4046 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4047 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4048 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4050 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4053 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4054 printf("appid : %s\n", appid);
4058 static int get_app_list(const char *mkey, const char *mvalue)
4061 pkgmgrinfo_appinfo_metadata_filter_h handle;
4062 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4063 if (ret != PMINFO_R_OK)
4065 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4066 if (ret != PMINFO_R_OK) {
4067 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4070 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4071 if (ret != PMINFO_R_OK) {
4072 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4075 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4080 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4081 const char *key, const char *value);
4084 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4085 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4086 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4087 * negative value, no more callbacks will be called and API will return.
4089 * @par This API is for package-manager client application
4090 * @par Sync (or) Async : Synchronous API
4092 * @param[in] handle pointer to the application metadata info filter handle.
4093 * @param[in] app_cb function pointer to callback
4094 * @param[in] user_data pointer to user data
4095 * @return 0 if success, error code(<0) if fail
4096 * @retval PMINFO_R_OK success
4097 * @retval PMINFO_R_EINVAL invalid argument
4098 * @retval PMINFO_R_ERROR internal error
4099 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4100 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4102 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4105 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4106 printf("appid : %s\n", appid);
4110 static int get_app_list(const char *mkey, const char *mvalue)
4113 pkgmgrinfo_appinfo_metadata_filter_h handle;
4114 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4115 if (ret != PMINFO_R_OK)
4117 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4118 if (ret != PMINFO_R_OK) {
4119 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4122 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4123 if (ret != PMINFO_R_OK) {
4124 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4127 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4132 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4133 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4136 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4137 * @brief This API creates the package cert information handle to get data from db.
4139 * @par This API is for package-manager client application
4140 * @par Sync (or) Async : Synchronous API
4142 * @param[out] handle pointer to the package cert handle.
4143 * @return 0 if success, error code(<0) if fail
4144 * @retval PMINFO_R_OK success
4145 * @retval PMINFO_R_EINVAL invalid argument
4146 * @retval PMINFO_R_ERROR internal error
4148 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4149 * @see pkgmgrinfo_pkginfo_get_cert_value()
4150 * @see pkgmgrinfo_pkginfo_load_certinfo()
4152 static int get_cert_info(const char *pkgid)
4155 pkgmgrinfo_certinfo_h handle;
4156 char *auth_cert = NULL;
4157 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4158 if (ret != PMINFO_R_OK)
4160 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4161 if (ret != PMINFO_R_OK) {
4162 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4165 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4166 if (ret != PMINFO_R_OK) {
4167 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4170 printf("Author root certificate: %s\n", auth_root);
4171 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4176 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4179 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4180 * @brief This API loads the package cert information handle with data from db.
4182 * @par This API is for package-manager client application
4183 * @par Sync (or) Async : Synchronous API
4185 * @param[in] pkgid pointer to the package ID.
4186 * @param[in] handle pointer to the package cert handle.
4187 * @return 0 if success, error code(<0) if fail
4188 * @retval PMINFO_R_OK success
4189 * @retval PMINFO_R_EINVAL invalid argument
4190 * @retval PMINFO_R_ERROR internal error
4191 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4192 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4193 * @see pkgmgrinfo_pkginfo_get_cert_value()
4195 static int get_cert_info(const char *pkgid)
4198 pkgmgrinfo_certinfo_h handle;
4199 char *auth_cert = NULL;
4200 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4201 if (ret != PMINFO_R_OK)
4203 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4204 if (ret != PMINFO_R_OK) {
4205 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4208 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4209 if (ret != PMINFO_R_OK) {
4210 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4213 printf("Author root certificate: %s\n", auth_root);
4214 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4219 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4222 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4223 * @brief This API gets the package cert information from the handle
4225 * @par This API is for package-manager client application
4226 * @par Sync (or) Async : Synchronous API
4228 * @param[in] handle pointer to the package cert handle.
4229 * @param[in] cert_type certificate type
4230 * @param[out] cert_value pointer to hold certificate value
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_pkginfo_create_certinfo()
4236 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4237 * @see pkgmgrinfo_pkginfo_load_certinfo()
4239 static int get_cert_info(const char *pkgid)
4242 pkgmgrinfo_certinfo_h handle;
4243 char *auth_cert = NULL;
4244 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4245 if (ret != PMINFO_R_OK)
4247 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4252 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4253 if (ret != PMINFO_R_OK) {
4254 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4257 printf("Author root certificate: %s\n", auth_root);
4258 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4263 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4266 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4267 * @brief This API destroys the package cert information handle freeing up all the resources
4269 * @par This API is for package-manager client application
4270 * @par Sync (or) Async : Synchronous API
4272 * @param[in] handle pointer to the package cert handle.
4273 * @return 0 if success, error code(<0) if fail
4274 * @retval PMINFO_R_OK success
4275 * @retval PMINFO_R_EINVAL invalid argument
4276 * @retval PMINFO_R_ERROR internal error
4277 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4279 * @see pkgmgrinfo_pkginfo_load_certinfo()
4281 static int get_cert_info(const char *pkgid)
4284 pkgmgrinfo_certinfo_h handle;
4285 char *auth_cert = NULL;
4286 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4287 if (ret != PMINFO_R_OK)
4289 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4290 if (ret != PMINFO_R_OK) {
4291 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4294 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4295 if (ret != PMINFO_R_OK) {
4296 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4299 printf("Author root certificate: %s\n", auth_root);
4300 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4305 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4308 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4309 * @brief This API deletes the package cert information from DB
4311 * @par This API is for package-manager client application
4312 * @par Sync (or) Async : Synchronous API
4314 * @param[in] pkgid pointer to the package ID.
4315 * @return 0 if success, error code(<0) if fail
4316 * @retval PMINFO_R_OK success
4317 * @retval PMINFO_R_EINVAL invalid argument
4318 * @retval PMINFO_R_ERROR internal error
4322 static int delete_cert_info(const char *pkgid)
4325 ret = pkgmgrinfo_delete_certinfo(pkgid);
4326 if (ret != PMINFO_R_OK)
4332 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4335 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4336 * @brief This API creates the package db information handle to set data in db.
4338 * @par This API is for package-manager client application
4339 * @par Sync (or) Async : Synchronous API
4341 * @param[in] pkgid pointer to the package ID.
4342 * @param[out] handle pointer to the package db info handle.
4343 * @return 0 if success, error code(<0) if fail
4344 * @retval PMINFO_R_OK success
4345 * @retval PMINFO_R_EINVAL invalid argument
4346 * @retval PMINFO_R_ERROR internal error
4348 * @post pkgmgrinfo_destroy_pkgdbinfo()
4349 * @see pkgmgrinfo_save_pkgdbinfo()
4350 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4352 static int set_pkg_in_db(const char *pkgid)
4355 pkgmgrinfo_pkgdbinfo_h handle;
4356 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4357 if (ret != PMINFO_R_OK)
4359 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4360 if (ret != PMINFO_R_OK) {
4361 pkgmgrinfo_destroy_pkgdbinfo(handle);
4364 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4365 if (ret != PMINFO_R_OK) {
4366 pkgmgrinfo_destroy_pkgdbinfo(handle);
4369 pkgmgrinfo_destroy_pkgdbinfo(handle);
4374 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4377 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4378 * @brief This API sets the package type in db handle
4380 * @par This API is for package-manager client application
4381 * @par Sync (or) Async : Synchronous API
4383 * @param[in] handle pointer to the pkgdbinfo handle.
4384 * @param[in] type pointer to the package type.
4385 * @return 0 if success, error code(<0) if fail
4386 * @retval PMINFO_R_OK success
4387 * @retval PMINFO_R_EINVAL invalid argument
4388 * @retval PMINFO_R_ERROR internal error
4389 * @pre pkgmgrinfo_create_pkgdbinfo()
4390 * @post pkgmgrinfo_destroy_pkgdbinfo()
4391 * @see pkgmgrinfo_save_pkgdbinfo()
4392 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4394 static int set_pkg_type_in_db(const char *pkgid)
4397 pkgmgrinfo_pkgdbinfo_h handle;
4398 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4399 if (ret != PMINFO_R_OK)
4401 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4402 if (ret != PMINFO_R_OK) {
4403 pkgmgrinfo_destroy_pkgdbinfo(handle);
4406 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4407 if (ret != PMINFO_R_OK) {
4408 pkgmgrinfo_destroy_pkgdbinfo(handle);
4411 pkgmgrinfo_destroy_pkgdbinfo(handle);
4416 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4419 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4420 * @brief This API sets the package version in db handle
4422 * @par This API is for package-manager client application
4423 * @par Sync (or) Async : Synchronous API
4425 * @param[in] handle pointer to the pkgdbinfo handle.
4426 * @param[in] version pointer to the package version
4427 * @return 0 if success, error code(<0) if fail
4428 * @retval PMINFO_R_OK success
4429 * @retval PMINFO_R_EINVAL invalid argument
4430 * @retval PMINFO_R_ERROR internal error
4431 * @pre pkgmgrinfo_create_pkgdbinfo()
4432 * @post pkgmgrinfo_destroy_pkgdbinfo()
4433 * @see pkgmgrinfo_save_pkgdbinfo()
4434 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4436 static int set_pkg_version_in_db(const char *pkgid)
4439 pkgmgrinfo_pkgdbinfo_h handle;
4440 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4441 if (ret != PMINFO_R_OK)
4443 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4444 if (ret != PMINFO_R_OK) {
4445 pkgmgrinfo_destroy_pkgdbinfo(handle);
4448 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4449 if (ret != PMINFO_R_OK) {
4450 pkgmgrinfo_destroy_pkgdbinfo(handle);
4453 pkgmgrinfo_destroy_pkgdbinfo(handle);
4458 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4461 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4462 * @brief This API sets the package install location in db handle
4464 * @par This API is for package-manager client application
4465 * @par Sync (or) Async : Synchronous API
4467 * @param[in] handle pointer to the pkgdbinfo handle.
4468 * @param[in] location package install location
4469 * @return 0 if success, error code(<0) if fail
4470 * @retval PMINFO_R_OK success
4471 * @retval PMINFO_R_EINVAL invalid argument
4472 * @retval PMINFO_R_ERROR internal error
4473 * @pre pkgmgrinfo_create_pkgdbinfo()
4474 * @post pkgmgrinfo_destroy_pkgdbinfo()
4475 * @see pkgmgrinfo_save_pkgdbinfo()
4476 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4478 static int set_pkg_install_location_in_db(const char *pkgid)
4481 pkgmgrinfo_pkgdbinfo_h handle;
4482 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4483 if (ret != PMINFO_R_OK)
4485 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4486 if (ret != PMINFO_R_OK) {
4487 pkgmgrinfo_destroy_pkgdbinfo(handle);
4490 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4491 if (ret != PMINFO_R_OK) {
4492 pkgmgrinfo_destroy_pkgdbinfo(handle);
4495 pkgmgrinfo_destroy_pkgdbinfo(handle);
4500 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4503 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4504 * @brief This API sets the package size in db handle
4506 * @par This API is for package-manager client application
4507 * @par Sync (or) Async : Synchronous API
4509 * @param[in] handle pointer to the pkgdbinfo handle.
4510 * @param[in] size pointer to the package size
4511 * @return 0 if success, error code(<0) if fail
4512 * @retval PMINFO_R_OK success
4513 * @retval PMINFO_R_EINVAL invalid argument
4514 * @retval PMINFO_R_ERROR internal error
4515 * @pre pkgmgrinfo_create_pkgdbinfo()
4516 * @post pkgmgrinfo_destroy_pkgdbinfo()
4517 * @see pkgmgrinfo_save_pkgdbinfo()
4518 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4520 static int set_pkg_size_in_db(const char *pkgid)
4523 pkgmgrinfo_pkgdbinfo_h handle;
4524 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4525 if (ret != PMINFO_R_OK)
4527 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4528 if (ret != PMINFO_R_OK) {
4529 pkgmgrinfo_destroy_pkgdbinfo(handle);
4532 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4533 if (ret != PMINFO_R_OK) {
4534 pkgmgrinfo_destroy_pkgdbinfo(handle);
4537 pkgmgrinfo_destroy_pkgdbinfo(handle);
4542 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4545 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4546 * @brief This API sets the package label in db handle
4548 * @par This API is for package-manager client application
4549 * @par Sync (or) Async : Synchronous API
4551 * @param[in] handle pointer to the pkgdbinfo handle.
4552 * @param[in] label pointer to the package label
4553 * @param[in] locale pointer to the locale
4554 * @return 0 if success, error code(<0) if fail
4555 * @retval PMINFO_R_OK success
4556 * @retval PMINFO_R_EINVAL invalid argument
4557 * @retval PMINFO_R_ERROR internal error
4558 * @pre pkgmgrinfo_create_pkgdbinfo()
4559 * @post pkgmgrinfo_destroy_pkgdbinfo()
4560 * @see pkgmgrinfo_save_pkgdbinfo()
4561 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4563 static int set_pkg_label_in_db(const char *pkgid)
4566 pkgmgrinfo_pkgdbinfo_h handle;
4567 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4568 if (ret != PMINFO_R_OK)
4570 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4571 if (ret != PMINFO_R_OK) {
4572 pkgmgrinfo_destroy_pkgdbinfo(handle);
4575 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4576 if (ret != PMINFO_R_OK) {
4577 pkgmgrinfo_destroy_pkgdbinfo(handle);
4580 pkgmgrinfo_destroy_pkgdbinfo(handle);
4585 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4588 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4589 * @brief This API sets the package icon in db handle
4591 * @par This API is for package-manager client application
4592 * @par Sync (or) Async : Synchronous API
4594 * @param[in] handle pointer to the pkgdbinfo handle.
4595 * @param[in] icon pointer to the package icon
4596 * @param[in] locale pointer to the locale
4597 * @return 0 if success, error code(<0) if fail
4598 * @retval PMINFO_R_OK success
4599 * @retval PMINFO_R_EINVAL invalid argument
4600 * @retval PMINFO_R_ERROR internal error
4601 * @pre pkgmgrinfo_create_pkgdbinfo()
4602 * @post pkgmgrinfo_destroy_pkgdbinfo()
4603 * @see pkgmgrinfo_save_pkgdbinfo()
4604 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4606 static int set_pkg_icon_in_db(const char *pkgid)
4609 pkgmgrinfo_pkgdbinfo_h handle;
4610 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4611 if (ret != PMINFO_R_OK)
4613 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4614 if (ret != PMINFO_R_OK) {
4615 pkgmgrinfo_destroy_pkgdbinfo(handle);
4618 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4619 if (ret != PMINFO_R_OK) {
4620 pkgmgrinfo_destroy_pkgdbinfo(handle);
4623 pkgmgrinfo_destroy_pkgdbinfo(handle);
4628 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4631 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4632 * @brief This API sets the package description in db handle
4634 * @par This API is for package-manager client application
4635 * @par Sync (or) Async : Synchronous API
4637 * @param[in] handle pointer to the pkgdbinfo handle.
4638 * @param[in] description pointer to the package description
4639 * @param[in] locale pointer to the locale
4640 * @return 0 if success, error code(<0) if fail
4641 * @retval PMINFO_R_OK success
4642 * @retval PMINFO_R_EINVAL invalid argument
4643 * @retval PMINFO_R_ERROR internal error
4644 * @pre pkgmgrinfo_create_pkgdbinfo()
4645 * @post pkgmgrinfo_destroy_pkgdbinfo()
4646 * @see pkgmgrinfo_save_pkgdbinfo()
4647 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4649 static int set_pkg_description_in_db(const char *pkgid)
4652 pkgmgrinfo_pkgdbinfo_h handle;
4653 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4654 if (ret != PMINFO_R_OK)
4656 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4657 if (ret != PMINFO_R_OK) {
4658 pkgmgrinfo_destroy_pkgdbinfo(handle);
4661 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4662 if (ret != PMINFO_R_OK) {
4663 pkgmgrinfo_destroy_pkgdbinfo(handle);
4666 pkgmgrinfo_destroy_pkgdbinfo(handle);
4671 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4674 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4675 const char *author_email, const char *author_href, const char *locale)
4676 * @brief This API sets the package author info in db handle
4678 * @par This API is for package-manager client application
4679 * @par Sync (or) Async : Synchronous API
4681 * @param[in] handle pointer to the pkgdbinfo handle.
4682 * @param[in] author_name pointer to the package author name
4683 * @param[in] author_email pointer to the package author email
4684 * @param[in] author_href pointer to the package author href
4685 * @param[in] locale pointer to the locale
4686 * @return 0 if success, error code(<0) if fail
4687 * @retval PMINFO_R_OK success
4688 * @retval PMINFO_R_EINVAL invalid argument
4689 * @retval PMINFO_R_ERROR internal error
4690 * @pre pkgmgrinfo_create_pkgdbinfo()
4691 * @post pkgmgrinfo_destroy_pkgdbinfo()
4692 * @see pkgmgrinfo_save_pkgdbinfo()
4693 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4695 static int set_pkg_author_in_db(const char *pkgid)
4698 pkgmgrinfo_pkgdbinfo_h handle;
4699 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4700 if (ret != PMINFO_R_OK)
4702 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4703 if (ret != PMINFO_R_OK) {
4704 pkgmgrinfo_destroy_pkgdbinfo(handle);
4707 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4708 if (ret != PMINFO_R_OK) {
4709 pkgmgrinfo_destroy_pkgdbinfo(handle);
4712 pkgmgrinfo_destroy_pkgdbinfo(handle);
4717 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4718 const char *author_email, const char *author_href, const char *locale);
4721 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4722 * @brief This API sets the package 'removable' value in db handle
4724 * @par This API is for package-manager client application
4725 * @par Sync (or) Async : Synchronous API
4727 * @param[in] handle pointer to the pkgdbinfo handle.
4728 * @param[in] removable package removable value
4729 * @return 0 if success, error code(<0) if fail
4730 * @retval PMINFO_R_OK success
4731 * @retval PMINFO_R_EINVAL invalid argument
4732 * @retval PMINFO_R_ERROR internal error
4733 * @pre pkgmgrinfo_create_pkgdbinfo()
4734 * @post pkgmgrinfo_destroy_pkgdbinfo()
4735 * @see pkgmgrinfo_save_pkgdbinfo()
4736 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4738 static int set_pkg_removable_in_db(const char *pkgid)
4741 pkgmgrinfo_pkgdbinfo_h handle;
4742 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4743 if (ret != PMINFO_R_OK)
4745 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4746 if (ret != PMINFO_R_OK) {
4747 pkgmgrinfo_destroy_pkgdbinfo(handle);
4750 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4751 if (ret != PMINFO_R_OK) {
4752 pkgmgrinfo_destroy_pkgdbinfo(handle);
4755 pkgmgrinfo_destroy_pkgdbinfo(handle);
4760 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4763 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4764 * @brief This API sets the package 'preload' value in db handle
4766 * @par This API is for package-manager client application
4767 * @par Sync (or) Async : Synchronous API
4769 * @param[in] handle pointer to the pkgdbinfo handle.
4770 * @param[in] preload package preload value
4771 * @return 0 if success, error code(<0) if fail
4772 * @retval PMINFO_R_OK success
4773 * @retval PMINFO_R_EINVAL invalid argument
4774 * @retval PMINFO_R_ERROR internal error
4775 * @pre pkgmgrinfo_create_pkgdbinfo()
4776 * @post pkgmgrinfo_destroy_pkgdbinfo()
4777 * @see pkgmgrinfo_save_pkgdbinfo()
4778 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4780 static int set_pkg_preload_in_db(const char *pkgid)
4783 pkgmgrinfo_pkgdbinfo_h handle;
4784 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4785 if (ret != PMINFO_R_OK)
4787 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4788 if (ret != PMINFO_R_OK) {
4789 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4793 if (ret != PMINFO_R_OK) {
4794 pkgmgrinfo_destroy_pkgdbinfo(handle);
4797 pkgmgrinfo_destroy_pkgdbinfo(handle);
4802 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4805 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4806 * @brief This API sets the package 'installed_storage' value in db handle
4808 * @par This API is for package-manager client application
4809 * @par Sync (or) Async : Synchronous API
4811 * @param[in] handle pointer to the pkgdbinfo handle.
4812 * @param[in] location installed_storage value
4813 * @return 0 if success, error code(<0) if fail
4814 * @retval PMINFO_R_OK success
4815 * @retval PMINFO_R_EINVAL invalid argument
4816 * @retval PMINFO_R_ERROR internal error
4817 * @pre pkgmgrinfo_create_pkgdbinfo()
4818 * @post pkgmgrinfo_destroy_pkgdbinfo()
4819 * @see pkgmgrinfo_save_pkgdbinfo()
4821 static int set_pkg_installed_storage_in_db(const char *pkgid)
4824 pkgmgrinfo_pkgdbinfo_h handle;
4825 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4826 if (ret != PMINFO_R_OK)
4828 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4829 if (ret != PMINFO_R_OK) {
4830 pkgmgrinfo_destroy_pkgdbinfo(handle);
4833 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4834 if (ret != PMINFO_R_OK) {
4835 pkgmgrinfo_destroy_pkgdbinfo(handle);
4838 pkgmgrinfo_destroy_pkgdbinfo(handle);
4843 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4846 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4847 * @brief This API saves all the information from the handle to the DB.
4849 * @par This API is for package-manager client application
4850 * @par Sync (or) Async : Synchronous API
4852 * @param[in] handle pointer to the package db info handle.
4853 * @return 0 if success, error code(<0) if fail
4854 * @retval PMINFO_R_OK success
4855 * @retval PMINFO_R_EINVAL invalid argument
4856 * @retval PMINFO_R_ERROR internal error
4857 * @pre pkgmgrinfo_create_pkgdbinfo()
4858 * @post pkgmgrinfo_destroy_pkgdbinfo()
4859 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4861 static int set_pkg_in_db(const char *pkgid)
4864 pkgmgrinfo_pkgdbinfo_h handle;
4865 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4866 if (ret != PMINFO_R_OK)
4868 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4869 if (ret != PMINFO_R_OK) {
4870 pkgmgrinfo_destroy_pkgdbinfo(handle);
4873 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4874 if (ret != PMINFO_R_OK) {
4875 pkgmgrinfo_destroy_pkgdbinfo(handle);
4878 pkgmgrinfo_destroy_pkgdbinfo(handle);
4883 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4886 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4887 * @brief This API destroys the package db information handle freeing up all the resources
4889 * @par This API is for package-manager client application
4890 * @par Sync (or) Async : Synchronous API
4892 * @param[in] handle pointer to the package db info handle.
4893 * @return 0 if success, error code(<0) if fail
4894 * @retval PMINFO_R_OK success
4895 * @retval PMINFO_R_EINVAL invalid argument
4896 * @retval PMINFO_R_ERROR internal error
4897 * @pre pkgmgrinfo_create_pkgdbinfo()
4899 * @see pkgmgrinfo_save_pkgdbinfo()
4900 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4902 static int set_pkg_in_db(const char *pkgid)
4905 pkgmgrinfo_pkgdbinfo_h handle;
4906 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4907 if (ret != PMINFO_R_OK)
4909 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4910 if (ret != PMINFO_R_OK) {
4911 pkgmgrinfo_destroy_pkgdbinfo(handle);
4914 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4915 if (ret != PMINFO_R_OK) {
4916 pkgmgrinfo_destroy_pkgdbinfo(handle);
4919 pkgmgrinfo_destroy_pkgdbinfo(handle);
4924 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4928 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4929 * @brief This API creates the package cert information handle to set data in db.
4931 * @par This API is for package-manager client application
4932 * @par Sync (or) Async : Synchronous API
4934 * @param[out] handle pointer to the package cert handle.
4935 * @return 0 if success, error code(<0) if fail
4936 * @retval PMINFO_R_OK success
4937 * @retval PMINFO_R_EINVAL invalid argument
4938 * @retval PMINFO_R_ERROR internal error
4940 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4941 * @see pkgmgrinfo_set_cert_value()
4942 * @see pkgmgrinfo_save_certinfo()
4944 static int set_cert_in_db(const char *pkgid)
4947 pkgmgrinfo_instcertinfo_h handle;
4948 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4956 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4961 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4966 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4969 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4970 * @brief This API sets the package cert information in the handle.
4972 * @par This API is for package-manager client application
4973 * @par Sync (or) Async : Synchronous API
4975 * @param[in] handle pointer to the package cert handle.
4976 * @param[in] cert_type certificate type.
4977 * @param[in] cert_value certificate value.
4978 * @return 0 if success, error code(<0) if fail
4979 * @retval PMINFO_R_OK success
4980 * @retval PMINFO_R_EINVAL invalid argument
4981 * @retval PMINFO_R_ERROR internal error
4982 * @pre pkgmgrinfo_create_certinfo_set_handle()
4983 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4984 * @see pkgmgrinfo_save_certinfo()
4986 static int set_cert_in_db(const char *pkgid)
4989 pkgmgrinfo_instcertinfo_h handle;
4990 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4991 if (ret != PMINFO_R_OK)
4993 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4994 if (ret != PMINFO_R_OK) {
4995 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4998 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4999 if (ret != PMINFO_R_OK) {
5000 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5003 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5008 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5011 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5012 * @brief This API saves the package cert information in the DB.
5014 * @par This API is for package-manager client application
5015 * @par Sync (or) Async : Synchronous API
5017 * @param[in] pkgid pointer to the package ID.
5018 * @param[in] handle pointer to the package cert handle.
5019 * @return 0 if success, error code(<0) if fail
5020 * @retval PMINFO_R_OK success
5021 * @retval PMINFO_R_EINVAL invalid argument
5022 * @retval PMINFO_R_ERROR internal error
5023 * @pre pkgmgrinfo_create_certinfo_set_handle()
5024 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5025 * @see pkgmgrinfo_save_certinfo()
5027 static int set_cert_in_db(const char *pkgid)
5030 pkgmgrinfo_instcertinfo_h handle;
5031 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5032 if (ret != PMINFO_R_OK)
5034 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5035 if (ret != PMINFO_R_OK) {
5036 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5039 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5040 if (ret != PMINFO_R_OK) {
5041 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5044 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5049 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5052 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5053 * @brief This API destroys the package cert information handle freeing up all the resources.
5055 * @par This API is for package-manager client application
5056 * @par Sync (or) Async : Synchronous API
5058 * @param[in] handle pointer to the package cert handle.
5059 * @return 0 if success, error code(<0) if fail
5060 * @retval PMINFO_R_OK success
5061 * @retval PMINFO_R_EINVAL invalid argument
5062 * @retval PMINFO_R_ERROR internal error
5063 * @pre pkgmgrinfo_create_certinfo_set_handle()
5065 * @see pkgmgrinfo_save_certinfo()
5067 static int set_cert_in_db(const char *pkgid)
5070 pkgmgrinfo_instcertinfo_h handle;
5071 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5072 if (ret != PMINFO_R_OK)
5074 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5075 if (ret != PMINFO_R_OK) {
5076 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5079 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5080 if (ret != PMINFO_R_OK) {
5081 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5084 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5089 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5092 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5093 * @brief This API gets the datacontrol info
5095 * @par This API is for package-manager client application
5096 * @par Sync (or) Async : Synchronous API
5098 * @param[in] providerid pointer to the providerid of dataconltrol.
5099 * @param[in] type pointer to the type of dataconltrol.
5100 * @param[out] appid pointer to hold appid, need to free after using
5101 * @param[out] access pointer to hold access, need to free after using
5102 * @return 0 if success, error code(<0) if fail
5103 * @retval PMINFO_R_OK success
5104 * @retval PMINFO_R_EINVAL invalid argument
5105 * @retval PMINFO_R_ERROR internal error
5108 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5111 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5112 * @brief This API gets the application 'guest mode visibility' value from the DB
5114 * @par This API is for package-manager client application
5115 * @par Sync (or) Async : Synchronous API
5117 * @param[in] handle pointer to application info handle
5118 * @param[out] status pointer to hold app guest mode visibility value
5119 * @return 0 if success, error code(<0) if fail
5120 * @retval PMINFO_R_OK success
5121 * @retval PMINFO_R_EINVAL invalid argument
5122 * @retval PMINFO_R_ERROR internal error
5123 * @pre pkgmgrinfo_appinfo_get_appinfo()
5124 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5125 * @see pkgmgrinfo_appinfo_get_appid()
5126 * @see pkgmgrinfo_appinfo_is_multiple()
5128 static int get_app_guestmode_visibility(const char *appid)
5132 pkgmgrinfo_appinfo_h handle;
5133 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5134 if (ret != PMINFO_R_OK)
5136 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5137 if (ret != PMINFO_R_OK) {
5138 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5141 printf("app guest mode visibility: %d\n", status);
5142 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5147 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5150 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5151 * @brief This API sets the application 'guest mode visibility' value in the DB
5153 * @par This API is for package-manager client application
5154 * @par Sync (or) Async : Synchronous API
5156 * @param[in] handle pointer to application info handle
5157 * @param[out] status app guest mode visibility value
5158 * @return 0 if success, error code(<0) if fail
5159 * @retval PMINFO_R_OK success
5160 * @retval PMINFO_R_EINVAL invalid argument
5161 * @retval PMINFO_R_ERROR internal error
5162 * @pre pkgmgrinfo_appinfo_get_appinfo()
5163 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5164 * @see pkgmgrinfo_appinfo_get_appid()
5165 * @see pkgmgrinfo_appinfo_is_multiple()
5167 static int set_app_guestmode_visibility(const char *appid, bool value)
5170 pkgmgrinfo_appinfo_h handle;
5171 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5172 if (ret != PMINFO_R_OK)
5174 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5175 if (ret != PMINFO_R_OK) {
5176 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5179 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5184 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5191 #endif /* __PKG_INFO_H__ */