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>
76 * @brief A type to retrieve uid information from the manifest handle
80 } pkgmgrinfo_uidinfo_t;
83 * @brief A handle to insert certificate information
85 typedef void* pkgmgrinfo_instcertinfo_h;
88 * @brief Certificate Types to be used for setting information
91 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
92 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
93 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
94 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
95 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
96 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
97 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
98 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
99 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
100 }pkgmgrinfo_instcert_type;
103 PMINFO_CERT_COMPARE_MATCH,
104 PMINFO_CERT_COMPARE_MISMATCH,
105 PMINFO_CERT_COMPARE_LHS_NO_CERT,
106 PMINFO_CERT_COMPARE_RHS_NO_CERT,
107 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
108 PMINFO_CERT_COMPARE_ERROR,
109 } pkgmgrinfo_cert_compare_result_type_e;
112 * @brief API return values
115 PMINFO_R_EINVAL = -2, /**< Invalid argument */
116 PMINFO_R_ERROR = -1, /**< General error */
117 PMINFO_R_OK = 0 /**< General success */
121 * @brief Value to be used when filtering based on install location
123 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
126 * @brief Value to be used when filtering based on install location
128 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
131 * @brief Value to be used when filtering based on install location
133 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
136 * @brief Value to be used when filtering based on app-component
138 #define PMINFO_APPINFO_UI_APP "UI_APP"
141 * @brief Value to be used when filtering based on app-component
143 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
146 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
147 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
148 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
149 }pkgmgrinfo_app_hwacceleration;
152 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
153 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
154 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
155 }pkgmgrinfo_app_screenreader;
158 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
159 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
160 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
161 }pkgmgrinfo_app_recentimage;
164 * @brief A handle to get package information
166 typedef void* pkgmgrinfo_pkginfo_h;
169 * @brief A handle to get application information
171 typedef void* pkgmgrinfo_appinfo_h;
174 * @brief A handle to get certificate information
176 typedef void* pkgmgrinfo_certinfo_h;
179 * @brief A handle to insert package information
181 typedef void* pkgmgrinfo_pkgdbinfo_h;
184 * @brief A handle to filter package information
186 typedef void* pkgmgrinfo_pkginfo_filter_h;
189 * @brief A handle to filter application information
191 typedef void* pkgmgrinfo_appinfo_filter_h;
194 * @brief A handle to filter application metadata information
196 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
199 * @brief A handle to get appcontrol information
201 typedef void* pkgmgrinfo_appcontrol_h;
204 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
206 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
208 * @param[in] handle the pkginfo handle
209 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
211 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
213 * @see pkgmgrinfo_pkginfo_get_list()
214 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
216 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
220 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
222 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
224 * @param[in] handle the appinfo handle
225 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
227 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
229 * @see pkgmgrinfo_appinfo_get_list()
230 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
231 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
233 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
237 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
239 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
241 * @param[in] category_name the name of the category
242 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
244 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
246 * @see pkgmgrinfo_appinfo_foreach_category()
248 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
252 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
254 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
256 * @param[in] permission_name the name of the permission
257 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
259 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
261 * @see pkgmgrinfo_appinfo_foreach_category()
263 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
267 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
269 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
271 * @param[in] privilege_name the name of the privilege
272 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
274 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
276 * @see pkgmgrinfo_pkginfo_foreach_privilege()
278 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
282 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
284 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
286 * @param[in] metadata_name the name of the metadata
287 * @param[in] metadata_value the value of the metadata
288 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
290 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
292 * @see pkgmgrinfo_appinfo_foreach_metadata()
294 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
295 const char *metadata_value, void *user_data);
298 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
300 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
302 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
303 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
305 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
307 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
309 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
313 * @brief Install Location Types
316 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
317 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
318 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
319 }pkgmgrinfo_install_location;
322 * @brief Application Component Types
325 PMINFO_ALL_APP = 0, /**< All Application*/
326 PMINFO_UI_APP, /**< UI Application*/
327 PMINFO_SVC_APP, /**< Service Application*/
328 }pkgmgrinfo_app_component;
331 * @brief Application Storage Types
334 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
335 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
336 }pkgmgrinfo_installed_storage;
339 * @brief Certificate Types to be used for getting information
342 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
343 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
344 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
345 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
346 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
347 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
348 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
349 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
350 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
351 }pkgmgrinfo_cert_type;
354 * @brief Install Location Types to be used when setting data in DB
357 INSTALL_INTERNAL = 0, /**< Internal Installation*/
358 INSTALL_EXTERNAL, /**< External Installation*/
362 * @brief permission Types
365 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
366 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
367 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
368 }pkgmgrinfo_permission_type;
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
381 /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
383 /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
385 /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
388 /** Boolean property for filtering based on package info*/
389 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
394 /** Boolean property for filtering based on package info*/
395 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
396 /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
398 /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
401 /** Integer property for filtering based on package info*/
402 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
420 /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
422 /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
424 /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
427 /** Boolean property for filtering based on app info*/
428 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
433 /** Boolean property for filtering based on app info*/
434 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
435 /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
437 /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
440 /** will be updated*/
441 /** string property for filtering based on pkg info*/
442 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
444 /* For multiuser support */
445 char *getUserPkgParserDBPath(void);
446 char *getUserPkgParserDBPathUID(uid_t uid);
447 char *getUserPkgCertDBPath(void);
448 char *getUserPkgCertDBPathUID(uid_t uid);
449 const char* getUserDesktopPath(uid_t uid);
450 const char* getUserManifestPath(uid_t uid);
453 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
454 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
455 * @brief This API gets list of installed packages
457 * @par This API is for package-manager client application
458 * @par Sync (or) Async : Synchronous API
459 * @param[in] pkg_list_cb iteration function for list
460 * @param[in] user_data user data to be passed to callback function
461 * @param[in] uid the addressee user id of the instruction
462 * @return 0 if success, error code(<0) if fail
463 * @retval PMINFO_R_OK success
464 * @retval PMINFO_R_EINVAL invalid argument
465 * @retval PMINFO_R_ERROR internal error
469 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
473 pkgid1 = (char *)user_data;
474 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
475 if (strcmp(pkgid1, pkgid2) == 0) {
482 static int list_pkgs()
485 char *name = "helloworld";
486 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
487 if (ret != PMINFO_R_OK) {
494 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
495 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
497 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
498 * @brief This API creates the package information handle from db
500 * @par This API is for package-manager client application
501 * @par Sync (or) Async : Synchronous API
503 * @param[in] pkgid pointer to package ID
504 * @param[in] uid the addressee user id of the instruction
505 * @param[out] handle pointer to the package info handle.
506 * @return 0 if success, error code(<0) if fail
507 * @retval PMINFO_R_OK success
508 * @retval PMINFO_R_EINVAL invalid argument
509 * @retval PMINFO_R_ERROR internal error
511 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
512 * @see pkgmgrinfo_pkginfo_get_pkgid()
513 * @see pkgmgrinfo_pkginfo_is_removable()
515 static int get_pkg_type(const char *pkgid)
519 pkgmgrinfo_pkginfo_h handle;
520 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
521 if (ret != PMINFO_R_OK)
523 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
524 if (ret != PMINFO_R_OK) {
525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
528 printf("pkgtype: %s\n", type);
529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
534 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
535 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
538 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
539 * @brief This API gets the package name from the package ID
541 * @par This API is for package-manager client application
542 * @par Sync (or) Async : Synchronous API
544 * @param[in] handle pointer to package info handle
545 * @param[out] pkg_name pointer to hold package name
546 * @return 0 if success, error code(<0) if fail
547 * @retval PMINFO_R_OK success
548 * @retval PMINFO_R_EINVAL invalid argument
549 * @retval PMINFO_R_ERROR internal error
550 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
551 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
552 * @see pkgmgrinfo_pkginfo_get_type()
553 * @see pkgmgrinfo_pkginfo_is_removable()
555 static int get_pkg_name(const char *pkgid)
558 char *pkgname = NULL;
559 pkgmgrinfo_pkginfo_h handle;
560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
561 if (ret != PMINFO_R_OK)
563 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
564 if (ret != PMINFO_R_OK) {
565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
568 printf("pkgname: %s\n", pkgname);
569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
574 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
577 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
578 * @brief This API gets the package id from the package ID
580 * @par This API is for package-manager client application
581 * @par Sync (or) Async : Synchronous API
583 * @param[in] handle pointer to package info handle
584 * @param[out] pkgid pointer to hold package id
585 * @return 0 if success, error code(<0) if fail
586 * @retval PMINFO_R_OK success
587 * @retval PMINFO_R_EINVAL invalid argument
588 * @retval PMINFO_R_ERROR internal error
589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
591 * @see pkgmgrinfo_pkginfo_get_type()
592 * @see pkgmgrinfo_pkginfo_is_removable()
594 static int get_pkgid(const char *pkgid)
598 pkgmgrinfo_pkginfo_h handle;
599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
600 if (ret != PMINFO_R_OK)
602 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
603 if (ret != PMINFO_R_OK) {
604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
607 printf("pkg id: %s\n", pkg_id);
608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
616 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
617 * @brief This API gets the package type from the package ID
619 * @par This API is for package-manager client application
620 * @par Sync (or) Async : Synchronous API
622 * @param[in] handle pointer to package info handle
623 * @param[out] type pointer to hold package type
624 * @return 0 if success, error code(<0) if fail
625 * @retval PMINFO_R_OK success
626 * @retval PMINFO_R_EINVAL invalid argument
627 * @retval PMINFO_R_ERROR internal error
628 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
629 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
630 * @see pkgmgrinfo_pkginfo_get_pkgid()
631 * @see pkgmgrinfo_pkginfo_is_removable()
633 static int get_pkg_type(const char *pkgid)
637 pkgmgrinfo_pkginfo_h handle;
638 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
639 if (ret != PMINFO_R_OK)
641 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
642 if (ret != PMINFO_R_OK) {
643 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
646 printf("pkgtype: %s\n", type);
647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
652 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
655 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
656 * @brief This API gets the package version from the package ID
658 * @par This API is for package-manager client application
659 * @par Sync (or) Async : Synchronous API
661 * @param[in] handle pointer to package info handle
662 * @param[out] version pointer to hold package version
663 * @return 0 if success, error code(<0) if fail
664 * @retval PMINFO_R_OK success
665 * @retval PMINFO_R_EINVAL invalid argument
666 * @retval PMINFO_R_ERROR internal error
667 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
668 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
669 * @see pkgmgrinfo_pkginfo_get_pkgid()
670 * @see pkgmgrinfo_pkginfo_is_removable()
672 static int get_pkg_version(const char *pkgid)
675 char *version = NULL;
676 pkgmgrinfo_pkginfo_h handle;
677 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
678 if (ret != PMINFO_R_OK)
680 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
681 if (ret != PMINFO_R_OK) {
682 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
685 printf("pkg version: %s\n", version);
686 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
691 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
694 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
695 * @brief This API gets the package install location from the package ID
697 * @par This API is for package-manager client application
698 * @par Sync (or) Async : Synchronous API
700 * @param[in] handle pointer to package info handle
701 * @param[out] location pointer to hold package install location
702 * @return 0 if success, error code(<0) if fail
703 * @retval PMINFO_R_OK success
704 * @retval PMINFO_R_EINVAL invalid argument
705 * @retval PMINFO_R_ERROR internal error
706 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
707 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
708 * @see pkgmgrinfo_pkginfo_get_pkgid()
709 * @see pkgmgrinfo_pkginfo_is_removable()
711 static int get_pkg_install_location(const char *pkgid)
714 pkgmgrinfo_install_location location;
715 pkgmgrinfo_pkginfo_h handle;
716 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
717 if (ret != PMINFO_R_OK)
719 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
720 if (ret != PMINFO_R_OK) {
721 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
724 printf("pkg install location: %d\n", location);
725 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
730 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
733 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
734 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
735 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
736 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
738 * @par This API is for package-manager client application
739 * @par Sync (or) Async : Synchronous API
741 * @param[in] handle pointer to package info handle
742 * @param[out] size pointer to hold package size
743 * @return 0 if success, error code(<0) if fail
744 * @retval PMINFO_R_OK success
745 * @retval PMINFO_R_EINVAL invalid argument
746 * @retval PMINFO_R_ERROR internal error
747 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
748 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
749 * @see pkgmgrinfo_pkginfo_get_pkgid()
750 * @see pkgmgrinfo_pkginfo_is_removable()
752 static int get_pkg_size(const char *pkgid)
756 pkgmgrinfo_pkginfo_h handle;
757 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
758 if (ret != PMINFO_R_OK)
760 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
761 if (ret != PMINFO_R_OK) {
762 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
765 printf("pkgsize: %d\n", size);
766 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
771 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
774 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
775 * @brief This API gets the installed package total size on the target.
777 * @par This API is for package-manager client application
778 * @par Sync (or) Async : Synchronous API
780 * @param[in] handle pointer to package info handle
781 * @param[out] size pointer to hold package total size
782 * @return 0 if success, error code(<0) if fail
783 * @retval PMINFO_R_OK success
784 * @retval PMINFO_R_EINVAL invalid argument
785 * @retval PMINFO_R_ERROR internal error
787 static int get_pkg_total_size(const char *pkgid)
791 pkgmgrinfo_pkginfo_h handle;
792 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
793 if (ret != PMINFO_R_OK)
795 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
796 if (ret != PMINFO_R_OK) {
797 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
800 printf("pkg total size: %d\n", size);
801 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
806 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
809 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
810 * @brief This API gets the installed package data size on the target.
812 * @par This API is for package-manager client application
813 * @par Sync (or) Async : Synchronous API
815 * @param[in] handle pointer to package info handle
816 * @param[out] size pointer to hold package data size
817 * @return 0 if success, error code(<0) if fail
818 * @retval PMINFO_R_OK success
819 * @retval PMINFO_R_EINVAL invalid argument
820 * @retval PMINFO_R_ERROR internal error
822 static int get_pkg_data_size(const char *pkgid)
826 pkgmgrinfo_pkginfo_h handle;
827 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
828 if (ret != PMINFO_R_OK)
830 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
831 if (ret != PMINFO_R_OK) {
832 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
835 printf("pkg data size: %d\n", size);
836 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
841 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
844 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
845 * @brief This API gets the package icon from the package ID
847 * @par This API is for package-manager client application
848 * @par Sync (or) Async : Synchronous API
850 * @param[in] handle pointer to package info handle
851 * @param[out] icon pointer to hold package icon
852 * @return 0 if success, error code(<0) if fail
853 * @retval PMINFO_R_OK success
854 * @retval PMINFO_R_EINVAL invalid argument
855 * @retval PMINFO_R_ERROR internal error
856 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
857 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
858 * @see pkgmgrinfo_pkginfo_get_pkgid()
859 * @see pkgmgrinfo_pkginfo_is_removable()
861 static int get_pkg_icon(const char *pkgid)
865 pkgmgrinfo_pkginfo_h handle;
866 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
867 if (ret != PMINFO_R_OK)
869 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
870 if (ret != PMINFO_R_OK) {
871 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
874 printf("pkg icon: %s\n", icon);
875 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
880 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
883 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
884 * @brief This API gets the package description from the package ID
886 * @par This API is for package-manager client application
887 * @par Sync (or) Async : Synchronous API
889 * @param[in] handle pointer to package info handle
890 * @param[out] description pointer to hold package description
891 * @return 0 if success, error code(<0) if fail
892 * @retval PMINFO_R_OK success
893 * @retval PMINFO_R_EINVAL invalid argument
894 * @retval PMINFO_R_ERROR internal error
895 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
896 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
897 * @see pkgmgrinfo_pkginfo_get_pkgid()
898 * @see pkgmgrinfo_pkginfo_is_removable()
900 static int get_pkg_description(const char *pkgid)
903 char *description = NULL;
904 pkgmgrinfo_pkginfo_h handle;
905 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
906 if (ret != PMINFO_R_OK)
908 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
909 if (ret != PMINFO_R_OK) {
910 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
913 printf("pkg description: %s\n", description);
914 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
919 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
922 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
923 * @brief This API gets the package's author name from the package ID
925 * @par This API is for package-manager client application
926 * @par Sync (or) Async : Synchronous API
928 * @param[in] handle pointer to package info handle
929 * @param[out] author_name pointer to hold package author name
930 * @return 0 if success, error code(<0) if fail
931 * @retval PMINFO_R_OK success
932 * @retval PMINFO_R_EINVAL invalid argument
933 * @retval PMINFO_R_ERROR internal error
934 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
935 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
936 * @see pkgmgrinfo_pkginfo_get_pkgid()
937 * @see pkgmgrinfo_pkginfo_is_removable()
939 static int get_pkg_author_name(const char *pkgid)
942 char *author_name = NULL;
943 pkgmgrinfo_pkginfo_h handle;
944 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
945 if (ret != PMINFO_R_OK)
947 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
948 if (ret != PMINFO_R_OK) {
949 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
952 printf("pkg author name: %s\n", author_name);
953 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
958 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
961 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
962 * @brief This API gets the package's author email from the package ID
964 * @par This API is for package-manager client application
965 * @par Sync (or) Async : Synchronous API
967 * @param[in] handle pointer to package info handle
968 * @param[out] author_email pointer to hold package author email
969 * @return 0 if success, error code(<0) if fail
970 * @retval PMINFO_R_OK success
971 * @retval PMINFO_R_EINVAL invalid argument
972 * @retval PMINFO_R_ERROR internal error
973 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
974 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
975 * @see pkgmgrinfo_pkginfo_get_pkgid()
976 * @see pkgmgrinfo_pkginfo_is_removable()
978 static int get_pkg_author_email(const char *pkgid)
981 char *author_email = NULL;
982 pkgmgrinfo_pkginfo_h handle;
983 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
984 if (ret != PMINFO_R_OK)
986 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
987 if (ret != PMINFO_R_OK) {
988 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
991 printf("pkg author email: %s\n", author_email);
992 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
997 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1000 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1001 * @brief This API gets the package's author href from the package ID
1003 * @par This API is for package-manager client application
1004 * @par Sync (or) Async : Synchronous API
1006 * @param[in] handle pointer to package info handle
1007 * @param[out] author_href pointer to hold package author href
1008 * @return 0 if success, error code(<0) if fail
1009 * @retval PMINFO_R_OK success
1010 * @retval PMINFO_R_EINVAL invalid argument
1011 * @retval PMINFO_R_ERROR internal error
1012 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1013 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1014 * @see pkgmgrinfo_pkginfo_get_pkgid()
1015 * @see pkgmgrinfo_pkginfo_is_removable()
1017 static int get_pkg_author_href(const char *pkgid)
1020 char *author_href = NULL;
1021 pkgmgrinfo_pkginfo_h handle;
1022 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1023 if (ret != PMINFO_R_OK)
1025 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1026 if (ret != PMINFO_R_OK) {
1027 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1030 printf("pkg author href: %s\n", author_href);
1031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1036 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1039 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1040 * @brief This API gets the package installed storagae value from the package ID
1042 * @par This API is for package-manager client application
1043 * @par Sync (or) Async : Synchronous API
1045 * @param[in] handle pointer to package info handle
1046 * @param[out] storage pointer to hold package installed storage
1047 * @return 0 if success, error code(<0) if fail
1048 * @retval PMINFO_R_OK success
1049 * @retval PMINFO_R_EINVAL invalid argument
1050 * @retval PMINFO_R_ERROR internal error
1051 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1052 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1053 * @see pkgmgrinfo_pkginfo_get_pkgid()
1054 * @see pkgmgrinfo_pkginfo_is_removable()
1056 static int get_pkg_installed_storage(const char *pkgid)
1059 pkgmgrinfo_installed_storage storage;
1060 pkgmgrinfo_pkginfo_h handle;
1061 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1062 if (ret != PMINFO_R_OK)
1064 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1065 if (ret != PMINFO_R_OK) {
1066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1069 printf("pkg installed storage: %d\n", storage);
1070 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1075 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1078 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1079 * @brief This API gets the installed time of package from the package ID
1081 * @par This API is for package-manager client application
1082 * @par Sync (or) Async : Synchronous API
1084 * @param[in] handle pointer to package info handle
1085 * @param[out] installed_time pointer to hold installed time of package
1086 * @return 0 if success, error code(<0) if fail
1087 * @retval PMINFO_R_OK success
1088 * @retval PMINFO_R_EINVAL invalid argument
1089 * @retval PMINFO_R_ERROR internal error
1090 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1091 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1092 * @see pkgmgrinfo_pkginfo_get_pkgid()
1093 * @see pkgmgrinfo_pkginfo_is_removable()
1095 static int get_pkg_installed_time(const char *pkgid)
1098 int installed_time = 0;
1099 pkgmgrinfo_pkginfo_h handle;
1100 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1101 if (ret != PMINFO_R_OK)
1103 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1104 if (ret != PMINFO_R_OK) {
1105 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1108 printf("installed_time: %d\n", installed_time);
1109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1114 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1117 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1118 * @brief This API gets the store client id of package from the package ID
1120 * @par This API is for package-manager client application
1121 * @par Sync (or) Async : Synchronous API
1123 * @param[in] handle pointer to package info handle
1124 * @param[out] storeclientid pointer to hold store client id of package
1125 * @return 0 if success, error code(<0) if fail
1126 * @retval PMINFO_R_OK success
1127 * @retval PMINFO_R_EINVAL invalid argument
1128 * @retval PMINFO_R_ERROR internal error
1129 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1130 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1131 * @see pkgmgrinfo_pkginfo_get_pkgid()
1132 * @see pkgmgrinfo_pkginfo_is_removable()
1134 static int get_pkg_storeclientid(const char *pkgid)
1137 char *storeclientid = 0;
1138 pkgmgrinfo_pkginfo_h handle;
1139 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1140 if (ret != PMINFO_R_OK)
1142 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1143 if (ret != PMINFO_R_OK) {
1144 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1147 printf(store client id: %s\n", storeclientid);
1148 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1153 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1156 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1157 * @brief This API gets the main app id of package from the package ID
1159 * @par This API is for package-manager client application
1160 * @par Sync (or) Async : Synchronous API
1162 * @param[in] handle pointer to package info handle
1163 * @param[out] mainappid pointer to hold main app id of package
1164 * @return 0 if success, error code(<0) if fail
1165 * @retval PMINFO_R_OK success
1166 * @retval PMINFO_R_EINVAL invalid argument
1167 * @retval PMINFO_R_ERROR internal error
1168 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1169 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1170 * @see pkgmgrinfo_pkginfo_get_pkgid()
1171 * @see pkgmgrinfo_pkginfo_is_removable()
1173 static int get_pkg_mainappid(const char *pkgid)
1176 char *mainappid = 0;
1177 pkgmgrinfo_pkginfo_h handle;
1178 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1179 if (ret != PMINFO_R_OK)
1181 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1182 if (ret != PMINFO_R_OK) {
1183 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1186 printf(main app id: %s\n", mainappid);
1187 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1192 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1195 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1196 * @brief This API gets the url of package from the package ID
1198 * @par This API is for package-manager client application
1199 * @par Sync (or) Async : Synchronous API
1201 * @param[in] handle pointer to package info handle
1202 * @param[out] url pointer to hold url of package
1203 * @return 0 if success, error code(<0) if fail
1204 * @retval PMINFO_R_OK success
1205 * @retval PMINFO_R_EINVAL invalid argument
1206 * @retval PMINFO_R_ERROR internal error
1207 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1208 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1209 * @see pkgmgrinfo_pkginfo_get_pkgid()
1210 * @see pkgmgrinfo_pkginfo_is_removable()
1212 static int get_pkg_url(const char *pkgid)
1216 pkgmgrinfo_pkginfo_h handle;
1217 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1218 if (ret != PMINFO_R_OK)
1220 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1221 if (ret != PMINFO_R_OK) {
1222 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1225 printf("url : %s\n", url);
1226 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1231 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1235 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1236 * @brief This API gets the root path of package
1238 * @par Sync (or) Async : Synchronous API
1240 * @param[in] handle pointer to package info handle
1241 * @param[out] path pointer to hold root path of package
1242 * @return 0 if success, error code(<0) if fail
1243 * @retval PMINFO_R_OK success
1244 * @retval PMINFO_R_EINVAL invalid argument
1245 * @retval PMINFO_R_ERROR internal error
1247 static int get_root_path(const char *pkgid)
1251 pkgmgrinfo_pkginfo_h handle;
1252 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1253 if (ret != PMINFO_R_OK)
1256 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1257 if (ret != PMINFO_R_OK) {
1258 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1261 printf("path : %s\n", path);
1262 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1268 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1272 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1273 * @brief This API gets the csc path of package
1275 * @par Sync (or) Async : Synchronous API
1277 * @param[in] handle pointer to package info handle
1278 * @param[out] path pointer to hold csc path of package
1279 * @return 0 if success, error code(<0) if fail
1280 * @retval PMINFO_R_OK success
1281 * @retval PMINFO_R_EINVAL invalid argument
1282 * @retval PMINFO_R_ERROR internal error
1284 static int get_csc_path(const char *pkgid)
1288 pkgmgrinfo_pkginfo_h handle;
1289 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1290 if (ret != PMINFO_R_OK)
1293 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1294 if (ret != PMINFO_R_OK) {
1295 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1298 printf("path : %s\n", path);
1299 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1305 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1308 * @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)
1309 * @brief This API compare the cert information from given package id
1311 * @par This API is for package-manager client application
1312 * @par Sync (or) Async : Synchronous API
1314 * @param[in] lhs_package_id pointer to first package ID
1315 * @param[in] rhs_package_id pointer to second package ID
1316 * @param[out] compare_result pointer to the compare result.
1317 * @return 0 if success, error code(<0) if fail
1318 * @retval PMINFO_R_OK success
1319 * @retval PMINFO_R_EINVAL invalid argument
1320 * @retval PMINFO_R_ERROR internal error
1322 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1323 * @see pkgmgrinfo_pkginfo_get_pkgid()
1324 * @see pkgmgrinfo_pkginfo_is_removable()
1326 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1329 pkgmgrinfo_cert_compare_result_type_e result;
1331 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1332 if (ret != PMINFO_R_OK) {
1335 printf("result: %d\n", result);
1340 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);
1341 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);
1343 * @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)
1344 * @brief This API compare the cert information from given app id
1346 * @par This API is for package-manager client application
1347 * @par Sync (or) Async : Synchronous API
1349 * @param[in] lhs_app_id pointer to first app ID
1350 * @param[in] rhs_app_id pointer to second app ID
1351 * @param[out] compare_result pointer to the compare result.
1352 * @return 0 if success, error code(<0) if fail
1353 * @retval PMINFO_R_OK success
1354 * @retval PMINFO_R_EINVAL invalid argument
1355 * @retval PMINFO_R_ERROR internal error
1357 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1358 * @see pkgmgrinfo_pkginfo_get_pkgid()
1359 * @see pkgmgrinfo_pkginfo_is_removable()
1361 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1364 pkgmgrinfo_cert_compare_result_type_e result;
1366 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1367 if (ret != PMINFO_R_OK) {
1370 printf("result: %d\n", result);
1375 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);
1376 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);
1378 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1379 * @brief This API gets the package 'removable' value from the package ID
1381 * @par This API is for package-manager client application
1382 * @par Sync (or) Async : Synchronous API
1384 * @param[in] handle pointer to package info handle
1385 * @param[out] removable pointer to hold package removable value
1386 * @return 0 if success, error code(<0) if fail
1387 * @retval PMINFO_R_OK success
1388 * @retval PMINFO_R_EINVAL invalid argument
1389 * @retval PMINFO_R_ERROR internal error
1390 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1391 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1392 * @see pkgmgrinfo_pkginfo_get_pkgid()
1393 * @see pkgmgrinfo_pkginfo_is_readonly()
1395 static int get_pkg_removable(const char *pkgid)
1399 pkgmgrinfo_pkginfo_h handle;
1400 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1401 if (ret != PMINFO_R_OK)
1403 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1404 if (ret != PMINFO_R_OK) {
1405 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1408 printf("pkg removable: %d\n", removable);
1409 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1414 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1417 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1418 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1420 * @par This API is for package-manager client application
1421 * @par Sync (or) Async : Synchronous API
1423 * @param[in] handle pointer to package info handle
1424 * @param[out] movable pointer to hold package movable state
1425 * @return 0 if success, error code(<0) if fail
1426 * @retval PMINFO_R_OK success
1427 * @retval PMINFO_R_EINVAL invalid argument
1428 * @retval PMINFO_R_ERROR internal error
1429 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1430 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1431 * @see pkgmgrinfo_pkginfo_get_pkgid()
1433 static int get_pkg_movable(const char *pkgid)
1437 pkgmgrinfo_pkginfo_h handle;
1438 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1439 if (ret != PMINFO_R_OK)
1441 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1442 if (ret != PMINFO_R_OK) {
1443 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 printf("pkg movable: %d\n", movable);
1447 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1452 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1455 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1456 * @brief This API gets the package 'preload' value from the package ID
1458 * @par This API is for package-manager client application
1459 * @par Sync (or) Async : Synchronous API
1461 * @param[in] handle pointer to package info handle
1462 * @param[out] preload pointer to hold package preload value
1463 * @return 0 if success, error code(<0) if fail
1464 * @retval PMINFO_R_OK success
1465 * @retval PMINFO_R_EINVAL invalid argument
1466 * @retval PMINFO_R_ERROR internal error
1467 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1468 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1469 * @see pkgmgrinfo_pkginfo_get_pkgid()
1470 * @see pkgmgrinfo_pkginfo_is_readonly()
1472 static int get_pkg_preload(const char *pkgid)
1476 pkgmgrinfo_pkginfo_h handle;
1477 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1478 if (ret != PMINFO_R_OK)
1480 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1481 if (ret != PMINFO_R_OK) {
1482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1485 printf("pkg preload: %d\n", preload);
1486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1494 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1495 * @brief This API gets the value for given handle is system or not
1497 * @par This API is for package-manager client application
1498 * @par Sync (or) Async : Synchronous API
1500 * @param[in] handle pointer to package info handle
1501 * @param[out] system pointer to hold system is or not
1502 * @return 0 if success, error code(<0) if fail
1503 * @retval PMINFO_R_OK success
1504 * @retval PMINFO_R_EINVAL invalid argument
1505 * @retval PMINFO_R_ERROR internal error
1506 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1507 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1508 * @see pkgmgrinfo_pkginfo_get_pkgid()
1509 * @see pkgmgrinfo_pkginfo_is_readonly()
1511 static int get_pkg_system(const char *pkgid)
1514 bool system = false;
1515 pkgmgrinfo_pkginfo_h handle = NULL;
1516 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1517 if (ret != PMINFO_R_OK)
1519 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1520 if (ret != PMINFO_R_OK) {
1521 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1524 printf("pkg system: %d\n", system);
1525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1530 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1533 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1534 * @brief This API gets the package 'readonly' value from the package ID
1536 * @par This API is for package-manager client application
1537 * @par Sync (or) Async : Synchronous API
1539 * @param[in] handle pointer to package info handle
1540 * @param[out] readonly pointer to hold package readonly value
1541 * @return 0 if success, error code(<0) if fail
1542 * @retval PMINFO_R_OK success
1543 * @retval PMINFO_R_EINVAL invalid argument
1544 * @retval PMINFO_R_ERROR internal error
1545 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1546 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1547 * @see pkgmgrinfo_pkginfo_get_pkgid()
1548 * @see pkgmgrinfo_pkginfo_is_removable()
1550 static int get_pkg_readonly(const char *pkgid)
1554 pkgmgrinfo_pkginfo_h handle;
1555 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1556 if (ret != PMINFO_R_OK)
1558 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1559 if (ret != PMINFO_R_OK) {
1560 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1563 printf("pkg readonly: %d\n", readonly);
1564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1569 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1573 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1574 * @brief This API gets the package 'upate' value from the package ID
1576 * @par This API is for package-manager client application
1577 * @par Sync (or) Async : Synchronous API
1579 * @param[in] handle pointer to package info handle
1580 * @param[out] update pointer to hold package update value
1581 * @return 0 if success, error code(<0) if fail
1582 * @retval PMINFO_R_OK success
1583 * @retval PMINFO_R_EINVAL invalid argument
1584 * @retval PMINFO_R_ERROR internal error
1585 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1586 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1587 * @see pkgmgrinfo_pkginfo_get_pkgid()
1589 static int get_pkg_update(const char *pkgid)
1593 pkgmgrinfo_pkginfo_h handle;
1594 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1595 if (ret != PMINFO_R_OK)
1597 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1598 if (ret != PMINFO_R_OK) {
1599 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1602 printf("pkg update: %d\n", update);
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1608 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1612 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1613 * @brief This API gets the package 'uid' value from the view table of user database
1615 * @par This API is for package-manager client application
1616 * @par Sync (or) Async : Synchronous API
1618 * @param[in] uid uid of the user to determine the database
1619 * @param[in] pkgid id of the current package
1620 * @return 1 if it a global package, 0 else
1623 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1627 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1628 * @brief This API gets the package 'accessible' value from the package ID
1630 * @par This API is for package-manager client application
1631 * @par Sync (or) Async : Synchronous API
1633 * @param[in] handle pointer to package info handle
1634 * @param[out] accessible pointer to hold package accessible value
1635 * @return 0 if success, error code(<0) if fail
1636 * @retval PMINFO_R_OK success
1637 * @retval PMINFO_R_EINVAL invalid argument
1638 * @retval PMINFO_R_ERROR internal error
1639 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1640 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1641 * @see pkgmgrinfo_pkginfo_get_pkgid()
1642 * @see pkgmgrinfo_pkginfo_is_readonly()
1644 static int get_pkg_accessible(const char *pkgid)
1648 pkgmgrinfo_pkginfo_h handle;
1649 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1650 if (ret != PMINFO_R_OK)
1652 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1653 if (ret != PMINFO_R_OK) {
1654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1657 printf("pkg accessible: %d\n", accessible);
1658 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1663 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1666 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1667 * @brief This API destroys the package information handle freeing up all the resources
1669 * @par This API is for package-manager client application
1670 * @par Sync (or) Async : Synchronous API
1672 * @param[in] handle pointer to the package info handle
1673 * @return 0 if success, error code(<0) if fail
1674 * @retval PMINFO_R_OK success
1675 * @retval PMINFO_R_EINVAL invalid argument
1676 * @retval PMINFO_R_ERROR internal error
1677 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1679 * @see pkgmgrinfo_pkginfo_get_pkgid()
1680 * @see pkgmgrinfo_pkginfo_is_removable()
1682 static int get_pkg_type(const char *pkgid)
1686 pkgmgrinfo_pkginfo_h handle;
1687 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1688 if (ret != PMINFO_R_OK)
1690 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1691 if (ret != PMINFO_R_OK) {
1692 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1695 printf("pkgtype: %s\n", type);
1696 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1701 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1704 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1705 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1706 The query will search the entire package information collected from the manifest file of all the installed packages
1708 * @par This API is for package-manager client application
1709 * @par Sync (or) Async : Synchronous API
1711 * @param[out] handle pointer to the package info filter handle.
1712 * @return 0 if success, error code(<0) if fail
1713 * @retval PMINFO_R_OK success
1714 * @retval PMINFO_R_EINVAL invalid argument
1715 * @retval PMINFO_R_ERROR internal error
1717 * @post pkgmgrinfo_pkginfo_filter_destroy()
1718 * @see pkgmgrinfo_pkginfo_filter_count()
1719 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1721 static int get_rpm_pkg_count()
1725 pkgmgrinfo_pkginfo_filter_h handle;
1726 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1727 if (ret != PMINFO_R_OK)
1729 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1730 if (ret != PMINFO_R_OK) {
1731 pkgmgrinfo_pkginfo_filter_destroy(handle);
1734 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1735 if (ret != PMINFO_R_OK) {
1736 pkgmgrinfo_pkginfo_filter_destroy(handle);
1739 printf("No of rpm pkgs: %d\n", count);
1740 pkgmgrinfo_pkginfo_filter_destroy(handle);
1745 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1748 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1749 * @brief This API destroys the package information filter handle freeing up all the resources
1751 * @par This API is for package-manager client application
1752 * @par Sync (or) Async : Synchronous API
1754 * @param[in] handle pointer to the package info filter handle.
1755 * @return 0 if success, error code(<0) if fail
1756 * @retval PMINFO_R_OK success
1757 * @retval PMINFO_R_EINVAL invalid argument
1758 * @retval PMINFO_R_ERROR internal error
1759 * @pre pkgmgrinfo_pkginfo_filter_create()
1761 * @see pkgmgrinfo_pkginfo_filter_count()
1762 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1764 static int get_rpm_pkg_count()
1768 pkgmgrinfo_pkginfo_filter_h handle;
1769 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1770 if (ret != PMINFO_R_OK)
1772 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1773 if (ret != PMINFO_R_OK) {
1774 pkgmgrinfo_pkginfo_filter_destroy(handle);
1777 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1778 if (ret != PMINFO_R_OK) {
1779 pkgmgrinfo_pkginfo_filter_destroy(handle);
1782 printf("No of rpm pkgs: %d\n", count);
1783 pkgmgrinfo_pkginfo_filter_destroy(handle);
1788 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1791 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1792 * @brief This API adds a boolean filter property to the filter handle
1794 * @par This API is for package-manager client application
1795 * @par Sync (or) Async : Synchronous API
1797 * @param[in] handle pointer to the package info filter handle.
1798 * @param[in] property boolean property name.
1799 * @param[in] value value corresponding to the property.
1800 * @return 0 if success, error code(<0) if fail
1801 * @retval PMINFO_R_OK success
1802 * @retval PMINFO_R_EINVAL invalid argument
1803 * @retval PMINFO_R_ERROR internal error
1804 * @pre pkgmgrinfo_pkginfo_filter_create()
1805 * @post pkgmgrinfo_pkginfo_filter_destroy()
1806 * @see pkgmgrinfo_pkginfo_filter_count()
1807 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1809 static int get_preload_pkg_count()
1813 pkgmgrinfo_pkginfo_filter_h handle;
1814 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1815 if (ret != PMINFO_R_OK)
1817 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1818 if (ret != PMINFO_R_OK) {
1819 pkgmgrinfo_pkginfo_filter_destroy(handle);
1822 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1823 if (ret != PMINFO_R_OK) {
1824 pkgmgrinfo_pkginfo_filter_destroy(handle);
1827 printf("No of preload pkgs: %d\n", count);
1828 pkgmgrinfo_pkginfo_filter_destroy(handle);
1833 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1834 const char *property, const bool value);
1837 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1838 * @brief This API adds an integer filter property to the filter handle
1840 * @par This API is for package-manager client application
1841 * @par Sync (or) Async : Synchronous API
1843 * @param[in] handle pointer to the package info filter handle.
1844 * @param[in] property integer property name.
1845 * @param[in] value value corresponding to the property.
1846 * @return 0 if success, error code(<0) if fail
1847 * @retval PMINFO_R_OK success
1848 * @retval PMINFO_R_EINVAL invalid argument
1849 * @retval PMINFO_R_ERROR internal error
1850 * @pre pkgmgrinfo_pkginfo_filter_create()
1851 * @post pkgmgrinfo_pkginfo_filter_destroy()
1852 * @see pkgmgrinfo_pkginfo_filter_count()
1853 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1855 static int get_pkg_count()
1859 pkgmgrinfo_pkginfo_filter_h handle;
1860 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1861 if (ret != PMINFO_R_OK)
1863 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1864 if (ret != PMINFO_R_OK) {
1865 pkgmgrinfo_pkginfo_filter_destroy(handle);
1868 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1869 if (ret != PMINFO_R_OK) {
1870 pkgmgrinfo_pkginfo_filter_destroy(handle);
1873 printf("No of preload pkgs: %d\n", count);
1874 pkgmgrinfo_pkginfo_filter_destroy(handle);
1879 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1880 const char *property, const int value);
1883 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1884 * @brief This API adds a string filter property to the filter handle
1886 * @par This API is for package-manager client application
1887 * @par Sync (or) Async : Synchronous API
1889 * @param[in] handle pointer to the package info filter handle.
1890 * @param[in] property string property name.
1891 * @param[in] value value corresponding to the property.
1892 * @return 0 if success, error code(<0) if fail
1893 * @retval PMINFO_R_OK success
1894 * @retval PMINFO_R_EINVAL invalid argument
1895 * @retval PMINFO_R_ERROR internal error
1896 * @pre pkgmgrinfo_pkginfo_filter_create()
1897 * @post pkgmgrinfo_pkginfo_filter_destroy()
1898 * @see pkgmgrinfo_pkginfo_filter_count()
1899 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1901 static int get_rpm_pkg_count()
1905 pkgmgrinfo_pkginfo_filter_h handle;
1906 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1907 if (ret != PMINFO_R_OK)
1909 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1910 if (ret != PMINFO_R_OK) {
1911 pkgmgrinfo_pkginfo_filter_destroy(handle);
1914 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1915 if (ret != PMINFO_R_OK) {
1916 pkgmgrinfo_pkginfo_filter_destroy(handle);
1919 printf("No of rpm pkgs: %d\n", count);
1920 pkgmgrinfo_pkginfo_filter_destroy(handle);
1925 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1926 const char *property, const char *value);
1929 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1930 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1932 * @par This API is for package-manager client application
1933 * @par Sync (or) Async : Synchronous API
1935 * @param[in] handle pointer to the package info filter handle.
1936 * @param[in] pkg_cb callback function.
1937 * @param[in] user_data user data to be passed to the callback function
1938 * @return 0 if success, error code(<0) if fail
1939 * @retval PMINFO_R_OK success
1940 * @retval PMINFO_R_EINVAL invalid argument
1941 * @retval PMINFO_R_ERROR internal error
1942 * @pre pkgmgrinfo_pkginfo_filter_create()
1943 * @post pkgmgrinfo_pkginfo_filter_destroy()
1944 * @see pkgmgrinfo_pkginfo_filter_count()
1946 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1949 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1950 printf("pkg id : %s\n", pkgid);
1954 static int get_rpm_pkg_list()
1957 pkgmgrinfo_pkginfo_filter_h handle;
1958 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1959 if (ret != PMINFO_R_OK)
1961 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1962 if (ret != PMINFO_R_OK) {
1963 pkgmgrinfo_pkginfo_filter_destroy(handle);
1966 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1967 if (ret != PMINFO_R_OK) {
1968 pkgmgrinfo_pkginfo_filter_destroy(handle);
1971 pkgmgrinfo_pkginfo_filter_destroy(handle);
1976 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1977 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1978 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1979 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1982 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1983 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1984 * @brief This API counts the package that satisfy the filter conditions
1986 * @par This API is for package-manager client application
1987 * @par Sync (or) Async : Synchronous API
1989 * @param[in] handle pointer to the package info filter handle.
1990 * @param[in] count pointer to store the count value.
1991 * @param[in] uid the addressee user id of the instruction
1992 * @return 0 if success, error code(<0) if fail
1993 * @retval PMINFO_R_OK success
1994 * @retval PMINFO_R_EINVAL invalid argument
1995 * @retval PMINFO_R_ERROR internal error
1996 * @pre pkgmgrinfo_pkginfo_filter_create()
1997 * @post pkgmgrinfo_pkginfo_filter_destroy()
1998 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2000 static int get_rpm_pkg_count()
2004 pkgmgrinfo_pkginfo_filter_h handle;
2005 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2006 if (ret != PMINFO_R_OK)
2008 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2009 if (ret != PMINFO_R_OK) {
2010 pkgmgrinfo_pkginfo_filter_destroy(handle);
2013 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2014 if (ret != PMINFO_R_OK) {
2015 pkgmgrinfo_pkginfo_filter_destroy(handle);
2018 printf("No of rpm pkgs: %d\n", count);
2019 pkgmgrinfo_pkginfo_filter_destroy(handle);
2024 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2025 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2027 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2028 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2029 * @brief This API gets the list of privilege for a particular package
2031 * @par This API is for package-manager client application
2032 * @par Sync (or) Async : Synchronous API
2033 * @param[in] handle pointer to the package info handle.
2034 * @param[in] privilege_func callback function for list
2035 * @param[in] user_data user data to be passed to callback function
2036 * @return 0 if success, error code(<0) if fail
2037 * @retval PMINFO_R_OK success
2038 * @retval PMINFO_R_EINVAL invalid argument
2039 * @retval PMINFO_R_ERROR internal error
2040 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2041 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2043 int privilege_func(const char *name, void *user_data)
2045 if (strcmp(name, (char *)user_data) == 0)
2051 static int list_privilege(const char *package, char *privilege)
2054 pkgmgrinfo_pkginfo_h handle;
2055 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2056 if (ret != PMINFO_R_OK)
2058 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2059 if (ret != PMINFO_R_OK) {
2060 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2063 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2068 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2069 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2072 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2073 pkgmgrinfo_app_list_cb app_func, void *user_data)
2074 * @brief This API gets list of installed applications for a particular package
2076 * @par This API is for package-manager client application
2077 * @par Sync (or) Async : Synchronous API
2078 * @param[in] handle package info handle
2079 * @param[in] component application component
2080 * @param[in] app_func iteration function for list
2081 * @param[in] user_data user data to be passed to callback function
2082 * @return 0 if success, error code(<0) if fail
2083 * @retval PMINFO_R_OK success
2084 * @retval PMINFO_R_EINVAL invalid argument
2085 * @retval PMINFO_R_ERROR internal error
2086 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2087 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2089 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2092 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2093 printf("appid : %s\n", appid);
2097 static int list_apps(const char *pkgid)
2100 pkgmgrinfo_pkginfo_h handle;
2101 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2102 if (ret != PMINFO_R_OK)
2104 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2105 if (ret != PMINFO_R_OK) {
2106 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2114 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2115 pkgmgrinfo_app_list_cb app_func, void *user_data);
2116 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2117 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2119 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2120 * @brief This API gets list of installed applications from all packages with minimum informaion.
2122 * @par This API is for package-manager client application
2123 * @par Sync (or) Async : Synchronous API
2124 * @param[in] app_func iteration function for list
2125 * @param[in] user_data user data to be passed to callback function
2126 * @return 0 if success, error code(<0) if fail
2127 * @retval PMINFO_R_OK success
2128 * @retval PMINFO_R_EINVAL invalid argument
2129 * @retval PMINFO_R_ERROR internal error
2133 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2135 char *pkgid1 = NULL;
2136 char *pkgid2 = NULL;
2137 pkgid1 = (char *)user_data;
2138 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2139 if (strcmp(pkgid1, pkgid2) == 0) {
2146 static int list_apps()
2149 char *name = "helloworld";
2150 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2151 if (ret != PMINFO_R_OK) {
2158 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2159 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2161 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2162 * @brief This API gets list of installed applications from all packages.
2164 * @par This API is for package-manager client application
2165 * @par Sync (or) Async : Synchronous API
2166 * @param[in] app_func iteration function for list
2167 * @param[in] user_data user data to be passed to callback function
2168 * @return 0 if success, error code(<0) if fail
2169 * @retval PMINFO_R_OK success
2170 * @retval PMINFO_R_EINVAL invalid argument
2171 * @retval PMINFO_R_ERROR internal error
2175 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2177 char *pkgid1 = NULL;
2178 char *pkgid2 = NULL;
2179 pkgid1 = (char *)user_data;
2180 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2181 if (strcmp(pkgid1, pkgid2) == 0) {
2188 static int list_apps()
2191 char *name = "helloworld";
2192 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2193 if (ret != PMINFO_R_OK) {
2200 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2201 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2204 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2205 * @brief This API creates the application information handle from db
2207 * @par This API is for package-manager client application
2208 * @par Sync (or) Async : Synchronous API
2210 * @param[in] appid pointer to appid
2211 * @param[out] handle pointer to the application info handle.
2212 * @return 0 if success, error code(<0) if fail
2213 * @retval PMINFO_R_OK success
2214 * @retval PMINFO_R_EINVAL invalid argument
2215 * @retval PMINFO_R_ERROR internal error
2217 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2218 * @see pkgmgrinfo_appinfo_get_pkgid()
2219 * @see pkgmgrinfo_appinfo_is_multiple()
2221 static int get_app_type(const char *appid)
2225 pkgmgrinfo_appinfo_h handle;
2226 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2227 if (ret != PMINFO_R_OK)
2229 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2230 if (ret != PMINFO_R_OK) {
2231 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2234 printf("apptype: %s\n", type);
2235 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2240 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2241 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2243 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2244 * @brief This API gets the application ID
2246 * @par This API is for package-manager client application
2247 * @par Sync (or) Async : Synchronous API
2249 * @param[in] handle pointer to the application info handle.
2250 * @param[out] appid pointer to hold appid
2251 * @return 0 if success, error code(<0) if fail
2252 * @retval PMINFO_R_OK success
2253 * @retval PMINFO_R_EINVAL invalid argument
2254 * @retval PMINFO_R_ERROR internal error
2255 * @pre pkgmgrinfo_appinfo_get_appinfo()
2256 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2257 * @see pkgmgrinfo_appinfo_get_pkgid()
2258 * @see pkgmgrinfo_appinfo_is_multiple()
2260 static int get_app_id(const char *appid)
2263 char *app_id = NULL;
2264 pkgmgrinfo_appinfo_h handle;
2265 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2266 if (ret != PMINFO_R_OK)
2268 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2269 if (ret != PMINFO_R_OK) {
2270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2273 printf("app id: %s\n", app_id);
2274 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2279 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2282 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2283 * @brief This API gets the package name of the application
2285 * @par This API is for package-manager client application
2286 * @par Sync (or) Async : Synchronous API
2288 * @param[in] handle pointer to the application info handle.
2289 * @param[out] pkg_name pointer to hold package name
2290 * @return 0 if success, error code(<0) if fail
2291 * @retval PMINFO_R_OK success
2292 * @retval PMINFO_R_EINVAL invalid argument
2293 * @retval PMINFO_R_ERROR internal error
2294 * @pre pkgmgrinfo_appinfo_get_appinfo()
2295 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2296 * @see pkgmgrinfo_appinfo_get_appid()
2297 * @see pkgmgrinfo_appinfo_is_multiple()
2299 static int get_app_pkgname(const char *appid)
2302 char *pkgname = NULL;
2303 pkgmgrinfo_appinfo_h handle;
2304 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2305 if (ret != PMINFO_R_OK)
2307 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2308 if (ret != PMINFO_R_OK) {
2309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2312 printf("pkg name: %s\n", pkgname);
2313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2318 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2321 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2322 * @brief This API gets the package id of the application
2324 * @par This API is for package-manager client application
2325 * @par Sync (or) Async : Synchronous API
2327 * @param[in] handle pointer to the application info handle.
2328 * @param[out] pkgid pointer to hold package id
2329 * @return 0 if success, error code(<0) if fail
2330 * @retval PMINFO_R_OK success
2331 * @retval PMINFO_R_EINVAL invalid argument
2332 * @retval PMINFO_R_ERROR internal error
2333 * @pre pkgmgrinfo_appinfo_get_appinfo()
2334 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2335 * @see pkgmgrinfo_appinfo_get_appid()
2336 * @see pkgmgrinfo_appinfo_is_multiple()
2338 static int get_app_pkgid(const char *appid)
2342 pkgmgrinfo_appinfo_h handle;
2343 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2344 if (ret != PMINFO_R_OK)
2346 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2347 if (ret != PMINFO_R_OK) {
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2351 printf("pkg id: %s\n", pkgid);
2352 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2357 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2360 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2361 * @brief This API gets the executable name of the application
2363 * @par This API is for package-manager client application
2364 * @par Sync (or) Async : Synchronous API
2366 * @param[in] handle pointer to the application info handle.
2367 * @param[out] exec pointer to hold app exec name
2368 * @return 0 if success, error code(<0) if fail
2369 * @retval PMINFO_R_OK success
2370 * @retval PMINFO_R_EINVAL invalid argument
2371 * @retval PMINFO_R_ERROR internal error
2372 * @pre pkgmgrinfo_appinfo_get_appinfo()
2373 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2374 * @see pkgmgrinfo_appinfo_get_appid()
2375 * @see pkgmgrinfo_appinfo_is_multiple()
2377 static int get_app_exec(const char *appid)
2381 pkgmgrinfo_appinfo_h handle;
2382 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2383 if (ret != PMINFO_R_OK)
2385 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 printf("exec name: %s\n", exec);
2391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2396 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2399 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2400 * @brief This API gets the icon name of the application
2402 * @par This API is for package-manager client application
2403 * @par Sync (or) Async : Synchronous API
2405 * @param[in] handle pointer to the application info handle.
2406 * @param[out] icon pointer to hold app icon name
2407 * @return 0 if success, error code(<0) if fail
2408 * @retval PMINFO_R_OK success
2409 * @retval PMINFO_R_EINVAL invalid argument
2410 * @retval PMINFO_R_ERROR internal error
2411 * @pre pkgmgrinfo_appinfo_get_appinfo()
2412 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2413 * @see pkgmgrinfo_appinfo_get_appid()
2414 * @see pkgmgrinfo_appinfo_is_multiple()
2416 static int get_app_icon(const char *appid)
2420 pkgmgrinfo_appinfo_h handle;
2421 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2422 if (ret != PMINFO_R_OK)
2424 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2425 if (ret != PMINFO_R_OK) {
2426 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2429 printf("icon name: %s\n", icon);
2430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2435 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2438 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2439 * @brief This API gets the label of the application
2441 * @par This API is for package-manager client application
2442 * @par Sync (or) Async : Synchronous API
2444 * @param[in] handle pointer to the application info handle.
2445 * @param[out] label pointer to hold app label
2446 * @return 0 if success, error code(<0) if fail
2447 * @retval PMINFO_R_OK success
2448 * @retval PMINFO_R_EINVAL invalid argument
2449 * @retval PMINFO_R_ERROR internal error
2450 * @pre pkgmgrinfo_appinfo_get_appinfo()
2451 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2452 * @see pkgmgrinfo_appinfo_get_appid()
2453 * @see pkgmgrinfo_appinfo_is_multiple()
2455 static int get_app_label(const char *appid)
2459 pkgmgrinfo_appinfo_h handle;
2460 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2461 if (ret != PMINFO_R_OK)
2463 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2464 if (ret != PMINFO_R_OK) {
2465 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2468 printf("label : %s\n", label);
2469 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2474 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2477 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2478 * @brief This API gets the component of the application
2480 * @par This API is for package-manager client application
2481 * @par Sync (or) Async : Synchronous API
2483 * @param[in] handle pointer to the application info handle.
2484 * @param[out] component pointer to hold app component
2485 * @return 0 if success, error code(<0) if fail
2486 * @retval PMINFO_R_OK success
2487 * @retval PMINFO_R_EINVAL invalid argument
2488 * @retval PMINFO_R_ERROR internal error
2489 * @pre pkgmgrinfo_appinfo_get_appinfo()
2490 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2491 * @see pkgmgrinfo_appinfo_get_appid()
2492 * @see pkgmgrinfo_appinfo_is_multiple()
2494 static int get_app_component(const char *appid)
2497 pkgmgrinfo_app_component component;
2498 pkgmgrinfo_appinfo_h handle;
2499 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2500 if (ret != PMINFO_R_OK)
2502 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2503 if (ret != PMINFO_R_OK) {
2504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2507 printf("component : %s\n", component);
2508 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2513 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2516 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2517 * @brief This API gets the apptype of the application
2519 * @par This API is for package-manager client application
2520 * @par Sync (or) Async : Synchronous API
2522 * @param[in] handle pointer to the application info handle.
2523 * @param[out] app_type pointer to hold apptype
2524 * @return 0 if success, error code(<0) if fail
2525 * @retval PMINFO_R_OK success
2526 * @retval PMINFO_R_EINVAL invalid argument
2527 * @retval PMINFO_R_ERROR internal error
2528 * @pre pkgmgrinfo_appinfo_get_appinfo()
2529 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2530 * @see pkgmgrinfo_appinfo_get_appid()
2531 * @see pkgmgrinfo_appinfo_is_multiple()
2533 static int get_app_type(const char *appid)
2536 char *apptype = NULL;
2537 pkgmgrinfo_appinfo_h handle;
2538 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2539 if (ret != PMINFO_R_OK)
2541 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2542 if (ret != PMINFO_R_OK) {
2543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2546 printf("apptype : %s\n", apptype);
2547 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2552 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2555 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2556 int *operation_count, char ***operation)
2557 * @brief This API gets the list of operation of the application
2559 * @par This API is for package-manager client application
2560 * @par Sync (or) Async : Synchronous API
2562 * @param[in] handle pointer to the appcontrol handle.
2563 * @param[out] operation_count pointer to hold number of operations
2564 * @param[out] operation pointer to hold list of operations
2565 * @return 0 if success, error code(<0) if fail
2566 * @retval PMINFO_R_OK success
2567 * @retval PMINFO_R_EINVAL invalid argument
2568 * @retval PMINFO_R_ERROR internal error
2569 * @pre pkgmgrinfo_appinfo_get_appinfo()
2570 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2571 * @see pkgmgrinfo_appinfo_get_uri()
2572 * @see pkgmgrinfo_appinfo_get_mime()
2574 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2579 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2580 for (i = 0; i < oc; i++) {
2581 if (strcmp(operation[i], (char *)user_data) == 0)
2588 static int check_operation(const char *appid, char *operation)
2591 pkgmgrinfo_appinfo_h handle;
2592 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2593 if (ret != PMINFO_R_OK)
2595 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2596 if (ret != PMINFO_R_OK) {
2597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2606 int *operation_count, char ***operation);
2609 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2610 int *uri_count, char ***uri)
2611 * @brief This API gets the list of uri of the application
2613 * @par This API is for package-manager client application
2614 * @par Sync (or) Async : Synchronous API
2616 * @param[in] handle pointer to the appcontrol handle.
2617 * @param[out] uri_count pointer to hold number of uris
2618 * @param[out] uri pointer to hold list of uris
2619 * @return 0 if success, error code(<0) if fail
2620 * @retval PMINFO_R_OK success
2621 * @retval PMINFO_R_EINVAL invalid argument
2622 * @retval PMINFO_R_ERROR internal error
2623 * @pre pkgmgrinfo_appinfo_get_appinfo()
2624 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2625 * @see pkgmgrinfo_appinfo_get_operation()
2626 * @see pkgmgrinfo_appinfo_get_mime()
2628 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2633 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2634 for (i = 0; i < uc; i++) {
2635 if (strcmp(uri[i], (char *)user_data) == 0)
2642 static int check_uri(const char *appid, char *uri)
2645 pkgmgrinfo_appinfo_h handle;
2646 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2647 if (ret != PMINFO_R_OK)
2649 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2650 if (ret != PMINFO_R_OK) {
2651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2654 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2659 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2660 int *uri_count, char ***uri);
2663 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2664 int *mime_count, char ***mime)
2665 * @brief This API gets the list of mime of the application
2667 * @par This API is for package-manager client application
2668 * @par Sync (or) Async : Synchronous API
2670 * @param[in] handle pointer to the appcontrol handle.
2671 * @param[out] mime_count pointer to hold number of mimes
2672 * @param[out] mime pointer to hold list of mimes
2673 * @return 0 if success, error code(<0) if fail
2674 * @retval PMINFO_R_OK success
2675 * @retval PMINFO_R_EINVAL invalid argument
2676 * @retval PMINFO_R_ERROR internal error
2677 * @pre pkgmgrinfo_appinfo_get_appinfo()
2678 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2679 * @see pkgmgrinfo_appinfo_get_uri()
2680 * @see pkgmgrinfo_appinfo_get_operation()
2682 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2687 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2688 for (i = 0; i < mc; i++) {
2689 if (strcmp(mime[i], (char *)user_data) == 0)
2696 static int check_mime(const char *appid, char *mime)
2699 pkgmgrinfo_appinfo_h handle;
2700 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2701 if (ret != PMINFO_R_OK)
2703 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2704 if (ret != PMINFO_R_OK) {
2705 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2708 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2713 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2714 int *mime_count, char ***mime);
2717 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2718 int *subapp_count, char ***subapp)
2719 * @brief This API gets the list of subapp of the application
2721 * @par This API is for package-manager client application
2722 * @par Sync (or) Async : Synchronous API
2724 * @param[in] handle pointer to the appcontrol handle.
2725 * @param[out] subapp_count pointer to hold number of subapp
2726 * @param[out] subapp pointer to hold list of subapp
2727 * @return 0 if success, error code(<0) if fail
2728 * @retval PMINFO_R_OK success
2729 * @retval PMINFO_R_EINVAL invalid argument
2730 * @retval PMINFO_R_ERROR internal error
2731 * @pre pkgmgrinfo_appinfo_get_appinfo()
2732 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2733 * @see pkgmgrinfo_appinfo_get_uri()
2734 * @see pkgmgrinfo_appinfo_get_operation()
2736 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2740 char **subapp = NULL;
2741 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2742 for (i = 0; i < sc; i++) {
2743 if (strcmp(subapp[i], (char *)user_data) == 0)
2750 static int check_subapp(const char *appid, char *subapp)
2753 pkgmgrinfo_appinfo_h handle = NULL;
2754 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2755 if (ret != PMINFO_R_OK)
2757 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2758 if (ret != PMINFO_R_OK) {
2759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2762 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2767 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2768 int *subapp_count, char ***subapp);
2771 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2772 * @brief This API gets the notification icon of the application
2774 * @par This API is for package-manager client application
2775 * @par Sync (or) Async : Synchronous API
2777 * @param[in] handle pointer to the application info handle.
2778 * @param[out] path pointer to hold notification icon
2779 * @return 0 if success, error code(<0) if fail
2780 * @retval PMINFO_R_OK success
2781 * @retval PMINFO_R_EINVAL invalid argument
2782 * @retval PMINFO_R_ERROR internal error
2783 * @pre pkgmgrinfo_appinfo_get_appinfo()
2784 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2785 * @see pkgmgrinfo_appinfo_get_appid()
2786 * @see pkgmgrinfo_appinfo_is_multiple()
2788 static int get_app_notification_icon(const char *appid)
2791 char *notification_icon = NULL;
2792 pkgmgrinfo_appinfo_h handle;
2793 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2794 if (ret != PMINFO_R_OK)
2796 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2797 if (ret != PMINFO_R_OK) {
2798 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2801 printf("notification icon : %s\n", notification_icon);
2802 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2807 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2810 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2811 * @brief This API gets the setting icon of the application
2813 * @par This API is for package-manager client application
2814 * @par Sync (or) Async : Synchronous API
2816 * @param[in] handle pointer to the application info handle.
2817 * @param[out] path pointer to hold setting icon
2818 * @return 0 if success, error code(<0) if fail
2819 * @retval PMINFO_R_OK success
2820 * @retval PMINFO_R_EINVAL invalid argument
2821 * @retval PMINFO_R_ERROR internal error
2822 * @pre pkgmgrinfo_appinfo_get_appinfo()
2823 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2824 * @see pkgmgrinfo_appinfo_get_appid()
2825 * @see pkgmgrinfo_appinfo_is_multiple()
2827 static int get_app_setting_icon(const char *appid)
2830 char *setting_icon = NULL;
2831 pkgmgrinfo_appinfo_h handle;
2832 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2833 if (ret != PMINFO_R_OK)
2835 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2836 if (ret != PMINFO_R_OK) {
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2840 printf("setting icon : %s\n", setting_icon);
2841 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2846 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2849 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2850 * @brief This API gets the type of recent image on app-tray
2852 * @par This API is for package-manager client application
2853 * @par Sync (or) Async : Synchronous API
2855 * @param[in] handle pointer to the application info handle.
2856 * @param[out] type pointer to hold image type
2857 * @return 0 if success, error code(<0) if fail
2858 * @retval PMINFO_R_OK success
2859 * @retval PMINFO_R_EINVAL invalid argument
2860 * @retval PMINFO_R_ERROR internal error
2861 * @pre pkgmgrinfo_appinfo_get_appinfo()
2862 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2863 * @see pkgmgrinfo_appinfo_get_appid()
2864 * @see pkgmgrinfo_appinfo_is_multiple()
2866 static int get_app_recent_image_type(const char *appid)
2869 pkgmgrinfo_app_recentimage type;
2870 pkgmgrinfo_appinfo_h handle;
2871 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2872 if (ret != PMINFO_R_OK)
2874 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2875 if (ret != PMINFO_R_OK) {
2876 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2879 printf("recent image type: %d\n", type);
2880 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2885 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2889 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2890 * @brief This API gets the preview image of application
2892 * @par Sync (or) Async : Synchronous API
2894 * @param[in] handle pointer to the application info handle.
2895 * @param[out] preview_img pointer to hold preview image path
2896 * @return 0 if success, error code(<0) if fail
2897 * @retval PMINFO_R_OK success
2898 * @retval PMINFO_R_EINVAL invalid argument
2899 * @retval PMINFO_R_ERROR internal error
2900 * @pre pkgmgrinfo_appinfo_get_appinfo()
2901 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2902 * @see pkgmgrinfo_appinfo_get_appid()
2904 static int get_app_previewimage(const char *appid)
2907 char *preview = NULL;
2908 pkgmgrinfo_appinfo_h handle = NULL;
2909 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2910 if (ret != PMINFO_R_OK)
2912 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2913 if (ret != PMINFO_R_OK) {
2914 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2917 printf("preview image path : %s\n", preview);
2918 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2923 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2927 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2928 * @brief This API gets the package permission type of the application
2930 * @par This API is for package-manager client application
2931 * @par Sync (or) Async : Synchronous API
2933 * @param[in] handle pointer to the application info handle.
2934 * @param[out] permission pointer to hold package permission
2935 * @return 0 if success, error code(<0) if fail
2936 * @retval PMINFO_R_OK success
2937 * @retval PMINFO_R_EINVAL invalid argument
2938 * @retval PMINFO_R_ERROR internal error
2939 * @pre pkgmgrinfo_appinfo_get_appinfo()
2940 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2941 * @see pkgmgrinfo_appinfo_get_appid()
2943 static int get_app_permission(const char *appid)
2946 pkgmgrinfo_permission_type permission = 0;
2947 pkgmgrinfo_appinfo_h handle;
2949 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2950 if (ret != PMINFO_R_OK)
2952 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2953 if (ret != PMINFO_R_OK) {
2954 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2957 printf("permission type: %d\n", permission);
2958 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2963 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2966 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2967 * @brief This API gets the component_type
2969 * @par This API is for package-manager client application
2970 * @par Sync (or) Async : Synchronous API
2972 * @param[in] handle pointer to the application info handle.
2973 * @param[out] component_type pointer to hold component_type
2974 * @return 0 if success, error code(<0) if fail
2975 * @retval PMINFO_R_OK success
2976 * @retval PMINFO_R_EINVAL invalid argument
2977 * @retval PMINFO_R_ERROR internal error
2978 * @pre pkgmgrinfo_appinfo_get_appinfo()
2979 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2980 * @see pkgmgrinfo_appinfo_get_pkgid()
2981 * @see pkgmgrinfo_appinfo_is_multiple()
2983 static int get_component_type(const char *appid)
2986 char *component_type = NULL;
2987 pkgmgrinfo_appinfo_h handle;
2988 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2989 if (ret != PMINFO_R_OK)
2991 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2992 if (ret != PMINFO_R_OK) {
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2996 printf("component_type: %s\n", component_type);
2997 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3002 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3005 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3006 * @brief This API gets the application 'hwacceleration' value from the app ID
3008 * @par This API is for package-manager client application
3009 * @par Sync (or) Async : Synchronous API
3011 * @param[in] handle pointer to application info handle
3012 * @param[out] hwacceleration pointer to hold package hwacceleration value
3013 * @return 0 if success, error code(<0) if fail
3014 * @retval PMINFO_R_OK success
3015 * @retval PMINFO_R_EINVAL invalid argument
3016 * @retval PMINFO_R_ERROR internal error
3017 * @pre pkgmgrinfo_appinfo_get_appinfo()
3018 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3019 * @see pkgmgrinfo_appinfo_get_appid()
3020 * @see pkgmgrinfo_appinfo_is_multiple()
3022 static int get_app_hwacceleration(const char *appid)
3025 pkgmgrinfo_app_hwacceleration hwacceleration;
3026 pkgmgrinfo_appinfo_h handle;
3027 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3028 if (ret != PMINFO_R_OK)
3030 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3031 if (ret != PMINFO_R_OK) {
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3035 printf("app hwacceleration: %d\n", hwacceleration);
3036 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3041 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3044 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3045 * @brief This API gets the application 'screenreader' value from the app ID
3047 * @par This API is for package-manager client application
3048 * @par Sync (or) Async : Synchronous API
3050 * @param[in] handle pointer to application info handle
3051 * @param[out] screenreader pointer to hold package accessibility value
3052 * @return 0 if success, error code(<0) if fail
3053 * @retval PMINFO_R_OK success
3054 * @retval PMINFO_R_EINVAL invalid argument
3055 * @retval PMINFO_R_ERROR internal error
3056 * @pre pkgmgrinfo_appinfo_get_appinfo()
3057 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3058 * @see pkgmgrinfo_appinfo_get_appid()
3059 * @see pkgmgrinfo_appinfo_is_multiple()
3061 static int get_app_screenreader(const char *appid)
3064 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3065 pkgmgrinfo_appinfo_h handle = NULL;
3066 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3067 if (ret != PMINFO_R_OK)
3069 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3070 if (ret != PMINFO_R_OK) {
3071 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3074 printf("app screenreader: %d\n", screenreader);
3075 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3080 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3083 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3084 * @brief This API gets the application's landscape & portrait effect images
3086 * @par This API is for package-manager client application
3087 * @par Sync (or) Async : Synchronous API
3089 * @param[in] handle pointer to application info handle
3090 * @param[out] portrait_img contains portrait mode effect image
3091 * @param[out] landscape_img contains landscape mode effect image
3092 * @return 0 if success, error code(<0) if fail
3093 * @retval PMINFO_R_OK success
3094 * @retval PMINFO_R_EINVAL invalid argument
3095 * @retval PMINFO_R_ERROR internal error
3096 * @pre pkgmgrinfo_appinfo_get_appinfo()
3097 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3098 * @see pkgmgrinfo_appinfo_get_appid()
3099 * @see pkgmgrinfo_appinfo_is_nodisplay()
3101 static int get_app_effectimages(const char *appid)
3104 char *portraitimg = NULL;
3105 char *landscapeimg = NULL;
3106 pkgmgrinfo_appinfo_h handle;
3107 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3108 if (ret != PMINFO_R_OK)
3110 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3111 if (ret != PMINFO_R_OK) {
3112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3115 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3121 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3124 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3125 * @brief This API gets the submode_mainid of the application
3127 * @par This API is for package-manager client application
3128 * @par Sync (or) Async : Synchronous API
3130 * @param[in] handle pointer to the application info handle.
3131 * @param[out] submode_mainid pointer to hold package name
3132 * @return 0 if success, error code(<0) if fail
3133 * @retval PMINFO_R_OK success
3134 * @retval PMINFO_R_EINVAL invalid argument
3135 * @retval PMINFO_R_ERROR internal error
3136 * @pre pkgmgrinfo_appinfo_get_appinfo()
3137 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3138 * @see pkgmgrinfo_appinfo_get_appid()
3139 * @see pkgmgrinfo_appinfo_is_multiple()
3141 static int get_app_submode_mainid(const char *appid)
3144 char *submode_mainid = NULL;
3145 pkgmgrinfo_appinfo_h handle = NULL;
3146 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3147 if (ret != PMINFO_R_OK)
3149 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3150 if (ret != PMINFO_R_OK) {
3151 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3154 printf("submode_mainid: %s\n", submode_mainid);
3155 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3160 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3163 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3164 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3165 * @brief This API gets the list of permission for a particular application
3167 * @par This API is for package-manager client application
3168 * @par Sync (or) Async : Synchronous API
3169 * @param[in] handle pointer to the application info handle.
3170 * @param[in] permission_func callback function for list
3171 * @param[in] user_data user data to be passed to callback function
3172 * @return 0 if success, error code(<0) if fail
3173 * @retval PMINFO_R_OK success
3174 * @retval PMINFO_R_EINVAL invalid argument
3175 * @retval PMINFO_R_ERROR internal error
3176 * @pre pkgmgrinfo_appinfo_get_appinfo()
3177 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3179 int permission_func(const char *name, void *user_data)
3181 if (strcmp(name, (char *)user_data) == 0)
3187 static int list_permission(const char *appid, char *permission)
3190 pkgmgrinfo_appinfo_h handle;
3191 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3192 if (ret != PMINFO_R_OK)
3194 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3195 if (ret != PMINFO_R_OK) {
3196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3199 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3204 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3205 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3208 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3209 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3210 * @brief This API gets the list of category for a particular application
3212 * @par This API is for package-manager client application
3213 * @par Sync (or) Async : Synchronous API
3214 * @param[in] handle pointer to the application info handle.
3215 * @param[in] category_func callback function for list
3216 * @param[in] user_data user data to be passed to callback function
3217 * @return 0 if success, error code(<0) if fail
3218 * @retval PMINFO_R_OK success
3219 * @retval PMINFO_R_EINVAL invalid argument
3220 * @retval PMINFO_R_ERROR internal error
3221 * @pre pkgmgrinfo_appinfo_get_appinfo()
3222 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3224 int category_func(const char *name, void *user_data)
3226 if (strcmp(name, (char *)user_data) == 0)
3232 static int list_category(const char *appid, char *category)
3235 pkgmgrinfo_appinfo_h handle;
3236 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3237 if (ret != PMINFO_R_OK)
3239 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3240 if (ret != PMINFO_R_OK) {
3241 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3244 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3249 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3250 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3253 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3254 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3255 * @brief This API gets the list of metadata for a particular application
3257 * @par This API is for package-manager client application
3258 * @par Sync (or) Async : Synchronous API
3259 * @param[in] handle pointer to the application info handle.
3260 * @param[in] metadata_func callback function for list
3261 * @param[in] user_data user data to be passed to callback function
3262 * @return 0 if success, error code(<0) if fail
3263 * @retval PMINFO_R_OK success
3264 * @retval PMINFO_R_EINVAL invalid argument
3265 * @retval PMINFO_R_ERROR internal error
3266 * @pre pkgmgrinfo_appinfo_get_appinfo()
3267 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3269 int metadata_func(const char *key, const char *value, void *user_data)
3271 if (strcmp(key, (char *)user_data) == 0) {
3272 printf("Value is %s\n", value);
3279 static int list_metadata(const char *appid, char *key)
3282 pkgmgrinfo_appinfo_h handle;
3283 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3284 if (ret != PMINFO_R_OK)
3286 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3287 if (ret != PMINFO_R_OK) {
3288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3296 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3297 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3301 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3302 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3303 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3304 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3305 * @brief This API gets the list of app-control for a particular application
3307 * @par This API is for package-manager client application
3308 * @par Sync (or) Async : Synchronous API
3309 * @param[in] handle pointer to the application info handle.
3310 * @param[in] appcontrol_func callback function for list
3311 * @param[in] user_data user data to be passed to callback function
3312 * @param[in] uid the addressee user id of the instruction
3313 * @return 0 if success, error code(<0) if fail
3314 * @retval PMINFO_R_OK success
3315 * @retval PMINFO_R_EINVAL invalid argument
3316 * @retval PMINFO_R_ERROR internal error
3317 * @pre pkgmgrinfo_appinfo_get_appinfo()
3318 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3320 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3325 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3326 for (i = 0; i < oc; i++) {
3327 if (strcmp(operation[i], (char *)user_data) == 0)
3334 static int check_operation(const char *appid, char *operation)
3337 pkgmgrinfo_appinfo_h handle;
3338 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3339 if (ret != PMINFO_R_OK)
3341 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3342 if (ret != PMINFO_R_OK) {
3343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3351 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3352 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3353 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3354 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3357 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3358 * @brief This API gets the application 'nodisplay' value from the app ID
3360 * @par This API is for package-manager client application
3361 * @par Sync (or) Async : Synchronous API
3363 * @param[in] handle pointer to application info handle
3364 * @param[out] nodisplay pointer to hold package nodisplay value
3365 * @return 0 if success, error code(<0) if fail
3366 * @retval PMINFO_R_OK success
3367 * @retval PMINFO_R_EINVAL invalid argument
3368 * @retval PMINFO_R_ERROR internal error
3369 * @pre pkgmgrinfo_appinfo_get_appinfo()
3370 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3371 * @see pkgmgrinfo_appinfo_get_appid()
3372 * @see pkgmgrinfo_appinfo_is_multiple()
3374 static int get_app_nodisplay(const char *appid)
3378 pkgmgrinfo_appinfo_h handle;
3379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3380 if (ret != PMINFO_R_OK)
3382 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3383 if (ret != PMINFO_R_OK) {
3384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3387 printf("app nodisplay: %d\n", nodisplay);
3388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3393 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3396 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3397 * @brief This API gets the application 'multiple' value from the app ID
3399 * @par This API is for package-manager client application
3400 * @par Sync (or) Async : Synchronous API
3402 * @param[in] handle pointer to application info handle
3403 * @param[out] multiple pointer to hold package multiple value
3404 * @return 0 if success, error code(<0) if fail
3405 * @retval PMINFO_R_OK success
3406 * @retval PMINFO_R_EINVAL invalid argument
3407 * @retval PMINFO_R_ERROR internal error
3408 * @pre pkgmgrinfo_appinfo_get_appinfo()
3409 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3410 * @see pkgmgrinfo_appinfo_get_appid()
3411 * @see pkgmgrinfo_appinfo_is_nodisplay()
3413 static int get_app_multiple(const char *appid)
3417 pkgmgrinfo_appinfo_h handle;
3418 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3419 if (ret != PMINFO_R_OK)
3421 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3422 if (ret != PMINFO_R_OK) {
3423 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3426 printf("app multiple: %d\n", multiple);
3427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3432 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3435 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3436 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3437 * application launching effect. If fales, indicator will be hidden during application launching effect
3439 * @par This API is for package-manager client application
3440 * @par Sync (or) Async : Synchronous API
3442 * @param[in] handle pointer to application info handle
3443 * @param[out] indicator_disp contains indicator display status for application launching effect
3444 * @return 0 if success, error code(<0) if fail
3445 * @retval PMINFO_R_OK success
3446 * @retval PMINFO_R_EINVAL invalid argument
3447 * @retval PMINFO_R_ERROR internal error
3448 * @pre pkgmgrinfo_appinfo_get_appinfo()
3449 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3450 * @see pkgmgrinfo_appinfo_get_appid()
3451 * @see pkgmgrinfo_appinfo_is_nodisplay()
3453 static int get_app_indicator_display(const char *appid)
3456 bool indicator_disp;
3457 pkgmgrinfo_appinfo_h handle;
3458 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3459 if (ret != PMINFO_R_OK)
3461 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3462 if (ret != PMINFO_R_OK){
3463 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3466 printf("app indicator disp : %d\n", indicator_disp);
3467 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3472 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3475 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3476 * @brief This API gets the application 'taskmanage' value from the app ID
3478 * @par This API is for package-manager client application
3479 * @par Sync (or) Async : Synchronous API
3481 * @param[in] handle pointer to application info handle
3482 * @param[out] taskmanage pointer to hold package taskmanage value
3483 * @return 0 if success, error code(<0) if fail
3484 * @retval PMINFO_R_OK success
3485 * @retval PMINFO_R_EINVAL invalid argument
3486 * @retval PMINFO_R_ERROR internal error
3487 * @pre pkgmgrinfo_appinfo_get_appinfo()
3488 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3489 * @see pkgmgrinfo_appinfo_get_appid()
3490 * @see pkgmgrinfo_appinfo_is_multiple()
3492 static int get_app_taskmanage(const char *appid)
3496 pkgmgrinfo_appinfo_h handle;
3497 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3498 if (ret != PMINFO_R_OK)
3500 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3501 if (ret != PMINFO_R_OK) {
3502 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3505 printf("app taskmanage: %d\n", taskmanage);
3506 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3511 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3514 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3515 * @brief This API gets the application 'taskmanage' value from the app ID
3517 * @par This API is for package-manager client application
3518 * @par Sync (or) Async : Synchronous API
3520 * @param[in] handle pointer to application info handle
3521 * @param[out] enabled pointer to hold package enabled value
3522 * @return 0 if success, error code(<0) if fail
3523 * @retval PMINFO_R_OK success
3524 * @retval PMINFO_R_EINVAL invalid argument
3525 * @retval PMINFO_R_ERROR internal error
3526 * @pre pkgmgrinfo_appinfo_get_appinfo()
3527 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3528 * @see pkgmgrinfo_appinfo_get_appid()
3529 * @see pkgmgrinfo_appinfo_is_multiple()
3531 static int get_app_enabled(const char *appid)
3535 pkgmgrinfo_appinfo_h handle;
3536 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3537 if (ret != PMINFO_R_OK)
3539 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3540 if (ret != PMINFO_R_OK) {
3541 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3544 printf("app enabled: %d\n", enabled);
3545 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3550 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3553 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3554 * @brief This API gets the application 'onboot' value from the app ID
3556 * @par This API is for package-manager client application
3557 * @par Sync (or) Async : Synchronous API
3559 * @param[in] handle pointer to application info handle
3560 * @param[out] onboot pointer to hold package onboot value
3561 * @return 0 if success, error code(<0) if fail
3562 * @retval PMINFO_R_OK success
3563 * @retval PMINFO_R_EINVAL invalid argument
3564 * @retval PMINFO_R_ERROR internal error
3565 * @pre pkgmgrinfo_appinfo_get_appinfo()
3566 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3567 * @see pkgmgrinfo_appinfo_get_appid()
3568 * @see pkgmgrinfo_appinfo_is_multiple()
3570 static int get_app_onboot(const char *appid)
3574 pkgmgrinfo_appinfo_h handle;
3575 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3576 if (ret != PMINFO_R_OK)
3578 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3579 if (ret != PMINFO_R_OK) {
3580 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3583 printf("app onboot: %d\n", onboot);
3584 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3589 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3592 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3593 * @brief This API gets the application 'autorestart' value from the app ID
3595 * @par This API is for package-manager client application
3596 * @par Sync (or) Async : Synchronous API
3598 * @param[in] handle pointer to application info handle
3599 * @param[out] autorestart pointer to hold package autorestart value
3600 * @return 0 if success, error code(<0) if fail
3601 * @retval PMINFO_R_OK success
3602 * @retval PMINFO_R_EINVAL invalid argument
3603 * @retval PMINFO_R_ERROR internal error
3604 * @pre pkgmgrinfo_appinfo_get_appinfo()
3605 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3606 * @see pkgmgrinfo_appinfo_get_appid()
3607 * @see pkgmgrinfo_appinfo_is_multiple()
3609 static int get_app_autorestart(const char *appid)
3613 pkgmgrinfo_appinfo_h handle;
3614 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3615 if (ret != PMINFO_R_OK)
3617 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3618 if (ret != PMINFO_R_OK) {
3619 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3622 printf("app autorestart: %d\n", autorestart);
3623 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3628 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3631 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3632 * @brief This API gets the value for given application is main app or not from handle
3634 * @par This API is for package-manager client application
3635 * @par Sync (or) Async : Synchronous API
3637 * @param[in] handle pointer to application info handle
3638 * @param[out] mainapp pointer to hold package mainapp is or not
3639 * @return 0 if success, error code(<0) if fail
3640 * @retval PMINFO_R_OK success
3641 * @retval PMINFO_R_EINVAL invalid argument
3642 * @retval PMINFO_R_ERROR internal error
3643 * @pre pkgmgrinfo_appinfo_get_appinfo()
3644 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3645 * @see pkgmgrinfo_appinfo_get_appid()
3646 * @see pkgmgrinfo_appinfo_is_multiple()
3648 static int get_app_mainapp(const char *appid)
3652 pkgmgrinfo_appinfo_h handle;
3653 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3654 if (ret != PMINFO_R_OK)
3656 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3657 if (ret != PMINFO_R_OK) {
3658 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3661 printf("mainapp: %d\n", mainapp);
3662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3667 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3671 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3672 * @brief This API gets the value for given application is preload or not from handle
3674 * @par This API is for package-manager client application
3675 * @par Sync (or) Async : Synchronous API
3677 * @param[in] handle pointer to application info handle
3678 * @param[out] preload pointer to hold preload is or not
3679 * @return 0 if success, error code(<0) if fail
3680 * @retval PMINFO_R_OK success
3681 * @retval PMINFO_R_EINVAL invalid argument
3682 * @retval PMINFO_R_ERROR internal error
3683 * @pre pkgmgrinfo_appinfo_get_appinfo()
3684 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3685 * @see pkgmgrinfo_appinfo_get_appid()
3686 * @see pkgmgrinfo_appinfo_is_multiple()
3688 static int get_app_preload(const char *appid)
3692 pkgmgrinfo_appinfo_h handle = NULL;
3693 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3694 if (ret != PMINFO_R_OK)
3696 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3697 if (ret != PMINFO_R_OK) {
3698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3701 printf("preload: %d\n", preload);
3702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3707 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3710 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3711 * @brief This API gets the value for given application is submode or not from handle
3713 * @par This API is for package-manager client application
3714 * @par Sync (or) Async : Synchronous API
3716 * @param[in] handle pointer to application info handle
3717 * @param[out] submode pointer to hold submode is or not
3718 * @return 0 if success, error code(<0) if fail
3719 * @retval PMINFO_R_OK success
3720 * @retval PMINFO_R_EINVAL invalid argument
3721 * @retval PMINFO_R_ERROR internal error
3722 * @pre pkgmgrinfo_appinfo_get_appinfo()
3723 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3724 * @see pkgmgrinfo_appinfo_get_appid()
3725 * @see pkgmgrinfo_appinfo_is_multiple()
3727 static int get_app_submode(const char *appid)
3731 pkgmgrinfo_appinfo_h handle = NULL;
3732 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3733 if (ret != PMINFO_R_OK)
3735 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3736 if (ret != PMINFO_R_OK) {
3737 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3740 printf("submode: %d\n", submode);
3741 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3746 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3749 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3750 * @brief This API destroys the application information handle freeing up all the resources
3752 * @par This API is for package-manager client application
3753 * @par Sync (or) Async : Synchronous API
3755 * @param[in] handle pointer to the application info handle.
3756 * @return 0 if success, error code(<0) if fail
3757 * @retval PMINFO_R_OK success
3758 * @retval PMINFO_R_EINVAL invalid argument
3759 * @retval PMINFO_R_ERROR internal error
3760 * @pre pkgmgrinfo_appinfo_get_appinfo()
3762 * @see pkgmgrinfo_appinfo_get_pkgid()
3763 * @see pkgmgrinfo_appinfo_is_multiple()
3765 static int get_app_type(const char *appid)
3769 pkgmgrinfo_appinfo_h handle;
3770 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3771 if (ret != PMINFO_R_OK)
3773 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3774 if (ret != PMINFO_R_OK) {
3775 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3778 printf("apptype: %s\n", type);
3779 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3784 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3787 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3788 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3789 The query will search the entire application information collected from the manifest file of all the installed packages
3791 * @par This API is for package-manager client application
3792 * @par Sync (or) Async : Synchronous API
3794 * @param[out] handle pointer to the application info filter handle.
3795 * @return 0 if success, error code(<0) if fail
3796 * @retval PMINFO_R_OK success
3797 * @retval PMINFO_R_EINVAL invalid argument
3798 * @retval PMINFO_R_ERROR internal error
3800 * @post pkgmgrinfo_appinfo_filter_destroy()
3801 * @see pkgmgrinfo_appinfo_filter_count()
3802 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3804 static int get_capp_count()
3808 pkgmgrinfo_appinfo_filter_h handle;
3809 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3810 if (ret != PMINFO_R_OK)
3812 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3813 if (ret != PMINFO_R_OK) {
3814 pkgmgrinfo_appinfo_filter_destroy(handle);
3817 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3818 if (ret != PMINFO_R_OK) {
3819 pkgmgrinfo_appinfo_filter_destroy(handle);
3822 printf("No of capp: %d\n", count);
3823 pkgmgrinfo_appinfo_filter_destroy(handle);
3828 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3831 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3832 * @brief This API destroys the application information filter handle freeing up all the resources
3834 * @par This API is for package-manager client application
3835 * @par Sync (or) Async : Synchronous API
3837 * @param[in] handle pointer to the application info filter handle.
3838 * @return 0 if success, error code(<0) if fail
3839 * @retval PMINFO_R_OK success
3840 * @retval PMINFO_R_EINVAL invalid argument
3841 * @retval PMINFO_R_ERROR internal error
3842 * @pre pkgmgrinfo_appinfo_filter_create()
3844 * @see pkgmgrinfo_appinfo_filter_count()
3845 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3847 static int get_capp_count()
3851 pkgmgrinfo_appinfo_filter_h handle;
3852 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3853 if (ret != PMINFO_R_OK)
3855 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3856 if (ret != PMINFO_R_OK) {
3857 pkgmgrinfo_appinfo_filter_destroy(handle);
3860 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3861 if (ret != PMINFO_R_OK) {
3862 pkgmgrinfo_appinfo_filter_destroy(handle);
3865 printf("No of capp: %d\n", count);
3866 pkgmgrinfo_appinfo_filter_destroy(handle);
3871 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3874 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3875 * @brief This API adds a boolean filter property to the filter handle
3877 * @par This API is for package-manager client application
3878 * @par Sync (or) Async : Synchronous API
3880 * @param[in] handle pointer to the application info filter handle.
3881 * @param[in] property boolean property name.
3882 * @param[in] value value corresponding to the property.
3883 * @return 0 if success, error code(<0) if fail
3884 * @retval PMINFO_R_OK success
3885 * @retval PMINFO_R_EINVAL invalid argument
3886 * @retval PMINFO_R_ERROR internal error
3887 * @pre pkgmgrinfo_appinfo_filter_create()
3888 * @post pkgmgrinfo_appinfo_filter_destroy()
3889 * @see pkgmgrinfo_appinfo_filter_count()
3890 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3892 static int get_taskmanageable_app_count()
3896 pkgmgrinfo_appinfo_filter_h handle;
3897 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3898 if (ret != PMINFO_R_OK)
3900 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3901 if (ret != PMINFO_R_OK) {
3902 pkgmgrinfo_appinfo_filter_destroy(handle);
3905 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3906 if (ret != PMINFO_R_OK) {
3907 pkgmgrinfo_appinfo_filter_destroy(handle);
3910 printf("No of taskmanageable apps: %d\n", count);
3911 pkgmgrinfo_appinfo_filter_destroy(handle);
3916 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3917 const char *property, const bool value);
3920 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3921 * @brief This API adds an integer filter property to the filter handle
3923 * @par This API is for package-manager client application
3924 * @par Sync (or) Async : Synchronous API
3926 * @param[in] handle pointer to the application info filter handle.
3927 * @param[in] property integer property name.
3928 * @param[in] value value corresponding to the property.
3929 * @return 0 if success, error code(<0) if fail
3930 * @retval PMINFO_R_OK success
3931 * @retval PMINFO_R_EINVAL invalid argument
3932 * @retval PMINFO_R_ERROR internal error
3933 * @pre pkgmgrinfo_appinfo_filter_create()
3934 * @post pkgmgrinfo_appinfo_filter_destroy()
3935 * @see pkgmgrinfo_appinfo_filter_count()
3936 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3938 static int get_taskmanageable_app_count()
3942 pkgmgrinfo_appinfo_filter_h handle;
3943 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3944 if (ret != PMINFO_R_OK)
3946 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3947 if (ret != PMINFO_R_OK) {
3948 pkgmgrinfo_appinfo_filter_destroy(handle);
3951 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3952 if (ret != PMINFO_R_OK) {
3953 pkgmgrinfo_appinfo_filter_destroy(handle);
3956 printf("No of apps: %d\n", count);
3957 pkgmgrinfo_appinfo_filter_destroy(handle);
3962 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3963 const char *property, const int value);
3966 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3967 * @brief This API adds a string filter property to the filter handle
3969 * @par This API is for package-manager client application
3970 * @par Sync (or) Async : Synchronous API
3972 * @param[in] handle pointer to the application info filter handle.
3973 * @param[in] property string property name.
3974 * @param[in] value value corresponding to the property.
3975 * @return 0 if success, error code(<0) if fail
3976 * @retval PMINFO_R_OK success
3977 * @retval PMINFO_R_EINVAL invalid argument
3978 * @retval PMINFO_R_ERROR internal error
3979 * @pre pkgmgrinfo_appinfo_filter_create()
3980 * @post pkgmgrinfo_appinfo_filter_destroy()
3981 * @see pkgmgrinfo_appinfo_filter_count()
3982 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3984 static int get_capp_count()
3988 pkgmgrinfo_appinfo_filter_h handle;
3989 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3990 if (ret != PMINFO_R_OK)
3992 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3993 if (ret != PMINFO_R_OK) {
3994 pkgmgrinfo_appinfo_filter_destroy(handle);
3997 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3998 if (ret != PMINFO_R_OK) {
3999 pkgmgrinfo_appinfo_filter_destroy(handle);
4002 printf("No of capp: %d\n", count);
4003 pkgmgrinfo_appinfo_filter_destroy(handle);
4008 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4009 const char *property, const char *value);
4012 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4013 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4015 * @par This API is for package-manager client application
4016 * @par Sync (or) Async : Synchronous API
4018 * @param[in] handle pointer to the application info filter handle.
4019 * @param[in] app_cb callback function.
4020 * @param[in] user_data user data to be passed to the callback function
4021 * @return 0 if success, error code(<0) if fail
4022 * @retval PMINFO_R_OK success
4023 * @retval PMINFO_R_EINVAL invalid argument
4024 * @retval PMINFO_R_ERROR internal error
4025 * @pre pkgmgrinfo_appinfo_filter_create()
4026 * @post pkgmgrinfo_appinfo_filter_destroy()
4027 * @see pkgmgrinfo_appinfo_filter_count()
4029 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4032 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4033 printf("appid : %s\n", appid);
4037 static int get_capp_list()
4040 pkgmgrinfo_appinfo_filter_h handle;
4041 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4042 if (ret != PMINFO_R_OK)
4044 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4045 if (ret != PMINFO_R_OK) {
4046 pkgmgrinfo_appinfo_filter_destroy(handle);
4049 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4050 if (ret != PMINFO_R_OK) {
4051 pkgmgrinfo_appinfo_filter_destroy(handle);
4054 pkgmgrinfo_appinfo_filter_destroy(handle);
4059 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4060 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4061 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4062 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4065 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4066 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4067 * @brief This API counts the application that satisfy the filter conditions
4069 * @par This API is for package-manager client application
4070 * @par Sync (or) Async : Synchronous API
4072 * @param[in] handle pointer to the application info filter handle.
4073 * @param[in] count pointer to store count value
4074 * @param[in] uid the addressee user id of the instruction
4075 * @return 0 if success, error code(<0) if fail
4076 * @retval PMINFO_R_OK success
4077 * @retval PMINFO_R_EINVAL invalid argument
4078 * @retval PMINFO_R_ERROR internal error
4079 * @pre pkgmgrinfo_appinfo_filter_create()
4080 * @post pkgmgrinfo_appinfo_filter_destroy()
4081 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4083 static int get_capp_count()
4087 pkgmgrinfo_appinfo_filter_h handle;
4088 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4089 if (ret != PMINFO_R_OK)
4091 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4092 if (ret != PMINFO_R_OK) {
4093 pkgmgrinfo_appinfo_filter_destroy(handle);
4096 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4097 if (ret != PMINFO_R_OK) {
4098 pkgmgrinfo_appinfo_filter_destroy(handle);
4101 printf("No of capp: %d\n", count);
4102 pkgmgrinfo_appinfo_filter_destroy(handle);
4107 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4108 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4110 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4111 * @brief This API creates the application's metadata information filter handle from db.
4113 * @par This API is for package-manager client application
4114 * @par Sync (or) Async : Synchronous API
4116 * @param[out] handle pointer to the application metadata info filter handle.
4117 * @return 0 if success, error code(<0) if fail
4118 * @retval PMINFO_R_OK success
4119 * @retval PMINFO_R_EINVAL invalid argument
4120 * @retval PMINFO_R_ERROR internal error
4122 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4123 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4125 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4128 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4129 printf("appid : %s\n", appid);
4133 static int get_app_list(const char *mkey, const char *mvalue)
4136 pkgmgrinfo_appinfo_metadata_filter_h handle;
4137 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4138 if (ret != PMINFO_R_OK)
4140 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4141 if (ret != PMINFO_R_OK) {
4142 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4145 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4146 if (ret != PMINFO_R_OK) {
4147 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4150 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4155 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4158 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4159 * @brief This API destroys the application's metadata information filter handle.
4161 * @par This API is for package-manager client application
4162 * @par Sync (or) Async : Synchronous API
4164 * @param[in] handle pointer to the application metadata info filter handle.
4165 * @return 0 if success, error code(<0) if fail
4166 * @retval PMINFO_R_OK success
4167 * @retval PMINFO_R_EINVAL invalid argument
4168 * @retval PMINFO_R_ERROR internal error
4169 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4171 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4173 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4176 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4177 printf("appid : %s\n", appid);
4181 static int get_app_list(const char *mkey, const char *mvalue)
4184 pkgmgrinfo_appinfo_metadata_filter_h handle;
4185 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4186 if (ret != PMINFO_R_OK)
4188 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4189 if (ret != PMINFO_R_OK) {
4190 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4193 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4194 if (ret != PMINFO_R_OK) {
4195 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4198 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4203 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4206 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4207 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4208 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4210 * @par This API is for package-manager client application
4211 * @par Sync (or) Async : Synchronous API
4213 * @param[in] handle pointer to the application metadata info filter handle.
4214 * @param[in] key pointer to metadata key
4215 * @param[in] value pointer to metadata value
4216 * @return 0 if success, error code(<0) if fail
4217 * @retval PMINFO_R_OK success
4218 * @retval PMINFO_R_EINVAL invalid argument
4219 * @retval PMINFO_R_ERROR internal error
4220 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4221 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4222 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4224 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4227 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4228 printf("appid : %s\n", appid);
4232 static int get_app_list(const char *mkey, const char *mvalue)
4235 pkgmgrinfo_appinfo_metadata_filter_h handle;
4236 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4237 if (ret != PMINFO_R_OK)
4239 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4240 if (ret != PMINFO_R_OK) {
4241 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4244 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4245 if (ret != PMINFO_R_OK) {
4246 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4249 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4254 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4255 const char *key, const char *value);
4258 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4259 * @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)
4260 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4261 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4262 * negative value, no more callbacks will be called and API will return.
4264 * @par This API is for package-manager client application
4265 * @par Sync (or) Async : Synchronous API
4267 * @param[in] handle pointer to the application metadata info filter handle.
4268 * @param[in] app_cb function pointer to callback
4269 * @param[in] user_data pointer to user data
4270 * @param[in] uid the addressee user id of the instruction
4271 * @return 0 if success, error code(<0) if fail
4272 * @retval PMINFO_R_OK success
4273 * @retval PMINFO_R_EINVAL invalid argument
4274 * @retval PMINFO_R_ERROR internal error
4275 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4276 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4278 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4281 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4282 printf("appid : %s\n", appid);
4286 static int get_app_list(const char *mkey, const char *mvalue)
4289 pkgmgrinfo_appinfo_metadata_filter_h handle;
4290 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4291 if (ret != PMINFO_R_OK)
4293 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4294 if (ret != PMINFO_R_OK) {
4295 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4298 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4299 if (ret != PMINFO_R_OK) {
4300 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4303 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4308 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4309 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4310 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4311 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4313 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4314 * @brief This API creates the package cert information handle to get data from db.
4316 * @par This API is for package-manager client application
4317 * @par Sync (or) Async : Synchronous API
4319 * @param[out] handle pointer to the package cert handle.
4320 * @return 0 if success, error code(<0) if fail
4321 * @retval PMINFO_R_OK success
4322 * @retval PMINFO_R_EINVAL invalid argument
4323 * @retval PMINFO_R_ERROR internal error
4325 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4326 * @see pkgmgrinfo_pkginfo_get_cert_value()
4327 * @see pkgmgrinfo_pkginfo_load_certinfo()
4329 static int get_cert_info(const char *pkgid)
4332 pkgmgrinfo_certinfo_h handle;
4333 char *auth_cert = NULL;
4334 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4335 if (ret != PMINFO_R_OK)
4337 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4338 if (ret != PMINFO_R_OK) {
4339 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4342 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4343 if (ret != PMINFO_R_OK) {
4344 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4347 printf("Author root certificate: %s\n", auth_root);
4348 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4353 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4356 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4357 * @brief This API loads the package cert information handle with data from db.
4359 * @par This API is for package-manager client application
4360 * @par Sync (or) Async : Synchronous API
4362 * @param[in] pkgid pointer to the package ID.
4363 * @param[in] handle pointer to the package cert handle.
4364 * @return 0 if success, error code(<0) if fail
4365 * @retval PMINFO_R_OK success
4366 * @retval PMINFO_R_EINVAL invalid argument
4367 * @retval PMINFO_R_ERROR internal error
4368 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4369 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4370 * @see pkgmgrinfo_pkginfo_get_cert_value()
4372 static int get_cert_info(const char *pkgid)
4375 pkgmgrinfo_certinfo_h handle;
4376 char *auth_cert = NULL;
4377 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4378 if (ret != PMINFO_R_OK)
4380 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4381 if (ret != PMINFO_R_OK) {
4382 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4385 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4386 if (ret != PMINFO_R_OK) {
4387 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4390 printf("Author root certificate: %s\n", auth_root);
4391 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4396 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4399 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4400 * @brief This API gets the package cert information from the handle
4402 * @par This API is for package-manager client application
4403 * @par Sync (or) Async : Synchronous API
4405 * @param[in] handle pointer to the package cert handle.
4406 * @param[in] cert_type certificate type
4407 * @param[out] cert_value pointer to hold certificate value
4408 * @return 0 if success, error code(<0) if fail
4409 * @retval PMINFO_R_OK success
4410 * @retval PMINFO_R_EINVAL invalid argument
4411 * @retval PMINFO_R_ERROR internal error
4412 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4413 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4414 * @see pkgmgrinfo_pkginfo_load_certinfo()
4416 static int get_cert_info(const char *pkgid)
4419 pkgmgrinfo_certinfo_h handle;
4420 char *auth_cert = NULL;
4421 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4422 if (ret != PMINFO_R_OK)
4424 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4425 if (ret != PMINFO_R_OK) {
4426 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4429 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4430 if (ret != PMINFO_R_OK) {
4431 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4434 printf("Author root certificate: %s\n", auth_root);
4435 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4440 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4443 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4444 * @brief This API destroys the package cert information handle freeing up all the resources
4446 * @par This API is for package-manager client application
4447 * @par Sync (or) Async : Synchronous API
4449 * @param[in] handle pointer to the package cert handle.
4450 * @return 0 if success, error code(<0) if fail
4451 * @retval PMINFO_R_OK success
4452 * @retval PMINFO_R_EINVAL invalid argument
4453 * @retval PMINFO_R_ERROR internal error
4454 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4456 * @see pkgmgrinfo_pkginfo_load_certinfo()
4458 static int get_cert_info(const char *pkgid)
4461 pkgmgrinfo_certinfo_h handle;
4462 char *auth_cert = NULL;
4463 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4464 if (ret != PMINFO_R_OK)
4466 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4467 if (ret != PMINFO_R_OK) {
4468 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4471 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4472 if (ret != PMINFO_R_OK) {
4473 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4476 printf("Author root certificate: %s\n", auth_root);
4477 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4482 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4485 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4486 * @brief This API deletes the package cert information from DB
4488 * @par This API is for package-manager client application
4489 * @par Sync (or) Async : Synchronous API
4491 * @param[in] pkgid pointer to the package ID.
4492 * @return 0 if success, error code(<0) if fail
4493 * @retval PMINFO_R_OK success
4494 * @retval PMINFO_R_EINVAL invalid argument
4495 * @retval PMINFO_R_ERROR internal error
4499 static int delete_cert_info(const char *pkgid)
4502 ret = pkgmgrinfo_delete_certinfo(pkgid);
4503 if (ret != PMINFO_R_OK)
4509 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4510 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4512 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4513 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4514 * @brief This API creates the package db information handle to set data in db.
4516 * @par This API is for package-manager client application
4517 * @par Sync (or) Async : Synchronous API
4519 * @param[in] pkgid pointer to the package ID.
4520 * @param[in] uid the addressee user id of the instruction
4521 * @param[out] handle pointer to the package db info handle.
4522 * @return 0 if success, error code(<0) if fail
4523 * @retval PMINFO_R_OK success
4524 * @retval PMINFO_R_EINVAL invalid argument
4525 * @retval PMINFO_R_ERROR internal error
4527 * @post pkgmgrinfo_destroy_pkgdbinfo()
4528 * @see pkgmgrinfo_save_pkgdbinfo()
4529 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4531 static int set_pkg_in_db(const char *pkgid)
4534 pkgmgrinfo_pkgdbinfo_h handle;
4535 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4536 if (ret != PMINFO_R_OK)
4538 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4539 if (ret != PMINFO_R_OK) {
4540 pkgmgrinfo_destroy_pkgdbinfo(handle);
4543 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4544 if (ret != PMINFO_R_OK) {
4545 pkgmgrinfo_destroy_pkgdbinfo(handle);
4548 pkgmgrinfo_destroy_pkgdbinfo(handle);
4553 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4554 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4557 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4558 * @brief This API sets the package type in db handle
4560 * @par This API is for package-manager client application
4561 * @par Sync (or) Async : Synchronous API
4563 * @param[in] handle pointer to the pkgdbinfo handle.
4564 * @param[in] type pointer to the package type.
4565 * @return 0 if success, error code(<0) if fail
4566 * @retval PMINFO_R_OK success
4567 * @retval PMINFO_R_EINVAL invalid argument
4568 * @retval PMINFO_R_ERROR internal error
4569 * @pre pkgmgrinfo_create_pkgdbinfo()
4570 * @post pkgmgrinfo_destroy_pkgdbinfo()
4571 * @see pkgmgrinfo_save_pkgdbinfo()
4572 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4574 static int set_pkg_type_in_db(const char *pkgid)
4577 pkgmgrinfo_pkgdbinfo_h handle;
4578 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4579 if (ret != PMINFO_R_OK)
4581 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4582 if (ret != PMINFO_R_OK) {
4583 pkgmgrinfo_destroy_pkgdbinfo(handle);
4586 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4587 if (ret != PMINFO_R_OK) {
4588 pkgmgrinfo_destroy_pkgdbinfo(handle);
4591 pkgmgrinfo_destroy_pkgdbinfo(handle);
4596 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4599 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4600 * @brief This API sets the package version in db handle
4602 * @par This API is for package-manager client application
4603 * @par Sync (or) Async : Synchronous API
4605 * @param[in] handle pointer to the pkgdbinfo handle.
4606 * @param[in] version pointer to the package version
4607 * @return 0 if success, error code(<0) if fail
4608 * @retval PMINFO_R_OK success
4609 * @retval PMINFO_R_EINVAL invalid argument
4610 * @retval PMINFO_R_ERROR internal error
4611 * @pre pkgmgrinfo_create_pkgdbinfo()
4612 * @post pkgmgrinfo_destroy_pkgdbinfo()
4613 * @see pkgmgrinfo_save_pkgdbinfo()
4614 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4616 static int set_pkg_version_in_db(const char *pkgid)
4619 pkgmgrinfo_pkgdbinfo_h handle;
4620 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4621 if (ret != PMINFO_R_OK)
4623 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4624 if (ret != PMINFO_R_OK) {
4625 pkgmgrinfo_destroy_pkgdbinfo(handle);
4628 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4629 if (ret != PMINFO_R_OK) {
4630 pkgmgrinfo_destroy_pkgdbinfo(handle);
4633 pkgmgrinfo_destroy_pkgdbinfo(handle);
4638 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4641 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4642 * @brief This API sets the package install location in db handle
4644 * @par This API is for package-manager client application
4645 * @par Sync (or) Async : Synchronous API
4647 * @param[in] handle pointer to the pkgdbinfo handle.
4648 * @param[in] location package install location
4649 * @return 0 if success, error code(<0) if fail
4650 * @retval PMINFO_R_OK success
4651 * @retval PMINFO_R_EINVAL invalid argument
4652 * @retval PMINFO_R_ERROR internal error
4653 * @pre pkgmgrinfo_create_pkgdbinfo()
4654 * @post pkgmgrinfo_destroy_pkgdbinfo()
4655 * @see pkgmgrinfo_save_pkgdbinfo()
4656 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4658 static int set_pkg_install_location_in_db(const char *pkgid)
4661 pkgmgrinfo_pkgdbinfo_h handle;
4662 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4663 if (ret != PMINFO_R_OK)
4665 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4666 if (ret != PMINFO_R_OK) {
4667 pkgmgrinfo_destroy_pkgdbinfo(handle);
4670 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4671 if (ret != PMINFO_R_OK) {
4672 pkgmgrinfo_destroy_pkgdbinfo(handle);
4675 pkgmgrinfo_destroy_pkgdbinfo(handle);
4680 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4683 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4684 * @brief This API sets the package size in db handle
4686 * @par This API is for package-manager client application
4687 * @par Sync (or) Async : Synchronous API
4689 * @param[in] handle pointer to the pkgdbinfo handle.
4690 * @param[in] size pointer to the package size
4691 * @return 0 if success, error code(<0) if fail
4692 * @retval PMINFO_R_OK success
4693 * @retval PMINFO_R_EINVAL invalid argument
4694 * @retval PMINFO_R_ERROR internal error
4695 * @pre pkgmgrinfo_create_pkgdbinfo()
4696 * @post pkgmgrinfo_destroy_pkgdbinfo()
4697 * @see pkgmgrinfo_save_pkgdbinfo()
4698 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4700 static int set_pkg_size_in_db(const char *pkgid)
4703 pkgmgrinfo_pkgdbinfo_h handle;
4704 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4705 if (ret != PMINFO_R_OK)
4707 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4708 if (ret != PMINFO_R_OK) {
4709 pkgmgrinfo_destroy_pkgdbinfo(handle);
4712 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4713 if (ret != PMINFO_R_OK) {
4714 pkgmgrinfo_destroy_pkgdbinfo(handle);
4717 pkgmgrinfo_destroy_pkgdbinfo(handle);
4722 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4725 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4726 * @brief This API sets the package label in db handle
4728 * @par This API is for package-manager client application
4729 * @par Sync (or) Async : Synchronous API
4731 * @param[in] handle pointer to the pkgdbinfo handle.
4732 * @param[in] label pointer to the package label
4733 * @param[in] locale pointer to the locale
4734 * @return 0 if success, error code(<0) if fail
4735 * @retval PMINFO_R_OK success
4736 * @retval PMINFO_R_EINVAL invalid argument
4737 * @retval PMINFO_R_ERROR internal error
4738 * @pre pkgmgrinfo_create_pkgdbinfo()
4739 * @post pkgmgrinfo_destroy_pkgdbinfo()
4740 * @see pkgmgrinfo_save_pkgdbinfo()
4741 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4743 static int set_pkg_label_in_db(const char *pkgid)
4746 pkgmgrinfo_pkgdbinfo_h handle;
4747 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4748 if (ret != PMINFO_R_OK)
4750 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4751 if (ret != PMINFO_R_OK) {
4752 pkgmgrinfo_destroy_pkgdbinfo(handle);
4755 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4756 if (ret != PMINFO_R_OK) {
4757 pkgmgrinfo_destroy_pkgdbinfo(handle);
4760 pkgmgrinfo_destroy_pkgdbinfo(handle);
4765 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4768 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4769 * @brief This API sets the package icon in db handle
4771 * @par This API is for package-manager client application
4772 * @par Sync (or) Async : Synchronous API
4774 * @param[in] handle pointer to the pkgdbinfo handle.
4775 * @param[in] icon pointer to the package icon
4776 * @param[in] locale pointer to the locale
4777 * @return 0 if success, error code(<0) if fail
4778 * @retval PMINFO_R_OK success
4779 * @retval PMINFO_R_EINVAL invalid argument
4780 * @retval PMINFO_R_ERROR internal error
4781 * @pre pkgmgrinfo_create_pkgdbinfo()
4782 * @post pkgmgrinfo_destroy_pkgdbinfo()
4783 * @see pkgmgrinfo_save_pkgdbinfo()
4784 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4786 static int set_pkg_icon_in_db(const char *pkgid)
4789 pkgmgrinfo_pkgdbinfo_h handle;
4790 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4791 if (ret != PMINFO_R_OK)
4793 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4794 if (ret != PMINFO_R_OK) {
4795 pkgmgrinfo_destroy_pkgdbinfo(handle);
4798 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4799 if (ret != PMINFO_R_OK) {
4800 pkgmgrinfo_destroy_pkgdbinfo(handle);
4803 pkgmgrinfo_destroy_pkgdbinfo(handle);
4808 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4811 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4812 * @brief This API sets the package description in db handle
4814 * @par This API is for package-manager client application
4815 * @par Sync (or) Async : Synchronous API
4817 * @param[in] handle pointer to the pkgdbinfo handle.
4818 * @param[in] description pointer to the package description
4819 * @param[in] locale pointer to the locale
4820 * @return 0 if success, error code(<0) if fail
4821 * @retval PMINFO_R_OK success
4822 * @retval PMINFO_R_EINVAL invalid argument
4823 * @retval PMINFO_R_ERROR internal error
4824 * @pre pkgmgrinfo_create_pkgdbinfo()
4825 * @post pkgmgrinfo_destroy_pkgdbinfo()
4826 * @see pkgmgrinfo_save_pkgdbinfo()
4827 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4829 static int set_pkg_description_in_db(const char *pkgid)
4832 pkgmgrinfo_pkgdbinfo_h handle;
4833 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4834 if (ret != PMINFO_R_OK)
4836 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4837 if (ret != PMINFO_R_OK) {
4838 pkgmgrinfo_destroy_pkgdbinfo(handle);
4841 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4842 if (ret != PMINFO_R_OK) {
4843 pkgmgrinfo_destroy_pkgdbinfo(handle);
4846 pkgmgrinfo_destroy_pkgdbinfo(handle);
4851 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4854 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4855 const char *author_email, const char *author_href, const char *locale)
4856 * @brief This API sets the package author info in db handle
4858 * @par This API is for package-manager client application
4859 * @par Sync (or) Async : Synchronous API
4861 * @param[in] handle pointer to the pkgdbinfo handle.
4862 * @param[in] author_name pointer to the package author name
4863 * @param[in] author_email pointer to the package author email
4864 * @param[in] author_href pointer to the package author href
4865 * @param[in] locale pointer to the locale
4866 * @return 0 if success, error code(<0) if fail
4867 * @retval PMINFO_R_OK success
4868 * @retval PMINFO_R_EINVAL invalid argument
4869 * @retval PMINFO_R_ERROR internal error
4870 * @pre pkgmgrinfo_create_pkgdbinfo()
4871 * @post pkgmgrinfo_destroy_pkgdbinfo()
4872 * @see pkgmgrinfo_save_pkgdbinfo()
4873 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4875 static int set_pkg_author_in_db(const char *pkgid)
4878 pkgmgrinfo_pkgdbinfo_h handle;
4879 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4880 if (ret != PMINFO_R_OK)
4882 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4883 if (ret != PMINFO_R_OK) {
4884 pkgmgrinfo_destroy_pkgdbinfo(handle);
4887 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4888 if (ret != PMINFO_R_OK) {
4889 pkgmgrinfo_destroy_pkgdbinfo(handle);
4892 pkgmgrinfo_destroy_pkgdbinfo(handle);
4897 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4898 const char *author_email, const char *author_href, const char *locale);
4901 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4902 * @brief This API sets the package 'removable' value in db handle
4904 * @par This API is for package-manager client application
4905 * @par Sync (or) Async : Synchronous API
4907 * @param[in] handle pointer to the pkgdbinfo handle.
4908 * @param[in] removable package removable value
4909 * @return 0 if success, error code(<0) if fail
4910 * @retval PMINFO_R_OK success
4911 * @retval PMINFO_R_EINVAL invalid argument
4912 * @retval PMINFO_R_ERROR internal error
4913 * @pre pkgmgrinfo_create_pkgdbinfo()
4914 * @post pkgmgrinfo_destroy_pkgdbinfo()
4915 * @see pkgmgrinfo_save_pkgdbinfo()
4916 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4918 static int set_pkg_removable_in_db(const char *pkgid)
4921 pkgmgrinfo_pkgdbinfo_h handle;
4922 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4923 if (ret != PMINFO_R_OK)
4925 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4926 if (ret != PMINFO_R_OK) {
4927 pkgmgrinfo_destroy_pkgdbinfo(handle);
4930 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4931 if (ret != PMINFO_R_OK) {
4932 pkgmgrinfo_destroy_pkgdbinfo(handle);
4935 pkgmgrinfo_destroy_pkgdbinfo(handle);
4940 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4943 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4944 * @brief This API sets the package 'preload' value in db handle
4946 * @par This API is for package-manager client application
4947 * @par Sync (or) Async : Synchronous API
4949 * @param[in] handle pointer to the pkgdbinfo handle.
4950 * @param[in] preload package preload value
4951 * @return 0 if success, error code(<0) if fail
4952 * @retval PMINFO_R_OK success
4953 * @retval PMINFO_R_EINVAL invalid argument
4954 * @retval PMINFO_R_ERROR internal error
4955 * @pre pkgmgrinfo_create_pkgdbinfo()
4956 * @post pkgmgrinfo_destroy_pkgdbinfo()
4957 * @see pkgmgrinfo_save_pkgdbinfo()
4958 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4960 static int set_pkg_preload_in_db(const char *pkgid)
4963 pkgmgrinfo_pkgdbinfo_h handle;
4964 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4965 if (ret != PMINFO_R_OK)
4967 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4968 if (ret != PMINFO_R_OK) {
4969 pkgmgrinfo_destroy_pkgdbinfo(handle);
4972 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4973 if (ret != PMINFO_R_OK) {
4974 pkgmgrinfo_destroy_pkgdbinfo(handle);
4977 pkgmgrinfo_destroy_pkgdbinfo(handle);
4982 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4985 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4986 * @brief This API sets the package 'installed_storage' value in db handle
4988 * @par This API is for package-manager client application
4989 * @par Sync (or) Async : Synchronous API
4991 * @param[in] handle pointer to the pkgdbinfo handle.
4992 * @param[in] location installed_storage value
4993 * @return 0 if success, error code(<0) if fail
4994 * @retval PMINFO_R_OK success
4995 * @retval PMINFO_R_EINVAL invalid argument
4996 * @retval PMINFO_R_ERROR internal error
4997 * @pre pkgmgrinfo_create_pkgdbinfo()
4998 * @post pkgmgrinfo_destroy_pkgdbinfo()
4999 * @see pkgmgrinfo_save_pkgdbinfo()
5001 static int set_pkg_installed_storage_in_db(const char *pkgid)
5004 pkgmgrinfo_pkgdbinfo_h handle;
5005 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5006 if (ret != PMINFO_R_OK)
5008 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5009 if (ret != PMINFO_R_OK) {
5010 pkgmgrinfo_destroy_pkgdbinfo(handle);
5013 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5014 if (ret != PMINFO_R_OK) {
5015 pkgmgrinfo_destroy_pkgdbinfo(handle);
5018 pkgmgrinfo_destroy_pkgdbinfo(handle);
5023 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5026 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5027 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5028 * @brief This API saves all the information from the handle to the DB.
5030 * @par This API is for package-manager client application
5031 * @par Sync (or) Async : Synchronous API
5033 * @param[in] handle pointer to the package db info handle.
5034 * @param[in] uid the addressee user id of the instruction
5035 * @return 0 if success, error code(<0) if fail
5036 * @retval PMINFO_R_OK success
5037 * @retval PMINFO_R_EINVAL invalid argument
5038 * @retval PMINFO_R_ERROR internal error
5039 * @pre pkgmgrinfo_create_pkgdbinfo()
5040 * @post pkgmgrinfo_destroy_pkgdbinfo()
5041 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5043 static int set_pkg_in_db(const char *pkgid)
5046 pkgmgrinfo_pkgdbinfo_h handle;
5047 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5048 if (ret != PMINFO_R_OK)
5050 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5051 if (ret != PMINFO_R_OK) {
5052 pkgmgrinfo_destroy_pkgdbinfo(handle);
5055 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5056 if (ret != PMINFO_R_OK) {
5057 pkgmgrinfo_destroy_pkgdbinfo(handle);
5060 pkgmgrinfo_destroy_pkgdbinfo(handle);
5065 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5066 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5068 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5069 * @brief This API destroys the package db information handle freeing up all the resources
5071 * @par This API is for package-manager client application
5072 * @par Sync (or) Async : Synchronous API
5074 * @param[in] handle pointer to the package db info handle.
5075 * @return 0 if success, error code(<0) if fail
5076 * @retval PMINFO_R_OK success
5077 * @retval PMINFO_R_EINVAL invalid argument
5078 * @retval PMINFO_R_ERROR internal error
5079 * @pre pkgmgrinfo_create_pkgdbinfo()
5081 * @see pkgmgrinfo_save_pkgdbinfo()
5082 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5084 static int set_pkg_in_db(const char *pkgid)
5087 pkgmgrinfo_pkgdbinfo_h handle;
5088 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5089 if (ret != PMINFO_R_OK)
5091 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5092 if (ret != PMINFO_R_OK) {
5093 pkgmgrinfo_destroy_pkgdbinfo(handle);
5096 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5097 if (ret != PMINFO_R_OK) {
5098 pkgmgrinfo_destroy_pkgdbinfo(handle);
5101 pkgmgrinfo_destroy_pkgdbinfo(handle);
5106 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5110 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5111 * @brief This API creates the package cert information handle to set data in db.
5113 * @par This API is for package-manager client application
5114 * @par Sync (or) Async : Synchronous API
5116 * @param[out] handle pointer to the package cert handle.
5117 * @return 0 if success, error code(<0) if fail
5118 * @retval PMINFO_R_OK success
5119 * @retval PMINFO_R_EINVAL invalid argument
5120 * @retval PMINFO_R_ERROR internal error
5122 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5123 * @see pkgmgrinfo_set_cert_value()
5124 * @see pkgmgrinfo_save_certinfo()
5126 static int set_cert_in_db(const char *pkgid)
5129 pkgmgrinfo_instcertinfo_h handle;
5130 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5131 if (ret != PMINFO_R_OK)
5133 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5134 if (ret != PMINFO_R_OK) {
5135 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5138 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5139 if (ret != PMINFO_R_OK) {
5140 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5143 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5148 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5151 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5152 * @brief This API sets the package cert information in the handle.
5154 * @par This API is for package-manager client application
5155 * @par Sync (or) Async : Synchronous API
5157 * @param[in] handle pointer to the package cert handle.
5158 * @param[in] cert_type certificate type.
5159 * @param[in] cert_value certificate value.
5160 * @return 0 if success, error code(<0) if fail
5161 * @retval PMINFO_R_OK success
5162 * @retval PMINFO_R_EINVAL invalid argument
5163 * @retval PMINFO_R_ERROR internal error
5164 * @pre pkgmgrinfo_create_certinfo_set_handle()
5165 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5166 * @see pkgmgrinfo_save_certinfo()
5168 static int set_cert_in_db(const char *pkgid)
5171 pkgmgrinfo_instcertinfo_h handle;
5172 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5173 if (ret != PMINFO_R_OK)
5175 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5176 if (ret != PMINFO_R_OK) {
5177 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5180 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5181 if (ret != PMINFO_R_OK) {
5182 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5185 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5190 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5193 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5194 * @brief This API saves the package cert information in the DB.
5196 * @par This API is for package-manager client application
5197 * @par Sync (or) Async : Synchronous API
5199 * @param[in] pkgid pointer to the package ID.
5200 * @param[in] handle pointer to the package cert handle.
5201 * @return 0 if success, error code(<0) if fail
5202 * @retval PMINFO_R_OK success
5203 * @retval PMINFO_R_EINVAL invalid argument
5204 * @retval PMINFO_R_ERROR internal error
5205 * @pre pkgmgrinfo_create_certinfo_set_handle()
5206 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5207 * @see pkgmgrinfo_save_certinfo()
5209 static int set_cert_in_db(const char *pkgid)
5212 pkgmgrinfo_instcertinfo_h handle;
5213 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5214 if (ret != PMINFO_R_OK)
5216 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5217 if (ret != PMINFO_R_OK) {
5218 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5221 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5222 if (ret != PMINFO_R_OK) {
5223 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5226 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5231 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5234 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5235 * @brief This API destroys the package cert information handle freeing up all the resources.
5237 * @par This API is for package-manager client application
5238 * @par Sync (or) Async : Synchronous API
5240 * @param[in] handle pointer to the package cert handle.
5241 * @return 0 if success, error code(<0) if fail
5242 * @retval PMINFO_R_OK success
5243 * @retval PMINFO_R_EINVAL invalid argument
5244 * @retval PMINFO_R_ERROR internal error
5245 * @pre pkgmgrinfo_create_certinfo_set_handle()
5247 * @see pkgmgrinfo_save_certinfo()
5249 static int set_cert_in_db(const char *pkgid)
5252 pkgmgrinfo_instcertinfo_h handle;
5253 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5254 if (ret != PMINFO_R_OK)
5256 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5257 if (ret != PMINFO_R_OK) {
5258 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5261 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5262 if (ret != PMINFO_R_OK) {
5263 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5266 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5271 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5274 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5275 * @brief This API gets the datacontrol info
5277 * @par This API is for package-manager client application
5278 * @par Sync (or) Async : Synchronous API
5280 * @param[in] providerid pointer to the providerid of dataconltrol.
5281 * @param[in] type pointer to the type of dataconltrol.
5282 * @param[out] appid pointer to hold appid, need to free after using
5283 * @param[out] access pointer to hold access, need to free after using
5284 * @return 0 if success, error code(<0) if fail
5285 * @retval PMINFO_R_OK success
5286 * @retval PMINFO_R_EINVAL invalid argument
5287 * @retval PMINFO_R_ERROR internal error
5290 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5293 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5294 * @brief This API gets the application 'guest mode visibility' value from the DB
5296 * @par This API is for package-manager client application
5297 * @par Sync (or) Async : Synchronous API
5299 * @param[in] handle pointer to application info handle
5300 * @param[out] status pointer to hold app guest mode visibility value
5301 * @return 0 if success, error code(<0) if fail
5302 * @retval PMINFO_R_OK success
5303 * @retval PMINFO_R_EINVAL invalid argument
5304 * @retval PMINFO_R_ERROR internal error
5305 * @pre pkgmgrinfo_appinfo_get_appinfo()
5306 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5307 * @see pkgmgrinfo_appinfo_get_appid()
5308 * @see pkgmgrinfo_appinfo_is_multiple()
5310 static int get_app_guestmode_visibility(const char *appid)
5314 pkgmgrinfo_appinfo_h handle;
5315 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5316 if (ret != PMINFO_R_OK)
5318 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5319 if (ret != PMINFO_R_OK) {
5320 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5323 printf("app guest mode visibility: %d\n", status);
5324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5329 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5332 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5333 * @brief This API sets the application 'guest mode visibility' value in the DB
5335 * @par This API is for package-manager client application
5336 * @par Sync (or) Async : Synchronous API
5338 * @param[in] handle pointer to application info handle
5339 * @param[out] status app guest mode visibility value
5340 * @return 0 if success, error code(<0) if fail
5341 * @retval PMINFO_R_OK success
5342 * @retval PMINFO_R_EINVAL invalid argument
5343 * @retval PMINFO_R_ERROR internal error
5344 * @pre pkgmgrinfo_appinfo_get_appinfo()
5345 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5346 * @see pkgmgrinfo_appinfo_get_appid()
5347 * @see pkgmgrinfo_appinfo_is_multiple()
5349 static int set_app_guestmode_visibility(const char *appid, bool value)
5352 pkgmgrinfo_appinfo_h handle;
5353 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5354 if (ret != PMINFO_R_OK)
5356 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5357 if (ret != PMINFO_R_OK) {
5358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5366 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5367 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5369 * @pkgmgrinfo client API
5373 * @brief listening status type in pkgmgrinfo.
5375 #define PMINFO_CLIENT_STATUS_ALL 0x00
5376 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5377 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5378 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5379 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5380 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5381 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5384 * @brief type definition.
5386 typedef void pkgmgrinfo_client;
5387 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5388 const char *pkgid, const char *key,
5389 const char *val, const void *pmsg, void *data);
5395 }pkgmgrinfo_client_type;
5398 * @brief This APIs provides pkgmgrinfo client listener
5400 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5401 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5402 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5403 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5404 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5407 * @pkgmgrinfo client API end
5415 #endif /* __PKG_INFO_H__ */