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 } pkgmgrinfo_cert_compare_result_type_e;
105 * @brief API return values
108 PMINFO_R_EINVAL = -2, /**< Invalid argument */
109 PMINFO_R_ERROR = -1, /**< General error */
110 PMINFO_R_OK = 0 /**< General success */
114 * @brief Value to be used when filtering based on install location
116 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
119 * @brief Value to be used when filtering based on install location
121 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
124 * @brief Value to be used when filtering based on install location
126 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
129 * @brief Value to be used when filtering based on app-component
131 #define PMINFO_APPINFO_UI_APP "UI_APP"
134 * @brief Value to be used when filtering based on app-component
136 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
139 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
140 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
141 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
142 }pkgmgrinfo_app_hwacceleration;
145 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
146 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
147 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
148 }pkgmgrinfo_app_recentimage;
151 * @brief A handle to get package information
153 typedef void* pkgmgrinfo_pkginfo_h;
156 * @brief A handle to get application information
158 typedef void* pkgmgrinfo_appinfo_h;
161 * @brief A handle to get certificate information
163 typedef void* pkgmgrinfo_certinfo_h;
166 * @brief A handle to insert package information
168 typedef void* pkgmgrinfo_pkgdbinfo_h;
171 * @brief A handle to filter package information
173 typedef void* pkgmgrinfo_pkginfo_filter_h;
176 * @brief A handle to filter application information
178 typedef void* pkgmgrinfo_appinfo_filter_h;
181 * @brief A handle to get appcontrol information
183 typedef void* pkgmgrinfo_appcontrol_h;
186 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
188 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
190 * @param[in] handle the pkginfo handle
191 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
193 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
195 * @see pkgmgrinfo_pkginfo_get_list()
196 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
198 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
202 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
204 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo()
206 * @param[in] handle the appinfo handle
207 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo()
209 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
211 * @see pkgmgrinfo_appinfo_get_list()
212 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
214 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
218 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
220 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
222 * @param[in] category_name the name of the category
223 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
225 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
227 * @see pkgmgrinfo_appinfo_foreach_category()
229 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
233 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_name, const char *metadata_value, void *user_data)
235 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
237 * @param[in] metadata_name the name of the metadata
238 * @param[in] metadata_value the value of the metadata
239 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
241 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
243 * @see pkgmgrinfo_appinfo_foreach_metadata()
245 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_name,
246 const char *metadata_value, void *user_data);
249 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
251 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
253 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
254 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
256 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
258 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
260 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
264 * @brief Install Location Types
267 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
268 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
269 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
270 }pkgmgrinfo_install_location;
273 * @brief Application Component Types
276 PMINFO_ALL_APP = 0, /**< All Application*/
277 PMINFO_UI_APP, /**< UI Application*/
278 PMINFO_SVC_APP, /**< Service Application*/
279 }pkgmgrinfo_app_component;
282 * @brief Application Storage Types
285 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
286 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
287 }pkgmgrinfo_installed_storage;
290 * @brief Certificate Types to be used for getting information
293 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
294 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
295 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
296 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
297 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
298 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
299 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
300 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
301 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
302 }pkgmgrinfo_cert_type;
305 * @brief Install Location Types to be used when setting data in DB
308 INSTALL_INTERNAL = 0, /**< Internal Installation*/
309 INSTALL_EXTERNAL, /**< External Installation*/
313 * @brief permission Types
316 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
317 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
318 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
319 }pkgmgrinfo_permission_type;
322 /** String property for filtering based on package info*/
323 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
324 /** String property for filtering based on package info*/
325 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
326 /** String property for filtering based on package info*/
327 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
328 /** String property for filtering based on package info*/
329 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
330 /** String property for filtering based on package info*/
331 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
332 /** String property for filtering based on package info*/
333 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
334 /** String property for filtering based on package info*/
335 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
337 /** Boolean property for filtering based on package info*/
338 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
339 /** Boolean property for filtering based on package info*/
340 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
341 /** Boolean property for filtering based on package info*/
342 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
344 /** Integer property for filtering based on package info*/
345 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
347 /** String property for filtering based on app info*/
348 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
349 /** String property for filtering based on app info*/
350 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
351 /** String property for filtering based on app info*/
352 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
353 /** String property for filtering based on app info*/
354 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
355 /** String property for filtering based on app info*/
356 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
357 /** String property for filtering based on app info*/
358 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
359 /** String property for filtering based on app info*/
360 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
361 /** String property for filtering based on app info*/
362 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
363 /** String property for filtering based on app info*/
364 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
365 /** String property for filtering based on app info*/
366 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
368 /** Boolean property for filtering based on app info*/
369 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
370 /** Boolean property for filtering based on app info*/
371 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
372 /** Boolean property for filtering based on app info*/
373 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
374 /** Boolean property for filtering based on app info*/
375 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
376 /** Boolean property for filtering based on app info*/
377 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
380 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
381 * @brief This API gets list of installed packages
383 * @par This API is for package-manager client application
384 * @par Sync (or) Async : Synchronous API
385 * @param[in] pkg_list_cb iteration function for list
386 * @param[in] user_data user data to be passed to callback function
387 * @return 0 if success, error code(<0) if fail
388 * @retval PMINFO_R_OK success
389 * @retval PMINFO_R_EINVAL invalid argument
390 * @retval PMINFO_R_ERROR internal error
394 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
398 pkgid1 = (char *)user_data;
399 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
400 if (strcmp(pkgid1, pkgid2) == 0) {
407 static int list_pkgs()
410 char *name = "helloworld";
411 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
412 if (ret != PMINFO_R_OK) {
419 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
422 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
423 * @brief This API creates the package information handle from db
425 * @par This API is for package-manager client application
426 * @par Sync (or) Async : Synchronous API
428 * @param[in] pkgid pointer to package ID
429 * @param[out] handle pointer to the package info handle.
430 * @return 0 if success, error code(<0) if fail
431 * @retval PMINFO_R_OK success
432 * @retval PMINFO_R_EINVAL invalid argument
433 * @retval PMINFO_R_ERROR internal error
435 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
436 * @see pkgmgrinfo_pkginfo_get_pkgid()
437 * @see pkgmgrinfo_pkginfo_is_removable()
439 static int get_pkg_type(const char *pkgid)
443 pkgmgrinfo_pkginfo_h handle;
444 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
445 if (ret != PMINFO_R_OK)
447 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
448 if (ret != PMINFO_R_OK) {
449 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
452 printf("pkgtype: %s\n", type);
453 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
458 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
461 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
462 * @brief This API gets the package name from the package ID
464 * @par This API is for package-manager client application
465 * @par Sync (or) Async : Synchronous API
467 * @param[in] handle pointer to package info handle
468 * @param[out] pkg_name pointer to hold package name
469 * @return 0 if success, error code(<0) if fail
470 * @retval PMINFO_R_OK success
471 * @retval PMINFO_R_EINVAL invalid argument
472 * @retval PMINFO_R_ERROR internal error
473 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
474 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
475 * @see pkgmgrinfo_pkginfo_get_type()
476 * @see pkgmgrinfo_pkginfo_is_removable()
478 static int get_pkg_name(const char *pkgid)
481 char *pkgname = NULL;
482 pkgmgrinfo_pkginfo_h handle;
483 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
484 if (ret != PMINFO_R_OK)
486 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
487 if (ret != PMINFO_R_OK) {
488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
491 printf("pkgname: %s\n", pkgname);
492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
497 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
500 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
501 * @brief This API gets the package id from the package ID
503 * @par This API is for package-manager client application
504 * @par Sync (or) Async : Synchronous API
506 * @param[in] handle pointer to package info handle
507 * @param[out] pkgid pointer to hold package id
508 * @return 0 if success, error code(<0) if fail
509 * @retval PMINFO_R_OK success
510 * @retval PMINFO_R_EINVAL invalid argument
511 * @retval PMINFO_R_ERROR internal error
512 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
513 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
514 * @see pkgmgrinfo_pkginfo_get_type()
515 * @see pkgmgrinfo_pkginfo_is_removable()
517 static int get_pkgid(const char *pkgid)
521 pkgmgrinfo_pkginfo_h handle;
522 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
523 if (ret != PMINFO_R_OK)
525 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
526 if (ret != PMINFO_R_OK) {
527 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
530 printf("pkg id: %s\n", pkg_id);
531 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
536 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
539 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
540 * @brief This API gets the package type from the package ID
542 * @par This API is for package-manager client application
543 * @par Sync (or) Async : Synchronous API
545 * @param[in] handle pointer to package info handle
546 * @param[out] type pointer to hold package type
547 * @return 0 if success, error code(<0) if fail
548 * @retval PMINFO_R_OK success
549 * @retval PMINFO_R_EINVAL invalid argument
550 * @retval PMINFO_R_ERROR internal error
551 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
552 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
553 * @see pkgmgrinfo_pkginfo_get_pkgid()
554 * @see pkgmgrinfo_pkginfo_is_removable()
556 static int get_pkg_type(const char *pkgid)
560 pkgmgrinfo_pkginfo_h handle;
561 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
562 if (ret != PMINFO_R_OK)
564 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
565 if (ret != PMINFO_R_OK) {
566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
569 printf("pkgtype: %s\n", type);
570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
575 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
578 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
579 * @brief This API gets the package version from the package ID
581 * @par This API is for package-manager client application
582 * @par Sync (or) Async : Synchronous API
584 * @param[in] handle pointer to package info handle
585 * @param[out] version pointer to hold package version
586 * @return 0 if success, error code(<0) if fail
587 * @retval PMINFO_R_OK success
588 * @retval PMINFO_R_EINVAL invalid argument
589 * @retval PMINFO_R_ERROR internal error
590 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
591 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
592 * @see pkgmgrinfo_pkginfo_get_pkgid()
593 * @see pkgmgrinfo_pkginfo_is_removable()
595 static int get_pkg_version(const char *pkgid)
598 char *version = NULL;
599 pkgmgrinfo_pkginfo_h handle;
600 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
601 if (ret != PMINFO_R_OK)
603 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
604 if (ret != PMINFO_R_OK) {
605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
608 printf("pkg version: %s\n", version);
609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
614 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
617 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
618 * @brief This API gets the package install location from the package ID
620 * @par This API is for package-manager client application
621 * @par Sync (or) Async : Synchronous API
623 * @param[in] handle pointer to package info handle
624 * @param[out] location pointer to hold package install location
625 * @return 0 if success, error code(<0) if fail
626 * @retval PMINFO_R_OK success
627 * @retval PMINFO_R_EINVAL invalid argument
628 * @retval PMINFO_R_ERROR internal error
629 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
630 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
631 * @see pkgmgrinfo_pkginfo_get_pkgid()
632 * @see pkgmgrinfo_pkginfo_is_removable()
634 static int get_pkg_install_location(const char *pkgid)
637 pkgmgrinfo_install_location location;
638 pkgmgrinfo_pkginfo_h handle;
639 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
640 if (ret != PMINFO_R_OK)
642 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
643 if (ret != PMINFO_R_OK) {
644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
647 printf("pkg install location: %d\n", location);
648 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
653 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
656 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
657 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
658 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
659 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
661 * @par This API is for package-manager client application
662 * @par Sync (or) Async : Synchronous API
664 * @param[in] handle pointer to package info handle
665 * @param[out] size pointer to hold package size
666 * @return 0 if success, error code(<0) if fail
667 * @retval PMINFO_R_OK success
668 * @retval PMINFO_R_EINVAL invalid argument
669 * @retval PMINFO_R_ERROR internal error
670 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
671 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
672 * @see pkgmgrinfo_pkginfo_get_pkgid()
673 * @see pkgmgrinfo_pkginfo_is_removable()
675 static int get_pkg_size(const char *pkgid)
679 pkgmgrinfo_pkginfo_h handle;
680 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
681 if (ret != PMINFO_R_OK)
683 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
684 if (ret != PMINFO_R_OK) {
685 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
688 printf("pkgsize: %d\n", size);
689 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
697 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
698 * @brief This API gets the installed package total size on the target.
700 * @par This API is for package-manager client application
701 * @par Sync (or) Async : Synchronous API
703 * @param[in] handle pointer to package info handle
704 * @param[out] size pointer to hold package total size
705 * @return 0 if success, error code(<0) if fail
706 * @retval PMINFO_R_OK success
707 * @retval PMINFO_R_EINVAL invalid argument
708 * @retval PMINFO_R_ERROR internal error
710 static int get_pkg_total_size(const char *pkgid)
714 pkgmgrinfo_pkginfo_h handle;
715 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
716 if (ret != PMINFO_R_OK)
718 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
719 if (ret != PMINFO_R_OK) {
720 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
723 printf("pkg total size: %d\n", size);
724 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
729 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
732 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
733 * @brief This API gets the installed package data size on the target.
735 * @par This API is for package-manager client application
736 * @par Sync (or) Async : Synchronous API
738 * @param[in] handle pointer to package info handle
739 * @param[out] size pointer to hold package data size
740 * @return 0 if success, error code(<0) if fail
741 * @retval PMINFO_R_OK success
742 * @retval PMINFO_R_EINVAL invalid argument
743 * @retval PMINFO_R_ERROR internal error
745 static int get_pkg_data_size(const char *pkgid)
749 pkgmgrinfo_pkginfo_h handle;
750 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
751 if (ret != PMINFO_R_OK)
753 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
754 if (ret != PMINFO_R_OK) {
755 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
758 printf("pkg data size: %d\n", size);
759 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
764 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
767 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
768 * @brief This API gets the package icon from the package ID
770 * @par This API is for package-manager client application
771 * @par Sync (or) Async : Synchronous API
773 * @param[in] handle pointer to package info handle
774 * @param[out] icon pointer to hold package icon
775 * @return 0 if success, error code(<0) if fail
776 * @retval PMINFO_R_OK success
777 * @retval PMINFO_R_EINVAL invalid argument
778 * @retval PMINFO_R_ERROR internal error
779 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
780 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
781 * @see pkgmgrinfo_pkginfo_get_pkgid()
782 * @see pkgmgrinfo_pkginfo_is_removable()
784 static int get_pkg_icon(const char *pkgid)
788 pkgmgrinfo_pkginfo_h handle;
789 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
790 if (ret != PMINFO_R_OK)
792 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
793 if (ret != PMINFO_R_OK) {
794 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
797 printf("pkg icon: %s\n", icon);
798 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
803 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
806 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
807 * @brief This API gets the package label from the package ID
809 * @par This API is for package-manager client application
810 * @par Sync (or) Async : Synchronous API
812 * @param[in] handle pointer to package info handle
813 * @param[out] label pointer to hold package label
814 * @return 0 if success, error code(<0) if fail
815 * @retval PMINFO_R_OK success
816 * @retval PMINFO_R_EINVAL invalid argument
817 * @retval PMINFO_R_ERROR internal error
818 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
819 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
820 * @see pkgmgrinfo_pkginfo_get_pkgid()
821 * @see pkgmgrinfo_pkginfo_is_removable()
823 static int get_pkg_label(const char *pkgid)
827 pkgmgrinfo_pkginfo_h handle;
828 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
829 if (ret != PMINFO_R_OK)
831 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
832 if (ret != PMINFO_R_OK) {
833 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
836 printf("pkg label: %s\n", label);
837 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
842 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
845 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
846 * @brief This API gets the package description from the package ID
848 * @par This API is for package-manager client application
849 * @par Sync (or) Async : Synchronous API
851 * @param[in] handle pointer to package info handle
852 * @param[out] description pointer to hold package description
853 * @return 0 if success, error code(<0) if fail
854 * @retval PMINFO_R_OK success
855 * @retval PMINFO_R_EINVAL invalid argument
856 * @retval PMINFO_R_ERROR internal error
857 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
858 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
859 * @see pkgmgrinfo_pkginfo_get_pkgid()
860 * @see pkgmgrinfo_pkginfo_is_removable()
862 static int get_pkg_description(const char *pkgid)
865 char *description = NULL;
866 pkgmgrinfo_pkginfo_h handle;
867 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
868 if (ret != PMINFO_R_OK)
870 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
871 if (ret != PMINFO_R_OK) {
872 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
875 printf("pkg description: %s\n", description);
876 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
881 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
884 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
885 * @brief This API gets the package's author name from the package ID
887 * @par This API is for package-manager client application
888 * @par Sync (or) Async : Synchronous API
890 * @param[in] handle pointer to package info handle
891 * @param[out] author_name pointer to hold package author name
892 * @return 0 if success, error code(<0) if fail
893 * @retval PMINFO_R_OK success
894 * @retval PMINFO_R_EINVAL invalid argument
895 * @retval PMINFO_R_ERROR internal error
896 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
897 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
898 * @see pkgmgrinfo_pkginfo_get_pkgid()
899 * @see pkgmgrinfo_pkginfo_is_removable()
901 static int get_pkg_author_name(const char *pkgid)
904 char *author_name = NULL;
905 pkgmgrinfo_pkginfo_h handle;
906 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
907 if (ret != PMINFO_R_OK)
909 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
910 if (ret != PMINFO_R_OK) {
911 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
914 printf("pkg author name: %s\n", author_name);
915 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
920 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
923 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
924 * @brief This API gets the package's author email from the package ID
926 * @par This API is for package-manager client application
927 * @par Sync (or) Async : Synchronous API
929 * @param[in] handle pointer to package info handle
930 * @param[out] author_email pointer to hold package author email
931 * @return 0 if success, error code(<0) if fail
932 * @retval PMINFO_R_OK success
933 * @retval PMINFO_R_EINVAL invalid argument
934 * @retval PMINFO_R_ERROR internal error
935 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
936 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
937 * @see pkgmgrinfo_pkginfo_get_pkgid()
938 * @see pkgmgrinfo_pkginfo_is_removable()
940 static int get_pkg_author_email(const char *pkgid)
943 char *author_email = NULL;
944 pkgmgrinfo_pkginfo_h handle;
945 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
946 if (ret != PMINFO_R_OK)
948 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
949 if (ret != PMINFO_R_OK) {
950 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
953 printf("pkg author email: %s\n", author_email);
954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
959 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
962 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
963 * @brief This API gets the package's author href from the package ID
965 * @par This API is for package-manager client application
966 * @par Sync (or) Async : Synchronous API
968 * @param[in] handle pointer to package info handle
969 * @param[out] author_href pointer to hold package author href
970 * @return 0 if success, error code(<0) if fail
971 * @retval PMINFO_R_OK success
972 * @retval PMINFO_R_EINVAL invalid argument
973 * @retval PMINFO_R_ERROR internal error
974 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
975 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
976 * @see pkgmgrinfo_pkginfo_get_pkgid()
977 * @see pkgmgrinfo_pkginfo_is_removable()
979 static int get_pkg_author_href(const char *pkgid)
982 char *author_href = NULL;
983 pkgmgrinfo_pkginfo_h handle;
984 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
985 if (ret != PMINFO_R_OK)
987 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
988 if (ret != PMINFO_R_OK) {
989 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
992 printf("pkg author href: %s\n", author_href);
993 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
998 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1001 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1002 * @brief This API gets the package installed storagae value from the package ID
1004 * @par This API is for package-manager client application
1005 * @par Sync (or) Async : Synchronous API
1007 * @param[in] handle pointer to package info handle
1008 * @param[out] storage pointer to hold package installed storage
1009 * @return 0 if success, error code(<0) if fail
1010 * @retval PMINFO_R_OK success
1011 * @retval PMINFO_R_EINVAL invalid argument
1012 * @retval PMINFO_R_ERROR internal error
1013 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1014 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1015 * @see pkgmgrinfo_pkginfo_get_pkgid()
1016 * @see pkgmgrinfo_pkginfo_is_removable()
1018 static int get_pkg_installed_storage(const char *pkgid)
1021 pkgmgrinfo_installed_storage storage;
1022 pkgmgrinfo_pkginfo_h handle;
1023 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1024 if (ret != PMINFO_R_OK)
1026 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1027 if (ret != PMINFO_R_OK) {
1028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1031 printf("pkg installed storage: %d\n", storage);
1032 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1037 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1040 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1041 * @brief This API gets the installed time of package from the package ID
1043 * @par This API is for package-manager client application
1044 * @par Sync (or) Async : Synchronous API
1046 * @param[in] handle pointer to package info handle
1047 * @param[out] installed_time pointer to hold installed time of package
1048 * @return 0 if success, error code(<0) if fail
1049 * @retval PMINFO_R_OK success
1050 * @retval PMINFO_R_EINVAL invalid argument
1051 * @retval PMINFO_R_ERROR internal error
1052 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1053 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1054 * @see pkgmgrinfo_pkginfo_get_pkgid()
1055 * @see pkgmgrinfo_pkginfo_is_removable()
1057 static int get_pkg_installed_time(const char *pkgid)
1060 int installed_time = 0;
1061 pkgmgrinfo_pkginfo_h handle;
1062 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1063 if (ret != PMINFO_R_OK)
1065 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1066 if (ret != PMINFO_R_OK) {
1067 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1070 printf("installed_time: %d\n", installed_time);
1071 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1076 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1079 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1080 * @brief This API gets the store client id of package from the package ID
1082 * @par This API is for package-manager client application
1083 * @par Sync (or) Async : Synchronous API
1085 * @param[in] handle pointer to package info handle
1086 * @param[out] storeclientid pointer to hold store client id of package
1087 * @return 0 if success, error code(<0) if fail
1088 * @retval PMINFO_R_OK success
1089 * @retval PMINFO_R_EINVAL invalid argument
1090 * @retval PMINFO_R_ERROR internal error
1091 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1092 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1093 * @see pkgmgrinfo_pkginfo_get_pkgid()
1094 * @see pkgmgrinfo_pkginfo_is_removable()
1096 static int get_pkg_storeclientid(const char *pkgid)
1099 char *storeclientid = 0;
1100 pkgmgrinfo_pkginfo_h handle;
1101 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1102 if (ret != PMINFO_R_OK)
1104 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1105 if (ret != PMINFO_R_OK) {
1106 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1109 printf(store client id: %s\n", storeclientid);
1110 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1115 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1118 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1119 * @brief This API gets the main app id of package from the package ID
1121 * @par This API is for package-manager client application
1122 * @par Sync (or) Async : Synchronous API
1124 * @param[in] handle pointer to package info handle
1125 * @param[out] mainappid pointer to hold main app id of package
1126 * @return 0 if success, error code(<0) if fail
1127 * @retval PMINFO_R_OK success
1128 * @retval PMINFO_R_EINVAL invalid argument
1129 * @retval PMINFO_R_ERROR internal error
1130 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1131 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1132 * @see pkgmgrinfo_pkginfo_get_pkgid()
1133 * @see pkgmgrinfo_pkginfo_is_removable()
1135 static int get_pkg_mainappid(const char *pkgid)
1138 char *mainappid = 0;
1139 pkgmgrinfo_pkginfo_h handle;
1140 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1141 if (ret != PMINFO_R_OK)
1143 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1144 if (ret != PMINFO_R_OK) {
1145 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1148 printf(main app id: %s\n", mainappid);
1149 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1154 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1157 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1158 * @brief This API gets the url of package from the package ID
1160 * @par This API is for package-manager client application
1161 * @par Sync (or) Async : Synchronous API
1163 * @param[in] handle pointer to package info handle
1164 * @param[out] url pointer to hold url of package
1165 * @return 0 if success, error code(<0) if fail
1166 * @retval PMINFO_R_OK success
1167 * @retval PMINFO_R_EINVAL invalid argument
1168 * @retval PMINFO_R_ERROR internal error
1169 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1170 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1171 * @see pkgmgrinfo_pkginfo_get_pkgid()
1172 * @see pkgmgrinfo_pkginfo_is_removable()
1174 static int get_pkg_url(const char *pkgid)
1178 pkgmgrinfo_pkginfo_h handle;
1179 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1180 if (ret != PMINFO_R_OK)
1182 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1183 if (ret != PMINFO_R_OK) {
1184 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1187 printf("url : %s\n", url);
1188 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1193 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1197 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1198 * @brief This API gets the root path of package
1200 * @par Sync (or) Async : Synchronous API
1202 * @param[in] handle pointer to package info handle
1203 * @param[out] path pointer to hold root path of package
1204 * @return 0 if success, error code(<0) if fail
1205 * @retval PMINFO_R_OK success
1206 * @retval PMINFO_R_EINVAL invalid argument
1207 * @retval PMINFO_R_ERROR internal error
1209 static int get_root_path(const char *pkgid)
1213 pkgmgrinfo_pkginfo_h handle;
1214 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1215 if (ret != PMINFO_R_OK)
1218 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1219 if (ret != PMINFO_R_OK) {
1220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1223 printf("path : %s\n", path);
1224 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1230 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1233 * @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)
1234 * @brief This API compare the cert information from given package id
1236 * @par This API is for package-manager client application
1237 * @par Sync (or) Async : Synchronous API
1239 * @param[in] lhs_package_id pointer to first package ID
1240 * @param[in] rhs_package_id pointer to second package ID
1241 * @param[out] compare_result pointer to the compare result.
1242 * @return 0 if success, error code(<0) if fail
1243 * @retval PMINFO_R_OK success
1244 * @retval PMINFO_R_EINVAL invalid argument
1245 * @retval PMINFO_R_ERROR internal error
1247 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1248 * @see pkgmgrinfo_pkginfo_get_pkgid()
1249 * @see pkgmgrinfo_pkginfo_is_removable()
1251 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1254 pkgmgrinfo_cert_compare_result_type_e result;
1256 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1257 if (ret != PMINFO_R_OK) {
1260 printf("result: %d\n", result);
1265 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);
1268 * @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)
1269 * @brief This API compare the cert information from given app id
1271 * @par This API is for package-manager client application
1272 * @par Sync (or) Async : Synchronous API
1274 * @param[in] lhs_app_id pointer to first app ID
1275 * @param[in] rhs_app_id pointer to second app ID
1276 * @param[out] compare_result pointer to the compare result.
1277 * @return 0 if success, error code(<0) if fail
1278 * @retval PMINFO_R_OK success
1279 * @retval PMINFO_R_EINVAL invalid argument
1280 * @retval PMINFO_R_ERROR internal error
1282 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1283 * @see pkgmgrinfo_pkginfo_get_pkgid()
1284 * @see pkgmgrinfo_pkginfo_is_removable()
1286 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1289 pkgmgrinfo_cert_compare_result_type_e result;
1291 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1292 if (ret != PMINFO_R_OK) {
1295 printf("result: %d\n", result);
1300 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);
1303 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1304 * @brief This API gets the package 'removable' value from the package ID
1306 * @par This API is for package-manager client application
1307 * @par Sync (or) Async : Synchronous API
1309 * @param[in] handle pointer to package info handle
1310 * @param[out] removable pointer to hold package removable value
1311 * @return 0 if success, error code(<0) if fail
1312 * @retval PMINFO_R_OK success
1313 * @retval PMINFO_R_EINVAL invalid argument
1314 * @retval PMINFO_R_ERROR internal error
1315 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1316 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1317 * @see pkgmgrinfo_pkginfo_get_pkgid()
1318 * @see pkgmgrinfo_pkginfo_is_readonly()
1320 static int get_pkg_removable(const char *pkgid)
1324 pkgmgrinfo_pkginfo_h handle;
1325 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1326 if (ret != PMINFO_R_OK)
1328 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1329 if (ret != PMINFO_R_OK) {
1330 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1333 printf("pkg removable: %d\n", removable);
1334 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1339 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1342 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1343 * @brief This API gets the package 'preload' value from the package ID
1345 * @par This API is for package-manager client application
1346 * @par Sync (or) Async : Synchronous API
1348 * @param[in] handle pointer to package info handle
1349 * @param[out] preload pointer to hold package preload value
1350 * @return 0 if success, error code(<0) if fail
1351 * @retval PMINFO_R_OK success
1352 * @retval PMINFO_R_EINVAL invalid argument
1353 * @retval PMINFO_R_ERROR internal error
1354 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1355 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1356 * @see pkgmgrinfo_pkginfo_get_pkgid()
1357 * @see pkgmgrinfo_pkginfo_is_readonly()
1359 static int get_pkg_preload(const char *pkgid)
1363 pkgmgrinfo_pkginfo_h handle;
1364 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1365 if (ret != PMINFO_R_OK)
1367 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1368 if (ret != PMINFO_R_OK) {
1369 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1372 printf("pkg preload: %d\n", preload);
1373 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1378 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1381 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1382 * @brief This API gets the package 'readonly' value from the package ID
1384 * @par This API is for package-manager client application
1385 * @par Sync (or) Async : Synchronous API
1387 * @param[in] handle pointer to package info handle
1388 * @param[out] readonly pointer to hold package readonly value
1389 * @return 0 if success, error code(<0) if fail
1390 * @retval PMINFO_R_OK success
1391 * @retval PMINFO_R_EINVAL invalid argument
1392 * @retval PMINFO_R_ERROR internal error
1393 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1394 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1395 * @see pkgmgrinfo_pkginfo_get_pkgid()
1396 * @see pkgmgrinfo_pkginfo_is_removable()
1398 static int get_pkg_readonly(const char *pkgid)
1402 pkgmgrinfo_pkginfo_h handle;
1403 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1404 if (ret != PMINFO_R_OK)
1406 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1407 if (ret != PMINFO_R_OK) {
1408 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1411 printf("pkg readonly: %d\n", readonly);
1412 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1417 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1420 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1421 * @brief This API gets the package 'accessible' value from the package ID
1423 * @par This API is for package-manager client application
1424 * @par Sync (or) Async : Synchronous API
1426 * @param[in] handle pointer to package info handle
1427 * @param[out] accessible pointer to hold package accessible value
1428 * @return 0 if success, error code(<0) if fail
1429 * @retval PMINFO_R_OK success
1430 * @retval PMINFO_R_EINVAL invalid argument
1431 * @retval PMINFO_R_ERROR internal error
1432 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1433 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1434 * @see pkgmgrinfo_pkginfo_get_pkgid()
1435 * @see pkgmgrinfo_pkginfo_is_readonly()
1437 static int get_pkg_accessible(const char *pkgid)
1441 pkgmgrinfo_pkginfo_h handle;
1442 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1443 if (ret != PMINFO_R_OK)
1445 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1446 if (ret != PMINFO_R_OK) {
1447 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1450 printf("pkg accessible: %d\n", accessible);
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1456 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1459 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1460 * @brief This API destroys the package information handle freeing up all the resources
1462 * @par This API is for package-manager client application
1463 * @par Sync (or) Async : Synchronous API
1465 * @param[in] handle pointer to the package info handle
1466 * @return 0 if success, error code(<0) if fail
1467 * @retval PMINFO_R_OK success
1468 * @retval PMINFO_R_EINVAL invalid argument
1469 * @retval PMINFO_R_ERROR internal error
1470 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1472 * @see pkgmgrinfo_pkginfo_get_pkgid()
1473 * @see pkgmgrinfo_pkginfo_is_removable()
1475 static int get_pkg_type(const char *pkgid)
1479 pkgmgrinfo_pkginfo_h handle;
1480 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1481 if (ret != PMINFO_R_OK)
1483 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1484 if (ret != PMINFO_R_OK) {
1485 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1488 printf("pkgtype: %s\n", type);
1489 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1494 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1497 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1498 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1499 The query will search the entire package information collected from the manifest file of all the installed packages
1501 * @par This API is for package-manager client application
1502 * @par Sync (or) Async : Synchronous API
1504 * @param[out] handle pointer to the package info filter handle.
1505 * @return 0 if success, error code(<0) if fail
1506 * @retval PMINFO_R_OK success
1507 * @retval PMINFO_R_EINVAL invalid argument
1508 * @retval PMINFO_R_ERROR internal error
1510 * @post pkgmgrinfo_pkginfo_filter_destroy()
1511 * @see pkgmgrinfo_pkginfo_filter_count()
1512 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1514 static int get_rpm_pkg_count()
1518 pkgmgrinfo_pkginfo_filter_h handle;
1519 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1520 if (ret != PMINFO_R_OK)
1522 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1523 if (ret != PMINFO_R_OK) {
1524 pkgmgrinfo_pkginfo_filter_destroy(handle);
1527 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1528 if (ret != PMINFO_R_OK) {
1529 pkgmgrinfo_pkginfo_filter_destroy(handle);
1532 printf("No of rpm pkgs: %d\n", count);
1533 pkgmgrinfo_pkginfo_filter_destroy(handle);
1538 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1541 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1542 * @brief This API destroys the package information filter handle freeing up all the resources
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[in] handle pointer to the package info filter handle.
1548 * @return 0 if success, error code(<0) if fail
1549 * @retval PMINFO_R_OK success
1550 * @retval PMINFO_R_EINVAL invalid argument
1551 * @retval PMINFO_R_ERROR internal error
1552 * @pre pkgmgrinfo_pkginfo_filter_create()
1554 * @see pkgmgrinfo_pkginfo_filter_count()
1555 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1557 static int get_rpm_pkg_count()
1561 pkgmgrinfo_pkginfo_filter_h handle;
1562 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1563 if (ret != PMINFO_R_OK)
1565 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1566 if (ret != PMINFO_R_OK) {
1567 pkgmgrinfo_pkginfo_filter_destroy(handle);
1570 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1571 if (ret != PMINFO_R_OK) {
1572 pkgmgrinfo_pkginfo_filter_destroy(handle);
1575 printf("No of rpm pkgs: %d\n", count);
1576 pkgmgrinfo_pkginfo_filter_destroy(handle);
1581 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1584 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1585 * @brief This API adds a boolean filter property to the filter handle
1587 * @par This API is for package-manager client application
1588 * @par Sync (or) Async : Synchronous API
1590 * @param[in] handle pointer to the package info filter handle.
1591 * @param[in] property boolean property name.
1592 * @param[in] value value corresponding to the property.
1593 * @return 0 if success, error code(<0) if fail
1594 * @retval PMINFO_R_OK success
1595 * @retval PMINFO_R_EINVAL invalid argument
1596 * @retval PMINFO_R_ERROR internal error
1597 * @pre pkgmgrinfo_pkginfo_filter_create()
1598 * @post pkgmgrinfo_pkginfo_filter_destroy()
1599 * @see pkgmgrinfo_pkginfo_filter_count()
1600 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1602 static int get_preload_pkg_count()
1606 pkgmgrinfo_pkginfo_filter_h handle;
1607 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1608 if (ret != PMINFO_R_OK)
1610 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1611 if (ret != PMINFO_R_OK) {
1612 pkgmgrinfo_pkginfo_filter_destroy(handle);
1615 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1616 if (ret != PMINFO_R_OK) {
1617 pkgmgrinfo_pkginfo_filter_destroy(handle);
1620 printf("No of preload pkgs: %d\n", count);
1621 pkgmgrinfo_pkginfo_filter_destroy(handle);
1626 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1627 const char *property, const bool value);
1630 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1631 * @brief This API adds an integer filter property to the filter handle
1633 * @par This API is for package-manager client application
1634 * @par Sync (or) Async : Synchronous API
1636 * @param[in] handle pointer to the package info filter handle.
1637 * @param[in] property integer property name.
1638 * @param[in] value value corresponding to the property.
1639 * @return 0 if success, error code(<0) if fail
1640 * @retval PMINFO_R_OK success
1641 * @retval PMINFO_R_EINVAL invalid argument
1642 * @retval PMINFO_R_ERROR internal error
1643 * @pre pkgmgrinfo_pkginfo_filter_create()
1644 * @post pkgmgrinfo_pkginfo_filter_destroy()
1645 * @see pkgmgrinfo_pkginfo_filter_count()
1646 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1648 static int get_pkg_count()
1652 pkgmgrinfo_pkginfo_filter_h handle;
1653 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1654 if (ret != PMINFO_R_OK)
1656 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1657 if (ret != PMINFO_R_OK) {
1658 pkgmgrinfo_pkginfo_filter_destroy(handle);
1661 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1662 if (ret != PMINFO_R_OK) {
1663 pkgmgrinfo_pkginfo_filter_destroy(handle);
1666 printf("No of preload pkgs: %d\n", count);
1667 pkgmgrinfo_pkginfo_filter_destroy(handle);
1672 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1673 const char *property, const int value);
1676 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1677 * @brief This API adds a string filter property to the filter handle
1679 * @par This API is for package-manager client application
1680 * @par Sync (or) Async : Synchronous API
1682 * @param[in] handle pointer to the package info filter handle.
1683 * @param[in] property string property name.
1684 * @param[in] value value corresponding to the property.
1685 * @return 0 if success, error code(<0) if fail
1686 * @retval PMINFO_R_OK success
1687 * @retval PMINFO_R_EINVAL invalid argument
1688 * @retval PMINFO_R_ERROR internal error
1689 * @pre pkgmgrinfo_pkginfo_filter_create()
1690 * @post pkgmgrinfo_pkginfo_filter_destroy()
1691 * @see pkgmgrinfo_pkginfo_filter_count()
1692 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1694 static int get_rpm_pkg_count()
1698 pkgmgrinfo_pkginfo_filter_h handle;
1699 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1700 if (ret != PMINFO_R_OK)
1702 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1703 if (ret != PMINFO_R_OK) {
1704 pkgmgrinfo_pkginfo_filter_destroy(handle);
1707 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1708 if (ret != PMINFO_R_OK) {
1709 pkgmgrinfo_pkginfo_filter_destroy(handle);
1712 printf("No of rpm pkgs: %d\n", count);
1713 pkgmgrinfo_pkginfo_filter_destroy(handle);
1718 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1719 const char *property, const char *value);
1722 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1723 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1725 * @par This API is for package-manager client application
1726 * @par Sync (or) Async : Synchronous API
1728 * @param[in] handle pointer to the package info filter handle.
1729 * @param[in] pkg_cb callback function.
1730 * @param[in] user_data user data to be passed to the callback function
1731 * @return 0 if success, error code(<0) if fail
1732 * @retval PMINFO_R_OK success
1733 * @retval PMINFO_R_EINVAL invalid argument
1734 * @retval PMINFO_R_ERROR internal error
1735 * @pre pkgmgrinfo_pkginfo_filter_create()
1736 * @post pkgmgrinfo_pkginfo_filter_destroy()
1737 * @see pkgmgrinfo_pkginfo_filter_count()
1739 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1742 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1743 printf("pkg id : %s\n", pkgid);
1747 static int get_rpm_pkg_list()
1750 pkgmgrinfo_pkginfo_filter_h handle;
1751 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1752 if (ret != PMINFO_R_OK)
1754 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1755 if (ret != PMINFO_R_OK) {
1756 pkgmgrinfo_pkginfo_filter_destroy(handle);
1759 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1760 if (ret != PMINFO_R_OK) {
1761 pkgmgrinfo_pkginfo_filter_destroy(handle);
1764 pkgmgrinfo_pkginfo_filter_destroy(handle);
1769 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1770 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1773 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1774 * @brief This API counts the package that satisfy the filter conditions
1776 * @par This API is for package-manager client application
1777 * @par Sync (or) Async : Synchronous API
1779 * @param[in] handle pointer to the package info filter handle.
1780 * @param[in] count pointer to store the count value.
1781 * @return 0 if success, error code(<0) if fail
1782 * @retval PMINFO_R_OK success
1783 * @retval PMINFO_R_EINVAL invalid argument
1784 * @retval PMINFO_R_ERROR internal error
1785 * @pre pkgmgrinfo_pkginfo_filter_create()
1786 * @post pkgmgrinfo_pkginfo_filter_destroy()
1787 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1789 static int get_rpm_pkg_count()
1793 pkgmgrinfo_pkginfo_filter_h handle;
1794 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1795 if (ret != PMINFO_R_OK)
1797 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1803 if (ret != PMINFO_R_OK) {
1804 pkgmgrinfo_pkginfo_filter_destroy(handle);
1807 printf("No of rpm pkgs: %d\n", count);
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1813 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1816 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1817 pkgmgrinfo_app_list_cb app_func, void *user_data)
1818 * @brief This API gets list of installed applications for a particular package
1820 * @par This API is for package-manager client application
1821 * @par Sync (or) Async : Synchronous API
1822 * @param[in] handle package info handle
1823 * @param[in] component application component
1824 * @param[in] app_func iteration function for list
1825 * @param[in] user_data user data to be passed to callback function
1826 * @return 0 if success, error code(<0) if fail
1827 * @retval PMINFO_R_OK success
1828 * @retval PMINFO_R_EINVAL invalid argument
1829 * @retval PMINFO_R_ERROR internal error
1830 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1831 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1833 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1836 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1837 printf("appid : %s\n", appid);
1841 static int list_apps(const char *pkgid)
1844 pkgmgrinfo_pkginfo_h handle;
1845 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1846 if (ret != PMINFO_R_OK)
1848 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1849 if (ret != PMINFO_R_OK) {
1850 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1858 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1859 pkgmgrinfo_app_list_cb app_func, void *user_data);
1862 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1863 * @brief This API gets list of installed applications from all packages.
1865 * @par This API is for package-manager client application
1866 * @par Sync (or) Async : Synchronous API
1867 * @param[in] app_func iteration function for list
1868 * @param[in] user_data user data to be passed to callback function
1869 * @return 0 if success, error code(<0) if fail
1870 * @retval PMINFO_R_OK success
1871 * @retval PMINFO_R_EINVAL invalid argument
1872 * @retval PMINFO_R_ERROR internal error
1876 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1878 char *pkgid1 = NULL;
1879 char *pkgid2 = NULL;
1880 pkgid1 = (char *)user_data;
1881 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1882 if (strcmp(pkgid1, pkgid2) == 0) {
1889 static int list_apps()
1892 char *name = "helloworld";
1893 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1894 if (ret != PMINFO_R_OK) {
1901 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1904 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
1905 * @brief This API creates the application information handle from db
1907 * @par This API is for package-manager client application
1908 * @par Sync (or) Async : Synchronous API
1910 * @param[in] appid pointer to appid
1911 * @param[out] handle pointer to the application info handle.
1912 * @return 0 if success, error code(<0) if fail
1913 * @retval PMINFO_R_OK success
1914 * @retval PMINFO_R_EINVAL invalid argument
1915 * @retval PMINFO_R_ERROR internal error
1917 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1918 * @see pkgmgrinfo_appinfo_get_pkgid()
1919 * @see pkgmgrinfo_appinfo_is_multiple()
1921 static int get_app_type(const char *appid)
1925 pkgmgrinfo_appinfo_h handle;
1926 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1927 if (ret != PMINFO_R_OK)
1929 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
1930 if (ret != PMINFO_R_OK) {
1931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1934 printf("apptype: %s\n", type);
1935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1940 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
1943 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
1944 * @brief This API gets the application ID
1946 * @par This API is for package-manager client application
1947 * @par Sync (or) Async : Synchronous API
1949 * @param[in] handle pointer to the application info handle.
1950 * @param[out] appid pointer to hold appid
1951 * @return 0 if success, error code(<0) if fail
1952 * @retval PMINFO_R_OK success
1953 * @retval PMINFO_R_EINVAL invalid argument
1954 * @retval PMINFO_R_ERROR internal error
1955 * @pre pkgmgrinfo_appinfo_get_appinfo()
1956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1957 * @see pkgmgrinfo_appinfo_get_pkgid()
1958 * @see pkgmgrinfo_appinfo_is_multiple()
1960 static int get_app_id(const char *appid)
1963 char *app_id = NULL;
1964 pkgmgrinfo_appinfo_h handle;
1965 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1966 if (ret != PMINFO_R_OK)
1968 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
1969 if (ret != PMINFO_R_OK) {
1970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1973 printf("app id: %s\n", app_id);
1974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1979 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
1982 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
1983 * @brief This API gets the package name of the application
1985 * @par This API is for package-manager client application
1986 * @par Sync (or) Async : Synchronous API
1988 * @param[in] handle pointer to the application info handle.
1989 * @param[out] pkg_name pointer to hold package name
1990 * @return 0 if success, error code(<0) if fail
1991 * @retval PMINFO_R_OK success
1992 * @retval PMINFO_R_EINVAL invalid argument
1993 * @retval PMINFO_R_ERROR internal error
1994 * @pre pkgmgrinfo_appinfo_get_appinfo()
1995 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1996 * @see pkgmgrinfo_appinfo_get_appid()
1997 * @see pkgmgrinfo_appinfo_is_multiple()
1999 static int get_app_pkgname(const char *appid)
2002 char *pkgname = NULL;
2003 pkgmgrinfo_appinfo_h handle;
2004 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2005 if (ret != PMINFO_R_OK)
2007 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2008 if (ret != PMINFO_R_OK) {
2009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2012 printf("pkg name: %s\n", pkgname);
2013 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2018 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2021 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2022 * @brief This API gets the package id of the application
2024 * @par This API is for package-manager client application
2025 * @par Sync (or) Async : Synchronous API
2027 * @param[in] handle pointer to the application info handle.
2028 * @param[out] pkgid pointer to hold package id
2029 * @return 0 if success, error code(<0) if fail
2030 * @retval PMINFO_R_OK success
2031 * @retval PMINFO_R_EINVAL invalid argument
2032 * @retval PMINFO_R_ERROR internal error
2033 * @pre pkgmgrinfo_appinfo_get_appinfo()
2034 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2035 * @see pkgmgrinfo_appinfo_get_appid()
2036 * @see pkgmgrinfo_appinfo_is_multiple()
2038 static int get_app_pkgid(const char *appid)
2042 pkgmgrinfo_appinfo_h handle;
2043 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2044 if (ret != PMINFO_R_OK)
2046 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2047 if (ret != PMINFO_R_OK) {
2048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2051 printf("pkg id: %s\n", pkgid);
2052 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2057 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2060 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2061 * @brief This API gets the executable name of the application
2063 * @par This API is for package-manager client application
2064 * @par Sync (or) Async : Synchronous API
2066 * @param[in] handle pointer to the application info handle.
2067 * @param[out] exec pointer to hold app exec name
2068 * @return 0 if success, error code(<0) if fail
2069 * @retval PMINFO_R_OK success
2070 * @retval PMINFO_R_EINVAL invalid argument
2071 * @retval PMINFO_R_ERROR internal error
2072 * @pre pkgmgrinfo_appinfo_get_appinfo()
2073 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2074 * @see pkgmgrinfo_appinfo_get_appid()
2075 * @see pkgmgrinfo_appinfo_is_multiple()
2077 static int get_app_exec(const char *appid)
2081 pkgmgrinfo_appinfo_h handle;
2082 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2083 if (ret != PMINFO_R_OK)
2085 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2086 if (ret != PMINFO_R_OK) {
2087 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2090 printf("exec name: %s\n", exec);
2091 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2096 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2099 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2100 * @brief This API gets the icon name of the application
2102 * @par This API is for package-manager client application
2103 * @par Sync (or) Async : Synchronous API
2105 * @param[in] handle pointer to the application info handle.
2106 * @param[out] icon pointer to hold app icon name
2107 * @return 0 if success, error code(<0) if fail
2108 * @retval PMINFO_R_OK success
2109 * @retval PMINFO_R_EINVAL invalid argument
2110 * @retval PMINFO_R_ERROR internal error
2111 * @pre pkgmgrinfo_appinfo_get_appinfo()
2112 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2113 * @see pkgmgrinfo_appinfo_get_appid()
2114 * @see pkgmgrinfo_appinfo_is_multiple()
2116 static int get_app_icon(const char *appid)
2120 pkgmgrinfo_appinfo_h handle;
2121 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2122 if (ret != PMINFO_R_OK)
2124 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2125 if (ret != PMINFO_R_OK) {
2126 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2129 printf("icon name: %s\n", icon);
2130 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2135 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2138 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2139 * @brief This API gets the label of the application
2141 * @par This API is for package-manager client application
2142 * @par Sync (or) Async : Synchronous API
2144 * @param[in] handle pointer to the application info handle.
2145 * @param[out] label pointer to hold app label
2146 * @return 0 if success, error code(<0) if fail
2147 * @retval PMINFO_R_OK success
2148 * @retval PMINFO_R_EINVAL invalid argument
2149 * @retval PMINFO_R_ERROR internal error
2150 * @pre pkgmgrinfo_appinfo_get_appinfo()
2151 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2152 * @see pkgmgrinfo_appinfo_get_appid()
2153 * @see pkgmgrinfo_appinfo_is_multiple()
2155 static int get_app_label(const char *appid)
2159 pkgmgrinfo_appinfo_h handle;
2160 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2161 if (ret != PMINFO_R_OK)
2163 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2164 if (ret != PMINFO_R_OK) {
2165 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2168 printf("label : %s\n", label);
2169 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2174 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2177 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2178 * @brief This API gets the component of the application
2180 * @par This API is for package-manager client application
2181 * @par Sync (or) Async : Synchronous API
2183 * @param[in] handle pointer to the application info handle.
2184 * @param[out] component pointer to hold app component
2185 * @return 0 if success, error code(<0) if fail
2186 * @retval PMINFO_R_OK success
2187 * @retval PMINFO_R_EINVAL invalid argument
2188 * @retval PMINFO_R_ERROR internal error
2189 * @pre pkgmgrinfo_appinfo_get_appinfo()
2190 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2191 * @see pkgmgrinfo_appinfo_get_appid()
2192 * @see pkgmgrinfo_appinfo_is_multiple()
2194 static int get_app_component(const char *appid)
2197 pkgmgrinfo_app_component component;
2198 pkgmgrinfo_appinfo_h handle;
2199 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2200 if (ret != PMINFO_R_OK)
2202 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2203 if (ret != PMINFO_R_OK) {
2204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2207 printf("component : %s\n", component);
2208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2213 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2216 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2217 * @brief This API gets the apptype of the application
2219 * @par This API is for package-manager client application
2220 * @par Sync (or) Async : Synchronous API
2222 * @param[in] handle pointer to the application info handle.
2223 * @param[out] app_type pointer to hold apptype
2224 * @return 0 if success, error code(<0) if fail
2225 * @retval PMINFO_R_OK success
2226 * @retval PMINFO_R_EINVAL invalid argument
2227 * @retval PMINFO_R_ERROR internal error
2228 * @pre pkgmgrinfo_appinfo_get_appinfo()
2229 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2230 * @see pkgmgrinfo_appinfo_get_appid()
2231 * @see pkgmgrinfo_appinfo_is_multiple()
2233 static int get_app_type(const char *appid)
2236 char *apptype = NULL;
2237 pkgmgrinfo_appinfo_h handle;
2238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2239 if (ret != PMINFO_R_OK)
2241 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2242 if (ret != PMINFO_R_OK) {
2243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2246 printf("apptype : %s\n", apptype);
2247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2252 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2255 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2256 int *operation_count, char ***operation)
2257 * @brief This API gets the list of operation of the application
2259 * @par This API is for package-manager client application
2260 * @par Sync (or) Async : Synchronous API
2262 * @param[in] handle pointer to the appcontrol handle.
2263 * @param[out] operation_count pointer to hold number of operations
2264 * @param[out] operation pointer to hold list of operations
2265 * @return 0 if success, error code(<0) if fail
2266 * @retval PMINFO_R_OK success
2267 * @retval PMINFO_R_EINVAL invalid argument
2268 * @retval PMINFO_R_ERROR internal error
2269 * @pre pkgmgrinfo_appinfo_get_appinfo()
2270 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2271 * @see pkgmgrinfo_appinfo_get_uri()
2272 * @see pkgmgrinfo_appinfo_get_mime()
2274 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2279 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2280 for (i = 0; i < oc; i++) {
2281 if (strcmp(operation[i], (char *)user_data) == 0)
2288 static int check_operation(const char *appid, char *operation)
2291 pkgmgrinfo_appinfo_h handle;
2292 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2293 if (ret != PMINFO_R_OK)
2295 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2296 if (ret != PMINFO_R_OK) {
2297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2300 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2305 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2306 int *operation_count, char ***operation);
2309 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2310 int *uri_count, char ***uri)
2311 * @brief This API gets the list of uri of the application
2313 * @par This API is for package-manager client application
2314 * @par Sync (or) Async : Synchronous API
2316 * @param[in] handle pointer to the appcontrol handle.
2317 * @param[out] uri_count pointer to hold number of uris
2318 * @param[out] uri pointer to hold list of uris
2319 * @return 0 if success, error code(<0) if fail
2320 * @retval PMINFO_R_OK success
2321 * @retval PMINFO_R_EINVAL invalid argument
2322 * @retval PMINFO_R_ERROR internal error
2323 * @pre pkgmgrinfo_appinfo_get_appinfo()
2324 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2325 * @see pkgmgrinfo_appinfo_get_operation()
2326 * @see pkgmgrinfo_appinfo_get_mime()
2328 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2333 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2334 for (i = 0; i < uc; i++) {
2335 if (strcmp(uri[i], (char *)user_data) == 0)
2342 static int check_uri(const char *appid, char *uri)
2345 pkgmgrinfo_appinfo_h handle;
2346 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2347 if (ret != PMINFO_R_OK)
2349 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2350 if (ret != PMINFO_R_OK) {
2351 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2354 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2359 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2360 int *uri_count, char ***uri);
2363 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2364 int *mime_count, char ***mime)
2365 * @brief This API gets the list of mime of the application
2367 * @par This API is for package-manager client application
2368 * @par Sync (or) Async : Synchronous API
2370 * @param[in] handle pointer to the appcontrol handle.
2371 * @param[out] mime_count pointer to hold number of mimes
2372 * @param[out] mime pointer to hold list of mimes
2373 * @return 0 if success, error code(<0) if fail
2374 * @retval PMINFO_R_OK success
2375 * @retval PMINFO_R_EINVAL invalid argument
2376 * @retval PMINFO_R_ERROR internal error
2377 * @pre pkgmgrinfo_appinfo_get_appinfo()
2378 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2379 * @see pkgmgrinfo_appinfo_get_uri()
2380 * @see pkgmgrinfo_appinfo_get_operation()
2382 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2387 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2388 for (i = 0; i < mc; i++) {
2389 if (strcmp(mime[i], (char *)user_data) == 0)
2396 static int check_mime(const char *appid, char *mime)
2399 pkgmgrinfo_appinfo_h handle;
2400 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2401 if (ret != PMINFO_R_OK)
2403 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2404 if (ret != PMINFO_R_OK) {
2405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2408 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2413 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2414 int *mime_count, char ***mime);
2417 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2418 * @brief This API gets the notification icon of the application
2420 * @par This API is for package-manager client application
2421 * @par Sync (or) Async : Synchronous API
2423 * @param[in] handle pointer to the application info handle.
2424 * @param[out] path pointer to hold notification icon
2425 * @return 0 if success, error code(<0) if fail
2426 * @retval PMINFO_R_OK success
2427 * @retval PMINFO_R_EINVAL invalid argument
2428 * @retval PMINFO_R_ERROR internal error
2429 * @pre pkgmgrinfo_appinfo_get_appinfo()
2430 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2431 * @see pkgmgrinfo_appinfo_get_appid()
2432 * @see pkgmgrinfo_appinfo_is_multiple()
2434 static int get_app_notification_icon(const char *appid)
2437 char *notification_icon = NULL;
2438 pkgmgrinfo_appinfo_h handle;
2439 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2440 if (ret != PMINFO_R_OK)
2442 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2443 if (ret != PMINFO_R_OK) {
2444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2447 printf("notification icon : %s\n", notification_icon);
2448 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2453 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2456 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2457 * @brief This API gets the setting icon of the application
2459 * @par This API is for package-manager client application
2460 * @par Sync (or) Async : Synchronous API
2462 * @param[in] handle pointer to the application info handle.
2463 * @param[out] path pointer to hold setting icon
2464 * @return 0 if success, error code(<0) if fail
2465 * @retval PMINFO_R_OK success
2466 * @retval PMINFO_R_EINVAL invalid argument
2467 * @retval PMINFO_R_ERROR internal error
2468 * @pre pkgmgrinfo_appinfo_get_appinfo()
2469 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2470 * @see pkgmgrinfo_appinfo_get_appid()
2471 * @see pkgmgrinfo_appinfo_is_multiple()
2473 static int get_app_setting_icon(const char *appid)
2476 char *setting_icon = NULL;
2477 pkgmgrinfo_appinfo_h handle;
2478 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2479 if (ret != PMINFO_R_OK)
2481 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2482 if (ret != PMINFO_R_OK) {
2483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2486 printf("setting icon : %s\n", setting_icon);
2487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2495 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2496 * @brief This API gets the type of recent image on app-tray
2498 * @par This API is for package-manager client application
2499 * @par Sync (or) Async : Synchronous API
2501 * @param[in] handle pointer to the application info handle.
2502 * @param[out] type pointer to hold image type
2503 * @return 0 if success, error code(<0) if fail
2504 * @retval PMINFO_R_OK success
2505 * @retval PMINFO_R_EINVAL invalid argument
2506 * @retval PMINFO_R_ERROR internal error
2507 * @pre pkgmgrinfo_appinfo_get_appinfo()
2508 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2509 * @see pkgmgrinfo_appinfo_get_appid()
2510 * @see pkgmgrinfo_appinfo_is_multiple()
2512 static int get_app_recent_image_type(const char *appid)
2515 pkgmgrinfo_app_recentimage type;
2516 pkgmgrinfo_appinfo_h handle;
2517 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2518 if (ret != PMINFO_R_OK)
2520 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2521 if (ret != PMINFO_R_OK) {
2522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2525 printf("recent image type: %d\n", type);
2526 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2531 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2535 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2536 * @brief This API gets the preview image of application
2538 * @par Sync (or) Async : Synchronous API
2540 * @param[in] handle pointer to the application info handle.
2541 * @param[out] preview_img pointer to hold preview image path
2542 * @return 0 if success, error code(<0) if fail
2543 * @retval PMINFO_R_OK success
2544 * @retval PMINFO_R_EINVAL invalid argument
2545 * @retval PMINFO_R_ERROR internal error
2546 * @pre pkgmgrinfo_appinfo_get_appinfo()
2547 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2548 * @see pkgmgrinfo_appinfo_get_appid()
2550 static int get_app_previewimage(const char *appid)
2553 char *preview = NULL;
2554 pkgmgrinfo_appinfo_h handle = NULL;
2555 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2556 if (ret != PMINFO_R_OK)
2558 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2559 if (ret != PMINFO_R_OK) {
2560 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2563 printf("preview image path : %s\n", preview);
2564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2569 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2573 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2574 * @brief This API gets the package permission type of the application
2576 * @par This API is for package-manager client application
2577 * @par Sync (or) Async : Synchronous API
2579 * @param[in] handle pointer to the application info handle.
2580 * @param[out] permission pointer to hold package permission
2581 * @return 0 if success, error code(<0) if fail
2582 * @retval PMINFO_R_OK success
2583 * @retval PMINFO_R_EINVAL invalid argument
2584 * @retval PMINFO_R_ERROR internal error
2585 * @pre pkgmgrinfo_appinfo_get_appinfo()
2586 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2587 * @see pkgmgrinfo_appinfo_get_appid()
2589 static int get_app_permission(const char *appid)
2592 pkgmgrinfo_permission_type permission = 0;
2593 pkgmgrinfo_appinfo_h handle;
2595 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2596 if (ret != PMINFO_R_OK)
2598 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2599 if (ret != PMINFO_R_OK) {
2600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2603 printf("permission type: %d\n", permission);
2604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2609 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2612 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2613 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2614 * @brief This API gets the list of category for a particular application
2616 * @par This API is for package-manager client application
2617 * @par Sync (or) Async : Synchronous API
2618 * @param[in] handle pointer to the application info handle.
2619 * @param[in] category_func callback function for list
2620 * @param[in] user_data user data to be passed to callback function
2621 * @return 0 if success, error code(<0) if fail
2622 * @retval PMINFO_R_OK success
2623 * @retval PMINFO_R_EINVAL invalid argument
2624 * @retval PMINFO_R_ERROR internal error
2625 * @pre pkgmgrinfo_appinfo_get_appinfo()
2626 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2628 int category_func(const char *name, void *user_data)
2630 if (strcmp(name, (char *)user_data) == 0)
2636 static int list_category(const char *appid, char *category)
2639 pkgmgrinfo_appinfo_h handle;
2640 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2641 if (ret != PMINFO_R_OK)
2643 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2644 if (ret != PMINFO_R_OK) {
2645 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2653 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2654 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2657 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2658 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2659 * @brief This API gets the list of metadata for a particular application
2661 * @par This API is for package-manager client application
2662 * @par Sync (or) Async : Synchronous API
2663 * @param[in] handle pointer to the application info handle.
2664 * @param[in] metadata_func callback function for list
2665 * @param[in] user_data user data to be passed to callback function
2666 * @return 0 if success, error code(<0) if fail
2667 * @retval PMINFO_R_OK success
2668 * @retval PMINFO_R_EINVAL invalid argument
2669 * @retval PMINFO_R_ERROR internal error
2670 * @pre pkgmgrinfo_appinfo_get_appinfo()
2671 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2673 int metadata_func(const char *name, const char *value, void *user_data)
2675 if (strcmp(name, (char *)user_data) == 0) {
2676 printf("Value is %s\n", value);
2683 static int list_metadata(const char *appid, char *name)
2686 pkgmgrinfo_appinfo_h handle;
2687 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2688 if (ret != PMINFO_R_OK)
2690 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)name);
2691 if (ret != PMINFO_R_OK) {
2692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2700 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2701 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2705 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2706 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2707 * @brief This API gets the list of app-control for a particular application
2709 * @par This API is for package-manager client application
2710 * @par Sync (or) Async : Synchronous API
2711 * @param[in] handle pointer to the application info handle.
2712 * @param[in] appcontrol_func callback function for list
2713 * @param[in] user_data user data to be passed to callback function
2714 * @return 0 if success, error code(<0) if fail
2715 * @retval PMINFO_R_OK success
2716 * @retval PMINFO_R_EINVAL invalid argument
2717 * @retval PMINFO_R_ERROR internal error
2718 * @pre pkgmgrinfo_appinfo_get_appinfo()
2719 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2721 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2726 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2727 for (i = 0; i < oc; i++) {
2728 if (strcmp(operation[i], (char *)user_data) == 0)
2735 static int check_operation(const char *appid, char *operation)
2738 pkgmgrinfo_appinfo_h handle;
2739 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2740 if (ret != PMINFO_R_OK)
2742 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2743 if (ret != PMINFO_R_OK) {
2744 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2747 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2752 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2753 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2756 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2757 * @brief This API gets the application 'nodisplay' value from the app ID
2759 * @par This API is for package-manager client application
2760 * @par Sync (or) Async : Synchronous API
2762 * @param[in] handle pointer to application info handle
2763 * @param[out] nodisplay pointer to hold package nodisplay value
2764 * @return 0 if success, error code(<0) if fail
2765 * @retval PMINFO_R_OK success
2766 * @retval PMINFO_R_EINVAL invalid argument
2767 * @retval PMINFO_R_ERROR internal error
2768 * @pre pkgmgrinfo_appinfo_get_appinfo()
2769 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2770 * @see pkgmgrinfo_appinfo_get_appid()
2771 * @see pkgmgrinfo_appinfo_is_multiple()
2773 static int get_app_nodisplay(const char *appid)
2777 pkgmgrinfo_appinfo_h handle;
2778 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2779 if (ret != PMINFO_R_OK)
2781 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2782 if (ret != PMINFO_R_OK) {
2783 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2786 printf("app nodisplay: %d\n", nodisplay);
2787 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2792 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2795 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2796 * @brief This API gets the application 'multiple' value from the app ID
2798 * @par This API is for package-manager client application
2799 * @par Sync (or) Async : Synchronous API
2801 * @param[in] handle pointer to application info handle
2802 * @param[out] multiple pointer to hold package multiple value
2803 * @return 0 if success, error code(<0) if fail
2804 * @retval PMINFO_R_OK success
2805 * @retval PMINFO_R_EINVAL invalid argument
2806 * @retval PMINFO_R_ERROR internal error
2807 * @pre pkgmgrinfo_appinfo_get_appinfo()
2808 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2809 * @see pkgmgrinfo_appinfo_get_appid()
2810 * @see pkgmgrinfo_appinfo_is_nodisplay()
2812 static int get_app_multiple(const char *appid)
2816 pkgmgrinfo_appinfo_h handle;
2817 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2818 if (ret != PMINFO_R_OK)
2820 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2821 if (ret != PMINFO_R_OK) {
2822 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2825 printf("app multiple: %d\n", multiple);
2826 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2831 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2834 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
2835 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
2836 * application launching effect. If fales, indicator will be hidden during application launching effect
2838 * @par This API is for package-manager client application
2839 * @par Sync (or) Async : Synchronous API
2841 * @param[in] handle pointer to application info handle
2842 * @param[out] indicator_disp contains indicator display status for application launching effect
2843 * @return 0 if success, error code(<0) if fail
2844 * @retval PMINFO_R_OK success
2845 * @retval PMINFO_R_EINVAL invalid argument
2846 * @retval PMINFO_R_ERROR internal error
2847 * @pre pkgmgrinfo_appinfo_get_appinfo()
2848 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2849 * @see pkgmgrinfo_appinfo_get_appid()
2850 * @see pkgmgrinfo_appinfo_is_nodisplay()
2852 static int get_app_indicator_display(const char *appid)
2855 bool indicator_disp;
2856 pkgmgrinfo_appinfo_h handle;
2857 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2858 if (ret != PMINFO_R_OK)
2860 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
2861 if (ret != PMINFO_R_OK){
2862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2865 printf("app indicator disp : %d\n", indicator_disp);
2866 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2871 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
2874 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2875 * @brief This API gets the application's landscape & portrait effect images
2877 * @par This API is for package-manager client application
2878 * @par Sync (or) Async : Synchronous API
2880 * @param[in] handle pointer to application info handle
2881 * @param[out] portrait_img contains portrait mode effect image
2882 * @param[out] landscape_img contains landscape mode effect image
2883 * @return 0 if success, error code(<0) if fail
2884 * @retval PMINFO_R_OK success
2885 * @retval PMINFO_R_EINVAL invalid argument
2886 * @retval PMINFO_R_ERROR internal error
2887 * @pre pkgmgrinfo_appinfo_get_appinfo()
2888 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2889 * @see pkgmgrinfo_appinfo_get_appid()
2890 * @see pkgmgrinfo_appinfo_is_nodisplay()
2892 static int get_app_effectimages(const char *appid)
2895 char *portraitimg = NULL;
2896 char *landscapeimg = NULL;
2897 pkgmgrinfo_appinfo_h handle;
2898 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2899 if (ret != PMINFO_R_OK)
2901 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2902 if (ret != PMINFO_R_OK) {
2903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2906 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2912 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
2915 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
2916 * @brief This API gets the application 'taskmanage' value from the app ID
2918 * @par This API is for package-manager client application
2919 * @par Sync (or) Async : Synchronous API
2921 * @param[in] handle pointer to application info handle
2922 * @param[out] taskmanage pointer to hold package taskmanage value
2923 * @return 0 if success, error code(<0) if fail
2924 * @retval PMINFO_R_OK success
2925 * @retval PMINFO_R_EINVAL invalid argument
2926 * @retval PMINFO_R_ERROR internal error
2927 * @pre pkgmgrinfo_appinfo_get_appinfo()
2928 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2929 * @see pkgmgrinfo_appinfo_get_appid()
2930 * @see pkgmgrinfo_appinfo_is_multiple()
2932 static int get_app_taskmanage(const char *appid)
2936 pkgmgrinfo_appinfo_h handle;
2937 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2938 if (ret != PMINFO_R_OK)
2940 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
2941 if (ret != PMINFO_R_OK) {
2942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2945 printf("app taskmanage: %d\n", taskmanage);
2946 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2951 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
2954 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
2955 * @brief This API gets the application 'taskmanage' value from the app ID
2957 * @par This API is for package-manager client application
2958 * @par Sync (or) Async : Synchronous API
2960 * @param[in] handle pointer to application info handle
2961 * @param[out] enabled pointer to hold package enabled value
2962 * @return 0 if success, error code(<0) if fail
2963 * @retval PMINFO_R_OK success
2964 * @retval PMINFO_R_EINVAL invalid argument
2965 * @retval PMINFO_R_ERROR internal error
2966 * @pre pkgmgrinfo_appinfo_get_appinfo()
2967 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2968 * @see pkgmgrinfo_appinfo_get_appid()
2969 * @see pkgmgrinfo_appinfo_is_multiple()
2971 static int get_app_enabled(const char *appid)
2975 pkgmgrinfo_appinfo_h handle;
2976 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2977 if (ret != PMINFO_R_OK)
2979 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
2980 if (ret != PMINFO_R_OK) {
2981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2984 printf("app enabled: %d\n", enabled);
2985 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2990 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
2993 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2994 * @brief This API gets the application 'hwacceleration' value from the app ID
2996 * @par This API is for package-manager client application
2997 * @par Sync (or) Async : Synchronous API
2999 * @param[in] handle pointer to application info handle
3000 * @param[out] hwacceleration pointer to hold package hwacceleration value
3001 * @return 0 if success, error code(<0) if fail
3002 * @retval PMINFO_R_OK success
3003 * @retval PMINFO_R_EINVAL invalid argument
3004 * @retval PMINFO_R_ERROR internal error
3005 * @pre pkgmgrinfo_appinfo_get_appinfo()
3006 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3007 * @see pkgmgrinfo_appinfo_get_appid()
3008 * @see pkgmgrinfo_appinfo_is_multiple()
3010 static int get_app_hwacceleration(const char *appid)
3013 pkgmgrinfo_app_hwacceleration hwacceleration;
3014 pkgmgrinfo_appinfo_h handle;
3015 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3016 if (ret != PMINFO_R_OK)
3018 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3019 if (ret != PMINFO_R_OK) {
3020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3023 printf("app hwacceleration: %d\n", hwacceleration);
3024 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3029 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3032 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3033 * @brief This API gets the application 'onboot' value from the app ID
3035 * @par This API is for package-manager client application
3036 * @par Sync (or) Async : Synchronous API
3038 * @param[in] handle pointer to application info handle
3039 * @param[out] onboot pointer to hold package onboot value
3040 * @return 0 if success, error code(<0) if fail
3041 * @retval PMINFO_R_OK success
3042 * @retval PMINFO_R_EINVAL invalid argument
3043 * @retval PMINFO_R_ERROR internal error
3044 * @pre pkgmgrinfo_appinfo_get_appinfo()
3045 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3046 * @see pkgmgrinfo_appinfo_get_appid()
3047 * @see pkgmgrinfo_appinfo_is_multiple()
3049 static int get_app_onboot(const char *appid)
3053 pkgmgrinfo_appinfo_h handle;
3054 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3055 if (ret != PMINFO_R_OK)
3057 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3058 if (ret != PMINFO_R_OK) {
3059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3062 printf("app onboot: %d\n", onboot);
3063 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3068 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3071 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3072 * @brief This API gets the application 'autorestart' value from the app ID
3074 * @par This API is for package-manager client application
3075 * @par Sync (or) Async : Synchronous API
3077 * @param[in] handle pointer to application info handle
3078 * @param[out] autorestart pointer to hold package autorestart value
3079 * @return 0 if success, error code(<0) if fail
3080 * @retval PMINFO_R_OK success
3081 * @retval PMINFO_R_EINVAL invalid argument
3082 * @retval PMINFO_R_ERROR internal error
3083 * @pre pkgmgrinfo_appinfo_get_appinfo()
3084 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3085 * @see pkgmgrinfo_appinfo_get_appid()
3086 * @see pkgmgrinfo_appinfo_is_multiple()
3088 static int get_app_autorestart(const char *appid)
3092 pkgmgrinfo_appinfo_h handle;
3093 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3094 if (ret != PMINFO_R_OK)
3096 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3097 if (ret != PMINFO_R_OK) {
3098 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3101 printf("app autorestart: %d\n", autorestart);
3102 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3107 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3110 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3111 * @brief This API gets the value for given application is main app or not from handle
3113 * @par This API is for package-manager client application
3114 * @par Sync (or) Async : Synchronous API
3116 * @param[in] handle pointer to application info handle
3117 * @param[out] mainapp pointer to hold package mainapp is or not
3118 * @return 0 if success, error code(<0) if fail
3119 * @retval PMINFO_R_OK success
3120 * @retval PMINFO_R_EINVAL invalid argument
3121 * @retval PMINFO_R_ERROR internal error
3122 * @pre pkgmgrinfo_appinfo_get_appinfo()
3123 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3124 * @see pkgmgrinfo_appinfo_get_appid()
3125 * @see pkgmgrinfo_appinfo_is_multiple()
3127 static int get_app_mainapp(const char *appid)
3131 pkgmgrinfo_appinfo_h handle;
3132 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3133 if (ret != PMINFO_R_OK)
3135 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3136 if (ret != PMINFO_R_OK) {
3137 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3140 printf("mainapp: %d\n", mainapp);
3141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3146 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3149 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3150 * @brief This API destroys the application information handle freeing up all the resources
3152 * @par This API is for package-manager client application
3153 * @par Sync (or) Async : Synchronous API
3155 * @param[in] handle pointer to the application info handle.
3156 * @return 0 if success, error code(<0) if fail
3157 * @retval PMINFO_R_OK success
3158 * @retval PMINFO_R_EINVAL invalid argument
3159 * @retval PMINFO_R_ERROR internal error
3160 * @pre pkgmgrinfo_appinfo_get_appinfo()
3162 * @see pkgmgrinfo_appinfo_get_pkgid()
3163 * @see pkgmgrinfo_appinfo_is_multiple()
3165 static int get_app_type(const char *appid)
3169 pkgmgrinfo_appinfo_h handle;
3170 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3171 if (ret != PMINFO_R_OK)
3173 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3174 if (ret != PMINFO_R_OK) {
3175 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3178 printf("apptype: %s\n", type);
3179 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3184 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3187 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3188 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3189 The query will search the entire application information collected from the manifest file of all the installed packages
3191 * @par This API is for package-manager client application
3192 * @par Sync (or) Async : Synchronous API
3194 * @param[out] handle pointer to the application info filter handle.
3195 * @return 0 if success, error code(<0) if fail
3196 * @retval PMINFO_R_OK success
3197 * @retval PMINFO_R_EINVAL invalid argument
3198 * @retval PMINFO_R_ERROR internal error
3200 * @post pkgmgrinfo_appinfo_filter_destroy()
3201 * @see pkgmgrinfo_appinfo_filter_count()
3202 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3204 static int get_capp_count()
3208 pkgmgrinfo_appinfo_filter_h handle;
3209 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3210 if (ret != PMINFO_R_OK)
3212 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3213 if (ret != PMINFO_R_OK) {
3214 pkgmgrinfo_appinfo_filter_destroy(handle);
3217 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3218 if (ret != PMINFO_R_OK) {
3219 pkgmgrinfo_appinfo_filter_destroy(handle);
3222 printf("No of capp: %d\n", count);
3223 pkgmgrinfo_appinfo_filter_destroy(handle);
3228 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3231 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3232 * @brief This API destroys the application information filter handle freeing up all the resources
3234 * @par This API is for package-manager client application
3235 * @par Sync (or) Async : Synchronous API
3237 * @param[in] handle pointer to the application info filter handle.
3238 * @return 0 if success, error code(<0) if fail
3239 * @retval PMINFO_R_OK success
3240 * @retval PMINFO_R_EINVAL invalid argument
3241 * @retval PMINFO_R_ERROR internal error
3242 * @pre pkgmgrinfo_appinfo_filter_create()
3244 * @see pkgmgrinfo_appinfo_filter_count()
3245 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3247 static int get_capp_count()
3251 pkgmgrinfo_appinfo_filter_h handle;
3252 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3253 if (ret != PMINFO_R_OK)
3255 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3256 if (ret != PMINFO_R_OK) {
3257 pkgmgrinfo_appinfo_filter_destroy(handle);
3260 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3261 if (ret != PMINFO_R_OK) {
3262 pkgmgrinfo_appinfo_filter_destroy(handle);
3265 printf("No of capp: %d\n", count);
3266 pkgmgrinfo_appinfo_filter_destroy(handle);
3271 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3274 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3275 * @brief This API adds a boolean filter property to the filter handle
3277 * @par This API is for package-manager client application
3278 * @par Sync (or) Async : Synchronous API
3280 * @param[in] handle pointer to the application info filter handle.
3281 * @param[in] property boolean property name.
3282 * @param[in] value value corresponding to the property.
3283 * @return 0 if success, error code(<0) if fail
3284 * @retval PMINFO_R_OK success
3285 * @retval PMINFO_R_EINVAL invalid argument
3286 * @retval PMINFO_R_ERROR internal error
3287 * @pre pkgmgrinfo_appinfo_filter_create()
3288 * @post pkgmgrinfo_appinfo_filter_destroy()
3289 * @see pkgmgrinfo_appinfo_filter_count()
3290 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3292 static int get_taskmanageable_app_count()
3296 pkgmgrinfo_appinfo_filter_h handle;
3297 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3298 if (ret != PMINFO_R_OK)
3300 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3301 if (ret != PMINFO_R_OK) {
3302 pkgmgrinfo_appinfo_filter_destroy(handle);
3305 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3306 if (ret != PMINFO_R_OK) {
3307 pkgmgrinfo_appinfo_filter_destroy(handle);
3310 printf("No of taskmanageable apps: %d\n", count);
3311 pkgmgrinfo_appinfo_filter_destroy(handle);
3316 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3317 const char *property, const bool value);
3320 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3321 * @brief This API adds an integer filter property to the filter handle
3323 * @par This API is for package-manager client application
3324 * @par Sync (or) Async : Synchronous API
3326 * @param[in] handle pointer to the application info filter handle.
3327 * @param[in] property integer property name.
3328 * @param[in] value value corresponding to the property.
3329 * @return 0 if success, error code(<0) if fail
3330 * @retval PMINFO_R_OK success
3331 * @retval PMINFO_R_EINVAL invalid argument
3332 * @retval PMINFO_R_ERROR internal error
3333 * @pre pkgmgrinfo_appinfo_filter_create()
3334 * @post pkgmgrinfo_appinfo_filter_destroy()
3335 * @see pkgmgrinfo_appinfo_filter_count()
3336 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3338 static int get_taskmanageable_app_count()
3342 pkgmgrinfo_appinfo_filter_h handle;
3343 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3344 if (ret != PMINFO_R_OK)
3346 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3347 if (ret != PMINFO_R_OK) {
3348 pkgmgrinfo_appinfo_filter_destroy(handle);
3351 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3352 if (ret != PMINFO_R_OK) {
3353 pkgmgrinfo_appinfo_filter_destroy(handle);
3356 printf("No of apps: %d\n", count);
3357 pkgmgrinfo_appinfo_filter_destroy(handle);
3362 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3363 const char *property, const int value);
3366 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3367 * @brief This API adds a string filter property to the filter handle
3369 * @par This API is for package-manager client application
3370 * @par Sync (or) Async : Synchronous API
3372 * @param[in] handle pointer to the application info filter handle.
3373 * @param[in] property string property name.
3374 * @param[in] value value corresponding to the property.
3375 * @return 0 if success, error code(<0) if fail
3376 * @retval PMINFO_R_OK success
3377 * @retval PMINFO_R_EINVAL invalid argument
3378 * @retval PMINFO_R_ERROR internal error
3379 * @pre pkgmgrinfo_appinfo_filter_create()
3380 * @post pkgmgrinfo_appinfo_filter_destroy()
3381 * @see pkgmgrinfo_appinfo_filter_count()
3382 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3384 static int get_capp_count()
3388 pkgmgrinfo_appinfo_filter_h handle;
3389 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3390 if (ret != PMINFO_R_OK)
3392 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3393 if (ret != PMINFO_R_OK) {
3394 pkgmgrinfo_appinfo_filter_destroy(handle);
3397 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3398 if (ret != PMINFO_R_OK) {
3399 pkgmgrinfo_appinfo_filter_destroy(handle);
3402 printf("No of capp: %d\n", count);
3403 pkgmgrinfo_appinfo_filter_destroy(handle);
3408 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3409 const char *property, const char *value);
3412 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3413 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3415 * @par This API is for package-manager client application
3416 * @par Sync (or) Async : Synchronous API
3418 * @param[in] handle pointer to the application info filter handle.
3419 * @param[in] app_cb callback function.
3420 * @param[in] user_data user data to be passed to the callback function
3421 * @return 0 if success, error code(<0) if fail
3422 * @retval PMINFO_R_OK success
3423 * @retval PMINFO_R_EINVAL invalid argument
3424 * @retval PMINFO_R_ERROR internal error
3425 * @pre pkgmgrinfo_appinfo_filter_create()
3426 * @post pkgmgrinfo_appinfo_filter_destroy()
3427 * @see pkgmgrinfo_appinfo_filter_count()
3429 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3432 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3433 printf("appid : %s\n", appid);
3437 static int get_capp_list()
3440 pkgmgrinfo_appinfo_filter_h handle;
3441 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3442 if (ret != PMINFO_R_OK)
3444 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3445 if (ret != PMINFO_R_OK) {
3446 pkgmgrinfo_appinfo_filter_destroy(handle);
3449 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3450 if (ret != PMINFO_R_OK) {
3451 pkgmgrinfo_appinfo_filter_destroy(handle);
3454 pkgmgrinfo_appinfo_filter_destroy(handle);
3459 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3460 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3463 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3464 * @brief This API counts the application that satisfy the filter conditions
3466 * @par This API is for package-manager client application
3467 * @par Sync (or) Async : Synchronous API
3469 * @param[in] handle pointer to the application info filter handle.
3470 * @param[in] count pointer to store count value
3471 * @return 0 if success, error code(<0) if fail
3472 * @retval PMINFO_R_OK success
3473 * @retval PMINFO_R_EINVAL invalid argument
3474 * @retval PMINFO_R_ERROR internal error
3475 * @pre pkgmgrinfo_appinfo_filter_create()
3476 * @post pkgmgrinfo_appinfo_filter_destroy()
3477 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3479 static int get_capp_count()
3483 pkgmgrinfo_appinfo_filter_h handle;
3484 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3485 if (ret != PMINFO_R_OK)
3487 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3488 if (ret != PMINFO_R_OK) {
3489 pkgmgrinfo_appinfo_filter_destroy(handle);
3492 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3493 if (ret != PMINFO_R_OK) {
3494 pkgmgrinfo_appinfo_filter_destroy(handle);
3497 printf("No of capp: %d\n", count);
3498 pkgmgrinfo_appinfo_filter_destroy(handle);
3503 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3506 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3507 * @brief This API creates the package cert information handle to get data from db.
3509 * @par This API is for package-manager client application
3510 * @par Sync (or) Async : Synchronous API
3512 * @param[out] handle pointer to the package cert handle.
3513 * @return 0 if success, error code(<0) if fail
3514 * @retval PMINFO_R_OK success
3515 * @retval PMINFO_R_EINVAL invalid argument
3516 * @retval PMINFO_R_ERROR internal error
3518 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3519 * @see pkgmgrinfo_pkginfo_get_cert_value()
3520 * @see pkgmgrinfo_pkginfo_load_certinfo()
3522 static int get_cert_info(const char *pkgid)
3525 pkgmgrinfo_certinfo_h handle;
3526 char *auth_cert = NULL;
3527 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3528 if (ret != PMINFO_R_OK)
3530 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3531 if (ret != PMINFO_R_OK) {
3532 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3535 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3536 if (ret != PMINFO_R_OK) {
3537 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3540 printf("Author root certificate: %s\n", auth_root);
3541 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3546 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3549 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3550 * @brief This API loads the package cert information handle with data from db.
3552 * @par This API is for package-manager client application
3553 * @par Sync (or) Async : Synchronous API
3555 * @param[in] pkgid pointer to the package ID.
3556 * @param[in] handle pointer to the package cert handle.
3557 * @return 0 if success, error code(<0) if fail
3558 * @retval PMINFO_R_OK success
3559 * @retval PMINFO_R_EINVAL invalid argument
3560 * @retval PMINFO_R_ERROR internal error
3561 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3562 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3563 * @see pkgmgrinfo_pkginfo_get_cert_value()
3565 static int get_cert_info(const char *pkgid)
3568 pkgmgrinfo_certinfo_h handle;
3569 char *auth_cert = NULL;
3570 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3571 if (ret != PMINFO_R_OK)
3573 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3574 if (ret != PMINFO_R_OK) {
3575 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3578 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3579 if (ret != PMINFO_R_OK) {
3580 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3583 printf("Author root certificate: %s\n", auth_root);
3584 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3589 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3592 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3593 * @brief This API gets the package cert information from the handle
3595 * @par This API is for package-manager client application
3596 * @par Sync (or) Async : Synchronous API
3598 * @param[in] handle pointer to the package cert handle.
3599 * @param[in] cert_type certificate type
3600 * @param[out] cert_value pointer to hold certificate value
3601 * @return 0 if success, error code(<0) if fail
3602 * @retval PMINFO_R_OK success
3603 * @retval PMINFO_R_EINVAL invalid argument
3604 * @retval PMINFO_R_ERROR internal error
3605 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3606 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3607 * @see pkgmgrinfo_pkginfo_load_certinfo()
3609 static int get_cert_info(const char *pkgid)
3612 pkgmgrinfo_certinfo_h handle;
3613 char *auth_cert = NULL;
3614 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3615 if (ret != PMINFO_R_OK)
3617 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3618 if (ret != PMINFO_R_OK) {
3619 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3622 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3623 if (ret != PMINFO_R_OK) {
3624 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3627 printf("Author root certificate: %s\n", auth_root);
3628 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3633 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3636 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3637 * @brief This API destroys the package cert information handle freeing up all the resources
3639 * @par This API is for package-manager client application
3640 * @par Sync (or) Async : Synchronous API
3642 * @param[in] handle pointer to the package cert handle.
3643 * @return 0 if success, error code(<0) if fail
3644 * @retval PMINFO_R_OK success
3645 * @retval PMINFO_R_EINVAL invalid argument
3646 * @retval PMINFO_R_ERROR internal error
3647 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3649 * @see pkgmgrinfo_pkginfo_load_certinfo()
3651 static int get_cert_info(const char *pkgid)
3654 pkgmgrinfo_certinfo_h handle;
3655 char *auth_cert = NULL;
3656 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3657 if (ret != PMINFO_R_OK)
3659 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3660 if (ret != PMINFO_R_OK) {
3661 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3664 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3665 if (ret != PMINFO_R_OK) {
3666 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3669 printf("Author root certificate: %s\n", auth_root);
3670 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3675 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
3678 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
3679 * @brief This API deletes the package cert information from DB
3681 * @par This API is for package-manager client application
3682 * @par Sync (or) Async : Synchronous API
3684 * @param[in] pkgid pointer to the package ID.
3685 * @return 0 if success, error code(<0) if fail
3686 * @retval PMINFO_R_OK success
3687 * @retval PMINFO_R_EINVAL invalid argument
3688 * @retval PMINFO_R_ERROR internal error
3692 static int delete_cert_info(const char *pkgid)
3695 ret = pkgmgrinfo_delete_certinfo(pkgid);
3696 if (ret != PMINFO_R_OK)
3702 int pkgmgrinfo_delete_certinfo(const char *pkgid);
3705 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
3706 * @brief This API creates the package db information handle to set data in db.
3708 * @par This API is for package-manager client application
3709 * @par Sync (or) Async : Synchronous API
3711 * @param[in] pkgid pointer to the package ID.
3712 * @param[out] handle pointer to the package db info handle.
3713 * @return 0 if success, error code(<0) if fail
3714 * @retval PMINFO_R_OK success
3715 * @retval PMINFO_R_EINVAL invalid argument
3716 * @retval PMINFO_R_ERROR internal error
3718 * @post pkgmgrinfo_destroy_pkgdbinfo()
3719 * @see pkgmgrinfo_save_pkgdbinfo()
3720 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3722 static int set_pkg_in_db(const char *pkgid)
3725 pkgmgrinfo_pkgdbinfo_h handle;
3726 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3727 if (ret != PMINFO_R_OK)
3729 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3730 if (ret != PMINFO_R_OK) {
3731 pkgmgrinfo_destroy_pkgdbinfo(handle);
3734 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3735 if (ret != PMINFO_R_OK) {
3736 pkgmgrinfo_destroy_pkgdbinfo(handle);
3739 pkgmgrinfo_destroy_pkgdbinfo(handle);
3744 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
3747 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
3748 * @brief This API sets the package type in db handle
3750 * @par This API is for package-manager client application
3751 * @par Sync (or) Async : Synchronous API
3753 * @param[in] handle pointer to the pkgdbinfo handle.
3754 * @param[in] type pointer to the package type.
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_create_pkgdbinfo()
3760 * @post pkgmgrinfo_destroy_pkgdbinfo()
3761 * @see pkgmgrinfo_save_pkgdbinfo()
3762 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
3764 static int set_pkg_type_in_db(const char *pkgid)
3767 pkgmgrinfo_pkgdbinfo_h handle;
3768 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3769 if (ret != PMINFO_R_OK)
3771 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
3772 if (ret != PMINFO_R_OK) {
3773 pkgmgrinfo_destroy_pkgdbinfo(handle);
3776 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3777 if (ret != PMINFO_R_OK) {
3778 pkgmgrinfo_destroy_pkgdbinfo(handle);
3781 pkgmgrinfo_destroy_pkgdbinfo(handle);
3786 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
3789 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
3790 * @brief This API sets the package version in db handle
3792 * @par This API is for package-manager client application
3793 * @par Sync (or) Async : Synchronous API
3795 * @param[in] handle pointer to the pkgdbinfo handle.
3796 * @param[in] version pointer to the package version
3797 * @return 0 if success, error code(<0) if fail
3798 * @retval PMINFO_R_OK success
3799 * @retval PMINFO_R_EINVAL invalid argument
3800 * @retval PMINFO_R_ERROR internal error
3801 * @pre pkgmgrinfo_create_pkgdbinfo()
3802 * @post pkgmgrinfo_destroy_pkgdbinfo()
3803 * @see pkgmgrinfo_save_pkgdbinfo()
3804 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3806 static int set_pkg_version_in_db(const char *pkgid)
3809 pkgmgrinfo_pkgdbinfo_h handle;
3810 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3811 if (ret != PMINFO_R_OK)
3813 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3814 if (ret != PMINFO_R_OK) {
3815 pkgmgrinfo_destroy_pkgdbinfo(handle);
3818 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3819 if (ret != PMINFO_R_OK) {
3820 pkgmgrinfo_destroy_pkgdbinfo(handle);
3823 pkgmgrinfo_destroy_pkgdbinfo(handle);
3828 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
3831 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
3832 * @brief This API sets the package install location in db handle
3834 * @par This API is for package-manager client application
3835 * @par Sync (or) Async : Synchronous API
3837 * @param[in] handle pointer to the pkgdbinfo handle.
3838 * @param[in] location package install location
3839 * @return 0 if success, error code(<0) if fail
3840 * @retval PMINFO_R_OK success
3841 * @retval PMINFO_R_EINVAL invalid argument
3842 * @retval PMINFO_R_ERROR internal error
3843 * @pre pkgmgrinfo_create_pkgdbinfo()
3844 * @post pkgmgrinfo_destroy_pkgdbinfo()
3845 * @see pkgmgrinfo_save_pkgdbinfo()
3846 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3848 static int set_pkg_install_location_in_db(const char *pkgid)
3851 pkgmgrinfo_pkgdbinfo_h handle;
3852 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3853 if (ret != PMINFO_R_OK)
3855 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
3856 if (ret != PMINFO_R_OK) {
3857 pkgmgrinfo_destroy_pkgdbinfo(handle);
3860 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3861 if (ret != PMINFO_R_OK) {
3862 pkgmgrinfo_destroy_pkgdbinfo(handle);
3865 pkgmgrinfo_destroy_pkgdbinfo(handle);
3870 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
3873 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
3874 * @brief This API sets the package size in db handle
3876 * @par This API is for package-manager client application
3877 * @par Sync (or) Async : Synchronous API
3879 * @param[in] handle pointer to the pkgdbinfo handle.
3880 * @param[in] size pointer to the package size
3881 * @return 0 if success, error code(<0) if fail
3882 * @retval PMINFO_R_OK success
3883 * @retval PMINFO_R_EINVAL invalid argument
3884 * @retval PMINFO_R_ERROR internal error
3885 * @pre pkgmgrinfo_create_pkgdbinfo()
3886 * @post pkgmgrinfo_destroy_pkgdbinfo()
3887 * @see pkgmgrinfo_save_pkgdbinfo()
3888 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3890 static int set_pkg_size_in_db(const char *pkgid)
3893 pkgmgrinfo_pkgdbinfo_h handle;
3894 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3895 if (ret != PMINFO_R_OK)
3897 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
3898 if (ret != PMINFO_R_OK) {
3899 pkgmgrinfo_destroy_pkgdbinfo(handle);
3902 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3903 if (ret != PMINFO_R_OK) {
3904 pkgmgrinfo_destroy_pkgdbinfo(handle);
3907 pkgmgrinfo_destroy_pkgdbinfo(handle);
3912 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
3915 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
3916 * @brief This API sets the package label in db handle
3918 * @par This API is for package-manager client application
3919 * @par Sync (or) Async : Synchronous API
3921 * @param[in] handle pointer to the pkgdbinfo handle.
3922 * @param[in] label pointer to the package label
3923 * @param[in] locale pointer to the locale
3924 * @return 0 if success, error code(<0) if fail
3925 * @retval PMINFO_R_OK success
3926 * @retval PMINFO_R_EINVAL invalid argument
3927 * @retval PMINFO_R_ERROR internal error
3928 * @pre pkgmgrinfo_create_pkgdbinfo()
3929 * @post pkgmgrinfo_destroy_pkgdbinfo()
3930 * @see pkgmgrinfo_save_pkgdbinfo()
3931 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3933 static int set_pkg_label_in_db(const char *pkgid)
3936 pkgmgrinfo_pkgdbinfo_h handle;
3937 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3938 if (ret != PMINFO_R_OK)
3940 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
3941 if (ret != PMINFO_R_OK) {
3942 pkgmgrinfo_destroy_pkgdbinfo(handle);
3945 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3946 if (ret != PMINFO_R_OK) {
3947 pkgmgrinfo_destroy_pkgdbinfo(handle);
3950 pkgmgrinfo_destroy_pkgdbinfo(handle);
3955 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
3958 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
3959 * @brief This API sets the package icon in db handle
3961 * @par This API is for package-manager client application
3962 * @par Sync (or) Async : Synchronous API
3964 * @param[in] handle pointer to the pkgdbinfo handle.
3965 * @param[in] icon pointer to the package icon
3966 * @param[in] locale pointer to the locale
3967 * @return 0 if success, error code(<0) if fail
3968 * @retval PMINFO_R_OK success
3969 * @retval PMINFO_R_EINVAL invalid argument
3970 * @retval PMINFO_R_ERROR internal error
3971 * @pre pkgmgrinfo_create_pkgdbinfo()
3972 * @post pkgmgrinfo_destroy_pkgdbinfo()
3973 * @see pkgmgrinfo_save_pkgdbinfo()
3974 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3976 static int set_pkg_icon_in_db(const char *pkgid)
3979 pkgmgrinfo_pkgdbinfo_h handle;
3980 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3981 if (ret != PMINFO_R_OK)
3983 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
3984 if (ret != PMINFO_R_OK) {
3985 pkgmgrinfo_destroy_pkgdbinfo(handle);
3988 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3989 if (ret != PMINFO_R_OK) {
3990 pkgmgrinfo_destroy_pkgdbinfo(handle);
3993 pkgmgrinfo_destroy_pkgdbinfo(handle);
3998 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4001 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4002 * @brief This API sets the package description in db handle
4004 * @par This API is for package-manager client application
4005 * @par Sync (or) Async : Synchronous API
4007 * @param[in] handle pointer to the pkgdbinfo handle.
4008 * @param[in] description pointer to the package description
4009 * @param[in] locale pointer to the locale
4010 * @return 0 if success, error code(<0) if fail
4011 * @retval PMINFO_R_OK success
4012 * @retval PMINFO_R_EINVAL invalid argument
4013 * @retval PMINFO_R_ERROR internal error
4014 * @pre pkgmgrinfo_create_pkgdbinfo()
4015 * @post pkgmgrinfo_destroy_pkgdbinfo()
4016 * @see pkgmgrinfo_save_pkgdbinfo()
4017 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4019 static int set_pkg_description_in_db(const char *pkgid)
4022 pkgmgrinfo_pkgdbinfo_h handle;
4023 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4024 if (ret != PMINFO_R_OK)
4026 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4027 if (ret != PMINFO_R_OK) {
4028 pkgmgrinfo_destroy_pkgdbinfo(handle);
4031 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4032 if (ret != PMINFO_R_OK) {
4033 pkgmgrinfo_destroy_pkgdbinfo(handle);
4036 pkgmgrinfo_destroy_pkgdbinfo(handle);
4041 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4044 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4045 const char *author_email, const char *author_href, const char *locale)
4046 * @brief This API sets the package author info in db handle
4048 * @par This API is for package-manager client application
4049 * @par Sync (or) Async : Synchronous API
4051 * @param[in] handle pointer to the pkgdbinfo handle.
4052 * @param[in] author_name pointer to the package author name
4053 * @param[in] author_email pointer to the package author email
4054 * @param[in] author_href pointer to the package author href
4055 * @param[in] locale pointer to the locale
4056 * @return 0 if success, error code(<0) if fail
4057 * @retval PMINFO_R_OK success
4058 * @retval PMINFO_R_EINVAL invalid argument
4059 * @retval PMINFO_R_ERROR internal error
4060 * @pre pkgmgrinfo_create_pkgdbinfo()
4061 * @post pkgmgrinfo_destroy_pkgdbinfo()
4062 * @see pkgmgrinfo_save_pkgdbinfo()
4063 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4065 static int set_pkg_author_in_db(const char *pkgid)
4068 pkgmgrinfo_pkgdbinfo_h handle;
4069 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4070 if (ret != PMINFO_R_OK)
4072 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4073 if (ret != PMINFO_R_OK) {
4074 pkgmgrinfo_destroy_pkgdbinfo(handle);
4077 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4078 if (ret != PMINFO_R_OK) {
4079 pkgmgrinfo_destroy_pkgdbinfo(handle);
4082 pkgmgrinfo_destroy_pkgdbinfo(handle);
4087 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4088 const char *author_email, const char *author_href, const char *locale);
4091 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4092 * @brief This API sets the package 'removable' value in db handle
4094 * @par This API is for package-manager client application
4095 * @par Sync (or) Async : Synchronous API
4097 * @param[in] handle pointer to the pkgdbinfo handle.
4098 * @param[in] removable package removable value
4099 * @return 0 if success, error code(<0) if fail
4100 * @retval PMINFO_R_OK success
4101 * @retval PMINFO_R_EINVAL invalid argument
4102 * @retval PMINFO_R_ERROR internal error
4103 * @pre pkgmgrinfo_create_pkgdbinfo()
4104 * @post pkgmgrinfo_destroy_pkgdbinfo()
4105 * @see pkgmgrinfo_save_pkgdbinfo()
4106 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4108 static int set_pkg_removable_in_db(const char *pkgid)
4111 pkgmgrinfo_pkgdbinfo_h handle;
4112 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4113 if (ret != PMINFO_R_OK)
4115 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4116 if (ret != PMINFO_R_OK) {
4117 pkgmgrinfo_destroy_pkgdbinfo(handle);
4120 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4121 if (ret != PMINFO_R_OK) {
4122 pkgmgrinfo_destroy_pkgdbinfo(handle);
4125 pkgmgrinfo_destroy_pkgdbinfo(handle);
4130 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4133 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4134 * @brief This API sets the package 'preload' value in db handle
4136 * @par This API is for package-manager client application
4137 * @par Sync (or) Async : Synchronous API
4139 * @param[in] handle pointer to the pkgdbinfo handle.
4140 * @param[in] preload package preload value
4141 * @return 0 if success, error code(<0) if fail
4142 * @retval PMINFO_R_OK success
4143 * @retval PMINFO_R_EINVAL invalid argument
4144 * @retval PMINFO_R_ERROR internal error
4145 * @pre pkgmgrinfo_create_pkgdbinfo()
4146 * @post pkgmgrinfo_destroy_pkgdbinfo()
4147 * @see pkgmgrinfo_save_pkgdbinfo()
4148 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4150 static int set_pkg_preload_in_db(const char *pkgid)
4153 pkgmgrinfo_pkgdbinfo_h handle;
4154 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4155 if (ret != PMINFO_R_OK)
4157 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4158 if (ret != PMINFO_R_OK) {
4159 pkgmgrinfo_destroy_pkgdbinfo(handle);
4162 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4163 if (ret != PMINFO_R_OK) {
4164 pkgmgrinfo_destroy_pkgdbinfo(handle);
4167 pkgmgrinfo_destroy_pkgdbinfo(handle);
4172 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4175 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4176 * @brief This API saves all the information from the handle to the DB.
4178 * @par This API is for package-manager client application
4179 * @par Sync (or) Async : Synchronous API
4181 * @param[in] handle pointer to the package db info handle.
4182 * @return 0 if success, error code(<0) if fail
4183 * @retval PMINFO_R_OK success
4184 * @retval PMINFO_R_EINVAL invalid argument
4185 * @retval PMINFO_R_ERROR internal error
4186 * @pre pkgmgrinfo_create_pkgdbinfo()
4187 * @post pkgmgrinfo_destroy_pkgdbinfo()
4188 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4190 static int set_pkg_in_db(const char *pkgid)
4193 pkgmgrinfo_pkgdbinfo_h handle;
4194 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4195 if (ret != PMINFO_R_OK)
4197 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4198 if (ret != PMINFO_R_OK) {
4199 pkgmgrinfo_destroy_pkgdbinfo(handle);
4202 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4203 if (ret != PMINFO_R_OK) {
4204 pkgmgrinfo_destroy_pkgdbinfo(handle);
4207 pkgmgrinfo_destroy_pkgdbinfo(handle);
4212 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4215 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4216 * @brief This API destroys the package db information handle freeing up all the resources
4218 * @par This API is for package-manager client application
4219 * @par Sync (or) Async : Synchronous API
4221 * @param[in] handle pointer to the package db info handle.
4222 * @return 0 if success, error code(<0) if fail
4223 * @retval PMINFO_R_OK success
4224 * @retval PMINFO_R_EINVAL invalid argument
4225 * @retval PMINFO_R_ERROR internal error
4226 * @pre pkgmgrinfo_create_pkgdbinfo()
4228 * @see pkgmgrinfo_save_pkgdbinfo()
4229 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4231 static int set_pkg_in_db(const char *pkgid)
4234 pkgmgrinfo_pkgdbinfo_h handle;
4235 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4236 if (ret != PMINFO_R_OK)
4238 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4239 if (ret != PMINFO_R_OK) {
4240 pkgmgrinfo_destroy_pkgdbinfo(handle);
4243 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4244 if (ret != PMINFO_R_OK) {
4245 pkgmgrinfo_destroy_pkgdbinfo(handle);
4248 pkgmgrinfo_destroy_pkgdbinfo(handle);
4253 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4256 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4257 * @brief This API creates the package cert information handle to set data in db.
4259 * @par This API is for package-manager client application
4260 * @par Sync (or) Async : Synchronous API
4262 * @param[out] handle pointer to the package cert handle.
4263 * @return 0 if success, error code(<0) if fail
4264 * @retval PMINFO_R_OK success
4265 * @retval PMINFO_R_EINVAL invalid argument
4266 * @retval PMINFO_R_ERROR internal error
4268 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4269 * @see pkgmgrinfo_set_cert_value()
4270 * @see pkgmgrinfo_save_certinfo()
4272 static int set_cert_in_db(const char *pkgid)
4275 pkgmgrinfo_instcertinfo_h handle;
4276 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4277 if (ret != PMINFO_R_OK)
4279 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4280 if (ret != PMINFO_R_OK) {
4281 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4284 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4285 if (ret != PMINFO_R_OK) {
4286 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4289 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4294 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4297 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4298 * @brief This API sets the package cert information in the handle.
4300 * @par This API is for package-manager client application
4301 * @par Sync (or) Async : Synchronous API
4303 * @param[in] handle pointer to the package cert handle.
4304 * @param[in] cert_type certificate type.
4305 * @param[in] cert_value certificate value.
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4310 * @pre pkgmgrinfo_create_certinfo_set_handle()
4311 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4312 * @see pkgmgrinfo_save_certinfo()
4314 static int set_cert_in_db(const char *pkgid)
4317 pkgmgrinfo_instcertinfo_h handle;
4318 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4319 if (ret != PMINFO_R_OK)
4321 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4322 if (ret != PMINFO_R_OK) {
4323 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4326 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4327 if (ret != PMINFO_R_OK) {
4328 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4331 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4336 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4339 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4340 * @brief This API saves the package cert information in the DB.
4342 * @par This API is for package-manager client application
4343 * @par Sync (or) Async : Synchronous API
4345 * @param[in] pkgid pointer to the package ID.
4346 * @param[in] handle pointer to the package cert handle.
4347 * @return 0 if success, error code(<0) if fail
4348 * @retval PMINFO_R_OK success
4349 * @retval PMINFO_R_EINVAL invalid argument
4350 * @retval PMINFO_R_ERROR internal error
4351 * @pre pkgmgrinfo_create_certinfo_set_handle()
4352 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4353 * @see pkgmgrinfo_save_certinfo()
4355 static int set_cert_in_db(const char *pkgid)
4358 pkgmgrinfo_instcertinfo_h handle;
4359 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4360 if (ret != PMINFO_R_OK)
4362 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4363 if (ret != PMINFO_R_OK) {
4364 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4367 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4368 if (ret != PMINFO_R_OK) {
4369 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4372 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4377 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4380 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4381 * @brief This API destroys the package cert information handle freeing up all the resources.
4383 * @par This API is for package-manager client application
4384 * @par Sync (or) Async : Synchronous API
4386 * @param[in] handle pointer to the package cert handle.
4387 * @return 0 if success, error code(<0) if fail
4388 * @retval PMINFO_R_OK success
4389 * @retval PMINFO_R_EINVAL invalid argument
4390 * @retval PMINFO_R_ERROR internal error
4391 * @pre pkgmgrinfo_create_certinfo_set_handle()
4393 * @see pkgmgrinfo_save_certinfo()
4395 static int set_cert_in_db(const char *pkgid)
4398 pkgmgrinfo_instcertinfo_h handle;
4399 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4400 if (ret != PMINFO_R_OK)
4402 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4403 if (ret != PMINFO_R_OK) {
4404 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4407 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4408 if (ret != PMINFO_R_OK) {
4409 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4412 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4417 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4420 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4421 * @brief This API gets the datacontrol info
4423 * @par This API is for package-manager client application
4424 * @par Sync (or) Async : Synchronous API
4426 * @param[in] providerid pointer to the providerid of dataconltrol.
4427 * @param[in] type pointer to the type of dataconltrol.
4428 * @param[out] appid pointer to hold appid, need to free after using
4429 * @param[out] access pointer to hold access, need to free after using
4430 * @return 0 if success, error code(<0) if fail
4431 * @retval PMINFO_R_OK success
4432 * @retval PMINFO_R_EINVAL invalid argument
4433 * @retval PMINFO_R_ERROR internal error
4436 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4439 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
4440 * @brief This API gets the application 'guest mode visibility' value from the DB
4442 * @par This API is for package-manager client application
4443 * @par Sync (or) Async : Synchronous API
4445 * @param[in] handle pointer to application info handle
4446 * @param[out] status pointer to hold app guest mode visibility value
4447 * @return 0 if success, error code(<0) if fail
4448 * @retval PMINFO_R_OK success
4449 * @retval PMINFO_R_EINVAL invalid argument
4450 * @retval PMINFO_R_ERROR internal error
4451 * @pre pkgmgrinfo_appinfo_get_appinfo()
4452 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4453 * @see pkgmgrinfo_appinfo_get_appid()
4454 * @see pkgmgrinfo_appinfo_is_multiple()
4456 static int get_app_guestmode_visibility(const char *appid)
4460 pkgmgrinfo_appinfo_h handle;
4461 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4462 if (ret != PMINFO_R_OK)
4464 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
4465 if (ret != PMINFO_R_OK) {
4466 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4469 printf("app guest mode visibility: %d\n", status);
4470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4475 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
4478 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
4479 * @brief This API sets the application 'guest mode visibility' value in the DB
4481 * @par This API is for package-manager client application
4482 * @par Sync (or) Async : Synchronous API
4484 * @param[in] handle pointer to application info handle
4485 * @param[out] status app guest mode visibility value
4486 * @return 0 if success, error code(<0) if fail
4487 * @retval PMINFO_R_OK success
4488 * @retval PMINFO_R_EINVAL invalid argument
4489 * @retval PMINFO_R_ERROR internal error
4490 * @pre pkgmgrinfo_appinfo_get_appinfo()
4491 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4492 * @see pkgmgrinfo_appinfo_get_appid()
4493 * @see pkgmgrinfo_appinfo_is_multiple()
4495 static int set_app_guestmode_visibility(const char *appid, bool value)
4498 pkgmgrinfo_appinfo_h handle;
4499 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4500 if (ret != PMINFO_R_OK)
4502 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
4503 if (ret != PMINFO_R_OK) {
4504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4512 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
4519 #endif /* __PKG_INFO_H__ */