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_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
235 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
237 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
238 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
240 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
242 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
244 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
248 * @brief Install Location Types
251 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
252 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
253 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
254 }pkgmgrinfo_install_location;
257 * @brief Application Component Types
260 PMINFO_ALL_APP = 0, /**< All Application*/
261 PMINFO_UI_APP, /**< UI Application*/
262 PMINFO_SVC_APP, /**< Service Application*/
263 }pkgmgrinfo_app_component;
266 * @brief Application Storage Types
269 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
270 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
271 }pkgmgrinfo_installed_storage;
274 * @brief Certificate Types to be used for getting information
277 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
278 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
279 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
280 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
281 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
282 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
283 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
284 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
285 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
286 }pkgmgrinfo_cert_type;
289 * @brief Install Location Types to be used when setting data in DB
292 INSTALL_INTERNAL = 0, /**< Internal Installation*/
293 INSTALL_EXTERNAL, /**< External Installation*/
296 /** String property for filtering based on package info*/
297 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
298 /** String property for filtering based on package info*/
299 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
300 /** String property for filtering based on package info*/
301 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
302 /** String property for filtering based on package info*/
303 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
304 /** String property for filtering based on package info*/
305 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
306 /** String property for filtering based on package info*/
307 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
308 /** String property for filtering based on package info*/
309 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
311 /** Boolean property for filtering based on package info*/
312 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
313 /** Boolean property for filtering based on package info*/
314 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
315 /** Boolean property for filtering based on package info*/
316 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
318 /** Integer property for filtering based on package info*/
319 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
321 /** String property for filtering based on app info*/
322 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
323 /** String property for filtering based on app info*/
324 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
325 /** String property for filtering based on app info*/
326 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
327 /** String property for filtering based on app info*/
328 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
329 /** String property for filtering based on app info*/
330 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
331 /** String property for filtering based on app info*/
332 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
333 /** String property for filtering based on app info*/
334 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
335 /** String property for filtering based on app info*/
336 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
337 /** String property for filtering based on app info*/
338 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
339 /** String property for filtering based on app info*/
340 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
342 /** Boolean property for filtering based on app info*/
343 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
344 /** Boolean property for filtering based on app info*/
345 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
346 /** Boolean property for filtering based on app info*/
347 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
348 /** Boolean property for filtering based on app info*/
349 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
350 /** Boolean property for filtering based on app info*/
351 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
354 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
355 * @brief This API gets list of installed packages
357 * @par This API is for package-manager client application
358 * @par Sync (or) Async : Synchronous API
359 * @param[in] pkg_list_cb iteration function for list
360 * @param[in] user_data user data to be passed to callback function
361 * @return 0 if success, error code(<0) if fail
362 * @retval PMINFO_R_OK success
363 * @retval PMINFO_R_EINVAL invalid argument
364 * @retval PMINFO_R_ERROR internal error
368 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
372 pkgid1 = (char *)user_data;
373 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
374 if (strcmp(pkgid1, pkgid2) == 0) {
381 static int list_pkgs()
384 char *name = "helloworld";
385 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
386 if (ret != PMINFO_R_OK) {
393 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
396 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
397 * @brief This API creates the package information handle from db
399 * @par This API is for package-manager client application
400 * @par Sync (or) Async : Synchronous API
402 * @param[in] pkgid pointer to package ID
403 * @param[out] handle pointer to the package info handle.
404 * @return 0 if success, error code(<0) if fail
405 * @retval PMINFO_R_OK success
406 * @retval PMINFO_R_EINVAL invalid argument
407 * @retval PMINFO_R_ERROR internal error
409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
410 * @see pkgmgrinfo_pkginfo_get_pkgid()
411 * @see pkgmgrinfo_pkginfo_is_removable()
413 static int get_pkg_type(const char *pkgid)
417 pkgmgrinfo_pkginfo_h handle;
418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419 if (ret != PMINFO_R_OK)
421 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
422 if (ret != PMINFO_R_OK) {
423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426 printf("pkgtype: %s\n", type);
427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
432 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
435 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
436 * @brief This API gets the package name from the package ID
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] handle pointer to package info handle
442 * @param[out] pkg_name pointer to hold package name
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_type()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_name(const char *pkgid)
455 char *pkgname = NULL;
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgname: %s\n", pkgname);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
474 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
475 * @brief This API gets the package id from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] pkgid pointer to hold package id
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_type()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkgid(const char *pkgid)
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkg id: %s\n", pkg_id);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
513 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
514 * @brief This API gets the package type from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] type pointer to hold package type
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_pkgid()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkg_type(const char *pkgid)
534 pkgmgrinfo_pkginfo_h handle;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkgtype: %s\n", type);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
552 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
553 * @brief This API gets the package version from the package ID
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to package info handle
559 * @param[out] version pointer to hold package version
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
567 * @see pkgmgrinfo_pkginfo_is_removable()
569 static int get_pkg_version(const char *pkgid)
572 char *version = NULL;
573 pkgmgrinfo_pkginfo_h handle;
574 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
575 if (ret != PMINFO_R_OK)
577 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
578 if (ret != PMINFO_R_OK) {
579 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
582 printf("pkg version: %s\n", version);
583 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
588 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
591 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
592 * @brief This API gets the package install location from the package ID
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to package info handle
598 * @param[out] location pointer to hold package install location
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
606 * @see pkgmgrinfo_pkginfo_is_removable()
608 static int get_pkg_install_location(const char *pkgid)
611 pkgmgrinfo_install_location location;
612 pkgmgrinfo_pkginfo_h handle;
613 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
614 if (ret != PMINFO_R_OK)
616 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
617 if (ret != PMINFO_R_OK) {
618 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
621 printf("pkg install location: %d\n", location);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
630 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
631 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
632 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
633 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
635 * @par This API is for package-manager client application
636 * @par Sync (or) Async : Synchronous API
638 * @param[in] handle pointer to package info handle
639 * @param[out] size pointer to hold package size
640 * @return 0 if success, error code(<0) if fail
641 * @retval PMINFO_R_OK success
642 * @retval PMINFO_R_EINVAL invalid argument
643 * @retval PMINFO_R_ERROR internal error
644 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
645 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
646 * @see pkgmgrinfo_pkginfo_get_pkgid()
647 * @see pkgmgrinfo_pkginfo_is_removable()
649 static int get_pkg_size(const char *pkgid)
653 pkgmgrinfo_pkginfo_h handle;
654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655 if (ret != PMINFO_R_OK)
657 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
658 if (ret != PMINFO_R_OK) {
659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662 printf("pkgsize: %d\n", size);
663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
668 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
671 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
672 * @brief This API gets the installed package total size on the target.
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] size pointer to hold package total size
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
684 static int get_pkg_total_size(const char *pkgid)
688 pkgmgrinfo_pkginfo_h handle;
689 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
690 if (ret != PMINFO_R_OK)
692 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
693 if (ret != PMINFO_R_OK) {
694 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
697 printf("pkg total size: %d\n", size);
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
703 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
706 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
707 * @brief This API gets the installed package data size on the target.
709 * @par This API is for package-manager client application
710 * @par Sync (or) Async : Synchronous API
712 * @param[in] handle pointer to package info handle
713 * @param[out] size pointer to hold package data size
714 * @return 0 if success, error code(<0) if fail
715 * @retval PMINFO_R_OK success
716 * @retval PMINFO_R_EINVAL invalid argument
717 * @retval PMINFO_R_ERROR internal error
719 static int get_pkg_data_size(const char *pkgid)
723 pkgmgrinfo_pkginfo_h handle;
724 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
725 if (ret != PMINFO_R_OK)
727 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
728 if (ret != PMINFO_R_OK) {
729 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
732 printf("pkg data size: %d\n", size);
733 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
738 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
741 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
742 * @brief This API gets the package icon from the package ID
744 * @par This API is for package-manager client application
745 * @par Sync (or) Async : Synchronous API
747 * @param[in] handle pointer to package info handle
748 * @param[out] icon pointer to hold package icon
749 * @return 0 if success, error code(<0) if fail
750 * @retval PMINFO_R_OK success
751 * @retval PMINFO_R_EINVAL invalid argument
752 * @retval PMINFO_R_ERROR internal error
753 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
754 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
755 * @see pkgmgrinfo_pkginfo_get_pkgid()
756 * @see pkgmgrinfo_pkginfo_is_removable()
758 static int get_pkg_icon(const char *pkgid)
762 pkgmgrinfo_pkginfo_h handle;
763 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
764 if (ret != PMINFO_R_OK)
766 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
767 if (ret != PMINFO_R_OK) {
768 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
771 printf("pkg icon: %s\n", icon);
772 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
777 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
780 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
781 * @brief This API gets the package label from the package ID
783 * @par This API is for package-manager client application
784 * @par Sync (or) Async : Synchronous API
786 * @param[in] handle pointer to package info handle
787 * @param[out] label pointer to hold package label
788 * @return 0 if success, error code(<0) if fail
789 * @retval PMINFO_R_OK success
790 * @retval PMINFO_R_EINVAL invalid argument
791 * @retval PMINFO_R_ERROR internal error
792 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
793 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
794 * @see pkgmgrinfo_pkginfo_get_pkgid()
795 * @see pkgmgrinfo_pkginfo_is_removable()
797 static int get_pkg_label(const char *pkgid)
801 pkgmgrinfo_pkginfo_h handle;
802 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
803 if (ret != PMINFO_R_OK)
805 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
806 if (ret != PMINFO_R_OK) {
807 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
810 printf("pkg label: %s\n", label);
811 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
816 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
819 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
820 * @brief This API gets the package description from the package ID
822 * @par This API is for package-manager client application
823 * @par Sync (or) Async : Synchronous API
825 * @param[in] handle pointer to package info handle
826 * @param[out] description pointer to hold package description
827 * @return 0 if success, error code(<0) if fail
828 * @retval PMINFO_R_OK success
829 * @retval PMINFO_R_EINVAL invalid argument
830 * @retval PMINFO_R_ERROR internal error
831 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
832 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
833 * @see pkgmgrinfo_pkginfo_get_pkgid()
834 * @see pkgmgrinfo_pkginfo_is_removable()
836 static int get_pkg_description(const char *pkgid)
839 char *description = NULL;
840 pkgmgrinfo_pkginfo_h handle;
841 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
842 if (ret != PMINFO_R_OK)
844 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
845 if (ret != PMINFO_R_OK) {
846 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
849 printf("pkg description: %s\n", description);
850 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
855 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
858 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
859 * @brief This API gets the package's author name from the package ID
861 * @par This API is for package-manager client application
862 * @par Sync (or) Async : Synchronous API
864 * @param[in] handle pointer to package info handle
865 * @param[out] author_name pointer to hold package author name
866 * @return 0 if success, error code(<0) if fail
867 * @retval PMINFO_R_OK success
868 * @retval PMINFO_R_EINVAL invalid argument
869 * @retval PMINFO_R_ERROR internal error
870 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
871 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
872 * @see pkgmgrinfo_pkginfo_get_pkgid()
873 * @see pkgmgrinfo_pkginfo_is_removable()
875 static int get_pkg_author_name(const char *pkgid)
878 char *author_name = NULL;
879 pkgmgrinfo_pkginfo_h handle;
880 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
881 if (ret != PMINFO_R_OK)
883 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
884 if (ret != PMINFO_R_OK) {
885 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
888 printf("pkg author name: %s\n", author_name);
889 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
894 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
897 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
898 * @brief This API gets the package's author email from the package ID
900 * @par This API is for package-manager client application
901 * @par Sync (or) Async : Synchronous API
903 * @param[in] handle pointer to package info handle
904 * @param[out] author_email pointer to hold package author email
905 * @return 0 if success, error code(<0) if fail
906 * @retval PMINFO_R_OK success
907 * @retval PMINFO_R_EINVAL invalid argument
908 * @retval PMINFO_R_ERROR internal error
909 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
910 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
911 * @see pkgmgrinfo_pkginfo_get_pkgid()
912 * @see pkgmgrinfo_pkginfo_is_removable()
914 static int get_pkg_author_email(const char *pkgid)
917 char *author_email = NULL;
918 pkgmgrinfo_pkginfo_h handle;
919 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
920 if (ret != PMINFO_R_OK)
922 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
923 if (ret != PMINFO_R_OK) {
924 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
927 printf("pkg author email: %s\n", author_email);
928 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
933 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
936 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
937 * @brief This API gets the package's author href from the package ID
939 * @par This API is for package-manager client application
940 * @par Sync (or) Async : Synchronous API
942 * @param[in] handle pointer to package info handle
943 * @param[out] author_href pointer to hold package author href
944 * @return 0 if success, error code(<0) if fail
945 * @retval PMINFO_R_OK success
946 * @retval PMINFO_R_EINVAL invalid argument
947 * @retval PMINFO_R_ERROR internal error
948 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
949 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
950 * @see pkgmgrinfo_pkginfo_get_pkgid()
951 * @see pkgmgrinfo_pkginfo_is_removable()
953 static int get_pkg_author_href(const char *pkgid)
956 char *author_href = NULL;
957 pkgmgrinfo_pkginfo_h handle;
958 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
959 if (ret != PMINFO_R_OK)
961 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
962 if (ret != PMINFO_R_OK) {
963 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
966 printf("pkg author href: %s\n", author_href);
967 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
972 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
975 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
976 * @brief This API gets the package installed storagae value from the package ID
978 * @par This API is for package-manager client application
979 * @par Sync (or) Async : Synchronous API
981 * @param[in] handle pointer to package info handle
982 * @param[out] storage pointer to hold package installed storage
983 * @return 0 if success, error code(<0) if fail
984 * @retval PMINFO_R_OK success
985 * @retval PMINFO_R_EINVAL invalid argument
986 * @retval PMINFO_R_ERROR internal error
987 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
988 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
989 * @see pkgmgrinfo_pkginfo_get_pkgid()
990 * @see pkgmgrinfo_pkginfo_is_removable()
992 static int get_pkg_installed_storage(const char *pkgid)
995 pkgmgrinfo_installed_storage storage;
996 pkgmgrinfo_pkginfo_h handle;
997 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
998 if (ret != PMINFO_R_OK)
1000 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1001 if (ret != PMINFO_R_OK) {
1002 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1005 printf("pkg installed storage: %d\n", storage);
1006 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1011 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1014 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1015 * @brief This API gets the installed time of package from the package ID
1017 * @par This API is for package-manager client application
1018 * @par Sync (or) Async : Synchronous API
1020 * @param[in] handle pointer to package info handle
1021 * @param[out] installed_time pointer to hold installed time of package
1022 * @return 0 if success, error code(<0) if fail
1023 * @retval PMINFO_R_OK success
1024 * @retval PMINFO_R_EINVAL invalid argument
1025 * @retval PMINFO_R_ERROR internal error
1026 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1027 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1028 * @see pkgmgrinfo_pkginfo_get_pkgid()
1029 * @see pkgmgrinfo_pkginfo_is_removable()
1031 static int get_pkg_installed_time(const char *pkgid)
1034 int installed_time = 0;
1035 pkgmgrinfo_pkginfo_h handle;
1036 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1037 if (ret != PMINFO_R_OK)
1039 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1040 if (ret != PMINFO_R_OK) {
1041 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1044 printf("installed_time: %d\n", installed_time);
1045 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1050 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1053 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1054 * @brief This API gets the store client id of package from the package ID
1056 * @par This API is for package-manager client application
1057 * @par Sync (or) Async : Synchronous API
1059 * @param[in] handle pointer to package info handle
1060 * @param[out] storeclientid pointer to hold store client id of package
1061 * @return 0 if success, error code(<0) if fail
1062 * @retval PMINFO_R_OK success
1063 * @retval PMINFO_R_EINVAL invalid argument
1064 * @retval PMINFO_R_ERROR internal error
1065 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1066 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1067 * @see pkgmgrinfo_pkginfo_get_pkgid()
1068 * @see pkgmgrinfo_pkginfo_is_removable()
1070 static int get_pkg_storeclientid(const char *pkgid)
1073 char *storeclientid = 0;
1074 pkgmgrinfo_pkginfo_h handle;
1075 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1076 if (ret != PMINFO_R_OK)
1078 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1079 if (ret != PMINFO_R_OK) {
1080 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1083 printf(store client id: %s\n", storeclientid);
1084 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1089 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1092 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1093 * @brief This API gets the main app id of package from the package ID
1095 * @par This API is for package-manager client application
1096 * @par Sync (or) Async : Synchronous API
1098 * @param[in] handle pointer to package info handle
1099 * @param[out] mainappid pointer to hold main app id of package
1100 * @return 0 if success, error code(<0) if fail
1101 * @retval PMINFO_R_OK success
1102 * @retval PMINFO_R_EINVAL invalid argument
1103 * @retval PMINFO_R_ERROR internal error
1104 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1105 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1106 * @see pkgmgrinfo_pkginfo_get_pkgid()
1107 * @see pkgmgrinfo_pkginfo_is_removable()
1109 static int get_pkg_mainappid(const char *pkgid)
1112 char *mainappid = 0;
1113 pkgmgrinfo_pkginfo_h handle;
1114 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1115 if (ret != PMINFO_R_OK)
1117 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1118 if (ret != PMINFO_R_OK) {
1119 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1122 printf(main app id: %s\n", mainappid);
1123 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1128 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1131 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1132 * @brief This API gets the url of package from the package ID
1134 * @par This API is for package-manager client application
1135 * @par Sync (or) Async : Synchronous API
1137 * @param[in] handle pointer to package info handle
1138 * @param[out] url pointer to hold url of package
1139 * @return 0 if success, error code(<0) if fail
1140 * @retval PMINFO_R_OK success
1141 * @retval PMINFO_R_EINVAL invalid argument
1142 * @retval PMINFO_R_ERROR internal error
1143 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1144 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1145 * @see pkgmgrinfo_pkginfo_get_pkgid()
1146 * @see pkgmgrinfo_pkginfo_is_removable()
1148 static int get_pkg_url(const char *pkgid)
1152 pkgmgrinfo_pkginfo_h handle;
1153 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1154 if (ret != PMINFO_R_OK)
1156 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1157 if (ret != PMINFO_R_OK) {
1158 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1161 printf("url : %s\n", url);
1162 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1167 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1170 * @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)
1171 * @brief This API compare the cert information from given package id
1173 * @par This API is for package-manager client application
1174 * @par Sync (or) Async : Synchronous API
1176 * @param[in] lhs_package_id pointer to first package ID
1177 * @param[in] rhs_package_id pointer to second package ID
1178 * @param[out] compare_result pointer to the compare result.
1179 * @return 0 if success, error code(<0) if fail
1180 * @retval PMINFO_R_OK success
1181 * @retval PMINFO_R_EINVAL invalid argument
1182 * @retval PMINFO_R_ERROR internal error
1184 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1185 * @see pkgmgrinfo_pkginfo_get_pkgid()
1186 * @see pkgmgrinfo_pkginfo_is_removable()
1188 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1191 pkgmgrinfo_cert_compare_result_type_e result;
1193 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1194 if (ret != PMINFO_R_OK) {
1197 printf("result: %d\n", result);
1202 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);
1205 * @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)
1206 * @brief This API compare the cert information from given app id
1208 * @par This API is for package-manager client application
1209 * @par Sync (or) Async : Synchronous API
1211 * @param[in] lhs_app_id pointer to first app ID
1212 * @param[in] rhs_app_id pointer to second app ID
1213 * @param[out] compare_result pointer to the compare result.
1214 * @return 0 if success, error code(<0) if fail
1215 * @retval PMINFO_R_OK success
1216 * @retval PMINFO_R_EINVAL invalid argument
1217 * @retval PMINFO_R_ERROR internal error
1219 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1220 * @see pkgmgrinfo_pkginfo_get_pkgid()
1221 * @see pkgmgrinfo_pkginfo_is_removable()
1223 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1226 pkgmgrinfo_cert_compare_result_type_e result;
1228 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1229 if (ret != PMINFO_R_OK) {
1232 printf("result: %d\n", result);
1237 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);
1240 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1241 * @brief This API gets the package 'removable' value from the package ID
1243 * @par This API is for package-manager client application
1244 * @par Sync (or) Async : Synchronous API
1246 * @param[in] handle pointer to package info handle
1247 * @param[out] removable pointer to hold package removable value
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
1252 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1253 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1254 * @see pkgmgrinfo_pkginfo_get_pkgid()
1255 * @see pkgmgrinfo_pkginfo_is_readonly()
1257 static int get_pkg_removable(const char *pkgid)
1261 pkgmgrinfo_pkginfo_h handle;
1262 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1263 if (ret != PMINFO_R_OK)
1265 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1266 if (ret != PMINFO_R_OK) {
1267 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1270 printf("pkg removable: %d\n", removable);
1271 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1276 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1279 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1280 * @brief This API gets the package 'preload' value from the package ID
1282 * @par This API is for package-manager client application
1283 * @par Sync (or) Async : Synchronous API
1285 * @param[in] handle pointer to package info handle
1286 * @param[out] preload pointer to hold package preload value
1287 * @return 0 if success, error code(<0) if fail
1288 * @retval PMINFO_R_OK success
1289 * @retval PMINFO_R_EINVAL invalid argument
1290 * @retval PMINFO_R_ERROR internal error
1291 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1292 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1293 * @see pkgmgrinfo_pkginfo_get_pkgid()
1294 * @see pkgmgrinfo_pkginfo_is_readonly()
1296 static int get_pkg_preload(const char *pkgid)
1300 pkgmgrinfo_pkginfo_h handle;
1301 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1302 if (ret != PMINFO_R_OK)
1304 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1305 if (ret != PMINFO_R_OK) {
1306 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1309 printf("pkg preload: %d\n", preload);
1310 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1315 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1318 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1319 * @brief This API gets the package 'readonly' value from the package ID
1321 * @par This API is for package-manager client application
1322 * @par Sync (or) Async : Synchronous API
1324 * @param[in] handle pointer to package info handle
1325 * @param[out] readonly pointer to hold package readonly value
1326 * @return 0 if success, error code(<0) if fail
1327 * @retval PMINFO_R_OK success
1328 * @retval PMINFO_R_EINVAL invalid argument
1329 * @retval PMINFO_R_ERROR internal error
1330 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1331 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1332 * @see pkgmgrinfo_pkginfo_get_pkgid()
1333 * @see pkgmgrinfo_pkginfo_is_removable()
1335 static int get_pkg_readonly(const char *pkgid)
1339 pkgmgrinfo_pkginfo_h handle;
1340 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1341 if (ret != PMINFO_R_OK)
1343 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1344 if (ret != PMINFO_R_OK) {
1345 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1348 printf("pkg readonly: %d\n", readonly);
1349 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1354 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1357 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1358 * @brief This API gets the package 'accessible' value from the package ID
1360 * @par This API is for package-manager client application
1361 * @par Sync (or) Async : Synchronous API
1363 * @param[in] handle pointer to package info handle
1364 * @param[out] accessible pointer to hold package accessible value
1365 * @return 0 if success, error code(<0) if fail
1366 * @retval PMINFO_R_OK success
1367 * @retval PMINFO_R_EINVAL invalid argument
1368 * @retval PMINFO_R_ERROR internal error
1369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_readonly()
1374 static int get_pkg_accessible(const char *pkgid)
1378 pkgmgrinfo_pkginfo_h handle;
1379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1380 if (ret != PMINFO_R_OK)
1382 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1383 if (ret != PMINFO_R_OK) {
1384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1387 printf("pkg accessible: %d\n", accessible);
1388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1393 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1396 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1397 * @brief This API destroys the package information handle freeing up all the resources
1399 * @par This API is for package-manager client application
1400 * @par Sync (or) Async : Synchronous API
1402 * @param[in] handle pointer to the package info handle
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1409 * @see pkgmgrinfo_pkginfo_get_pkgid()
1410 * @see pkgmgrinfo_pkginfo_is_removable()
1412 static int get_pkg_type(const char *pkgid)
1416 pkgmgrinfo_pkginfo_h handle;
1417 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1418 if (ret != PMINFO_R_OK)
1420 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1421 if (ret != PMINFO_R_OK) {
1422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1425 printf("pkgtype: %s\n", type);
1426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1431 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1434 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1435 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1436 The query will search the entire package information collected from the manifest file of all the installed packages
1438 * @par This API is for package-manager client application
1439 * @par Sync (or) Async : Synchronous API
1441 * @param[out] handle pointer to the package info filter handle.
1442 * @return 0 if success, error code(<0) if fail
1443 * @retval PMINFO_R_OK success
1444 * @retval PMINFO_R_EINVAL invalid argument
1445 * @retval PMINFO_R_ERROR internal error
1447 * @post pkgmgrinfo_pkginfo_filter_destroy()
1448 * @see pkgmgrinfo_pkginfo_filter_count()
1449 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1451 static int get_rpm_pkg_count()
1455 pkgmgrinfo_pkginfo_filter_h handle;
1456 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1457 if (ret != PMINFO_R_OK)
1459 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1460 if (ret != PMINFO_R_OK) {
1461 pkgmgrinfo_pkginfo_filter_destroy(handle);
1464 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1465 if (ret != PMINFO_R_OK) {
1466 pkgmgrinfo_pkginfo_filter_destroy(handle);
1469 printf("No of rpm pkgs: %d\n", count);
1470 pkgmgrinfo_pkginfo_filter_destroy(handle);
1475 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1478 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1479 * @brief This API destroys the package information filter handle freeing up all the resources
1481 * @par This API is for package-manager client application
1482 * @par Sync (or) Async : Synchronous API
1484 * @param[in] handle pointer to the package info filter handle.
1485 * @return 0 if success, error code(<0) if fail
1486 * @retval PMINFO_R_OK success
1487 * @retval PMINFO_R_EINVAL invalid argument
1488 * @retval PMINFO_R_ERROR internal error
1489 * @pre pkgmgrinfo_pkginfo_filter_create()
1491 * @see pkgmgrinfo_pkginfo_filter_count()
1492 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1494 static int get_rpm_pkg_count()
1498 pkgmgrinfo_pkginfo_filter_h handle;
1499 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1500 if (ret != PMINFO_R_OK)
1502 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1503 if (ret != PMINFO_R_OK) {
1504 pkgmgrinfo_pkginfo_filter_destroy(handle);
1507 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1508 if (ret != PMINFO_R_OK) {
1509 pkgmgrinfo_pkginfo_filter_destroy(handle);
1512 printf("No of rpm pkgs: %d\n", count);
1513 pkgmgrinfo_pkginfo_filter_destroy(handle);
1518 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1521 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1522 * @brief This API adds a boolean filter property to the filter handle
1524 * @par This API is for package-manager client application
1525 * @par Sync (or) Async : Synchronous API
1527 * @param[in] handle pointer to the package info filter handle.
1528 * @param[in] property boolean property name.
1529 * @param[in] value value corresponding to the property.
1530 * @return 0 if success, error code(<0) if fail
1531 * @retval PMINFO_R_OK success
1532 * @retval PMINFO_R_EINVAL invalid argument
1533 * @retval PMINFO_R_ERROR internal error
1534 * @pre pkgmgrinfo_pkginfo_filter_create()
1535 * @post pkgmgrinfo_pkginfo_filter_destroy()
1536 * @see pkgmgrinfo_pkginfo_filter_count()
1537 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1539 static int get_preload_pkg_count()
1543 pkgmgrinfo_pkginfo_filter_h handle;
1544 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1545 if (ret != PMINFO_R_OK)
1547 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1548 if (ret != PMINFO_R_OK) {
1549 pkgmgrinfo_pkginfo_filter_destroy(handle);
1552 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1553 if (ret != PMINFO_R_OK) {
1554 pkgmgrinfo_pkginfo_filter_destroy(handle);
1557 printf("No of preload pkgs: %d\n", count);
1558 pkgmgrinfo_pkginfo_filter_destroy(handle);
1563 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1564 const char *property, const bool value);
1567 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1568 * @brief This API adds an integer filter property to the filter handle
1570 * @par This API is for package-manager client application
1571 * @par Sync (or) Async : Synchronous API
1573 * @param[in] handle pointer to the package info filter handle.
1574 * @param[in] property integer property name.
1575 * @param[in] value value corresponding to the property.
1576 * @return 0 if success, error code(<0) if fail
1577 * @retval PMINFO_R_OK success
1578 * @retval PMINFO_R_EINVAL invalid argument
1579 * @retval PMINFO_R_ERROR internal error
1580 * @pre pkgmgrinfo_pkginfo_filter_create()
1581 * @post pkgmgrinfo_pkginfo_filter_destroy()
1582 * @see pkgmgrinfo_pkginfo_filter_count()
1583 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1585 static int get_pkg_count()
1589 pkgmgrinfo_pkginfo_filter_h handle;
1590 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1591 if (ret != PMINFO_R_OK)
1593 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1594 if (ret != PMINFO_R_OK) {
1595 pkgmgrinfo_pkginfo_filter_destroy(handle);
1598 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1599 if (ret != PMINFO_R_OK) {
1600 pkgmgrinfo_pkginfo_filter_destroy(handle);
1603 printf("No of preload pkgs: %d\n", count);
1604 pkgmgrinfo_pkginfo_filter_destroy(handle);
1609 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1610 const char *property, const int value);
1613 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1614 * @brief This API adds a string filter property to the filter handle
1616 * @par This API is for package-manager client application
1617 * @par Sync (or) Async : Synchronous API
1619 * @param[in] handle pointer to the package info filter handle.
1620 * @param[in] property string property name.
1621 * @param[in] value value corresponding to the property.
1622 * @return 0 if success, error code(<0) if fail
1623 * @retval PMINFO_R_OK success
1624 * @retval PMINFO_R_EINVAL invalid argument
1625 * @retval PMINFO_R_ERROR internal error
1626 * @pre pkgmgrinfo_pkginfo_filter_create()
1627 * @post pkgmgrinfo_pkginfo_filter_destroy()
1628 * @see pkgmgrinfo_pkginfo_filter_count()
1629 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1631 static int get_rpm_pkg_count()
1635 pkgmgrinfo_pkginfo_filter_h handle;
1636 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1637 if (ret != PMINFO_R_OK)
1639 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1640 if (ret != PMINFO_R_OK) {
1641 pkgmgrinfo_pkginfo_filter_destroy(handle);
1644 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1645 if (ret != PMINFO_R_OK) {
1646 pkgmgrinfo_pkginfo_filter_destroy(handle);
1649 printf("No of rpm pkgs: %d\n", count);
1650 pkgmgrinfo_pkginfo_filter_destroy(handle);
1655 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1656 const char *property, const char *value);
1659 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1660 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1662 * @par This API is for package-manager client application
1663 * @par Sync (or) Async : Synchronous API
1665 * @param[in] handle pointer to the package info filter handle.
1666 * @param[in] pkg_cb callback function.
1667 * @param[in] user_data user data to be passed to the callback function
1668 * @return 0 if success, error code(<0) if fail
1669 * @retval PMINFO_R_OK success
1670 * @retval PMINFO_R_EINVAL invalid argument
1671 * @retval PMINFO_R_ERROR internal error
1672 * @pre pkgmgrinfo_pkginfo_filter_create()
1673 * @post pkgmgrinfo_pkginfo_filter_destroy()
1674 * @see pkgmgrinfo_pkginfo_filter_count()
1676 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1679 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1680 printf("pkg id : %s\n", pkgid);
1684 static int get_rpm_pkg_list()
1687 pkgmgrinfo_pkginfo_filter_h handle;
1688 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1689 if (ret != PMINFO_R_OK)
1691 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1692 if (ret != PMINFO_R_OK) {
1693 pkgmgrinfo_pkginfo_filter_destroy(handle);
1696 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1697 if (ret != PMINFO_R_OK) {
1698 pkgmgrinfo_pkginfo_filter_destroy(handle);
1701 pkgmgrinfo_pkginfo_filter_destroy(handle);
1706 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1707 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1710 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1711 * @brief This API counts the package that satisfy the filter conditions
1713 * @par This API is for package-manager client application
1714 * @par Sync (or) Async : Synchronous API
1716 * @param[in] handle pointer to the package info filter handle.
1717 * @param[in] count pointer to store the count value.
1718 * @return 0 if success, error code(<0) if fail
1719 * @retval PMINFO_R_OK success
1720 * @retval PMINFO_R_EINVAL invalid argument
1721 * @retval PMINFO_R_ERROR internal error
1722 * @pre pkgmgrinfo_pkginfo_filter_create()
1723 * @post pkgmgrinfo_pkginfo_filter_destroy()
1724 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1726 static int get_rpm_pkg_count()
1730 pkgmgrinfo_pkginfo_filter_h handle;
1731 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1732 if (ret != PMINFO_R_OK)
1734 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1735 if (ret != PMINFO_R_OK) {
1736 pkgmgrinfo_pkginfo_filter_destroy(handle);
1739 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1740 if (ret != PMINFO_R_OK) {
1741 pkgmgrinfo_pkginfo_filter_destroy(handle);
1744 printf("No of rpm pkgs: %d\n", count);
1745 pkgmgrinfo_pkginfo_filter_destroy(handle);
1750 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1753 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1754 pkgmgrinfo_app_list_cb app_func, void *user_data)
1755 * @brief This API gets list of installed applications for a particular package
1757 * @par This API is for package-manager client application
1758 * @par Sync (or) Async : Synchronous API
1759 * @param[in] handle package info handle
1760 * @param[in] component application component
1761 * @param[in] app_func iteration function for list
1762 * @param[in] user_data user data to be passed to callback function
1763 * @return 0 if success, error code(<0) if fail
1764 * @retval PMINFO_R_OK success
1765 * @retval PMINFO_R_EINVAL invalid argument
1766 * @retval PMINFO_R_ERROR internal error
1767 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1768 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1770 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1773 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1774 printf("appid : %s\n", appid);
1778 static int list_apps(const char *pkgid)
1781 pkgmgrinfo_pkginfo_h handle;
1782 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1783 if (ret != PMINFO_R_OK)
1785 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1786 if (ret != PMINFO_R_OK) {
1787 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1790 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1795 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1796 pkgmgrinfo_app_list_cb app_func, void *user_data);
1799 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1800 * @brief This API gets list of installed applications from all packages.
1802 * @par This API is for package-manager client application
1803 * @par Sync (or) Async : Synchronous API
1804 * @param[in] app_func iteration function for list
1805 * @param[in] user_data user data to be passed to callback function
1806 * @return 0 if success, error code(<0) if fail
1807 * @retval PMINFO_R_OK success
1808 * @retval PMINFO_R_EINVAL invalid argument
1809 * @retval PMINFO_R_ERROR internal error
1813 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1815 char *pkgid1 = NULL;
1816 char *pkgid2 = NULL;
1817 pkgid1 = (char *)user_data;
1818 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1819 if (strcmp(pkgid1, pkgid2) == 0) {
1826 static int list_apps()
1829 char *name = "helloworld";
1830 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1831 if (ret != PMINFO_R_OK) {
1838 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1841 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
1842 * @brief This API creates the application information handle from db
1844 * @par This API is for package-manager client application
1845 * @par Sync (or) Async : Synchronous API
1847 * @param[in] appid pointer to appid
1848 * @param[out] handle pointer to the application info handle.
1849 * @return 0 if success, error code(<0) if fail
1850 * @retval PMINFO_R_OK success
1851 * @retval PMINFO_R_EINVAL invalid argument
1852 * @retval PMINFO_R_ERROR internal error
1854 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1855 * @see pkgmgrinfo_appinfo_get_pkgid()
1856 * @see pkgmgrinfo_appinfo_is_multiple()
1858 static int get_app_type(const char *appid)
1862 pkgmgrinfo_appinfo_h handle;
1863 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1864 if (ret != PMINFO_R_OK)
1866 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
1867 if (ret != PMINFO_R_OK) {
1868 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1871 printf("apptype: %s\n", type);
1872 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1877 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
1880 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
1881 * @brief This API gets the application ID
1883 * @par This API is for package-manager client application
1884 * @par Sync (or) Async : Synchronous API
1886 * @param[in] handle pointer to the application info handle.
1887 * @param[out] appid pointer to hold appid
1888 * @return 0 if success, error code(<0) if fail
1889 * @retval PMINFO_R_OK success
1890 * @retval PMINFO_R_EINVAL invalid argument
1891 * @retval PMINFO_R_ERROR internal error
1892 * @pre pkgmgrinfo_appinfo_get_appinfo()
1893 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1894 * @see pkgmgrinfo_appinfo_get_pkgid()
1895 * @see pkgmgrinfo_appinfo_is_multiple()
1897 static int get_app_id(const char *appid)
1900 char *app_id = NULL;
1901 pkgmgrinfo_appinfo_h handle;
1902 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1903 if (ret != PMINFO_R_OK)
1905 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
1906 if (ret != PMINFO_R_OK) {
1907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1910 printf("app id: %s\n", app_id);
1911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1916 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
1919 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
1920 * @brief This API gets the package name of the application
1922 * @par This API is for package-manager client application
1923 * @par Sync (or) Async : Synchronous API
1925 * @param[in] handle pointer to the application info handle.
1926 * @param[out] pkg_name pointer to hold package name
1927 * @return 0 if success, error code(<0) if fail
1928 * @retval PMINFO_R_OK success
1929 * @retval PMINFO_R_EINVAL invalid argument
1930 * @retval PMINFO_R_ERROR internal error
1931 * @pre pkgmgrinfo_appinfo_get_appinfo()
1932 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1933 * @see pkgmgrinfo_appinfo_get_appid()
1934 * @see pkgmgrinfo_appinfo_is_multiple()
1936 static int get_app_pkgname(const char *appid)
1939 char *pkgname = NULL;
1940 pkgmgrinfo_appinfo_h handle;
1941 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1942 if (ret != PMINFO_R_OK)
1944 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1949 printf("pkg name: %s\n", pkgname);
1950 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1955 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
1958 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
1959 * @brief This API gets the package id of the application
1961 * @par This API is for package-manager client application
1962 * @par Sync (or) Async : Synchronous API
1964 * @param[in] handle pointer to the application info handle.
1965 * @param[out] pkgid pointer to hold package id
1966 * @return 0 if success, error code(<0) if fail
1967 * @retval PMINFO_R_OK success
1968 * @retval PMINFO_R_EINVAL invalid argument
1969 * @retval PMINFO_R_ERROR internal error
1970 * @pre pkgmgrinfo_appinfo_get_appinfo()
1971 * @post pkgmgrinfo_appinfo_destroy_appinfo()
1972 * @see pkgmgrinfo_appinfo_get_appid()
1973 * @see pkgmgrinfo_appinfo_is_multiple()
1975 static int get_app_pkgid(const char *appid)
1979 pkgmgrinfo_appinfo_h handle;
1980 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
1981 if (ret != PMINFO_R_OK)
1983 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
1984 if (ret != PMINFO_R_OK) {
1985 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1988 printf("pkg id: %s\n", pkgid);
1989 pkgmgrinfo_appinfo_destroy_appinfo(handle);
1994 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
1997 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
1998 * @brief This API gets the executable name of the application
2000 * @par This API is for package-manager client application
2001 * @par Sync (or) Async : Synchronous API
2003 * @param[in] handle pointer to the application info handle.
2004 * @param[out] exec pointer to hold app exec name
2005 * @return 0 if success, error code(<0) if fail
2006 * @retval PMINFO_R_OK success
2007 * @retval PMINFO_R_EINVAL invalid argument
2008 * @retval PMINFO_R_ERROR internal error
2009 * @pre pkgmgrinfo_appinfo_get_appinfo()
2010 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2011 * @see pkgmgrinfo_appinfo_get_appid()
2012 * @see pkgmgrinfo_appinfo_is_multiple()
2014 static int get_app_exec(const char *appid)
2018 pkgmgrinfo_appinfo_h handle;
2019 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2020 if (ret != PMINFO_R_OK)
2022 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2023 if (ret != PMINFO_R_OK) {
2024 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2027 printf("exec name: %s\n", exec);
2028 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2033 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2036 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2037 * @brief This API gets the icon name of the application
2039 * @par This API is for package-manager client application
2040 * @par Sync (or) Async : Synchronous API
2042 * @param[in] handle pointer to the application info handle.
2043 * @param[out] icon pointer to hold app icon name
2044 * @return 0 if success, error code(<0) if fail
2045 * @retval PMINFO_R_OK success
2046 * @retval PMINFO_R_EINVAL invalid argument
2047 * @retval PMINFO_R_ERROR internal error
2048 * @pre pkgmgrinfo_appinfo_get_appinfo()
2049 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2050 * @see pkgmgrinfo_appinfo_get_appid()
2051 * @see pkgmgrinfo_appinfo_is_multiple()
2053 static int get_app_icon(const char *appid)
2057 pkgmgrinfo_appinfo_h handle;
2058 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2059 if (ret != PMINFO_R_OK)
2061 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2062 if (ret != PMINFO_R_OK) {
2063 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2066 printf("icon name: %s\n", icon);
2067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2072 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2075 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2076 * @brief This API gets the label of the application
2078 * @par This API is for package-manager client application
2079 * @par Sync (or) Async : Synchronous API
2081 * @param[in] handle pointer to the application info handle.
2082 * @param[out] label pointer to hold app label
2083 * @return 0 if success, error code(<0) if fail
2084 * @retval PMINFO_R_OK success
2085 * @retval PMINFO_R_EINVAL invalid argument
2086 * @retval PMINFO_R_ERROR internal error
2087 * @pre pkgmgrinfo_appinfo_get_appinfo()
2088 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2089 * @see pkgmgrinfo_appinfo_get_appid()
2090 * @see pkgmgrinfo_appinfo_is_multiple()
2092 static int get_app_label(const char *appid)
2096 pkgmgrinfo_appinfo_h handle;
2097 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2098 if (ret != PMINFO_R_OK)
2100 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2101 if (ret != PMINFO_R_OK) {
2102 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2105 printf("label : %s\n", label);
2106 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2111 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2114 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2115 * @brief This API gets the component of the application
2117 * @par This API is for package-manager client application
2118 * @par Sync (or) Async : Synchronous API
2120 * @param[in] handle pointer to the application info handle.
2121 * @param[out] component pointer to hold app component
2122 * @return 0 if success, error code(<0) if fail
2123 * @retval PMINFO_R_OK success
2124 * @retval PMINFO_R_EINVAL invalid argument
2125 * @retval PMINFO_R_ERROR internal error
2126 * @pre pkgmgrinfo_appinfo_get_appinfo()
2127 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2128 * @see pkgmgrinfo_appinfo_get_appid()
2129 * @see pkgmgrinfo_appinfo_is_multiple()
2131 static int get_app_component(const char *appid)
2134 pkgmgrinfo_app_component component;
2135 pkgmgrinfo_appinfo_h handle;
2136 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2137 if (ret != PMINFO_R_OK)
2139 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2140 if (ret != PMINFO_R_OK) {
2141 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2144 printf("component : %s\n", component);
2145 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2150 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2153 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2154 * @brief This API gets the apptype of the application
2156 * @par This API is for package-manager client application
2157 * @par Sync (or) Async : Synchronous API
2159 * @param[in] handle pointer to the application info handle.
2160 * @param[out] app_type pointer to hold apptype
2161 * @return 0 if success, error code(<0) if fail
2162 * @retval PMINFO_R_OK success
2163 * @retval PMINFO_R_EINVAL invalid argument
2164 * @retval PMINFO_R_ERROR internal error
2165 * @pre pkgmgrinfo_appinfo_get_appinfo()
2166 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2167 * @see pkgmgrinfo_appinfo_get_appid()
2168 * @see pkgmgrinfo_appinfo_is_multiple()
2170 static int get_app_type(const char *appid)
2173 char *apptype = NULL;
2174 pkgmgrinfo_appinfo_h handle;
2175 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2176 if (ret != PMINFO_R_OK)
2178 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2179 if (ret != PMINFO_R_OK) {
2180 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2183 printf("apptype : %s\n", apptype);
2184 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2189 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2192 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2193 int *operation_count, char ***operation)
2194 * @brief This API gets the list of operation of the application
2196 * @par This API is for package-manager client application
2197 * @par Sync (or) Async : Synchronous API
2199 * @param[in] handle pointer to the appcontrol handle.
2200 * @param[out] operation_count pointer to hold number of operations
2201 * @param[out] operation pointer to hold list of operations
2202 * @return 0 if success, error code(<0) if fail
2203 * @retval PMINFO_R_OK success
2204 * @retval PMINFO_R_EINVAL invalid argument
2205 * @retval PMINFO_R_ERROR internal error
2206 * @pre pkgmgrinfo_appinfo_get_appinfo()
2207 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2208 * @see pkgmgrinfo_appinfo_get_uri()
2209 * @see pkgmgrinfo_appinfo_get_mime()
2211 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2216 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2217 for (i = 0; i < oc; i++) {
2218 if (strcmp(operation[i], (char *)user_data) == 0)
2225 static int check_operation(const char *appid, char *operation)
2228 pkgmgrinfo_appinfo_h handle;
2229 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2230 if (ret != PMINFO_R_OK)
2232 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2233 if (ret != PMINFO_R_OK) {
2234 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2242 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2243 int *operation_count, char ***operation);
2246 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2247 int *uri_count, char ***uri)
2248 * @brief This API gets the list of uri of the application
2250 * @par This API is for package-manager client application
2251 * @par Sync (or) Async : Synchronous API
2253 * @param[in] handle pointer to the appcontrol handle.
2254 * @param[out] uri_count pointer to hold number of uris
2255 * @param[out] uri pointer to hold list of uris
2256 * @return 0 if success, error code(<0) if fail
2257 * @retval PMINFO_R_OK success
2258 * @retval PMINFO_R_EINVAL invalid argument
2259 * @retval PMINFO_R_ERROR internal error
2260 * @pre pkgmgrinfo_appinfo_get_appinfo()
2261 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2262 * @see pkgmgrinfo_appinfo_get_operation()
2263 * @see pkgmgrinfo_appinfo_get_mime()
2265 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2270 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2271 for (i = 0; i < uc; i++) {
2272 if (strcmp(uri[i], (char *)user_data) == 0)
2279 static int check_uri(const char *appid, char *uri)
2282 pkgmgrinfo_appinfo_h handle;
2283 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2284 if (ret != PMINFO_R_OK)
2286 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2287 if (ret != PMINFO_R_OK) {
2288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2296 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2297 int *uri_count, char ***uri);
2300 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2301 int *mime_count, char ***mime)
2302 * @brief This API gets the list of mime 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] mime_count pointer to hold number of mimes
2309 * @param[out] mime pointer to hold list of mimes
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_operation()
2319 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2324 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2325 for (i = 0; i < mc; i++) {
2326 if (strcmp(mime[i], (char *)user_data) == 0)
2333 static int check_mime(const char *appid, char *mime)
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 *)mime);
2341 if (ret != PMINFO_R_OK) {
2342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2350 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2351 int *mime_count, char ***mime);
2354 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2355 * @brief This API gets the notification icon of the application
2357 * @par This API is for package-manager client application
2358 * @par Sync (or) Async : Synchronous API
2360 * @param[in] handle pointer to the application info handle.
2361 * @param[out] path pointer to hold notification icon
2362 * @return 0 if success, error code(<0) if fail
2363 * @retval PMINFO_R_OK success
2364 * @retval PMINFO_R_EINVAL invalid argument
2365 * @retval PMINFO_R_ERROR internal error
2366 * @pre pkgmgrinfo_appinfo_get_appinfo()
2367 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2368 * @see pkgmgrinfo_appinfo_get_appid()
2369 * @see pkgmgrinfo_appinfo_is_multiple()
2371 static int get_app_notification_icon(const char *appid)
2374 char *notification_icon = NULL;
2375 pkgmgrinfo_appinfo_h handle;
2376 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2377 if (ret != PMINFO_R_OK)
2379 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2380 if (ret != PMINFO_R_OK) {
2381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2384 printf("notification icon : %s\n", notification_icon);
2385 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2393 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2394 * @brief This API gets the setting icon of the application
2396 * @par This API is for package-manager client application
2397 * @par Sync (or) Async : Synchronous API
2399 * @param[in] handle pointer to the application info handle.
2400 * @param[out] path pointer to hold setting icon
2401 * @return 0 if success, error code(<0) if fail
2402 * @retval PMINFO_R_OK success
2403 * @retval PMINFO_R_EINVAL invalid argument
2404 * @retval PMINFO_R_ERROR internal error
2405 * @pre pkgmgrinfo_appinfo_get_appinfo()
2406 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2407 * @see pkgmgrinfo_appinfo_get_appid()
2408 * @see pkgmgrinfo_appinfo_is_multiple()
2410 static int get_app_setting_icon(const char *appid)
2413 char *setting_icon = NULL;
2414 pkgmgrinfo_appinfo_h handle;
2415 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2416 if (ret != PMINFO_R_OK)
2418 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2419 if (ret != PMINFO_R_OK) {
2420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2423 printf("setting icon : %s\n", setting_icon);
2424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2429 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2432 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2433 * @brief This API gets the type of recent image on app-tray
2435 * @par This API is for package-manager client application
2436 * @par Sync (or) Async : Synchronous API
2438 * @param[in] handle pointer to the application info handle.
2439 * @param[out] type pointer to hold image type
2440 * @return 0 if success, error code(<0) if fail
2441 * @retval PMINFO_R_OK success
2442 * @retval PMINFO_R_EINVAL invalid argument
2443 * @retval PMINFO_R_ERROR internal error
2444 * @pre pkgmgrinfo_appinfo_get_appinfo()
2445 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2446 * @see pkgmgrinfo_appinfo_get_appid()
2447 * @see pkgmgrinfo_appinfo_is_multiple()
2449 static int get_app_recent_image_type(const char *appid)
2452 pkgmgrinfo_app_recentimage type;
2453 pkgmgrinfo_appinfo_h handle;
2454 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2455 if (ret != PMINFO_R_OK)
2457 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2458 if (ret != PMINFO_R_OK) {
2459 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2462 printf("recent image type: %d\n", type);
2463 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2468 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2471 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2472 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2473 * @brief This API gets the list of category for a particular application
2475 * @par This API is for package-manager client application
2476 * @par Sync (or) Async : Synchronous API
2477 * @param[in] handle pointer to the application info handle.
2478 * @param[in] category_func callback function for list
2479 * @param[in] user_data user data to be passed to callback function
2480 * @return 0 if success, error code(<0) if fail
2481 * @retval PMINFO_R_OK success
2482 * @retval PMINFO_R_EINVAL invalid argument
2483 * @retval PMINFO_R_ERROR internal error
2484 * @pre pkgmgrinfo_appinfo_get_appinfo()
2485 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2487 int category_func(const char *name, void *user_data)
2489 if (strcmp(name, (char *)user_data) == 0)
2495 static int list_category(const char *appid, char *category)
2498 pkgmgrinfo_appinfo_h handle;
2499 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2500 if (ret != PMINFO_R_OK)
2502 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
2503 if (ret != PMINFO_R_OK) {
2504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2512 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
2513 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
2517 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2518 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2519 * @brief This API gets the list of app-control for a particular application
2521 * @par This API is for package-manager client application
2522 * @par Sync (or) Async : Synchronous API
2523 * @param[in] handle pointer to the application info handle.
2524 * @param[in] appcontrol_func callback function for list
2525 * @param[in] user_data user data to be passed to callback function
2526 * @return 0 if success, error code(<0) if fail
2527 * @retval PMINFO_R_OK success
2528 * @retval PMINFO_R_EINVAL invalid argument
2529 * @retval PMINFO_R_ERROR internal error
2530 * @pre pkgmgrinfo_appinfo_get_appinfo()
2531 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2533 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2538 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2539 for (i = 0; i < oc; i++) {
2540 if (strcmp(operation[i], (char *)user_data) == 0)
2547 static int check_operation(const char *appid, char *operation)
2550 pkgmgrinfo_appinfo_h handle;
2551 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2552 if (ret != PMINFO_R_OK)
2554 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2555 if (ret != PMINFO_R_OK) {
2556 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2564 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
2565 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
2568 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
2569 * @brief This API gets the application 'nodisplay' value from the app ID
2571 * @par This API is for package-manager client application
2572 * @par Sync (or) Async : Synchronous API
2574 * @param[in] handle pointer to application info handle
2575 * @param[out] nodisplay pointer to hold package nodisplay value
2576 * @return 0 if success, error code(<0) if fail
2577 * @retval PMINFO_R_OK success
2578 * @retval PMINFO_R_EINVAL invalid argument
2579 * @retval PMINFO_R_ERROR internal error
2580 * @pre pkgmgrinfo_appinfo_get_appinfo()
2581 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2582 * @see pkgmgrinfo_appinfo_get_appid()
2583 * @see pkgmgrinfo_appinfo_is_multiple()
2585 static int get_app_nodisplay(const char *appid)
2589 pkgmgrinfo_appinfo_h handle;
2590 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2591 if (ret != PMINFO_R_OK)
2593 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
2594 if (ret != PMINFO_R_OK) {
2595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2598 printf("app nodisplay: %d\n", nodisplay);
2599 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2604 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
2607 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
2608 * @brief This API gets the application 'multiple' value from the app ID
2610 * @par This API is for package-manager client application
2611 * @par Sync (or) Async : Synchronous API
2613 * @param[in] handle pointer to application info handle
2614 * @param[out] multiple pointer to hold package multiple value
2615 * @return 0 if success, error code(<0) if fail
2616 * @retval PMINFO_R_OK success
2617 * @retval PMINFO_R_EINVAL invalid argument
2618 * @retval PMINFO_R_ERROR internal error
2619 * @pre pkgmgrinfo_appinfo_get_appinfo()
2620 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2621 * @see pkgmgrinfo_appinfo_get_appid()
2622 * @see pkgmgrinfo_appinfo_is_nodisplay()
2624 static int get_app_multiple(const char *appid)
2628 pkgmgrinfo_appinfo_h handle;
2629 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2630 if (ret != PMINFO_R_OK)
2632 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
2633 if (ret != PMINFO_R_OK) {
2634 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2637 printf("app multiple: %d\n", multiple);
2638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2643 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
2646 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
2647 * @brief This API gets the application 'taskmanage' value from the app ID
2649 * @par This API is for package-manager client application
2650 * @par Sync (or) Async : Synchronous API
2652 * @param[in] handle pointer to application info handle
2653 * @param[out] taskmanage pointer to hold package taskmanage value
2654 * @return 0 if success, error code(<0) if fail
2655 * @retval PMINFO_R_OK success
2656 * @retval PMINFO_R_EINVAL invalid argument
2657 * @retval PMINFO_R_ERROR internal error
2658 * @pre pkgmgrinfo_appinfo_get_appinfo()
2659 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2660 * @see pkgmgrinfo_appinfo_get_appid()
2661 * @see pkgmgrinfo_appinfo_is_multiple()
2663 static int get_app_taskmanage(const char *appid)
2667 pkgmgrinfo_appinfo_h handle;
2668 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2669 if (ret != PMINFO_R_OK)
2671 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
2672 if (ret != PMINFO_R_OK) {
2673 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2676 printf("app taskmanage: %d\n", taskmanage);
2677 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2682 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
2685 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2686 * @brief This API gets the application 'hwacceleration' value from the app ID
2688 * @par This API is for package-manager client application
2689 * @par Sync (or) Async : Synchronous API
2691 * @param[in] handle pointer to application info handle
2692 * @param[out] hwacceleration pointer to hold package hwacceleration value
2693 * @return 0 if success, error code(<0) if fail
2694 * @retval PMINFO_R_OK success
2695 * @retval PMINFO_R_EINVAL invalid argument
2696 * @retval PMINFO_R_ERROR internal error
2697 * @pre pkgmgrinfo_appinfo_get_appinfo()
2698 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2699 * @see pkgmgrinfo_appinfo_get_appid()
2700 * @see pkgmgrinfo_appinfo_is_multiple()
2702 static int get_app_hwacceleration(const char *appid)
2705 pkgmgrinfo_app_hwacceleration hwacceleration;
2706 pkgmgrinfo_appinfo_h handle;
2707 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2708 if (ret != PMINFO_R_OK)
2710 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2711 if (ret != PMINFO_R_OK) {
2712 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2715 printf("app hwacceleration: %d\n", hwacceleration);
2716 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2721 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2724 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
2725 * @brief This API gets the application 'onboot' value from the app ID
2727 * @par This API is for package-manager client application
2728 * @par Sync (or) Async : Synchronous API
2730 * @param[in] handle pointer to application info handle
2731 * @param[out] onboot pointer to hold package onboot value
2732 * @return 0 if success, error code(<0) if fail
2733 * @retval PMINFO_R_OK success
2734 * @retval PMINFO_R_EINVAL invalid argument
2735 * @retval PMINFO_R_ERROR internal error
2736 * @pre pkgmgrinfo_appinfo_get_appinfo()
2737 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2738 * @see pkgmgrinfo_appinfo_get_appid()
2739 * @see pkgmgrinfo_appinfo_is_multiple()
2741 static int get_app_onboot(const char *appid)
2745 pkgmgrinfo_appinfo_h handle;
2746 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2747 if (ret != PMINFO_R_OK)
2749 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
2750 if (ret != PMINFO_R_OK) {
2751 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2754 printf("app onboot: %d\n", onboot);
2755 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2760 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
2763 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
2764 * @brief This API gets the application 'autorestart' value from the app ID
2766 * @par This API is for package-manager client application
2767 * @par Sync (or) Async : Synchronous API
2769 * @param[in] handle pointer to application info handle
2770 * @param[out] autorestart pointer to hold package autorestart value
2771 * @return 0 if success, error code(<0) if fail
2772 * @retval PMINFO_R_OK success
2773 * @retval PMINFO_R_EINVAL invalid argument
2774 * @retval PMINFO_R_ERROR internal error
2775 * @pre pkgmgrinfo_appinfo_get_appinfo()
2776 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2777 * @see pkgmgrinfo_appinfo_get_appid()
2778 * @see pkgmgrinfo_appinfo_is_multiple()
2780 static int get_app_autorestart(const char *appid)
2784 pkgmgrinfo_appinfo_h handle;
2785 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2786 if (ret != PMINFO_R_OK)
2788 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
2789 if (ret != PMINFO_R_OK) {
2790 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2793 printf("app autorestart: %d\n", autorestart);
2794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2799 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
2802 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
2803 * @brief This API gets the value for given application is main app or not from handle
2805 * @par This API is for package-manager client application
2806 * @par Sync (or) Async : Synchronous API
2808 * @param[in] handle pointer to application info handle
2809 * @param[out] mainapp pointer to hold package mainapp is or not
2810 * @return 0 if success, error code(<0) if fail
2811 * @retval PMINFO_R_OK success
2812 * @retval PMINFO_R_EINVAL invalid argument
2813 * @retval PMINFO_R_ERROR internal error
2814 * @pre pkgmgrinfo_appinfo_get_appinfo()
2815 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2816 * @see pkgmgrinfo_appinfo_get_appid()
2817 * @see pkgmgrinfo_appinfo_is_multiple()
2819 static int get_app_mainapp(const char *appid)
2823 pkgmgrinfo_appinfo_h handle;
2824 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2825 if (ret != PMINFO_R_OK)
2827 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
2828 if (ret != PMINFO_R_OK) {
2829 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2832 printf("mainapp: %d\n", mainapp);
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2838 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
2841 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
2842 * @brief This API destroys the application information handle freeing up all the resources
2844 * @par This API is for package-manager client application
2845 * @par Sync (or) Async : Synchronous API
2847 * @param[in] handle pointer to the application info handle.
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()
2854 * @see pkgmgrinfo_appinfo_get_pkgid()
2855 * @see pkgmgrinfo_appinfo_is_multiple()
2857 static int get_app_type(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_get_apptype(handle, &type);
2866 if (ret != PMINFO_R_OK) {
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2870 printf("apptype: %s\n", type);
2871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
2879 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
2880 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
2881 The query will search the entire application information collected from the manifest file of all the installed packages
2883 * @par This API is for package-manager client application
2884 * @par Sync (or) Async : Synchronous API
2886 * @param[out] handle pointer to the application info filter handle.
2887 * @return 0 if success, error code(<0) if fail
2888 * @retval PMINFO_R_OK success
2889 * @retval PMINFO_R_EINVAL invalid argument
2890 * @retval PMINFO_R_ERROR internal error
2892 * @post pkgmgrinfo_appinfo_filter_destroy()
2893 * @see pkgmgrinfo_appinfo_filter_count()
2894 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
2896 static int get_capp_count()
2900 pkgmgrinfo_appinfo_filter_h handle;
2901 ret = pkgmgrinfo_appinfo_filter_create(&handle);
2902 if (ret != PMINFO_R_OK)
2904 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
2905 if (ret != PMINFO_R_OK) {
2906 pkgmgrinfo_appinfo_filter_destroy(handle);
2909 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2910 if (ret != PMINFO_R_OK) {
2911 pkgmgrinfo_appinfo_filter_destroy(handle);
2914 printf("No of capp: %d\n", count);
2915 pkgmgrinfo_appinfo_filter_destroy(handle);
2920 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
2923 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
2924 * @brief This API destroys the application information filter handle freeing up all the resources
2926 * @par This API is for package-manager client application
2927 * @par Sync (or) Async : Synchronous API
2929 * @param[in] handle pointer to the application info filter handle.
2930 * @return 0 if success, error code(<0) if fail
2931 * @retval PMINFO_R_OK success
2932 * @retval PMINFO_R_EINVAL invalid argument
2933 * @retval PMINFO_R_ERROR internal error
2934 * @pre pkgmgrinfo_appinfo_filter_create()
2936 * @see pkgmgrinfo_appinfo_filter_count()
2937 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
2939 static int get_capp_count()
2943 pkgmgrinfo_appinfo_filter_h handle;
2944 ret = pkgmgrinfo_appinfo_filter_create(&handle);
2945 if (ret != PMINFO_R_OK)
2947 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
2948 if (ret != PMINFO_R_OK) {
2949 pkgmgrinfo_appinfo_filter_destroy(handle);
2952 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2953 if (ret != PMINFO_R_OK) {
2954 pkgmgrinfo_appinfo_filter_destroy(handle);
2957 printf("No of capp: %d\n", count);
2958 pkgmgrinfo_appinfo_filter_destroy(handle);
2963 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
2966 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
2967 * @brief This API adds a boolean filter property to the filter handle
2969 * @par This API is for package-manager client application
2970 * @par Sync (or) Async : Synchronous API
2972 * @param[in] handle pointer to the application info filter handle.
2973 * @param[in] property boolean property name.
2974 * @param[in] value value corresponding to the property.
2975 * @return 0 if success, error code(<0) if fail
2976 * @retval PMINFO_R_OK success
2977 * @retval PMINFO_R_EINVAL invalid argument
2978 * @retval PMINFO_R_ERROR internal error
2979 * @pre pkgmgrinfo_appinfo_filter_create()
2980 * @post pkgmgrinfo_appinfo_filter_destroy()
2981 * @see pkgmgrinfo_appinfo_filter_count()
2982 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
2984 static int get_taskmanageable_app_count()
2988 pkgmgrinfo_appinfo_filter_h handle;
2989 ret = pkgmgrinfo_appinfo_filter_create(&handle);
2990 if (ret != PMINFO_R_OK)
2992 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
2993 if (ret != PMINFO_R_OK) {
2994 pkgmgrinfo_appinfo_filter_destroy(handle);
2997 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
2998 if (ret != PMINFO_R_OK) {
2999 pkgmgrinfo_appinfo_filter_destroy(handle);
3002 printf("No of taskmanageable apps: %d\n", count);
3003 pkgmgrinfo_appinfo_filter_destroy(handle);
3008 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3009 const char *property, const bool value);
3012 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3013 * @brief This API adds an integer filter property to the filter handle
3015 * @par This API is for package-manager client application
3016 * @par Sync (or) Async : Synchronous API
3018 * @param[in] handle pointer to the application info filter handle.
3019 * @param[in] property integer property name.
3020 * @param[in] value value corresponding to the property.
3021 * @return 0 if success, error code(<0) if fail
3022 * @retval PMINFO_R_OK success
3023 * @retval PMINFO_R_EINVAL invalid argument
3024 * @retval PMINFO_R_ERROR internal error
3025 * @pre pkgmgrinfo_appinfo_filter_create()
3026 * @post pkgmgrinfo_appinfo_filter_destroy()
3027 * @see pkgmgrinfo_appinfo_filter_count()
3028 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3030 static int get_taskmanageable_app_count()
3034 pkgmgrinfo_appinfo_filter_h handle;
3035 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3036 if (ret != PMINFO_R_OK)
3038 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3039 if (ret != PMINFO_R_OK) {
3040 pkgmgrinfo_appinfo_filter_destroy(handle);
3043 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3044 if (ret != PMINFO_R_OK) {
3045 pkgmgrinfo_appinfo_filter_destroy(handle);
3048 printf("No of apps: %d\n", count);
3049 pkgmgrinfo_appinfo_filter_destroy(handle);
3054 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3055 const char *property, const int value);
3058 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3059 * @brief This API adds a string filter property to the filter handle
3061 * @par This API is for package-manager client application
3062 * @par Sync (or) Async : Synchronous API
3064 * @param[in] handle pointer to the application info filter handle.
3065 * @param[in] property string property name.
3066 * @param[in] value value corresponding to the property.
3067 * @return 0 if success, error code(<0) if fail
3068 * @retval PMINFO_R_OK success
3069 * @retval PMINFO_R_EINVAL invalid argument
3070 * @retval PMINFO_R_ERROR internal error
3071 * @pre pkgmgrinfo_appinfo_filter_create()
3072 * @post pkgmgrinfo_appinfo_filter_destroy()
3073 * @see pkgmgrinfo_appinfo_filter_count()
3074 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3076 static int get_capp_count()
3080 pkgmgrinfo_appinfo_filter_h handle;
3081 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3082 if (ret != PMINFO_R_OK)
3084 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3085 if (ret != PMINFO_R_OK) {
3086 pkgmgrinfo_appinfo_filter_destroy(handle);
3089 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3090 if (ret != PMINFO_R_OK) {
3091 pkgmgrinfo_appinfo_filter_destroy(handle);
3094 printf("No of capp: %d\n", count);
3095 pkgmgrinfo_appinfo_filter_destroy(handle);
3100 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3101 const char *property, const char *value);
3104 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3105 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3107 * @par This API is for package-manager client application
3108 * @par Sync (or) Async : Synchronous API
3110 * @param[in] handle pointer to the application info filter handle.
3111 * @param[in] app_cb callback function.
3112 * @param[in] user_data user data to be passed to the callback function
3113 * @return 0 if success, error code(<0) if fail
3114 * @retval PMINFO_R_OK success
3115 * @retval PMINFO_R_EINVAL invalid argument
3116 * @retval PMINFO_R_ERROR internal error
3117 * @pre pkgmgrinfo_appinfo_filter_create()
3118 * @post pkgmgrinfo_appinfo_filter_destroy()
3119 * @see pkgmgrinfo_appinfo_filter_count()
3121 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3124 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3125 printf("appid : %s\n", appid);
3129 static int get_capp_list()
3132 pkgmgrinfo_appinfo_filter_h handle;
3133 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3134 if (ret != PMINFO_R_OK)
3136 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3137 if (ret != PMINFO_R_OK) {
3138 pkgmgrinfo_appinfo_filter_destroy(handle);
3141 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3142 if (ret != PMINFO_R_OK) {
3143 pkgmgrinfo_appinfo_filter_destroy(handle);
3146 pkgmgrinfo_appinfo_filter_destroy(handle);
3151 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3152 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3155 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3156 * @brief This API counts the application that satisfy the filter conditions
3158 * @par This API is for package-manager client application
3159 * @par Sync (or) Async : Synchronous API
3161 * @param[in] handle pointer to the application info filter handle.
3162 * @param[in] count pointer to store count value
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_filter_create()
3168 * @post pkgmgrinfo_appinfo_filter_destroy()
3169 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3171 static int get_capp_count()
3175 pkgmgrinfo_appinfo_filter_h handle;
3176 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3177 if (ret != PMINFO_R_OK)
3179 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3180 if (ret != PMINFO_R_OK) {
3181 pkgmgrinfo_appinfo_filter_destroy(handle);
3184 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3185 if (ret != PMINFO_R_OK) {
3186 pkgmgrinfo_appinfo_filter_destroy(handle);
3189 printf("No of capp: %d\n", count);
3190 pkgmgrinfo_appinfo_filter_destroy(handle);
3195 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
3198 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
3199 * @brief This API creates the package cert information handle to get data from db.
3201 * @par This API is for package-manager client application
3202 * @par Sync (or) Async : Synchronous API
3204 * @param[out] handle pointer to the package cert handle.
3205 * @return 0 if success, error code(<0) if fail
3206 * @retval PMINFO_R_OK success
3207 * @retval PMINFO_R_EINVAL invalid argument
3208 * @retval PMINFO_R_ERROR internal error
3210 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3211 * @see pkgmgrinfo_pkginfo_get_cert_value()
3212 * @see pkgmgrinfo_pkginfo_load_certinfo()
3214 static int get_cert_info(const char *pkgid)
3217 pkgmgrinfo_certinfo_h handle;
3218 char *auth_cert = NULL;
3219 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3220 if (ret != PMINFO_R_OK)
3222 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3223 if (ret != PMINFO_R_OK) {
3224 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3227 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3228 if (ret != PMINFO_R_OK) {
3229 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3232 printf("Author root certificate: %s\n", auth_root);
3233 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3238 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
3241 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
3242 * @brief This API loads the package cert information handle with data from db.
3244 * @par This API is for package-manager client application
3245 * @par Sync (or) Async : Synchronous API
3247 * @param[in] pkgid pointer to the package ID.
3248 * @param[in] handle pointer to the package cert handle.
3249 * @return 0 if success, error code(<0) if fail
3250 * @retval PMINFO_R_OK success
3251 * @retval PMINFO_R_EINVAL invalid argument
3252 * @retval PMINFO_R_ERROR internal error
3253 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3254 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3255 * @see pkgmgrinfo_pkginfo_get_cert_value()
3257 static int get_cert_info(const char *pkgid)
3260 pkgmgrinfo_certinfo_h handle;
3261 char *auth_cert = NULL;
3262 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3263 if (ret != PMINFO_R_OK)
3265 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3266 if (ret != PMINFO_R_OK) {
3267 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3270 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3271 if (ret != PMINFO_R_OK) {
3272 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3275 printf("Author root certificate: %s\n", auth_root);
3276 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3281 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
3284 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
3285 * @brief This API gets the package cert information from the handle
3287 * @par This API is for package-manager client application
3288 * @par Sync (or) Async : Synchronous API
3290 * @param[in] handle pointer to the package cert handle.
3291 * @param[in] cert_type certificate type
3292 * @param[out] cert_value pointer to hold certificate value
3293 * @return 0 if success, error code(<0) if fail
3294 * @retval PMINFO_R_OK success
3295 * @retval PMINFO_R_EINVAL invalid argument
3296 * @retval PMINFO_R_ERROR internal error
3297 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3298 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
3299 * @see pkgmgrinfo_pkginfo_load_certinfo()
3301 static int get_cert_info(const char *pkgid)
3304 pkgmgrinfo_certinfo_h handle;
3305 char *auth_cert = NULL;
3306 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3307 if (ret != PMINFO_R_OK)
3309 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3310 if (ret != PMINFO_R_OK) {
3311 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3314 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3315 if (ret != PMINFO_R_OK) {
3316 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3319 printf("Author root certificate: %s\n", auth_root);
3320 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3325 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
3328 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
3329 * @brief This API destroys the package cert information handle freeing up all the resources
3331 * @par This API is for package-manager client application
3332 * @par Sync (or) Async : Synchronous API
3334 * @param[in] handle pointer to the package cert handle.
3335 * @return 0 if success, error code(<0) if fail
3336 * @retval PMINFO_R_OK success
3337 * @retval PMINFO_R_EINVAL invalid argument
3338 * @retval PMINFO_R_ERROR internal error
3339 * @pre pkgmgrinfo_pkginfo_create_certinfo()
3341 * @see pkgmgrinfo_pkginfo_load_certinfo()
3343 static int get_cert_info(const char *pkgid)
3346 pkgmgrinfo_certinfo_h handle;
3347 char *auth_cert = NULL;
3348 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
3349 if (ret != PMINFO_R_OK)
3351 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
3352 if (ret != PMINFO_R_OK) {
3353 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3356 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
3357 if (ret != PMINFO_R_OK) {
3358 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3361 printf("Author root certificate: %s\n", auth_root);
3362 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
3367 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
3370 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
3371 * @brief This API deletes the package cert information from DB
3373 * @par This API is for package-manager client application
3374 * @par Sync (or) Async : Synchronous API
3376 * @param[in] pkgid pointer to the package ID.
3377 * @return 0 if success, error code(<0) if fail
3378 * @retval PMINFO_R_OK success
3379 * @retval PMINFO_R_EINVAL invalid argument
3380 * @retval PMINFO_R_ERROR internal error
3384 static int delete_cert_info(const char *pkgid)
3387 ret = pkgmgrinfo_delete_certinfo(pkgid);
3388 if (ret != PMINFO_R_OK)
3394 int pkgmgrinfo_delete_certinfo(const char *pkgid);
3397 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
3398 * @brief This API creates the package db information handle to set data in db.
3400 * @par This API is for package-manager client application
3401 * @par Sync (or) Async : Synchronous API
3403 * @param[in] pkgid pointer to the package ID.
3404 * @param[out] handle pointer to the package db info handle.
3405 * @return 0 if success, error code(<0) if fail
3406 * @retval PMINFO_R_OK success
3407 * @retval PMINFO_R_EINVAL invalid argument
3408 * @retval PMINFO_R_ERROR internal error
3410 * @post pkgmgrinfo_destroy_pkgdbinfo()
3411 * @see pkgmgrinfo_save_pkgdbinfo()
3412 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3414 static int set_pkg_in_db(const char *pkgid)
3417 pkgmgrinfo_pkgdbinfo_h handle;
3418 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3419 if (ret != PMINFO_R_OK)
3421 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3422 if (ret != PMINFO_R_OK) {
3423 pkgmgrinfo_destroy_pkgdbinfo(handle);
3426 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3427 if (ret != PMINFO_R_OK) {
3428 pkgmgrinfo_destroy_pkgdbinfo(handle);
3431 pkgmgrinfo_destroy_pkgdbinfo(handle);
3436 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
3439 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
3440 * @brief This API sets the package type in db handle
3442 * @par This API is for package-manager client application
3443 * @par Sync (or) Async : Synchronous API
3445 * @param[in] handle pointer to the pkgdbinfo handle.
3446 * @param[in] type pointer to the package type.
3447 * @return 0 if success, error code(<0) if fail
3448 * @retval PMINFO_R_OK success
3449 * @retval PMINFO_R_EINVAL invalid argument
3450 * @retval PMINFO_R_ERROR internal error
3451 * @pre pkgmgrinfo_create_pkgdbinfo()
3452 * @post pkgmgrinfo_destroy_pkgdbinfo()
3453 * @see pkgmgrinfo_save_pkgdbinfo()
3454 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
3456 static int set_pkg_type_in_db(const char *pkgid)
3459 pkgmgrinfo_pkgdbinfo_h handle;
3460 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3461 if (ret != PMINFO_R_OK)
3463 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
3464 if (ret != PMINFO_R_OK) {
3465 pkgmgrinfo_destroy_pkgdbinfo(handle);
3468 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3469 if (ret != PMINFO_R_OK) {
3470 pkgmgrinfo_destroy_pkgdbinfo(handle);
3473 pkgmgrinfo_destroy_pkgdbinfo(handle);
3478 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
3481 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
3482 * @brief This API sets the package version in db handle
3484 * @par This API is for package-manager client application
3485 * @par Sync (or) Async : Synchronous API
3487 * @param[in] handle pointer to the pkgdbinfo handle.
3488 * @param[in] version pointer to the package version
3489 * @return 0 if success, error code(<0) if fail
3490 * @retval PMINFO_R_OK success
3491 * @retval PMINFO_R_EINVAL invalid argument
3492 * @retval PMINFO_R_ERROR internal error
3493 * @pre pkgmgrinfo_create_pkgdbinfo()
3494 * @post pkgmgrinfo_destroy_pkgdbinfo()
3495 * @see pkgmgrinfo_save_pkgdbinfo()
3496 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3498 static int set_pkg_version_in_db(const char *pkgid)
3501 pkgmgrinfo_pkgdbinfo_h handle;
3502 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3503 if (ret != PMINFO_R_OK)
3505 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3506 if (ret != PMINFO_R_OK) {
3507 pkgmgrinfo_destroy_pkgdbinfo(handle);
3510 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3511 if (ret != PMINFO_R_OK) {
3512 pkgmgrinfo_destroy_pkgdbinfo(handle);
3515 pkgmgrinfo_destroy_pkgdbinfo(handle);
3520 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
3523 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
3524 * @brief This API sets the package install location in db handle
3526 * @par This API is for package-manager client application
3527 * @par Sync (or) Async : Synchronous API
3529 * @param[in] handle pointer to the pkgdbinfo handle.
3530 * @param[in] location package install location
3531 * @return 0 if success, error code(<0) if fail
3532 * @retval PMINFO_R_OK success
3533 * @retval PMINFO_R_EINVAL invalid argument
3534 * @retval PMINFO_R_ERROR internal error
3535 * @pre pkgmgrinfo_create_pkgdbinfo()
3536 * @post pkgmgrinfo_destroy_pkgdbinfo()
3537 * @see pkgmgrinfo_save_pkgdbinfo()
3538 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3540 static int set_pkg_install_location_in_db(const char *pkgid)
3543 pkgmgrinfo_pkgdbinfo_h handle;
3544 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3545 if (ret != PMINFO_R_OK)
3547 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
3548 if (ret != PMINFO_R_OK) {
3549 pkgmgrinfo_destroy_pkgdbinfo(handle);
3552 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3553 if (ret != PMINFO_R_OK) {
3554 pkgmgrinfo_destroy_pkgdbinfo(handle);
3557 pkgmgrinfo_destroy_pkgdbinfo(handle);
3562 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
3565 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
3566 * @brief This API sets the package size in db handle
3568 * @par This API is for package-manager client application
3569 * @par Sync (or) Async : Synchronous API
3571 * @param[in] handle pointer to the pkgdbinfo handle.
3572 * @param[in] size pointer to the package size
3573 * @return 0 if success, error code(<0) if fail
3574 * @retval PMINFO_R_OK success
3575 * @retval PMINFO_R_EINVAL invalid argument
3576 * @retval PMINFO_R_ERROR internal error
3577 * @pre pkgmgrinfo_create_pkgdbinfo()
3578 * @post pkgmgrinfo_destroy_pkgdbinfo()
3579 * @see pkgmgrinfo_save_pkgdbinfo()
3580 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3582 static int set_pkg_size_in_db(const char *pkgid)
3585 pkgmgrinfo_pkgdbinfo_h handle;
3586 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3587 if (ret != PMINFO_R_OK)
3589 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
3590 if (ret != PMINFO_R_OK) {
3591 pkgmgrinfo_destroy_pkgdbinfo(handle);
3594 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3595 if (ret != PMINFO_R_OK) {
3596 pkgmgrinfo_destroy_pkgdbinfo(handle);
3599 pkgmgrinfo_destroy_pkgdbinfo(handle);
3604 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
3607 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
3608 * @brief This API sets the package label in db handle
3610 * @par This API is for package-manager client application
3611 * @par Sync (or) Async : Synchronous API
3613 * @param[in] handle pointer to the pkgdbinfo handle.
3614 * @param[in] label pointer to the package label
3615 * @param[in] locale pointer to the locale
3616 * @return 0 if success, error code(<0) if fail
3617 * @retval PMINFO_R_OK success
3618 * @retval PMINFO_R_EINVAL invalid argument
3619 * @retval PMINFO_R_ERROR internal error
3620 * @pre pkgmgrinfo_create_pkgdbinfo()
3621 * @post pkgmgrinfo_destroy_pkgdbinfo()
3622 * @see pkgmgrinfo_save_pkgdbinfo()
3623 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3625 static int set_pkg_label_in_db(const char *pkgid)
3628 pkgmgrinfo_pkgdbinfo_h handle;
3629 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3630 if (ret != PMINFO_R_OK)
3632 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
3633 if (ret != PMINFO_R_OK) {
3634 pkgmgrinfo_destroy_pkgdbinfo(handle);
3637 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3638 if (ret != PMINFO_R_OK) {
3639 pkgmgrinfo_destroy_pkgdbinfo(handle);
3642 pkgmgrinfo_destroy_pkgdbinfo(handle);
3647 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
3650 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
3651 * @brief This API sets the package icon in db handle
3653 * @par This API is for package-manager client application
3654 * @par Sync (or) Async : Synchronous API
3656 * @param[in] handle pointer to the pkgdbinfo handle.
3657 * @param[in] icon pointer to the package icon
3658 * @param[in] locale pointer to the locale
3659 * @return 0 if success, error code(<0) if fail
3660 * @retval PMINFO_R_OK success
3661 * @retval PMINFO_R_EINVAL invalid argument
3662 * @retval PMINFO_R_ERROR internal error
3663 * @pre pkgmgrinfo_create_pkgdbinfo()
3664 * @post pkgmgrinfo_destroy_pkgdbinfo()
3665 * @see pkgmgrinfo_save_pkgdbinfo()
3666 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3668 static int set_pkg_icon_in_db(const char *pkgid)
3671 pkgmgrinfo_pkgdbinfo_h handle;
3672 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3673 if (ret != PMINFO_R_OK)
3675 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
3676 if (ret != PMINFO_R_OK) {
3677 pkgmgrinfo_destroy_pkgdbinfo(handle);
3680 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3681 if (ret != PMINFO_R_OK) {
3682 pkgmgrinfo_destroy_pkgdbinfo(handle);
3685 pkgmgrinfo_destroy_pkgdbinfo(handle);
3690 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
3693 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
3694 * @brief This API sets the package description in db handle
3696 * @par This API is for package-manager client application
3697 * @par Sync (or) Async : Synchronous API
3699 * @param[in] handle pointer to the pkgdbinfo handle.
3700 * @param[in] description pointer to the package description
3701 * @param[in] locale pointer to the locale
3702 * @return 0 if success, error code(<0) if fail
3703 * @retval PMINFO_R_OK success
3704 * @retval PMINFO_R_EINVAL invalid argument
3705 * @retval PMINFO_R_ERROR internal error
3706 * @pre pkgmgrinfo_create_pkgdbinfo()
3707 * @post pkgmgrinfo_destroy_pkgdbinfo()
3708 * @see pkgmgrinfo_save_pkgdbinfo()
3709 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3711 static int set_pkg_description_in_db(const char *pkgid)
3714 pkgmgrinfo_pkgdbinfo_h handle;
3715 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3716 if (ret != PMINFO_R_OK)
3718 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
3719 if (ret != PMINFO_R_OK) {
3720 pkgmgrinfo_destroy_pkgdbinfo(handle);
3723 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3724 if (ret != PMINFO_R_OK) {
3725 pkgmgrinfo_destroy_pkgdbinfo(handle);
3728 pkgmgrinfo_destroy_pkgdbinfo(handle);
3733 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
3736 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
3737 const char *author_email, const char *author_href, const char *locale)
3738 * @brief This API sets the package author info in db handle
3740 * @par This API is for package-manager client application
3741 * @par Sync (or) Async : Synchronous API
3743 * @param[in] handle pointer to the pkgdbinfo handle.
3744 * @param[in] author_name pointer to the package author name
3745 * @param[in] author_email pointer to the package author email
3746 * @param[in] author_href pointer to the package author href
3747 * @param[in] locale pointer to the locale
3748 * @return 0 if success, error code(<0) if fail
3749 * @retval PMINFO_R_OK success
3750 * @retval PMINFO_R_EINVAL invalid argument
3751 * @retval PMINFO_R_ERROR internal error
3752 * @pre pkgmgrinfo_create_pkgdbinfo()
3753 * @post pkgmgrinfo_destroy_pkgdbinfo()
3754 * @see pkgmgrinfo_save_pkgdbinfo()
3755 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3757 static int set_pkg_author_in_db(const char *pkgid)
3760 pkgmgrinfo_pkgdbinfo_h handle;
3761 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3762 if (ret != PMINFO_R_OK)
3764 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
3765 if (ret != PMINFO_R_OK) {
3766 pkgmgrinfo_destroy_pkgdbinfo(handle);
3769 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3770 if (ret != PMINFO_R_OK) {
3771 pkgmgrinfo_destroy_pkgdbinfo(handle);
3774 pkgmgrinfo_destroy_pkgdbinfo(handle);
3779 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
3780 const char *author_email, const char *author_href, const char *locale);
3783 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
3784 * @brief This API sets the package 'removable' value in db handle
3786 * @par This API is for package-manager client application
3787 * @par Sync (or) Async : Synchronous API
3789 * @param[in] handle pointer to the pkgdbinfo handle.
3790 * @param[in] removable package removable value
3791 * @return 0 if success, error code(<0) if fail
3792 * @retval PMINFO_R_OK success
3793 * @retval PMINFO_R_EINVAL invalid argument
3794 * @retval PMINFO_R_ERROR internal error
3795 * @pre pkgmgrinfo_create_pkgdbinfo()
3796 * @post pkgmgrinfo_destroy_pkgdbinfo()
3797 * @see pkgmgrinfo_save_pkgdbinfo()
3798 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3800 static int set_pkg_removable_in_db(const char *pkgid)
3803 pkgmgrinfo_pkgdbinfo_h handle;
3804 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3805 if (ret != PMINFO_R_OK)
3807 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
3808 if (ret != PMINFO_R_OK) {
3809 pkgmgrinfo_destroy_pkgdbinfo(handle);
3812 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3813 if (ret != PMINFO_R_OK) {
3814 pkgmgrinfo_destroy_pkgdbinfo(handle);
3817 pkgmgrinfo_destroy_pkgdbinfo(handle);
3822 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
3825 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
3826 * @brief This API sets the package 'preload' value in db handle
3828 * @par This API is for package-manager client application
3829 * @par Sync (or) Async : Synchronous API
3831 * @param[in] handle pointer to the pkgdbinfo handle.
3832 * @param[in] preload package preload value
3833 * @return 0 if success, error code(<0) if fail
3834 * @retval PMINFO_R_OK success
3835 * @retval PMINFO_R_EINVAL invalid argument
3836 * @retval PMINFO_R_ERROR internal error
3837 * @pre pkgmgrinfo_create_pkgdbinfo()
3838 * @post pkgmgrinfo_destroy_pkgdbinfo()
3839 * @see pkgmgrinfo_save_pkgdbinfo()
3840 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3842 static int set_pkg_preload_in_db(const char *pkgid)
3845 pkgmgrinfo_pkgdbinfo_h handle;
3846 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3847 if (ret != PMINFO_R_OK)
3849 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
3850 if (ret != PMINFO_R_OK) {
3851 pkgmgrinfo_destroy_pkgdbinfo(handle);
3854 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3855 if (ret != PMINFO_R_OK) {
3856 pkgmgrinfo_destroy_pkgdbinfo(handle);
3859 pkgmgrinfo_destroy_pkgdbinfo(handle);
3864 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
3867 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
3868 * @brief This API saves all the information from the handle to the DB.
3870 * @par This API is for package-manager client application
3871 * @par Sync (or) Async : Synchronous API
3873 * @param[in] handle pointer to the package db info handle.
3874 * @return 0 if success, error code(<0) if fail
3875 * @retval PMINFO_R_OK success
3876 * @retval PMINFO_R_EINVAL invalid argument
3877 * @retval PMINFO_R_ERROR internal error
3878 * @pre pkgmgrinfo_create_pkgdbinfo()
3879 * @post pkgmgrinfo_destroy_pkgdbinfo()
3880 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3882 static int set_pkg_in_db(const char *pkgid)
3885 pkgmgrinfo_pkgdbinfo_h handle;
3886 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3887 if (ret != PMINFO_R_OK)
3889 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3890 if (ret != PMINFO_R_OK) {
3891 pkgmgrinfo_destroy_pkgdbinfo(handle);
3894 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3895 if (ret != PMINFO_R_OK) {
3896 pkgmgrinfo_destroy_pkgdbinfo(handle);
3899 pkgmgrinfo_destroy_pkgdbinfo(handle);
3904 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
3907 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
3908 * @brief This API destroys the package db information handle freeing up all the resources
3910 * @par This API is for package-manager client application
3911 * @par Sync (or) Async : Synchronous API
3913 * @param[in] handle pointer to the package db info handle.
3914 * @return 0 if success, error code(<0) if fail
3915 * @retval PMINFO_R_OK success
3916 * @retval PMINFO_R_EINVAL invalid argument
3917 * @retval PMINFO_R_ERROR internal error
3918 * @pre pkgmgrinfo_create_pkgdbinfo()
3920 * @see pkgmgrinfo_save_pkgdbinfo()
3921 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
3923 static int set_pkg_in_db(const char *pkgid)
3926 pkgmgrinfo_pkgdbinfo_h handle;
3927 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
3928 if (ret != PMINFO_R_OK)
3930 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
3931 if (ret != PMINFO_R_OK) {
3932 pkgmgrinfo_destroy_pkgdbinfo(handle);
3935 ret = pkgmgrinfo_save_pkgdbinfo(handle);
3936 if (ret != PMINFO_R_OK) {
3937 pkgmgrinfo_destroy_pkgdbinfo(handle);
3940 pkgmgrinfo_destroy_pkgdbinfo(handle);
3945 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
3948 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
3949 * @brief This API creates the package cert information handle to set data in db.
3951 * @par This API is for package-manager client application
3952 * @par Sync (or) Async : Synchronous API
3954 * @param[out] handle pointer to the package cert handle.
3955 * @return 0 if success, error code(<0) if fail
3956 * @retval PMINFO_R_OK success
3957 * @retval PMINFO_R_EINVAL invalid argument
3958 * @retval PMINFO_R_ERROR internal error
3960 * @post pkgmgrinfo_destroy_certinfo_set_handle()
3961 * @see pkgmgrinfo_set_cert_value()
3962 * @see pkgmgrinfo_save_certinfo()
3964 static int set_cert_in_db(const char *pkgid)
3967 pkgmgrinfo_instcertinfo_h handle;
3968 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
3969 if (ret != PMINFO_R_OK)
3971 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
3972 if (ret != PMINFO_R_OK) {
3973 pkgmgrinfo_destroy_certinfo_set_handle(handle);
3976 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
3977 if (ret != PMINFO_R_OK) {
3978 pkgmgrinfo_destroy_certinfo_set_handle(handle);
3981 pkgmgrinfo_destroy_certinfo_set_handle(handle);
3986 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
3989 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
3990 * @brief This API sets the package cert information in the handle.
3992 * @par This API is for package-manager client application
3993 * @par Sync (or) Async : Synchronous API
3995 * @param[in] handle pointer to the package cert handle.
3996 * @param[in] cert_type certificate type.
3997 * @param[in] cert_value certificate value.
3998 * @return 0 if success, error code(<0) if fail
3999 * @retval PMINFO_R_OK success
4000 * @retval PMINFO_R_EINVAL invalid argument
4001 * @retval PMINFO_R_ERROR internal error
4002 * @pre pkgmgrinfo_create_certinfo_set_handle()
4003 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4004 * @see pkgmgrinfo_save_certinfo()
4006 static int set_cert_in_db(const char *pkgid)
4009 pkgmgrinfo_instcertinfo_h handle;
4010 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4011 if (ret != PMINFO_R_OK)
4013 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4014 if (ret != PMINFO_R_OK) {
4015 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4018 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4019 if (ret != PMINFO_R_OK) {
4020 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4023 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4028 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
4031 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
4032 * @brief This API saves the package cert information in the DB.
4034 * @par This API is for package-manager client application
4035 * @par Sync (or) Async : Synchronous API
4037 * @param[in] pkgid pointer to the package ID.
4038 * @param[in] handle pointer to the package cert handle.
4039 * @return 0 if success, error code(<0) if fail
4040 * @retval PMINFO_R_OK success
4041 * @retval PMINFO_R_EINVAL invalid argument
4042 * @retval PMINFO_R_ERROR internal error
4043 * @pre pkgmgrinfo_create_certinfo_set_handle()
4044 * @post pkgmgrinfo_destroy_certinfo_set_handle()
4045 * @see pkgmgrinfo_save_certinfo()
4047 static int set_cert_in_db(const char *pkgid)
4050 pkgmgrinfo_instcertinfo_h handle;
4051 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4052 if (ret != PMINFO_R_OK)
4054 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4055 if (ret != PMINFO_R_OK) {
4056 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4059 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4060 if (ret != PMINFO_R_OK) {
4061 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4064 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4069 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
4072 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
4073 * @brief This API destroys the package cert information handle freeing up all the resources.
4075 * @par This API is for package-manager client application
4076 * @par Sync (or) Async : Synchronous API
4078 * @param[in] handle pointer to the package cert handle.
4079 * @return 0 if success, error code(<0) if fail
4080 * @retval PMINFO_R_OK success
4081 * @retval PMINFO_R_EINVAL invalid argument
4082 * @retval PMINFO_R_ERROR internal error
4083 * @pre pkgmgrinfo_create_certinfo_set_handle()
4085 * @see pkgmgrinfo_save_certinfo()
4087 static int set_cert_in_db(const char *pkgid)
4090 pkgmgrinfo_instcertinfo_h handle;
4091 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
4092 if (ret != PMINFO_R_OK)
4094 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
4095 if (ret != PMINFO_R_OK) {
4096 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4099 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
4100 if (ret != PMINFO_R_OK) {
4101 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4104 pkgmgrinfo_destroy_certinfo_set_handle(handle);
4109 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
4112 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
4113 * @brief This API gets the datacontrol info
4115 * @par This API is for package-manager client application
4116 * @par Sync (or) Async : Synchronous API
4118 * @param[in] providerid pointer to the providerid of dataconltrol.
4119 * @param[in] type pointer to the type of dataconltrol.
4120 * @param[out] appid pointer to hold appid, need to free after using
4121 * @param[out] access pointer to hold access, need to free after using
4122 * @return 0 if success, error code(<0) if fail
4123 * @retval PMINFO_R_OK success
4124 * @retval PMINFO_R_EINVAL invalid argument
4125 * @retval PMINFO_R_ERROR internal error
4128 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
4134 #endif /* __PKG_INFO_H__ */