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_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
332 /** String property for filtering based on package info*/
333 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
334 /** String property for filtering based on package info*/
335 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
336 /** String property for filtering based on package info*/
337 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
339 /** Boolean property for filtering based on package info*/
340 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
341 /** Boolean property for filtering based on package info*/
342 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
343 /** Boolean property for filtering based on package info*/
344 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
345 /** Boolean property for filtering based on package info*/
346 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
347 /** Boolean property for filtering based on package info*/
348 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
350 /** Integer property for filtering based on package info*/
351 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
353 /** String property for filtering based on app info*/
354 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
355 /** String property for filtering based on app info*/
356 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
357 /** String property for filtering based on app info*/
358 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
359 /** String property for filtering based on app info*/
360 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
361 /** String property for filtering based on app info*/
362 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
363 /** String property for filtering based on app info*/
364 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
365 /** String property for filtering based on app info*/
366 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
367 /** String property for filtering based on app info*/
368 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
369 /** String property for filtering based on app info*/
370 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
371 /** String property for filtering based on app info*/
372 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
374 /** Boolean property for filtering based on app info*/
375 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
376 /** Boolean property for filtering based on app info*/
377 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
378 /** Boolean property for filtering based on app info*/
379 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
380 /** Boolean property for filtering based on app info*/
381 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
382 /** Boolean property for filtering based on app info*/
383 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
386 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
387 * @brief This API gets list of installed packages
389 * @par This API is for package-manager client application
390 * @par Sync (or) Async : Synchronous API
391 * @param[in] pkg_list_cb iteration function for list
392 * @param[in] user_data user data to be passed to callback function
393 * @return 0 if success, error code(<0) if fail
394 * @retval PMINFO_R_OK success
395 * @retval PMINFO_R_EINVAL invalid argument
396 * @retval PMINFO_R_ERROR internal error
400 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
404 pkgid1 = (char *)user_data;
405 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
406 if (strcmp(pkgid1, pkgid2) == 0) {
413 static int list_pkgs()
416 char *name = "helloworld";
417 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
418 if (ret != PMINFO_R_OK) {
425 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
428 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
429 * @brief This API creates the package information handle from db
431 * @par This API is for package-manager client application
432 * @par Sync (or) Async : Synchronous API
434 * @param[in] pkgid pointer to package ID
435 * @param[out] handle pointer to the package info handle.
436 * @return 0 if success, error code(<0) if fail
437 * @retval PMINFO_R_OK success
438 * @retval PMINFO_R_EINVAL invalid argument
439 * @retval PMINFO_R_ERROR internal error
441 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
442 * @see pkgmgrinfo_pkginfo_get_pkgid()
443 * @see pkgmgrinfo_pkginfo_is_removable()
445 static int get_pkg_type(const char *pkgid)
449 pkgmgrinfo_pkginfo_h handle;
450 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
451 if (ret != PMINFO_R_OK)
453 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
454 if (ret != PMINFO_R_OK) {
455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
458 printf("pkgtype: %s\n", type);
459 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
467 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
468 * @brief This API gets the package name from the package ID
470 * @par This API is for package-manager client application
471 * @par Sync (or) Async : Synchronous API
473 * @param[in] handle pointer to package info handle
474 * @param[out] pkg_name pointer to hold package name
475 * @return 0 if success, error code(<0) if fail
476 * @retval PMINFO_R_OK success
477 * @retval PMINFO_R_EINVAL invalid argument
478 * @retval PMINFO_R_ERROR internal error
479 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
480 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
481 * @see pkgmgrinfo_pkginfo_get_type()
482 * @see pkgmgrinfo_pkginfo_is_removable()
484 static int get_pkg_name(const char *pkgid)
487 char *pkgname = NULL;
488 pkgmgrinfo_pkginfo_h handle;
489 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
490 if (ret != PMINFO_R_OK)
492 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
493 if (ret != PMINFO_R_OK) {
494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
497 printf("pkgname: %s\n", pkgname);
498 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
506 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
507 * @brief This API gets the package id from the package ID
509 * @par This API is for package-manager client application
510 * @par Sync (or) Async : Synchronous API
512 * @param[in] handle pointer to package info handle
513 * @param[out] pkgid pointer to hold package id
514 * @return 0 if success, error code(<0) if fail
515 * @retval PMINFO_R_OK success
516 * @retval PMINFO_R_EINVAL invalid argument
517 * @retval PMINFO_R_ERROR internal error
518 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
519 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
520 * @see pkgmgrinfo_pkginfo_get_type()
521 * @see pkgmgrinfo_pkginfo_is_removable()
523 static int get_pkgid(const char *pkgid)
527 pkgmgrinfo_pkginfo_h handle;
528 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
529 if (ret != PMINFO_R_OK)
531 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
532 if (ret != PMINFO_R_OK) {
533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
536 printf("pkg id: %s\n", pkg_id);
537 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
545 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
546 * @brief This API gets the package type from the package ID
548 * @par This API is for package-manager client application
549 * @par Sync (or) Async : Synchronous API
551 * @param[in] handle pointer to package info handle
552 * @param[out] type pointer to hold package type
553 * @return 0 if success, error code(<0) if fail
554 * @retval PMINFO_R_OK success
555 * @retval PMINFO_R_EINVAL invalid argument
556 * @retval PMINFO_R_ERROR internal error
557 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
558 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
559 * @see pkgmgrinfo_pkginfo_get_pkgid()
560 * @see pkgmgrinfo_pkginfo_is_removable()
562 static int get_pkg_type(const char *pkgid)
566 pkgmgrinfo_pkginfo_h handle;
567 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
568 if (ret != PMINFO_R_OK)
570 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
571 if (ret != PMINFO_R_OK) {
572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
575 printf("pkgtype: %s\n", type);
576 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
584 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
585 * @brief This API gets the package version from the package ID
587 * @par This API is for package-manager client application
588 * @par Sync (or) Async : Synchronous API
590 * @param[in] handle pointer to package info handle
591 * @param[out] version pointer to hold package version
592 * @return 0 if success, error code(<0) if fail
593 * @retval PMINFO_R_OK success
594 * @retval PMINFO_R_EINVAL invalid argument
595 * @retval PMINFO_R_ERROR internal error
596 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
597 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
598 * @see pkgmgrinfo_pkginfo_get_pkgid()
599 * @see pkgmgrinfo_pkginfo_is_removable()
601 static int get_pkg_version(const char *pkgid)
604 char *version = NULL;
605 pkgmgrinfo_pkginfo_h handle;
606 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
607 if (ret != PMINFO_R_OK)
609 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
610 if (ret != PMINFO_R_OK) {
611 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
614 printf("pkg version: %s\n", version);
615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
623 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
624 * @brief This API gets the package install location from the package ID
626 * @par This API is for package-manager client application
627 * @par Sync (or) Async : Synchronous API
629 * @param[in] handle pointer to package info handle
630 * @param[out] location pointer to hold package install location
631 * @return 0 if success, error code(<0) if fail
632 * @retval PMINFO_R_OK success
633 * @retval PMINFO_R_EINVAL invalid argument
634 * @retval PMINFO_R_ERROR internal error
635 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
636 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
637 * @see pkgmgrinfo_pkginfo_get_pkgid()
638 * @see pkgmgrinfo_pkginfo_is_removable()
640 static int get_pkg_install_location(const char *pkgid)
643 pkgmgrinfo_install_location location;
644 pkgmgrinfo_pkginfo_h handle;
645 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
646 if (ret != PMINFO_R_OK)
648 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
649 if (ret != PMINFO_R_OK) {
650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
653 printf("pkg install location: %d\n", location);
654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
662 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
663 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
664 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
665 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
667 * @par This API is for package-manager client application
668 * @par Sync (or) Async : Synchronous API
670 * @param[in] handle pointer to package info handle
671 * @param[out] size pointer to hold package size
672 * @return 0 if success, error code(<0) if fail
673 * @retval PMINFO_R_OK success
674 * @retval PMINFO_R_EINVAL invalid argument
675 * @retval PMINFO_R_ERROR internal error
676 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
677 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
678 * @see pkgmgrinfo_pkginfo_get_pkgid()
679 * @see pkgmgrinfo_pkginfo_is_removable()
681 static int get_pkg_size(const char *pkgid)
685 pkgmgrinfo_pkginfo_h handle;
686 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
687 if (ret != PMINFO_R_OK)
689 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
690 if (ret != PMINFO_R_OK) {
691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 printf("pkgsize: %d\n", size);
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
703 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
704 * @brief This API gets the installed package total size on the target.
706 * @par This API is for package-manager client application
707 * @par Sync (or) Async : Synchronous API
709 * @param[in] handle pointer to package info handle
710 * @param[out] size pointer to hold package total size
711 * @return 0 if success, error code(<0) if fail
712 * @retval PMINFO_R_OK success
713 * @retval PMINFO_R_EINVAL invalid argument
714 * @retval PMINFO_R_ERROR internal error
716 static int get_pkg_total_size(const char *pkgid)
720 pkgmgrinfo_pkginfo_h handle;
721 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
722 if (ret != PMINFO_R_OK)
724 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
725 if (ret != PMINFO_R_OK) {
726 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
729 printf("pkg total size: %d\n", size);
730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
735 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
738 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
739 * @brief This API gets the installed package data size on the target.
741 * @par This API is for package-manager client application
742 * @par Sync (or) Async : Synchronous API
744 * @param[in] handle pointer to package info handle
745 * @param[out] size pointer to hold package data size
746 * @return 0 if success, error code(<0) if fail
747 * @retval PMINFO_R_OK success
748 * @retval PMINFO_R_EINVAL invalid argument
749 * @retval PMINFO_R_ERROR internal error
751 static int get_pkg_data_size(const char *pkgid)
755 pkgmgrinfo_pkginfo_h handle;
756 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
757 if (ret != PMINFO_R_OK)
759 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
760 if (ret != PMINFO_R_OK) {
761 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
764 printf("pkg data size: %d\n", size);
765 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
770 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
773 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
774 * @brief This API gets the package icon from the package ID
776 * @par This API is for package-manager client application
777 * @par Sync (or) Async : Synchronous API
779 * @param[in] handle pointer to package info handle
780 * @param[out] icon pointer to hold package icon
781 * @return 0 if success, error code(<0) if fail
782 * @retval PMINFO_R_OK success
783 * @retval PMINFO_R_EINVAL invalid argument
784 * @retval PMINFO_R_ERROR internal error
785 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
786 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
787 * @see pkgmgrinfo_pkginfo_get_pkgid()
788 * @see pkgmgrinfo_pkginfo_is_removable()
790 static int get_pkg_icon(const char *pkgid)
794 pkgmgrinfo_pkginfo_h handle;
795 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
796 if (ret != PMINFO_R_OK)
798 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
799 if (ret != PMINFO_R_OK) {
800 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
803 printf("pkg icon: %s\n", icon);
804 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
809 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
812 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
813 * @brief This API gets the package label from the package ID
815 * @par This API is for package-manager client application
816 * @par Sync (or) Async : Synchronous API
818 * @param[in] handle pointer to package info handle
819 * @param[out] label pointer to hold package label
820 * @return 0 if success, error code(<0) if fail
821 * @retval PMINFO_R_OK success
822 * @retval PMINFO_R_EINVAL invalid argument
823 * @retval PMINFO_R_ERROR internal error
824 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
825 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
826 * @see pkgmgrinfo_pkginfo_get_pkgid()
827 * @see pkgmgrinfo_pkginfo_is_removable()
829 static int get_pkg_label(const char *pkgid)
833 pkgmgrinfo_pkginfo_h handle;
834 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
835 if (ret != PMINFO_R_OK)
837 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
838 if (ret != PMINFO_R_OK) {
839 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
842 printf("pkg label: %s\n", label);
843 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
848 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
851 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
852 * @brief This API gets the package description from the package ID
854 * @par This API is for package-manager client application
855 * @par Sync (or) Async : Synchronous API
857 * @param[in] handle pointer to package info handle
858 * @param[out] description pointer to hold package description
859 * @return 0 if success, error code(<0) if fail
860 * @retval PMINFO_R_OK success
861 * @retval PMINFO_R_EINVAL invalid argument
862 * @retval PMINFO_R_ERROR internal error
863 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
864 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
865 * @see pkgmgrinfo_pkginfo_get_pkgid()
866 * @see pkgmgrinfo_pkginfo_is_removable()
868 static int get_pkg_description(const char *pkgid)
871 char *description = NULL;
872 pkgmgrinfo_pkginfo_h handle;
873 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
874 if (ret != PMINFO_R_OK)
876 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
877 if (ret != PMINFO_R_OK) {
878 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
881 printf("pkg description: %s\n", description);
882 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
887 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
890 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
891 * @brief This API gets the package's author name from the package ID
893 * @par This API is for package-manager client application
894 * @par Sync (or) Async : Synchronous API
896 * @param[in] handle pointer to package info handle
897 * @param[out] author_name pointer to hold package author name
898 * @return 0 if success, error code(<0) if fail
899 * @retval PMINFO_R_OK success
900 * @retval PMINFO_R_EINVAL invalid argument
901 * @retval PMINFO_R_ERROR internal error
902 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
903 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
904 * @see pkgmgrinfo_pkginfo_get_pkgid()
905 * @see pkgmgrinfo_pkginfo_is_removable()
907 static int get_pkg_author_name(const char *pkgid)
910 char *author_name = NULL;
911 pkgmgrinfo_pkginfo_h handle;
912 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
913 if (ret != PMINFO_R_OK)
915 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
916 if (ret != PMINFO_R_OK) {
917 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
920 printf("pkg author name: %s\n", author_name);
921 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
926 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
929 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
930 * @brief This API gets the package's author email from the package ID
932 * @par This API is for package-manager client application
933 * @par Sync (or) Async : Synchronous API
935 * @param[in] handle pointer to package info handle
936 * @param[out] author_email pointer to hold package author email
937 * @return 0 if success, error code(<0) if fail
938 * @retval PMINFO_R_OK success
939 * @retval PMINFO_R_EINVAL invalid argument
940 * @retval PMINFO_R_ERROR internal error
941 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
942 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
943 * @see pkgmgrinfo_pkginfo_get_pkgid()
944 * @see pkgmgrinfo_pkginfo_is_removable()
946 static int get_pkg_author_email(const char *pkgid)
949 char *author_email = NULL;
950 pkgmgrinfo_pkginfo_h handle;
951 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
952 if (ret != PMINFO_R_OK)
954 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
955 if (ret != PMINFO_R_OK) {
956 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
959 printf("pkg author email: %s\n", author_email);
960 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
965 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
968 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
969 * @brief This API gets the package's author href from the package ID
971 * @par This API is for package-manager client application
972 * @par Sync (or) Async : Synchronous API
974 * @param[in] handle pointer to package info handle
975 * @param[out] author_href pointer to hold package author href
976 * @return 0 if success, error code(<0) if fail
977 * @retval PMINFO_R_OK success
978 * @retval PMINFO_R_EINVAL invalid argument
979 * @retval PMINFO_R_ERROR internal error
980 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
981 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
982 * @see pkgmgrinfo_pkginfo_get_pkgid()
983 * @see pkgmgrinfo_pkginfo_is_removable()
985 static int get_pkg_author_href(const char *pkgid)
988 char *author_href = NULL;
989 pkgmgrinfo_pkginfo_h handle;
990 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
991 if (ret != PMINFO_R_OK)
993 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
994 if (ret != PMINFO_R_OK) {
995 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
998 printf("pkg author href: %s\n", author_href);
999 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1004 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1007 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1008 * @brief This API gets the package installed storagae value from the package ID
1010 * @par This API is for package-manager client application
1011 * @par Sync (or) Async : Synchronous API
1013 * @param[in] handle pointer to package info handle
1014 * @param[out] storage pointer to hold package installed storage
1015 * @return 0 if success, error code(<0) if fail
1016 * @retval PMINFO_R_OK success
1017 * @retval PMINFO_R_EINVAL invalid argument
1018 * @retval PMINFO_R_ERROR internal error
1019 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1020 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1021 * @see pkgmgrinfo_pkginfo_get_pkgid()
1022 * @see pkgmgrinfo_pkginfo_is_removable()
1024 static int get_pkg_installed_storage(const char *pkgid)
1027 pkgmgrinfo_installed_storage storage;
1028 pkgmgrinfo_pkginfo_h handle;
1029 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1030 if (ret != PMINFO_R_OK)
1032 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1033 if (ret != PMINFO_R_OK) {
1034 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1037 printf("pkg installed storage: %d\n", storage);
1038 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1043 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1046 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1047 * @brief This API gets the installed time of package from the package ID
1049 * @par This API is for package-manager client application
1050 * @par Sync (or) Async : Synchronous API
1052 * @param[in] handle pointer to package info handle
1053 * @param[out] installed_time pointer to hold installed time of package
1054 * @return 0 if success, error code(<0) if fail
1055 * @retval PMINFO_R_OK success
1056 * @retval PMINFO_R_EINVAL invalid argument
1057 * @retval PMINFO_R_ERROR internal error
1058 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1059 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1060 * @see pkgmgrinfo_pkginfo_get_pkgid()
1061 * @see pkgmgrinfo_pkginfo_is_removable()
1063 static int get_pkg_installed_time(const char *pkgid)
1066 int installed_time = 0;
1067 pkgmgrinfo_pkginfo_h handle;
1068 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1069 if (ret != PMINFO_R_OK)
1071 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1072 if (ret != PMINFO_R_OK) {
1073 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1076 printf("installed_time: %d\n", installed_time);
1077 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1082 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1085 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1086 * @brief This API gets the store client id of package from the package ID
1088 * @par This API is for package-manager client application
1089 * @par Sync (or) Async : Synchronous API
1091 * @param[in] handle pointer to package info handle
1092 * @param[out] storeclientid pointer to hold store client id of package
1093 * @return 0 if success, error code(<0) if fail
1094 * @retval PMINFO_R_OK success
1095 * @retval PMINFO_R_EINVAL invalid argument
1096 * @retval PMINFO_R_ERROR internal error
1097 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1098 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1099 * @see pkgmgrinfo_pkginfo_get_pkgid()
1100 * @see pkgmgrinfo_pkginfo_is_removable()
1102 static int get_pkg_storeclientid(const char *pkgid)
1105 char *storeclientid = 0;
1106 pkgmgrinfo_pkginfo_h handle;
1107 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1108 if (ret != PMINFO_R_OK)
1110 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1111 if (ret != PMINFO_R_OK) {
1112 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1115 printf(store client id: %s\n", storeclientid);
1116 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1121 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1124 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1125 * @brief This API gets the main app id of package from the package ID
1127 * @par This API is for package-manager client application
1128 * @par Sync (or) Async : Synchronous API
1130 * @param[in] handle pointer to package info handle
1131 * @param[out] mainappid pointer to hold main app id of package
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1136 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1137 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1138 * @see pkgmgrinfo_pkginfo_get_pkgid()
1139 * @see pkgmgrinfo_pkginfo_is_removable()
1141 static int get_pkg_mainappid(const char *pkgid)
1144 char *mainappid = 0;
1145 pkgmgrinfo_pkginfo_h handle;
1146 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1147 if (ret != PMINFO_R_OK)
1149 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1150 if (ret != PMINFO_R_OK) {
1151 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1154 printf(main app id: %s\n", mainappid);
1155 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1160 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1163 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1164 * @brief This API gets the url of package from the package ID
1166 * @par This API is for package-manager client application
1167 * @par Sync (or) Async : Synchronous API
1169 * @param[in] handle pointer to package info handle
1170 * @param[out] url pointer to hold url of package
1171 * @return 0 if success, error code(<0) if fail
1172 * @retval PMINFO_R_OK success
1173 * @retval PMINFO_R_EINVAL invalid argument
1174 * @retval PMINFO_R_ERROR internal error
1175 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1176 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1177 * @see pkgmgrinfo_pkginfo_get_pkgid()
1178 * @see pkgmgrinfo_pkginfo_is_removable()
1180 static int get_pkg_url(const char *pkgid)
1184 pkgmgrinfo_pkginfo_h handle;
1185 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1186 if (ret != PMINFO_R_OK)
1188 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1189 if (ret != PMINFO_R_OK) {
1190 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1193 printf("url : %s\n", url);
1194 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1199 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1203 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1204 * @brief This API gets the root path of package
1206 * @par Sync (or) Async : Synchronous API
1208 * @param[in] handle pointer to package info handle
1209 * @param[out] path pointer to hold root path of package
1210 * @return 0 if success, error code(<0) if fail
1211 * @retval PMINFO_R_OK success
1212 * @retval PMINFO_R_EINVAL invalid argument
1213 * @retval PMINFO_R_ERROR internal error
1215 static int get_root_path(const char *pkgid)
1219 pkgmgrinfo_pkginfo_h handle;
1220 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1221 if (ret != PMINFO_R_OK)
1224 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1225 if (ret != PMINFO_R_OK) {
1226 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1229 printf("path : %s\n", path);
1230 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1236 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1239 * @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)
1240 * @brief This API compare the cert information from given package id
1242 * @par This API is for package-manager client application
1243 * @par Sync (or) Async : Synchronous API
1245 * @param[in] lhs_package_id pointer to first package ID
1246 * @param[in] rhs_package_id pointer to second package ID
1247 * @param[out] compare_result pointer to the compare result.
1248 * @return 0 if success, error code(<0) if fail
1249 * @retval PMINFO_R_OK success
1250 * @retval PMINFO_R_EINVAL invalid argument
1251 * @retval PMINFO_R_ERROR internal error
1253 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1254 * @see pkgmgrinfo_pkginfo_get_pkgid()
1255 * @see pkgmgrinfo_pkginfo_is_removable()
1257 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1260 pkgmgrinfo_cert_compare_result_type_e result;
1262 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1263 if (ret != PMINFO_R_OK) {
1266 printf("result: %d\n", result);
1271 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);
1274 * @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)
1275 * @brief This API compare the cert information from given app id
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] lhs_app_id pointer to first app ID
1281 * @param[in] rhs_app_id pointer to second app ID
1282 * @param[out] compare_result pointer to the compare result.
1283 * @return 0 if success, error code(<0) if fail
1284 * @retval PMINFO_R_OK success
1285 * @retval PMINFO_R_EINVAL invalid argument
1286 * @retval PMINFO_R_ERROR internal error
1288 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1289 * @see pkgmgrinfo_pkginfo_get_pkgid()
1290 * @see pkgmgrinfo_pkginfo_is_removable()
1292 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1295 pkgmgrinfo_cert_compare_result_type_e result;
1297 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1298 if (ret != PMINFO_R_OK) {
1301 printf("result: %d\n", result);
1306 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);
1309 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1310 * @brief This API gets the package 'removable' value from the package ID
1312 * @par This API is for package-manager client application
1313 * @par Sync (or) Async : Synchronous API
1315 * @param[in] handle pointer to package info handle
1316 * @param[out] removable pointer to hold package removable value
1317 * @return 0 if success, error code(<0) if fail
1318 * @retval PMINFO_R_OK success
1319 * @retval PMINFO_R_EINVAL invalid argument
1320 * @retval PMINFO_R_ERROR internal error
1321 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1322 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1323 * @see pkgmgrinfo_pkginfo_get_pkgid()
1324 * @see pkgmgrinfo_pkginfo_is_readonly()
1326 static int get_pkg_removable(const char *pkgid)
1330 pkgmgrinfo_pkginfo_h handle;
1331 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1332 if (ret != PMINFO_R_OK)
1334 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1335 if (ret != PMINFO_R_OK) {
1336 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1339 printf("pkg removable: %d\n", removable);
1340 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1345 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1348 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1349 * @brief This API gets the package 'preload' value from the package ID
1351 * @par This API is for package-manager client application
1352 * @par Sync (or) Async : Synchronous API
1354 * @param[in] handle pointer to package info handle
1355 * @param[out] preload pointer to hold package preload value
1356 * @return 0 if success, error code(<0) if fail
1357 * @retval PMINFO_R_OK success
1358 * @retval PMINFO_R_EINVAL invalid argument
1359 * @retval PMINFO_R_ERROR internal error
1360 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1361 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1362 * @see pkgmgrinfo_pkginfo_get_pkgid()
1363 * @see pkgmgrinfo_pkginfo_is_readonly()
1365 static int get_pkg_preload(const char *pkgid)
1369 pkgmgrinfo_pkginfo_h handle;
1370 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1371 if (ret != PMINFO_R_OK)
1373 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1374 if (ret != PMINFO_R_OK) {
1375 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1378 printf("pkg preload: %d\n", preload);
1379 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1384 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1387 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1388 * @brief This API gets the package 'readonly' value from the package ID
1390 * @par This API is for package-manager client application
1391 * @par Sync (or) Async : Synchronous API
1393 * @param[in] handle pointer to package info handle
1394 * @param[out] readonly pointer to hold package readonly value
1395 * @return 0 if success, error code(<0) if fail
1396 * @retval PMINFO_R_OK success
1397 * @retval PMINFO_R_EINVAL invalid argument
1398 * @retval PMINFO_R_ERROR internal error
1399 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1400 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1401 * @see pkgmgrinfo_pkginfo_get_pkgid()
1402 * @see pkgmgrinfo_pkginfo_is_removable()
1404 static int get_pkg_readonly(const char *pkgid)
1408 pkgmgrinfo_pkginfo_h handle;
1409 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1410 if (ret != PMINFO_R_OK)
1412 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1413 if (ret != PMINFO_R_OK) {
1414 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1417 printf("pkg readonly: %d\n", readonly);
1418 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1423 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1427 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1428 * @brief This API gets the package 'upate' value from the package ID
1430 * @par This API is for package-manager client application
1431 * @par Sync (or) Async : Synchronous API
1433 * @param[in] handle pointer to package info handle
1434 * @param[out] update pointer to hold package update value
1435 * @return 0 if success, error code(<0) if fail
1436 * @retval PMINFO_R_OK success
1437 * @retval PMINFO_R_EINVAL invalid argument
1438 * @retval PMINFO_R_ERROR internal error
1439 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1440 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1441 * @see pkgmgrinfo_pkginfo_get_pkgid()
1443 static int get_pkg_update(const char *pkgid)
1447 pkgmgrinfo_pkginfo_h handle;
1448 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1449 if (ret != PMINFO_R_OK)
1451 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1452 if (ret != PMINFO_R_OK) {
1453 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1456 printf("pkg update: %d\n", update);
1457 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1462 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1465 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1466 * @brief This API gets the package 'accessible' value from the package ID
1468 * @par This API is for package-manager client application
1469 * @par Sync (or) Async : Synchronous API
1471 * @param[in] handle pointer to package info handle
1472 * @param[out] accessible pointer to hold package accessible value
1473 * @return 0 if success, error code(<0) if fail
1474 * @retval PMINFO_R_OK success
1475 * @retval PMINFO_R_EINVAL invalid argument
1476 * @retval PMINFO_R_ERROR internal error
1477 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1478 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1479 * @see pkgmgrinfo_pkginfo_get_pkgid()
1480 * @see pkgmgrinfo_pkginfo_is_readonly()
1482 static int get_pkg_accessible(const char *pkgid)
1486 pkgmgrinfo_pkginfo_h handle;
1487 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1488 if (ret != PMINFO_R_OK)
1490 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1491 if (ret != PMINFO_R_OK) {
1492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1495 printf("pkg accessible: %d\n", accessible);
1496 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1501 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1504 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1505 * @brief This API destroys the package information handle freeing up all the resources
1507 * @par This API is for package-manager client application
1508 * @par Sync (or) Async : Synchronous API
1510 * @param[in] handle pointer to the package info handle
1511 * @return 0 if success, error code(<0) if fail
1512 * @retval PMINFO_R_OK success
1513 * @retval PMINFO_R_EINVAL invalid argument
1514 * @retval PMINFO_R_ERROR internal error
1515 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1517 * @see pkgmgrinfo_pkginfo_get_pkgid()
1518 * @see pkgmgrinfo_pkginfo_is_removable()
1520 static int get_pkg_type(const char *pkgid)
1524 pkgmgrinfo_pkginfo_h handle;
1525 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1526 if (ret != PMINFO_R_OK)
1528 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1529 if (ret != PMINFO_R_OK) {
1530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1533 printf("pkgtype: %s\n", type);
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1542 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1543 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1544 The query will search the entire package information collected from the manifest file of all the installed packages
1546 * @par This API is for package-manager client application
1547 * @par Sync (or) Async : Synchronous API
1549 * @param[out] handle pointer to the package info filter handle.
1550 * @return 0 if success, error code(<0) if fail
1551 * @retval PMINFO_R_OK success
1552 * @retval PMINFO_R_EINVAL invalid argument
1553 * @retval PMINFO_R_ERROR internal error
1555 * @post pkgmgrinfo_pkginfo_filter_destroy()
1556 * @see pkgmgrinfo_pkginfo_filter_count()
1557 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1559 static int get_rpm_pkg_count()
1563 pkgmgrinfo_pkginfo_filter_h handle;
1564 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1565 if (ret != PMINFO_R_OK)
1567 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1568 if (ret != PMINFO_R_OK) {
1569 pkgmgrinfo_pkginfo_filter_destroy(handle);
1572 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1573 if (ret != PMINFO_R_OK) {
1574 pkgmgrinfo_pkginfo_filter_destroy(handle);
1577 printf("No of rpm pkgs: %d\n", count);
1578 pkgmgrinfo_pkginfo_filter_destroy(handle);
1583 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1586 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1587 * @brief This API destroys the package information filter handle freeing up all the resources
1589 * @par This API is for package-manager client application
1590 * @par Sync (or) Async : Synchronous API
1592 * @param[in] handle pointer to the package info filter handle.
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()
1599 * @see pkgmgrinfo_pkginfo_filter_count()
1600 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1602 static int get_rpm_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_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
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 rpm pkgs: %d\n", count);
1621 pkgmgrinfo_pkginfo_filter_destroy(handle);
1626 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1629 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1630 * @brief This API adds a boolean filter property to the filter handle
1632 * @par This API is for package-manager client application
1633 * @par Sync (or) Async : Synchronous API
1635 * @param[in] handle pointer to the package info filter handle.
1636 * @param[in] property boolean property name.
1637 * @param[in] value value corresponding to the property.
1638 * @return 0 if success, error code(<0) if fail
1639 * @retval PMINFO_R_OK success
1640 * @retval PMINFO_R_EINVAL invalid argument
1641 * @retval PMINFO_R_ERROR internal error
1642 * @pre pkgmgrinfo_pkginfo_filter_create()
1643 * @post pkgmgrinfo_pkginfo_filter_destroy()
1644 * @see pkgmgrinfo_pkginfo_filter_count()
1645 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1647 static int get_preload_pkg_count()
1651 pkgmgrinfo_pkginfo_filter_h handle;
1652 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1653 if (ret != PMINFO_R_OK)
1655 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1656 if (ret != PMINFO_R_OK) {
1657 pkgmgrinfo_pkginfo_filter_destroy(handle);
1660 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1661 if (ret != PMINFO_R_OK) {
1662 pkgmgrinfo_pkginfo_filter_destroy(handle);
1665 printf("No of preload pkgs: %d\n", count);
1666 pkgmgrinfo_pkginfo_filter_destroy(handle);
1671 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1672 const char *property, const bool value);
1675 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1676 * @brief This API adds an integer filter property to the filter handle
1678 * @par This API is for package-manager client application
1679 * @par Sync (or) Async : Synchronous API
1681 * @param[in] handle pointer to the package info filter handle.
1682 * @param[in] property integer property name.
1683 * @param[in] value value corresponding to the property.
1684 * @return 0 if success, error code(<0) if fail
1685 * @retval PMINFO_R_OK success
1686 * @retval PMINFO_R_EINVAL invalid argument
1687 * @retval PMINFO_R_ERROR internal error
1688 * @pre pkgmgrinfo_pkginfo_filter_create()
1689 * @post pkgmgrinfo_pkginfo_filter_destroy()
1690 * @see pkgmgrinfo_pkginfo_filter_count()
1691 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1693 static int get_pkg_count()
1697 pkgmgrinfo_pkginfo_filter_h handle;
1698 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1699 if (ret != PMINFO_R_OK)
1701 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1702 if (ret != PMINFO_R_OK) {
1703 pkgmgrinfo_pkginfo_filter_destroy(handle);
1706 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1707 if (ret != PMINFO_R_OK) {
1708 pkgmgrinfo_pkginfo_filter_destroy(handle);
1711 printf("No of preload pkgs: %d\n", count);
1712 pkgmgrinfo_pkginfo_filter_destroy(handle);
1717 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1718 const char *property, const int value);
1721 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1722 * @brief This API adds a string filter property to the filter handle
1724 * @par This API is for package-manager client application
1725 * @par Sync (or) Async : Synchronous API
1727 * @param[in] handle pointer to the package info filter handle.
1728 * @param[in] property string property name.
1729 * @param[in] value value corresponding to the property.
1730 * @return 0 if success, error code(<0) if fail
1731 * @retval PMINFO_R_OK success
1732 * @retval PMINFO_R_EINVAL invalid argument
1733 * @retval PMINFO_R_ERROR internal error
1734 * @pre pkgmgrinfo_pkginfo_filter_create()
1735 * @post pkgmgrinfo_pkginfo_filter_destroy()
1736 * @see pkgmgrinfo_pkginfo_filter_count()
1737 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1739 static int get_rpm_pkg_count()
1743 pkgmgrinfo_pkginfo_filter_h handle;
1744 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1745 if (ret != PMINFO_R_OK)
1747 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1748 if (ret != PMINFO_R_OK) {
1749 pkgmgrinfo_pkginfo_filter_destroy(handle);
1752 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1753 if (ret != PMINFO_R_OK) {
1754 pkgmgrinfo_pkginfo_filter_destroy(handle);
1757 printf("No of rpm pkgs: %d\n", count);
1758 pkgmgrinfo_pkginfo_filter_destroy(handle);
1763 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1764 const char *property, const char *value);
1767 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1768 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1770 * @par This API is for package-manager client application
1771 * @par Sync (or) Async : Synchronous API
1773 * @param[in] handle pointer to the package info filter handle.
1774 * @param[in] pkg_cb callback function.
1775 * @param[in] user_data user data to be passed to the callback function
1776 * @return 0 if success, error code(<0) if fail
1777 * @retval PMINFO_R_OK success
1778 * @retval PMINFO_R_EINVAL invalid argument
1779 * @retval PMINFO_R_ERROR internal error
1780 * @pre pkgmgrinfo_pkginfo_filter_create()
1781 * @post pkgmgrinfo_pkginfo_filter_destroy()
1782 * @see pkgmgrinfo_pkginfo_filter_count()
1784 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1787 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1788 printf("pkg id : %s\n", pkgid);
1792 static int get_rpm_pkg_list()
1795 pkgmgrinfo_pkginfo_filter_h handle;
1796 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1797 if (ret != PMINFO_R_OK)
1799 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1800 if (ret != PMINFO_R_OK) {
1801 pkgmgrinfo_pkginfo_filter_destroy(handle);
1804 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1805 if (ret != PMINFO_R_OK) {
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1809 pkgmgrinfo_pkginfo_filter_destroy(handle);
1814 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1815 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1818 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1819 * @brief This API counts the package that satisfy the filter conditions
1821 * @par This API is for package-manager client application
1822 * @par Sync (or) Async : Synchronous API
1824 * @param[in] handle pointer to the package info filter handle.
1825 * @param[in] count pointer to store the count value.
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_filter_create()
1831 * @post pkgmgrinfo_pkginfo_filter_destroy()
1832 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1834 static int get_rpm_pkg_count()
1838 pkgmgrinfo_pkginfo_filter_h handle;
1839 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1840 if (ret != PMINFO_R_OK)
1842 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1843 if (ret != PMINFO_R_OK) {
1844 pkgmgrinfo_pkginfo_filter_destroy(handle);
1847 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1848 if (ret != PMINFO_R_OK) {
1849 pkgmgrinfo_pkginfo_filter_destroy(handle);
1852 printf("No of rpm pkgs: %d\n", count);
1853 pkgmgrinfo_pkginfo_filter_destroy(handle);
1858 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1861 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1862 pkgmgrinfo_app_list_cb app_func, void *user_data)
1863 * @brief This API gets list of installed applications for a particular package
1865 * @par This API is for package-manager client application
1866 * @par Sync (or) Async : Synchronous API
1867 * @param[in] handle package info handle
1868 * @param[in] component application component
1869 * @param[in] app_func iteration function for list
1870 * @param[in] user_data user data to be passed to callback function
1871 * @return 0 if success, error code(<0) if fail
1872 * @retval PMINFO_R_OK success
1873 * @retval PMINFO_R_EINVAL invalid argument
1874 * @retval PMINFO_R_ERROR internal error
1875 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1876 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1878 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1881 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1882 printf("appid : %s\n", appid);
1886 static int list_apps(const char *pkgid)
1889 pkgmgrinfo_pkginfo_h handle;
1890 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1891 if (ret != PMINFO_R_OK)
1893 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1894 if (ret != PMINFO_R_OK) {
1895 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1903 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1904 pkgmgrinfo_app_list_cb app_func, void *user_data);
1907 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1908 * @brief This API gets list of installed applications from all packages.
1910 * @par This API is for package-manager client application
1911 * @par Sync (or) Async : Synchronous API
1912 * @param[in] app_func iteration function for list
1913 * @param[in] user_data user data to be passed to callback function
1914 * @return 0 if success, error code(<0) if fail
1915 * @retval PMINFO_R_OK success
1916 * @retval PMINFO_R_EINVAL invalid argument
1917 * @retval PMINFO_R_ERROR internal error
1921 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1923 char *pkgid1 = NULL;
1924 char *pkgid2 = NULL;
1925 pkgid1 = (char *)user_data;
1926 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1927 if (strcmp(pkgid1, pkgid2) == 0) {
1934 static int list_apps()
1937 char *name = "helloworld";
1938 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1939 if (ret != PMINFO_R_OK) {
1946 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1949 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
1950 * @brief This API creates the application information handle from db
1952 * @par This API is for package-manager client application
1953 * @par Sync (or) Async : Synchronous API
1955 * @param[in] appid pointer to appid
1956 * @param[out] handle pointer to the application info handle.
1957 * @return 0 if success, error code(<0) if fail
1958 * @retval PMINFO_R_OK success
1959 * @retval PMINFO_R_EINVAL invalid argument
1960 * @retval PMINFO_R_ERROR internal error
1962 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1963 * @see pkgmgrinfo_appinfo_get_pkgid()
1964 * @see pkgmgrinfo_appinfo_is_multiple()
1966 static int get_app_type(const char *appid)
1970 pkgmgrinfo_appinfo_h handle;
1971 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1972 if (ret != PMINFO_R_OK)
1974 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
1975 if (ret != PMINFO_R_OK) {
1976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1979 printf("apptype: %s\n", type);
1980 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1985 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
1988 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
1989 * @brief This API gets the application ID
1991 * @par This API is for package-manager client application
1992 * @par Sync (or) Async : Synchronous API
1994 * @param[in] handle pointer to the application info handle.
1995 * @param[out] appid pointer to hold appid
1996 * @return 0 if success, error code(<0) if fail
1997 * @retval PMINFO_R_OK success
1998 * @retval PMINFO_R_EINVAL invalid argument
1999 * @retval PMINFO_R_ERROR internal error
2000 * @pre pkgmgrinfo_appinfo_get_appinfo()
2001 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2002 * @see pkgmgrinfo_appinfo_get_pkgid()
2003 * @see pkgmgrinfo_appinfo_is_multiple()
2005 static int get_app_id(const char *appid)
2008 char *app_id = NULL;
2009 pkgmgrinfo_appinfo_h handle;
2010 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2011 if (ret != PMINFO_R_OK)
2013 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2014 if (ret != PMINFO_R_OK) {
2015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2018 printf("app id: %s\n", app_id);
2019 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2024 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2027 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2028 * @brief This API gets the package name of the application
2030 * @par This API is for package-manager client application
2031 * @par Sync (or) Async : Synchronous API
2033 * @param[in] handle pointer to the application info handle.
2034 * @param[out] pkg_name pointer to hold package name
2035 * @return 0 if success, error code(<0) if fail
2036 * @retval PMINFO_R_OK success
2037 * @retval PMINFO_R_EINVAL invalid argument
2038 * @retval PMINFO_R_ERROR internal error
2039 * @pre pkgmgrinfo_appinfo_get_appinfo()
2040 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2041 * @see pkgmgrinfo_appinfo_get_appid()
2042 * @see pkgmgrinfo_appinfo_is_multiple()
2044 static int get_app_pkgname(const char *appid)
2047 char *pkgname = NULL;
2048 pkgmgrinfo_appinfo_h handle;
2049 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2050 if (ret != PMINFO_R_OK)
2052 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2053 if (ret != PMINFO_R_OK) {
2054 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2057 printf("pkg name: %s\n", pkgname);
2058 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2063 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2066 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2067 * @brief This API gets the package id of the application
2069 * @par This API is for package-manager client application
2070 * @par Sync (or) Async : Synchronous API
2072 * @param[in] handle pointer to the application info handle.
2073 * @param[out] pkgid pointer to hold package id
2074 * @return 0 if success, error code(<0) if fail
2075 * @retval PMINFO_R_OK success
2076 * @retval PMINFO_R_EINVAL invalid argument
2077 * @retval PMINFO_R_ERROR internal error
2078 * @pre pkgmgrinfo_appinfo_get_appinfo()
2079 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2080 * @see pkgmgrinfo_appinfo_get_appid()
2081 * @see pkgmgrinfo_appinfo_is_multiple()
2083 static int get_app_pkgid(const char *appid)
2087 pkgmgrinfo_appinfo_h handle;
2088 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2089 if (ret != PMINFO_R_OK)
2091 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2092 if (ret != PMINFO_R_OK) {
2093 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2096 printf("pkg id: %s\n", pkgid);
2097 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2102 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2105 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2106 * @brief This API gets the executable name of the application
2108 * @par This API is for package-manager client application
2109 * @par Sync (or) Async : Synchronous API
2111 * @param[in] handle pointer to the application info handle.
2112 * @param[out] exec pointer to hold app exec name
2113 * @return 0 if success, error code(<0) if fail
2114 * @retval PMINFO_R_OK success
2115 * @retval PMINFO_R_EINVAL invalid argument
2116 * @retval PMINFO_R_ERROR internal error
2117 * @pre pkgmgrinfo_appinfo_get_appinfo()
2118 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2119 * @see pkgmgrinfo_appinfo_get_appid()
2120 * @see pkgmgrinfo_appinfo_is_multiple()
2122 static int get_app_exec(const char *appid)
2126 pkgmgrinfo_appinfo_h handle;
2127 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2128 if (ret != PMINFO_R_OK)
2130 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2131 if (ret != PMINFO_R_OK) {
2132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2135 printf("exec name: %s\n", exec);
2136 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2141 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2144 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2145 * @brief This API gets the icon name of the application
2147 * @par This API is for package-manager client application
2148 * @par Sync (or) Async : Synchronous API
2150 * @param[in] handle pointer to the application info handle.
2151 * @param[out] icon pointer to hold app icon name
2152 * @return 0 if success, error code(<0) if fail
2153 * @retval PMINFO_R_OK success
2154 * @retval PMINFO_R_EINVAL invalid argument
2155 * @retval PMINFO_R_ERROR internal error
2156 * @pre pkgmgrinfo_appinfo_get_appinfo()
2157 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2158 * @see pkgmgrinfo_appinfo_get_appid()
2159 * @see pkgmgrinfo_appinfo_is_multiple()
2161 static int get_app_icon(const char *appid)
2165 pkgmgrinfo_appinfo_h handle;
2166 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2167 if (ret != PMINFO_R_OK)
2169 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2170 if (ret != PMINFO_R_OK) {
2171 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2174 printf("icon name: %s\n", icon);
2175 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2180 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2183 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2184 * @brief This API gets the label of the application
2186 * @par This API is for package-manager client application
2187 * @par Sync (or) Async : Synchronous API
2189 * @param[in] handle pointer to the application info handle.
2190 * @param[out] label pointer to hold app label
2191 * @return 0 if success, error code(<0) if fail
2192 * @retval PMINFO_R_OK success
2193 * @retval PMINFO_R_EINVAL invalid argument
2194 * @retval PMINFO_R_ERROR internal error
2195 * @pre pkgmgrinfo_appinfo_get_appinfo()
2196 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2197 * @see pkgmgrinfo_appinfo_get_appid()
2198 * @see pkgmgrinfo_appinfo_is_multiple()
2200 static int get_app_label(const char *appid)
2204 pkgmgrinfo_appinfo_h handle;
2205 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2206 if (ret != PMINFO_R_OK)
2208 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2209 if (ret != PMINFO_R_OK) {
2210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2213 printf("label : %s\n", label);
2214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2219 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2222 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2223 * @brief This API gets the component of the application
2225 * @par This API is for package-manager client application
2226 * @par Sync (or) Async : Synchronous API
2228 * @param[in] handle pointer to the application info handle.
2229 * @param[out] component pointer to hold app component
2230 * @return 0 if success, error code(<0) if fail
2231 * @retval PMINFO_R_OK success
2232 * @retval PMINFO_R_EINVAL invalid argument
2233 * @retval PMINFO_R_ERROR internal error
2234 * @pre pkgmgrinfo_appinfo_get_appinfo()
2235 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2236 * @see pkgmgrinfo_appinfo_get_appid()
2237 * @see pkgmgrinfo_appinfo_is_multiple()
2239 static int get_app_component(const char *appid)
2242 pkgmgrinfo_app_component component;
2243 pkgmgrinfo_appinfo_h handle;
2244 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2245 if (ret != PMINFO_R_OK)
2247 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2248 if (ret != PMINFO_R_OK) {
2249 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2252 printf("component : %s\n", component);
2253 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2258 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2261 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2262 * @brief This API gets the apptype of the application
2264 * @par This API is for package-manager client application
2265 * @par Sync (or) Async : Synchronous API
2267 * @param[in] handle pointer to the application info handle.
2268 * @param[out] app_type pointer to hold apptype
2269 * @return 0 if success, error code(<0) if fail
2270 * @retval PMINFO_R_OK success
2271 * @retval PMINFO_R_EINVAL invalid argument
2272 * @retval PMINFO_R_ERROR internal error
2273 * @pre pkgmgrinfo_appinfo_get_appinfo()
2274 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2275 * @see pkgmgrinfo_appinfo_get_appid()
2276 * @see pkgmgrinfo_appinfo_is_multiple()
2278 static int get_app_type(const char *appid)
2281 char *apptype = NULL;
2282 pkgmgrinfo_appinfo_h handle;
2283 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2284 if (ret != PMINFO_R_OK)
2286 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2287 if (ret != PMINFO_R_OK) {
2288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2291 printf("apptype : %s\n", apptype);
2292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2297 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2300 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2301 int *operation_count, char ***operation)
2302 * @brief This API gets the list of operation of the application
2304 * @par This API is for package-manager client application
2305 * @par Sync (or) Async : Synchronous API
2307 * @param[in] handle pointer to the appcontrol handle.
2308 * @param[out] operation_count pointer to hold number of operations
2309 * @param[out] operation pointer to hold list of operations
2310 * @return 0 if success, error code(<0) if fail
2311 * @retval PMINFO_R_OK success
2312 * @retval PMINFO_R_EINVAL invalid argument
2313 * @retval PMINFO_R_ERROR internal error
2314 * @pre pkgmgrinfo_appinfo_get_appinfo()
2315 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2316 * @see pkgmgrinfo_appinfo_get_uri()
2317 * @see pkgmgrinfo_appinfo_get_mime()
2319 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2324 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2325 for (i = 0; i < oc; i++) {
2326 if (strcmp(operation[i], (char *)user_data) == 0)
2333 static int check_operation(const char *appid, char *operation)
2336 pkgmgrinfo_appinfo_h handle;
2337 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2338 if (ret != PMINFO_R_OK)
2340 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2341 if (ret != PMINFO_R_OK) {
2342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2350 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2351 int *operation_count, char ***operation);
2354 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2355 int *uri_count, char ***uri)
2356 * @brief This API gets the list of uri of the application
2358 * @par This API is for package-manager client application
2359 * @par Sync (or) Async : Synchronous API
2361 * @param[in] handle pointer to the appcontrol handle.
2362 * @param[out] uri_count pointer to hold number of uris
2363 * @param[out] uri pointer to hold list of uris
2364 * @return 0 if success, error code(<0) if fail
2365 * @retval PMINFO_R_OK success
2366 * @retval PMINFO_R_EINVAL invalid argument
2367 * @retval PMINFO_R_ERROR internal error
2368 * @pre pkgmgrinfo_appinfo_get_appinfo()
2369 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2370 * @see pkgmgrinfo_appinfo_get_operation()
2371 * @see pkgmgrinfo_appinfo_get_mime()
2373 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2378 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2379 for (i = 0; i < uc; i++) {
2380 if (strcmp(uri[i], (char *)user_data) == 0)
2387 static int check_uri(const char *appid, char *uri)
2390 pkgmgrinfo_appinfo_h handle;
2391 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2392 if (ret != PMINFO_R_OK)
2394 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2395 if (ret != PMINFO_R_OK) {
2396 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2399 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2404 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2405 int *uri_count, char ***uri);
2408 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2409 int *mime_count, char ***mime)
2410 * @brief This API gets the list of mime of the application
2412 * @par This API is for package-manager client application
2413 * @par Sync (or) Async : Synchronous API
2415 * @param[in] handle pointer to the appcontrol handle.
2416 * @param[out] mime_count pointer to hold number of mimes
2417 * @param[out] mime pointer to hold list of mimes
2418 * @return 0 if success, error code(<0) if fail
2419 * @retval PMINFO_R_OK success
2420 * @retval PMINFO_R_EINVAL invalid argument
2421 * @retval PMINFO_R_ERROR internal error
2422 * @pre pkgmgrinfo_appinfo_get_appinfo()
2423 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2424 * @see pkgmgrinfo_appinfo_get_uri()
2425 * @see pkgmgrinfo_appinfo_get_operation()
2427 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2432 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2433 for (i = 0; i < mc; i++) {
2434 if (strcmp(mime[i], (char *)user_data) == 0)
2441 static int check_mime(const char *appid, char *mime)
2444 pkgmgrinfo_appinfo_h handle;
2445 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2446 if (ret != PMINFO_R_OK)
2448 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2449 if (ret != PMINFO_R_OK) {
2450 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2458 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2459 int *mime_count, char ***mime);
2462 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2463 * @brief This API gets the notification icon of the application
2465 * @par This API is for package-manager client application
2466 * @par Sync (or) Async : Synchronous API
2468 * @param[in] handle pointer to the application info handle.
2469 * @param[out] path pointer to hold notification icon
2470 * @return 0 if success, error code(<0) if fail
2471 * @retval PMINFO_R_OK success
2472 * @retval PMINFO_R_EINVAL invalid argument
2473 * @retval PMINFO_R_ERROR internal error
2474 * @pre pkgmgrinfo_appinfo_get_appinfo()
2475 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2476 * @see pkgmgrinfo_appinfo_get_appid()
2477 * @see pkgmgrinfo_appinfo_is_multiple()
2479 static int get_app_notification_icon(const char *appid)
2482 char *notification_icon = NULL;
2483 pkgmgrinfo_appinfo_h handle;
2484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2485 if (ret != PMINFO_R_OK)
2487 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2488 if (ret != PMINFO_R_OK) {
2489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 printf("notification icon : %s\n", notification_icon);
2493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2498 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2501 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2502 * @brief This API gets the setting icon of the application
2504 * @par This API is for package-manager client application
2505 * @par Sync (or) Async : Synchronous API
2507 * @param[in] handle pointer to the application info handle.
2508 * @param[out] path pointer to hold setting icon
2509 * @return 0 if success, error code(<0) if fail
2510 * @retval PMINFO_R_OK success
2511 * @retval PMINFO_R_EINVAL invalid argument
2512 * @retval PMINFO_R_ERROR internal error
2513 * @pre pkgmgrinfo_appinfo_get_appinfo()
2514 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2515 * @see pkgmgrinfo_appinfo_get_appid()
2516 * @see pkgmgrinfo_appinfo_is_multiple()
2518 static int get_app_setting_icon(const char *appid)
2521 char *setting_icon = NULL;
2522 pkgmgrinfo_appinfo_h handle;
2523 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2524 if (ret != PMINFO_R_OK)
2526 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2527 if (ret != PMINFO_R_OK) {
2528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2531 printf("setting icon : %s\n", setting_icon);
2532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2537 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2540 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2541 * @brief This API gets the type of recent image on app-tray
2543 * @par This API is for package-manager client application
2544 * @par Sync (or) Async : Synchronous API
2546 * @param[in] handle pointer to the application info handle.
2547 * @param[out] type pointer to hold image type
2548 * @return 0 if success, error code(<0) if fail
2549 * @retval PMINFO_R_OK success
2550 * @retval PMINFO_R_EINVAL invalid argument
2551 * @retval PMINFO_R_ERROR internal error
2552 * @pre pkgmgrinfo_appinfo_get_appinfo()
2553 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2554 * @see pkgmgrinfo_appinfo_get_appid()
2555 * @see pkgmgrinfo_appinfo_is_multiple()
2557 static int get_app_recent_image_type(const char *appid)
2560 pkgmgrinfo_app_recentimage type;
2561 pkgmgrinfo_appinfo_h handle;
2562 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2563 if (ret != PMINFO_R_OK)
2565 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2566 if (ret != PMINFO_R_OK) {
2567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2570 printf("recent image type: %d\n", type);
2571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2576 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2580 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2581 * @brief This API gets the preview image of application
2583 * @par Sync (or) Async : Synchronous API
2585 * @param[in] handle pointer to the application info handle.
2586 * @param[out] preview_img pointer to hold preview image path
2587 * @return 0 if success, error code(<0) if fail
2588 * @retval PMINFO_R_OK success
2589 * @retval PMINFO_R_EINVAL invalid argument
2590 * @retval PMINFO_R_ERROR internal error
2591 * @pre pkgmgrinfo_appinfo_get_appinfo()
2592 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2593 * @see pkgmgrinfo_appinfo_get_appid()
2595 static int get_app_previewimage(const char *appid)
2598 char *preview = NULL;
2599 pkgmgrinfo_appinfo_h handle = NULL;
2600 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2601 if (ret != PMINFO_R_OK)
2603 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2604 if (ret != PMINFO_R_OK) {
2605 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2608 printf("preview image path : %s\n", preview);
2609 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2614 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2618 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2619 * @brief This API gets the package permission type of the application
2621 * @par This API is for package-manager client application
2622 * @par Sync (or) Async : Synchronous API
2624 * @param[in] handle pointer to the application info handle.
2625 * @param[out] permission pointer to hold package permission
2626 * @return 0 if success, error code(<0) if fail
2627 * @retval PMINFO_R_OK success
2628 * @retval PMINFO_R_EINVAL invalid argument
2629 * @retval PMINFO_R_ERROR internal error
2630 * @pre pkgmgrinfo_appinfo_get_appinfo()
2631 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2632 * @see pkgmgrinfo_appinfo_get_appid()
2634 static int get_app_permission(const char *appid)
2637 pkgmgrinfo_permission_type permission = 0;
2638 pkgmgrinfo_appinfo_h handle;
2640 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2641 if (ret != PMINFO_R_OK)
2643 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2644 if (ret != PMINFO_R_OK) {
2645 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2648 printf("permission type: %d\n", permission);
2649 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2654 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2657 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2658 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2659 * @brief This API gets the list of category 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] category_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 category_func(const char *name, void *user_data)
2675 if (strcmp(name, (char *)user_data) == 0)
2681 static int list_category(const char *appid, char *category)
2684 pkgmgrinfo_appinfo_h handle;
2685 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2686 if (ret != PMINFO_R_OK)
2688 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2689 if (ret != PMINFO_R_OK) {
2690 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2693 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2698 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2699 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2702 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2703 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2704 * @brief This API gets the list of metadata for a particular application
2706 * @par This API is for package-manager client application
2707 * @par Sync (or) Async : Synchronous API
2708 * @param[in] handle pointer to the application info handle.
2709 * @param[in] metadata_func callback function for list
2710 * @param[in] user_data user data to be passed to callback function
2711 * @return 0 if success, error code(<0) if fail
2712 * @retval PMINFO_R_OK success
2713 * @retval PMINFO_R_EINVAL invalid argument
2714 * @retval PMINFO_R_ERROR internal error
2715 * @pre pkgmgrinfo_appinfo_get_appinfo()
2716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2718 int metadata_func(const char *name, const char *value, void *user_data)
2720 if (strcmp(name, (char *)user_data) == 0) {
2721 printf("Value is %s\n", value);
2728 static int list_metadata(const char *appid, char *name)
2731 pkgmgrinfo_appinfo_h handle;
2732 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2733 if (ret != PMINFO_R_OK)
2735 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)name);
2736 if (ret != PMINFO_R_OK) {
2737 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2745 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
2746 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
2750 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2751 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2752 * @brief This API gets the list of app-control for a particular application
2754 * @par This API is for package-manager client application
2755 * @par Sync (or) Async : Synchronous API
2756 * @param[in] handle pointer to the application info handle.
2757 * @param[in] appcontrol_func callback function for list
2758 * @param[in] user_data user data to be passed to callback function
2759 * @return 0 if success, error code(<0) if fail
2760 * @retval PMINFO_R_OK success
2761 * @retval PMINFO_R_EINVAL invalid argument
2762 * @retval PMINFO_R_ERROR internal error
2763 * @pre pkgmgrinfo_appinfo_get_appinfo()
2764 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2766 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2771 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2772 for (i = 0; i < oc; i++) {
2773 if (strcmp(operation[i], (char *)user_data) == 0)
2780 static int check_operation(const char *appid, char *operation)
2783 pkgmgrinfo_appinfo_h handle;
2784 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2785 if (ret != PMINFO_R_OK)
2787 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2788 if (ret != PMINFO_R_OK) {
2789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2792 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2798 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2801 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2802 * @brief This API gets the application 'nodisplay' value from the app ID
2804 * @par This API is for package-manager client application
2805 * @par Sync (or) Async : Synchronous API
2807 * @param[in] handle pointer to application info handle
2808 * @param[out] nodisplay pointer to hold package nodisplay value
2809 * @return 0 if success, error code(<0) if fail
2810 * @retval PMINFO_R_OK success
2811 * @retval PMINFO_R_EINVAL invalid argument
2812 * @retval PMINFO_R_ERROR internal error
2813 * @pre pkgmgrinfo_appinfo_get_appinfo()
2814 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2815 * @see pkgmgrinfo_appinfo_get_appid()
2816 * @see pkgmgrinfo_appinfo_is_multiple()
2818 static int get_app_nodisplay(const char *appid)
2822 pkgmgrinfo_appinfo_h handle;
2823 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2824 if (ret != PMINFO_R_OK)
2826 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2827 if (ret != PMINFO_R_OK) {
2828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2831 printf("app nodisplay: %d\n", nodisplay);
2832 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2840 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2841 * @brief This API gets the application 'multiple' value from the app ID
2843 * @par This API is for package-manager client application
2844 * @par Sync (or) Async : Synchronous API
2846 * @param[in] handle pointer to application info handle
2847 * @param[out] multiple pointer to hold package multiple value
2848 * @return 0 if success, error code(<0) if fail
2849 * @retval PMINFO_R_OK success
2850 * @retval PMINFO_R_EINVAL invalid argument
2851 * @retval PMINFO_R_ERROR internal error
2852 * @pre pkgmgrinfo_appinfo_get_appinfo()
2853 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2854 * @see pkgmgrinfo_appinfo_get_appid()
2855 * @see pkgmgrinfo_appinfo_is_nodisplay()
2857 static int get_app_multiple(const char *appid)
2861 pkgmgrinfo_appinfo_h handle;
2862 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2863 if (ret != PMINFO_R_OK)
2865 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2866 if (ret != PMINFO_R_OK) {
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2870 printf("app multiple: %d\n", multiple);
2871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2879 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
2880 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
2881 * application launching effect. If fales, indicator will be hidden during application launching effect
2883 * @par This API is for package-manager client application
2884 * @par Sync (or) Async : Synchronous API
2886 * @param[in] handle pointer to application info handle
2887 * @param[out] indicator_disp contains indicator display status for application launching effect
2888 * @return 0 if success, error code(<0) if fail
2889 * @retval PMINFO_R_OK success
2890 * @retval PMINFO_R_EINVAL invalid argument
2891 * @retval PMINFO_R_ERROR internal error
2892 * @pre pkgmgrinfo_appinfo_get_appinfo()
2893 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2894 * @see pkgmgrinfo_appinfo_get_appid()
2895 * @see pkgmgrinfo_appinfo_is_nodisplay()
2897 static int get_app_indicator_display(const char *appid)
2900 bool indicator_disp;
2901 pkgmgrinfo_appinfo_h handle;
2902 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2903 if (ret != PMINFO_R_OK)
2905 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
2906 if (ret != PMINFO_R_OK){
2907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2910 printf("app indicator disp : %d\n", indicator_disp);
2911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2916 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
2919 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2920 * @brief This API gets the application's landscape & portrait effect images
2922 * @par This API is for package-manager client application
2923 * @par Sync (or) Async : Synchronous API
2925 * @param[in] handle pointer to application info handle
2926 * @param[out] portrait_img contains portrait mode effect image
2927 * @param[out] landscape_img contains landscape mode effect image
2928 * @return 0 if success, error code(<0) if fail
2929 * @retval PMINFO_R_OK success
2930 * @retval PMINFO_R_EINVAL invalid argument
2931 * @retval PMINFO_R_ERROR internal error
2932 * @pre pkgmgrinfo_appinfo_get_appinfo()
2933 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2934 * @see pkgmgrinfo_appinfo_get_appid()
2935 * @see pkgmgrinfo_appinfo_is_nodisplay()
2937 static int get_app_effectimages(const char *appid)
2940 char *portraitimg = NULL;
2941 char *landscapeimg = NULL;
2942 pkgmgrinfo_appinfo_h handle;
2943 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2944 if (ret != PMINFO_R_OK)
2946 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2947 if (ret != PMINFO_R_OK) {
2948 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2951 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2952 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2957 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
2960 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
2961 * @brief This API gets the application 'taskmanage' value from the app ID
2963 * @par This API is for package-manager client application
2964 * @par Sync (or) Async : Synchronous API
2966 * @param[in] handle pointer to application info handle
2967 * @param[out] taskmanage pointer to hold package taskmanage value
2968 * @return 0 if success, error code(<0) if fail
2969 * @retval PMINFO_R_OK success
2970 * @retval PMINFO_R_EINVAL invalid argument
2971 * @retval PMINFO_R_ERROR internal error
2972 * @pre pkgmgrinfo_appinfo_get_appinfo()
2973 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2974 * @see pkgmgrinfo_appinfo_get_appid()
2975 * @see pkgmgrinfo_appinfo_is_multiple()
2977 static int get_app_taskmanage(const char *appid)
2981 pkgmgrinfo_appinfo_h handle;
2982 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2983 if (ret != PMINFO_R_OK)
2985 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
2986 if (ret != PMINFO_R_OK) {
2987 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2990 printf("app taskmanage: %d\n", taskmanage);
2991 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2996 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
2999 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3000 * @brief This API gets the application 'taskmanage' value from the app ID
3002 * @par This API is for package-manager client application
3003 * @par Sync (or) Async : Synchronous API
3005 * @param[in] handle pointer to application info handle
3006 * @param[out] enabled pointer to hold package enabled value
3007 * @return 0 if success, error code(<0) if fail
3008 * @retval PMINFO_R_OK success
3009 * @retval PMINFO_R_EINVAL invalid argument
3010 * @retval PMINFO_R_ERROR internal error
3011 * @pre pkgmgrinfo_appinfo_get_appinfo()
3012 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3013 * @see pkgmgrinfo_appinfo_get_appid()
3014 * @see pkgmgrinfo_appinfo_is_multiple()
3016 static int get_app_enabled(const char *appid)
3020 pkgmgrinfo_appinfo_h handle;
3021 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3022 if (ret != PMINFO_R_OK)
3024 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3025 if (ret != PMINFO_R_OK) {
3026 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3029 printf("app enabled: %d\n", enabled);
3030 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3035 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3038 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3039 * @brief This API gets the application 'hwacceleration' value from the app ID
3041 * @par This API is for package-manager client application
3042 * @par Sync (or) Async : Synchronous API
3044 * @param[in] handle pointer to application info handle
3045 * @param[out] hwacceleration pointer to hold package hwacceleration value
3046 * @return 0 if success, error code(<0) if fail
3047 * @retval PMINFO_R_OK success
3048 * @retval PMINFO_R_EINVAL invalid argument
3049 * @retval PMINFO_R_ERROR internal error
3050 * @pre pkgmgrinfo_appinfo_get_appinfo()
3051 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3052 * @see pkgmgrinfo_appinfo_get_appid()
3053 * @see pkgmgrinfo_appinfo_is_multiple()
3055 static int get_app_hwacceleration(const char *appid)
3058 pkgmgrinfo_app_hwacceleration hwacceleration;
3059 pkgmgrinfo_appinfo_h handle;
3060 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3061 if (ret != PMINFO_R_OK)
3063 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3064 if (ret != PMINFO_R_OK) {
3065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3068 printf("app hwacceleration: %d\n", hwacceleration);
3069 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3074 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3077 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3078 * @brief This API gets the application 'onboot' value from the app ID
3080 * @par This API is for package-manager client application
3081 * @par Sync (or) Async : Synchronous API
3083 * @param[in] handle pointer to application info handle
3084 * @param[out] onboot pointer to hold package onboot value
3085 * @return 0 if success, error code(<0) if fail
3086 * @retval PMINFO_R_OK success
3087 * @retval PMINFO_R_EINVAL invalid argument
3088 * @retval PMINFO_R_ERROR internal error
3089 * @pre pkgmgrinfo_appinfo_get_appinfo()
3090 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3091 * @see pkgmgrinfo_appinfo_get_appid()
3092 * @see pkgmgrinfo_appinfo_is_multiple()
3094 static int get_app_onboot(const char *appid)
3098 pkgmgrinfo_appinfo_h handle;
3099 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3100 if (ret != PMINFO_R_OK)
3102 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3103 if (ret != PMINFO_R_OK) {
3104 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3107 printf("app onboot: %d\n", onboot);
3108 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3113 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3116 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3117 * @brief This API gets the application 'autorestart' value from the app ID
3119 * @par This API is for package-manager client application
3120 * @par Sync (or) Async : Synchronous API
3122 * @param[in] handle pointer to application info handle
3123 * @param[out] autorestart pointer to hold package autorestart value
3124 * @return 0 if success, error code(<0) if fail
3125 * @retval PMINFO_R_OK success
3126 * @retval PMINFO_R_EINVAL invalid argument
3127 * @retval PMINFO_R_ERROR internal error
3128 * @pre pkgmgrinfo_appinfo_get_appinfo()
3129 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3130 * @see pkgmgrinfo_appinfo_get_appid()
3131 * @see pkgmgrinfo_appinfo_is_multiple()
3133 static int get_app_autorestart(const char *appid)
3137 pkgmgrinfo_appinfo_h handle;
3138 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3139 if (ret != PMINFO_R_OK)
3141 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3142 if (ret != PMINFO_R_OK) {
3143 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3146 printf("app autorestart: %d\n", autorestart);
3147 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3152 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3155 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3156 * @brief This API gets the value for given application is main app or not from handle
3158 * @par This API is for package-manager client application
3159 * @par Sync (or) Async : Synchronous API
3161 * @param[in] handle pointer to application info handle
3162 * @param[out] mainapp pointer to hold package mainapp is or not
3163 * @return 0 if success, error code(<0) if fail
3164 * @retval PMINFO_R_OK success
3165 * @retval PMINFO_R_EINVAL invalid argument
3166 * @retval PMINFO_R_ERROR internal error
3167 * @pre pkgmgrinfo_appinfo_get_appinfo()
3168 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3169 * @see pkgmgrinfo_appinfo_get_appid()
3170 * @see pkgmgrinfo_appinfo_is_multiple()
3172 static int get_app_mainapp(const char *appid)
3176 pkgmgrinfo_appinfo_h handle;
3177 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3178 if (ret != PMINFO_R_OK)
3180 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3181 if (ret != PMINFO_R_OK) {
3182 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3185 printf("mainapp: %d\n", mainapp);
3186 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3191 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3194 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3195 * @brief This API destroys the application information handle freeing up all the resources
3197 * @par This API is for package-manager client application
3198 * @par Sync (or) Async : Synchronous API
3200 * @param[in] handle pointer to the application info handle.
3201 * @return 0 if success, error code(<0) if fail
3202 * @retval PMINFO_R_OK success
3203 * @retval PMINFO_R_EINVAL invalid argument
3204 * @retval PMINFO_R_ERROR internal error
3205 * @pre pkgmgrinfo_appinfo_get_appinfo()
3207 * @see pkgmgrinfo_appinfo_get_pkgid()
3208 * @see pkgmgrinfo_appinfo_is_multiple()
3210 static int get_app_type(const char *appid)
3214 pkgmgrinfo_appinfo_h handle;
3215 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3216 if (ret != PMINFO_R_OK)
3218 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3219 if (ret != PMINFO_R_OK) {
3220 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3223 printf("apptype: %s\n", type);
3224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3229 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3232 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3233 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3234 The query will search the entire application information collected from the manifest file of all the installed packages
3236 * @par This API is for package-manager client application
3237 * @par Sync (or) Async : Synchronous API
3239 * @param[out] handle pointer to the application info filter handle.
3240 * @return 0 if success, error code(<0) if fail
3241 * @retval PMINFO_R_OK success
3242 * @retval PMINFO_R_EINVAL invalid argument
3243 * @retval PMINFO_R_ERROR internal error
3245 * @post pkgmgrinfo_appinfo_filter_destroy()
3246 * @see pkgmgrinfo_appinfo_filter_count()
3247 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3249 static int get_capp_count()
3253 pkgmgrinfo_appinfo_filter_h handle;
3254 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3255 if (ret != PMINFO_R_OK)
3257 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3258 if (ret != PMINFO_R_OK) {
3259 pkgmgrinfo_appinfo_filter_destroy(handle);
3262 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3263 if (ret != PMINFO_R_OK) {
3264 pkgmgrinfo_appinfo_filter_destroy(handle);
3267 printf("No of capp: %d\n", count);
3268 pkgmgrinfo_appinfo_filter_destroy(handle);
3273 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3276 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3277 * @brief This API destroys the application information filter handle freeing up all the resources
3279 * @par This API is for package-manager client application
3280 * @par Sync (or) Async : Synchronous API
3282 * @param[in] handle pointer to the application info filter handle.
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()
3289 * @see pkgmgrinfo_appinfo_filter_count()
3290 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3292 static int get_capp_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_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
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 capp: %d\n", count);
3311 pkgmgrinfo_appinfo_filter_destroy(handle);
3316 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3319 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3320 * @brief This API adds a boolean filter property to the filter handle
3322 * @par This API is for package-manager client application
3323 * @par Sync (or) Async : Synchronous API
3325 * @param[in] handle pointer to the application info filter handle.
3326 * @param[in] property boolean property name.
3327 * @param[in] value value corresponding to the property.
3328 * @return 0 if success, error code(<0) if fail
3329 * @retval PMINFO_R_OK success
3330 * @retval PMINFO_R_EINVAL invalid argument
3331 * @retval PMINFO_R_ERROR internal error
3332 * @pre pkgmgrinfo_appinfo_filter_create()
3333 * @post pkgmgrinfo_appinfo_filter_destroy()
3334 * @see pkgmgrinfo_appinfo_filter_count()
3335 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3337 static int get_taskmanageable_app_count()
3341 pkgmgrinfo_appinfo_filter_h handle;
3342 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3343 if (ret != PMINFO_R_OK)
3345 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3346 if (ret != PMINFO_R_OK) {
3347 pkgmgrinfo_appinfo_filter_destroy(handle);
3350 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3351 if (ret != PMINFO_R_OK) {
3352 pkgmgrinfo_appinfo_filter_destroy(handle);
3355 printf("No of taskmanageable apps: %d\n", count);
3356 pkgmgrinfo_appinfo_filter_destroy(handle);
3361 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3362 const char *property, const bool value);
3365 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3366 * @brief This API adds an integer filter property to the filter handle
3368 * @par This API is for package-manager client application
3369 * @par Sync (or) Async : Synchronous API
3371 * @param[in] handle pointer to the application info filter handle.
3372 * @param[in] property integer property name.
3373 * @param[in] value value corresponding to the property.
3374 * @return 0 if success, error code(<0) if fail
3375 * @retval PMINFO_R_OK success
3376 * @retval PMINFO_R_EINVAL invalid argument
3377 * @retval PMINFO_R_ERROR internal error
3378 * @pre pkgmgrinfo_appinfo_filter_create()
3379 * @post pkgmgrinfo_appinfo_filter_destroy()
3380 * @see pkgmgrinfo_appinfo_filter_count()
3381 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3383 static int get_taskmanageable_app_count()
3387 pkgmgrinfo_appinfo_filter_h handle;
3388 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3389 if (ret != PMINFO_R_OK)
3391 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3392 if (ret != PMINFO_R_OK) {
3393 pkgmgrinfo_appinfo_filter_destroy(handle);
3396 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3397 if (ret != PMINFO_R_OK) {
3398 pkgmgrinfo_appinfo_filter_destroy(handle);
3401 printf("No of apps: %d\n", count);
3402 pkgmgrinfo_appinfo_filter_destroy(handle);
3407 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3408 const char *property, const int value);
3411 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3412 * @brief This API adds a string filter property to the filter handle
3414 * @par This API is for package-manager client application
3415 * @par Sync (or) Async : Synchronous API
3417 * @param[in] handle pointer to the application info filter handle.
3418 * @param[in] property string property name.
3419 * @param[in] value value corresponding to the property.
3420 * @return 0 if success, error code(<0) if fail
3421 * @retval PMINFO_R_OK success
3422 * @retval PMINFO_R_EINVAL invalid argument
3423 * @retval PMINFO_R_ERROR internal error
3424 * @pre pkgmgrinfo_appinfo_filter_create()
3425 * @post pkgmgrinfo_appinfo_filter_destroy()
3426 * @see pkgmgrinfo_appinfo_filter_count()
3427 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3429 static int get_capp_count()
3433 pkgmgrinfo_appinfo_filter_h handle;
3434 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3435 if (ret != PMINFO_R_OK)
3437 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3438 if (ret != PMINFO_R_OK) {
3439 pkgmgrinfo_appinfo_filter_destroy(handle);
3442 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3443 if (ret != PMINFO_R_OK) {
3444 pkgmgrinfo_appinfo_filter_destroy(handle);
3447 printf("No of capp: %d\n", count);
3448 pkgmgrinfo_appinfo_filter_destroy(handle);
3453 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3454 const char *property, const char *value);
3457 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3458 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3460 * @par This API is for package-manager client application
3461 * @par Sync (or) Async : Synchronous API
3463 * @param[in] handle pointer to the application info filter handle.
3464 * @param[in] app_cb callback function.
3465 * @param[in] user_data user data to be passed to the callback function
3466 * @return 0 if success, error code(<0) if fail
3467 * @retval PMINFO_R_OK success
3468 * @retval PMINFO_R_EINVAL invalid argument
3469 * @retval PMINFO_R_ERROR internal error
3470 * @pre pkgmgrinfo_appinfo_filter_create()
3471 * @post pkgmgrinfo_appinfo_filter_destroy()
3472 * @see pkgmgrinfo_appinfo_filter_count()
3474 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3477 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3478 printf("appid : %s\n", appid);
3482 static int get_capp_list()
3485 pkgmgrinfo_appinfo_filter_h handle;
3486 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3487 if (ret != PMINFO_R_OK)
3489 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3490 if (ret != PMINFO_R_OK) {
3491 pkgmgrinfo_appinfo_filter_destroy(handle);
3494 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3495 if (ret != PMINFO_R_OK) {
3496 pkgmgrinfo_appinfo_filter_destroy(handle);
3499 pkgmgrinfo_appinfo_filter_destroy(handle);
3504 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3505 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3508 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3509 * @brief This API counts the application that satisfy the filter conditions
3511 * @par This API is for package-manager client application
3512 * @par Sync (or) Async : Synchronous API
3514 * @param[in] handle pointer to the application info filter handle.
3515 * @param[in] count pointer to store count value
3516 * @return 0 if success, error code(<0) if fail
3517 * @retval PMINFO_R_OK success
3518 * @retval PMINFO_R_EINVAL invalid argument
3519 * @retval PMINFO_R_ERROR internal error
3520 * @pre pkgmgrinfo_appinfo_filter_create()
3521 * @post pkgmgrinfo_appinfo_filter_destroy()
3522 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3524 static int get_capp_count()
3528 pkgmgrinfo_appinfo_filter_h handle;
3529 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3530 if (ret != PMINFO_R_OK)
3532 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3533 if (ret != PMINFO_R_OK) {
3534 pkgmgrinfo_appinfo_filter_destroy(handle);
3537 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3538 if (ret != PMINFO_R_OK) {
3539 pkgmgrinfo_appinfo_filter_destroy(handle);
3542 printf("No of capp: %d\n", count);
3543 pkgmgrinfo_appinfo_filter_destroy(handle);
3548 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3551 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3552 * @brief This API creates the package cert information handle to get data from db.
3554 * @par This API is for package-manager client application
3555 * @par Sync (or) Async : Synchronous API
3557 * @param[out] handle pointer to the package cert handle.
3558 * @return 0 if success, error code(<0) if fail
3559 * @retval PMINFO_R_OK success
3560 * @retval PMINFO_R_EINVAL invalid argument
3561 * @retval PMINFO_R_ERROR internal error
3563 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3564 * @see pkgmgrinfo_pkginfo_get_cert_value()
3565 * @see pkgmgrinfo_pkginfo_load_certinfo()
3567 static int get_cert_info(const char *pkgid)
3570 pkgmgrinfo_certinfo_h handle;
3571 char *auth_cert = NULL;
3572 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3573 if (ret != PMINFO_R_OK)
3575 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3576 if (ret != PMINFO_R_OK) {
3577 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3580 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3581 if (ret != PMINFO_R_OK) {
3582 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3585 printf("Author root certificate: %s\n", auth_root);
3586 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3591 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3594 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3595 * @brief This API loads the package cert information handle with data from db.
3597 * @par This API is for package-manager client application
3598 * @par Sync (or) Async : Synchronous API
3600 * @param[in] pkgid pointer to the package ID.
3601 * @param[in] handle pointer to the package cert handle.
3602 * @return 0 if success, error code(<0) if fail
3603 * @retval PMINFO_R_OK success
3604 * @retval PMINFO_R_EINVAL invalid argument
3605 * @retval PMINFO_R_ERROR internal error
3606 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3607 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3608 * @see pkgmgrinfo_pkginfo_get_cert_value()
3610 static int get_cert_info(const char *pkgid)
3613 pkgmgrinfo_certinfo_h handle;
3614 char *auth_cert = NULL;
3615 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3616 if (ret != PMINFO_R_OK)
3618 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3619 if (ret != PMINFO_R_OK) {
3620 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3623 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3624 if (ret != PMINFO_R_OK) {
3625 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3628 printf("Author root certificate: %s\n", auth_root);
3629 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3634 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3637 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3638 * @brief This API gets the package cert information from the handle
3640 * @par This API is for package-manager client application
3641 * @par Sync (or) Async : Synchronous API
3643 * @param[in] handle pointer to the package cert handle.
3644 * @param[in] cert_type certificate type
3645 * @param[out] cert_value pointer to hold certificate value
3646 * @return 0 if success, error code(<0) if fail
3647 * @retval PMINFO_R_OK success
3648 * @retval PMINFO_R_EINVAL invalid argument
3649 * @retval PMINFO_R_ERROR internal error
3650 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3651 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3652 * @see pkgmgrinfo_pkginfo_load_certinfo()
3654 static int get_cert_info(const char *pkgid)
3657 pkgmgrinfo_certinfo_h handle;
3658 char *auth_cert = NULL;
3659 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3660 if (ret != PMINFO_R_OK)
3662 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3663 if (ret != PMINFO_R_OK) {
3664 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3667 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3668 if (ret != PMINFO_R_OK) {
3669 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3672 printf("Author root certificate: %s\n", auth_root);
3673 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3678 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3681 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3682 * @brief This API destroys the package cert information handle freeing up all the resources
3684 * @par This API is for package-manager client application
3685 * @par Sync (or) Async : Synchronous API
3687 * @param[in] handle pointer to the package cert handle.
3688 * @return 0 if success, error code(<0) if fail
3689 * @retval PMINFO_R_OK success
3690 * @retval PMINFO_R_EINVAL invalid argument
3691 * @retval PMINFO_R_ERROR internal error
3692 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3694 * @see pkgmgrinfo_pkginfo_load_certinfo()
3696 static int get_cert_info(const char *pkgid)
3699 pkgmgrinfo_certinfo_h handle;
3700 char *auth_cert = NULL;
3701 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3702 if (ret != PMINFO_R_OK)
3704 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3705 if (ret != PMINFO_R_OK) {
3706 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3709 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3710 if (ret != PMINFO_R_OK) {
3711 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3714 printf("Author root certificate: %s\n", auth_root);
3715 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3720 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
3723 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
3724 * @brief This API deletes the package cert information from DB
3726 * @par This API is for package-manager client application
3727 * @par Sync (or) Async : Synchronous API
3729 * @param[in] pkgid pointer to the package ID.
3730 * @return 0 if success, error code(<0) if fail
3731 * @retval PMINFO_R_OK success
3732 * @retval PMINFO_R_EINVAL invalid argument
3733 * @retval PMINFO_R_ERROR internal error
3737 static int delete_cert_info(const char *pkgid)
3740 ret = pkgmgrinfo_delete_certinfo(pkgid);
3741 if (ret != PMINFO_R_OK)
3747 int pkgmgrinfo_delete_certinfo(const char *pkgid);
3750 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
3751 * @brief This API creates the package db information handle to set data in db.
3753 * @par This API is for package-manager client application
3754 * @par Sync (or) Async : Synchronous API
3756 * @param[in] pkgid pointer to the package ID.
3757 * @param[out] handle pointer to the package db info handle.
3758 * @return 0 if success, error code(<0) if fail
3759 * @retval PMINFO_R_OK success
3760 * @retval PMINFO_R_EINVAL invalid argument
3761 * @retval PMINFO_R_ERROR internal error
3763 * @post pkgmgrinfo_destroy_pkgdbinfo()
3764 * @see pkgmgrinfo_save_pkgdbinfo()
3765 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3767 static int set_pkg_in_db(const char *pkgid)
3770 pkgmgrinfo_pkgdbinfo_h handle;
3771 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3772 if (ret != PMINFO_R_OK)
3774 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3775 if (ret != PMINFO_R_OK) {
3776 pkgmgrinfo_destroy_pkgdbinfo(handle);
3779 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3780 if (ret != PMINFO_R_OK) {
3781 pkgmgrinfo_destroy_pkgdbinfo(handle);
3784 pkgmgrinfo_destroy_pkgdbinfo(handle);
3789 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
3792 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
3793 * @brief This API sets the package type in db handle
3795 * @par This API is for package-manager client application
3796 * @par Sync (or) Async : Synchronous API
3798 * @param[in] handle pointer to the pkgdbinfo handle.
3799 * @param[in] type pointer to the package type.
3800 * @return 0 if success, error code(<0) if fail
3801 * @retval PMINFO_R_OK success
3802 * @retval PMINFO_R_EINVAL invalid argument
3803 * @retval PMINFO_R_ERROR internal error
3804 * @pre pkgmgrinfo_create_pkgdbinfo()
3805 * @post pkgmgrinfo_destroy_pkgdbinfo()
3806 * @see pkgmgrinfo_save_pkgdbinfo()
3807 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
3809 static int set_pkg_type_in_db(const char *pkgid)
3812 pkgmgrinfo_pkgdbinfo_h handle;
3813 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3814 if (ret != PMINFO_R_OK)
3816 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
3817 if (ret != PMINFO_R_OK) {
3818 pkgmgrinfo_destroy_pkgdbinfo(handle);
3821 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3822 if (ret != PMINFO_R_OK) {
3823 pkgmgrinfo_destroy_pkgdbinfo(handle);
3826 pkgmgrinfo_destroy_pkgdbinfo(handle);
3831 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
3834 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
3835 * @brief This API sets the package version in db handle
3837 * @par This API is for package-manager client application
3838 * @par Sync (or) Async : Synchronous API
3840 * @param[in] handle pointer to the pkgdbinfo handle.
3841 * @param[in] version pointer to the package version
3842 * @return 0 if success, error code(<0) if fail
3843 * @retval PMINFO_R_OK success
3844 * @retval PMINFO_R_EINVAL invalid argument
3845 * @retval PMINFO_R_ERROR internal error
3846 * @pre pkgmgrinfo_create_pkgdbinfo()
3847 * @post pkgmgrinfo_destroy_pkgdbinfo()
3848 * @see pkgmgrinfo_save_pkgdbinfo()
3849 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3851 static int set_pkg_version_in_db(const char *pkgid)
3854 pkgmgrinfo_pkgdbinfo_h handle;
3855 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3856 if (ret != PMINFO_R_OK)
3858 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3859 if (ret != PMINFO_R_OK) {
3860 pkgmgrinfo_destroy_pkgdbinfo(handle);
3863 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3864 if (ret != PMINFO_R_OK) {
3865 pkgmgrinfo_destroy_pkgdbinfo(handle);
3868 pkgmgrinfo_destroy_pkgdbinfo(handle);
3873 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
3876 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
3877 * @brief This API sets the package install location in db handle
3879 * @par This API is for package-manager client application
3880 * @par Sync (or) Async : Synchronous API
3882 * @param[in] handle pointer to the pkgdbinfo handle.
3883 * @param[in] location package install location
3884 * @return 0 if success, error code(<0) if fail
3885 * @retval PMINFO_R_OK success
3886 * @retval PMINFO_R_EINVAL invalid argument
3887 * @retval PMINFO_R_ERROR internal error
3888 * @pre pkgmgrinfo_create_pkgdbinfo()
3889 * @post pkgmgrinfo_destroy_pkgdbinfo()
3890 * @see pkgmgrinfo_save_pkgdbinfo()
3891 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3893 static int set_pkg_install_location_in_db(const char *pkgid)
3896 pkgmgrinfo_pkgdbinfo_h handle;
3897 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3898 if (ret != PMINFO_R_OK)
3900 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
3901 if (ret != PMINFO_R_OK) {
3902 pkgmgrinfo_destroy_pkgdbinfo(handle);
3905 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3906 if (ret != PMINFO_R_OK) {
3907 pkgmgrinfo_destroy_pkgdbinfo(handle);
3910 pkgmgrinfo_destroy_pkgdbinfo(handle);
3915 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
3918 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
3919 * @brief This API sets the package size in db handle
3921 * @par This API is for package-manager client application
3922 * @par Sync (or) Async : Synchronous API
3924 * @param[in] handle pointer to the pkgdbinfo handle.
3925 * @param[in] size pointer to the package size
3926 * @return 0 if success, error code(<0) if fail
3927 * @retval PMINFO_R_OK success
3928 * @retval PMINFO_R_EINVAL invalid argument
3929 * @retval PMINFO_R_ERROR internal error
3930 * @pre pkgmgrinfo_create_pkgdbinfo()
3931 * @post pkgmgrinfo_destroy_pkgdbinfo()
3932 * @see pkgmgrinfo_save_pkgdbinfo()
3933 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3935 static int set_pkg_size_in_db(const char *pkgid)
3938 pkgmgrinfo_pkgdbinfo_h handle;
3939 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3940 if (ret != PMINFO_R_OK)
3942 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
3943 if (ret != PMINFO_R_OK) {
3944 pkgmgrinfo_destroy_pkgdbinfo(handle);
3947 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3948 if (ret != PMINFO_R_OK) {
3949 pkgmgrinfo_destroy_pkgdbinfo(handle);
3952 pkgmgrinfo_destroy_pkgdbinfo(handle);
3957 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
3960 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
3961 * @brief This API sets the package label in db handle
3963 * @par This API is for package-manager client application
3964 * @par Sync (or) Async : Synchronous API
3966 * @param[in] handle pointer to the pkgdbinfo handle.
3967 * @param[in] label pointer to the package label
3968 * @param[in] locale pointer to the locale
3969 * @return 0 if success, error code(<0) if fail
3970 * @retval PMINFO_R_OK success
3971 * @retval PMINFO_R_EINVAL invalid argument
3972 * @retval PMINFO_R_ERROR internal error
3973 * @pre pkgmgrinfo_create_pkgdbinfo()
3974 * @post pkgmgrinfo_destroy_pkgdbinfo()
3975 * @see pkgmgrinfo_save_pkgdbinfo()
3976 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3978 static int set_pkg_label_in_db(const char *pkgid)
3981 pkgmgrinfo_pkgdbinfo_h handle;
3982 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3983 if (ret != PMINFO_R_OK)
3985 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
3986 if (ret != PMINFO_R_OK) {
3987 pkgmgrinfo_destroy_pkgdbinfo(handle);
3990 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3991 if (ret != PMINFO_R_OK) {
3992 pkgmgrinfo_destroy_pkgdbinfo(handle);
3995 pkgmgrinfo_destroy_pkgdbinfo(handle);
4000 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4003 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4004 * @brief This API sets the package icon in db handle
4006 * @par This API is for package-manager client application
4007 * @par Sync (or) Async : Synchronous API
4009 * @param[in] handle pointer to the pkgdbinfo handle.
4010 * @param[in] icon pointer to the package icon
4011 * @param[in] locale pointer to the locale
4012 * @return 0 if success, error code(<0) if fail
4013 * @retval PMINFO_R_OK success
4014 * @retval PMINFO_R_EINVAL invalid argument
4015 * @retval PMINFO_R_ERROR internal error
4016 * @pre pkgmgrinfo_create_pkgdbinfo()
4017 * @post pkgmgrinfo_destroy_pkgdbinfo()
4018 * @see pkgmgrinfo_save_pkgdbinfo()
4019 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4021 static int set_pkg_icon_in_db(const char *pkgid)
4024 pkgmgrinfo_pkgdbinfo_h handle;
4025 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4026 if (ret != PMINFO_R_OK)
4028 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4029 if (ret != PMINFO_R_OK) {
4030 pkgmgrinfo_destroy_pkgdbinfo(handle);
4033 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4034 if (ret != PMINFO_R_OK) {
4035 pkgmgrinfo_destroy_pkgdbinfo(handle);
4038 pkgmgrinfo_destroy_pkgdbinfo(handle);
4043 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4046 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4047 * @brief This API sets the package description in db handle
4049 * @par This API is for package-manager client application
4050 * @par Sync (or) Async : Synchronous API
4052 * @param[in] handle pointer to the pkgdbinfo handle.
4053 * @param[in] description pointer to the package description
4054 * @param[in] locale pointer to the locale
4055 * @return 0 if success, error code(<0) if fail
4056 * @retval PMINFO_R_OK success
4057 * @retval PMINFO_R_EINVAL invalid argument
4058 * @retval PMINFO_R_ERROR internal error
4059 * @pre pkgmgrinfo_create_pkgdbinfo()
4060 * @post pkgmgrinfo_destroy_pkgdbinfo()
4061 * @see pkgmgrinfo_save_pkgdbinfo()
4062 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4064 static int set_pkg_description_in_db(const char *pkgid)
4067 pkgmgrinfo_pkgdbinfo_h handle;
4068 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4069 if (ret != PMINFO_R_OK)
4071 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4072 if (ret != PMINFO_R_OK) {
4073 pkgmgrinfo_destroy_pkgdbinfo(handle);
4076 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4077 if (ret != PMINFO_R_OK) {
4078 pkgmgrinfo_destroy_pkgdbinfo(handle);
4081 pkgmgrinfo_destroy_pkgdbinfo(handle);
4086 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4089 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4090 const char *author_email, const char *author_href, const char *locale)
4091 * @brief This API sets the package author info in db handle
4093 * @par This API is for package-manager client application
4094 * @par Sync (or) Async : Synchronous API
4096 * @param[in] handle pointer to the pkgdbinfo handle.
4097 * @param[in] author_name pointer to the package author name
4098 * @param[in] author_email pointer to the package author email
4099 * @param[in] author_href pointer to the package author href
4100 * @param[in] locale pointer to the locale
4101 * @return 0 if success, error code(<0) if fail
4102 * @retval PMINFO_R_OK success
4103 * @retval PMINFO_R_EINVAL invalid argument
4104 * @retval PMINFO_R_ERROR internal error
4105 * @pre pkgmgrinfo_create_pkgdbinfo()
4106 * @post pkgmgrinfo_destroy_pkgdbinfo()
4107 * @see pkgmgrinfo_save_pkgdbinfo()
4108 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4110 static int set_pkg_author_in_db(const char *pkgid)
4113 pkgmgrinfo_pkgdbinfo_h handle;
4114 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4115 if (ret != PMINFO_R_OK)
4117 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4118 if (ret != PMINFO_R_OK) {
4119 pkgmgrinfo_destroy_pkgdbinfo(handle);
4122 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4123 if (ret != PMINFO_R_OK) {
4124 pkgmgrinfo_destroy_pkgdbinfo(handle);
4127 pkgmgrinfo_destroy_pkgdbinfo(handle);
4132 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4133 const char *author_email, const char *author_href, const char *locale);
4136 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4137 * @brief This API sets the package 'removable' value in db handle
4139 * @par This API is for package-manager client application
4140 * @par Sync (or) Async : Synchronous API
4142 * @param[in] handle pointer to the pkgdbinfo handle.
4143 * @param[in] removable package removable value
4144 * @return 0 if success, error code(<0) if fail
4145 * @retval PMINFO_R_OK success
4146 * @retval PMINFO_R_EINVAL invalid argument
4147 * @retval PMINFO_R_ERROR internal error
4148 * @pre pkgmgrinfo_create_pkgdbinfo()
4149 * @post pkgmgrinfo_destroy_pkgdbinfo()
4150 * @see pkgmgrinfo_save_pkgdbinfo()
4151 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4153 static int set_pkg_removable_in_db(const char *pkgid)
4156 pkgmgrinfo_pkgdbinfo_h handle;
4157 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4158 if (ret != PMINFO_R_OK)
4160 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4161 if (ret != PMINFO_R_OK) {
4162 pkgmgrinfo_destroy_pkgdbinfo(handle);
4165 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4166 if (ret != PMINFO_R_OK) {
4167 pkgmgrinfo_destroy_pkgdbinfo(handle);
4170 pkgmgrinfo_destroy_pkgdbinfo(handle);
4175 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4178 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4179 * @brief This API sets the package 'preload' value in db handle
4181 * @par This API is for package-manager client application
4182 * @par Sync (or) Async : Synchronous API
4184 * @param[in] handle pointer to the pkgdbinfo handle.
4185 * @param[in] preload package preload value
4186 * @return 0 if success, error code(<0) if fail
4187 * @retval PMINFO_R_OK success
4188 * @retval PMINFO_R_EINVAL invalid argument
4189 * @retval PMINFO_R_ERROR internal error
4190 * @pre pkgmgrinfo_create_pkgdbinfo()
4191 * @post pkgmgrinfo_destroy_pkgdbinfo()
4192 * @see pkgmgrinfo_save_pkgdbinfo()
4193 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4195 static int set_pkg_preload_in_db(const char *pkgid)
4198 pkgmgrinfo_pkgdbinfo_h handle;
4199 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4200 if (ret != PMINFO_R_OK)
4202 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4203 if (ret != PMINFO_R_OK) {
4204 pkgmgrinfo_destroy_pkgdbinfo(handle);
4207 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4208 if (ret != PMINFO_R_OK) {
4209 pkgmgrinfo_destroy_pkgdbinfo(handle);
4212 pkgmgrinfo_destroy_pkgdbinfo(handle);
4217 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4220 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4221 * @brief This API saves all the information from the handle to the DB.
4223 * @par This API is for package-manager client application
4224 * @par Sync (or) Async : Synchronous API
4226 * @param[in] handle pointer to the package db info handle.
4227 * @return 0 if success, error code(<0) if fail
4228 * @retval PMINFO_R_OK success
4229 * @retval PMINFO_R_EINVAL invalid argument
4230 * @retval PMINFO_R_ERROR internal error
4231 * @pre pkgmgrinfo_create_pkgdbinfo()
4232 * @post pkgmgrinfo_destroy_pkgdbinfo()
4233 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4235 static int set_pkg_in_db(const char *pkgid)
4238 pkgmgrinfo_pkgdbinfo_h handle;
4239 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4240 if (ret != PMINFO_R_OK)
4242 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4243 if (ret != PMINFO_R_OK) {
4244 pkgmgrinfo_destroy_pkgdbinfo(handle);
4247 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_destroy_pkgdbinfo(handle);
4252 pkgmgrinfo_destroy_pkgdbinfo(handle);
4257 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4260 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4261 * @brief This API destroys the package db information handle freeing up all the resources
4263 * @par This API is for package-manager client application
4264 * @par Sync (or) Async : Synchronous API
4266 * @param[in] handle pointer to the package db info handle.
4267 * @return 0 if success, error code(<0) if fail
4268 * @retval PMINFO_R_OK success
4269 * @retval PMINFO_R_EINVAL invalid argument
4270 * @retval PMINFO_R_ERROR internal error
4271 * @pre pkgmgrinfo_create_pkgdbinfo()
4273 * @see pkgmgrinfo_save_pkgdbinfo()
4274 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4276 static int set_pkg_in_db(const char *pkgid)
4279 pkgmgrinfo_pkgdbinfo_h handle;
4280 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4281 if (ret != PMINFO_R_OK)
4283 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4284 if (ret != PMINFO_R_OK) {
4285 pkgmgrinfo_destroy_pkgdbinfo(handle);
4288 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4289 if (ret != PMINFO_R_OK) {
4290 pkgmgrinfo_destroy_pkgdbinfo(handle);
4293 pkgmgrinfo_destroy_pkgdbinfo(handle);
4298 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4301 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
4302 * @brief This API creates the package cert information handle to set data in db.
4304 * @par This API is for package-manager client application
4305 * @par Sync (or) Async : Synchronous API
4307 * @param[out] handle pointer to the package cert handle.
4308 * @return 0 if success, error code(<0) if fail
4309 * @retval PMINFO_R_OK success
4310 * @retval PMINFO_R_EINVAL invalid argument
4311 * @retval PMINFO_R_ERROR internal error
4313 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4314 * @see pkgmgrinfo_set_cert_value()
4315 * @see pkgmgrinfo_save_certinfo()
4317 static int set_cert_in_db(const char *pkgid)
4320 pkgmgrinfo_instcertinfo_h handle;
4321 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4322 if (ret != PMINFO_R_OK)
4324 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4325 if (ret != PMINFO_R_OK) {
4326 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4329 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4330 if (ret != PMINFO_R_OK) {
4331 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4334 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4339 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
4342 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
4343 * @brief This API sets the package cert information in the handle.
4345 * @par This API is for package-manager client application
4346 * @par Sync (or) Async : Synchronous API
4348 * @param[in] handle pointer to the package cert handle.
4349 * @param[in] cert_type certificate type.
4350 * @param[in] cert_value certificate value.
4351 * @return 0 if success, error code(<0) if fail
4352 * @retval PMINFO_R_OK success
4353 * @retval PMINFO_R_EINVAL invalid argument
4354 * @retval PMINFO_R_ERROR internal error
4355 * @pre pkgmgrinfo_create_certinfo_set_handle()
4356 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4357 * @see pkgmgrinfo_save_certinfo()
4359 static int set_cert_in_db(const char *pkgid)
4362 pkgmgrinfo_instcertinfo_h handle;
4363 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4364 if (ret != PMINFO_R_OK)
4366 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4367 if (ret != PMINFO_R_OK) {
4368 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4371 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4372 if (ret != PMINFO_R_OK) {
4373 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4376 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4381 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4384 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4385 * @brief This API saves the package cert information in the DB.
4387 * @par This API is for package-manager client application
4388 * @par Sync (or) Async : Synchronous API
4390 * @param[in] pkgid pointer to the package ID.
4391 * @param[in] handle pointer to the package cert handle.
4392 * @return 0 if success, error code(<0) if fail
4393 * @retval PMINFO_R_OK success
4394 * @retval PMINFO_R_EINVAL invalid argument
4395 * @retval PMINFO_R_ERROR internal error
4396 * @pre pkgmgrinfo_create_certinfo_set_handle()
4397 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4398 * @see pkgmgrinfo_save_certinfo()
4400 static int set_cert_in_db(const char *pkgid)
4403 pkgmgrinfo_instcertinfo_h handle;
4404 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4405 if (ret != PMINFO_R_OK)
4407 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4408 if (ret != PMINFO_R_OK) {
4409 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4412 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4413 if (ret != PMINFO_R_OK) {
4414 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4417 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4422 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4425 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4426 * @brief This API destroys the package cert information handle freeing up all the resources.
4428 * @par This API is for package-manager client application
4429 * @par Sync (or) Async : Synchronous API
4431 * @param[in] handle pointer to the package cert handle.
4432 * @return 0 if success, error code(<0) if fail
4433 * @retval PMINFO_R_OK success
4434 * @retval PMINFO_R_EINVAL invalid argument
4435 * @retval PMINFO_R_ERROR internal error
4436 * @pre pkgmgrinfo_create_certinfo_set_handle()
4438 * @see pkgmgrinfo_save_certinfo()
4440 static int set_cert_in_db(const char *pkgid)
4443 pkgmgrinfo_instcertinfo_h handle;
4444 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4445 if (ret != PMINFO_R_OK)
4447 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4448 if (ret != PMINFO_R_OK) {
4449 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4452 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4453 if (ret != PMINFO_R_OK) {
4454 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4457 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4462 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4465 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4466 * @brief This API gets the datacontrol info
4468 * @par This API is for package-manager client application
4469 * @par Sync (or) Async : Synchronous API
4471 * @param[in] providerid pointer to the providerid of dataconltrol.
4472 * @param[in] type pointer to the type of dataconltrol.
4473 * @param[out] appid pointer to hold appid, need to free after using
4474 * @param[out] access pointer to hold access, need to free after using
4475 * @return 0 if success, error code(<0) if fail
4476 * @retval PMINFO_R_OK success
4477 * @retval PMINFO_R_EINVAL invalid argument
4478 * @retval PMINFO_R_ERROR internal error
4481 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4484 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
4485 * @brief This API gets the application 'guest mode visibility' value from the DB
4487 * @par This API is for package-manager client application
4488 * @par Sync (or) Async : Synchronous API
4490 * @param[in] handle pointer to application info handle
4491 * @param[out] status pointer to hold app guest mode visibility value
4492 * @return 0 if success, error code(<0) if fail
4493 * @retval PMINFO_R_OK success
4494 * @retval PMINFO_R_EINVAL invalid argument
4495 * @retval PMINFO_R_ERROR internal error
4496 * @pre pkgmgrinfo_appinfo_get_appinfo()
4497 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4498 * @see pkgmgrinfo_appinfo_get_appid()
4499 * @see pkgmgrinfo_appinfo_is_multiple()
4501 static int get_app_guestmode_visibility(const char *appid)
4505 pkgmgrinfo_appinfo_h handle;
4506 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4507 if (ret != PMINFO_R_OK)
4509 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
4510 if (ret != PMINFO_R_OK) {
4511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4514 printf("app guest mode visibility: %d\n", status);
4515 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4520 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
4523 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
4524 * @brief This API sets the application 'guest mode visibility' value in the DB
4526 * @par This API is for package-manager client application
4527 * @par Sync (or) Async : Synchronous API
4529 * @param[in] handle pointer to application info handle
4530 * @param[out] status app guest mode visibility value
4531 * @return 0 if success, error code(<0) if fail
4532 * @retval PMINFO_R_OK success
4533 * @retval PMINFO_R_EINVAL invalid argument
4534 * @retval PMINFO_R_ERROR internal error
4535 * @pre pkgmgrinfo_appinfo_get_appinfo()
4536 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4537 * @see pkgmgrinfo_appinfo_get_appid()
4538 * @see pkgmgrinfo_appinfo_is_multiple()
4540 static int set_app_guestmode_visibility(const char *appid, bool value)
4543 pkgmgrinfo_appinfo_h handle;
4544 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4545 if (ret != PMINFO_R_OK)
4547 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
4548 if (ret != PMINFO_R_OK) {
4549 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4552 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4557 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
4564 #endif /* __PKG_INFO_H__ */