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_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
242 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
244 * @param[in] metadata_name the name of the metadata
245 * @param[in] metadata_value the value of the metadata
246 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
248 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
250 * @see pkgmgrinfo_appinfo_foreach_metadata()
252 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
253 const char *metadata_value, void *user_data);
256 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
258 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
260 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
261 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
263 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
265 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
267 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
271 * @brief Install Location Types
274 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
275 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
276 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
277 }pkgmgrinfo_install_location;
280 * @brief Application Component Types
283 PMINFO_ALL_APP = 0, /**< All Application*/
284 PMINFO_UI_APP, /**< UI Application*/
285 PMINFO_SVC_APP, /**< Service Application*/
286 }pkgmgrinfo_app_component;
289 * @brief Application Storage Types
292 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
293 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
294 }pkgmgrinfo_installed_storage;
297 * @brief Certificate Types to be used for getting information
300 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
301 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
302 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
303 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
304 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
305 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
306 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
307 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
308 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
309 }pkgmgrinfo_cert_type;
312 * @brief Install Location Types to be used when setting data in DB
315 INSTALL_INTERNAL = 0, /**< Internal Installation*/
316 INSTALL_EXTERNAL, /**< External Installation*/
320 * @brief permission Types
323 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
324 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
325 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
326 }pkgmgrinfo_permission_type;
329 /** String property for filtering based on package info*/
330 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
331 /** String property for filtering based on package info*/
332 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
333 /** String property for filtering based on package info*/
334 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
335 /** String property for filtering based on package info*/
336 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
337 /** String property for filtering based on package info*/
338 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
339 /** String property for filtering based on package info*/
340 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
341 /** String property for filtering based on package info*/
342 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
343 /** String property for filtering based on package info*/
344 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
346 /** Boolean property for filtering based on package info*/
347 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
348 /** Boolean property for filtering based on package info*/
349 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
350 /** Boolean property for filtering based on package info*/
351 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
352 /** Boolean property for filtering based on package info*/
353 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
354 /** Boolean property for filtering based on package info*/
355 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
357 /** Integer property for filtering based on package info*/
358 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
360 /** String property for filtering based on app info*/
361 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
362 /** String property for filtering based on app info*/
363 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
364 /** String property for filtering based on app info*/
365 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
366 /** String property for filtering based on app info*/
367 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
368 /** String property for filtering based on app info*/
369 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
370 /** String property for filtering based on app info*/
371 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
372 /** String property for filtering based on app info*/
373 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
374 /** String property for filtering based on app info*/
375 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
376 /** String property for filtering based on app info*/
377 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
378 /** String property for filtering based on app info*/
379 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
381 /** Boolean property for filtering based on app info*/
382 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
383 /** Boolean property for filtering based on app info*/
384 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
385 /** Boolean property for filtering based on app info*/
386 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
387 /** Boolean property for filtering based on app info*/
388 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
389 /** Boolean property for filtering based on app info*/
390 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
393 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
394 * @brief This API gets list of installed packages
396 * @par This API is for package-manager client application
397 * @par Sync (or) Async : Synchronous API
398 * @param[in] pkg_list_cb iteration function for list
399 * @param[in] user_data user data to be passed to callback function
400 * @return 0 if success, error code(<0) if fail
401 * @retval PMINFO_R_OK success
402 * @retval PMINFO_R_EINVAL invalid argument
403 * @retval PMINFO_R_ERROR internal error
407 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
411 pkgid1 = (char *)user_data;
412 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
413 if (strcmp(pkgid1, pkgid2) == 0) {
420 static int list_pkgs()
423 char *name = "helloworld";
424 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
425 if (ret != PMINFO_R_OK) {
432 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
435 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
436 * @brief This API creates the package information handle from db
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] pkgid pointer to package ID
442 * @param[out] handle pointer to the package info handle.
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_pkgid()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_type(const char *pkgid)
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgtype: %s\n", type);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
474 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
475 * @brief This API gets the package name from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] pkg_name pointer to hold package name
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_type()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkg_name(const char *pkgid)
494 char *pkgname = NULL;
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkgname: %s\n", pkgname);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
513 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
514 * @brief This API gets the package id from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] pkgid pointer to hold package id
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_type()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkgid(const char *pkgid)
534 pkgmgrinfo_pkginfo_h handle;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkg id: %s\n", pkg_id);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
552 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
553 * @brief This API gets the package type from the package ID
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to package info handle
559 * @param[out] type pointer to hold package type
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
567 * @see pkgmgrinfo_pkginfo_is_removable()
569 static int get_pkg_type(const char *pkgid)
573 pkgmgrinfo_pkginfo_h handle;
574 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
575 if (ret != PMINFO_R_OK)
577 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
578 if (ret != PMINFO_R_OK) {
579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
582 printf("pkgtype: %s\n", type);
583 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
588 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
591 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
592 * @brief This API gets the package version from the package ID
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to package info handle
598 * @param[out] version pointer to hold package version
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
606 * @see pkgmgrinfo_pkginfo_is_removable()
608 static int get_pkg_version(const char *pkgid)
611 char *version = NULL;
612 pkgmgrinfo_pkginfo_h handle;
613 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
614 if (ret != PMINFO_R_OK)
616 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
617 if (ret != PMINFO_R_OK) {
618 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
621 printf("pkg version: %s\n", version);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
630 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
631 * @brief This API gets the package install location from the package ID
633 * @par This API is for package-manager client application
634 * @par Sync (or) Async : Synchronous API
636 * @param[in] handle pointer to package info handle
637 * @param[out] location pointer to hold package install location
638 * @return 0 if success, error code(<0) if fail
639 * @retval PMINFO_R_OK success
640 * @retval PMINFO_R_EINVAL invalid argument
641 * @retval PMINFO_R_ERROR internal error
642 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
643 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
644 * @see pkgmgrinfo_pkginfo_get_pkgid()
645 * @see pkgmgrinfo_pkginfo_is_removable()
647 static int get_pkg_install_location(const char *pkgid)
650 pkgmgrinfo_install_location location;
651 pkgmgrinfo_pkginfo_h handle;
652 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
653 if (ret != PMINFO_R_OK)
655 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
656 if (ret != PMINFO_R_OK) {
657 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
660 printf("pkg install location: %d\n", location);
661 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
666 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
669 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
670 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
671 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
672 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] size pointer to hold package size
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
683 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
684 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
685 * @see pkgmgrinfo_pkginfo_get_pkgid()
686 * @see pkgmgrinfo_pkginfo_is_removable()
688 static int get_pkg_size(const char *pkgid)
692 pkgmgrinfo_pkginfo_h handle;
693 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
694 if (ret != PMINFO_R_OK)
696 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
697 if (ret != PMINFO_R_OK) {
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701 printf("pkgsize: %d\n", size);
702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
707 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
710 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
711 * @brief This API gets the installed package total size on the target.
713 * @par This API is for package-manager client application
714 * @par Sync (or) Async : Synchronous API
716 * @param[in] handle pointer to package info handle
717 * @param[out] size pointer to hold package total size
718 * @return 0 if success, error code(<0) if fail
719 * @retval PMINFO_R_OK success
720 * @retval PMINFO_R_EINVAL invalid argument
721 * @retval PMINFO_R_ERROR internal error
723 static int get_pkg_total_size(const char *pkgid)
727 pkgmgrinfo_pkginfo_h handle;
728 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
729 if (ret != PMINFO_R_OK)
731 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
732 if (ret != PMINFO_R_OK) {
733 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
736 printf("pkg total size: %d\n", size);
737 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
745 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
746 * @brief This API gets the installed package data size on the target.
748 * @par This API is for package-manager client application
749 * @par Sync (or) Async : Synchronous API
751 * @param[in] handle pointer to package info handle
752 * @param[out] size pointer to hold package data size
753 * @return 0 if success, error code(<0) if fail
754 * @retval PMINFO_R_OK success
755 * @retval PMINFO_R_EINVAL invalid argument
756 * @retval PMINFO_R_ERROR internal error
758 static int get_pkg_data_size(const char *pkgid)
762 pkgmgrinfo_pkginfo_h handle;
763 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
764 if (ret != PMINFO_R_OK)
766 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
767 if (ret != PMINFO_R_OK) {
768 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
771 printf("pkg data size: %d\n", size);
772 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
777 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
780 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
781 * @brief This API gets the package icon from the package ID
783 * @par This API is for package-manager client application
784 * @par Sync (or) Async : Synchronous API
786 * @param[in] handle pointer to package info handle
787 * @param[out] icon pointer to hold package icon
788 * @return 0 if success, error code(<0) if fail
789 * @retval PMINFO_R_OK success
790 * @retval PMINFO_R_EINVAL invalid argument
791 * @retval PMINFO_R_ERROR internal error
792 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
793 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
794 * @see pkgmgrinfo_pkginfo_get_pkgid()
795 * @see pkgmgrinfo_pkginfo_is_removable()
797 static int get_pkg_icon(const char *pkgid)
801 pkgmgrinfo_pkginfo_h handle;
802 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
803 if (ret != PMINFO_R_OK)
805 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
806 if (ret != PMINFO_R_OK) {
807 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
810 printf("pkg icon: %s\n", icon);
811 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
816 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
819 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
820 * @brief This API gets the package label from the package ID
822 * @par This API is for package-manager client application
823 * @par Sync (or) Async : Synchronous API
825 * @param[in] handle pointer to package info handle
826 * @param[out] label pointer to hold package label
827 * @return 0 if success, error code(<0) if fail
828 * @retval PMINFO_R_OK success
829 * @retval PMINFO_R_EINVAL invalid argument
830 * @retval PMINFO_R_ERROR internal error
831 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
832 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
833 * @see pkgmgrinfo_pkginfo_get_pkgid()
834 * @see pkgmgrinfo_pkginfo_is_removable()
836 static int get_pkg_label(const char *pkgid)
840 pkgmgrinfo_pkginfo_h handle;
841 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
842 if (ret != PMINFO_R_OK)
844 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
845 if (ret != PMINFO_R_OK) {
846 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
849 printf("pkg label: %s\n", label);
850 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
855 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
858 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
859 * @brief This API gets the package description from the package ID
861 * @par This API is for package-manager client application
862 * @par Sync (or) Async : Synchronous API
864 * @param[in] handle pointer to package info handle
865 * @param[out] description pointer to hold package description
866 * @return 0 if success, error code(<0) if fail
867 * @retval PMINFO_R_OK success
868 * @retval PMINFO_R_EINVAL invalid argument
869 * @retval PMINFO_R_ERROR internal error
870 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
871 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
872 * @see pkgmgrinfo_pkginfo_get_pkgid()
873 * @see pkgmgrinfo_pkginfo_is_removable()
875 static int get_pkg_description(const char *pkgid)
878 char *description = NULL;
879 pkgmgrinfo_pkginfo_h handle;
880 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
881 if (ret != PMINFO_R_OK)
883 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
884 if (ret != PMINFO_R_OK) {
885 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
888 printf("pkg description: %s\n", description);
889 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
894 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
897 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
898 * @brief This API gets the package's author name from the package ID
900 * @par This API is for package-manager client application
901 * @par Sync (or) Async : Synchronous API
903 * @param[in] handle pointer to package info handle
904 * @param[out] author_name pointer to hold package author name
905 * @return 0 if success, error code(<0) if fail
906 * @retval PMINFO_R_OK success
907 * @retval PMINFO_R_EINVAL invalid argument
908 * @retval PMINFO_R_ERROR internal error
909 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
910 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
911 * @see pkgmgrinfo_pkginfo_get_pkgid()
912 * @see pkgmgrinfo_pkginfo_is_removable()
914 static int get_pkg_author_name(const char *pkgid)
917 char *author_name = NULL;
918 pkgmgrinfo_pkginfo_h handle;
919 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
920 if (ret != PMINFO_R_OK)
922 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
923 if (ret != PMINFO_R_OK) {
924 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
927 printf("pkg author name: %s\n", author_name);
928 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
933 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
936 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
937 * @brief This API gets the package's author email from the package ID
939 * @par This API is for package-manager client application
940 * @par Sync (or) Async : Synchronous API
942 * @param[in] handle pointer to package info handle
943 * @param[out] author_email pointer to hold package author email
944 * @return 0 if success, error code(<0) if fail
945 * @retval PMINFO_R_OK success
946 * @retval PMINFO_R_EINVAL invalid argument
947 * @retval PMINFO_R_ERROR internal error
948 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
949 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
950 * @see pkgmgrinfo_pkginfo_get_pkgid()
951 * @see pkgmgrinfo_pkginfo_is_removable()
953 static int get_pkg_author_email(const char *pkgid)
956 char *author_email = NULL;
957 pkgmgrinfo_pkginfo_h handle;
958 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
959 if (ret != PMINFO_R_OK)
961 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
962 if (ret != PMINFO_R_OK) {
963 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
966 printf("pkg author email: %s\n", author_email);
967 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
972 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
975 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
976 * @brief This API gets the package's author href from the package ID
978 * @par This API is for package-manager client application
979 * @par Sync (or) Async : Synchronous API
981 * @param[in] handle pointer to package info handle
982 * @param[out] author_href pointer to hold package author href
983 * @return 0 if success, error code(<0) if fail
984 * @retval PMINFO_R_OK success
985 * @retval PMINFO_R_EINVAL invalid argument
986 * @retval PMINFO_R_ERROR internal error
987 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
988 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
989 * @see pkgmgrinfo_pkginfo_get_pkgid()
990 * @see pkgmgrinfo_pkginfo_is_removable()
992 static int get_pkg_author_href(const char *pkgid)
995 char *author_href = NULL;
996 pkgmgrinfo_pkginfo_h handle;
997 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
998 if (ret != PMINFO_R_OK)
1000 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1001 if (ret != PMINFO_R_OK) {
1002 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1005 printf("pkg author href: %s\n", author_href);
1006 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1011 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1014 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1015 * @brief This API gets the package installed storagae value from the package ID
1017 * @par This API is for package-manager client application
1018 * @par Sync (or) Async : Synchronous API
1020 * @param[in] handle pointer to package info handle
1021 * @param[out] storage pointer to hold package installed storage
1022 * @return 0 if success, error code(<0) if fail
1023 * @retval PMINFO_R_OK success
1024 * @retval PMINFO_R_EINVAL invalid argument
1025 * @retval PMINFO_R_ERROR internal error
1026 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1027 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1028 * @see pkgmgrinfo_pkginfo_get_pkgid()
1029 * @see pkgmgrinfo_pkginfo_is_removable()
1031 static int get_pkg_installed_storage(const char *pkgid)
1034 pkgmgrinfo_installed_storage storage;
1035 pkgmgrinfo_pkginfo_h handle;
1036 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1037 if (ret != PMINFO_R_OK)
1039 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1040 if (ret != PMINFO_R_OK) {
1041 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1044 printf("pkg installed storage: %d\n", storage);
1045 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1050 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1053 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1054 * @brief This API gets the installed time of package from the package ID
1056 * @par This API is for package-manager client application
1057 * @par Sync (or) Async : Synchronous API
1059 * @param[in] handle pointer to package info handle
1060 * @param[out] installed_time pointer to hold installed time of package
1061 * @return 0 if success, error code(<0) if fail
1062 * @retval PMINFO_R_OK success
1063 * @retval PMINFO_R_EINVAL invalid argument
1064 * @retval PMINFO_R_ERROR internal error
1065 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1066 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1067 * @see pkgmgrinfo_pkginfo_get_pkgid()
1068 * @see pkgmgrinfo_pkginfo_is_removable()
1070 static int get_pkg_installed_time(const char *pkgid)
1073 int installed_time = 0;
1074 pkgmgrinfo_pkginfo_h handle;
1075 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1076 if (ret != PMINFO_R_OK)
1078 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1079 if (ret != PMINFO_R_OK) {
1080 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1083 printf("installed_time: %d\n", installed_time);
1084 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1089 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1092 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1093 * @brief This API gets the store client id of package from the package ID
1095 * @par This API is for package-manager client application
1096 * @par Sync (or) Async : Synchronous API
1098 * @param[in] handle pointer to package info handle
1099 * @param[out] storeclientid pointer to hold store client id of package
1100 * @return 0 if success, error code(<0) if fail
1101 * @retval PMINFO_R_OK success
1102 * @retval PMINFO_R_EINVAL invalid argument
1103 * @retval PMINFO_R_ERROR internal error
1104 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1105 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1106 * @see pkgmgrinfo_pkginfo_get_pkgid()
1107 * @see pkgmgrinfo_pkginfo_is_removable()
1109 static int get_pkg_storeclientid(const char *pkgid)
1112 char *storeclientid = 0;
1113 pkgmgrinfo_pkginfo_h handle;
1114 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1115 if (ret != PMINFO_R_OK)
1117 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1118 if (ret != PMINFO_R_OK) {
1119 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1122 printf(store client id: %s\n", storeclientid);
1123 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1128 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1131 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1132 * @brief This API gets the main app id of package from the package ID
1134 * @par This API is for package-manager client application
1135 * @par Sync (or) Async : Synchronous API
1137 * @param[in] handle pointer to package info handle
1138 * @param[out] mainappid pointer to hold main app id of package
1139 * @return 0 if success, error code(<0) if fail
1140 * @retval PMINFO_R_OK success
1141 * @retval PMINFO_R_EINVAL invalid argument
1142 * @retval PMINFO_R_ERROR internal error
1143 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1144 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1145 * @see pkgmgrinfo_pkginfo_get_pkgid()
1146 * @see pkgmgrinfo_pkginfo_is_removable()
1148 static int get_pkg_mainappid(const char *pkgid)
1151 char *mainappid = 0;
1152 pkgmgrinfo_pkginfo_h handle;
1153 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1154 if (ret != PMINFO_R_OK)
1156 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1157 if (ret != PMINFO_R_OK) {
1158 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1161 printf(main app id: %s\n", mainappid);
1162 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1167 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1170 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1171 * @brief This API gets the url of package from the package ID
1173 * @par This API is for package-manager client application
1174 * @par Sync (or) Async : Synchronous API
1176 * @param[in] handle pointer to package info handle
1177 * @param[out] url pointer to hold url of package
1178 * @return 0 if success, error code(<0) if fail
1179 * @retval PMINFO_R_OK success
1180 * @retval PMINFO_R_EINVAL invalid argument
1181 * @retval PMINFO_R_ERROR internal error
1182 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1183 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1184 * @see pkgmgrinfo_pkginfo_get_pkgid()
1185 * @see pkgmgrinfo_pkginfo_is_removable()
1187 static int get_pkg_url(const char *pkgid)
1191 pkgmgrinfo_pkginfo_h handle;
1192 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1193 if (ret != PMINFO_R_OK)
1195 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1196 if (ret != PMINFO_R_OK) {
1197 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1200 printf("url : %s\n", url);
1201 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1206 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1210 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1211 * @brief This API gets the root path of package
1213 * @par Sync (or) Async : Synchronous API
1215 * @param[in] handle pointer to package info handle
1216 * @param[out] path pointer to hold root path of package
1217 * @return 0 if success, error code(<0) if fail
1218 * @retval PMINFO_R_OK success
1219 * @retval PMINFO_R_EINVAL invalid argument
1220 * @retval PMINFO_R_ERROR internal error
1222 static int get_root_path(const char *pkgid)
1226 pkgmgrinfo_pkginfo_h handle;
1227 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1228 if (ret != PMINFO_R_OK)
1231 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1232 if (ret != PMINFO_R_OK) {
1233 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1236 printf("path : %s\n", path);
1237 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1243 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1246 * @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)
1247 * @brief This API compare the cert information from given package id
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] lhs_package_id pointer to first package ID
1253 * @param[in] rhs_package_id pointer to second package ID
1254 * @param[out] compare_result pointer to the compare result.
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 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1261 * @see pkgmgrinfo_pkginfo_get_pkgid()
1262 * @see pkgmgrinfo_pkginfo_is_removable()
1264 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1267 pkgmgrinfo_cert_compare_result_type_e result;
1269 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1270 if (ret != PMINFO_R_OK) {
1273 printf("result: %d\n", result);
1278 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);
1281 * @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)
1282 * @brief This API compare the cert information from given app id
1284 * @par This API is for package-manager client application
1285 * @par Sync (or) Async : Synchronous API
1287 * @param[in] lhs_app_id pointer to first app ID
1288 * @param[in] rhs_app_id pointer to second app ID
1289 * @param[out] compare_result pointer to the compare result.
1290 * @return 0 if success, error code(<0) if fail
1291 * @retval PMINFO_R_OK success
1292 * @retval PMINFO_R_EINVAL invalid argument
1293 * @retval PMINFO_R_ERROR internal error
1295 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1296 * @see pkgmgrinfo_pkginfo_get_pkgid()
1297 * @see pkgmgrinfo_pkginfo_is_removable()
1299 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1302 pkgmgrinfo_cert_compare_result_type_e result;
1304 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1305 if (ret != PMINFO_R_OK) {
1308 printf("result: %d\n", result);
1313 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);
1316 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1317 * @brief This API gets the package 'removable' value from the package ID
1319 * @par This API is for package-manager client application
1320 * @par Sync (or) Async : Synchronous API
1322 * @param[in] handle pointer to package info handle
1323 * @param[out] removable pointer to hold package removable value
1324 * @return 0 if success, error code(<0) if fail
1325 * @retval PMINFO_R_OK success
1326 * @retval PMINFO_R_EINVAL invalid argument
1327 * @retval PMINFO_R_ERROR internal error
1328 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1329 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1330 * @see pkgmgrinfo_pkginfo_get_pkgid()
1331 * @see pkgmgrinfo_pkginfo_is_readonly()
1333 static int get_pkg_removable(const char *pkgid)
1337 pkgmgrinfo_pkginfo_h handle;
1338 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1339 if (ret != PMINFO_R_OK)
1341 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1342 if (ret != PMINFO_R_OK) {
1343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1346 printf("pkg removable: %d\n", removable);
1347 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1352 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1355 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1356 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1358 * @par This API is for package-manager client application
1359 * @par Sync (or) Async : Synchronous API
1361 * @param[in] handle pointer to package info handle
1362 * @param[out] movable pointer to hold package movable state
1363 * @return 0 if success, error code(<0) if fail
1364 * @retval PMINFO_R_OK success
1365 * @retval PMINFO_R_EINVAL invalid argument
1366 * @retval PMINFO_R_ERROR internal error
1367 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1368 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1369 * @see pkgmgrinfo_pkginfo_get_pkgid()
1371 static int get_pkg_movable(const char *pkgid)
1375 pkgmgrinfo_pkginfo_h handle;
1376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1377 if (ret != PMINFO_R_OK)
1379 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1380 if (ret != PMINFO_R_OK) {
1381 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1384 printf("pkg movable: %d\n", movable);
1385 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1390 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1393 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1394 * @brief This API gets the package 'preload' value from the package ID
1396 * @par This API is for package-manager client application
1397 * @par Sync (or) Async : Synchronous API
1399 * @param[in] handle pointer to package info handle
1400 * @param[out] preload pointer to hold package preload value
1401 * @return 0 if success, error code(<0) if fail
1402 * @retval PMINFO_R_OK success
1403 * @retval PMINFO_R_EINVAL invalid argument
1404 * @retval PMINFO_R_ERROR internal error
1405 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1406 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1407 * @see pkgmgrinfo_pkginfo_get_pkgid()
1408 * @see pkgmgrinfo_pkginfo_is_readonly()
1410 static int get_pkg_preload(const char *pkgid)
1414 pkgmgrinfo_pkginfo_h handle;
1415 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1416 if (ret != PMINFO_R_OK)
1418 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1419 if (ret != PMINFO_R_OK) {
1420 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1423 printf("pkg preload: %d\n", preload);
1424 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1429 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1432 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1433 * @brief This API gets the package 'readonly' value from the package ID
1435 * @par This API is for package-manager client application
1436 * @par Sync (or) Async : Synchronous API
1438 * @param[in] handle pointer to package info handle
1439 * @param[out] readonly pointer to hold package readonly value
1440 * @return 0 if success, error code(<0) if fail
1441 * @retval PMINFO_R_OK success
1442 * @retval PMINFO_R_EINVAL invalid argument
1443 * @retval PMINFO_R_ERROR internal error
1444 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1445 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1446 * @see pkgmgrinfo_pkginfo_get_pkgid()
1447 * @see pkgmgrinfo_pkginfo_is_removable()
1449 static int get_pkg_readonly(const char *pkgid)
1453 pkgmgrinfo_pkginfo_h handle;
1454 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1455 if (ret != PMINFO_R_OK)
1457 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1458 if (ret != PMINFO_R_OK) {
1459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1462 printf("pkg readonly: %d\n", readonly);
1463 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1468 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1472 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1473 * @brief This API gets the package 'upate' value from the package ID
1475 * @par This API is for package-manager client application
1476 * @par Sync (or) Async : Synchronous API
1478 * @param[in] handle pointer to package info handle
1479 * @param[out] update pointer to hold package update value
1480 * @return 0 if success, error code(<0) if fail
1481 * @retval PMINFO_R_OK success
1482 * @retval PMINFO_R_EINVAL invalid argument
1483 * @retval PMINFO_R_ERROR internal error
1484 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1485 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1486 * @see pkgmgrinfo_pkginfo_get_pkgid()
1488 static int get_pkg_update(const char *pkgid)
1492 pkgmgrinfo_pkginfo_h handle;
1493 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1494 if (ret != PMINFO_R_OK)
1496 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1497 if (ret != PMINFO_R_OK) {
1498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1501 printf("pkg update: %d\n", update);
1502 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1507 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1510 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1511 * @brief This API gets the package 'accessible' value from the package ID
1513 * @par This API is for package-manager client application
1514 * @par Sync (or) Async : Synchronous API
1516 * @param[in] handle pointer to package info handle
1517 * @param[out] accessible pointer to hold package accessible value
1518 * @return 0 if success, error code(<0) if fail
1519 * @retval PMINFO_R_OK success
1520 * @retval PMINFO_R_EINVAL invalid argument
1521 * @retval PMINFO_R_ERROR internal error
1522 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1523 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1524 * @see pkgmgrinfo_pkginfo_get_pkgid()
1525 * @see pkgmgrinfo_pkginfo_is_readonly()
1527 static int get_pkg_accessible(const char *pkgid)
1531 pkgmgrinfo_pkginfo_h handle;
1532 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1533 if (ret != PMINFO_R_OK)
1535 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1536 if (ret != PMINFO_R_OK) {
1537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1540 printf("pkg accessible: %d\n", accessible);
1541 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1546 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1549 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1550 * @brief This API destroys the package information handle freeing up all the resources
1552 * @par This API is for package-manager client application
1553 * @par Sync (or) Async : Synchronous API
1555 * @param[in] handle pointer to the package info handle
1556 * @return 0 if success, error code(<0) if fail
1557 * @retval PMINFO_R_OK success
1558 * @retval PMINFO_R_EINVAL invalid argument
1559 * @retval PMINFO_R_ERROR internal error
1560 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1562 * @see pkgmgrinfo_pkginfo_get_pkgid()
1563 * @see pkgmgrinfo_pkginfo_is_removable()
1565 static int get_pkg_type(const char *pkgid)
1569 pkgmgrinfo_pkginfo_h handle;
1570 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1571 if (ret != PMINFO_R_OK)
1573 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1574 if (ret != PMINFO_R_OK) {
1575 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1578 printf("pkgtype: %s\n", type);
1579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1584 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1587 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1588 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1589 The query will search the entire package information collected from the manifest file of all the installed packages
1591 * @par This API is for package-manager client application
1592 * @par Sync (or) Async : Synchronous API
1594 * @param[out] handle pointer to the package info filter handle.
1595 * @return 0 if success, error code(<0) if fail
1596 * @retval PMINFO_R_OK success
1597 * @retval PMINFO_R_EINVAL invalid argument
1598 * @retval PMINFO_R_ERROR internal error
1600 * @post pkgmgrinfo_pkginfo_filter_destroy()
1601 * @see pkgmgrinfo_pkginfo_filter_count()
1602 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1604 static int get_rpm_pkg_count()
1608 pkgmgrinfo_pkginfo_filter_h handle;
1609 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1610 if (ret != PMINFO_R_OK)
1612 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1613 if (ret != PMINFO_R_OK) {
1614 pkgmgrinfo_pkginfo_filter_destroy(handle);
1617 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1618 if (ret != PMINFO_R_OK) {
1619 pkgmgrinfo_pkginfo_filter_destroy(handle);
1622 printf("No of rpm pkgs: %d\n", count);
1623 pkgmgrinfo_pkginfo_filter_destroy(handle);
1628 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1631 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1632 * @brief This API destroys the package information filter handle freeing up all the resources
1634 * @par This API is for package-manager client application
1635 * @par Sync (or) Async : Synchronous API
1637 * @param[in] handle pointer to the package info filter handle.
1638 * @return 0 if success, error code(<0) if fail
1639 * @retval PMINFO_R_OK success
1640 * @retval PMINFO_R_EINVAL invalid argument
1641 * @retval PMINFO_R_ERROR internal error
1642 * @pre pkgmgrinfo_pkginfo_filter_create()
1644 * @see pkgmgrinfo_pkginfo_filter_count()
1645 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1647 static int get_rpm_pkg_count()
1651 pkgmgrinfo_pkginfo_filter_h handle;
1652 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1653 if (ret != PMINFO_R_OK)
1655 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1656 if (ret != PMINFO_R_OK) {
1657 pkgmgrinfo_pkginfo_filter_destroy(handle);
1660 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1661 if (ret != PMINFO_R_OK) {
1662 pkgmgrinfo_pkginfo_filter_destroy(handle);
1665 printf("No of rpm pkgs: %d\n", count);
1666 pkgmgrinfo_pkginfo_filter_destroy(handle);
1671 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1674 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1675 * @brief This API adds a boolean filter property to the filter handle
1677 * @par This API is for package-manager client application
1678 * @par Sync (or) Async : Synchronous API
1680 * @param[in] handle pointer to the package info filter handle.
1681 * @param[in] property boolean property name.
1682 * @param[in] value value corresponding to the property.
1683 * @return 0 if success, error code(<0) if fail
1684 * @retval PMINFO_R_OK success
1685 * @retval PMINFO_R_EINVAL invalid argument
1686 * @retval PMINFO_R_ERROR internal error
1687 * @pre pkgmgrinfo_pkginfo_filter_create()
1688 * @post pkgmgrinfo_pkginfo_filter_destroy()
1689 * @see pkgmgrinfo_pkginfo_filter_count()
1690 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1692 static int get_preload_pkg_count()
1696 pkgmgrinfo_pkginfo_filter_h handle;
1697 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1698 if (ret != PMINFO_R_OK)
1700 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1701 if (ret != PMINFO_R_OK) {
1702 pkgmgrinfo_pkginfo_filter_destroy(handle);
1705 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1706 if (ret != PMINFO_R_OK) {
1707 pkgmgrinfo_pkginfo_filter_destroy(handle);
1710 printf("No of preload pkgs: %d\n", count);
1711 pkgmgrinfo_pkginfo_filter_destroy(handle);
1716 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1717 const char *property, const bool value);
1720 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1721 * @brief This API adds an integer filter property to the filter handle
1723 * @par This API is for package-manager client application
1724 * @par Sync (or) Async : Synchronous API
1726 * @param[in] handle pointer to the package info filter handle.
1727 * @param[in] property integer property name.
1728 * @param[in] value value corresponding to the property.
1729 * @return 0 if success, error code(<0) if fail
1730 * @retval PMINFO_R_OK success
1731 * @retval PMINFO_R_EINVAL invalid argument
1732 * @retval PMINFO_R_ERROR internal error
1733 * @pre pkgmgrinfo_pkginfo_filter_create()
1734 * @post pkgmgrinfo_pkginfo_filter_destroy()
1735 * @see pkgmgrinfo_pkginfo_filter_count()
1736 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1738 static int get_pkg_count()
1742 pkgmgrinfo_pkginfo_filter_h handle;
1743 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1744 if (ret != PMINFO_R_OK)
1746 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1747 if (ret != PMINFO_R_OK) {
1748 pkgmgrinfo_pkginfo_filter_destroy(handle);
1751 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1752 if (ret != PMINFO_R_OK) {
1753 pkgmgrinfo_pkginfo_filter_destroy(handle);
1756 printf("No of preload pkgs: %d\n", count);
1757 pkgmgrinfo_pkginfo_filter_destroy(handle);
1762 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1763 const char *property, const int value);
1766 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1767 * @brief This API adds a string filter property to the filter handle
1769 * @par This API is for package-manager client application
1770 * @par Sync (or) Async : Synchronous API
1772 * @param[in] handle pointer to the package info filter handle.
1773 * @param[in] property string property name.
1774 * @param[in] value value corresponding to the property.
1775 * @return 0 if success, error code(<0) if fail
1776 * @retval PMINFO_R_OK success
1777 * @retval PMINFO_R_EINVAL invalid argument
1778 * @retval PMINFO_R_ERROR internal error
1779 * @pre pkgmgrinfo_pkginfo_filter_create()
1780 * @post pkgmgrinfo_pkginfo_filter_destroy()
1781 * @see pkgmgrinfo_pkginfo_filter_count()
1782 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1784 static int get_rpm_pkg_count()
1788 pkgmgrinfo_pkginfo_filter_h handle;
1789 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1790 if (ret != PMINFO_R_OK)
1792 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1793 if (ret != PMINFO_R_OK) {
1794 pkgmgrinfo_pkginfo_filter_destroy(handle);
1797 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 printf("No of rpm pkgs: %d\n", count);
1803 pkgmgrinfo_pkginfo_filter_destroy(handle);
1808 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1809 const char *property, const char *value);
1812 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1813 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1815 * @par This API is for package-manager client application
1816 * @par Sync (or) Async : Synchronous API
1818 * @param[in] handle pointer to the package info filter handle.
1819 * @param[in] pkg_cb callback function.
1820 * @param[in] user_data user data to be passed to the callback function
1821 * @return 0 if success, error code(<0) if fail
1822 * @retval PMINFO_R_OK success
1823 * @retval PMINFO_R_EINVAL invalid argument
1824 * @retval PMINFO_R_ERROR internal error
1825 * @pre pkgmgrinfo_pkginfo_filter_create()
1826 * @post pkgmgrinfo_pkginfo_filter_destroy()
1827 * @see pkgmgrinfo_pkginfo_filter_count()
1829 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1832 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1833 printf("pkg id : %s\n", pkgid);
1837 static int get_rpm_pkg_list()
1840 pkgmgrinfo_pkginfo_filter_h handle;
1841 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1842 if (ret != PMINFO_R_OK)
1844 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1845 if (ret != PMINFO_R_OK) {
1846 pkgmgrinfo_pkginfo_filter_destroy(handle);
1849 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1850 if (ret != PMINFO_R_OK) {
1851 pkgmgrinfo_pkginfo_filter_destroy(handle);
1854 pkgmgrinfo_pkginfo_filter_destroy(handle);
1859 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1860 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1863 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1864 * @brief This API counts the package that satisfy the filter conditions
1866 * @par This API is for package-manager client application
1867 * @par Sync (or) Async : Synchronous API
1869 * @param[in] handle pointer to the package info filter handle.
1870 * @param[in] count pointer to store the count value.
1871 * @return 0 if success, error code(<0) if fail
1872 * @retval PMINFO_R_OK success
1873 * @retval PMINFO_R_EINVAL invalid argument
1874 * @retval PMINFO_R_ERROR internal error
1875 * @pre pkgmgrinfo_pkginfo_filter_create()
1876 * @post pkgmgrinfo_pkginfo_filter_destroy()
1877 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1879 static int get_rpm_pkg_count()
1883 pkgmgrinfo_pkginfo_filter_h handle;
1884 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1885 if (ret != PMINFO_R_OK)
1887 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1888 if (ret != PMINFO_R_OK) {
1889 pkgmgrinfo_pkginfo_filter_destroy(handle);
1892 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_filter_destroy(handle);
1897 printf("No of rpm pkgs: %d\n", count);
1898 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1906 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1907 pkgmgrinfo_app_list_cb app_func, void *user_data)
1908 * @brief This API gets list of installed applications for a particular package
1910 * @par This API is for package-manager client application
1911 * @par Sync (or) Async : Synchronous API
1912 * @param[in] handle package info handle
1913 * @param[in] component application component
1914 * @param[in] app_func iteration function for list
1915 * @param[in] user_data user data to be passed to callback function
1916 * @return 0 if success, error code(<0) if fail
1917 * @retval PMINFO_R_OK success
1918 * @retval PMINFO_R_EINVAL invalid argument
1919 * @retval PMINFO_R_ERROR internal error
1920 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1921 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1923 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1926 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1927 printf("appid : %s\n", appid);
1931 static int list_apps(const char *pkgid)
1934 pkgmgrinfo_pkginfo_h handle;
1935 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1936 if (ret != PMINFO_R_OK)
1938 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1939 if (ret != PMINFO_R_OK) {
1940 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1943 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1948 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1949 pkgmgrinfo_app_list_cb app_func, void *user_data);
1952 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1953 * @brief This API gets list of installed applications from all packages.
1955 * @par This API is for package-manager client application
1956 * @par Sync (or) Async : Synchronous API
1957 * @param[in] app_func iteration function for list
1958 * @param[in] user_data user data to be passed to callback function
1959 * @return 0 if success, error code(<0) if fail
1960 * @retval PMINFO_R_OK success
1961 * @retval PMINFO_R_EINVAL invalid argument
1962 * @retval PMINFO_R_ERROR internal error
1966 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1968 char *pkgid1 = NULL;
1969 char *pkgid2 = NULL;
1970 pkgid1 = (char *)user_data;
1971 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1972 if (strcmp(pkgid1, pkgid2) == 0) {
1979 static int list_apps()
1982 char *name = "helloworld";
1983 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1984 if (ret != PMINFO_R_OK) {
1991 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1994 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
1995 * @brief This API creates the application information handle from db
1997 * @par This API is for package-manager client application
1998 * @par Sync (or) Async : Synchronous API
2000 * @param[in] appid pointer to appid
2001 * @param[out] handle pointer to the application info handle.
2002 * @return 0 if success, error code(<0) if fail
2003 * @retval PMINFO_R_OK success
2004 * @retval PMINFO_R_EINVAL invalid argument
2005 * @retval PMINFO_R_ERROR internal error
2007 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2008 * @see pkgmgrinfo_appinfo_get_pkgid()
2009 * @see pkgmgrinfo_appinfo_is_multiple()
2011 static int get_app_type(const char *appid)
2015 pkgmgrinfo_appinfo_h handle;
2016 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2017 if (ret != PMINFO_R_OK)
2019 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2020 if (ret != PMINFO_R_OK) {
2021 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2024 printf("apptype: %s\n", type);
2025 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2030 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2033 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2034 * @brief This API gets the application ID
2036 * @par This API is for package-manager client application
2037 * @par Sync (or) Async : Synchronous API
2039 * @param[in] handle pointer to the application info handle.
2040 * @param[out] appid pointer to hold appid
2041 * @return 0 if success, error code(<0) if fail
2042 * @retval PMINFO_R_OK success
2043 * @retval PMINFO_R_EINVAL invalid argument
2044 * @retval PMINFO_R_ERROR internal error
2045 * @pre pkgmgrinfo_appinfo_get_appinfo()
2046 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2047 * @see pkgmgrinfo_appinfo_get_pkgid()
2048 * @see pkgmgrinfo_appinfo_is_multiple()
2050 static int get_app_id(const char *appid)
2053 char *app_id = NULL;
2054 pkgmgrinfo_appinfo_h handle;
2055 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2056 if (ret != PMINFO_R_OK)
2058 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2059 if (ret != PMINFO_R_OK) {
2060 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2063 printf("app id: %s\n", app_id);
2064 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2069 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2072 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2073 * @brief This API gets the package name of the application
2075 * @par This API is for package-manager client application
2076 * @par Sync (or) Async : Synchronous API
2078 * @param[in] handle pointer to the application info handle.
2079 * @param[out] pkg_name pointer to hold package name
2080 * @return 0 if success, error code(<0) if fail
2081 * @retval PMINFO_R_OK success
2082 * @retval PMINFO_R_EINVAL invalid argument
2083 * @retval PMINFO_R_ERROR internal error
2084 * @pre pkgmgrinfo_appinfo_get_appinfo()
2085 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2086 * @see pkgmgrinfo_appinfo_get_appid()
2087 * @see pkgmgrinfo_appinfo_is_multiple()
2089 static int get_app_pkgname(const char *appid)
2092 char *pkgname = NULL;
2093 pkgmgrinfo_appinfo_h handle;
2094 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2095 if (ret != PMINFO_R_OK)
2097 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2098 if (ret != PMINFO_R_OK) {
2099 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2102 printf("pkg name: %s\n", pkgname);
2103 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2108 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2111 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2112 * @brief This API gets the package id of the application
2114 * @par This API is for package-manager client application
2115 * @par Sync (or) Async : Synchronous API
2117 * @param[in] handle pointer to the application info handle.
2118 * @param[out] pkgid pointer to hold package id
2119 * @return 0 if success, error code(<0) if fail
2120 * @retval PMINFO_R_OK success
2121 * @retval PMINFO_R_EINVAL invalid argument
2122 * @retval PMINFO_R_ERROR internal error
2123 * @pre pkgmgrinfo_appinfo_get_appinfo()
2124 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2125 * @see pkgmgrinfo_appinfo_get_appid()
2126 * @see pkgmgrinfo_appinfo_is_multiple()
2128 static int get_app_pkgid(const char *appid)
2132 pkgmgrinfo_appinfo_h handle;
2133 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2134 if (ret != PMINFO_R_OK)
2136 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2137 if (ret != PMINFO_R_OK) {
2138 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2141 printf("pkg id: %s\n", pkgid);
2142 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2147 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2150 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2151 * @brief This API gets the executable name of the application
2153 * @par This API is for package-manager client application
2154 * @par Sync (or) Async : Synchronous API
2156 * @param[in] handle pointer to the application info handle.
2157 * @param[out] exec pointer to hold app exec name
2158 * @return 0 if success, error code(<0) if fail
2159 * @retval PMINFO_R_OK success
2160 * @retval PMINFO_R_EINVAL invalid argument
2161 * @retval PMINFO_R_ERROR internal error
2162 * @pre pkgmgrinfo_appinfo_get_appinfo()
2163 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2164 * @see pkgmgrinfo_appinfo_get_appid()
2165 * @see pkgmgrinfo_appinfo_is_multiple()
2167 static int get_app_exec(const char *appid)
2171 pkgmgrinfo_appinfo_h handle;
2172 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2173 if (ret != PMINFO_R_OK)
2175 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2176 if (ret != PMINFO_R_OK) {
2177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2180 printf("exec name: %s\n", exec);
2181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2186 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2189 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2190 * @brief This API gets the icon name of the application
2192 * @par This API is for package-manager client application
2193 * @par Sync (or) Async : Synchronous API
2195 * @param[in] handle pointer to the application info handle.
2196 * @param[out] icon pointer to hold app icon name
2197 * @return 0 if success, error code(<0) if fail
2198 * @retval PMINFO_R_OK success
2199 * @retval PMINFO_R_EINVAL invalid argument
2200 * @retval PMINFO_R_ERROR internal error
2201 * @pre pkgmgrinfo_appinfo_get_appinfo()
2202 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2203 * @see pkgmgrinfo_appinfo_get_appid()
2204 * @see pkgmgrinfo_appinfo_is_multiple()
2206 static int get_app_icon(const char *appid)
2210 pkgmgrinfo_appinfo_h handle;
2211 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2212 if (ret != PMINFO_R_OK)
2214 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2215 if (ret != PMINFO_R_OK) {
2216 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2219 printf("icon name: %s\n", icon);
2220 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2225 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2228 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2229 * @brief This API gets the label of the application
2231 * @par This API is for package-manager client application
2232 * @par Sync (or) Async : Synchronous API
2234 * @param[in] handle pointer to the application info handle.
2235 * @param[out] label pointer to hold app label
2236 * @return 0 if success, error code(<0) if fail
2237 * @retval PMINFO_R_OK success
2238 * @retval PMINFO_R_EINVAL invalid argument
2239 * @retval PMINFO_R_ERROR internal error
2240 * @pre pkgmgrinfo_appinfo_get_appinfo()
2241 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2242 * @see pkgmgrinfo_appinfo_get_appid()
2243 * @see pkgmgrinfo_appinfo_is_multiple()
2245 static int get_app_label(const char *appid)
2249 pkgmgrinfo_appinfo_h handle;
2250 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2251 if (ret != PMINFO_R_OK)
2253 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2254 if (ret != PMINFO_R_OK) {
2255 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2258 printf("label : %s\n", label);
2259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2264 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2267 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2268 * @brief This API gets the component of the application
2270 * @par This API is for package-manager client application
2271 * @par Sync (or) Async : Synchronous API
2273 * @param[in] handle pointer to the application info handle.
2274 * @param[out] component pointer to hold app component
2275 * @return 0 if success, error code(<0) if fail
2276 * @retval PMINFO_R_OK success
2277 * @retval PMINFO_R_EINVAL invalid argument
2278 * @retval PMINFO_R_ERROR internal error
2279 * @pre pkgmgrinfo_appinfo_get_appinfo()
2280 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2281 * @see pkgmgrinfo_appinfo_get_appid()
2282 * @see pkgmgrinfo_appinfo_is_multiple()
2284 static int get_app_component(const char *appid)
2287 pkgmgrinfo_app_component component;
2288 pkgmgrinfo_appinfo_h handle;
2289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2290 if (ret != PMINFO_R_OK)
2292 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2293 if (ret != PMINFO_R_OK) {
2294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2297 printf("component : %s\n", component);
2298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2303 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2306 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2307 * @brief This API gets the apptype of the application
2309 * @par This API is for package-manager client application
2310 * @par Sync (or) Async : Synchronous API
2312 * @param[in] handle pointer to the application info handle.
2313 * @param[out] app_type pointer to hold apptype
2314 * @return 0 if success, error code(<0) if fail
2315 * @retval PMINFO_R_OK success
2316 * @retval PMINFO_R_EINVAL invalid argument
2317 * @retval PMINFO_R_ERROR internal error
2318 * @pre pkgmgrinfo_appinfo_get_appinfo()
2319 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2320 * @see pkgmgrinfo_appinfo_get_appid()
2321 * @see pkgmgrinfo_appinfo_is_multiple()
2323 static int get_app_type(const char *appid)
2326 char *apptype = NULL;
2327 pkgmgrinfo_appinfo_h handle;
2328 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2329 if (ret != PMINFO_R_OK)
2331 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2332 if (ret != PMINFO_R_OK) {
2333 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2336 printf("apptype : %s\n", apptype);
2337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2342 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2345 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2346 int *operation_count, char ***operation)
2347 * @brief This API gets the list of operation of the application
2349 * @par This API is for package-manager client application
2350 * @par Sync (or) Async : Synchronous API
2352 * @param[in] handle pointer to the appcontrol handle.
2353 * @param[out] operation_count pointer to hold number of operations
2354 * @param[out] operation pointer to hold list of operations
2355 * @return 0 if success, error code(<0) if fail
2356 * @retval PMINFO_R_OK success
2357 * @retval PMINFO_R_EINVAL invalid argument
2358 * @retval PMINFO_R_ERROR internal error
2359 * @pre pkgmgrinfo_appinfo_get_appinfo()
2360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2361 * @see pkgmgrinfo_appinfo_get_uri()
2362 * @see pkgmgrinfo_appinfo_get_mime()
2364 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2369 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2370 for (i = 0; i < oc; i++) {
2371 if (strcmp(operation[i], (char *)user_data) == 0)
2378 static int check_operation(const char *appid, char *operation)
2381 pkgmgrinfo_appinfo_h handle;
2382 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2383 if (ret != PMINFO_R_OK)
2385 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2395 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2396 int *operation_count, char ***operation);
2399 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2400 int *uri_count, char ***uri)
2401 * @brief This API gets the list of uri of the application
2403 * @par This API is for package-manager client application
2404 * @par Sync (or) Async : Synchronous API
2406 * @param[in] handle pointer to the appcontrol handle.
2407 * @param[out] uri_count pointer to hold number of uris
2408 * @param[out] uri pointer to hold list of uris
2409 * @return 0 if success, error code(<0) if fail
2410 * @retval PMINFO_R_OK success
2411 * @retval PMINFO_R_EINVAL invalid argument
2412 * @retval PMINFO_R_ERROR internal error
2413 * @pre pkgmgrinfo_appinfo_get_appinfo()
2414 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2415 * @see pkgmgrinfo_appinfo_get_operation()
2416 * @see pkgmgrinfo_appinfo_get_mime()
2418 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2423 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2424 for (i = 0; i < uc; i++) {
2425 if (strcmp(uri[i], (char *)user_data) == 0)
2432 static int check_uri(const char *appid, char *uri)
2435 pkgmgrinfo_appinfo_h handle;
2436 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2437 if (ret != PMINFO_R_OK)
2439 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2440 if (ret != PMINFO_R_OK) {
2441 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2449 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2450 int *uri_count, char ***uri);
2453 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2454 int *mime_count, char ***mime)
2455 * @brief This API gets the list of mime of the application
2457 * @par This API is for package-manager client application
2458 * @par Sync (or) Async : Synchronous API
2460 * @param[in] handle pointer to the appcontrol handle.
2461 * @param[out] mime_count pointer to hold number of mimes
2462 * @param[out] mime pointer to hold list of mimes
2463 * @return 0 if success, error code(<0) if fail
2464 * @retval PMINFO_R_OK success
2465 * @retval PMINFO_R_EINVAL invalid argument
2466 * @retval PMINFO_R_ERROR internal error
2467 * @pre pkgmgrinfo_appinfo_get_appinfo()
2468 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2469 * @see pkgmgrinfo_appinfo_get_uri()
2470 * @see pkgmgrinfo_appinfo_get_operation()
2472 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2477 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2478 for (i = 0; i < mc; i++) {
2479 if (strcmp(mime[i], (char *)user_data) == 0)
2486 static int check_mime(const char *appid, char *mime)
2489 pkgmgrinfo_appinfo_h handle;
2490 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2491 if (ret != PMINFO_R_OK)
2493 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2494 if (ret != PMINFO_R_OK) {
2495 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2498 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2503 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2504 int *mime_count, char ***mime);
2507 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2508 * @brief This API gets the notification icon 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 application info handle.
2514 * @param[out] path pointer to hold notification icon
2515 * @return 0 if success, error code(<0) if fail
2516 * @retval PMINFO_R_OK success
2517 * @retval PMINFO_R_EINVAL invalid argument
2518 * @retval PMINFO_R_ERROR internal error
2519 * @pre pkgmgrinfo_appinfo_get_appinfo()
2520 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2521 * @see pkgmgrinfo_appinfo_get_appid()
2522 * @see pkgmgrinfo_appinfo_is_multiple()
2524 static int get_app_notification_icon(const char *appid)
2527 char *notification_icon = NULL;
2528 pkgmgrinfo_appinfo_h handle;
2529 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2530 if (ret != PMINFO_R_OK)
2532 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2533 if (ret != PMINFO_R_OK) {
2534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2537 printf("notification icon : %s\n", notification_icon);
2538 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2543 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2546 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2547 * @brief This API gets the setting icon of the application
2549 * @par This API is for package-manager client application
2550 * @par Sync (or) Async : Synchronous API
2552 * @param[in] handle pointer to the application info handle.
2553 * @param[out] path pointer to hold setting icon
2554 * @return 0 if success, error code(<0) if fail
2555 * @retval PMINFO_R_OK success
2556 * @retval PMINFO_R_EINVAL invalid argument
2557 * @retval PMINFO_R_ERROR internal error
2558 * @pre pkgmgrinfo_appinfo_get_appinfo()
2559 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2560 * @see pkgmgrinfo_appinfo_get_appid()
2561 * @see pkgmgrinfo_appinfo_is_multiple()
2563 static int get_app_setting_icon(const char *appid)
2566 char *setting_icon = NULL;
2567 pkgmgrinfo_appinfo_h handle;
2568 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2569 if (ret != PMINFO_R_OK)
2571 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2572 if (ret != PMINFO_R_OK) {
2573 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2576 printf("setting icon : %s\n", setting_icon);
2577 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2582 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2585 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2586 * @brief This API gets the type of recent image on app-tray
2588 * @par This API is for package-manager client application
2589 * @par Sync (or) Async : Synchronous API
2591 * @param[in] handle pointer to the application info handle.
2592 * @param[out] type pointer to hold image type
2593 * @return 0 if success, error code(<0) if fail
2594 * @retval PMINFO_R_OK success
2595 * @retval PMINFO_R_EINVAL invalid argument
2596 * @retval PMINFO_R_ERROR internal error
2597 * @pre pkgmgrinfo_appinfo_get_appinfo()
2598 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2599 * @see pkgmgrinfo_appinfo_get_appid()
2600 * @see pkgmgrinfo_appinfo_is_multiple()
2602 static int get_app_recent_image_type(const char *appid)
2605 pkgmgrinfo_app_recentimage type;
2606 pkgmgrinfo_appinfo_h handle;
2607 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2608 if (ret != PMINFO_R_OK)
2610 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2611 if (ret != PMINFO_R_OK) {
2612 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2615 printf("recent image type: %d\n", type);
2616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2621 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2625 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2626 * @brief This API gets the preview image of application
2628 * @par Sync (or) Async : Synchronous API
2630 * @param[in] handle pointer to the application info handle.
2631 * @param[out] preview_img pointer to hold preview image path
2632 * @return 0 if success, error code(<0) if fail
2633 * @retval PMINFO_R_OK success
2634 * @retval PMINFO_R_EINVAL invalid argument
2635 * @retval PMINFO_R_ERROR internal error
2636 * @pre pkgmgrinfo_appinfo_get_appinfo()
2637 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2638 * @see pkgmgrinfo_appinfo_get_appid()
2640 static int get_app_previewimage(const char *appid)
2643 char *preview = NULL;
2644 pkgmgrinfo_appinfo_h handle = NULL;
2645 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2646 if (ret != PMINFO_R_OK)
2648 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2649 if (ret != PMINFO_R_OK) {
2650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2653 printf("preview image path : %s\n", preview);
2654 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2659 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2663 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2664 * @brief This API gets the package permission type of the application
2666 * @par This API is for package-manager client application
2667 * @par Sync (or) Async : Synchronous API
2669 * @param[in] handle pointer to the application info handle.
2670 * @param[out] permission pointer to hold package permission
2671 * @return 0 if success, error code(<0) if fail
2672 * @retval PMINFO_R_OK success
2673 * @retval PMINFO_R_EINVAL invalid argument
2674 * @retval PMINFO_R_ERROR internal error
2675 * @pre pkgmgrinfo_appinfo_get_appinfo()
2676 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2677 * @see pkgmgrinfo_appinfo_get_appid()
2679 static int get_app_permission(const char *appid)
2682 pkgmgrinfo_permission_type permission = 0;
2683 pkgmgrinfo_appinfo_h handle;
2685 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2686 if (ret != PMINFO_R_OK)
2688 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2689 if (ret != PMINFO_R_OK) {
2690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2693 printf("permission type: %d\n", permission);
2694 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2699 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2702 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2703 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2704 * @brief This API gets the list of category for a particular application
2706 * @par This API is for package-manager client application
2707 * @par Sync (or) Async : Synchronous API
2708 * @param[in] handle pointer to the application info handle.
2709 * @param[in] category_func callback function for list
2710 * @param[in] user_data user data to be passed to callback function
2711 * @return 0 if success, error code(<0) if fail
2712 * @retval PMINFO_R_OK success
2713 * @retval PMINFO_R_EINVAL invalid argument
2714 * @retval PMINFO_R_ERROR internal error
2715 * @pre pkgmgrinfo_appinfo_get_appinfo()
2716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2718 int category_func(const char *name, void *user_data)
2720 if (strcmp(name, (char *)user_data) == 0)
2726 static int list_category(const char *appid, char *category)
2729 pkgmgrinfo_appinfo_h handle;
2730 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2731 if (ret != PMINFO_R_OK)
2733 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2734 if (ret != PMINFO_R_OK) {
2735 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2738 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2743 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2744 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2747 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2748 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2749 * @brief This API gets the list of metadata for a particular application
2751 * @par This API is for package-manager client application
2752 * @par Sync (or) Async : Synchronous API
2753 * @param[in] handle pointer to the application info handle.
2754 * @param[in] metadata_func callback function for list
2755 * @param[in] user_data user data to be passed to callback function
2756 * @return 0 if success, error code(<0) if fail
2757 * @retval PMINFO_R_OK success
2758 * @retval PMINFO_R_EINVAL invalid argument
2759 * @retval PMINFO_R_ERROR internal error
2760 * @pre pkgmgrinfo_appinfo_get_appinfo()
2761 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2763 int metadata_func(const char *key, const char *value, void *user_data)
2765 if (strcmp(key, (char *)user_data) == 0) {
2766 printf("Value is %s\n", value);
2773 static int list_metadata(const char *appid, char *key)
2776 pkgmgrinfo_appinfo_h handle;
2777 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2778 if (ret != PMINFO_R_OK)
2780 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
2781 if (ret != PMINFO_R_OK) {
2782 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2790 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2791 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2795 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2796 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2797 * @brief This API gets the list of app-control for a particular application
2799 * @par This API is for package-manager client application
2800 * @par Sync (or) Async : Synchronous API
2801 * @param[in] handle pointer to the application info handle.
2802 * @param[in] appcontrol_func callback function for list
2803 * @param[in] user_data user data to be passed to callback function
2804 * @return 0 if success, error code(<0) if fail
2805 * @retval PMINFO_R_OK success
2806 * @retval PMINFO_R_EINVAL invalid argument
2807 * @retval PMINFO_R_ERROR internal error
2808 * @pre pkgmgrinfo_appinfo_get_appinfo()
2809 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2811 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2816 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2817 for (i = 0; i < oc; i++) {
2818 if (strcmp(operation[i], (char *)user_data) == 0)
2825 static int check_operation(const char *appid, char *operation)
2828 pkgmgrinfo_appinfo_h handle;
2829 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2830 if (ret != PMINFO_R_OK)
2832 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2833 if (ret != PMINFO_R_OK) {
2834 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2843 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2846 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2847 * @brief This API gets the application 'nodisplay' value from the app ID
2849 * @par This API is for package-manager client application
2850 * @par Sync (or) Async : Synchronous API
2852 * @param[in] handle pointer to application info handle
2853 * @param[out] nodisplay pointer to hold package nodisplay value
2854 * @return 0 if success, error code(<0) if fail
2855 * @retval PMINFO_R_OK success
2856 * @retval PMINFO_R_EINVAL invalid argument
2857 * @retval PMINFO_R_ERROR internal error
2858 * @pre pkgmgrinfo_appinfo_get_appinfo()
2859 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2860 * @see pkgmgrinfo_appinfo_get_appid()
2861 * @see pkgmgrinfo_appinfo_is_multiple()
2863 static int get_app_nodisplay(const char *appid)
2867 pkgmgrinfo_appinfo_h handle;
2868 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2869 if (ret != PMINFO_R_OK)
2871 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2872 if (ret != PMINFO_R_OK) {
2873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 printf("app nodisplay: %d\n", nodisplay);
2877 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2882 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2885 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2886 * @brief This API gets the application 'multiple' value from the app ID
2888 * @par This API is for package-manager client application
2889 * @par Sync (or) Async : Synchronous API
2891 * @param[in] handle pointer to application info handle
2892 * @param[out] multiple pointer to hold package multiple value
2893 * @return 0 if success, error code(<0) if fail
2894 * @retval PMINFO_R_OK success
2895 * @retval PMINFO_R_EINVAL invalid argument
2896 * @retval PMINFO_R_ERROR internal error
2897 * @pre pkgmgrinfo_appinfo_get_appinfo()
2898 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2899 * @see pkgmgrinfo_appinfo_get_appid()
2900 * @see pkgmgrinfo_appinfo_is_nodisplay()
2902 static int get_app_multiple(const char *appid)
2906 pkgmgrinfo_appinfo_h handle;
2907 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2908 if (ret != PMINFO_R_OK)
2910 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2911 if (ret != PMINFO_R_OK) {
2912 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2915 printf("app multiple: %d\n", multiple);
2916 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2921 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2924 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
2925 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
2926 * application launching effect. If fales, indicator will be hidden during application launching effect
2928 * @par This API is for package-manager client application
2929 * @par Sync (or) Async : Synchronous API
2931 * @param[in] handle pointer to application info handle
2932 * @param[out] indicator_disp contains indicator display status for application launching effect
2933 * @return 0 if success, error code(<0) if fail
2934 * @retval PMINFO_R_OK success
2935 * @retval PMINFO_R_EINVAL invalid argument
2936 * @retval PMINFO_R_ERROR internal error
2937 * @pre pkgmgrinfo_appinfo_get_appinfo()
2938 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2939 * @see pkgmgrinfo_appinfo_get_appid()
2940 * @see pkgmgrinfo_appinfo_is_nodisplay()
2942 static int get_app_indicator_display(const char *appid)
2945 bool indicator_disp;
2946 pkgmgrinfo_appinfo_h handle;
2947 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2948 if (ret != PMINFO_R_OK)
2950 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
2951 if (ret != PMINFO_R_OK){
2952 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2955 printf("app indicator disp : %d\n", indicator_disp);
2956 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2961 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
2964 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2965 * @brief This API gets the application's landscape & portrait effect images
2967 * @par This API is for package-manager client application
2968 * @par Sync (or) Async : Synchronous API
2970 * @param[in] handle pointer to application info handle
2971 * @param[out] portrait_img contains portrait mode effect image
2972 * @param[out] landscape_img contains landscape mode effect image
2973 * @return 0 if success, error code(<0) if fail
2974 * @retval PMINFO_R_OK success
2975 * @retval PMINFO_R_EINVAL invalid argument
2976 * @retval PMINFO_R_ERROR internal error
2977 * @pre pkgmgrinfo_appinfo_get_appinfo()
2978 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2979 * @see pkgmgrinfo_appinfo_get_appid()
2980 * @see pkgmgrinfo_appinfo_is_nodisplay()
2982 static int get_app_effectimages(const char *appid)
2985 char *portraitimg = NULL;
2986 char *landscapeimg = NULL;
2987 pkgmgrinfo_appinfo_h handle;
2988 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2989 if (ret != PMINFO_R_OK)
2991 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2992 if (ret != PMINFO_R_OK) {
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2996 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2997 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3002 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3005 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3006 * @brief This API gets the application 'taskmanage' value from the app ID
3008 * @par This API is for package-manager client application
3009 * @par Sync (or) Async : Synchronous API
3011 * @param[in] handle pointer to application info handle
3012 * @param[out] taskmanage pointer to hold package taskmanage value
3013 * @return 0 if success, error code(<0) if fail
3014 * @retval PMINFO_R_OK success
3015 * @retval PMINFO_R_EINVAL invalid argument
3016 * @retval PMINFO_R_ERROR internal error
3017 * @pre pkgmgrinfo_appinfo_get_appinfo()
3018 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3019 * @see pkgmgrinfo_appinfo_get_appid()
3020 * @see pkgmgrinfo_appinfo_is_multiple()
3022 static int get_app_taskmanage(const char *appid)
3026 pkgmgrinfo_appinfo_h handle;
3027 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3028 if (ret != PMINFO_R_OK)
3030 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3031 if (ret != PMINFO_R_OK) {
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3035 printf("app taskmanage: %d\n", taskmanage);
3036 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3041 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3044 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3045 * @brief This API gets the application 'taskmanage' value from the app ID
3047 * @par This API is for package-manager client application
3048 * @par Sync (or) Async : Synchronous API
3050 * @param[in] handle pointer to application info handle
3051 * @param[out] enabled pointer to hold package enabled value
3052 * @return 0 if success, error code(<0) if fail
3053 * @retval PMINFO_R_OK success
3054 * @retval PMINFO_R_EINVAL invalid argument
3055 * @retval PMINFO_R_ERROR internal error
3056 * @pre pkgmgrinfo_appinfo_get_appinfo()
3057 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3058 * @see pkgmgrinfo_appinfo_get_appid()
3059 * @see pkgmgrinfo_appinfo_is_multiple()
3061 static int get_app_enabled(const char *appid)
3065 pkgmgrinfo_appinfo_h handle;
3066 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3067 if (ret != PMINFO_R_OK)
3069 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3070 if (ret != PMINFO_R_OK) {
3071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3074 printf("app enabled: %d\n", enabled);
3075 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3080 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3083 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3084 * @brief This API gets the application 'hwacceleration' value from the app ID
3086 * @par This API is for package-manager client application
3087 * @par Sync (or) Async : Synchronous API
3089 * @param[in] handle pointer to application info handle
3090 * @param[out] hwacceleration pointer to hold package hwacceleration value
3091 * @return 0 if success, error code(<0) if fail
3092 * @retval PMINFO_R_OK success
3093 * @retval PMINFO_R_EINVAL invalid argument
3094 * @retval PMINFO_R_ERROR internal error
3095 * @pre pkgmgrinfo_appinfo_get_appinfo()
3096 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3097 * @see pkgmgrinfo_appinfo_get_appid()
3098 * @see pkgmgrinfo_appinfo_is_multiple()
3100 static int get_app_hwacceleration(const char *appid)
3103 pkgmgrinfo_app_hwacceleration hwacceleration;
3104 pkgmgrinfo_appinfo_h handle;
3105 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3106 if (ret != PMINFO_R_OK)
3108 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3109 if (ret != PMINFO_R_OK) {
3110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3113 printf("app hwacceleration: %d\n", hwacceleration);
3114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3119 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3122 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3123 * @brief This API gets the application 'onboot' value from the app ID
3125 * @par This API is for package-manager client application
3126 * @par Sync (or) Async : Synchronous API
3128 * @param[in] handle pointer to application info handle
3129 * @param[out] onboot pointer to hold package onboot value
3130 * @return 0 if success, error code(<0) if fail
3131 * @retval PMINFO_R_OK success
3132 * @retval PMINFO_R_EINVAL invalid argument
3133 * @retval PMINFO_R_ERROR internal error
3134 * @pre pkgmgrinfo_appinfo_get_appinfo()
3135 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3136 * @see pkgmgrinfo_appinfo_get_appid()
3137 * @see pkgmgrinfo_appinfo_is_multiple()
3139 static int get_app_onboot(const char *appid)
3143 pkgmgrinfo_appinfo_h handle;
3144 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3145 if (ret != PMINFO_R_OK)
3147 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3148 if (ret != PMINFO_R_OK) {
3149 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3152 printf("app onboot: %d\n", onboot);
3153 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3158 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3161 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3162 * @brief This API gets the application 'autorestart' value from the app ID
3164 * @par This API is for package-manager client application
3165 * @par Sync (or) Async : Synchronous API
3167 * @param[in] handle pointer to application info handle
3168 * @param[out] autorestart pointer to hold package autorestart value
3169 * @return 0 if success, error code(<0) if fail
3170 * @retval PMINFO_R_OK success
3171 * @retval PMINFO_R_EINVAL invalid argument
3172 * @retval PMINFO_R_ERROR internal error
3173 * @pre pkgmgrinfo_appinfo_get_appinfo()
3174 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3175 * @see pkgmgrinfo_appinfo_get_appid()
3176 * @see pkgmgrinfo_appinfo_is_multiple()
3178 static int get_app_autorestart(const char *appid)
3182 pkgmgrinfo_appinfo_h handle;
3183 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3184 if (ret != PMINFO_R_OK)
3186 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3187 if (ret != PMINFO_R_OK) {
3188 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3191 printf("app autorestart: %d\n", autorestart);
3192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3197 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3200 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3201 * @brief This API gets the value for given application is main app or not from handle
3203 * @par This API is for package-manager client application
3204 * @par Sync (or) Async : Synchronous API
3206 * @param[in] handle pointer to application info handle
3207 * @param[out] mainapp pointer to hold package mainapp is or not
3208 * @return 0 if success, error code(<0) if fail
3209 * @retval PMINFO_R_OK success
3210 * @retval PMINFO_R_EINVAL invalid argument
3211 * @retval PMINFO_R_ERROR internal error
3212 * @pre pkgmgrinfo_appinfo_get_appinfo()
3213 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3214 * @see pkgmgrinfo_appinfo_get_appid()
3215 * @see pkgmgrinfo_appinfo_is_multiple()
3217 static int get_app_mainapp(const char *appid)
3221 pkgmgrinfo_appinfo_h handle;
3222 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3223 if (ret != PMINFO_R_OK)
3225 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3226 if (ret != PMINFO_R_OK) {
3227 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3230 printf("mainapp: %d\n", mainapp);
3231 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3236 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3239 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3240 * @brief This API destroys the application information handle freeing up all the resources
3242 * @par This API is for package-manager client application
3243 * @par Sync (or) Async : Synchronous API
3245 * @param[in] handle pointer to the application info handle.
3246 * @return 0 if success, error code(<0) if fail
3247 * @retval PMINFO_R_OK success
3248 * @retval PMINFO_R_EINVAL invalid argument
3249 * @retval PMINFO_R_ERROR internal error
3250 * @pre pkgmgrinfo_appinfo_get_appinfo()
3252 * @see pkgmgrinfo_appinfo_get_pkgid()
3253 * @see pkgmgrinfo_appinfo_is_multiple()
3255 static int get_app_type(const char *appid)
3259 pkgmgrinfo_appinfo_h handle;
3260 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3261 if (ret != PMINFO_R_OK)
3263 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3264 if (ret != PMINFO_R_OK) {
3265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268 printf("apptype: %s\n", type);
3269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3274 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3277 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3278 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3279 The query will search the entire application information collected from the manifest file of all the installed packages
3281 * @par This API is for package-manager client application
3282 * @par Sync (or) Async : Synchronous API
3284 * @param[out] handle pointer to the application info filter handle.
3285 * @return 0 if success, error code(<0) if fail
3286 * @retval PMINFO_R_OK success
3287 * @retval PMINFO_R_EINVAL invalid argument
3288 * @retval PMINFO_R_ERROR internal error
3290 * @post pkgmgrinfo_appinfo_filter_destroy()
3291 * @see pkgmgrinfo_appinfo_filter_count()
3292 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3294 static int get_capp_count()
3298 pkgmgrinfo_appinfo_filter_h handle;
3299 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3300 if (ret != PMINFO_R_OK)
3302 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3303 if (ret != PMINFO_R_OK) {
3304 pkgmgrinfo_appinfo_filter_destroy(handle);
3307 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3308 if (ret != PMINFO_R_OK) {
3309 pkgmgrinfo_appinfo_filter_destroy(handle);
3312 printf("No of capp: %d\n", count);
3313 pkgmgrinfo_appinfo_filter_destroy(handle);
3318 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3321 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3322 * @brief This API destroys the application information filter handle freeing up all the resources
3324 * @par This API is for package-manager client application
3325 * @par Sync (or) Async : Synchronous API
3327 * @param[in] handle pointer to the application info filter handle.
3328 * @return 0 if success, error code(<0) if fail
3329 * @retval PMINFO_R_OK success
3330 * @retval PMINFO_R_EINVAL invalid argument
3331 * @retval PMINFO_R_ERROR internal error
3332 * @pre pkgmgrinfo_appinfo_filter_create()
3334 * @see pkgmgrinfo_appinfo_filter_count()
3335 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3337 static int get_capp_count()
3341 pkgmgrinfo_appinfo_filter_h handle;
3342 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3343 if (ret != PMINFO_R_OK)
3345 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3346 if (ret != PMINFO_R_OK) {
3347 pkgmgrinfo_appinfo_filter_destroy(handle);
3350 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3351 if (ret != PMINFO_R_OK) {
3352 pkgmgrinfo_appinfo_filter_destroy(handle);
3355 printf("No of capp: %d\n", count);
3356 pkgmgrinfo_appinfo_filter_destroy(handle);
3361 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3364 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3365 * @brief This API adds a boolean filter property to the filter handle
3367 * @par This API is for package-manager client application
3368 * @par Sync (or) Async : Synchronous API
3370 * @param[in] handle pointer to the application info filter handle.
3371 * @param[in] property boolean property name.
3372 * @param[in] value value corresponding to the property.
3373 * @return 0 if success, error code(<0) if fail
3374 * @retval PMINFO_R_OK success
3375 * @retval PMINFO_R_EINVAL invalid argument
3376 * @retval PMINFO_R_ERROR internal error
3377 * @pre pkgmgrinfo_appinfo_filter_create()
3378 * @post pkgmgrinfo_appinfo_filter_destroy()
3379 * @see pkgmgrinfo_appinfo_filter_count()
3380 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3382 static int get_taskmanageable_app_count()
3386 pkgmgrinfo_appinfo_filter_h handle;
3387 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3388 if (ret != PMINFO_R_OK)
3390 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3391 if (ret != PMINFO_R_OK) {
3392 pkgmgrinfo_appinfo_filter_destroy(handle);
3395 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3396 if (ret != PMINFO_R_OK) {
3397 pkgmgrinfo_appinfo_filter_destroy(handle);
3400 printf("No of taskmanageable apps: %d\n", count);
3401 pkgmgrinfo_appinfo_filter_destroy(handle);
3406 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3407 const char *property, const bool value);
3410 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3411 * @brief This API adds an integer filter property to the filter handle
3413 * @par This API is for package-manager client application
3414 * @par Sync (or) Async : Synchronous API
3416 * @param[in] handle pointer to the application info filter handle.
3417 * @param[in] property integer property name.
3418 * @param[in] value value corresponding to the property.
3419 * @return 0 if success, error code(<0) if fail
3420 * @retval PMINFO_R_OK success
3421 * @retval PMINFO_R_EINVAL invalid argument
3422 * @retval PMINFO_R_ERROR internal error
3423 * @pre pkgmgrinfo_appinfo_filter_create()
3424 * @post pkgmgrinfo_appinfo_filter_destroy()
3425 * @see pkgmgrinfo_appinfo_filter_count()
3426 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3428 static int get_taskmanageable_app_count()
3432 pkgmgrinfo_appinfo_filter_h handle;
3433 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3434 if (ret != PMINFO_R_OK)
3436 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3437 if (ret != PMINFO_R_OK) {
3438 pkgmgrinfo_appinfo_filter_destroy(handle);
3441 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3442 if (ret != PMINFO_R_OK) {
3443 pkgmgrinfo_appinfo_filter_destroy(handle);
3446 printf("No of apps: %d\n", count);
3447 pkgmgrinfo_appinfo_filter_destroy(handle);
3452 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3453 const char *property, const int value);
3456 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3457 * @brief This API adds a string filter property to the filter handle
3459 * @par This API is for package-manager client application
3460 * @par Sync (or) Async : Synchronous API
3462 * @param[in] handle pointer to the application info filter handle.
3463 * @param[in] property string property name.
3464 * @param[in] value value corresponding to the property.
3465 * @return 0 if success, error code(<0) if fail
3466 * @retval PMINFO_R_OK success
3467 * @retval PMINFO_R_EINVAL invalid argument
3468 * @retval PMINFO_R_ERROR internal error
3469 * @pre pkgmgrinfo_appinfo_filter_create()
3470 * @post pkgmgrinfo_appinfo_filter_destroy()
3471 * @see pkgmgrinfo_appinfo_filter_count()
3472 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3474 static int get_capp_count()
3478 pkgmgrinfo_appinfo_filter_h handle;
3479 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3480 if (ret != PMINFO_R_OK)
3482 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3483 if (ret != PMINFO_R_OK) {
3484 pkgmgrinfo_appinfo_filter_destroy(handle);
3487 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3488 if (ret != PMINFO_R_OK) {
3489 pkgmgrinfo_appinfo_filter_destroy(handle);
3492 printf("No of capp: %d\n", count);
3493 pkgmgrinfo_appinfo_filter_destroy(handle);
3498 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3499 const char *property, const char *value);
3502 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3503 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3505 * @par This API is for package-manager client application
3506 * @par Sync (or) Async : Synchronous API
3508 * @param[in] handle pointer to the application info filter handle.
3509 * @param[in] app_cb callback function.
3510 * @param[in] user_data user data to be passed to the callback function
3511 * @return 0 if success, error code(<0) if fail
3512 * @retval PMINFO_R_OK success
3513 * @retval PMINFO_R_EINVAL invalid argument
3514 * @retval PMINFO_R_ERROR internal error
3515 * @pre pkgmgrinfo_appinfo_filter_create()
3516 * @post pkgmgrinfo_appinfo_filter_destroy()
3517 * @see pkgmgrinfo_appinfo_filter_count()
3519 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3522 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3523 printf("appid : %s\n", appid);
3527 static int get_capp_list()
3530 pkgmgrinfo_appinfo_filter_h handle;
3531 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3532 if (ret != PMINFO_R_OK)
3534 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3535 if (ret != PMINFO_R_OK) {
3536 pkgmgrinfo_appinfo_filter_destroy(handle);
3539 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3540 if (ret != PMINFO_R_OK) {
3541 pkgmgrinfo_appinfo_filter_destroy(handle);
3544 pkgmgrinfo_appinfo_filter_destroy(handle);
3549 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3550 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3553 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3554 * @brief This API counts the application that satisfy the filter conditions
3556 * @par This API is for package-manager client application
3557 * @par Sync (or) Async : Synchronous API
3559 * @param[in] handle pointer to the application info filter handle.
3560 * @param[in] count pointer to store count value
3561 * @return 0 if success, error code(<0) if fail
3562 * @retval PMINFO_R_OK success
3563 * @retval PMINFO_R_EINVAL invalid argument
3564 * @retval PMINFO_R_ERROR internal error
3565 * @pre pkgmgrinfo_appinfo_filter_create()
3566 * @post pkgmgrinfo_appinfo_filter_destroy()
3567 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3569 static int get_capp_count()
3573 pkgmgrinfo_appinfo_filter_h handle;
3574 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3575 if (ret != PMINFO_R_OK)
3577 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3578 if (ret != PMINFO_R_OK) {
3579 pkgmgrinfo_appinfo_filter_destroy(handle);
3582 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3583 if (ret != PMINFO_R_OK) {
3584 pkgmgrinfo_appinfo_filter_destroy(handle);
3587 printf("No of capp: %d\n", count);
3588 pkgmgrinfo_appinfo_filter_destroy(handle);
3593 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3596 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
3597 * @brief This API creates the application's metadata information filter handle from db.
3599 * @par This API is for package-manager client application
3600 * @par Sync (or) Async : Synchronous API
3602 * @param[out] handle pointer to the application metadata info filter handle.
3603 * @return 0 if success, error code(<0) if fail
3604 * @retval PMINFO_R_OK success
3605 * @retval PMINFO_R_EINVAL invalid argument
3606 * @retval PMINFO_R_ERROR internal error
3608 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3609 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3611 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3614 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3615 printf("appid : %s\n", appid);
3619 static int get_app_list(const char *mkey, const char *mvalue)
3622 pkgmgrinfo_appinfo_metadata_filter_h handle;
3623 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3624 if (ret != PMINFO_R_OK)
3626 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3627 if (ret != PMINFO_R_OK) {
3628 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3631 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3632 if (ret != PMINFO_R_OK) {
3633 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3636 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3641 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
3644 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
3645 * @brief This API destroys the application's metadata information filter handle.
3647 * @par This API is for package-manager client application
3648 * @par Sync (or) Async : Synchronous API
3650 * @param[in] handle pointer to the application metadata info filter handle.
3651 * @return 0 if success, error code(<0) if fail
3652 * @retval PMINFO_R_OK success
3653 * @retval PMINFO_R_EINVAL invalid argument
3654 * @retval PMINFO_R_ERROR internal error
3655 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3657 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3659 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3662 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3663 printf("appid : %s\n", appid);
3667 static int get_app_list(const char *mkey, const char *mvalue)
3670 pkgmgrinfo_appinfo_metadata_filter_h handle;
3671 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3672 if (ret != PMINFO_R_OK)
3674 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3675 if (ret != PMINFO_R_OK) {
3676 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3679 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3680 if (ret != PMINFO_R_OK) {
3681 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3684 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3689 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
3692 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
3693 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
3694 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
3696 * @par This API is for package-manager client application
3697 * @par Sync (or) Async : Synchronous API
3699 * @param[in] handle pointer to the application metadata info filter handle.
3700 * @param[in] key pointer to metadata key
3701 * @param[in] value pointer to metadata value
3702 * @return 0 if success, error code(<0) if fail
3703 * @retval PMINFO_R_OK success
3704 * @retval PMINFO_R_EINVAL invalid argument
3705 * @retval PMINFO_R_ERROR internal error
3706 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3707 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
3708 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
3710 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3713 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3714 printf("appid : %s\n", appid);
3718 static int get_app_list(const char *mkey, const char *mvalue)
3721 pkgmgrinfo_appinfo_metadata_filter_h handle;
3722 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3723 if (ret != PMINFO_R_OK)
3725 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3726 if (ret != PMINFO_R_OK) {
3727 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3730 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3731 if (ret != PMINFO_R_OK) {
3732 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3735 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3740 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
3741 const char *key, const char *value);
3744 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3745 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
3746 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
3747 * negative value, no more callbacks will be called and API will return.
3749 * @par This API is for package-manager client application
3750 * @par Sync (or) Async : Synchronous API
3752 * @param[in] handle pointer to the application metadata info filter handle.
3753 * @param[in] app_cb function pointer to callback
3754 * @param[in] user_data pointer to user data
3755 * @return 0 if success, error code(<0) if fail
3756 * @retval PMINFO_R_OK success
3757 * @retval PMINFO_R_EINVAL invalid argument
3758 * @retval PMINFO_R_ERROR internal error
3759 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
3760 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
3762 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3765 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3766 printf("appid : %s\n", appid);
3770 static int get_app_list(const char *mkey, const char *mvalue)
3773 pkgmgrinfo_appinfo_metadata_filter_h handle;
3774 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
3775 if (ret != PMINFO_R_OK)
3777 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
3778 if (ret != PMINFO_R_OK) {
3779 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3782 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
3783 if (ret != PMINFO_R_OK) {
3784 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3787 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
3792 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
3793 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3796 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3797 * @brief This API creates the package cert information handle to get data from db.
3799 * @par This API is for package-manager client application
3800 * @par Sync (or) Async : Synchronous API
3802 * @param[out] handle pointer to the package cert handle.
3803 * @return 0 if success, error code(<0) if fail
3804 * @retval PMINFO_R_OK success
3805 * @retval PMINFO_R_EINVAL invalid argument
3806 * @retval PMINFO_R_ERROR internal error
3808 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3809 * @see pkgmgrinfo_pkginfo_get_cert_value()
3810 * @see pkgmgrinfo_pkginfo_load_certinfo()
3812 static int get_cert_info(const char *pkgid)
3815 pkgmgrinfo_certinfo_h handle;
3816 char *auth_cert = NULL;
3817 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3818 if (ret != PMINFO_R_OK)
3820 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3821 if (ret != PMINFO_R_OK) {
3822 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3825 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3826 if (ret != PMINFO_R_OK) {
3827 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3830 printf("Author root certificate: %s\n", auth_root);
3831 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3836 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3839 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3840 * @brief This API loads the package cert information handle with data from db.
3842 * @par This API is for package-manager client application
3843 * @par Sync (or) Async : Synchronous API
3845 * @param[in] pkgid pointer to the package ID.
3846 * @param[in] handle pointer to the package cert handle.
3847 * @return 0 if success, error code(<0) if fail
3848 * @retval PMINFO_R_OK success
3849 * @retval PMINFO_R_EINVAL invalid argument
3850 * @retval PMINFO_R_ERROR internal error
3851 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3852 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3853 * @see pkgmgrinfo_pkginfo_get_cert_value()
3855 static int get_cert_info(const char *pkgid)
3858 pkgmgrinfo_certinfo_h handle;
3859 char *auth_cert = NULL;
3860 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3861 if (ret != PMINFO_R_OK)
3863 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3864 if (ret != PMINFO_R_OK) {
3865 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3868 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3869 if (ret != PMINFO_R_OK) {
3870 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3873 printf("Author root certificate: %s\n", auth_root);
3874 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3879 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3882 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3883 * @brief This API gets the package cert information from the handle
3885 * @par This API is for package-manager client application
3886 * @par Sync (or) Async : Synchronous API
3888 * @param[in] handle pointer to the package cert handle.
3889 * @param[in] cert_type certificate type
3890 * @param[out] cert_value pointer to hold certificate value
3891 * @return 0 if success, error code(<0) if fail
3892 * @retval PMINFO_R_OK success
3893 * @retval PMINFO_R_EINVAL invalid argument
3894 * @retval PMINFO_R_ERROR internal error
3895 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3896 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3897 * @see pkgmgrinfo_pkginfo_load_certinfo()
3899 static int get_cert_info(const char *pkgid)
3902 pkgmgrinfo_certinfo_h handle;
3903 char *auth_cert = NULL;
3904 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3905 if (ret != PMINFO_R_OK)
3907 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3908 if (ret != PMINFO_R_OK) {
3909 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3912 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3913 if (ret != PMINFO_R_OK) {
3914 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3917 printf("Author root certificate: %s\n", auth_root);
3918 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3923 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3926 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3927 * @brief This API destroys the package cert information handle freeing up all the resources
3929 * @par This API is for package-manager client application
3930 * @par Sync (or) Async : Synchronous API
3932 * @param[in] handle pointer to the package cert handle.
3933 * @return 0 if success, error code(<0) if fail
3934 * @retval PMINFO_R_OK success
3935 * @retval PMINFO_R_EINVAL invalid argument
3936 * @retval PMINFO_R_ERROR internal error
3937 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3939 * @see pkgmgrinfo_pkginfo_load_certinfo()
3941 static int get_cert_info(const char *pkgid)
3944 pkgmgrinfo_certinfo_h handle;
3945 char *auth_cert = NULL;
3946 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3947 if (ret != PMINFO_R_OK)
3949 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3950 if (ret != PMINFO_R_OK) {
3951 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3954 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3955 if (ret != PMINFO_R_OK) {
3956 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3959 printf("Author root certificate: %s\n", auth_root);
3960 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3965 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
3968 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
3969 * @brief This API deletes the package cert information from DB
3971 * @par This API is for package-manager client application
3972 * @par Sync (or) Async : Synchronous API
3974 * @param[in] pkgid pointer to the package ID.
3975 * @return 0 if success, error code(<0) if fail
3976 * @retval PMINFO_R_OK success
3977 * @retval PMINFO_R_EINVAL invalid argument
3978 * @retval PMINFO_R_ERROR internal error
3982 static int delete_cert_info(const char *pkgid)
3985 ret = pkgmgrinfo_delete_certinfo(pkgid);
3986 if (ret != PMINFO_R_OK)
3992 int pkgmgrinfo_delete_certinfo(const char *pkgid);
3995 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
3996 * @brief This API creates the package cert information handle to set data in db.
3998 * @par This API is for package-manager client application
3999 * @par Sync (or) Async : Synchronous API
4001 * @param[out] handle pointer to the package cert handle.
4002 * @return 0 if success, error code(<0) if fail
4003 * @retval PMINFO_R_OK success
4004 * @retval PMINFO_R_EINVAL invalid argument
4005 * @retval PMINFO_R_ERROR internal error
4007 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4008 * @see pkgmgrinfo_set_cert_value()
4009 * @see pkgmgrinfo_save_certinfo()
4011 static int set_cert_in_db(const char *pkgid)
4014 pkgmgrinfo_instcertinfo_h handle;
4015 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4016 if (ret != PMINFO_R_OK)
4018 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4019 if (ret != PMINFO_R_OK) {
4020 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4023 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4024 if (ret != PMINFO_R_OK) {
4025 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4028 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4033 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4036 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4037 * @brief This API sets the package cert information in the handle.
4039 * @par This API is for package-manager client application
4040 * @par Sync (or) Async : Synchronous API
4042 * @param[in] handle pointer to the package cert handle.
4043 * @param[in] cert_type certificate type.
4044 * @param[in] cert_value certificate value.
4045 * @return 0 if success, error code(<0) if fail
4046 * @retval PMINFO_R_OK success
4047 * @retval PMINFO_R_EINVAL invalid argument
4048 * @retval PMINFO_R_ERROR internal error
4049 * @pre pkgmgrinfo_create_certinfo_set_handle()
4050 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4051 * @see pkgmgrinfo_save_certinfo()
4053 static int set_cert_in_db(const char *pkgid)
4056 pkgmgrinfo_instcertinfo_h handle;
4057 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4058 if (ret != PMINFO_R_OK)
4060 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4061 if (ret != PMINFO_R_OK) {
4062 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4065 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4066 if (ret != PMINFO_R_OK) {
4067 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4070 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4075 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4078 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4079 * @brief This API saves the package cert information in the DB.
4081 * @par This API is for package-manager client application
4082 * @par Sync (or) Async : Synchronous API
4084 * @param[in] pkgid pointer to the package ID.
4085 * @param[in] handle pointer to the package cert handle.
4086 * @return 0 if success, error code(<0) if fail
4087 * @retval PMINFO_R_OK success
4088 * @retval PMINFO_R_EINVAL invalid argument
4089 * @retval PMINFO_R_ERROR internal error
4090 * @pre pkgmgrinfo_create_certinfo_set_handle()
4091 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4092 * @see pkgmgrinfo_save_certinfo()
4094 static int set_cert_in_db(const char *pkgid)
4097 pkgmgrinfo_instcertinfo_h handle;
4098 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4099 if (ret != PMINFO_R_OK)
4101 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4102 if (ret != PMINFO_R_OK) {
4103 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4106 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4107 if (ret != PMINFO_R_OK) {
4108 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4111 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4116 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4119 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4120 * @brief This API destroys the package cert information handle freeing up all the resources.
4122 * @par This API is for package-manager client application
4123 * @par Sync (or) Async : Synchronous API
4125 * @param[in] handle pointer to the package cert handle.
4126 * @return 0 if success, error code(<0) if fail
4127 * @retval PMINFO_R_OK success
4128 * @retval PMINFO_R_EINVAL invalid argument
4129 * @retval PMINFO_R_ERROR internal error
4130 * @pre pkgmgrinfo_create_certinfo_set_handle()
4132 * @see pkgmgrinfo_save_certinfo()
4134 static int set_cert_in_db(const char *pkgid)
4137 pkgmgrinfo_instcertinfo_h handle;
4138 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4139 if (ret != PMINFO_R_OK)
4141 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4142 if (ret != PMINFO_R_OK) {
4143 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4146 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4147 if (ret != PMINFO_R_OK) {
4148 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4151 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4156 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4159 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4160 * @brief This API gets the datacontrol info
4162 * @par This API is for package-manager client application
4163 * @par Sync (or) Async : Synchronous API
4165 * @param[in] providerid pointer to the providerid of dataconltrol.
4166 * @param[in] type pointer to the type of dataconltrol.
4167 * @param[out] appid pointer to hold appid, need to free after using
4168 * @param[out] access pointer to hold access, need to free after using
4169 * @return 0 if success, error code(<0) if fail
4170 * @retval PMINFO_R_OK success
4171 * @retval PMINFO_R_EINVAL invalid argument
4172 * @retval PMINFO_R_ERROR internal error
4175 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4178 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
4179 * @brief This API gets the application 'guest mode visibility' value from the DB
4181 * @par This API is for package-manager client application
4182 * @par Sync (or) Async : Synchronous API
4184 * @param[in] handle pointer to application info handle
4185 * @param[out] status pointer to hold app guest mode visibility value
4186 * @return 0 if success, error code(<0) if fail
4187 * @retval PMINFO_R_OK success
4188 * @retval PMINFO_R_EINVAL invalid argument
4189 * @retval PMINFO_R_ERROR internal error
4190 * @pre pkgmgrinfo_appinfo_get_appinfo()
4191 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4192 * @see pkgmgrinfo_appinfo_get_appid()
4193 * @see pkgmgrinfo_appinfo_is_multiple()
4195 static int get_app_guestmode_visibility(const char *appid)
4199 pkgmgrinfo_appinfo_h handle;
4200 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4201 if (ret != PMINFO_R_OK)
4203 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
4204 if (ret != PMINFO_R_OK) {
4205 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4208 printf("app guest mode visibility: %d\n", status);
4209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4214 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
4217 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
4218 * @brief This API sets the application 'guest mode visibility' value in the DB
4220 * @par This API is for package-manager client application
4221 * @par Sync (or) Async : Synchronous API
4223 * @param[in] handle pointer to application info handle
4224 * @param[out] status app guest mode visibility value
4225 * @return 0 if success, error code(<0) if fail
4226 * @retval PMINFO_R_OK success
4227 * @retval PMINFO_R_EINVAL invalid argument
4228 * @retval PMINFO_R_ERROR internal error
4229 * @pre pkgmgrinfo_appinfo_get_appinfo()
4230 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4231 * @see pkgmgrinfo_appinfo_get_appid()
4232 * @see pkgmgrinfo_appinfo_is_multiple()
4234 static int set_app_guestmode_visibility(const char *appid, bool value)
4237 pkgmgrinfo_appinfo_h handle;
4238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4239 if (ret != PMINFO_R_OK)
4241 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
4242 if (ret != PMINFO_R_OK) {
4243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4246 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4251 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
4258 #endif /* __PKG_INFO_H__ */