4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 * @brief A handle to insert certificate information
79 typedef void* pkgmgrinfo_instcertinfo_h;
82 * @brief Certificate Types to be used for setting information
85 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
86 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
87 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
88 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
89 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
90 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
91 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
92 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
93 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
94 }pkgmgrinfo_instcert_type;
97 PMINFO_CERT_COMPARE_MATCH,
98 PMINFO_CERT_COMPARE_MISMATCH,
99 PMINFO_CERT_COMPARE_LHS_NO_CERT,
100 PMINFO_CERT_COMPARE_RHS_NO_CERT,
101 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
102 PMINFO_CERT_COMPARE_ERROR,
103 } pkgmgrinfo_cert_compare_result_type_e;
106 * @brief API return values
109 PMINFO_R_EINVAL = -2, /**< Invalid argument */
110 PMINFO_R_ERROR = -1, /**< General error */
111 PMINFO_R_OK = 0 /**< General success */
115 * @brief Value to be used when filtering based on install location
117 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
120 * @brief Value to be used when filtering based on install location
122 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
125 * @brief Value to be used when filtering based on install location
127 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
130 * @brief Value to be used when filtering based on app-component
132 #define PMINFO_APPINFO_UI_APP "UI_APP"
135 * @brief Value to be used when filtering based on app-component
137 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
140 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
141 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
142 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
143 }pkgmgrinfo_app_hwacceleration;
146 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
147 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
148 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
149 }pkgmgrinfo_app_screenreader;
152 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
153 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
154 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
155 }pkgmgrinfo_app_recentimage;
158 * @brief A handle to get package information
160 typedef void* pkgmgrinfo_pkginfo_h;
163 * @brief A handle to get application information
165 typedef void* pkgmgrinfo_appinfo_h;
168 * @brief A handle to get certificate information
170 typedef void* pkgmgrinfo_certinfo_h;
173 * @brief A handle to insert package information
175 typedef void* pkgmgrinfo_pkgdbinfo_h;
178 * @brief A handle to filter package information
180 typedef void* pkgmgrinfo_pkginfo_filter_h;
183 * @brief A handle to filter application information
185 typedef void* pkgmgrinfo_appinfo_filter_h;
188 * @brief A handle to filter application metadata information
190 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
193 * @brief A handle to get appcontrol information
195 typedef void* pkgmgrinfo_appcontrol_h;
198 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
200 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
202 * @param[in] handle the pkginfo handle
203 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
205 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
207 * @see pkgmgrinfo_pkginfo_get_list()
208 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
214 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
216 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
218 * @param[in] handle the appinfo handle
219 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
221 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
223 * @see pkgmgrinfo_appinfo_get_list()
224 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
225 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
227 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
231 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
233 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
235 * @param[in] category_name the name of the category
236 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
238 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
240 * @see pkgmgrinfo_appinfo_foreach_category()
242 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
246 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
248 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
250 * @param[in] permission_name the name of the permission
251 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
253 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
255 * @see pkgmgrinfo_appinfo_foreach_category()
257 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
261 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
263 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
265 * @param[in] privilege_name the name of the privilege
266 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
268 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
270 * @see pkgmgrinfo_pkginfo_foreach_privilege()
272 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
276 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
278 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
280 * @param[in] metadata_name the name of the metadata
281 * @param[in] metadata_value the value of the metadata
282 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
284 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
286 * @see pkgmgrinfo_appinfo_foreach_metadata()
288 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
289 const char *metadata_value, void *user_data);
292 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
294 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
296 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
297 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
299 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
301 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
303 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
307 * @brief Install Location Types
310 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
311 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
312 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
313 }pkgmgrinfo_install_location;
316 * @brief Application Component Types
319 PMINFO_ALL_APP = 0, /**< All Application*/
320 PMINFO_UI_APP, /**< UI Application*/
321 PMINFO_SVC_APP, /**< Service Application*/
322 }pkgmgrinfo_app_component;
325 * @brief Application Storage Types
328 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
329 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
330 }pkgmgrinfo_installed_storage;
333 * @brief Certificate Types to be used for getting information
336 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
337 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
338 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
339 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
340 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
341 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
342 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
343 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
344 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
345 }pkgmgrinfo_cert_type;
348 * @brief Install Location Types to be used when setting data in DB
351 INSTALL_INTERNAL = 0, /**< Internal Installation*/
352 INSTALL_EXTERNAL, /**< External Installation*/
356 * @brief permission Types
359 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
360 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
361 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
362 }pkgmgrinfo_permission_type;
365 /** String property for filtering based on package info*/
366 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
367 /** String property for filtering based on package info*/
368 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
369 /** String property for filtering based on package info*/
370 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
382 /** Boolean property for filtering based on package info*/
383 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
384 /** Boolean property for filtering based on package info*/
385 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
386 /** Boolean property for filtering based on package info*/
387 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
388 /** Boolean property for filtering based on package info*/
389 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
395 /** Integer property for filtering based on package info*/
396 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
398 /** String property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
400 /** String property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
402 /** String property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
421 /** Boolean property for filtering based on app info*/
422 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
423 /** Boolean property for filtering based on app info*/
424 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
425 /** Boolean property for filtering based on app info*/
426 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
427 /** Boolean property for filtering based on app info*/
428 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
434 /** will be updated*/
435 /** string property for filtering based on pkg info*/
436 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
438 /* For multiuser support */
439 char *getUserDBLabel(void);
440 char *getUserPkgParserDBPath(void);
441 char *getUserPkgParserDBPathUID(uid_t uid);
442 char *getUserPkgParserJournalDBPath(uid_t uid);
443 char *getUserPkgCertDBPath(void);
444 char *getUserPkgCertDBPathUID(uid_t uid);
445 char *getUserPkgCertJournalDBPath(uid_t uid);
446 const char* getUserDesktopPath(uid_t uid);
447 const char* getUserManifestPath(uid_t uid);
450 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
451 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
452 * @brief This API gets list of installed packages
454 * @par This API is for package-manager client application
455 * @par Sync (or) Async : Synchronous API
456 * @param[in] pkg_list_cb iteration function for list
457 * @param[in] user_data user data to be passed to callback function
458 * @param[in] uid the addressee user id of the instruction
459 * @return 0 if success, error code(<0) if fail
460 * @retval PMINFO_R_OK success
461 * @retval PMINFO_R_EINVAL invalid argument
462 * @retval PMINFO_R_ERROR internal error
466 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
470 pkgid1 = (char *)user_data;
471 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
472 if (strcmp(pkgid1, pkgid2) == 0) {
479 static int list_pkgs()
482 char *name = "helloworld";
483 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
484 if (ret != PMINFO_R_OK) {
491 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
492 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
494 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
495 * @brief This API creates the package information handle from db
497 * @par This API is for package-manager client application
498 * @par Sync (or) Async : Synchronous API
500 * @param[in] pkgid pointer to package ID
501 * @param[in] uid the addressee user id of the instruction
502 * @param[out] handle pointer to the package info handle.
503 * @return 0 if success, error code(<0) if fail
504 * @retval PMINFO_R_OK success
505 * @retval PMINFO_R_EINVAL invalid argument
506 * @retval PMINFO_R_ERROR internal error
508 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
509 * @see pkgmgrinfo_pkginfo_get_pkgid()
510 * @see pkgmgrinfo_pkginfo_is_removable()
512 static int get_pkg_type(const char *pkgid)
516 pkgmgrinfo_pkginfo_h handle;
517 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
518 if (ret != PMINFO_R_OK)
520 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
521 if (ret != PMINFO_R_OK) {
522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
525 printf("pkgtype: %s\n", type);
526 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
531 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
532 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
535 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
536 * @brief This API gets the package name from the package ID
538 * @par This API is for package-manager client application
539 * @par Sync (or) Async : Synchronous API
541 * @param[in] handle pointer to package info handle
542 * @param[out] pkg_name pointer to hold package name
543 * @return 0 if success, error code(<0) if fail
544 * @retval PMINFO_R_OK success
545 * @retval PMINFO_R_EINVAL invalid argument
546 * @retval PMINFO_R_ERROR internal error
547 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
548 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
549 * @see pkgmgrinfo_pkginfo_get_type()
550 * @see pkgmgrinfo_pkginfo_is_removable()
552 static int get_pkg_name(const char *pkgid)
555 char *pkgname = NULL;
556 pkgmgrinfo_pkginfo_h handle;
557 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
558 if (ret != PMINFO_R_OK)
560 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
561 if (ret != PMINFO_R_OK) {
562 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
565 printf("pkgname: %s\n", pkgname);
566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
571 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
574 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
575 * @brief This API gets the package id from the package ID
577 * @par This API is for package-manager client application
578 * @par Sync (or) Async : Synchronous API
580 * @param[in] handle pointer to package info handle
581 * @param[out] pkgid pointer to hold package id
582 * @return 0 if success, error code(<0) if fail
583 * @retval PMINFO_R_OK success
584 * @retval PMINFO_R_EINVAL invalid argument
585 * @retval PMINFO_R_ERROR internal error
586 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
587 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
588 * @see pkgmgrinfo_pkginfo_get_type()
589 * @see pkgmgrinfo_pkginfo_is_removable()
591 static int get_pkgid(const char *pkgid)
595 pkgmgrinfo_pkginfo_h handle;
596 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
597 if (ret != PMINFO_R_OK)
599 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
600 if (ret != PMINFO_R_OK) {
601 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
604 printf("pkg id: %s\n", pkg_id);
605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
610 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
613 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
614 * @brief This API gets the package type from the package ID
616 * @par This API is for package-manager client application
617 * @par Sync (or) Async : Synchronous API
619 * @param[in] handle pointer to package info handle
620 * @param[out] type pointer to hold package type
621 * @return 0 if success, error code(<0) if fail
622 * @retval PMINFO_R_OK success
623 * @retval PMINFO_R_EINVAL invalid argument
624 * @retval PMINFO_R_ERROR internal error
625 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
626 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
627 * @see pkgmgrinfo_pkginfo_get_pkgid()
628 * @see pkgmgrinfo_pkginfo_is_removable()
630 static int get_pkg_type(const char *pkgid)
634 pkgmgrinfo_pkginfo_h handle;
635 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
636 if (ret != PMINFO_R_OK)
638 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
639 if (ret != PMINFO_R_OK) {
640 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
643 printf("pkgtype: %s\n", type);
644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
649 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
652 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
653 * @brief This API gets the package version from the package ID
655 * @par This API is for package-manager client application
656 * @par Sync (or) Async : Synchronous API
658 * @param[in] handle pointer to package info handle
659 * @param[out] version pointer to hold package version
660 * @return 0 if success, error code(<0) if fail
661 * @retval PMINFO_R_OK success
662 * @retval PMINFO_R_EINVAL invalid argument
663 * @retval PMINFO_R_ERROR internal error
664 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
665 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
666 * @see pkgmgrinfo_pkginfo_get_pkgid()
667 * @see pkgmgrinfo_pkginfo_is_removable()
669 static int get_pkg_version(const char *pkgid)
672 char *version = NULL;
673 pkgmgrinfo_pkginfo_h handle;
674 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
675 if (ret != PMINFO_R_OK)
677 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
678 if (ret != PMINFO_R_OK) {
679 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
682 printf("pkg version: %s\n", version);
683 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
688 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
691 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
692 * @brief This API gets the package install location from the package ID
694 * @par This API is for package-manager client application
695 * @par Sync (or) Async : Synchronous API
697 * @param[in] handle pointer to package info handle
698 * @param[out] location pointer to hold package install location
699 * @return 0 if success, error code(<0) if fail
700 * @retval PMINFO_R_OK success
701 * @retval PMINFO_R_EINVAL invalid argument
702 * @retval PMINFO_R_ERROR internal error
703 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
704 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
705 * @see pkgmgrinfo_pkginfo_get_pkgid()
706 * @see pkgmgrinfo_pkginfo_is_removable()
708 static int get_pkg_install_location(const char *pkgid)
711 pkgmgrinfo_install_location location;
712 pkgmgrinfo_pkginfo_h handle;
713 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
714 if (ret != PMINFO_R_OK)
716 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
717 if (ret != PMINFO_R_OK) {
718 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
721 printf("pkg install location: %d\n", location);
722 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
727 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
730 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
731 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
732 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
733 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
735 * @par This API is for package-manager client application
736 * @par Sync (or) Async : Synchronous API
738 * @param[in] handle pointer to package info handle
739 * @param[out] size pointer to hold package size
740 * @return 0 if success, error code(<0) if fail
741 * @retval PMINFO_R_OK success
742 * @retval PMINFO_R_EINVAL invalid argument
743 * @retval PMINFO_R_ERROR internal error
744 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
745 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
746 * @see pkgmgrinfo_pkginfo_get_pkgid()
747 * @see pkgmgrinfo_pkginfo_is_removable()
749 static int get_pkg_size(const char *pkgid)
753 pkgmgrinfo_pkginfo_h handle;
754 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
755 if (ret != PMINFO_R_OK)
757 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
758 if (ret != PMINFO_R_OK) {
759 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
762 printf("pkgsize: %d\n", size);
763 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
768 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
771 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
772 * @brief This API gets the installed package total size on the target.
774 * @par This API is for package-manager client application
775 * @par Sync (or) Async : Synchronous API
777 * @param[in] handle pointer to package info handle
778 * @param[out] size pointer to hold package total size
779 * @return 0 if success, error code(<0) if fail
780 * @retval PMINFO_R_OK success
781 * @retval PMINFO_R_EINVAL invalid argument
782 * @retval PMINFO_R_ERROR internal error
784 static int get_pkg_total_size(const char *pkgid)
788 pkgmgrinfo_pkginfo_h handle;
789 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
790 if (ret != PMINFO_R_OK)
792 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
793 if (ret != PMINFO_R_OK) {
794 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
797 printf("pkg total size: %d\n", size);
798 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
803 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
806 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
807 * @brief This API gets the installed package data size on the target.
809 * @par This API is for package-manager client application
810 * @par Sync (or) Async : Synchronous API
812 * @param[in] handle pointer to package info handle
813 * @param[out] size pointer to hold package data size
814 * @return 0 if success, error code(<0) if fail
815 * @retval PMINFO_R_OK success
816 * @retval PMINFO_R_EINVAL invalid argument
817 * @retval PMINFO_R_ERROR internal error
819 static int get_pkg_data_size(const char *pkgid)
823 pkgmgrinfo_pkginfo_h handle;
824 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
825 if (ret != PMINFO_R_OK)
827 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
828 if (ret != PMINFO_R_OK) {
829 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
832 printf("pkg data size: %d\n", size);
833 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
838 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
841 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
842 * @brief This API gets the package icon from the package ID
844 * @par This API is for package-manager client application
845 * @par Sync (or) Async : Synchronous API
847 * @param[in] handle pointer to package info handle
848 * @param[out] icon pointer to hold package icon
849 * @return 0 if success, error code(<0) if fail
850 * @retval PMINFO_R_OK success
851 * @retval PMINFO_R_EINVAL invalid argument
852 * @retval PMINFO_R_ERROR internal error
853 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
854 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
855 * @see pkgmgrinfo_pkginfo_get_pkgid()
856 * @see pkgmgrinfo_pkginfo_is_removable()
858 static int get_pkg_icon(const char *pkgid)
862 pkgmgrinfo_pkginfo_h handle;
863 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
864 if (ret != PMINFO_R_OK)
866 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
867 if (ret != PMINFO_R_OK) {
868 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
871 printf("pkg icon: %s\n", icon);
872 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
877 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
880 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
881 * @brief This API gets the package label from the package ID
883 * @par This API is for package-manager client application
884 * @par Sync (or) Async : Synchronous API
886 * @param[in] handle pointer to package info handle
887 * @param[out] label pointer to hold package label
888 * @return 0 if success, error code(<0) if fail
889 * @retval PMINFO_R_OK success
890 * @retval PMINFO_R_EINVAL invalid argument
891 * @retval PMINFO_R_ERROR internal error
892 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
893 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
894 * @see pkgmgrinfo_pkginfo_get_pkgid()
895 * @see pkgmgrinfo_pkginfo_is_removable()
897 static int get_pkg_label(const char *pkgid)
901 pkgmgrinfo_pkginfo_h handle;
902 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
903 if (ret != PMINFO_R_OK)
905 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
906 if (ret != PMINFO_R_OK) {
907 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
910 printf("pkg label: %s\n", label);
911 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
916 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
919 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
920 * @brief This API gets the package description from the package ID
922 * @par This API is for package-manager client application
923 * @par Sync (or) Async : Synchronous API
925 * @param[in] handle pointer to package info handle
926 * @param[out] description pointer to hold package description
927 * @return 0 if success, error code(<0) if fail
928 * @retval PMINFO_R_OK success
929 * @retval PMINFO_R_EINVAL invalid argument
930 * @retval PMINFO_R_ERROR internal error
931 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
932 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
933 * @see pkgmgrinfo_pkginfo_get_pkgid()
934 * @see pkgmgrinfo_pkginfo_is_removable()
936 static int get_pkg_description(const char *pkgid)
939 char *description = NULL;
940 pkgmgrinfo_pkginfo_h handle;
941 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
942 if (ret != PMINFO_R_OK)
944 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
945 if (ret != PMINFO_R_OK) {
946 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
949 printf("pkg description: %s\n", description);
950 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
955 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
958 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
959 * @brief This API gets the package's author name from the package ID
961 * @par This API is for package-manager client application
962 * @par Sync (or) Async : Synchronous API
964 * @param[in] handle pointer to package info handle
965 * @param[out] author_name pointer to hold package author name
966 * @return 0 if success, error code(<0) if fail
967 * @retval PMINFO_R_OK success
968 * @retval PMINFO_R_EINVAL invalid argument
969 * @retval PMINFO_R_ERROR internal error
970 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
971 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
972 * @see pkgmgrinfo_pkginfo_get_pkgid()
973 * @see pkgmgrinfo_pkginfo_is_removable()
975 static int get_pkg_author_name(const char *pkgid)
978 char *author_name = NULL;
979 pkgmgrinfo_pkginfo_h handle;
980 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
981 if (ret != PMINFO_R_OK)
983 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
984 if (ret != PMINFO_R_OK) {
985 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
988 printf("pkg author name: %s\n", author_name);
989 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
994 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
997 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
998 * @brief This API gets the package's author email from the package ID
1000 * @par This API is for package-manager client application
1001 * @par Sync (or) Async : Synchronous API
1003 * @param[in] handle pointer to package info handle
1004 * @param[out] author_email pointer to hold package author email
1005 * @return 0 if success, error code(<0) if fail
1006 * @retval PMINFO_R_OK success
1007 * @retval PMINFO_R_EINVAL invalid argument
1008 * @retval PMINFO_R_ERROR internal error
1009 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1010 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1011 * @see pkgmgrinfo_pkginfo_get_pkgid()
1012 * @see pkgmgrinfo_pkginfo_is_removable()
1014 static int get_pkg_author_email(const char *pkgid)
1017 char *author_email = NULL;
1018 pkgmgrinfo_pkginfo_h handle;
1019 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1020 if (ret != PMINFO_R_OK)
1022 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1023 if (ret != PMINFO_R_OK) {
1024 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1027 printf("pkg author email: %s\n", author_email);
1028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1033 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1036 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1037 * @brief This API gets the package's author href from the package ID
1039 * @par This API is for package-manager client application
1040 * @par Sync (or) Async : Synchronous API
1042 * @param[in] handle pointer to package info handle
1043 * @param[out] author_href pointer to hold package author href
1044 * @return 0 if success, error code(<0) if fail
1045 * @retval PMINFO_R_OK success
1046 * @retval PMINFO_R_EINVAL invalid argument
1047 * @retval PMINFO_R_ERROR internal error
1048 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1049 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1050 * @see pkgmgrinfo_pkginfo_get_pkgid()
1051 * @see pkgmgrinfo_pkginfo_is_removable()
1053 static int get_pkg_author_href(const char *pkgid)
1056 char *author_href = NULL;
1057 pkgmgrinfo_pkginfo_h handle;
1058 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1059 if (ret != PMINFO_R_OK)
1061 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1062 if (ret != PMINFO_R_OK) {
1063 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1066 printf("pkg author href: %s\n", author_href);
1067 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1072 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1075 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1076 * @brief This API gets the package installed storagae value from the package ID
1078 * @par This API is for package-manager client application
1079 * @par Sync (or) Async : Synchronous API
1081 * @param[in] handle pointer to package info handle
1082 * @param[out] storage pointer to hold package installed storage
1083 * @return 0 if success, error code(<0) if fail
1084 * @retval PMINFO_R_OK success
1085 * @retval PMINFO_R_EINVAL invalid argument
1086 * @retval PMINFO_R_ERROR internal error
1087 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1088 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1089 * @see pkgmgrinfo_pkginfo_get_pkgid()
1090 * @see pkgmgrinfo_pkginfo_is_removable()
1092 static int get_pkg_installed_storage(const char *pkgid)
1095 pkgmgrinfo_installed_storage storage;
1096 pkgmgrinfo_pkginfo_h handle;
1097 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1098 if (ret != PMINFO_R_OK)
1100 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1101 if (ret != PMINFO_R_OK) {
1102 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1105 printf("pkg installed storage: %d\n", storage);
1106 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1111 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1114 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1115 * @brief This API gets the installed time of package from the package ID
1117 * @par This API is for package-manager client application
1118 * @par Sync (or) Async : Synchronous API
1120 * @param[in] handle pointer to package info handle
1121 * @param[out] installed_time pointer to hold installed time of package
1122 * @return 0 if success, error code(<0) if fail
1123 * @retval PMINFO_R_OK success
1124 * @retval PMINFO_R_EINVAL invalid argument
1125 * @retval PMINFO_R_ERROR internal error
1126 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1127 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1128 * @see pkgmgrinfo_pkginfo_get_pkgid()
1129 * @see pkgmgrinfo_pkginfo_is_removable()
1131 static int get_pkg_installed_time(const char *pkgid)
1134 int installed_time = 0;
1135 pkgmgrinfo_pkginfo_h handle;
1136 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1137 if (ret != PMINFO_R_OK)
1139 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1140 if (ret != PMINFO_R_OK) {
1141 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1144 printf("installed_time: %d\n", installed_time);
1145 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1150 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1153 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1154 * @brief This API gets the store client id of package from the package ID
1156 * @par This API is for package-manager client application
1157 * @par Sync (or) Async : Synchronous API
1159 * @param[in] handle pointer to package info handle
1160 * @param[out] storeclientid pointer to hold store client id of package
1161 * @return 0 if success, error code(<0) if fail
1162 * @retval PMINFO_R_OK success
1163 * @retval PMINFO_R_EINVAL invalid argument
1164 * @retval PMINFO_R_ERROR internal error
1165 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1166 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1167 * @see pkgmgrinfo_pkginfo_get_pkgid()
1168 * @see pkgmgrinfo_pkginfo_is_removable()
1170 static int get_pkg_storeclientid(const char *pkgid)
1173 char *storeclientid = 0;
1174 pkgmgrinfo_pkginfo_h handle;
1175 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1176 if (ret != PMINFO_R_OK)
1178 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1179 if (ret != PMINFO_R_OK) {
1180 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1183 printf(store client id: %s\n", storeclientid);
1184 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1189 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1192 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1193 * @brief This API gets the main app id of package from the package ID
1195 * @par This API is for package-manager client application
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package info handle
1199 * @param[out] mainappid pointer to hold main app id of package
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1204 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1205 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1206 * @see pkgmgrinfo_pkginfo_get_pkgid()
1207 * @see pkgmgrinfo_pkginfo_is_removable()
1209 static int get_pkg_mainappid(const char *pkgid)
1212 char *mainappid = 0;
1213 pkgmgrinfo_pkginfo_h handle;
1214 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1215 if (ret != PMINFO_R_OK)
1217 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1218 if (ret != PMINFO_R_OK) {
1219 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1222 printf(main app id: %s\n", mainappid);
1223 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1228 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1231 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1232 * @brief This API gets the url of package from the package ID
1234 * @par This API is for package-manager client application
1235 * @par Sync (or) Async : Synchronous API
1237 * @param[in] handle pointer to package info handle
1238 * @param[out] url pointer to hold url of package
1239 * @return 0 if success, error code(<0) if fail
1240 * @retval PMINFO_R_OK success
1241 * @retval PMINFO_R_EINVAL invalid argument
1242 * @retval PMINFO_R_ERROR internal error
1243 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1244 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1245 * @see pkgmgrinfo_pkginfo_get_pkgid()
1246 * @see pkgmgrinfo_pkginfo_is_removable()
1248 static int get_pkg_url(const char *pkgid)
1252 pkgmgrinfo_pkginfo_h handle;
1253 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1254 if (ret != PMINFO_R_OK)
1256 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1257 if (ret != PMINFO_R_OK) {
1258 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1261 printf("url : %s\n", url);
1262 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1267 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1271 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1272 * @brief This API gets the root path of package
1274 * @par Sync (or) Async : Synchronous API
1276 * @param[in] handle pointer to package info handle
1277 * @param[out] path pointer to hold root path of package
1278 * @return 0 if success, error code(<0) if fail
1279 * @retval PMINFO_R_OK success
1280 * @retval PMINFO_R_EINVAL invalid argument
1281 * @retval PMINFO_R_ERROR internal error
1283 static int get_root_path(const char *pkgid)
1287 pkgmgrinfo_pkginfo_h handle;
1288 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1289 if (ret != PMINFO_R_OK)
1292 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1293 if (ret != PMINFO_R_OK) {
1294 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1297 printf("path : %s\n", path);
1298 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1304 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1308 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1309 * @brief This API gets the csc path of package
1311 * @par Sync (or) Async : Synchronous API
1313 * @param[in] handle pointer to package info handle
1314 * @param[out] path pointer to hold csc path of package
1315 * @return 0 if success, error code(<0) if fail
1316 * @retval PMINFO_R_OK success
1317 * @retval PMINFO_R_EINVAL invalid argument
1318 * @retval PMINFO_R_ERROR internal error
1320 static int get_csc_path(const char *pkgid)
1324 pkgmgrinfo_pkginfo_h handle;
1325 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1326 if (ret != PMINFO_R_OK)
1329 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1330 if (ret != PMINFO_R_OK) {
1331 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1334 printf("path : %s\n", path);
1335 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1341 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1344 * @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)
1345 * @brief This API compare the cert information from given package id
1347 * @par This API is for package-manager client application
1348 * @par Sync (or) Async : Synchronous API
1350 * @param[in] lhs_package_id pointer to first package ID
1351 * @param[in] rhs_package_id pointer to second package ID
1352 * @param[out] compare_result pointer to the compare result.
1353 * @return 0 if success, error code(<0) if fail
1354 * @retval PMINFO_R_OK success
1355 * @retval PMINFO_R_EINVAL invalid argument
1356 * @retval PMINFO_R_ERROR internal error
1358 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1359 * @see pkgmgrinfo_pkginfo_get_pkgid()
1360 * @see pkgmgrinfo_pkginfo_is_removable()
1362 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1365 pkgmgrinfo_cert_compare_result_type_e result;
1367 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1368 if (ret != PMINFO_R_OK) {
1371 printf("result: %d\n", result);
1376 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);
1377 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1379 * @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)
1380 * @brief This API compare the cert information from given app id
1382 * @par This API is for package-manager client application
1383 * @par Sync (or) Async : Synchronous API
1385 * @param[in] lhs_app_id pointer to first app ID
1386 * @param[in] rhs_app_id pointer to second app ID
1387 * @param[out] compare_result pointer to the compare result.
1388 * @return 0 if success, error code(<0) if fail
1389 * @retval PMINFO_R_OK success
1390 * @retval PMINFO_R_EINVAL invalid argument
1391 * @retval PMINFO_R_ERROR internal error
1393 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1394 * @see pkgmgrinfo_pkginfo_get_pkgid()
1395 * @see pkgmgrinfo_pkginfo_is_removable()
1397 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1400 pkgmgrinfo_cert_compare_result_type_e result;
1402 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1403 if (ret != PMINFO_R_OK) {
1406 printf("result: %d\n", result);
1411 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);
1412 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1414 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1415 * @brief This API gets the package 'removable' value from the package ID
1417 * @par This API is for package-manager client application
1418 * @par Sync (or) Async : Synchronous API
1420 * @param[in] handle pointer to package info handle
1421 * @param[out] removable pointer to hold package removable value
1422 * @return 0 if success, error code(<0) if fail
1423 * @retval PMINFO_R_OK success
1424 * @retval PMINFO_R_EINVAL invalid argument
1425 * @retval PMINFO_R_ERROR internal error
1426 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1427 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1428 * @see pkgmgrinfo_pkginfo_get_pkgid()
1429 * @see pkgmgrinfo_pkginfo_is_readonly()
1431 static int get_pkg_removable(const char *pkgid)
1435 pkgmgrinfo_pkginfo_h handle;
1436 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1437 if (ret != PMINFO_R_OK)
1439 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1440 if (ret != PMINFO_R_OK) {
1441 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1444 printf("pkg removable: %d\n", removable);
1445 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1450 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1453 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1454 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1456 * @par This API is for package-manager client application
1457 * @par Sync (or) Async : Synchronous API
1459 * @param[in] handle pointer to package info handle
1460 * @param[out] movable pointer to hold package movable state
1461 * @return 0 if success, error code(<0) if fail
1462 * @retval PMINFO_R_OK success
1463 * @retval PMINFO_R_EINVAL invalid argument
1464 * @retval PMINFO_R_ERROR internal error
1465 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1466 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1467 * @see pkgmgrinfo_pkginfo_get_pkgid()
1469 static int get_pkg_movable(const char *pkgid)
1473 pkgmgrinfo_pkginfo_h handle;
1474 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1475 if (ret != PMINFO_R_OK)
1477 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1478 if (ret != PMINFO_R_OK) {
1479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1482 printf("pkg movable: %d\n", movable);
1483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1488 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1491 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1492 * @brief This API gets the package 'preload' value from the package ID
1494 * @par This API is for package-manager client application
1495 * @par Sync (or) Async : Synchronous API
1497 * @param[in] handle pointer to package info handle
1498 * @param[out] preload pointer to hold package preload value
1499 * @return 0 if success, error code(<0) if fail
1500 * @retval PMINFO_R_OK success
1501 * @retval PMINFO_R_EINVAL invalid argument
1502 * @retval PMINFO_R_ERROR internal error
1503 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1504 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1505 * @see pkgmgrinfo_pkginfo_get_pkgid()
1506 * @see pkgmgrinfo_pkginfo_is_readonly()
1508 static int get_pkg_preload(const char *pkgid)
1512 pkgmgrinfo_pkginfo_h handle;
1513 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1514 if (ret != PMINFO_R_OK)
1516 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1517 if (ret != PMINFO_R_OK) {
1518 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1521 printf("pkg preload: %d\n", preload);
1522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1527 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1530 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1531 * @brief This API gets the value for given handle is system or not
1533 * @par This API is for package-manager client application
1534 * @par Sync (or) Async : Synchronous API
1536 * @param[in] handle pointer to package info handle
1537 * @param[out] system pointer to hold system is or not
1538 * @return 0 if success, error code(<0) if fail
1539 * @retval PMINFO_R_OK success
1540 * @retval PMINFO_R_EINVAL invalid argument
1541 * @retval PMINFO_R_ERROR internal error
1542 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1543 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1544 * @see pkgmgrinfo_pkginfo_get_pkgid()
1545 * @see pkgmgrinfo_pkginfo_is_readonly()
1547 static int get_pkg_system(const char *pkgid)
1550 bool system = false;
1551 pkgmgrinfo_pkginfo_h handle = NULL;
1552 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1553 if (ret != PMINFO_R_OK)
1555 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1556 if (ret != PMINFO_R_OK) {
1557 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1560 printf("pkg system: %d\n", system);
1561 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1566 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1569 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1570 * @brief This API gets the package 'readonly' value from the package ID
1572 * @par This API is for package-manager client application
1573 * @par Sync (or) Async : Synchronous API
1575 * @param[in] handle pointer to package info handle
1576 * @param[out] readonly pointer to hold package readonly value
1577 * @return 0 if success, error code(<0) if fail
1578 * @retval PMINFO_R_OK success
1579 * @retval PMINFO_R_EINVAL invalid argument
1580 * @retval PMINFO_R_ERROR internal error
1581 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1582 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1583 * @see pkgmgrinfo_pkginfo_get_pkgid()
1584 * @see pkgmgrinfo_pkginfo_is_removable()
1586 static int get_pkg_readonly(const char *pkgid)
1590 pkgmgrinfo_pkginfo_h handle;
1591 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1592 if (ret != PMINFO_R_OK)
1594 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1595 if (ret != PMINFO_R_OK) {
1596 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1599 printf("pkg readonly: %d\n", readonly);
1600 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1605 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1609 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1610 * @brief This API gets the package 'upate' value from the package ID
1612 * @par This API is for package-manager client application
1613 * @par Sync (or) Async : Synchronous API
1615 * @param[in] handle pointer to package info handle
1616 * @param[out] update pointer to hold package update value
1617 * @return 0 if success, error code(<0) if fail
1618 * @retval PMINFO_R_OK success
1619 * @retval PMINFO_R_EINVAL invalid argument
1620 * @retval PMINFO_R_ERROR internal error
1621 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1622 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1623 * @see pkgmgrinfo_pkginfo_get_pkgid()
1625 static int get_pkg_update(const char *pkgid)
1629 pkgmgrinfo_pkginfo_h handle;
1630 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1631 if (ret != PMINFO_R_OK)
1633 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1634 if (ret != PMINFO_R_OK) {
1635 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1638 printf("pkg update: %d\n", update);
1639 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1644 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1647 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1648 * @brief This API gets the package 'accessible' value from the package ID
1650 * @par This API is for package-manager client application
1651 * @par Sync (or) Async : Synchronous API
1653 * @param[in] handle pointer to package info handle
1654 * @param[out] accessible pointer to hold package accessible value
1655 * @return 0 if success, error code(<0) if fail
1656 * @retval PMINFO_R_OK success
1657 * @retval PMINFO_R_EINVAL invalid argument
1658 * @retval PMINFO_R_ERROR internal error
1659 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1660 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1661 * @see pkgmgrinfo_pkginfo_get_pkgid()
1662 * @see pkgmgrinfo_pkginfo_is_readonly()
1664 static int get_pkg_accessible(const char *pkgid)
1668 pkgmgrinfo_pkginfo_h handle;
1669 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1670 if (ret != PMINFO_R_OK)
1672 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1673 if (ret != PMINFO_R_OK) {
1674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1677 printf("pkg accessible: %d\n", accessible);
1678 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1683 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1686 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1687 * @brief This API destroys the package information handle freeing up all the resources
1689 * @par This API is for package-manager client application
1690 * @par Sync (or) Async : Synchronous API
1692 * @param[in] handle pointer to the package info handle
1693 * @return 0 if success, error code(<0) if fail
1694 * @retval PMINFO_R_OK success
1695 * @retval PMINFO_R_EINVAL invalid argument
1696 * @retval PMINFO_R_ERROR internal error
1697 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1699 * @see pkgmgrinfo_pkginfo_get_pkgid()
1700 * @see pkgmgrinfo_pkginfo_is_removable()
1702 static int get_pkg_type(const char *pkgid)
1706 pkgmgrinfo_pkginfo_h handle;
1707 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1708 if (ret != PMINFO_R_OK)
1710 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1711 if (ret != PMINFO_R_OK) {
1712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1715 printf("pkgtype: %s\n", type);
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1721 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1724 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1725 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1726 The query will search the entire package information collected from the manifest file of all the installed packages
1728 * @par This API is for package-manager client application
1729 * @par Sync (or) Async : Synchronous API
1731 * @param[out] handle pointer to the package info filter handle.
1732 * @return 0 if success, error code(<0) if fail
1733 * @retval PMINFO_R_OK success
1734 * @retval PMINFO_R_EINVAL invalid argument
1735 * @retval PMINFO_R_ERROR internal error
1737 * @post pkgmgrinfo_pkginfo_filter_destroy()
1738 * @see pkgmgrinfo_pkginfo_filter_count()
1739 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1741 static int get_rpm_pkg_count()
1745 pkgmgrinfo_pkginfo_filter_h handle;
1746 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1747 if (ret != PMINFO_R_OK)
1749 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1750 if (ret != PMINFO_R_OK) {
1751 pkgmgrinfo_pkginfo_filter_destroy(handle);
1754 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1755 if (ret != PMINFO_R_OK) {
1756 pkgmgrinfo_pkginfo_filter_destroy(handle);
1759 printf("No of rpm pkgs: %d\n", count);
1760 pkgmgrinfo_pkginfo_filter_destroy(handle);
1765 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1768 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1769 * @brief This API destroys the package information filter handle freeing up all the resources
1771 * @par This API is for package-manager client application
1772 * @par Sync (or) Async : Synchronous API
1774 * @param[in] handle pointer to the package info filter handle.
1775 * @return 0 if success, error code(<0) if fail
1776 * @retval PMINFO_R_OK success
1777 * @retval PMINFO_R_EINVAL invalid argument
1778 * @retval PMINFO_R_ERROR internal error
1779 * @pre pkgmgrinfo_pkginfo_filter_create()
1781 * @see pkgmgrinfo_pkginfo_filter_count()
1782 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1784 static int get_rpm_pkg_count()
1788 pkgmgrinfo_pkginfo_filter_h handle;
1789 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1790 if (ret != PMINFO_R_OK)
1792 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1793 if (ret != PMINFO_R_OK) {
1794 pkgmgrinfo_pkginfo_filter_destroy(handle);
1797 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 printf("No of rpm pkgs: %d\n", count);
1803 pkgmgrinfo_pkginfo_filter_destroy(handle);
1808 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1811 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1812 * @brief This API adds a boolean filter property to the filter handle
1814 * @par This API is for package-manager client application
1815 * @par Sync (or) Async : Synchronous API
1817 * @param[in] handle pointer to the package info filter handle.
1818 * @param[in] property boolean property name.
1819 * @param[in] value value corresponding to the property.
1820 * @return 0 if success, error code(<0) if fail
1821 * @retval PMINFO_R_OK success
1822 * @retval PMINFO_R_EINVAL invalid argument
1823 * @retval PMINFO_R_ERROR internal error
1824 * @pre pkgmgrinfo_pkginfo_filter_create()
1825 * @post pkgmgrinfo_pkginfo_filter_destroy()
1826 * @see pkgmgrinfo_pkginfo_filter_count()
1827 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1829 static int get_preload_pkg_count()
1833 pkgmgrinfo_pkginfo_filter_h handle;
1834 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1835 if (ret != PMINFO_R_OK)
1837 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1838 if (ret != PMINFO_R_OK) {
1839 pkgmgrinfo_pkginfo_filter_destroy(handle);
1842 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1843 if (ret != PMINFO_R_OK) {
1844 pkgmgrinfo_pkginfo_filter_destroy(handle);
1847 printf("No of preload pkgs: %d\n", count);
1848 pkgmgrinfo_pkginfo_filter_destroy(handle);
1853 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1854 const char *property, const bool value);
1857 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1858 * @brief This API adds an integer filter property to the filter handle
1860 * @par This API is for package-manager client application
1861 * @par Sync (or) Async : Synchronous API
1863 * @param[in] handle pointer to the package info filter handle.
1864 * @param[in] property integer property name.
1865 * @param[in] value value corresponding to the property.
1866 * @return 0 if success, error code(<0) if fail
1867 * @retval PMINFO_R_OK success
1868 * @retval PMINFO_R_EINVAL invalid argument
1869 * @retval PMINFO_R_ERROR internal error
1870 * @pre pkgmgrinfo_pkginfo_filter_create()
1871 * @post pkgmgrinfo_pkginfo_filter_destroy()
1872 * @see pkgmgrinfo_pkginfo_filter_count()
1873 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1875 static int get_pkg_count()
1879 pkgmgrinfo_pkginfo_filter_h handle;
1880 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1881 if (ret != PMINFO_R_OK)
1883 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1884 if (ret != PMINFO_R_OK) {
1885 pkgmgrinfo_pkginfo_filter_destroy(handle);
1888 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1889 if (ret != PMINFO_R_OK) {
1890 pkgmgrinfo_pkginfo_filter_destroy(handle);
1893 printf("No of preload pkgs: %d\n", count);
1894 pkgmgrinfo_pkginfo_filter_destroy(handle);
1899 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1900 const char *property, const int value);
1903 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1904 * @brief This API adds a string filter property to the filter handle
1906 * @par This API is for package-manager client application
1907 * @par Sync (or) Async : Synchronous API
1909 * @param[in] handle pointer to the package info filter handle.
1910 * @param[in] property string property name.
1911 * @param[in] value value corresponding to the property.
1912 * @return 0 if success, error code(<0) if fail
1913 * @retval PMINFO_R_OK success
1914 * @retval PMINFO_R_EINVAL invalid argument
1915 * @retval PMINFO_R_ERROR internal error
1916 * @pre pkgmgrinfo_pkginfo_filter_create()
1917 * @post pkgmgrinfo_pkginfo_filter_destroy()
1918 * @see pkgmgrinfo_pkginfo_filter_count()
1919 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1921 static int get_rpm_pkg_count()
1925 pkgmgrinfo_pkginfo_filter_h handle;
1926 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1927 if (ret != PMINFO_R_OK)
1929 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1930 if (ret != PMINFO_R_OK) {
1931 pkgmgrinfo_pkginfo_filter_destroy(handle);
1934 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1935 if (ret != PMINFO_R_OK) {
1936 pkgmgrinfo_pkginfo_filter_destroy(handle);
1939 printf("No of rpm pkgs: %d\n", count);
1940 pkgmgrinfo_pkginfo_filter_destroy(handle);
1945 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1946 const char *property, const char *value);
1949 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1950 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1952 * @par This API is for package-manager client application
1953 * @par Sync (or) Async : Synchronous API
1955 * @param[in] handle pointer to the package info filter handle.
1956 * @param[in] pkg_cb callback function.
1957 * @param[in] user_data user data to be passed to the callback function
1958 * @return 0 if success, error code(<0) if fail
1959 * @retval PMINFO_R_OK success
1960 * @retval PMINFO_R_EINVAL invalid argument
1961 * @retval PMINFO_R_ERROR internal error
1962 * @pre pkgmgrinfo_pkginfo_filter_create()
1963 * @post pkgmgrinfo_pkginfo_filter_destroy()
1964 * @see pkgmgrinfo_pkginfo_filter_count()
1966 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1969 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1970 printf("pkg id : %s\n", pkgid);
1974 static int get_rpm_pkg_list()
1977 pkgmgrinfo_pkginfo_filter_h handle;
1978 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1979 if (ret != PMINFO_R_OK)
1981 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1982 if (ret != PMINFO_R_OK) {
1983 pkgmgrinfo_pkginfo_filter_destroy(handle);
1986 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_filter_destroy(handle);
1991 pkgmgrinfo_pkginfo_filter_destroy(handle);
1996 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1997 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2000 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2001 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2002 * @brief This API counts the package that satisfy the filter conditions
2004 * @par This API is for package-manager client application
2005 * @par Sync (or) Async : Synchronous API
2007 * @param[in] handle pointer to the package info filter handle.
2008 * @param[in] count pointer to store the count value.
2009 * @param[in] uid the addressee user id of the instruction
2010 * @return 0 if success, error code(<0) if fail
2011 * @retval PMINFO_R_OK success
2012 * @retval PMINFO_R_EINVAL invalid argument
2013 * @retval PMINFO_R_ERROR internal error
2014 * @pre pkgmgrinfo_pkginfo_filter_create()
2015 * @post pkgmgrinfo_pkginfo_filter_destroy()
2016 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2018 static int get_rpm_pkg_count()
2022 pkgmgrinfo_pkginfo_filter_h handle;
2023 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2024 if (ret != PMINFO_R_OK)
2026 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2027 if (ret != PMINFO_R_OK) {
2028 pkgmgrinfo_pkginfo_filter_destroy(handle);
2031 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2032 if (ret != PMINFO_R_OK) {
2033 pkgmgrinfo_pkginfo_filter_destroy(handle);
2036 printf("No of rpm pkgs: %d\n", count);
2037 pkgmgrinfo_pkginfo_filter_destroy(handle);
2042 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2043 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2045 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2046 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2047 * @brief This API gets the list of privilege for a particular package
2049 * @par This API is for package-manager client application
2050 * @par Sync (or) Async : Synchronous API
2051 * @param[in] handle pointer to the package info handle.
2052 * @param[in] privilege_func callback function for list
2053 * @param[in] user_data user data to be passed to callback function
2054 * @return 0 if success, error code(<0) if fail
2055 * @retval PMINFO_R_OK success
2056 * @retval PMINFO_R_EINVAL invalid argument
2057 * @retval PMINFO_R_ERROR internal error
2058 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2059 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2061 int privilege_func(const char *name, void *user_data)
2063 if (strcmp(name, (char *)user_data) == 0)
2069 static int list_privilege(const char *package, char *privilege)
2072 pkgmgrinfo_pkginfo_h handle;
2073 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2074 if (ret != PMINFO_R_OK)
2076 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2077 if (ret != PMINFO_R_OK) {
2078 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2081 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2086 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2087 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2090 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2091 pkgmgrinfo_app_list_cb app_func, void *user_data)
2092 * @brief This API gets list of installed applications for a particular package
2094 * @par This API is for package-manager client application
2095 * @par Sync (or) Async : Synchronous API
2096 * @param[in] handle package info handle
2097 * @param[in] component application component
2098 * @param[in] app_func iteration function for list
2099 * @param[in] user_data user data to be passed to callback function
2100 * @return 0 if success, error code(<0) if fail
2101 * @retval PMINFO_R_OK success
2102 * @retval PMINFO_R_EINVAL invalid argument
2103 * @retval PMINFO_R_ERROR internal error
2104 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2105 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2107 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2110 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2111 printf("appid : %s\n", appid);
2115 static int list_apps(const char *pkgid)
2118 pkgmgrinfo_pkginfo_h handle;
2119 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2120 if (ret != PMINFO_R_OK)
2122 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2123 if (ret != PMINFO_R_OK) {
2124 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2127 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2132 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2133 pkgmgrinfo_app_list_cb app_func, void *user_data);
2135 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2136 * @brief This API gets list of installed applications from all packages with minimum informaion.
2138 * @par This API is for package-manager client application
2139 * @par Sync (or) Async : Synchronous API
2140 * @param[in] app_func iteration function for list
2141 * @param[in] user_data user data to be passed to callback function
2142 * @return 0 if success, error code(<0) if fail
2143 * @retval PMINFO_R_OK success
2144 * @retval PMINFO_R_EINVAL invalid argument
2145 * @retval PMINFO_R_ERROR internal error
2149 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2151 char *pkgid1 = NULL;
2152 char *pkgid2 = NULL;
2153 pkgid1 = (char *)user_data;
2154 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2155 if (strcmp(pkgid1, pkgid2) == 0) {
2162 static int list_apps()
2165 char *name = "helloworld";
2166 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2167 if (ret != PMINFO_R_OK) {
2174 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2175 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2177 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2178 * @brief This API gets list of installed applications from all packages.
2180 * @par This API is for package-manager client application
2181 * @par Sync (or) Async : Synchronous API
2182 * @param[in] app_func iteration function for list
2183 * @param[in] user_data user data to be passed to callback function
2184 * @return 0 if success, error code(<0) if fail
2185 * @retval PMINFO_R_OK success
2186 * @retval PMINFO_R_EINVAL invalid argument
2187 * @retval PMINFO_R_ERROR internal error
2191 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2193 char *pkgid1 = NULL;
2194 char *pkgid2 = NULL;
2195 pkgid1 = (char *)user_data;
2196 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2197 if (strcmp(pkgid1, pkgid2) == 0) {
2204 static int list_apps()
2207 char *name = "helloworld";
2208 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2209 if (ret != PMINFO_R_OK) {
2216 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2217 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2220 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2221 * @brief This API creates the application information handle from db
2223 * @par This API is for package-manager client application
2224 * @par Sync (or) Async : Synchronous API
2226 * @param[in] appid pointer to appid
2227 * @param[out] handle pointer to the application info handle.
2228 * @return 0 if success, error code(<0) if fail
2229 * @retval PMINFO_R_OK success
2230 * @retval PMINFO_R_EINVAL invalid argument
2231 * @retval PMINFO_R_ERROR internal error
2233 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2234 * @see pkgmgrinfo_appinfo_get_pkgid()
2235 * @see pkgmgrinfo_appinfo_is_multiple()
2237 static int get_app_type(const char *appid)
2241 pkgmgrinfo_appinfo_h handle;
2242 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2243 if (ret != PMINFO_R_OK)
2245 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2246 if (ret != PMINFO_R_OK) {
2247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2250 printf("apptype: %s\n", type);
2251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2256 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2257 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2259 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2260 * @brief This API gets the application ID
2262 * @par This API is for package-manager client application
2263 * @par Sync (or) Async : Synchronous API
2265 * @param[in] handle pointer to the application info handle.
2266 * @param[out] appid pointer to hold appid
2267 * @return 0 if success, error code(<0) if fail
2268 * @retval PMINFO_R_OK success
2269 * @retval PMINFO_R_EINVAL invalid argument
2270 * @retval PMINFO_R_ERROR internal error
2271 * @pre pkgmgrinfo_appinfo_get_appinfo()
2272 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2273 * @see pkgmgrinfo_appinfo_get_pkgid()
2274 * @see pkgmgrinfo_appinfo_is_multiple()
2276 static int get_app_id(const char *appid)
2279 char *app_id = NULL;
2280 pkgmgrinfo_appinfo_h handle;
2281 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2282 if (ret != PMINFO_R_OK)
2284 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2285 if (ret != PMINFO_R_OK) {
2286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2289 printf("app id: %s\n", app_id);
2290 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2295 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2298 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2299 * @brief This API gets the package name of the application
2301 * @par This API is for package-manager client application
2302 * @par Sync (or) Async : Synchronous API
2304 * @param[in] handle pointer to the application info handle.
2305 * @param[out] pkg_name pointer to hold package name
2306 * @return 0 if success, error code(<0) if fail
2307 * @retval PMINFO_R_OK success
2308 * @retval PMINFO_R_EINVAL invalid argument
2309 * @retval PMINFO_R_ERROR internal error
2310 * @pre pkgmgrinfo_appinfo_get_appinfo()
2311 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2312 * @see pkgmgrinfo_appinfo_get_appid()
2313 * @see pkgmgrinfo_appinfo_is_multiple()
2315 static int get_app_pkgname(const char *appid)
2318 char *pkgname = NULL;
2319 pkgmgrinfo_appinfo_h handle;
2320 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2321 if (ret != PMINFO_R_OK)
2323 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2324 if (ret != PMINFO_R_OK) {
2325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2328 printf("pkg name: %s\n", pkgname);
2329 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2334 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2337 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2338 * @brief This API gets the package id of the application
2340 * @par This API is for package-manager client application
2341 * @par Sync (or) Async : Synchronous API
2343 * @param[in] handle pointer to the application info handle.
2344 * @param[out] pkgid pointer to hold package id
2345 * @return 0 if success, error code(<0) if fail
2346 * @retval PMINFO_R_OK success
2347 * @retval PMINFO_R_EINVAL invalid argument
2348 * @retval PMINFO_R_ERROR internal error
2349 * @pre pkgmgrinfo_appinfo_get_appinfo()
2350 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2351 * @see pkgmgrinfo_appinfo_get_appid()
2352 * @see pkgmgrinfo_appinfo_is_multiple()
2354 static int get_app_pkgid(const char *appid)
2358 pkgmgrinfo_appinfo_h handle;
2359 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2360 if (ret != PMINFO_R_OK)
2362 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2363 if (ret != PMINFO_R_OK) {
2364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2367 printf("pkg id: %s\n", pkgid);
2368 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2373 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2376 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2377 * @brief This API gets the executable name of the application
2379 * @par This API is for package-manager client application
2380 * @par Sync (or) Async : Synchronous API
2382 * @param[in] handle pointer to the application info handle.
2383 * @param[out] exec pointer to hold app exec name
2384 * @return 0 if success, error code(<0) if fail
2385 * @retval PMINFO_R_OK success
2386 * @retval PMINFO_R_EINVAL invalid argument
2387 * @retval PMINFO_R_ERROR internal error
2388 * @pre pkgmgrinfo_appinfo_get_appinfo()
2389 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2390 * @see pkgmgrinfo_appinfo_get_appid()
2391 * @see pkgmgrinfo_appinfo_is_multiple()
2393 static int get_app_exec(const char *appid)
2397 pkgmgrinfo_appinfo_h handle;
2398 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2399 if (ret != PMINFO_R_OK)
2401 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2402 if (ret != PMINFO_R_OK) {
2403 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2406 printf("exec name: %s\n", exec);
2407 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2412 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2415 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2416 * @brief This API gets the icon name of the application
2418 * @par This API is for package-manager client application
2419 * @par Sync (or) Async : Synchronous API
2421 * @param[in] handle pointer to the application info handle.
2422 * @param[out] icon pointer to hold app icon name
2423 * @return 0 if success, error code(<0) if fail
2424 * @retval PMINFO_R_OK success
2425 * @retval PMINFO_R_EINVAL invalid argument
2426 * @retval PMINFO_R_ERROR internal error
2427 * @pre pkgmgrinfo_appinfo_get_appinfo()
2428 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2429 * @see pkgmgrinfo_appinfo_get_appid()
2430 * @see pkgmgrinfo_appinfo_is_multiple()
2432 static int get_app_icon(const char *appid)
2436 pkgmgrinfo_appinfo_h handle;
2437 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2438 if (ret != PMINFO_R_OK)
2440 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2441 if (ret != PMINFO_R_OK) {
2442 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2445 printf("icon name: %s\n", icon);
2446 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2451 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2454 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2455 * @brief This API gets the label of the application
2457 * @par This API is for package-manager client application
2458 * @par Sync (or) Async : Synchronous API
2460 * @param[in] handle pointer to the application info handle.
2461 * @param[out] label pointer to hold app label
2462 * @return 0 if success, error code(<0) if fail
2463 * @retval PMINFO_R_OK success
2464 * @retval PMINFO_R_EINVAL invalid argument
2465 * @retval PMINFO_R_ERROR internal error
2466 * @pre pkgmgrinfo_appinfo_get_appinfo()
2467 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2468 * @see pkgmgrinfo_appinfo_get_appid()
2469 * @see pkgmgrinfo_appinfo_is_multiple()
2471 static int get_app_label(const char *appid)
2475 pkgmgrinfo_appinfo_h handle;
2476 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2477 if (ret != PMINFO_R_OK)
2479 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2480 if (ret != PMINFO_R_OK) {
2481 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2484 printf("label : %s\n", label);
2485 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2490 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2493 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2494 * @brief This API gets the component of the application
2496 * @par This API is for package-manager client application
2497 * @par Sync (or) Async : Synchronous API
2499 * @param[in] handle pointer to the application info handle.
2500 * @param[out] component pointer to hold app component
2501 * @return 0 if success, error code(<0) if fail
2502 * @retval PMINFO_R_OK success
2503 * @retval PMINFO_R_EINVAL invalid argument
2504 * @retval PMINFO_R_ERROR internal error
2505 * @pre pkgmgrinfo_appinfo_get_appinfo()
2506 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2507 * @see pkgmgrinfo_appinfo_get_appid()
2508 * @see pkgmgrinfo_appinfo_is_multiple()
2510 static int get_app_component(const char *appid)
2513 pkgmgrinfo_app_component component;
2514 pkgmgrinfo_appinfo_h handle;
2515 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2516 if (ret != PMINFO_R_OK)
2518 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2519 if (ret != PMINFO_R_OK) {
2520 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2523 printf("component : %s\n", component);
2524 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2529 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2532 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2533 * @brief This API gets the apptype of the application
2535 * @par This API is for package-manager client application
2536 * @par Sync (or) Async : Synchronous API
2538 * @param[in] handle pointer to the application info handle.
2539 * @param[out] app_type pointer to hold apptype
2540 * @return 0 if success, error code(<0) if fail
2541 * @retval PMINFO_R_OK success
2542 * @retval PMINFO_R_EINVAL invalid argument
2543 * @retval PMINFO_R_ERROR internal error
2544 * @pre pkgmgrinfo_appinfo_get_appinfo()
2545 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2546 * @see pkgmgrinfo_appinfo_get_appid()
2547 * @see pkgmgrinfo_appinfo_is_multiple()
2549 static int get_app_type(const char *appid)
2552 char *apptype = NULL;
2553 pkgmgrinfo_appinfo_h handle;
2554 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2555 if (ret != PMINFO_R_OK)
2557 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2558 if (ret != PMINFO_R_OK) {
2559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2562 printf("apptype : %s\n", apptype);
2563 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2568 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2571 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2572 int *operation_count, char ***operation)
2573 * @brief This API gets the list of operation of the application
2575 * @par This API is for package-manager client application
2576 * @par Sync (or) Async : Synchronous API
2578 * @param[in] handle pointer to the appcontrol handle.
2579 * @param[out] operation_count pointer to hold number of operations
2580 * @param[out] operation pointer to hold list of operations
2581 * @return 0 if success, error code(<0) if fail
2582 * @retval PMINFO_R_OK success
2583 * @retval PMINFO_R_EINVAL invalid argument
2584 * @retval PMINFO_R_ERROR internal error
2585 * @pre pkgmgrinfo_appinfo_get_appinfo()
2586 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2587 * @see pkgmgrinfo_appinfo_get_uri()
2588 * @see pkgmgrinfo_appinfo_get_mime()
2590 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2595 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2596 for (i = 0; i < oc; i++) {
2597 if (strcmp(operation[i], (char *)user_data) == 0)
2604 static int check_operation(const char *appid, char *operation)
2607 pkgmgrinfo_appinfo_h handle;
2608 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2609 if (ret != PMINFO_R_OK)
2611 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2612 if (ret != PMINFO_R_OK) {
2613 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2621 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2622 int *operation_count, char ***operation);
2625 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2626 int *uri_count, char ***uri)
2627 * @brief This API gets the list of uri of the application
2629 * @par This API is for package-manager client application
2630 * @par Sync (or) Async : Synchronous API
2632 * @param[in] handle pointer to the appcontrol handle.
2633 * @param[out] uri_count pointer to hold number of uris
2634 * @param[out] uri pointer to hold list of uris
2635 * @return 0 if success, error code(<0) if fail
2636 * @retval PMINFO_R_OK success
2637 * @retval PMINFO_R_EINVAL invalid argument
2638 * @retval PMINFO_R_ERROR internal error
2639 * @pre pkgmgrinfo_appinfo_get_appinfo()
2640 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2641 * @see pkgmgrinfo_appinfo_get_operation()
2642 * @see pkgmgrinfo_appinfo_get_mime()
2644 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2649 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2650 for (i = 0; i < uc; i++) {
2651 if (strcmp(uri[i], (char *)user_data) == 0)
2658 static int check_uri(const char *appid, char *uri)
2661 pkgmgrinfo_appinfo_h handle;
2662 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2663 if (ret != PMINFO_R_OK)
2665 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2666 if (ret != PMINFO_R_OK) {
2667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2670 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2675 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2676 int *uri_count, char ***uri);
2679 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2680 int *mime_count, char ***mime)
2681 * @brief This API gets the list of mime of the application
2683 * @par This API is for package-manager client application
2684 * @par Sync (or) Async : Synchronous API
2686 * @param[in] handle pointer to the appcontrol handle.
2687 * @param[out] mime_count pointer to hold number of mimes
2688 * @param[out] mime pointer to hold list of mimes
2689 * @return 0 if success, error code(<0) if fail
2690 * @retval PMINFO_R_OK success
2691 * @retval PMINFO_R_EINVAL invalid argument
2692 * @retval PMINFO_R_ERROR internal error
2693 * @pre pkgmgrinfo_appinfo_get_appinfo()
2694 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2695 * @see pkgmgrinfo_appinfo_get_uri()
2696 * @see pkgmgrinfo_appinfo_get_operation()
2698 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2703 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2704 for (i = 0; i < mc; i++) {
2705 if (strcmp(mime[i], (char *)user_data) == 0)
2712 static int check_mime(const char *appid, char *mime)
2715 pkgmgrinfo_appinfo_h handle;
2716 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2717 if (ret != PMINFO_R_OK)
2719 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2720 if (ret != PMINFO_R_OK) {
2721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2729 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2730 int *mime_count, char ***mime);
2733 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2734 int *subapp_count, char ***subapp)
2735 * @brief This API gets the list of subapp of the application
2737 * @par This API is for package-manager client application
2738 * @par Sync (or) Async : Synchronous API
2740 * @param[in] handle pointer to the appcontrol handle.
2741 * @param[out] subapp_count pointer to hold number of subapp
2742 * @param[out] subapp pointer to hold list of subapp
2743 * @return 0 if success, error code(<0) if fail
2744 * @retval PMINFO_R_OK success
2745 * @retval PMINFO_R_EINVAL invalid argument
2746 * @retval PMINFO_R_ERROR internal error
2747 * @pre pkgmgrinfo_appinfo_get_appinfo()
2748 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2749 * @see pkgmgrinfo_appinfo_get_uri()
2750 * @see pkgmgrinfo_appinfo_get_operation()
2752 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2756 char **subapp = NULL;
2757 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2758 for (i = 0; i < sc; i++) {
2759 if (strcmp(subapp[i], (char *)user_data) == 0)
2766 static int check_subapp(const char *appid, char *subapp)
2769 pkgmgrinfo_appinfo_h handle = NULL;
2770 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2771 if (ret != PMINFO_R_OK)
2773 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2774 if (ret != PMINFO_R_OK) {
2775 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2783 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2784 int *subapp_count, char ***subapp);
2787 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2788 * @brief This API gets the notification icon of the application
2790 * @par This API is for package-manager client application
2791 * @par Sync (or) Async : Synchronous API
2793 * @param[in] handle pointer to the application info handle.
2794 * @param[out] path pointer to hold notification icon
2795 * @return 0 if success, error code(<0) if fail
2796 * @retval PMINFO_R_OK success
2797 * @retval PMINFO_R_EINVAL invalid argument
2798 * @retval PMINFO_R_ERROR internal error
2799 * @pre pkgmgrinfo_appinfo_get_appinfo()
2800 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2801 * @see pkgmgrinfo_appinfo_get_appid()
2802 * @see pkgmgrinfo_appinfo_is_multiple()
2804 static int get_app_notification_icon(const char *appid)
2807 char *notification_icon = NULL;
2808 pkgmgrinfo_appinfo_h handle;
2809 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2810 if (ret != PMINFO_R_OK)
2812 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2813 if (ret != PMINFO_R_OK) {
2814 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2817 printf("notification icon : %s\n", notification_icon);
2818 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2823 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2826 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2827 * @brief This API gets the setting icon of the application
2829 * @par This API is for package-manager client application
2830 * @par Sync (or) Async : Synchronous API
2832 * @param[in] handle pointer to the application info handle.
2833 * @param[out] path pointer to hold setting icon
2834 * @return 0 if success, error code(<0) if fail
2835 * @retval PMINFO_R_OK success
2836 * @retval PMINFO_R_EINVAL invalid argument
2837 * @retval PMINFO_R_ERROR internal error
2838 * @pre pkgmgrinfo_appinfo_get_appinfo()
2839 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2840 * @see pkgmgrinfo_appinfo_get_appid()
2841 * @see pkgmgrinfo_appinfo_is_multiple()
2843 static int get_app_setting_icon(const char *appid)
2846 char *setting_icon = NULL;
2847 pkgmgrinfo_appinfo_h handle;
2848 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2849 if (ret != PMINFO_R_OK)
2851 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2852 if (ret != PMINFO_R_OK) {
2853 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2856 printf("setting icon : %s\n", setting_icon);
2857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2862 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2865 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2866 * @brief This API gets the type of recent image on app-tray
2868 * @par This API is for package-manager client application
2869 * @par Sync (or) Async : Synchronous API
2871 * @param[in] handle pointer to the application info handle.
2872 * @param[out] type pointer to hold image type
2873 * @return 0 if success, error code(<0) if fail
2874 * @retval PMINFO_R_OK success
2875 * @retval PMINFO_R_EINVAL invalid argument
2876 * @retval PMINFO_R_ERROR internal error
2877 * @pre pkgmgrinfo_appinfo_get_appinfo()
2878 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2879 * @see pkgmgrinfo_appinfo_get_appid()
2880 * @see pkgmgrinfo_appinfo_is_multiple()
2882 static int get_app_recent_image_type(const char *appid)
2885 pkgmgrinfo_app_recentimage type;
2886 pkgmgrinfo_appinfo_h handle;
2887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2888 if (ret != PMINFO_R_OK)
2890 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2891 if (ret != PMINFO_R_OK) {
2892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2895 printf("recent image type: %d\n", type);
2896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2901 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2905 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2906 * @brief This API gets the preview image of application
2908 * @par Sync (or) Async : Synchronous API
2910 * @param[in] handle pointer to the application info handle.
2911 * @param[out] preview_img pointer to hold preview image path
2912 * @return 0 if success, error code(<0) if fail
2913 * @retval PMINFO_R_OK success
2914 * @retval PMINFO_R_EINVAL invalid argument
2915 * @retval PMINFO_R_ERROR internal error
2916 * @pre pkgmgrinfo_appinfo_get_appinfo()
2917 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2918 * @see pkgmgrinfo_appinfo_get_appid()
2920 static int get_app_previewimage(const char *appid)
2923 char *preview = NULL;
2924 pkgmgrinfo_appinfo_h handle = NULL;
2925 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2926 if (ret != PMINFO_R_OK)
2928 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2929 if (ret != PMINFO_R_OK) {
2930 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2933 printf("preview image path : %s\n", preview);
2934 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2939 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2943 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2944 * @brief This API gets the package permission type of the application
2946 * @par This API is for package-manager client application
2947 * @par Sync (or) Async : Synchronous API
2949 * @param[in] handle pointer to the application info handle.
2950 * @param[out] permission pointer to hold package permission
2951 * @return 0 if success, error code(<0) if fail
2952 * @retval PMINFO_R_OK success
2953 * @retval PMINFO_R_EINVAL invalid argument
2954 * @retval PMINFO_R_ERROR internal error
2955 * @pre pkgmgrinfo_appinfo_get_appinfo()
2956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2957 * @see pkgmgrinfo_appinfo_get_appid()
2959 static int get_app_permission(const char *appid)
2962 pkgmgrinfo_permission_type permission = 0;
2963 pkgmgrinfo_appinfo_h handle;
2965 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2966 if (ret != PMINFO_R_OK)
2968 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2969 if (ret != PMINFO_R_OK) {
2970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973 printf("permission type: %d\n", permission);
2974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2979 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2982 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2983 * @brief This API gets the component_type
2985 * @par This API is for package-manager client application
2986 * @par Sync (or) Async : Synchronous API
2988 * @param[in] handle pointer to the application info handle.
2989 * @param[out] component_type pointer to hold component_type
2990 * @return 0 if success, error code(<0) if fail
2991 * @retval PMINFO_R_OK success
2992 * @retval PMINFO_R_EINVAL invalid argument
2993 * @retval PMINFO_R_ERROR internal error
2994 * @pre pkgmgrinfo_appinfo_get_appinfo()
2995 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2996 * @see pkgmgrinfo_appinfo_get_pkgid()
2997 * @see pkgmgrinfo_appinfo_is_multiple()
2999 static int get_component_type(const char *appid)
3002 char *component_type = NULL;
3003 pkgmgrinfo_appinfo_h handle;
3004 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3005 if (ret != PMINFO_R_OK)
3007 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3008 if (ret != PMINFO_R_OK) {
3009 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012 printf("component_type: %s\n", component_type);
3013 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3018 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3021 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3022 * @brief This API gets the application 'hwacceleration' value from the app ID
3024 * @par This API is for package-manager client application
3025 * @par Sync (or) Async : Synchronous API
3027 * @param[in] handle pointer to application info handle
3028 * @param[out] hwacceleration pointer to hold package hwacceleration value
3029 * @return 0 if success, error code(<0) if fail
3030 * @retval PMINFO_R_OK success
3031 * @retval PMINFO_R_EINVAL invalid argument
3032 * @retval PMINFO_R_ERROR internal error
3033 * @pre pkgmgrinfo_appinfo_get_appinfo()
3034 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3035 * @see pkgmgrinfo_appinfo_get_appid()
3036 * @see pkgmgrinfo_appinfo_is_multiple()
3038 static int get_app_hwacceleration(const char *appid)
3041 pkgmgrinfo_app_hwacceleration hwacceleration;
3042 pkgmgrinfo_appinfo_h handle;
3043 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3044 if (ret != PMINFO_R_OK)
3046 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3047 if (ret != PMINFO_R_OK) {
3048 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3051 printf("app hwacceleration: %d\n", hwacceleration);
3052 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3057 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3060 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3061 * @brief This API gets the application 'screenreader' value from the app ID
3063 * @par This API is for package-manager client application
3064 * @par Sync (or) Async : Synchronous API
3066 * @param[in] handle pointer to application info handle
3067 * @param[out] screenreader pointer to hold package accessibility value
3068 * @return 0 if success, error code(<0) if fail
3069 * @retval PMINFO_R_OK success
3070 * @retval PMINFO_R_EINVAL invalid argument
3071 * @retval PMINFO_R_ERROR internal error
3072 * @pre pkgmgrinfo_appinfo_get_appinfo()
3073 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3074 * @see pkgmgrinfo_appinfo_get_appid()
3075 * @see pkgmgrinfo_appinfo_is_multiple()
3077 static int get_app_screenreader(const char *appid)
3080 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3081 pkgmgrinfo_appinfo_h handle = NULL;
3082 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3083 if (ret != PMINFO_R_OK)
3085 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3086 if (ret != PMINFO_R_OK) {
3087 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3090 printf("app screenreader: %d\n", screenreader);
3091 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3096 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3099 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3100 * @brief This API gets the application's landscape & portrait effect images
3102 * @par This API is for package-manager client application
3103 * @par Sync (or) Async : Synchronous API
3105 * @param[in] handle pointer to application info handle
3106 * @param[out] portrait_img contains portrait mode effect image
3107 * @param[out] landscape_img contains landscape mode effect image
3108 * @return 0 if success, error code(<0) if fail
3109 * @retval PMINFO_R_OK success
3110 * @retval PMINFO_R_EINVAL invalid argument
3111 * @retval PMINFO_R_ERROR internal error
3112 * @pre pkgmgrinfo_appinfo_get_appinfo()
3113 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3114 * @see pkgmgrinfo_appinfo_get_appid()
3115 * @see pkgmgrinfo_appinfo_is_nodisplay()
3117 static int get_app_effectimages(const char *appid)
3120 char *portraitimg = NULL;
3121 char *landscapeimg = NULL;
3122 pkgmgrinfo_appinfo_h handle;
3123 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3124 if (ret != PMINFO_R_OK)
3126 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3127 if (ret != PMINFO_R_OK) {
3128 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3131 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3132 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3137 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3140 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3141 * @brief This API gets the submode_mainid of the application
3143 * @par This API is for package-manager client application
3144 * @par Sync (or) Async : Synchronous API
3146 * @param[in] handle pointer to the application info handle.
3147 * @param[out] submode_mainid pointer to hold package name
3148 * @return 0 if success, error code(<0) if fail
3149 * @retval PMINFO_R_OK success
3150 * @retval PMINFO_R_EINVAL invalid argument
3151 * @retval PMINFO_R_ERROR internal error
3152 * @pre pkgmgrinfo_appinfo_get_appinfo()
3153 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3154 * @see pkgmgrinfo_appinfo_get_appid()
3155 * @see pkgmgrinfo_appinfo_is_multiple()
3157 static int get_app_submode_mainid(const char *appid)
3160 char *submode_mainid = NULL;
3161 pkgmgrinfo_appinfo_h handle = NULL;
3162 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3163 if (ret != PMINFO_R_OK)
3165 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3166 if (ret != PMINFO_R_OK) {
3167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3170 printf("submode_mainid: %s\n", submode_mainid);
3171 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3176 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3179 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3180 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3181 * @brief This API gets the list of permission for a particular application
3183 * @par This API is for package-manager client application
3184 * @par Sync (or) Async : Synchronous API
3185 * @param[in] handle pointer to the application info handle.
3186 * @param[in] permission_func callback function for list
3187 * @param[in] user_data user data to be passed to callback function
3188 * @return 0 if success, error code(<0) if fail
3189 * @retval PMINFO_R_OK success
3190 * @retval PMINFO_R_EINVAL invalid argument
3191 * @retval PMINFO_R_ERROR internal error
3192 * @pre pkgmgrinfo_appinfo_get_appinfo()
3193 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3195 int permission_func(const char *name, void *user_data)
3197 if (strcmp(name, (char *)user_data) == 0)
3203 static int list_permission(const char *appid, char *permission)
3206 pkgmgrinfo_appinfo_h handle;
3207 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3208 if (ret != PMINFO_R_OK)
3210 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3211 if (ret != PMINFO_R_OK) {
3212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3221 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3224 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3225 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3226 * @brief This API gets the list of category for a particular application
3228 * @par This API is for package-manager client application
3229 * @par Sync (or) Async : Synchronous API
3230 * @param[in] handle pointer to the application info handle.
3231 * @param[in] category_func callback function for list
3232 * @param[in] user_data user data to be passed to callback function
3233 * @return 0 if success, error code(<0) if fail
3234 * @retval PMINFO_R_OK success
3235 * @retval PMINFO_R_EINVAL invalid argument
3236 * @retval PMINFO_R_ERROR internal error
3237 * @pre pkgmgrinfo_appinfo_get_appinfo()
3238 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3240 int category_func(const char *name, void *user_data)
3242 if (strcmp(name, (char *)user_data) == 0)
3248 static int list_category(const char *appid, char *category)
3251 pkgmgrinfo_appinfo_h handle;
3252 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3253 if (ret != PMINFO_R_OK)
3255 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3256 if (ret != PMINFO_R_OK) {
3257 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3265 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3266 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3269 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3270 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3271 * @brief This API gets the list of metadata for a particular application
3273 * @par This API is for package-manager client application
3274 * @par Sync (or) Async : Synchronous API
3275 * @param[in] handle pointer to the application info handle.
3276 * @param[in] metadata_func callback function for list
3277 * @param[in] user_data user data to be passed to callback function
3278 * @return 0 if success, error code(<0) if fail
3279 * @retval PMINFO_R_OK success
3280 * @retval PMINFO_R_EINVAL invalid argument
3281 * @retval PMINFO_R_ERROR internal error
3282 * @pre pkgmgrinfo_appinfo_get_appinfo()
3283 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3285 int metadata_func(const char *key, const char *value, void *user_data)
3287 if (strcmp(key, (char *)user_data) == 0) {
3288 printf("Value is %s\n", value);
3295 static int list_metadata(const char *appid, char *key)
3298 pkgmgrinfo_appinfo_h handle;
3299 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3300 if (ret != PMINFO_R_OK)
3302 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3303 if (ret != PMINFO_R_OK) {
3304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3312 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3313 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3317 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3318 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3319 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3320 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3321 * @brief This API gets the list of app-control for a particular application
3323 * @par This API is for package-manager client application
3324 * @par Sync (or) Async : Synchronous API
3325 * @param[in] handle pointer to the application info handle.
3326 * @param[in] appcontrol_func callback function for list
3327 * @param[in] user_data user data to be passed to callback function
3328 * @param[in] uid the addressee user id of the instruction
3329 * @return 0 if success, error code(<0) if fail
3330 * @retval PMINFO_R_OK success
3331 * @retval PMINFO_R_EINVAL invalid argument
3332 * @retval PMINFO_R_ERROR internal error
3333 * @pre pkgmgrinfo_appinfo_get_appinfo()
3334 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3336 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3341 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3342 for (i = 0; i < oc; i++) {
3343 if (strcmp(operation[i], (char *)user_data) == 0)
3350 static int check_operation(const char *appid, char *operation)
3353 pkgmgrinfo_appinfo_h handle;
3354 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3355 if (ret != PMINFO_R_OK)
3357 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3358 if (ret != PMINFO_R_OK) {
3359 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3367 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3368 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3369 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3370 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3373 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3374 * @brief This API gets the application 'nodisplay' value from the app ID
3376 * @par This API is for package-manager client application
3377 * @par Sync (or) Async : Synchronous API
3379 * @param[in] handle pointer to application info handle
3380 * @param[out] nodisplay pointer to hold package nodisplay value
3381 * @return 0 if success, error code(<0) if fail
3382 * @retval PMINFO_R_OK success
3383 * @retval PMINFO_R_EINVAL invalid argument
3384 * @retval PMINFO_R_ERROR internal error
3385 * @pre pkgmgrinfo_appinfo_get_appinfo()
3386 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3387 * @see pkgmgrinfo_appinfo_get_appid()
3388 * @see pkgmgrinfo_appinfo_is_multiple()
3390 static int get_app_nodisplay(const char *appid)
3394 pkgmgrinfo_appinfo_h handle;
3395 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3396 if (ret != PMINFO_R_OK)
3398 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3399 if (ret != PMINFO_R_OK) {
3400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3403 printf("app nodisplay: %d\n", nodisplay);
3404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3409 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3412 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3413 * @brief This API gets the application 'multiple' value from the app ID
3415 * @par This API is for package-manager client application
3416 * @par Sync (or) Async : Synchronous API
3418 * @param[in] handle pointer to application info handle
3419 * @param[out] multiple pointer to hold package multiple value
3420 * @return 0 if success, error code(<0) if fail
3421 * @retval PMINFO_R_OK success
3422 * @retval PMINFO_R_EINVAL invalid argument
3423 * @retval PMINFO_R_ERROR internal error
3424 * @pre pkgmgrinfo_appinfo_get_appinfo()
3425 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3426 * @see pkgmgrinfo_appinfo_get_appid()
3427 * @see pkgmgrinfo_appinfo_is_nodisplay()
3429 static int get_app_multiple(const char *appid)
3433 pkgmgrinfo_appinfo_h handle;
3434 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3435 if (ret != PMINFO_R_OK)
3437 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3438 if (ret != PMINFO_R_OK) {
3439 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3442 printf("app multiple: %d\n", multiple);
3443 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3448 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3451 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3452 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3453 * application launching effect. If fales, indicator will be hidden during application launching effect
3455 * @par This API is for package-manager client application
3456 * @par Sync (or) Async : Synchronous API
3458 * @param[in] handle pointer to application info handle
3459 * @param[out] indicator_disp contains indicator display status for application launching effect
3460 * @return 0 if success, error code(<0) if fail
3461 * @retval PMINFO_R_OK success
3462 * @retval PMINFO_R_EINVAL invalid argument
3463 * @retval PMINFO_R_ERROR internal error
3464 * @pre pkgmgrinfo_appinfo_get_appinfo()
3465 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3466 * @see pkgmgrinfo_appinfo_get_appid()
3467 * @see pkgmgrinfo_appinfo_is_nodisplay()
3469 static int get_app_indicator_display(const char *appid)
3472 bool indicator_disp;
3473 pkgmgrinfo_appinfo_h handle;
3474 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3475 if (ret != PMINFO_R_OK)
3477 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3478 if (ret != PMINFO_R_OK){
3479 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3482 printf("app indicator disp : %d\n", indicator_disp);
3483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3488 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3491 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3492 * @brief This API gets the application 'taskmanage' value from the app ID
3494 * @par This API is for package-manager client application
3495 * @par Sync (or) Async : Synchronous API
3497 * @param[in] handle pointer to application info handle
3498 * @param[out] taskmanage pointer to hold package taskmanage value
3499 * @return 0 if success, error code(<0) if fail
3500 * @retval PMINFO_R_OK success
3501 * @retval PMINFO_R_EINVAL invalid argument
3502 * @retval PMINFO_R_ERROR internal error
3503 * @pre pkgmgrinfo_appinfo_get_appinfo()
3504 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3505 * @see pkgmgrinfo_appinfo_get_appid()
3506 * @see pkgmgrinfo_appinfo_is_multiple()
3508 static int get_app_taskmanage(const char *appid)
3512 pkgmgrinfo_appinfo_h handle;
3513 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3514 if (ret != PMINFO_R_OK)
3516 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3517 if (ret != PMINFO_R_OK) {
3518 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3521 printf("app taskmanage: %d\n", taskmanage);
3522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3527 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3530 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3531 * @brief This API gets the application 'taskmanage' value from the app ID
3533 * @par This API is for package-manager client application
3534 * @par Sync (or) Async : Synchronous API
3536 * @param[in] handle pointer to application info handle
3537 * @param[out] enabled pointer to hold package enabled value
3538 * @return 0 if success, error code(<0) if fail
3539 * @retval PMINFO_R_OK success
3540 * @retval PMINFO_R_EINVAL invalid argument
3541 * @retval PMINFO_R_ERROR internal error
3542 * @pre pkgmgrinfo_appinfo_get_appinfo()
3543 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3544 * @see pkgmgrinfo_appinfo_get_appid()
3545 * @see pkgmgrinfo_appinfo_is_multiple()
3547 static int get_app_enabled(const char *appid)
3551 pkgmgrinfo_appinfo_h handle;
3552 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3553 if (ret != PMINFO_R_OK)
3555 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3556 if (ret != PMINFO_R_OK) {
3557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3560 printf("app enabled: %d\n", enabled);
3561 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3566 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3569 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3570 * @brief This API gets the application 'onboot' value from the app ID
3572 * @par This API is for package-manager client application
3573 * @par Sync (or) Async : Synchronous API
3575 * @param[in] handle pointer to application info handle
3576 * @param[out] onboot pointer to hold package onboot value
3577 * @return 0 if success, error code(<0) if fail
3578 * @retval PMINFO_R_OK success
3579 * @retval PMINFO_R_EINVAL invalid argument
3580 * @retval PMINFO_R_ERROR internal error
3581 * @pre pkgmgrinfo_appinfo_get_appinfo()
3582 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3583 * @see pkgmgrinfo_appinfo_get_appid()
3584 * @see pkgmgrinfo_appinfo_is_multiple()
3586 static int get_app_onboot(const char *appid)
3590 pkgmgrinfo_appinfo_h handle;
3591 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3592 if (ret != PMINFO_R_OK)
3594 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3595 if (ret != PMINFO_R_OK) {
3596 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3599 printf("app onboot: %d\n", onboot);
3600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3605 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3608 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3609 * @brief This API gets the application 'autorestart' value from the app ID
3611 * @par This API is for package-manager client application
3612 * @par Sync (or) Async : Synchronous API
3614 * @param[in] handle pointer to application info handle
3615 * @param[out] autorestart pointer to hold package autorestart value
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_appinfo_get_appinfo()
3621 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3622 * @see pkgmgrinfo_appinfo_get_appid()
3623 * @see pkgmgrinfo_appinfo_is_multiple()
3625 static int get_app_autorestart(const char *appid)
3629 pkgmgrinfo_appinfo_h handle;
3630 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3631 if (ret != PMINFO_R_OK)
3633 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3634 if (ret != PMINFO_R_OK) {
3635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3638 printf("app autorestart: %d\n", autorestart);
3639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3644 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3647 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3648 * @brief This API gets the value for given application is main app or not from handle
3650 * @par This API is for package-manager client application
3651 * @par Sync (or) Async : Synchronous API
3653 * @param[in] handle pointer to application info handle
3654 * @param[out] mainapp pointer to hold package mainapp is or not
3655 * @return 0 if success, error code(<0) if fail
3656 * @retval PMINFO_R_OK success
3657 * @retval PMINFO_R_EINVAL invalid argument
3658 * @retval PMINFO_R_ERROR internal error
3659 * @pre pkgmgrinfo_appinfo_get_appinfo()
3660 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3661 * @see pkgmgrinfo_appinfo_get_appid()
3662 * @see pkgmgrinfo_appinfo_is_multiple()
3664 static int get_app_mainapp(const char *appid)
3668 pkgmgrinfo_appinfo_h handle;
3669 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3670 if (ret != PMINFO_R_OK)
3672 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3673 if (ret != PMINFO_R_OK) {
3674 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3677 printf("mainapp: %d\n", mainapp);
3678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3683 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3687 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3688 * @brief This API gets the value for given application is preload or not from handle
3690 * @par This API is for package-manager client application
3691 * @par Sync (or) Async : Synchronous API
3693 * @param[in] handle pointer to application info handle
3694 * @param[out] preload pointer to hold preload is or not
3695 * @return 0 if success, error code(<0) if fail
3696 * @retval PMINFO_R_OK success
3697 * @retval PMINFO_R_EINVAL invalid argument
3698 * @retval PMINFO_R_ERROR internal error
3699 * @pre pkgmgrinfo_appinfo_get_appinfo()
3700 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3701 * @see pkgmgrinfo_appinfo_get_appid()
3702 * @see pkgmgrinfo_appinfo_is_multiple()
3704 static int get_app_preload(const char *appid)
3708 pkgmgrinfo_appinfo_h handle = NULL;
3709 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3710 if (ret != PMINFO_R_OK)
3712 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3713 if (ret != PMINFO_R_OK) {
3714 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3717 printf("preload: %d\n", preload);
3718 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3723 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3726 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3727 * @brief This API gets the value for given application is submode or not from handle
3729 * @par This API is for package-manager client application
3730 * @par Sync (or) Async : Synchronous API
3732 * @param[in] handle pointer to application info handle
3733 * @param[out] submode pointer to hold submode is or not
3734 * @return 0 if success, error code(<0) if fail
3735 * @retval PMINFO_R_OK success
3736 * @retval PMINFO_R_EINVAL invalid argument
3737 * @retval PMINFO_R_ERROR internal error
3738 * @pre pkgmgrinfo_appinfo_get_appinfo()
3739 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3740 * @see pkgmgrinfo_appinfo_get_appid()
3741 * @see pkgmgrinfo_appinfo_is_multiple()
3743 static int get_app_submode(const char *appid)
3747 pkgmgrinfo_appinfo_h handle = NULL;
3748 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3749 if (ret != PMINFO_R_OK)
3751 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3752 if (ret != PMINFO_R_OK) {
3753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3756 printf("submode: %d\n", submode);
3757 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3762 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3765 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3766 * @brief This API destroys the application information handle freeing up all the resources
3768 * @par This API is for package-manager client application
3769 * @par Sync (or) Async : Synchronous API
3771 * @param[in] handle pointer to the application info handle.
3772 * @return 0 if success, error code(<0) if fail
3773 * @retval PMINFO_R_OK success
3774 * @retval PMINFO_R_EINVAL invalid argument
3775 * @retval PMINFO_R_ERROR internal error
3776 * @pre pkgmgrinfo_appinfo_get_appinfo()
3778 * @see pkgmgrinfo_appinfo_get_pkgid()
3779 * @see pkgmgrinfo_appinfo_is_multiple()
3781 static int get_app_type(const char *appid)
3785 pkgmgrinfo_appinfo_h handle;
3786 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3787 if (ret != PMINFO_R_OK)
3789 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3790 if (ret != PMINFO_R_OK) {
3791 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3794 printf("apptype: %s\n", type);
3795 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3800 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3803 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3804 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3805 The query will search the entire application information collected from the manifest file of all the installed packages
3807 * @par This API is for package-manager client application
3808 * @par Sync (or) Async : Synchronous API
3810 * @param[out] handle pointer to the application info filter handle.
3811 * @return 0 if success, error code(<0) if fail
3812 * @retval PMINFO_R_OK success
3813 * @retval PMINFO_R_EINVAL invalid argument
3814 * @retval PMINFO_R_ERROR internal error
3816 * @post pkgmgrinfo_appinfo_filter_destroy()
3817 * @see pkgmgrinfo_appinfo_filter_count()
3818 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3820 static int get_capp_count()
3824 pkgmgrinfo_appinfo_filter_h handle;
3825 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3826 if (ret != PMINFO_R_OK)
3828 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3829 if (ret != PMINFO_R_OK) {
3830 pkgmgrinfo_appinfo_filter_destroy(handle);
3833 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3834 if (ret != PMINFO_R_OK) {
3835 pkgmgrinfo_appinfo_filter_destroy(handle);
3838 printf("No of capp: %d\n", count);
3839 pkgmgrinfo_appinfo_filter_destroy(handle);
3844 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3847 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3848 * @brief This API destroys the application information filter handle freeing up all the resources
3850 * @par This API is for package-manager client application
3851 * @par Sync (or) Async : Synchronous API
3853 * @param[in] handle pointer to the application info filter handle.
3854 * @return 0 if success, error code(<0) if fail
3855 * @retval PMINFO_R_OK success
3856 * @retval PMINFO_R_EINVAL invalid argument
3857 * @retval PMINFO_R_ERROR internal error
3858 * @pre pkgmgrinfo_appinfo_filter_create()
3860 * @see pkgmgrinfo_appinfo_filter_count()
3861 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3863 static int get_capp_count()
3867 pkgmgrinfo_appinfo_filter_h handle;
3868 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3869 if (ret != PMINFO_R_OK)
3871 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3872 if (ret != PMINFO_R_OK) {
3873 pkgmgrinfo_appinfo_filter_destroy(handle);
3876 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3877 if (ret != PMINFO_R_OK) {
3878 pkgmgrinfo_appinfo_filter_destroy(handle);
3881 printf("No of capp: %d\n", count);
3882 pkgmgrinfo_appinfo_filter_destroy(handle);
3887 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3890 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3891 * @brief This API adds a boolean filter property to the filter handle
3893 * @par This API is for package-manager client application
3894 * @par Sync (or) Async : Synchronous API
3896 * @param[in] handle pointer to the application info filter handle.
3897 * @param[in] property boolean property name.
3898 * @param[in] value value corresponding to the property.
3899 * @return 0 if success, error code(<0) if fail
3900 * @retval PMINFO_R_OK success
3901 * @retval PMINFO_R_EINVAL invalid argument
3902 * @retval PMINFO_R_ERROR internal error
3903 * @pre pkgmgrinfo_appinfo_filter_create()
3904 * @post pkgmgrinfo_appinfo_filter_destroy()
3905 * @see pkgmgrinfo_appinfo_filter_count()
3906 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3908 static int get_taskmanageable_app_count()
3912 pkgmgrinfo_appinfo_filter_h handle;
3913 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3914 if (ret != PMINFO_R_OK)
3916 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3917 if (ret != PMINFO_R_OK) {
3918 pkgmgrinfo_appinfo_filter_destroy(handle);
3921 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3922 if (ret != PMINFO_R_OK) {
3923 pkgmgrinfo_appinfo_filter_destroy(handle);
3926 printf("No of taskmanageable apps: %d\n", count);
3927 pkgmgrinfo_appinfo_filter_destroy(handle);
3932 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3933 const char *property, const bool value);
3936 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3937 * @brief This API adds an integer filter property to the filter handle
3939 * @par This API is for package-manager client application
3940 * @par Sync (or) Async : Synchronous API
3942 * @param[in] handle pointer to the application info filter handle.
3943 * @param[in] property integer property name.
3944 * @param[in] value value corresponding to the property.
3945 * @return 0 if success, error code(<0) if fail
3946 * @retval PMINFO_R_OK success
3947 * @retval PMINFO_R_EINVAL invalid argument
3948 * @retval PMINFO_R_ERROR internal error
3949 * @pre pkgmgrinfo_appinfo_filter_create()
3950 * @post pkgmgrinfo_appinfo_filter_destroy()
3951 * @see pkgmgrinfo_appinfo_filter_count()
3952 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3954 static int get_taskmanageable_app_count()
3958 pkgmgrinfo_appinfo_filter_h handle;
3959 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3960 if (ret != PMINFO_R_OK)
3962 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3963 if (ret != PMINFO_R_OK) {
3964 pkgmgrinfo_appinfo_filter_destroy(handle);
3967 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3968 if (ret != PMINFO_R_OK) {
3969 pkgmgrinfo_appinfo_filter_destroy(handle);
3972 printf("No of apps: %d\n", count);
3973 pkgmgrinfo_appinfo_filter_destroy(handle);
3978 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3979 const char *property, const int value);
3982 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3983 * @brief This API adds a string filter property to the filter handle
3985 * @par This API is for package-manager client application
3986 * @par Sync (or) Async : Synchronous API
3988 * @param[in] handle pointer to the application info filter handle.
3989 * @param[in] property string property name.
3990 * @param[in] value value corresponding to the property.
3991 * @return 0 if success, error code(<0) if fail
3992 * @retval PMINFO_R_OK success
3993 * @retval PMINFO_R_EINVAL invalid argument
3994 * @retval PMINFO_R_ERROR internal error
3995 * @pre pkgmgrinfo_appinfo_filter_create()
3996 * @post pkgmgrinfo_appinfo_filter_destroy()
3997 * @see pkgmgrinfo_appinfo_filter_count()
3998 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4000 static int get_capp_count()
4004 pkgmgrinfo_appinfo_filter_h handle;
4005 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4006 if (ret != PMINFO_R_OK)
4008 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4009 if (ret != PMINFO_R_OK) {
4010 pkgmgrinfo_appinfo_filter_destroy(handle);
4013 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4014 if (ret != PMINFO_R_OK) {
4015 pkgmgrinfo_appinfo_filter_destroy(handle);
4018 printf("No of capp: %d\n", count);
4019 pkgmgrinfo_appinfo_filter_destroy(handle);
4024 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4025 const char *property, const char *value);
4028 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4029 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4031 * @par This API is for package-manager client application
4032 * @par Sync (or) Async : Synchronous API
4034 * @param[in] handle pointer to the application info filter handle.
4035 * @param[in] app_cb callback function.
4036 * @param[in] user_data user data to be passed to the callback function
4037 * @return 0 if success, error code(<0) if fail
4038 * @retval PMINFO_R_OK success
4039 * @retval PMINFO_R_EINVAL invalid argument
4040 * @retval PMINFO_R_ERROR internal error
4041 * @pre pkgmgrinfo_appinfo_filter_create()
4042 * @post pkgmgrinfo_appinfo_filter_destroy()
4043 * @see pkgmgrinfo_appinfo_filter_count()
4045 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4048 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4049 printf("appid : %s\n", appid);
4053 static int get_capp_list()
4056 pkgmgrinfo_appinfo_filter_h handle;
4057 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4058 if (ret != PMINFO_R_OK)
4060 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4061 if (ret != PMINFO_R_OK) {
4062 pkgmgrinfo_appinfo_filter_destroy(handle);
4065 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4066 if (ret != PMINFO_R_OK) {
4067 pkgmgrinfo_appinfo_filter_destroy(handle);
4070 pkgmgrinfo_appinfo_filter_destroy(handle);
4075 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4076 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4079 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4080 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4081 * @brief This API counts the application that satisfy the filter conditions
4083 * @par This API is for package-manager client application
4084 * @par Sync (or) Async : Synchronous API
4086 * @param[in] handle pointer to the application info filter handle.
4087 * @param[in] count pointer to store count value
4088 * @param[in] uid the addressee user id of the instruction
4089 * @return 0 if success, error code(<0) if fail
4090 * @retval PMINFO_R_OK success
4091 * @retval PMINFO_R_EINVAL invalid argument
4092 * @retval PMINFO_R_ERROR internal error
4093 * @pre pkgmgrinfo_appinfo_filter_create()
4094 * @post pkgmgrinfo_appinfo_filter_destroy()
4095 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4097 static int get_capp_count()
4101 pkgmgrinfo_appinfo_filter_h handle;
4102 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4103 if (ret != PMINFO_R_OK)
4105 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4106 if (ret != PMINFO_R_OK) {
4107 pkgmgrinfo_appinfo_filter_destroy(handle);
4110 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4111 if (ret != PMINFO_R_OK) {
4112 pkgmgrinfo_appinfo_filter_destroy(handle);
4115 printf("No of capp: %d\n", count);
4116 pkgmgrinfo_appinfo_filter_destroy(handle);
4121 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4122 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4124 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4125 * @brief This API creates the application's metadata information filter handle from db.
4127 * @par This API is for package-manager client application
4128 * @par Sync (or) Async : Synchronous API
4130 * @param[out] handle pointer to the application metadata info filter handle.
4131 * @return 0 if success, error code(<0) if fail
4132 * @retval PMINFO_R_OK success
4133 * @retval PMINFO_R_EINVAL invalid argument
4134 * @retval PMINFO_R_ERROR internal error
4136 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4137 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4139 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4142 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4143 printf("appid : %s\n", appid);
4147 static int get_app_list(const char *mkey, const char *mvalue)
4150 pkgmgrinfo_appinfo_metadata_filter_h handle;
4151 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4152 if (ret != PMINFO_R_OK)
4154 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4155 if (ret != PMINFO_R_OK) {
4156 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4159 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4160 if (ret != PMINFO_R_OK) {
4161 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4164 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4169 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4172 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4173 * @brief This API destroys the application's metadata information filter handle.
4175 * @par This API is for package-manager client application
4176 * @par Sync (or) Async : Synchronous API
4178 * @param[in] handle pointer to the application metadata info filter handle.
4179 * @return 0 if success, error code(<0) if fail
4180 * @retval PMINFO_R_OK success
4181 * @retval PMINFO_R_EINVAL invalid argument
4182 * @retval PMINFO_R_ERROR internal error
4183 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4185 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4187 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4190 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4191 printf("appid : %s\n", appid);
4195 static int get_app_list(const char *mkey, const char *mvalue)
4198 pkgmgrinfo_appinfo_metadata_filter_h handle;
4199 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4200 if (ret != PMINFO_R_OK)
4202 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4203 if (ret != PMINFO_R_OK) {
4204 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4207 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4208 if (ret != PMINFO_R_OK) {
4209 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4212 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4217 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4220 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4221 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4222 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4224 * @par This API is for package-manager client application
4225 * @par Sync (or) Async : Synchronous API
4227 * @param[in] handle pointer to the application metadata info filter handle.
4228 * @param[in] key pointer to metadata key
4229 * @param[in] value pointer to metadata value
4230 * @return 0 if success, error code(<0) if fail
4231 * @retval PMINFO_R_OK success
4232 * @retval PMINFO_R_EINVAL invalid argument
4233 * @retval PMINFO_R_ERROR internal error
4234 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4235 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4236 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4238 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4241 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4242 printf("appid : %s\n", appid);
4246 static int get_app_list(const char *mkey, const char *mvalue)
4249 pkgmgrinfo_appinfo_metadata_filter_h handle;
4250 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4251 if (ret != PMINFO_R_OK)
4253 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4254 if (ret != PMINFO_R_OK) {
4255 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4258 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4259 if (ret != PMINFO_R_OK) {
4260 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4263 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4268 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4269 const char *key, const char *value);
4272 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4273 * @fn int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid)
4274 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4275 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4276 * negative value, no more callbacks will be called and API will return.
4278 * @par This API is for package-manager client application
4279 * @par Sync (or) Async : Synchronous API
4281 * @param[in] handle pointer to the application metadata info filter handle.
4282 * @param[in] app_cb function pointer to callback
4283 * @param[in] user_data pointer to user data
4284 * @param[in] uid the addressee user id of the instruction
4285 * @return 0 if success, error code(<0) if fail
4286 * @retval PMINFO_R_OK success
4287 * @retval PMINFO_R_EINVAL invalid argument
4288 * @retval PMINFO_R_ERROR internal error
4289 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4290 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4292 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4295 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4296 printf("appid : %s\n", appid);
4300 static int get_app_list(const char *mkey, const char *mvalue)
4303 pkgmgrinfo_appinfo_metadata_filter_h handle;
4304 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4305 if (ret != PMINFO_R_OK)
4307 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4308 if (ret != PMINFO_R_OK) {
4309 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4312 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4313 if (ret != PMINFO_R_OK) {
4314 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4317 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4322 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4323 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4324 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4325 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4327 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4328 * @brief This API creates the package cert information handle to get data from db.
4330 * @par This API is for package-manager client application
4331 * @par Sync (or) Async : Synchronous API
4333 * @param[out] handle pointer to the package cert handle.
4334 * @return 0 if success, error code(<0) if fail
4335 * @retval PMINFO_R_OK success
4336 * @retval PMINFO_R_EINVAL invalid argument
4337 * @retval PMINFO_R_ERROR internal error
4339 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4340 * @see pkgmgrinfo_pkginfo_get_cert_value()
4341 * @see pkgmgrinfo_pkginfo_load_certinfo()
4343 static int get_cert_info(const char *pkgid)
4346 pkgmgrinfo_certinfo_h handle;
4347 char *auth_cert = NULL;
4348 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4349 if (ret != PMINFO_R_OK)
4351 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4352 if (ret != PMINFO_R_OK) {
4353 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4356 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4357 if (ret != PMINFO_R_OK) {
4358 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4361 printf("Author root certificate: %s\n", auth_root);
4362 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4367 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4370 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4371 * @brief This API loads the package cert information handle with data from db.
4373 * @par This API is for package-manager client application
4374 * @par Sync (or) Async : Synchronous API
4376 * @param[in] pkgid pointer to the package ID.
4377 * @param[in] handle pointer to the package cert handle.
4378 * @return 0 if success, error code(<0) if fail
4379 * @retval PMINFO_R_OK success
4380 * @retval PMINFO_R_EINVAL invalid argument
4381 * @retval PMINFO_R_ERROR internal error
4382 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4383 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4384 * @see pkgmgrinfo_pkginfo_get_cert_value()
4386 static int get_cert_info(const char *pkgid)
4389 pkgmgrinfo_certinfo_h handle;
4390 char *auth_cert = NULL;
4391 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4392 if (ret != PMINFO_R_OK)
4394 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4395 if (ret != PMINFO_R_OK) {
4396 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4399 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4400 if (ret != PMINFO_R_OK) {
4401 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4404 printf("Author root certificate: %s\n", auth_root);
4405 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4410 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4413 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4414 * @brief This API gets the package cert information from the handle
4416 * @par This API is for package-manager client application
4417 * @par Sync (or) Async : Synchronous API
4419 * @param[in] handle pointer to the package cert handle.
4420 * @param[in] cert_type certificate type
4421 * @param[out] cert_value pointer to hold certificate value
4422 * @return 0 if success, error code(<0) if fail
4423 * @retval PMINFO_R_OK success
4424 * @retval PMINFO_R_EINVAL invalid argument
4425 * @retval PMINFO_R_ERROR internal error
4426 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4427 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4428 * @see pkgmgrinfo_pkginfo_load_certinfo()
4430 static int get_cert_info(const char *pkgid)
4433 pkgmgrinfo_certinfo_h handle;
4434 char *auth_cert = NULL;
4435 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4436 if (ret != PMINFO_R_OK)
4438 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4439 if (ret != PMINFO_R_OK) {
4440 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4443 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4444 if (ret != PMINFO_R_OK) {
4445 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4448 printf("Author root certificate: %s\n", auth_root);
4449 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4454 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4457 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4458 * @brief This API destroys the package cert information handle freeing up all the resources
4460 * @par This API is for package-manager client application
4461 * @par Sync (or) Async : Synchronous API
4463 * @param[in] handle pointer to the package cert handle.
4464 * @return 0 if success, error code(<0) if fail
4465 * @retval PMINFO_R_OK success
4466 * @retval PMINFO_R_EINVAL invalid argument
4467 * @retval PMINFO_R_ERROR internal error
4468 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4470 * @see pkgmgrinfo_pkginfo_load_certinfo()
4472 static int get_cert_info(const char *pkgid)
4475 pkgmgrinfo_certinfo_h handle;
4476 char *auth_cert = NULL;
4477 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4478 if (ret != PMINFO_R_OK)
4480 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4481 if (ret != PMINFO_R_OK) {
4482 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4485 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4486 if (ret != PMINFO_R_OK) {
4487 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4490 printf("Author root certificate: %s\n", auth_root);
4491 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4496 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4499 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4500 * @brief This API deletes the package cert information from DB
4502 * @par This API is for package-manager client application
4503 * @par Sync (or) Async : Synchronous API
4505 * @param[in] pkgid pointer to the package ID.
4506 * @return 0 if success, error code(<0) if fail
4507 * @retval PMINFO_R_OK success
4508 * @retval PMINFO_R_EINVAL invalid argument
4509 * @retval PMINFO_R_ERROR internal error
4513 static int delete_cert_info(const char *pkgid)
4516 ret = pkgmgrinfo_delete_certinfo(pkgid);
4517 if (ret != PMINFO_R_OK)
4523 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4526 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4527 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4528 * @brief This API creates the package db information handle to set data in db.
4530 * @par This API is for package-manager client application
4531 * @par Sync (or) Async : Synchronous API
4533 * @param[in] pkgid pointer to the package ID.
4534 * @param[in] uid the addressee user id of the instruction
4535 * @param[out] handle pointer to the package db info handle.
4536 * @return 0 if success, error code(<0) if fail
4537 * @retval PMINFO_R_OK success
4538 * @retval PMINFO_R_EINVAL invalid argument
4539 * @retval PMINFO_R_ERROR internal error
4541 * @post pkgmgrinfo_destroy_pkgdbinfo()
4542 * @see pkgmgrinfo_save_pkgdbinfo()
4543 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4545 static int set_pkg_in_db(const char *pkgid)
4548 pkgmgrinfo_pkgdbinfo_h handle;
4549 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4550 if (ret != PMINFO_R_OK)
4552 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4553 if (ret != PMINFO_R_OK) {
4554 pkgmgrinfo_destroy_pkgdbinfo(handle);
4557 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4558 if (ret != PMINFO_R_OK) {
4559 pkgmgrinfo_destroy_pkgdbinfo(handle);
4562 pkgmgrinfo_destroy_pkgdbinfo(handle);
4567 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4568 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4571 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4572 * @brief This API sets the package type in db handle
4574 * @par This API is for package-manager client application
4575 * @par Sync (or) Async : Synchronous API
4577 * @param[in] handle pointer to the pkgdbinfo handle.
4578 * @param[in] type pointer to the package type.
4579 * @return 0 if success, error code(<0) if fail
4580 * @retval PMINFO_R_OK success
4581 * @retval PMINFO_R_EINVAL invalid argument
4582 * @retval PMINFO_R_ERROR internal error
4583 * @pre pkgmgrinfo_create_pkgdbinfo()
4584 * @post pkgmgrinfo_destroy_pkgdbinfo()
4585 * @see pkgmgrinfo_save_pkgdbinfo()
4586 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4588 static int set_pkg_type_in_db(const char *pkgid)
4591 pkgmgrinfo_pkgdbinfo_h handle;
4592 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4593 if (ret != PMINFO_R_OK)
4595 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4596 if (ret != PMINFO_R_OK) {
4597 pkgmgrinfo_destroy_pkgdbinfo(handle);
4600 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4601 if (ret != PMINFO_R_OK) {
4602 pkgmgrinfo_destroy_pkgdbinfo(handle);
4605 pkgmgrinfo_destroy_pkgdbinfo(handle);
4610 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4613 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4614 * @brief This API sets the package version in db handle
4616 * @par This API is for package-manager client application
4617 * @par Sync (or) Async : Synchronous API
4619 * @param[in] handle pointer to the pkgdbinfo handle.
4620 * @param[in] version pointer to the package version
4621 * @return 0 if success, error code(<0) if fail
4622 * @retval PMINFO_R_OK success
4623 * @retval PMINFO_R_EINVAL invalid argument
4624 * @retval PMINFO_R_ERROR internal error
4625 * @pre pkgmgrinfo_create_pkgdbinfo()
4626 * @post pkgmgrinfo_destroy_pkgdbinfo()
4627 * @see pkgmgrinfo_save_pkgdbinfo()
4628 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4630 static int set_pkg_version_in_db(const char *pkgid)
4633 pkgmgrinfo_pkgdbinfo_h handle;
4634 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4635 if (ret != PMINFO_R_OK)
4637 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4638 if (ret != PMINFO_R_OK) {
4639 pkgmgrinfo_destroy_pkgdbinfo(handle);
4642 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4643 if (ret != PMINFO_R_OK) {
4644 pkgmgrinfo_destroy_pkgdbinfo(handle);
4647 pkgmgrinfo_destroy_pkgdbinfo(handle);
4652 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4655 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4656 * @brief This API sets the package install location in db handle
4658 * @par This API is for package-manager client application
4659 * @par Sync (or) Async : Synchronous API
4661 * @param[in] handle pointer to the pkgdbinfo handle.
4662 * @param[in] location package install location
4663 * @return 0 if success, error code(<0) if fail
4664 * @retval PMINFO_R_OK success
4665 * @retval PMINFO_R_EINVAL invalid argument
4666 * @retval PMINFO_R_ERROR internal error
4667 * @pre pkgmgrinfo_create_pkgdbinfo()
4668 * @post pkgmgrinfo_destroy_pkgdbinfo()
4669 * @see pkgmgrinfo_save_pkgdbinfo()
4670 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4672 static int set_pkg_install_location_in_db(const char *pkgid)
4675 pkgmgrinfo_pkgdbinfo_h handle;
4676 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4677 if (ret != PMINFO_R_OK)
4679 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4680 if (ret != PMINFO_R_OK) {
4681 pkgmgrinfo_destroy_pkgdbinfo(handle);
4684 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4685 if (ret != PMINFO_R_OK) {
4686 pkgmgrinfo_destroy_pkgdbinfo(handle);
4689 pkgmgrinfo_destroy_pkgdbinfo(handle);
4694 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4697 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4698 * @brief This API sets the package size in db handle
4700 * @par This API is for package-manager client application
4701 * @par Sync (or) Async : Synchronous API
4703 * @param[in] handle pointer to the pkgdbinfo handle.
4704 * @param[in] size pointer to the package size
4705 * @return 0 if success, error code(<0) if fail
4706 * @retval PMINFO_R_OK success
4707 * @retval PMINFO_R_EINVAL invalid argument
4708 * @retval PMINFO_R_ERROR internal error
4709 * @pre pkgmgrinfo_create_pkgdbinfo()
4710 * @post pkgmgrinfo_destroy_pkgdbinfo()
4711 * @see pkgmgrinfo_save_pkgdbinfo()
4712 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4714 static int set_pkg_size_in_db(const char *pkgid)
4717 pkgmgrinfo_pkgdbinfo_h handle;
4718 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4719 if (ret != PMINFO_R_OK)
4721 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4722 if (ret != PMINFO_R_OK) {
4723 pkgmgrinfo_destroy_pkgdbinfo(handle);
4726 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4727 if (ret != PMINFO_R_OK) {
4728 pkgmgrinfo_destroy_pkgdbinfo(handle);
4731 pkgmgrinfo_destroy_pkgdbinfo(handle);
4736 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4739 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4740 * @brief This API sets the package label in db handle
4742 * @par This API is for package-manager client application
4743 * @par Sync (or) Async : Synchronous API
4745 * @param[in] handle pointer to the pkgdbinfo handle.
4746 * @param[in] label pointer to the package label
4747 * @param[in] locale pointer to the locale
4748 * @return 0 if success, error code(<0) if fail
4749 * @retval PMINFO_R_OK success
4750 * @retval PMINFO_R_EINVAL invalid argument
4751 * @retval PMINFO_R_ERROR internal error
4752 * @pre pkgmgrinfo_create_pkgdbinfo()
4753 * @post pkgmgrinfo_destroy_pkgdbinfo()
4754 * @see pkgmgrinfo_save_pkgdbinfo()
4755 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4757 static int set_pkg_label_in_db(const char *pkgid)
4760 pkgmgrinfo_pkgdbinfo_h handle;
4761 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4762 if (ret != PMINFO_R_OK)
4764 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4765 if (ret != PMINFO_R_OK) {
4766 pkgmgrinfo_destroy_pkgdbinfo(handle);
4769 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4770 if (ret != PMINFO_R_OK) {
4771 pkgmgrinfo_destroy_pkgdbinfo(handle);
4774 pkgmgrinfo_destroy_pkgdbinfo(handle);
4779 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4782 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4783 * @brief This API sets the package icon in db handle
4785 * @par This API is for package-manager client application
4786 * @par Sync (or) Async : Synchronous API
4788 * @param[in] handle pointer to the pkgdbinfo handle.
4789 * @param[in] icon pointer to the package icon
4790 * @param[in] locale pointer to the locale
4791 * @return 0 if success, error code(<0) if fail
4792 * @retval PMINFO_R_OK success
4793 * @retval PMINFO_R_EINVAL invalid argument
4794 * @retval PMINFO_R_ERROR internal error
4795 * @pre pkgmgrinfo_create_pkgdbinfo()
4796 * @post pkgmgrinfo_destroy_pkgdbinfo()
4797 * @see pkgmgrinfo_save_pkgdbinfo()
4798 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4800 static int set_pkg_icon_in_db(const char *pkgid)
4803 pkgmgrinfo_pkgdbinfo_h handle;
4804 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4805 if (ret != PMINFO_R_OK)
4807 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4808 if (ret != PMINFO_R_OK) {
4809 pkgmgrinfo_destroy_pkgdbinfo(handle);
4812 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4813 if (ret != PMINFO_R_OK) {
4814 pkgmgrinfo_destroy_pkgdbinfo(handle);
4817 pkgmgrinfo_destroy_pkgdbinfo(handle);
4822 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4825 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4826 * @brief This API sets the package description in db handle
4828 * @par This API is for package-manager client application
4829 * @par Sync (or) Async : Synchronous API
4831 * @param[in] handle pointer to the pkgdbinfo handle.
4832 * @param[in] description pointer to the package description
4833 * @param[in] locale pointer to the locale
4834 * @return 0 if success, error code(<0) if fail
4835 * @retval PMINFO_R_OK success
4836 * @retval PMINFO_R_EINVAL invalid argument
4837 * @retval PMINFO_R_ERROR internal error
4838 * @pre pkgmgrinfo_create_pkgdbinfo()
4839 * @post pkgmgrinfo_destroy_pkgdbinfo()
4840 * @see pkgmgrinfo_save_pkgdbinfo()
4841 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4843 static int set_pkg_description_in_db(const char *pkgid)
4846 pkgmgrinfo_pkgdbinfo_h handle;
4847 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4848 if (ret != PMINFO_R_OK)
4850 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4851 if (ret != PMINFO_R_OK) {
4852 pkgmgrinfo_destroy_pkgdbinfo(handle);
4855 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4856 if (ret != PMINFO_R_OK) {
4857 pkgmgrinfo_destroy_pkgdbinfo(handle);
4860 pkgmgrinfo_destroy_pkgdbinfo(handle);
4865 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4868 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4869 const char *author_email, const char *author_href, const char *locale)
4870 * @brief This API sets the package author info in db handle
4872 * @par This API is for package-manager client application
4873 * @par Sync (or) Async : Synchronous API
4875 * @param[in] handle pointer to the pkgdbinfo handle.
4876 * @param[in] author_name pointer to the package author name
4877 * @param[in] author_email pointer to the package author email
4878 * @param[in] author_href pointer to the package author href
4879 * @param[in] locale pointer to the locale
4880 * @return 0 if success, error code(<0) if fail
4881 * @retval PMINFO_R_OK success
4882 * @retval PMINFO_R_EINVAL invalid argument
4883 * @retval PMINFO_R_ERROR internal error
4884 * @pre pkgmgrinfo_create_pkgdbinfo()
4885 * @post pkgmgrinfo_destroy_pkgdbinfo()
4886 * @see pkgmgrinfo_save_pkgdbinfo()
4887 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4889 static int set_pkg_author_in_db(const char *pkgid)
4892 pkgmgrinfo_pkgdbinfo_h handle;
4893 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4894 if (ret != PMINFO_R_OK)
4896 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4897 if (ret != PMINFO_R_OK) {
4898 pkgmgrinfo_destroy_pkgdbinfo(handle);
4901 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4902 if (ret != PMINFO_R_OK) {
4903 pkgmgrinfo_destroy_pkgdbinfo(handle);
4906 pkgmgrinfo_destroy_pkgdbinfo(handle);
4911 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4912 const char *author_email, const char *author_href, const char *locale);
4915 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4916 * @brief This API sets the package 'removable' value in db handle
4918 * @par This API is for package-manager client application
4919 * @par Sync (or) Async : Synchronous API
4921 * @param[in] handle pointer to the pkgdbinfo handle.
4922 * @param[in] removable package removable value
4923 * @return 0 if success, error code(<0) if fail
4924 * @retval PMINFO_R_OK success
4925 * @retval PMINFO_R_EINVAL invalid argument
4926 * @retval PMINFO_R_ERROR internal error
4927 * @pre pkgmgrinfo_create_pkgdbinfo()
4928 * @post pkgmgrinfo_destroy_pkgdbinfo()
4929 * @see pkgmgrinfo_save_pkgdbinfo()
4930 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4932 static int set_pkg_removable_in_db(const char *pkgid)
4935 pkgmgrinfo_pkgdbinfo_h handle;
4936 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4937 if (ret != PMINFO_R_OK)
4939 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4940 if (ret != PMINFO_R_OK) {
4941 pkgmgrinfo_destroy_pkgdbinfo(handle);
4944 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4945 if (ret != PMINFO_R_OK) {
4946 pkgmgrinfo_destroy_pkgdbinfo(handle);
4949 pkgmgrinfo_destroy_pkgdbinfo(handle);
4954 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4957 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4958 * @brief This API sets the package 'preload' value in db handle
4960 * @par This API is for package-manager client application
4961 * @par Sync (or) Async : Synchronous API
4963 * @param[in] handle pointer to the pkgdbinfo handle.
4964 * @param[in] preload package preload value
4965 * @return 0 if success, error code(<0) if fail
4966 * @retval PMINFO_R_OK success
4967 * @retval PMINFO_R_EINVAL invalid argument
4968 * @retval PMINFO_R_ERROR internal error
4969 * @pre pkgmgrinfo_create_pkgdbinfo()
4970 * @post pkgmgrinfo_destroy_pkgdbinfo()
4971 * @see pkgmgrinfo_save_pkgdbinfo()
4972 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4974 static int set_pkg_preload_in_db(const char *pkgid)
4977 pkgmgrinfo_pkgdbinfo_h handle;
4978 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4979 if (ret != PMINFO_R_OK)
4981 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4982 if (ret != PMINFO_R_OK) {
4983 pkgmgrinfo_destroy_pkgdbinfo(handle);
4986 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4987 if (ret != PMINFO_R_OK) {
4988 pkgmgrinfo_destroy_pkgdbinfo(handle);
4991 pkgmgrinfo_destroy_pkgdbinfo(handle);
4996 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4999 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5000 * @brief This API sets the package 'installed_storage' value in db handle
5002 * @par This API is for package-manager client application
5003 * @par Sync (or) Async : Synchronous API
5005 * @param[in] handle pointer to the pkgdbinfo handle.
5006 * @param[in] location installed_storage value
5007 * @return 0 if success, error code(<0) if fail
5008 * @retval PMINFO_R_OK success
5009 * @retval PMINFO_R_EINVAL invalid argument
5010 * @retval PMINFO_R_ERROR internal error
5011 * @pre pkgmgrinfo_create_pkgdbinfo()
5012 * @post pkgmgrinfo_destroy_pkgdbinfo()
5013 * @see pkgmgrinfo_save_pkgdbinfo()
5015 static int set_pkg_installed_storage_in_db(const char *pkgid)
5018 pkgmgrinfo_pkgdbinfo_h handle;
5019 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5020 if (ret != PMINFO_R_OK)
5022 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5023 if (ret != PMINFO_R_OK) {
5024 pkgmgrinfo_destroy_pkgdbinfo(handle);
5027 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5028 if (ret != PMINFO_R_OK) {
5029 pkgmgrinfo_destroy_pkgdbinfo(handle);
5032 pkgmgrinfo_destroy_pkgdbinfo(handle);
5037 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5040 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5041 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5042 * @brief This API saves all the information from the handle to the DB.
5044 * @par This API is for package-manager client application
5045 * @par Sync (or) Async : Synchronous API
5047 * @param[in] handle pointer to the package db info handle.
5048 * @param[in] uid the addressee user id of the instruction
5049 * @return 0 if success, error code(<0) if fail
5050 * @retval PMINFO_R_OK success
5051 * @retval PMINFO_R_EINVAL invalid argument
5052 * @retval PMINFO_R_ERROR internal error
5053 * @pre pkgmgrinfo_create_pkgdbinfo()
5054 * @post pkgmgrinfo_destroy_pkgdbinfo()
5055 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5057 static int set_pkg_in_db(const char *pkgid)
5060 pkgmgrinfo_pkgdbinfo_h handle;
5061 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5062 if (ret != PMINFO_R_OK)
5064 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5065 if (ret != PMINFO_R_OK) {
5066 pkgmgrinfo_destroy_pkgdbinfo(handle);
5069 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5070 if (ret != PMINFO_R_OK) {
5071 pkgmgrinfo_destroy_pkgdbinfo(handle);
5074 pkgmgrinfo_destroy_pkgdbinfo(handle);
5079 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5080 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5082 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5083 * @brief This API destroys the package db information handle freeing up all the resources
5085 * @par This API is for package-manager client application
5086 * @par Sync (or) Async : Synchronous API
5088 * @param[in] handle pointer to the package db info handle.
5089 * @return 0 if success, error code(<0) if fail
5090 * @retval PMINFO_R_OK success
5091 * @retval PMINFO_R_EINVAL invalid argument
5092 * @retval PMINFO_R_ERROR internal error
5093 * @pre pkgmgrinfo_create_pkgdbinfo()
5095 * @see pkgmgrinfo_save_pkgdbinfo()
5096 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5098 static int set_pkg_in_db(const char *pkgid)
5101 pkgmgrinfo_pkgdbinfo_h handle;
5102 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5103 if (ret != PMINFO_R_OK)
5105 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5106 if (ret != PMINFO_R_OK) {
5107 pkgmgrinfo_destroy_pkgdbinfo(handle);
5110 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5111 if (ret != PMINFO_R_OK) {
5112 pkgmgrinfo_destroy_pkgdbinfo(handle);
5115 pkgmgrinfo_destroy_pkgdbinfo(handle);
5120 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5124 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5125 * @brief This API creates the package cert information handle to set data in db.
5127 * @par This API is for package-manager client application
5128 * @par Sync (or) Async : Synchronous API
5130 * @param[out] handle pointer to the package cert handle.
5131 * @return 0 if success, error code(<0) if fail
5132 * @retval PMINFO_R_OK success
5133 * @retval PMINFO_R_EINVAL invalid argument
5134 * @retval PMINFO_R_ERROR internal error
5136 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5137 * @see pkgmgrinfo_set_cert_value()
5138 * @see pkgmgrinfo_save_certinfo()
5140 static int set_cert_in_db(const char *pkgid)
5143 pkgmgrinfo_instcertinfo_h handle;
5144 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5145 if (ret != PMINFO_R_OK)
5147 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5148 if (ret != PMINFO_R_OK) {
5149 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5152 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5153 if (ret != PMINFO_R_OK) {
5154 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5157 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5162 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5165 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5166 * @brief This API sets the package cert information in the handle.
5168 * @par This API is for package-manager client application
5169 * @par Sync (or) Async : Synchronous API
5171 * @param[in] handle pointer to the package cert handle.
5172 * @param[in] cert_type certificate type.
5173 * @param[in] cert_value certificate value.
5174 * @return 0 if success, error code(<0) if fail
5175 * @retval PMINFO_R_OK success
5176 * @retval PMINFO_R_EINVAL invalid argument
5177 * @retval PMINFO_R_ERROR internal error
5178 * @pre pkgmgrinfo_create_certinfo_set_handle()
5179 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5180 * @see pkgmgrinfo_save_certinfo()
5182 static int set_cert_in_db(const char *pkgid)
5185 pkgmgrinfo_instcertinfo_h handle;
5186 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5187 if (ret != PMINFO_R_OK)
5189 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5190 if (ret != PMINFO_R_OK) {
5191 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5194 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5195 if (ret != PMINFO_R_OK) {
5196 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5199 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5204 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5207 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5208 * @brief This API saves the package cert information in the DB.
5210 * @par This API is for package-manager client application
5211 * @par Sync (or) Async : Synchronous API
5213 * @param[in] pkgid pointer to the package ID.
5214 * @param[in] handle pointer to the package cert handle.
5215 * @return 0 if success, error code(<0) if fail
5216 * @retval PMINFO_R_OK success
5217 * @retval PMINFO_R_EINVAL invalid argument
5218 * @retval PMINFO_R_ERROR internal error
5219 * @pre pkgmgrinfo_create_certinfo_set_handle()
5220 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5221 * @see pkgmgrinfo_save_certinfo()
5223 static int set_cert_in_db(const char *pkgid)
5226 pkgmgrinfo_instcertinfo_h handle;
5227 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5228 if (ret != PMINFO_R_OK)
5230 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5231 if (ret != PMINFO_R_OK) {
5232 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5235 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5236 if (ret != PMINFO_R_OK) {
5237 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5240 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5245 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5248 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5249 * @brief This API destroys the package cert information handle freeing up all the resources.
5251 * @par This API is for package-manager client application
5252 * @par Sync (or) Async : Synchronous API
5254 * @param[in] handle pointer to the package cert handle.
5255 * @return 0 if success, error code(<0) if fail
5256 * @retval PMINFO_R_OK success
5257 * @retval PMINFO_R_EINVAL invalid argument
5258 * @retval PMINFO_R_ERROR internal error
5259 * @pre pkgmgrinfo_create_certinfo_set_handle()
5261 * @see pkgmgrinfo_save_certinfo()
5263 static int set_cert_in_db(const char *pkgid)
5266 pkgmgrinfo_instcertinfo_h handle;
5267 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5268 if (ret != PMINFO_R_OK)
5270 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5271 if (ret != PMINFO_R_OK) {
5272 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5275 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5276 if (ret != PMINFO_R_OK) {
5277 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5280 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5285 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5288 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5289 * @brief This API gets the datacontrol info
5291 * @par This API is for package-manager client application
5292 * @par Sync (or) Async : Synchronous API
5294 * @param[in] providerid pointer to the providerid of dataconltrol.
5295 * @param[in] type pointer to the type of dataconltrol.
5296 * @param[out] appid pointer to hold appid, need to free after using
5297 * @param[out] access pointer to hold access, need to free after using
5298 * @return 0 if success, error code(<0) if fail
5299 * @retval PMINFO_R_OK success
5300 * @retval PMINFO_R_EINVAL invalid argument
5301 * @retval PMINFO_R_ERROR internal error
5304 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5307 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5308 * @brief This API gets the application 'guest mode visibility' value from the DB
5310 * @par This API is for package-manager client application
5311 * @par Sync (or) Async : Synchronous API
5313 * @param[in] handle pointer to application info handle
5314 * @param[out] status pointer to hold app guest mode visibility value
5315 * @return 0 if success, error code(<0) if fail
5316 * @retval PMINFO_R_OK success
5317 * @retval PMINFO_R_EINVAL invalid argument
5318 * @retval PMINFO_R_ERROR internal error
5319 * @pre pkgmgrinfo_appinfo_get_appinfo()
5320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5321 * @see pkgmgrinfo_appinfo_get_appid()
5322 * @see pkgmgrinfo_appinfo_is_multiple()
5324 static int get_app_guestmode_visibility(const char *appid)
5328 pkgmgrinfo_appinfo_h handle;
5329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5330 if (ret != PMINFO_R_OK)
5332 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5333 if (ret != PMINFO_R_OK) {
5334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5337 printf("app guest mode visibility: %d\n", status);
5338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5343 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5346 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5347 * @brief This API sets the application 'guest mode visibility' value in the DB
5349 * @par This API is for package-manager client application
5350 * @par Sync (or) Async : Synchronous API
5352 * @param[in] handle pointer to application info handle
5353 * @param[out] status app guest mode visibility value
5354 * @return 0 if success, error code(<0) if fail
5355 * @retval PMINFO_R_OK success
5356 * @retval PMINFO_R_EINVAL invalid argument
5357 * @retval PMINFO_R_ERROR internal error
5358 * @pre pkgmgrinfo_appinfo_get_appinfo()
5359 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5360 * @see pkgmgrinfo_appinfo_get_appid()
5361 * @see pkgmgrinfo_appinfo_is_multiple()
5363 static int set_app_guestmode_visibility(const char *appid, bool value)
5366 pkgmgrinfo_appinfo_h handle;
5367 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5368 if (ret != PMINFO_R_OK)
5370 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5371 if (ret != PMINFO_R_OK) {
5372 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5380 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5381 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5383 * @pkgmgrinfo client API
5387 * @brief listening status type in pkgmgrinfo.
5389 #define PMINFO_CLIENT_STATUS_ALL 0x00
5390 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5391 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5392 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5393 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5394 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5395 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5398 * @brief type definition.
5400 typedef void pkgmgrinfo_client;
5401 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5402 const char *pkgid, const char *key,
5403 const char *val, const void *pmsg, void *data);
5409 }pkgmgrinfo_client_type;
5412 * @brief This APIs provides pkgmgrinfo client listener
5414 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5415 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5416 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5417 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5418 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5421 * @pkgmgrinfo client API end
5429 #endif /* __PKG_INFO_H__ */