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 *getIconPath(uid_t uid);
446 char *getUserPkgParserDBPath(void);
447 char *getUserPkgParserDBPathUID(uid_t uid);
448 char *getUserPkgCertDBPath(void);
449 char *getUserPkgCertDBPathUID(uid_t uid);
450 const char* getUserDesktopPath(uid_t uid);
451 const char* getUserManifestPath(uid_t uid);
454 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
455 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
456 * @brief This API gets list of installed packages
458 * @par This API is for package-manager client application
459 * @par Sync (or) Async : Synchronous API
460 * @param[in] pkg_list_cb iteration function for list
461 * @param[in] user_data user data to be passed to callback function
462 * @param[in] uid the addressee user id of the instruction
463 * @return 0 if success, error code(<0) if fail
464 * @retval PMINFO_R_OK success
465 * @retval PMINFO_R_EINVAL invalid argument
466 * @retval PMINFO_R_ERROR internal error
470 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
474 pkgid1 = (char *)user_data;
475 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
476 if (strcmp(pkgid1, pkgid2) == 0) {
483 static int list_pkgs()
486 char *name = "helloworld";
487 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
488 if (ret != PMINFO_R_OK) {
495 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
496 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
498 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
499 * @brief This API creates the package information handle from db
501 * @par This API is for package-manager client application
502 * @par Sync (or) Async : Synchronous API
504 * @param[in] pkgid pointer to package ID
505 * @param[in] uid the addressee user id of the instruction
506 * @param[out] handle pointer to the package info handle.
507 * @return 0 if success, error code(<0) if fail
508 * @retval PMINFO_R_OK success
509 * @retval PMINFO_R_EINVAL invalid argument
510 * @retval PMINFO_R_ERROR internal error
512 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
513 * @see pkgmgrinfo_pkginfo_get_pkgid()
514 * @see pkgmgrinfo_pkginfo_is_removable()
516 static int get_pkg_type(const char *pkgid)
520 pkgmgrinfo_pkginfo_h handle;
521 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
522 if (ret != PMINFO_R_OK)
524 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
525 if (ret != PMINFO_R_OK) {
526 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
529 printf("pkgtype: %s\n", type);
530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
535 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
536 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
539 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
540 * @brief This API gets the package name from the package ID
542 * @par This API is for package-manager client application
543 * @par Sync (or) Async : Synchronous API
545 * @param[in] handle pointer to package info handle
546 * @param[out] pkg_name pointer to hold package name
547 * @return 0 if success, error code(<0) if fail
548 * @retval PMINFO_R_OK success
549 * @retval PMINFO_R_EINVAL invalid argument
550 * @retval PMINFO_R_ERROR internal error
551 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
552 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
553 * @see pkgmgrinfo_pkginfo_get_type()
554 * @see pkgmgrinfo_pkginfo_is_removable()
556 static int get_pkg_name(const char *pkgid)
559 char *pkgname = NULL;
560 pkgmgrinfo_pkginfo_h handle;
561 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
562 if (ret != PMINFO_R_OK)
564 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
565 if (ret != PMINFO_R_OK) {
566 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
569 printf("pkgname: %s\n", pkgname);
570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
575 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
578 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
579 * @brief This API gets the package id from the package ID
581 * @par This API is for package-manager client application
582 * @par Sync (or) Async : Synchronous API
584 * @param[in] handle pointer to package info handle
585 * @param[out] pkgid pointer to hold package id
586 * @return 0 if success, error code(<0) if fail
587 * @retval PMINFO_R_OK success
588 * @retval PMINFO_R_EINVAL invalid argument
589 * @retval PMINFO_R_ERROR internal error
590 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
591 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
592 * @see pkgmgrinfo_pkginfo_get_type()
593 * @see pkgmgrinfo_pkginfo_is_removable()
595 static int get_pkgid(const char *pkgid)
599 pkgmgrinfo_pkginfo_h handle;
600 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
601 if (ret != PMINFO_R_OK)
603 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
604 if (ret != PMINFO_R_OK) {
605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
608 printf("pkg id: %s\n", pkg_id);
609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
614 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
617 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
618 * @brief This API gets the package type from the package ID
620 * @par This API is for package-manager client application
621 * @par Sync (or) Async : Synchronous API
623 * @param[in] handle pointer to package info handle
624 * @param[out] type pointer to hold package type
625 * @return 0 if success, error code(<0) if fail
626 * @retval PMINFO_R_OK success
627 * @retval PMINFO_R_EINVAL invalid argument
628 * @retval PMINFO_R_ERROR internal error
629 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
630 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
631 * @see pkgmgrinfo_pkginfo_get_pkgid()
632 * @see pkgmgrinfo_pkginfo_is_removable()
634 static int get_pkg_type(const char *pkgid)
638 pkgmgrinfo_pkginfo_h handle;
639 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
640 if (ret != PMINFO_R_OK)
642 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
643 if (ret != PMINFO_R_OK) {
644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
647 printf("pkgtype: %s\n", type);
648 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
653 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
656 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
657 * @brief This API gets the package version from the package ID
659 * @par This API is for package-manager client application
660 * @par Sync (or) Async : Synchronous API
662 * @param[in] handle pointer to package info handle
663 * @param[out] version pointer to hold package version
664 * @return 0 if success, error code(<0) if fail
665 * @retval PMINFO_R_OK success
666 * @retval PMINFO_R_EINVAL invalid argument
667 * @retval PMINFO_R_ERROR internal error
668 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
669 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
670 * @see pkgmgrinfo_pkginfo_get_pkgid()
671 * @see pkgmgrinfo_pkginfo_is_removable()
673 static int get_pkg_version(const char *pkgid)
676 char *version = NULL;
677 pkgmgrinfo_pkginfo_h handle;
678 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
679 if (ret != PMINFO_R_OK)
681 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
682 if (ret != PMINFO_R_OK) {
683 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
686 printf("pkg version: %s\n", version);
687 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
692 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
695 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
696 * @brief This API gets the package install location from the package ID
698 * @par This API is for package-manager client application
699 * @par Sync (or) Async : Synchronous API
701 * @param[in] handle pointer to package info handle
702 * @param[out] location pointer to hold package install location
703 * @return 0 if success, error code(<0) if fail
704 * @retval PMINFO_R_OK success
705 * @retval PMINFO_R_EINVAL invalid argument
706 * @retval PMINFO_R_ERROR internal error
707 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
708 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
709 * @see pkgmgrinfo_pkginfo_get_pkgid()
710 * @see pkgmgrinfo_pkginfo_is_removable()
712 static int get_pkg_install_location(const char *pkgid)
715 pkgmgrinfo_install_location location;
716 pkgmgrinfo_pkginfo_h handle;
717 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
718 if (ret != PMINFO_R_OK)
720 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
721 if (ret != PMINFO_R_OK) {
722 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
725 printf("pkg install location: %d\n", location);
726 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
731 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
734 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
735 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
736 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
737 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
739 * @par This API is for package-manager client application
740 * @par Sync (or) Async : Synchronous API
742 * @param[in] handle pointer to package info handle
743 * @param[out] size pointer to hold package size
744 * @return 0 if success, error code(<0) if fail
745 * @retval PMINFO_R_OK success
746 * @retval PMINFO_R_EINVAL invalid argument
747 * @retval PMINFO_R_ERROR internal error
748 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
749 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
750 * @see pkgmgrinfo_pkginfo_get_pkgid()
751 * @see pkgmgrinfo_pkginfo_is_removable()
753 static int get_pkg_size(const char *pkgid)
757 pkgmgrinfo_pkginfo_h handle;
758 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
759 if (ret != PMINFO_R_OK)
761 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
762 if (ret != PMINFO_R_OK) {
763 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
766 printf("pkgsize: %d\n", size);
767 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
772 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
775 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
776 * @brief This API gets the installed package total size on the target.
778 * @par This API is for package-manager client application
779 * @par Sync (or) Async : Synchronous API
781 * @param[in] handle pointer to package info handle
782 * @param[out] size pointer to hold package total size
783 * @return 0 if success, error code(<0) if fail
784 * @retval PMINFO_R_OK success
785 * @retval PMINFO_R_EINVAL invalid argument
786 * @retval PMINFO_R_ERROR internal error
788 static int get_pkg_total_size(const char *pkgid)
792 pkgmgrinfo_pkginfo_h handle;
793 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
794 if (ret != PMINFO_R_OK)
796 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
797 if (ret != PMINFO_R_OK) {
798 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
801 printf("pkg total size: %d\n", size);
802 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
807 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
810 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
811 * @brief This API gets the installed package data size on the target.
813 * @par This API is for package-manager client application
814 * @par Sync (or) Async : Synchronous API
816 * @param[in] handle pointer to package info handle
817 * @param[out] size pointer to hold package data size
818 * @return 0 if success, error code(<0) if fail
819 * @retval PMINFO_R_OK success
820 * @retval PMINFO_R_EINVAL invalid argument
821 * @retval PMINFO_R_ERROR internal error
823 static int get_pkg_data_size(const char *pkgid)
827 pkgmgrinfo_pkginfo_h handle;
828 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
829 if (ret != PMINFO_R_OK)
831 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
832 if (ret != PMINFO_R_OK) {
833 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
836 printf("pkg data size: %d\n", size);
837 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
842 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
845 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
846 * @brief This API gets the package icon from the package ID
848 * @par This API is for package-manager client application
849 * @par Sync (or) Async : Synchronous API
851 * @param[in] handle pointer to package info handle
852 * @param[out] icon pointer to hold package icon
853 * @return 0 if success, error code(<0) if fail
854 * @retval PMINFO_R_OK success
855 * @retval PMINFO_R_EINVAL invalid argument
856 * @retval PMINFO_R_ERROR internal error
857 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
858 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
859 * @see pkgmgrinfo_pkginfo_get_pkgid()
860 * @see pkgmgrinfo_pkginfo_is_removable()
862 static int get_pkg_icon(const char *pkgid)
866 pkgmgrinfo_pkginfo_h handle;
867 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
868 if (ret != PMINFO_R_OK)
870 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
871 if (ret != PMINFO_R_OK) {
872 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
875 printf("pkg icon: %s\n", icon);
876 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
881 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
884 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
885 * @brief This API gets the package description from the package ID
887 * @par This API is for package-manager client application
888 * @par Sync (or) Async : Synchronous API
890 * @param[in] handle pointer to package info handle
891 * @param[out] description pointer to hold package description
892 * @return 0 if success, error code(<0) if fail
893 * @retval PMINFO_R_OK success
894 * @retval PMINFO_R_EINVAL invalid argument
895 * @retval PMINFO_R_ERROR internal error
896 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
897 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
898 * @see pkgmgrinfo_pkginfo_get_pkgid()
899 * @see pkgmgrinfo_pkginfo_is_removable()
901 static int get_pkg_description(const char *pkgid)
904 char *description = NULL;
905 pkgmgrinfo_pkginfo_h handle;
906 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
907 if (ret != PMINFO_R_OK)
909 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
910 if (ret != PMINFO_R_OK) {
911 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
914 printf("pkg description: %s\n", description);
915 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
920 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
923 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
924 * @brief This API gets the package's author name from the package ID
926 * @par This API is for package-manager client application
927 * @par Sync (or) Async : Synchronous API
929 * @param[in] handle pointer to package info handle
930 * @param[out] author_name pointer to hold package author name
931 * @return 0 if success, error code(<0) if fail
932 * @retval PMINFO_R_OK success
933 * @retval PMINFO_R_EINVAL invalid argument
934 * @retval PMINFO_R_ERROR internal error
935 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
936 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
937 * @see pkgmgrinfo_pkginfo_get_pkgid()
938 * @see pkgmgrinfo_pkginfo_is_removable()
940 static int get_pkg_author_name(const char *pkgid)
943 char *author_name = NULL;
944 pkgmgrinfo_pkginfo_h handle;
945 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
946 if (ret != PMINFO_R_OK)
948 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
949 if (ret != PMINFO_R_OK) {
950 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
953 printf("pkg author name: %s\n", author_name);
954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
959 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
962 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
963 * @brief This API gets the package's author email from the package ID
965 * @par This API is for package-manager client application
966 * @par Sync (or) Async : Synchronous API
968 * @param[in] handle pointer to package info handle
969 * @param[out] author_email pointer to hold package author email
970 * @return 0 if success, error code(<0) if fail
971 * @retval PMINFO_R_OK success
972 * @retval PMINFO_R_EINVAL invalid argument
973 * @retval PMINFO_R_ERROR internal error
974 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
975 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
976 * @see pkgmgrinfo_pkginfo_get_pkgid()
977 * @see pkgmgrinfo_pkginfo_is_removable()
979 static int get_pkg_author_email(const char *pkgid)
982 char *author_email = NULL;
983 pkgmgrinfo_pkginfo_h handle;
984 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
985 if (ret != PMINFO_R_OK)
987 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
988 if (ret != PMINFO_R_OK) {
989 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
992 printf("pkg author email: %s\n", author_email);
993 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
998 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1001 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1002 * @brief This API gets the package's author href from the package ID
1004 * @par This API is for package-manager client application
1005 * @par Sync (or) Async : Synchronous API
1007 * @param[in] handle pointer to package info handle
1008 * @param[out] author_href pointer to hold package author href
1009 * @return 0 if success, error code(<0) if fail
1010 * @retval PMINFO_R_OK success
1011 * @retval PMINFO_R_EINVAL invalid argument
1012 * @retval PMINFO_R_ERROR internal error
1013 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1014 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1015 * @see pkgmgrinfo_pkginfo_get_pkgid()
1016 * @see pkgmgrinfo_pkginfo_is_removable()
1018 static int get_pkg_author_href(const char *pkgid)
1021 char *author_href = NULL;
1022 pkgmgrinfo_pkginfo_h handle;
1023 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1024 if (ret != PMINFO_R_OK)
1026 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1027 if (ret != PMINFO_R_OK) {
1028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1031 printf("pkg author href: %s\n", author_href);
1032 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1037 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1040 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1041 * @brief This API gets the package installed storagae value from the package ID
1043 * @par This API is for package-manager client application
1044 * @par Sync (or) Async : Synchronous API
1046 * @param[in] handle pointer to package info handle
1047 * @param[out] storage pointer to hold package installed storage
1048 * @return 0 if success, error code(<0) if fail
1049 * @retval PMINFO_R_OK success
1050 * @retval PMINFO_R_EINVAL invalid argument
1051 * @retval PMINFO_R_ERROR internal error
1052 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1053 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1054 * @see pkgmgrinfo_pkginfo_get_pkgid()
1055 * @see pkgmgrinfo_pkginfo_is_removable()
1057 static int get_pkg_installed_storage(const char *pkgid)
1060 pkgmgrinfo_installed_storage storage;
1061 pkgmgrinfo_pkginfo_h handle;
1062 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1063 if (ret != PMINFO_R_OK)
1065 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1066 if (ret != PMINFO_R_OK) {
1067 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1070 printf("pkg installed storage: %d\n", storage);
1071 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1076 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1079 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1080 * @brief This API gets the installed time of package from the package ID
1082 * @par This API is for package-manager client application
1083 * @par Sync (or) Async : Synchronous API
1085 * @param[in] handle pointer to package info handle
1086 * @param[out] installed_time pointer to hold installed time of package
1087 * @return 0 if success, error code(<0) if fail
1088 * @retval PMINFO_R_OK success
1089 * @retval PMINFO_R_EINVAL invalid argument
1090 * @retval PMINFO_R_ERROR internal error
1091 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1092 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1093 * @see pkgmgrinfo_pkginfo_get_pkgid()
1094 * @see pkgmgrinfo_pkginfo_is_removable()
1096 static int get_pkg_installed_time(const char *pkgid)
1099 int installed_time = 0;
1100 pkgmgrinfo_pkginfo_h handle;
1101 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1102 if (ret != PMINFO_R_OK)
1104 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1105 if (ret != PMINFO_R_OK) {
1106 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1109 printf("installed_time: %d\n", installed_time);
1110 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1115 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1118 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1119 * @brief This API gets the store client id of package from the package ID
1121 * @par This API is for package-manager client application
1122 * @par Sync (or) Async : Synchronous API
1124 * @param[in] handle pointer to package info handle
1125 * @param[out] storeclientid pointer to hold store client id of package
1126 * @return 0 if success, error code(<0) if fail
1127 * @retval PMINFO_R_OK success
1128 * @retval PMINFO_R_EINVAL invalid argument
1129 * @retval PMINFO_R_ERROR internal error
1130 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1131 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1132 * @see pkgmgrinfo_pkginfo_get_pkgid()
1133 * @see pkgmgrinfo_pkginfo_is_removable()
1135 static int get_pkg_storeclientid(const char *pkgid)
1138 char *storeclientid = 0;
1139 pkgmgrinfo_pkginfo_h handle;
1140 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1141 if (ret != PMINFO_R_OK)
1143 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1144 if (ret != PMINFO_R_OK) {
1145 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1148 printf(store client id: %s\n", storeclientid);
1149 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1154 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1157 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1158 * @brief This API gets the main app id of package from the package ID
1160 * @par This API is for package-manager client application
1161 * @par Sync (or) Async : Synchronous API
1163 * @param[in] handle pointer to package info handle
1164 * @param[out] mainappid pointer to hold main app id of package
1165 * @return 0 if success, error code(<0) if fail
1166 * @retval PMINFO_R_OK success
1167 * @retval PMINFO_R_EINVAL invalid argument
1168 * @retval PMINFO_R_ERROR internal error
1169 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1170 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1171 * @see pkgmgrinfo_pkginfo_get_pkgid()
1172 * @see pkgmgrinfo_pkginfo_is_removable()
1174 static int get_pkg_mainappid(const char *pkgid)
1177 char *mainappid = 0;
1178 pkgmgrinfo_pkginfo_h handle;
1179 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1180 if (ret != PMINFO_R_OK)
1182 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1183 if (ret != PMINFO_R_OK) {
1184 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1187 printf(main app id: %s\n", mainappid);
1188 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1193 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1196 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1197 * @brief This API gets the url of package from the package ID
1199 * @par This API is for package-manager client application
1200 * @par Sync (or) Async : Synchronous API
1202 * @param[in] handle pointer to package info handle
1203 * @param[out] url pointer to hold url of package
1204 * @return 0 if success, error code(<0) if fail
1205 * @retval PMINFO_R_OK success
1206 * @retval PMINFO_R_EINVAL invalid argument
1207 * @retval PMINFO_R_ERROR internal error
1208 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1209 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1210 * @see pkgmgrinfo_pkginfo_get_pkgid()
1211 * @see pkgmgrinfo_pkginfo_is_removable()
1213 static int get_pkg_url(const char *pkgid)
1217 pkgmgrinfo_pkginfo_h handle;
1218 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1219 if (ret != PMINFO_R_OK)
1221 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1222 if (ret != PMINFO_R_OK) {
1223 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1226 printf("url : %s\n", url);
1227 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1232 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1236 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1237 * @brief This API gets the root path of package
1239 * @par Sync (or) Async : Synchronous API
1241 * @param[in] handle pointer to package info handle
1242 * @param[out] path pointer to hold root path of package
1243 * @return 0 if success, error code(<0) if fail
1244 * @retval PMINFO_R_OK success
1245 * @retval PMINFO_R_EINVAL invalid argument
1246 * @retval PMINFO_R_ERROR internal error
1248 static int get_root_path(const char *pkgid)
1252 pkgmgrinfo_pkginfo_h handle;
1253 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1254 if (ret != PMINFO_R_OK)
1257 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1258 if (ret != PMINFO_R_OK) {
1259 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1262 printf("path : %s\n", path);
1263 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1269 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1273 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1274 * @brief This API gets the csc path of package
1276 * @par Sync (or) Async : Synchronous API
1278 * @param[in] handle pointer to package info handle
1279 * @param[out] path pointer to hold csc path of package
1280 * @return 0 if success, error code(<0) if fail
1281 * @retval PMINFO_R_OK success
1282 * @retval PMINFO_R_EINVAL invalid argument
1283 * @retval PMINFO_R_ERROR internal error
1285 static int get_csc_path(const char *pkgid)
1289 pkgmgrinfo_pkginfo_h handle;
1290 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1291 if (ret != PMINFO_R_OK)
1294 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1295 if (ret != PMINFO_R_OK) {
1296 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1299 printf("path : %s\n", path);
1300 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1306 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1309 * @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)
1310 * @brief This API compare the cert information from given package id
1312 * @par This API is for package-manager client application
1313 * @par Sync (or) Async : Synchronous API
1315 * @param[in] lhs_package_id pointer to first package ID
1316 * @param[in] rhs_package_id pointer to second package ID
1317 * @param[out] compare_result pointer to the compare result.
1318 * @return 0 if success, error code(<0) if fail
1319 * @retval PMINFO_R_OK success
1320 * @retval PMINFO_R_EINVAL invalid argument
1321 * @retval PMINFO_R_ERROR internal error
1323 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1324 * @see pkgmgrinfo_pkginfo_get_pkgid()
1325 * @see pkgmgrinfo_pkginfo_is_removable()
1327 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1330 pkgmgrinfo_cert_compare_result_type_e result;
1332 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1333 if (ret != PMINFO_R_OK) {
1336 printf("result: %d\n", result);
1341 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);
1342 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);
1344 * @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)
1345 * @brief This API compare the cert information from given app id
1347 * @par This API is for package-manager client application
1348 * @par Sync (or) Async : Synchronous API
1350 * @param[in] lhs_app_id pointer to first app ID
1351 * @param[in] rhs_app_id pointer to second app ID
1352 * @param[out] compare_result pointer to the compare result.
1353 * @return 0 if success, error code(<0) if fail
1354 * @retval PMINFO_R_OK success
1355 * @retval PMINFO_R_EINVAL invalid argument
1356 * @retval PMINFO_R_ERROR internal error
1358 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1359 * @see pkgmgrinfo_pkginfo_get_pkgid()
1360 * @see pkgmgrinfo_pkginfo_is_removable()
1362 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1365 pkgmgrinfo_cert_compare_result_type_e result;
1367 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1368 if (ret != PMINFO_R_OK) {
1371 printf("result: %d\n", result);
1376 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);
1377 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);
1379 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1380 * @brief This API gets the package 'removable' value from the package ID
1382 * @par This API is for package-manager client application
1383 * @par Sync (or) Async : Synchronous API
1385 * @param[in] handle pointer to package info handle
1386 * @param[out] removable pointer to hold package removable value
1387 * @return 0 if success, error code(<0) if fail
1388 * @retval PMINFO_R_OK success
1389 * @retval PMINFO_R_EINVAL invalid argument
1390 * @retval PMINFO_R_ERROR internal error
1391 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1392 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1393 * @see pkgmgrinfo_pkginfo_get_pkgid()
1394 * @see pkgmgrinfo_pkginfo_is_readonly()
1396 static int get_pkg_removable(const char *pkgid)
1400 pkgmgrinfo_pkginfo_h handle;
1401 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1402 if (ret != PMINFO_R_OK)
1404 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1405 if (ret != PMINFO_R_OK) {
1406 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1409 printf("pkg removable: %d\n", removable);
1410 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1415 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1418 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1419 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1421 * @par This API is for package-manager client application
1422 * @par Sync (or) Async : Synchronous API
1424 * @param[in] handle pointer to package info handle
1425 * @param[out] movable pointer to hold package movable state
1426 * @return 0 if success, error code(<0) if fail
1427 * @retval PMINFO_R_OK success
1428 * @retval PMINFO_R_EINVAL invalid argument
1429 * @retval PMINFO_R_ERROR internal error
1430 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1431 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1432 * @see pkgmgrinfo_pkginfo_get_pkgid()
1434 static int get_pkg_movable(const char *pkgid)
1438 pkgmgrinfo_pkginfo_h handle;
1439 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1440 if (ret != PMINFO_R_OK)
1442 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1443 if (ret != PMINFO_R_OK) {
1444 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1447 printf("pkg movable: %d\n", movable);
1448 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1453 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1456 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1457 * @brief This API gets the package 'preload' value from the package ID
1459 * @par This API is for package-manager client application
1460 * @par Sync (or) Async : Synchronous API
1462 * @param[in] handle pointer to package info handle
1463 * @param[out] preload pointer to hold package preload value
1464 * @return 0 if success, error code(<0) if fail
1465 * @retval PMINFO_R_OK success
1466 * @retval PMINFO_R_EINVAL invalid argument
1467 * @retval PMINFO_R_ERROR internal error
1468 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1469 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1470 * @see pkgmgrinfo_pkginfo_get_pkgid()
1471 * @see pkgmgrinfo_pkginfo_is_readonly()
1473 static int get_pkg_preload(const char *pkgid)
1477 pkgmgrinfo_pkginfo_h handle;
1478 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1479 if (ret != PMINFO_R_OK)
1481 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1482 if (ret != PMINFO_R_OK) {
1483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1486 printf("pkg preload: %d\n", preload);
1487 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1492 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1495 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1496 * @brief This API gets the value for given handle is system or not
1498 * @par This API is for package-manager client application
1499 * @par Sync (or) Async : Synchronous API
1501 * @param[in] handle pointer to package info handle
1502 * @param[out] system pointer to hold system is or not
1503 * @return 0 if success, error code(<0) if fail
1504 * @retval PMINFO_R_OK success
1505 * @retval PMINFO_R_EINVAL invalid argument
1506 * @retval PMINFO_R_ERROR internal error
1507 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1508 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1509 * @see pkgmgrinfo_pkginfo_get_pkgid()
1510 * @see pkgmgrinfo_pkginfo_is_readonly()
1512 static int get_pkg_system(const char *pkgid)
1515 bool system = false;
1516 pkgmgrinfo_pkginfo_h handle = NULL;
1517 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1518 if (ret != PMINFO_R_OK)
1520 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1521 if (ret != PMINFO_R_OK) {
1522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1525 printf("pkg system: %d\n", system);
1526 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1531 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1534 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1535 * @brief This API gets the package 'readonly' value from the package ID
1537 * @par This API is for package-manager client application
1538 * @par Sync (or) Async : Synchronous API
1540 * @param[in] handle pointer to package info handle
1541 * @param[out] readonly pointer to hold package readonly value
1542 * @return 0 if success, error code(<0) if fail
1543 * @retval PMINFO_R_OK success
1544 * @retval PMINFO_R_EINVAL invalid argument
1545 * @retval PMINFO_R_ERROR internal error
1546 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1547 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1548 * @see pkgmgrinfo_pkginfo_get_pkgid()
1549 * @see pkgmgrinfo_pkginfo_is_removable()
1551 static int get_pkg_readonly(const char *pkgid)
1555 pkgmgrinfo_pkginfo_h handle;
1556 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1557 if (ret != PMINFO_R_OK)
1559 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1560 if (ret != PMINFO_R_OK) {
1561 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1564 printf("pkg readonly: %d\n", readonly);
1565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1570 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1574 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1575 * @brief This API gets the package 'upate' value from the package ID
1577 * @par This API is for package-manager client application
1578 * @par Sync (or) Async : Synchronous API
1580 * @param[in] handle pointer to package info handle
1581 * @param[out] update pointer to hold package update value
1582 * @return 0 if success, error code(<0) if fail
1583 * @retval PMINFO_R_OK success
1584 * @retval PMINFO_R_EINVAL invalid argument
1585 * @retval PMINFO_R_ERROR internal error
1586 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1587 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1588 * @see pkgmgrinfo_pkginfo_get_pkgid()
1590 static int get_pkg_update(const char *pkgid)
1594 pkgmgrinfo_pkginfo_h handle;
1595 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1596 if (ret != PMINFO_R_OK)
1598 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1599 if (ret != PMINFO_R_OK) {
1600 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1603 printf("pkg update: %d\n", update);
1604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1609 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1613 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1614 * @brief This API gets the package 'uid' value from the view table of user database
1616 * @par This API is for package-manager client application
1617 * @par Sync (or) Async : Synchronous API
1619 * @param[in] uid uid of the user to determine the database
1620 * @param[in] pkgid id of the current package
1621 * @return 1 if it a global package, 0 else
1624 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1628 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1629 * @brief This API gets the package 'accessible' value from the package ID
1631 * @par This API is for package-manager client application
1632 * @par Sync (or) Async : Synchronous API
1634 * @param[in] handle pointer to package info handle
1635 * @param[out] accessible pointer to hold package accessible value
1636 * @return 0 if success, error code(<0) if fail
1637 * @retval PMINFO_R_OK success
1638 * @retval PMINFO_R_EINVAL invalid argument
1639 * @retval PMINFO_R_ERROR internal error
1640 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1641 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1642 * @see pkgmgrinfo_pkginfo_get_pkgid()
1643 * @see pkgmgrinfo_pkginfo_is_readonly()
1645 static int get_pkg_accessible(const char *pkgid)
1649 pkgmgrinfo_pkginfo_h handle;
1650 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1651 if (ret != PMINFO_R_OK)
1653 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1654 if (ret != PMINFO_R_OK) {
1655 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1658 printf("pkg accessible: %d\n", accessible);
1659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1664 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1667 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1668 * @brief This API destroys the package information handle freeing up all the resources
1670 * @par This API is for package-manager client application
1671 * @par Sync (or) Async : Synchronous API
1673 * @param[in] handle pointer to the package info handle
1674 * @return 0 if success, error code(<0) if fail
1675 * @retval PMINFO_R_OK success
1676 * @retval PMINFO_R_EINVAL invalid argument
1677 * @retval PMINFO_R_ERROR internal error
1678 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1680 * @see pkgmgrinfo_pkginfo_get_pkgid()
1681 * @see pkgmgrinfo_pkginfo_is_removable()
1683 static int get_pkg_type(const char *pkgid)
1687 pkgmgrinfo_pkginfo_h handle;
1688 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1689 if (ret != PMINFO_R_OK)
1691 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1692 if (ret != PMINFO_R_OK) {
1693 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1696 printf("pkgtype: %s\n", type);
1697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1702 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1705 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1706 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1707 The query will search the entire package information collected from the manifest file of all the installed packages
1709 * @par This API is for package-manager client application
1710 * @par Sync (or) Async : Synchronous API
1712 * @param[out] handle pointer to the package info filter handle.
1713 * @return 0 if success, error code(<0) if fail
1714 * @retval PMINFO_R_OK success
1715 * @retval PMINFO_R_EINVAL invalid argument
1716 * @retval PMINFO_R_ERROR internal error
1718 * @post pkgmgrinfo_pkginfo_filter_destroy()
1719 * @see pkgmgrinfo_pkginfo_filter_count()
1720 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1722 static int get_rpm_pkg_count()
1726 pkgmgrinfo_pkginfo_filter_h handle;
1727 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1728 if (ret != PMINFO_R_OK)
1730 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1731 if (ret != PMINFO_R_OK) {
1732 pkgmgrinfo_pkginfo_filter_destroy(handle);
1735 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1736 if (ret != PMINFO_R_OK) {
1737 pkgmgrinfo_pkginfo_filter_destroy(handle);
1740 printf("No of rpm pkgs: %d\n", count);
1741 pkgmgrinfo_pkginfo_filter_destroy(handle);
1746 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1749 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1750 * @brief This API destroys the package information filter handle freeing up all the resources
1752 * @par This API is for package-manager client application
1753 * @par Sync (or) Async : Synchronous API
1755 * @param[in] handle pointer to the package info filter handle.
1756 * @return 0 if success, error code(<0) if fail
1757 * @retval PMINFO_R_OK success
1758 * @retval PMINFO_R_EINVAL invalid argument
1759 * @retval PMINFO_R_ERROR internal error
1760 * @pre pkgmgrinfo_pkginfo_filter_create()
1762 * @see pkgmgrinfo_pkginfo_filter_count()
1763 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1765 static int get_rpm_pkg_count()
1769 pkgmgrinfo_pkginfo_filter_h handle;
1770 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1771 if (ret != PMINFO_R_OK)
1773 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1774 if (ret != PMINFO_R_OK) {
1775 pkgmgrinfo_pkginfo_filter_destroy(handle);
1778 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1779 if (ret != PMINFO_R_OK) {
1780 pkgmgrinfo_pkginfo_filter_destroy(handle);
1783 printf("No of rpm pkgs: %d\n", count);
1784 pkgmgrinfo_pkginfo_filter_destroy(handle);
1789 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1792 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1793 * @brief This API adds a boolean filter property to the filter handle
1795 * @par This API is for package-manager client application
1796 * @par Sync (or) Async : Synchronous API
1798 * @param[in] handle pointer to the package info filter handle.
1799 * @param[in] property boolean property name.
1800 * @param[in] value value corresponding to the property.
1801 * @return 0 if success, error code(<0) if fail
1802 * @retval PMINFO_R_OK success
1803 * @retval PMINFO_R_EINVAL invalid argument
1804 * @retval PMINFO_R_ERROR internal error
1805 * @pre pkgmgrinfo_pkginfo_filter_create()
1806 * @post pkgmgrinfo_pkginfo_filter_destroy()
1807 * @see pkgmgrinfo_pkginfo_filter_count()
1808 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1810 static int get_preload_pkg_count()
1814 pkgmgrinfo_pkginfo_filter_h handle;
1815 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1816 if (ret != PMINFO_R_OK)
1818 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1819 if (ret != PMINFO_R_OK) {
1820 pkgmgrinfo_pkginfo_filter_destroy(handle);
1823 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1824 if (ret != PMINFO_R_OK) {
1825 pkgmgrinfo_pkginfo_filter_destroy(handle);
1828 printf("No of preload pkgs: %d\n", count);
1829 pkgmgrinfo_pkginfo_filter_destroy(handle);
1834 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1835 const char *property, const bool value);
1838 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1839 * @brief This API adds an integer filter property to the filter handle
1841 * @par This API is for package-manager client application
1842 * @par Sync (or) Async : Synchronous API
1844 * @param[in] handle pointer to the package info filter handle.
1845 * @param[in] property integer property name.
1846 * @param[in] value value corresponding to the property.
1847 * @return 0 if success, error code(<0) if fail
1848 * @retval PMINFO_R_OK success
1849 * @retval PMINFO_R_EINVAL invalid argument
1850 * @retval PMINFO_R_ERROR internal error
1851 * @pre pkgmgrinfo_pkginfo_filter_create()
1852 * @post pkgmgrinfo_pkginfo_filter_destroy()
1853 * @see pkgmgrinfo_pkginfo_filter_count()
1854 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1856 static int get_pkg_count()
1860 pkgmgrinfo_pkginfo_filter_h handle;
1861 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1862 if (ret != PMINFO_R_OK)
1864 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1865 if (ret != PMINFO_R_OK) {
1866 pkgmgrinfo_pkginfo_filter_destroy(handle);
1869 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1870 if (ret != PMINFO_R_OK) {
1871 pkgmgrinfo_pkginfo_filter_destroy(handle);
1874 printf("No of preload pkgs: %d\n", count);
1875 pkgmgrinfo_pkginfo_filter_destroy(handle);
1880 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1881 const char *property, const int value);
1884 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1885 * @brief This API adds a string filter property to the filter handle
1887 * @par This API is for package-manager client application
1888 * @par Sync (or) Async : Synchronous API
1890 * @param[in] handle pointer to the package info filter handle.
1891 * @param[in] property string property name.
1892 * @param[in] value value corresponding to the property.
1893 * @return 0 if success, error code(<0) if fail
1894 * @retval PMINFO_R_OK success
1895 * @retval PMINFO_R_EINVAL invalid argument
1896 * @retval PMINFO_R_ERROR internal error
1897 * @pre pkgmgrinfo_pkginfo_filter_create()
1898 * @post pkgmgrinfo_pkginfo_filter_destroy()
1899 * @see pkgmgrinfo_pkginfo_filter_count()
1900 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1902 static int get_rpm_pkg_count()
1906 pkgmgrinfo_pkginfo_filter_h handle;
1907 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1908 if (ret != PMINFO_R_OK)
1910 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1911 if (ret != PMINFO_R_OK) {
1912 pkgmgrinfo_pkginfo_filter_destroy(handle);
1915 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1916 if (ret != PMINFO_R_OK) {
1917 pkgmgrinfo_pkginfo_filter_destroy(handle);
1920 printf("No of rpm pkgs: %d\n", count);
1921 pkgmgrinfo_pkginfo_filter_destroy(handle);
1926 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1927 const char *property, const char *value);
1930 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1931 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1933 * @par This API is for package-manager client application
1934 * @par Sync (or) Async : Synchronous API
1936 * @param[in] handle pointer to the package info filter handle.
1937 * @param[in] pkg_cb callback function.
1938 * @param[in] user_data user data to be passed to the callback function
1939 * @return 0 if success, error code(<0) if fail
1940 * @retval PMINFO_R_OK success
1941 * @retval PMINFO_R_EINVAL invalid argument
1942 * @retval PMINFO_R_ERROR internal error
1943 * @pre pkgmgrinfo_pkginfo_filter_create()
1944 * @post pkgmgrinfo_pkginfo_filter_destroy()
1945 * @see pkgmgrinfo_pkginfo_filter_count()
1947 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1950 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1951 printf("pkg id : %s\n", pkgid);
1955 static int get_rpm_pkg_list()
1958 pkgmgrinfo_pkginfo_filter_h handle;
1959 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1960 if (ret != PMINFO_R_OK)
1962 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1963 if (ret != PMINFO_R_OK) {
1964 pkgmgrinfo_pkginfo_filter_destroy(handle);
1967 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1968 if (ret != PMINFO_R_OK) {
1969 pkgmgrinfo_pkginfo_filter_destroy(handle);
1972 pkgmgrinfo_pkginfo_filter_destroy(handle);
1977 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1978 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1979 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1980 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1983 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1984 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1985 * @brief This API counts the package that satisfy the filter conditions
1987 * @par This API is for package-manager client application
1988 * @par Sync (or) Async : Synchronous API
1990 * @param[in] handle pointer to the package info filter handle.
1991 * @param[in] count pointer to store the count value.
1992 * @param[in] uid the addressee user id of the instruction
1993 * @return 0 if success, error code(<0) if fail
1994 * @retval PMINFO_R_OK success
1995 * @retval PMINFO_R_EINVAL invalid argument
1996 * @retval PMINFO_R_ERROR internal error
1997 * @pre pkgmgrinfo_pkginfo_filter_create()
1998 * @post pkgmgrinfo_pkginfo_filter_destroy()
1999 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2001 static int get_rpm_pkg_count()
2005 pkgmgrinfo_pkginfo_filter_h handle;
2006 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2007 if (ret != PMINFO_R_OK)
2009 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2010 if (ret != PMINFO_R_OK) {
2011 pkgmgrinfo_pkginfo_filter_destroy(handle);
2014 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2015 if (ret != PMINFO_R_OK) {
2016 pkgmgrinfo_pkginfo_filter_destroy(handle);
2019 printf("No of rpm pkgs: %d\n", count);
2020 pkgmgrinfo_pkginfo_filter_destroy(handle);
2025 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2026 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2028 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2029 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2030 * @brief This API gets the list of privilege for a particular package
2032 * @par This API is for package-manager client application
2033 * @par Sync (or) Async : Synchronous API
2034 * @param[in] handle pointer to the package info handle.
2035 * @param[in] privilege_func callback function for list
2036 * @param[in] user_data user data to be passed to callback function
2037 * @return 0 if success, error code(<0) if fail
2038 * @retval PMINFO_R_OK success
2039 * @retval PMINFO_R_EINVAL invalid argument
2040 * @retval PMINFO_R_ERROR internal error
2041 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2042 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2044 int privilege_func(const char *name, void *user_data)
2046 if (strcmp(name, (char *)user_data) == 0)
2052 static int list_privilege(const char *package, char *privilege)
2055 pkgmgrinfo_pkginfo_h handle;
2056 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2057 if (ret != PMINFO_R_OK)
2059 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2060 if (ret != PMINFO_R_OK) {
2061 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2069 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2070 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2073 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2074 pkgmgrinfo_app_list_cb app_func, void *user_data)
2075 * @brief This API gets list of installed applications for a particular package
2077 * @par This API is for package-manager client application
2078 * @par Sync (or) Async : Synchronous API
2079 * @param[in] handle package info handle
2080 * @param[in] component application component
2081 * @param[in] app_func iteration function for list
2082 * @param[in] user_data user data to be passed to callback function
2083 * @return 0 if success, error code(<0) if fail
2084 * @retval PMINFO_R_OK success
2085 * @retval PMINFO_R_EINVAL invalid argument
2086 * @retval PMINFO_R_ERROR internal error
2087 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2088 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2090 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2093 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2094 printf("appid : %s\n", appid);
2098 static int list_apps(const char *pkgid)
2101 pkgmgrinfo_pkginfo_h handle;
2102 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2103 if (ret != PMINFO_R_OK)
2105 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2106 if (ret != PMINFO_R_OK) {
2107 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2110 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2115 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2116 pkgmgrinfo_app_list_cb app_func, void *user_data);
2117 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2118 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2120 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2121 * @brief This API gets list of installed applications from all packages with minimum informaion.
2123 * @par This API is for package-manager client application
2124 * @par Sync (or) Async : Synchronous API
2125 * @param[in] app_func iteration function for list
2126 * @param[in] user_data user data to be passed to callback function
2127 * @return 0 if success, error code(<0) if fail
2128 * @retval PMINFO_R_OK success
2129 * @retval PMINFO_R_EINVAL invalid argument
2130 * @retval PMINFO_R_ERROR internal error
2134 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2136 char *pkgid1 = NULL;
2137 char *pkgid2 = NULL;
2138 pkgid1 = (char *)user_data;
2139 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2140 if (strcmp(pkgid1, pkgid2) == 0) {
2147 static int list_apps()
2150 char *name = "helloworld";
2151 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2152 if (ret != PMINFO_R_OK) {
2159 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2160 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2162 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2163 * @brief This API gets list of installed applications from all packages.
2165 * @par This API is for package-manager client application
2166 * @par Sync (or) Async : Synchronous API
2167 * @param[in] app_func iteration function for list
2168 * @param[in] user_data user data to be passed to callback function
2169 * @return 0 if success, error code(<0) if fail
2170 * @retval PMINFO_R_OK success
2171 * @retval PMINFO_R_EINVAL invalid argument
2172 * @retval PMINFO_R_ERROR internal error
2176 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2178 char *pkgid1 = NULL;
2179 char *pkgid2 = NULL;
2180 pkgid1 = (char *)user_data;
2181 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2182 if (strcmp(pkgid1, pkgid2) == 0) {
2189 static int list_apps()
2192 char *name = "helloworld";
2193 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2194 if (ret != PMINFO_R_OK) {
2201 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2202 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2205 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2206 * @brief This API creates the application information handle from db
2208 * @par This API is for package-manager client application
2209 * @par Sync (or) Async : Synchronous API
2211 * @param[in] appid pointer to appid
2212 * @param[out] handle pointer to the application info handle.
2213 * @return 0 if success, error code(<0) if fail
2214 * @retval PMINFO_R_OK success
2215 * @retval PMINFO_R_EINVAL invalid argument
2216 * @retval PMINFO_R_ERROR internal error
2218 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2219 * @see pkgmgrinfo_appinfo_get_pkgid()
2220 * @see pkgmgrinfo_appinfo_is_multiple()
2222 static int get_app_type(const char *appid)
2226 pkgmgrinfo_appinfo_h handle;
2227 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2228 if (ret != PMINFO_R_OK)
2230 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2231 if (ret != PMINFO_R_OK) {
2232 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2235 printf("apptype: %s\n", type);
2236 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2241 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2242 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2244 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2245 * @brief This API gets the application ID
2247 * @par This API is for package-manager client application
2248 * @par Sync (or) Async : Synchronous API
2250 * @param[in] handle pointer to the application info handle.
2251 * @param[out] appid pointer to hold appid
2252 * @return 0 if success, error code(<0) if fail
2253 * @retval PMINFO_R_OK success
2254 * @retval PMINFO_R_EINVAL invalid argument
2255 * @retval PMINFO_R_ERROR internal error
2256 * @pre pkgmgrinfo_appinfo_get_appinfo()
2257 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2258 * @see pkgmgrinfo_appinfo_get_pkgid()
2259 * @see pkgmgrinfo_appinfo_is_multiple()
2261 static int get_app_id(const char *appid)
2264 char *app_id = NULL;
2265 pkgmgrinfo_appinfo_h handle;
2266 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2267 if (ret != PMINFO_R_OK)
2269 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2270 if (ret != PMINFO_R_OK) {
2271 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2274 printf("app id: %s\n", app_id);
2275 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2280 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2283 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2284 * @brief This API gets the package name of the application
2286 * @par This API is for package-manager client application
2287 * @par Sync (or) Async : Synchronous API
2289 * @param[in] handle pointer to the application info handle.
2290 * @param[out] pkg_name pointer to hold package name
2291 * @return 0 if success, error code(<0) if fail
2292 * @retval PMINFO_R_OK success
2293 * @retval PMINFO_R_EINVAL invalid argument
2294 * @retval PMINFO_R_ERROR internal error
2295 * @pre pkgmgrinfo_appinfo_get_appinfo()
2296 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2297 * @see pkgmgrinfo_appinfo_get_appid()
2298 * @see pkgmgrinfo_appinfo_is_multiple()
2300 static int get_app_pkgname(const char *appid)
2303 char *pkgname = NULL;
2304 pkgmgrinfo_appinfo_h handle;
2305 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2306 if (ret != PMINFO_R_OK)
2308 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2309 if (ret != PMINFO_R_OK) {
2310 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2313 printf("pkg name: %s\n", pkgname);
2314 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2319 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2322 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2323 * @brief This API gets the package id of the application
2325 * @par This API is for package-manager client application
2326 * @par Sync (or) Async : Synchronous API
2328 * @param[in] handle pointer to the application info handle.
2329 * @param[out] pkgid pointer to hold package id
2330 * @return 0 if success, error code(<0) if fail
2331 * @retval PMINFO_R_OK success
2332 * @retval PMINFO_R_EINVAL invalid argument
2333 * @retval PMINFO_R_ERROR internal error
2334 * @pre pkgmgrinfo_appinfo_get_appinfo()
2335 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2336 * @see pkgmgrinfo_appinfo_get_appid()
2337 * @see pkgmgrinfo_appinfo_is_multiple()
2339 static int get_app_pkgid(const char *appid)
2343 pkgmgrinfo_appinfo_h handle;
2344 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2345 if (ret != PMINFO_R_OK)
2347 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2348 if (ret != PMINFO_R_OK) {
2349 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2352 printf("pkg id: %s\n", pkgid);
2353 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2358 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2361 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2362 * @brief This API gets the executable name of the application
2364 * @par This API is for package-manager client application
2365 * @par Sync (or) Async : Synchronous API
2367 * @param[in] handle pointer to the application info handle.
2368 * @param[out] exec pointer to hold app exec name
2369 * @return 0 if success, error code(<0) if fail
2370 * @retval PMINFO_R_OK success
2371 * @retval PMINFO_R_EINVAL invalid argument
2372 * @retval PMINFO_R_ERROR internal error
2373 * @pre pkgmgrinfo_appinfo_get_appinfo()
2374 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2375 * @see pkgmgrinfo_appinfo_get_appid()
2376 * @see pkgmgrinfo_appinfo_is_multiple()
2378 static int get_app_exec(const char *appid)
2382 pkgmgrinfo_appinfo_h handle;
2383 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2384 if (ret != PMINFO_R_OK)
2386 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2387 if (ret != PMINFO_R_OK) {
2388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2391 printf("exec name: %s\n", exec);
2392 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2397 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2400 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2401 * @brief This API gets the icon name of the application
2403 * @par This API is for package-manager client application
2404 * @par Sync (or) Async : Synchronous API
2406 * @param[in] handle pointer to the application info handle.
2407 * @param[out] icon pointer to hold app icon name
2408 * @return 0 if success, error code(<0) if fail
2409 * @retval PMINFO_R_OK success
2410 * @retval PMINFO_R_EINVAL invalid argument
2411 * @retval PMINFO_R_ERROR internal error
2412 * @pre pkgmgrinfo_appinfo_get_appinfo()
2413 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2414 * @see pkgmgrinfo_appinfo_get_appid()
2415 * @see pkgmgrinfo_appinfo_is_multiple()
2417 static int get_app_icon(const char *appid)
2421 pkgmgrinfo_appinfo_h handle;
2422 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2423 if (ret != PMINFO_R_OK)
2425 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2426 if (ret != PMINFO_R_OK) {
2427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2430 printf("icon name: %s\n", icon);
2431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2436 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2439 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2440 * @brief This API gets the label of the application
2442 * @par This API is for package-manager client application
2443 * @par Sync (or) Async : Synchronous API
2445 * @param[in] handle pointer to the application info handle.
2446 * @param[out] label pointer to hold app label
2447 * @return 0 if success, error code(<0) if fail
2448 * @retval PMINFO_R_OK success
2449 * @retval PMINFO_R_EINVAL invalid argument
2450 * @retval PMINFO_R_ERROR internal error
2451 * @pre pkgmgrinfo_appinfo_get_appinfo()
2452 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2453 * @see pkgmgrinfo_appinfo_get_appid()
2454 * @see pkgmgrinfo_appinfo_is_multiple()
2456 static int get_app_label(const char *appid)
2460 pkgmgrinfo_appinfo_h handle;
2461 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2462 if (ret != PMINFO_R_OK)
2464 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2465 if (ret != PMINFO_R_OK) {
2466 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2469 printf("label : %s\n", label);
2470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2475 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2478 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2479 * @brief This API gets the component of the application
2481 * @par This API is for package-manager client application
2482 * @par Sync (or) Async : Synchronous API
2484 * @param[in] handle pointer to the application info handle.
2485 * @param[out] component pointer to hold app component
2486 * @return 0 if success, error code(<0) if fail
2487 * @retval PMINFO_R_OK success
2488 * @retval PMINFO_R_EINVAL invalid argument
2489 * @retval PMINFO_R_ERROR internal error
2490 * @pre pkgmgrinfo_appinfo_get_appinfo()
2491 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2492 * @see pkgmgrinfo_appinfo_get_appid()
2493 * @see pkgmgrinfo_appinfo_is_multiple()
2495 static int get_app_component(const char *appid)
2498 pkgmgrinfo_app_component component;
2499 pkgmgrinfo_appinfo_h handle;
2500 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2501 if (ret != PMINFO_R_OK)
2503 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2504 if (ret != PMINFO_R_OK) {
2505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2508 printf("component : %s\n", component);
2509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2514 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2517 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2518 * @brief This API gets the apptype of the application
2520 * @par This API is for package-manager client application
2521 * @par Sync (or) Async : Synchronous API
2523 * @param[in] handle pointer to the application info handle.
2524 * @param[out] app_type pointer to hold apptype
2525 * @return 0 if success, error code(<0) if fail
2526 * @retval PMINFO_R_OK success
2527 * @retval PMINFO_R_EINVAL invalid argument
2528 * @retval PMINFO_R_ERROR internal error
2529 * @pre pkgmgrinfo_appinfo_get_appinfo()
2530 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2531 * @see pkgmgrinfo_appinfo_get_appid()
2532 * @see pkgmgrinfo_appinfo_is_multiple()
2534 static int get_app_type(const char *appid)
2537 char *apptype = NULL;
2538 pkgmgrinfo_appinfo_h handle;
2539 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2540 if (ret != PMINFO_R_OK)
2542 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2543 if (ret != PMINFO_R_OK) {
2544 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2547 printf("apptype : %s\n", apptype);
2548 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2553 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2556 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2557 int *operation_count, char ***operation)
2558 * @brief This API gets the list of operation of the application
2560 * @par This API is for package-manager client application
2561 * @par Sync (or) Async : Synchronous API
2563 * @param[in] handle pointer to the appcontrol handle.
2564 * @param[out] operation_count pointer to hold number of operations
2565 * @param[out] operation pointer to hold list of operations
2566 * @return 0 if success, error code(<0) if fail
2567 * @retval PMINFO_R_OK success
2568 * @retval PMINFO_R_EINVAL invalid argument
2569 * @retval PMINFO_R_ERROR internal error
2570 * @pre pkgmgrinfo_appinfo_get_appinfo()
2571 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2572 * @see pkgmgrinfo_appinfo_get_uri()
2573 * @see pkgmgrinfo_appinfo_get_mime()
2575 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2580 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2581 for (i = 0; i < oc; i++) {
2582 if (strcmp(operation[i], (char *)user_data) == 0)
2589 static int check_operation(const char *appid, char *operation)
2592 pkgmgrinfo_appinfo_h handle;
2593 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2594 if (ret != PMINFO_R_OK)
2596 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2597 if (ret != PMINFO_R_OK) {
2598 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2601 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2606 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2607 int *operation_count, char ***operation);
2610 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2611 int *uri_count, char ***uri)
2612 * @brief This API gets the list of uri of the application
2614 * @par This API is for package-manager client application
2615 * @par Sync (or) Async : Synchronous API
2617 * @param[in] handle pointer to the appcontrol handle.
2618 * @param[out] uri_count pointer to hold number of uris
2619 * @param[out] uri pointer to hold list of uris
2620 * @return 0 if success, error code(<0) if fail
2621 * @retval PMINFO_R_OK success
2622 * @retval PMINFO_R_EINVAL invalid argument
2623 * @retval PMINFO_R_ERROR internal error
2624 * @pre pkgmgrinfo_appinfo_get_appinfo()
2625 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2626 * @see pkgmgrinfo_appinfo_get_operation()
2627 * @see pkgmgrinfo_appinfo_get_mime()
2629 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2634 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2635 for (i = 0; i < uc; i++) {
2636 if (strcmp(uri[i], (char *)user_data) == 0)
2643 static int check_uri(const char *appid, char *uri)
2646 pkgmgrinfo_appinfo_h handle;
2647 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2648 if (ret != PMINFO_R_OK)
2650 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2651 if (ret != PMINFO_R_OK) {
2652 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2660 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2661 int *uri_count, char ***uri);
2664 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2665 int *mime_count, char ***mime)
2666 * @brief This API gets the list of mime of the application
2668 * @par This API is for package-manager client application
2669 * @par Sync (or) Async : Synchronous API
2671 * @param[in] handle pointer to the appcontrol handle.
2672 * @param[out] mime_count pointer to hold number of mimes
2673 * @param[out] mime pointer to hold list of mimes
2674 * @return 0 if success, error code(<0) if fail
2675 * @retval PMINFO_R_OK success
2676 * @retval PMINFO_R_EINVAL invalid argument
2677 * @retval PMINFO_R_ERROR internal error
2678 * @pre pkgmgrinfo_appinfo_get_appinfo()
2679 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2680 * @see pkgmgrinfo_appinfo_get_uri()
2681 * @see pkgmgrinfo_appinfo_get_operation()
2683 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2688 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2689 for (i = 0; i < mc; i++) {
2690 if (strcmp(mime[i], (char *)user_data) == 0)
2697 static int check_mime(const char *appid, char *mime)
2700 pkgmgrinfo_appinfo_h handle;
2701 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2702 if (ret != PMINFO_R_OK)
2704 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2705 if (ret != PMINFO_R_OK) {
2706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2709 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2714 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2715 int *mime_count, char ***mime);
2718 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2719 int *subapp_count, char ***subapp)
2720 * @brief This API gets the list of subapp of the application
2722 * @par This API is for package-manager client application
2723 * @par Sync (or) Async : Synchronous API
2725 * @param[in] handle pointer to the appcontrol handle.
2726 * @param[out] subapp_count pointer to hold number of subapp
2727 * @param[out] subapp pointer to hold list of subapp
2728 * @return 0 if success, error code(<0) if fail
2729 * @retval PMINFO_R_OK success
2730 * @retval PMINFO_R_EINVAL invalid argument
2731 * @retval PMINFO_R_ERROR internal error
2732 * @pre pkgmgrinfo_appinfo_get_appinfo()
2733 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2734 * @see pkgmgrinfo_appinfo_get_uri()
2735 * @see pkgmgrinfo_appinfo_get_operation()
2737 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2741 char **subapp = NULL;
2742 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2743 for (i = 0; i < sc; i++) {
2744 if (strcmp(subapp[i], (char *)user_data) == 0)
2751 static int check_subapp(const char *appid, char *subapp)
2754 pkgmgrinfo_appinfo_h handle = NULL;
2755 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2756 if (ret != PMINFO_R_OK)
2758 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2759 if (ret != PMINFO_R_OK) {
2760 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2763 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2768 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2769 int *subapp_count, char ***subapp);
2772 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2773 * @brief This API gets the notification icon of the application
2775 * @par This API is for package-manager client application
2776 * @par Sync (or) Async : Synchronous API
2778 * @param[in] handle pointer to the application info handle.
2779 * @param[out] path pointer to hold notification icon
2780 * @return 0 if success, error code(<0) if fail
2781 * @retval PMINFO_R_OK success
2782 * @retval PMINFO_R_EINVAL invalid argument
2783 * @retval PMINFO_R_ERROR internal error
2784 * @pre pkgmgrinfo_appinfo_get_appinfo()
2785 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2786 * @see pkgmgrinfo_appinfo_get_appid()
2787 * @see pkgmgrinfo_appinfo_is_multiple()
2789 static int get_app_notification_icon(const char *appid)
2792 char *notification_icon = NULL;
2793 pkgmgrinfo_appinfo_h handle;
2794 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2795 if (ret != PMINFO_R_OK)
2797 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2798 if (ret != PMINFO_R_OK) {
2799 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2802 printf("notification icon : %s\n", notification_icon);
2803 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2808 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2811 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2812 * @brief This API gets the setting icon of the application
2814 * @par This API is for package-manager client application
2815 * @par Sync (or) Async : Synchronous API
2817 * @param[in] handle pointer to the application info handle.
2818 * @param[out] path pointer to hold setting icon
2819 * @return 0 if success, error code(<0) if fail
2820 * @retval PMINFO_R_OK success
2821 * @retval PMINFO_R_EINVAL invalid argument
2822 * @retval PMINFO_R_ERROR internal error
2823 * @pre pkgmgrinfo_appinfo_get_appinfo()
2824 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2825 * @see pkgmgrinfo_appinfo_get_appid()
2826 * @see pkgmgrinfo_appinfo_is_multiple()
2828 static int get_app_setting_icon(const char *appid)
2831 char *setting_icon = NULL;
2832 pkgmgrinfo_appinfo_h handle;
2833 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2834 if (ret != PMINFO_R_OK)
2836 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2837 if (ret != PMINFO_R_OK) {
2838 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2841 printf("setting icon : %s\n", setting_icon);
2842 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2847 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2850 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2851 * @brief This API gets the type of recent image on app-tray
2853 * @par This API is for package-manager client application
2854 * @par Sync (or) Async : Synchronous API
2856 * @param[in] handle pointer to the application info handle.
2857 * @param[out] type pointer to hold image type
2858 * @return 0 if success, error code(<0) if fail
2859 * @retval PMINFO_R_OK success
2860 * @retval PMINFO_R_EINVAL invalid argument
2861 * @retval PMINFO_R_ERROR internal error
2862 * @pre pkgmgrinfo_appinfo_get_appinfo()
2863 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2864 * @see pkgmgrinfo_appinfo_get_appid()
2865 * @see pkgmgrinfo_appinfo_is_multiple()
2867 static int get_app_recent_image_type(const char *appid)
2870 pkgmgrinfo_app_recentimage type;
2871 pkgmgrinfo_appinfo_h handle;
2872 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2873 if (ret != PMINFO_R_OK)
2875 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2876 if (ret != PMINFO_R_OK) {
2877 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2880 printf("recent image type: %d\n", type);
2881 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2886 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2890 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2891 * @brief This API gets the preview image of application
2893 * @par Sync (or) Async : Synchronous API
2895 * @param[in] handle pointer to the application info handle.
2896 * @param[out] preview_img pointer to hold preview image path
2897 * @return 0 if success, error code(<0) if fail
2898 * @retval PMINFO_R_OK success
2899 * @retval PMINFO_R_EINVAL invalid argument
2900 * @retval PMINFO_R_ERROR internal error
2901 * @pre pkgmgrinfo_appinfo_get_appinfo()
2902 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2903 * @see pkgmgrinfo_appinfo_get_appid()
2905 static int get_app_previewimage(const char *appid)
2908 char *preview = NULL;
2909 pkgmgrinfo_appinfo_h handle = NULL;
2910 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2911 if (ret != PMINFO_R_OK)
2913 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2914 if (ret != PMINFO_R_OK) {
2915 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2918 printf("preview image path : %s\n", preview);
2919 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2924 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2928 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2929 * @brief This API gets the package permission type of the application
2931 * @par This API is for package-manager client application
2932 * @par Sync (or) Async : Synchronous API
2934 * @param[in] handle pointer to the application info handle.
2935 * @param[out] permission pointer to hold package permission
2936 * @return 0 if success, error code(<0) if fail
2937 * @retval PMINFO_R_OK success
2938 * @retval PMINFO_R_EINVAL invalid argument
2939 * @retval PMINFO_R_ERROR internal error
2940 * @pre pkgmgrinfo_appinfo_get_appinfo()
2941 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2942 * @see pkgmgrinfo_appinfo_get_appid()
2944 static int get_app_permission(const char *appid)
2947 pkgmgrinfo_permission_type permission = 0;
2948 pkgmgrinfo_appinfo_h handle;
2950 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2951 if (ret != PMINFO_R_OK)
2953 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2954 if (ret != PMINFO_R_OK) {
2955 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2958 printf("permission type: %d\n", permission);
2959 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2964 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2967 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2968 * @brief This API gets the component_type
2970 * @par This API is for package-manager client application
2971 * @par Sync (or) Async : Synchronous API
2973 * @param[in] handle pointer to the application info handle.
2974 * @param[out] component_type pointer to hold component_type
2975 * @return 0 if success, error code(<0) if fail
2976 * @retval PMINFO_R_OK success
2977 * @retval PMINFO_R_EINVAL invalid argument
2978 * @retval PMINFO_R_ERROR internal error
2979 * @pre pkgmgrinfo_appinfo_get_appinfo()
2980 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2981 * @see pkgmgrinfo_appinfo_get_pkgid()
2982 * @see pkgmgrinfo_appinfo_is_multiple()
2984 static int get_component_type(const char *appid)
2987 char *component_type = NULL;
2988 pkgmgrinfo_appinfo_h handle;
2989 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2990 if (ret != PMINFO_R_OK)
2992 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2993 if (ret != PMINFO_R_OK) {
2994 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2997 printf("component_type: %s\n", component_type);
2998 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3003 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3006 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3007 * @brief This API gets the application 'hwacceleration' value from the app ID
3009 * @par This API is for package-manager client application
3010 * @par Sync (or) Async : Synchronous API
3012 * @param[in] handle pointer to application info handle
3013 * @param[out] hwacceleration pointer to hold package hwacceleration value
3014 * @return 0 if success, error code(<0) if fail
3015 * @retval PMINFO_R_OK success
3016 * @retval PMINFO_R_EINVAL invalid argument
3017 * @retval PMINFO_R_ERROR internal error
3018 * @pre pkgmgrinfo_appinfo_get_appinfo()
3019 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3020 * @see pkgmgrinfo_appinfo_get_appid()
3021 * @see pkgmgrinfo_appinfo_is_multiple()
3023 static int get_app_hwacceleration(const char *appid)
3026 pkgmgrinfo_app_hwacceleration hwacceleration;
3027 pkgmgrinfo_appinfo_h handle;
3028 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3029 if (ret != PMINFO_R_OK)
3031 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3032 if (ret != PMINFO_R_OK) {
3033 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3036 printf("app hwacceleration: %d\n", hwacceleration);
3037 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3042 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3045 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3046 * @brief This API gets the application 'screenreader' value from the app ID
3048 * @par This API is for package-manager client application
3049 * @par Sync (or) Async : Synchronous API
3051 * @param[in] handle pointer to application info handle
3052 * @param[out] screenreader pointer to hold package accessibility value
3053 * @return 0 if success, error code(<0) if fail
3054 * @retval PMINFO_R_OK success
3055 * @retval PMINFO_R_EINVAL invalid argument
3056 * @retval PMINFO_R_ERROR internal error
3057 * @pre pkgmgrinfo_appinfo_get_appinfo()
3058 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3059 * @see pkgmgrinfo_appinfo_get_appid()
3060 * @see pkgmgrinfo_appinfo_is_multiple()
3062 static int get_app_screenreader(const char *appid)
3065 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3066 pkgmgrinfo_appinfo_h handle = NULL;
3067 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3068 if (ret != PMINFO_R_OK)
3070 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3071 if (ret != PMINFO_R_OK) {
3072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3075 printf("app screenreader: %d\n", screenreader);
3076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3081 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3084 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3085 * @brief This API gets the application's landscape & portrait effect images
3087 * @par This API is for package-manager client application
3088 * @par Sync (or) Async : Synchronous API
3090 * @param[in] handle pointer to application info handle
3091 * @param[out] portrait_img contains portrait mode effect image
3092 * @param[out] landscape_img contains landscape mode effect image
3093 * @return 0 if success, error code(<0) if fail
3094 * @retval PMINFO_R_OK success
3095 * @retval PMINFO_R_EINVAL invalid argument
3096 * @retval PMINFO_R_ERROR internal error
3097 * @pre pkgmgrinfo_appinfo_get_appinfo()
3098 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3099 * @see pkgmgrinfo_appinfo_get_appid()
3100 * @see pkgmgrinfo_appinfo_is_nodisplay()
3102 static int get_app_effectimages(const char *appid)
3105 char *portraitimg = NULL;
3106 char *landscapeimg = NULL;
3107 pkgmgrinfo_appinfo_h handle;
3108 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3109 if (ret != PMINFO_R_OK)
3111 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3112 if (ret != PMINFO_R_OK) {
3113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3116 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3122 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3125 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3126 * @brief This API gets the submode_mainid of the application
3128 * @par This API is for package-manager client application
3129 * @par Sync (or) Async : Synchronous API
3131 * @param[in] handle pointer to the application info handle.
3132 * @param[out] submode_mainid pointer to hold package name
3133 * @return 0 if success, error code(<0) if fail
3134 * @retval PMINFO_R_OK success
3135 * @retval PMINFO_R_EINVAL invalid argument
3136 * @retval PMINFO_R_ERROR internal error
3137 * @pre pkgmgrinfo_appinfo_get_appinfo()
3138 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3139 * @see pkgmgrinfo_appinfo_get_appid()
3140 * @see pkgmgrinfo_appinfo_is_multiple()
3142 static int get_app_submode_mainid(const char *appid)
3145 char *submode_mainid = NULL;
3146 pkgmgrinfo_appinfo_h handle = NULL;
3147 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3148 if (ret != PMINFO_R_OK)
3150 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3151 if (ret != PMINFO_R_OK) {
3152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3155 printf("submode_mainid: %s\n", submode_mainid);
3156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3161 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3164 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3165 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3166 * @brief This API gets the list of permission for a particular application
3168 * @par This API is for package-manager client application
3169 * @par Sync (or) Async : Synchronous API
3170 * @param[in] handle pointer to the application info handle.
3171 * @param[in] permission_func callback function for list
3172 * @param[in] user_data user data to be passed to callback function
3173 * @return 0 if success, error code(<0) if fail
3174 * @retval PMINFO_R_OK success
3175 * @retval PMINFO_R_EINVAL invalid argument
3176 * @retval PMINFO_R_ERROR internal error
3177 * @pre pkgmgrinfo_appinfo_get_appinfo()
3178 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3180 int permission_func(const char *name, void *user_data)
3182 if (strcmp(name, (char *)user_data) == 0)
3188 static int list_permission(const char *appid, char *permission)
3191 pkgmgrinfo_appinfo_h handle;
3192 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3193 if (ret != PMINFO_R_OK)
3195 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3196 if (ret != PMINFO_R_OK) {
3197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3205 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3206 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3209 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3210 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3211 * @brief This API gets the list of category for a particular application
3213 * @par This API is for package-manager client application
3214 * @par Sync (or) Async : Synchronous API
3215 * @param[in] handle pointer to the application info handle.
3216 * @param[in] category_func callback function for list
3217 * @param[in] user_data user data to be passed to callback function
3218 * @return 0 if success, error code(<0) if fail
3219 * @retval PMINFO_R_OK success
3220 * @retval PMINFO_R_EINVAL invalid argument
3221 * @retval PMINFO_R_ERROR internal error
3222 * @pre pkgmgrinfo_appinfo_get_appinfo()
3223 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3225 int category_func(const char *name, void *user_data)
3227 if (strcmp(name, (char *)user_data) == 0)
3233 static int list_category(const char *appid, char *category)
3236 pkgmgrinfo_appinfo_h handle;
3237 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3238 if (ret != PMINFO_R_OK)
3240 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3241 if (ret != PMINFO_R_OK) {
3242 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3245 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3250 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3251 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3254 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3255 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3256 * @brief This API gets the list of metadata for a particular application
3258 * @par This API is for package-manager client application
3259 * @par Sync (or) Async : Synchronous API
3260 * @param[in] handle pointer to the application info handle.
3261 * @param[in] metadata_func callback function for list
3262 * @param[in] user_data user data to be passed to callback function
3263 * @return 0 if success, error code(<0) if fail
3264 * @retval PMINFO_R_OK success
3265 * @retval PMINFO_R_EINVAL invalid argument
3266 * @retval PMINFO_R_ERROR internal error
3267 * @pre pkgmgrinfo_appinfo_get_appinfo()
3268 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3270 int metadata_func(const char *key, const char *value, void *user_data)
3272 if (strcmp(key, (char *)user_data) == 0) {
3273 printf("Value is %s\n", value);
3280 static int list_metadata(const char *appid, char *key)
3283 pkgmgrinfo_appinfo_h handle;
3284 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3285 if (ret != PMINFO_R_OK)
3287 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3288 if (ret != PMINFO_R_OK) {
3289 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3297 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3298 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3302 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3303 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3304 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3305 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3306 * @brief This API gets the list of app-control for a particular application
3308 * @par This API is for package-manager client application
3309 * @par Sync (or) Async : Synchronous API
3310 * @param[in] handle pointer to the application info handle.
3311 * @param[in] appcontrol_func callback function for list
3312 * @param[in] user_data user data to be passed to callback function
3313 * @param[in] uid the addressee user id of the instruction
3314 * @return 0 if success, error code(<0) if fail
3315 * @retval PMINFO_R_OK success
3316 * @retval PMINFO_R_EINVAL invalid argument
3317 * @retval PMINFO_R_ERROR internal error
3318 * @pre pkgmgrinfo_appinfo_get_appinfo()
3319 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3321 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3326 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3327 for (i = 0; i < oc; i++) {
3328 if (strcmp(operation[i], (char *)user_data) == 0)
3335 static int check_operation(const char *appid, char *operation)
3338 pkgmgrinfo_appinfo_h handle;
3339 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3340 if (ret != PMINFO_R_OK)
3342 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3343 if (ret != PMINFO_R_OK) {
3344 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3347 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3352 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3353 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3354 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3355 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3358 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3359 * @brief This API gets the application 'nodisplay' value from the app ID
3361 * @par This API is for package-manager client application
3362 * @par Sync (or) Async : Synchronous API
3364 * @param[in] handle pointer to application info handle
3365 * @param[out] nodisplay pointer to hold package nodisplay value
3366 * @return 0 if success, error code(<0) if fail
3367 * @retval PMINFO_R_OK success
3368 * @retval PMINFO_R_EINVAL invalid argument
3369 * @retval PMINFO_R_ERROR internal error
3370 * @pre pkgmgrinfo_appinfo_get_appinfo()
3371 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3372 * @see pkgmgrinfo_appinfo_get_appid()
3373 * @see pkgmgrinfo_appinfo_is_multiple()
3375 static int get_app_nodisplay(const char *appid)
3379 pkgmgrinfo_appinfo_h handle;
3380 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3381 if (ret != PMINFO_R_OK)
3383 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3384 if (ret != PMINFO_R_OK) {
3385 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3388 printf("app nodisplay: %d\n", nodisplay);
3389 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3394 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3397 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3398 * @brief This API gets the application 'multiple' value from the app ID
3400 * @par This API is for package-manager client application
3401 * @par Sync (or) Async : Synchronous API
3403 * @param[in] handle pointer to application info handle
3404 * @param[out] multiple pointer to hold package multiple value
3405 * @return 0 if success, error code(<0) if fail
3406 * @retval PMINFO_R_OK success
3407 * @retval PMINFO_R_EINVAL invalid argument
3408 * @retval PMINFO_R_ERROR internal error
3409 * @pre pkgmgrinfo_appinfo_get_appinfo()
3410 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3411 * @see pkgmgrinfo_appinfo_get_appid()
3412 * @see pkgmgrinfo_appinfo_is_nodisplay()
3414 static int get_app_multiple(const char *appid)
3418 pkgmgrinfo_appinfo_h handle;
3419 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3420 if (ret != PMINFO_R_OK)
3422 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3423 if (ret != PMINFO_R_OK) {
3424 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3427 printf("app multiple: %d\n", multiple);
3428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3433 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3436 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3437 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3438 * application launching effect. If fales, indicator will be hidden during application launching effect
3440 * @par This API is for package-manager client application
3441 * @par Sync (or) Async : Synchronous API
3443 * @param[in] handle pointer to application info handle
3444 * @param[out] indicator_disp contains indicator display status for application launching effect
3445 * @return 0 if success, error code(<0) if fail
3446 * @retval PMINFO_R_OK success
3447 * @retval PMINFO_R_EINVAL invalid argument
3448 * @retval PMINFO_R_ERROR internal error
3449 * @pre pkgmgrinfo_appinfo_get_appinfo()
3450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3451 * @see pkgmgrinfo_appinfo_get_appid()
3452 * @see pkgmgrinfo_appinfo_is_nodisplay()
3454 static int get_app_indicator_display(const char *appid)
3457 bool indicator_disp;
3458 pkgmgrinfo_appinfo_h handle;
3459 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3460 if (ret != PMINFO_R_OK)
3462 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3463 if (ret != PMINFO_R_OK){
3464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3467 printf("app indicator disp : %d\n", indicator_disp);
3468 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3473 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3476 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3477 * @brief This API gets the application 'taskmanage' value from the app ID
3479 * @par This API is for package-manager client application
3480 * @par Sync (or) Async : Synchronous API
3482 * @param[in] handle pointer to application info handle
3483 * @param[out] taskmanage pointer to hold package taskmanage value
3484 * @return 0 if success, error code(<0) if fail
3485 * @retval PMINFO_R_OK success
3486 * @retval PMINFO_R_EINVAL invalid argument
3487 * @retval PMINFO_R_ERROR internal error
3488 * @pre pkgmgrinfo_appinfo_get_appinfo()
3489 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3490 * @see pkgmgrinfo_appinfo_get_appid()
3491 * @see pkgmgrinfo_appinfo_is_multiple()
3493 static int get_app_taskmanage(const char *appid)
3497 pkgmgrinfo_appinfo_h handle;
3498 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3499 if (ret != PMINFO_R_OK)
3501 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3502 if (ret != PMINFO_R_OK) {
3503 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3506 printf("app taskmanage: %d\n", taskmanage);
3507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3512 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3515 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3516 * @brief This API gets the application 'taskmanage' value from the app ID
3518 * @par This API is for package-manager client application
3519 * @par Sync (or) Async : Synchronous API
3521 * @param[in] handle pointer to application info handle
3522 * @param[out] enabled pointer to hold package enabled value
3523 * @return 0 if success, error code(<0) if fail
3524 * @retval PMINFO_R_OK success
3525 * @retval PMINFO_R_EINVAL invalid argument
3526 * @retval PMINFO_R_ERROR internal error
3527 * @pre pkgmgrinfo_appinfo_get_appinfo()
3528 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3529 * @see pkgmgrinfo_appinfo_get_appid()
3530 * @see pkgmgrinfo_appinfo_is_multiple()
3532 static int get_app_enabled(const char *appid)
3536 pkgmgrinfo_appinfo_h handle;
3537 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3538 if (ret != PMINFO_R_OK)
3540 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3541 if (ret != PMINFO_R_OK) {
3542 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3545 printf("app enabled: %d\n", enabled);
3546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3551 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3554 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3555 * @brief This API gets the application 'onboot' value from the app ID
3557 * @par This API is for package-manager client application
3558 * @par Sync (or) Async : Synchronous API
3560 * @param[in] handle pointer to application info handle
3561 * @param[out] onboot pointer to hold package onboot value
3562 * @return 0 if success, error code(<0) if fail
3563 * @retval PMINFO_R_OK success
3564 * @retval PMINFO_R_EINVAL invalid argument
3565 * @retval PMINFO_R_ERROR internal error
3566 * @pre pkgmgrinfo_appinfo_get_appinfo()
3567 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3568 * @see pkgmgrinfo_appinfo_get_appid()
3569 * @see pkgmgrinfo_appinfo_is_multiple()
3571 static int get_app_onboot(const char *appid)
3575 pkgmgrinfo_appinfo_h handle;
3576 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3577 if (ret != PMINFO_R_OK)
3579 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3580 if (ret != PMINFO_R_OK) {
3581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3584 printf("app onboot: %d\n", onboot);
3585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3590 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3593 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3594 * @brief This API gets the application 'autorestart' value from the app ID
3596 * @par This API is for package-manager client application
3597 * @par Sync (or) Async : Synchronous API
3599 * @param[in] handle pointer to application info handle
3600 * @param[out] autorestart pointer to hold package autorestart value
3601 * @return 0 if success, error code(<0) if fail
3602 * @retval PMINFO_R_OK success
3603 * @retval PMINFO_R_EINVAL invalid argument
3604 * @retval PMINFO_R_ERROR internal error
3605 * @pre pkgmgrinfo_appinfo_get_appinfo()
3606 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3607 * @see pkgmgrinfo_appinfo_get_appid()
3608 * @see pkgmgrinfo_appinfo_is_multiple()
3610 static int get_app_autorestart(const char *appid)
3614 pkgmgrinfo_appinfo_h handle;
3615 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3616 if (ret != PMINFO_R_OK)
3618 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3619 if (ret != PMINFO_R_OK) {
3620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3623 printf("app autorestart: %d\n", autorestart);
3624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3629 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3632 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3633 * @brief This API gets the value for given application is main app or not from handle
3635 * @par This API is for package-manager client application
3636 * @par Sync (or) Async : Synchronous API
3638 * @param[in] handle pointer to application info handle
3639 * @param[out] mainapp pointer to hold package mainapp is or not
3640 * @return 0 if success, error code(<0) if fail
3641 * @retval PMINFO_R_OK success
3642 * @retval PMINFO_R_EINVAL invalid argument
3643 * @retval PMINFO_R_ERROR internal error
3644 * @pre pkgmgrinfo_appinfo_get_appinfo()
3645 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3646 * @see pkgmgrinfo_appinfo_get_appid()
3647 * @see pkgmgrinfo_appinfo_is_multiple()
3649 static int get_app_mainapp(const char *appid)
3653 pkgmgrinfo_appinfo_h handle;
3654 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3655 if (ret != PMINFO_R_OK)
3657 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3658 if (ret != PMINFO_R_OK) {
3659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3662 printf("mainapp: %d\n", mainapp);
3663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3668 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3672 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3673 * @brief This API gets the value for given application is preload or not from handle
3675 * @par This API is for package-manager client application
3676 * @par Sync (or) Async : Synchronous API
3678 * @param[in] handle pointer to application info handle
3679 * @param[out] preload pointer to hold preload is or not
3680 * @return 0 if success, error code(<0) if fail
3681 * @retval PMINFO_R_OK success
3682 * @retval PMINFO_R_EINVAL invalid argument
3683 * @retval PMINFO_R_ERROR internal error
3684 * @pre pkgmgrinfo_appinfo_get_appinfo()
3685 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3686 * @see pkgmgrinfo_appinfo_get_appid()
3687 * @see pkgmgrinfo_appinfo_is_multiple()
3689 static int get_app_preload(const char *appid)
3693 pkgmgrinfo_appinfo_h handle = NULL;
3694 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3695 if (ret != PMINFO_R_OK)
3697 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3698 if (ret != PMINFO_R_OK) {
3699 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3702 printf("preload: %d\n", preload);
3703 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3708 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3711 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3712 * @brief This API gets the value for given application is submode or not from handle
3714 * @par This API is for package-manager client application
3715 * @par Sync (or) Async : Synchronous API
3717 * @param[in] handle pointer to application info handle
3718 * @param[out] submode pointer to hold submode is or not
3719 * @return 0 if success, error code(<0) if fail
3720 * @retval PMINFO_R_OK success
3721 * @retval PMINFO_R_EINVAL invalid argument
3722 * @retval PMINFO_R_ERROR internal error
3723 * @pre pkgmgrinfo_appinfo_get_appinfo()
3724 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3725 * @see pkgmgrinfo_appinfo_get_appid()
3726 * @see pkgmgrinfo_appinfo_is_multiple()
3728 static int get_app_submode(const char *appid)
3732 pkgmgrinfo_appinfo_h handle = NULL;
3733 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3734 if (ret != PMINFO_R_OK)
3736 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3737 if (ret != PMINFO_R_OK) {
3738 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3741 printf("submode: %d\n", submode);
3742 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3747 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3750 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3751 * @brief This API destroys the application information handle freeing up all the resources
3753 * @par This API is for package-manager client application
3754 * @par Sync (or) Async : Synchronous API
3756 * @param[in] handle pointer to the application info handle.
3757 * @return 0 if success, error code(<0) if fail
3758 * @retval PMINFO_R_OK success
3759 * @retval PMINFO_R_EINVAL invalid argument
3760 * @retval PMINFO_R_ERROR internal error
3761 * @pre pkgmgrinfo_appinfo_get_appinfo()
3763 * @see pkgmgrinfo_appinfo_get_pkgid()
3764 * @see pkgmgrinfo_appinfo_is_multiple()
3766 static int get_app_type(const char *appid)
3770 pkgmgrinfo_appinfo_h handle;
3771 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3772 if (ret != PMINFO_R_OK)
3774 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3775 if (ret != PMINFO_R_OK) {
3776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3779 printf("apptype: %s\n", type);
3780 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3785 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3788 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3789 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3790 The query will search the entire application information collected from the manifest file of all the installed packages
3792 * @par This API is for package-manager client application
3793 * @par Sync (or) Async : Synchronous API
3795 * @param[out] handle pointer to the application info filter handle.
3796 * @return 0 if success, error code(<0) if fail
3797 * @retval PMINFO_R_OK success
3798 * @retval PMINFO_R_EINVAL invalid argument
3799 * @retval PMINFO_R_ERROR internal error
3801 * @post pkgmgrinfo_appinfo_filter_destroy()
3802 * @see pkgmgrinfo_appinfo_filter_count()
3803 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3805 static int get_capp_count()
3809 pkgmgrinfo_appinfo_filter_h handle;
3810 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3811 if (ret != PMINFO_R_OK)
3813 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3814 if (ret != PMINFO_R_OK) {
3815 pkgmgrinfo_appinfo_filter_destroy(handle);
3818 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3819 if (ret != PMINFO_R_OK) {
3820 pkgmgrinfo_appinfo_filter_destroy(handle);
3823 printf("No of capp: %d\n", count);
3824 pkgmgrinfo_appinfo_filter_destroy(handle);
3829 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3832 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3833 * @brief This API destroys the application information filter handle freeing up all the resources
3835 * @par This API is for package-manager client application
3836 * @par Sync (or) Async : Synchronous API
3838 * @param[in] handle pointer to the application info filter handle.
3839 * @return 0 if success, error code(<0) if fail
3840 * @retval PMINFO_R_OK success
3841 * @retval PMINFO_R_EINVAL invalid argument
3842 * @retval PMINFO_R_ERROR internal error
3843 * @pre pkgmgrinfo_appinfo_filter_create()
3845 * @see pkgmgrinfo_appinfo_filter_count()
3846 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3848 static int get_capp_count()
3852 pkgmgrinfo_appinfo_filter_h handle;
3853 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3854 if (ret != PMINFO_R_OK)
3856 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3857 if (ret != PMINFO_R_OK) {
3858 pkgmgrinfo_appinfo_filter_destroy(handle);
3861 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3862 if (ret != PMINFO_R_OK) {
3863 pkgmgrinfo_appinfo_filter_destroy(handle);
3866 printf("No of capp: %d\n", count);
3867 pkgmgrinfo_appinfo_filter_destroy(handle);
3872 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3875 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3876 * @brief This API adds a boolean filter property to the filter handle
3878 * @par This API is for package-manager client application
3879 * @par Sync (or) Async : Synchronous API
3881 * @param[in] handle pointer to the application info filter handle.
3882 * @param[in] property boolean property name.
3883 * @param[in] value value corresponding to the property.
3884 * @return 0 if success, error code(<0) if fail
3885 * @retval PMINFO_R_OK success
3886 * @retval PMINFO_R_EINVAL invalid argument
3887 * @retval PMINFO_R_ERROR internal error
3888 * @pre pkgmgrinfo_appinfo_filter_create()
3889 * @post pkgmgrinfo_appinfo_filter_destroy()
3890 * @see pkgmgrinfo_appinfo_filter_count()
3891 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3893 static int get_taskmanageable_app_count()
3897 pkgmgrinfo_appinfo_filter_h handle;
3898 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3899 if (ret != PMINFO_R_OK)
3901 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3902 if (ret != PMINFO_R_OK) {
3903 pkgmgrinfo_appinfo_filter_destroy(handle);
3906 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3907 if (ret != PMINFO_R_OK) {
3908 pkgmgrinfo_appinfo_filter_destroy(handle);
3911 printf("No of taskmanageable apps: %d\n", count);
3912 pkgmgrinfo_appinfo_filter_destroy(handle);
3917 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3918 const char *property, const bool value);
3921 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3922 * @brief This API adds an integer filter property to the filter handle
3924 * @par This API is for package-manager client application
3925 * @par Sync (or) Async : Synchronous API
3927 * @param[in] handle pointer to the application info filter handle.
3928 * @param[in] property integer property name.
3929 * @param[in] value value corresponding to the property.
3930 * @return 0 if success, error code(<0) if fail
3931 * @retval PMINFO_R_OK success
3932 * @retval PMINFO_R_EINVAL invalid argument
3933 * @retval PMINFO_R_ERROR internal error
3934 * @pre pkgmgrinfo_appinfo_filter_create()
3935 * @post pkgmgrinfo_appinfo_filter_destroy()
3936 * @see pkgmgrinfo_appinfo_filter_count()
3937 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3939 static int get_taskmanageable_app_count()
3943 pkgmgrinfo_appinfo_filter_h handle;
3944 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3945 if (ret != PMINFO_R_OK)
3947 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3948 if (ret != PMINFO_R_OK) {
3949 pkgmgrinfo_appinfo_filter_destroy(handle);
3952 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3953 if (ret != PMINFO_R_OK) {
3954 pkgmgrinfo_appinfo_filter_destroy(handle);
3957 printf("No of apps: %d\n", count);
3958 pkgmgrinfo_appinfo_filter_destroy(handle);
3963 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3964 const char *property, const int value);
3967 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3968 * @brief This API adds a string filter property to the filter handle
3970 * @par This API is for package-manager client application
3971 * @par Sync (or) Async : Synchronous API
3973 * @param[in] handle pointer to the application info filter handle.
3974 * @param[in] property string property name.
3975 * @param[in] value value corresponding to the property.
3976 * @return 0 if success, error code(<0) if fail
3977 * @retval PMINFO_R_OK success
3978 * @retval PMINFO_R_EINVAL invalid argument
3979 * @retval PMINFO_R_ERROR internal error
3980 * @pre pkgmgrinfo_appinfo_filter_create()
3981 * @post pkgmgrinfo_appinfo_filter_destroy()
3982 * @see pkgmgrinfo_appinfo_filter_count()
3983 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3985 static int get_capp_count()
3989 pkgmgrinfo_appinfo_filter_h handle;
3990 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3991 if (ret != PMINFO_R_OK)
3993 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3994 if (ret != PMINFO_R_OK) {
3995 pkgmgrinfo_appinfo_filter_destroy(handle);
3998 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3999 if (ret != PMINFO_R_OK) {
4000 pkgmgrinfo_appinfo_filter_destroy(handle);
4003 printf("No of capp: %d\n", count);
4004 pkgmgrinfo_appinfo_filter_destroy(handle);
4009 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4010 const char *property, const char *value);
4013 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4014 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4016 * @par This API is for package-manager client application
4017 * @par Sync (or) Async : Synchronous API
4019 * @param[in] handle pointer to the application info filter handle.
4020 * @param[in] app_cb callback function.
4021 * @param[in] user_data user data to be passed to the callback function
4022 * @return 0 if success, error code(<0) if fail
4023 * @retval PMINFO_R_OK success
4024 * @retval PMINFO_R_EINVAL invalid argument
4025 * @retval PMINFO_R_ERROR internal error
4026 * @pre pkgmgrinfo_appinfo_filter_create()
4027 * @post pkgmgrinfo_appinfo_filter_destroy()
4028 * @see pkgmgrinfo_appinfo_filter_count()
4030 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4033 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4034 printf("appid : %s\n", appid);
4038 static int get_capp_list()
4041 pkgmgrinfo_appinfo_filter_h handle;
4042 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4043 if (ret != PMINFO_R_OK)
4045 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4046 if (ret != PMINFO_R_OK) {
4047 pkgmgrinfo_appinfo_filter_destroy(handle);
4050 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4051 if (ret != PMINFO_R_OK) {
4052 pkgmgrinfo_appinfo_filter_destroy(handle);
4055 pkgmgrinfo_appinfo_filter_destroy(handle);
4060 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4061 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4062 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4063 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4066 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4067 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4068 * @brief This API counts the application that satisfy the filter conditions
4070 * @par This API is for package-manager client application
4071 * @par Sync (or) Async : Synchronous API
4073 * @param[in] handle pointer to the application info filter handle.
4074 * @param[in] count pointer to store count value
4075 * @param[in] uid the addressee user id of the instruction
4076 * @return 0 if success, error code(<0) if fail
4077 * @retval PMINFO_R_OK success
4078 * @retval PMINFO_R_EINVAL invalid argument
4079 * @retval PMINFO_R_ERROR internal error
4080 * @pre pkgmgrinfo_appinfo_filter_create()
4081 * @post pkgmgrinfo_appinfo_filter_destroy()
4082 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4084 static int get_capp_count()
4088 pkgmgrinfo_appinfo_filter_h handle;
4089 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4090 if (ret != PMINFO_R_OK)
4092 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4093 if (ret != PMINFO_R_OK) {
4094 pkgmgrinfo_appinfo_filter_destroy(handle);
4097 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4098 if (ret != PMINFO_R_OK) {
4099 pkgmgrinfo_appinfo_filter_destroy(handle);
4102 printf("No of capp: %d\n", count);
4103 pkgmgrinfo_appinfo_filter_destroy(handle);
4108 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4109 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4111 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4112 * @brief This API creates the application's metadata information filter handle from db.
4114 * @par This API is for package-manager client application
4115 * @par Sync (or) Async : Synchronous API
4117 * @param[out] handle pointer to the application metadata info filter handle.
4118 * @return 0 if success, error code(<0) if fail
4119 * @retval PMINFO_R_OK success
4120 * @retval PMINFO_R_EINVAL invalid argument
4121 * @retval PMINFO_R_ERROR internal error
4123 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4124 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4126 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4129 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4130 printf("appid : %s\n", appid);
4134 static int get_app_list(const char *mkey, const char *mvalue)
4137 pkgmgrinfo_appinfo_metadata_filter_h handle;
4138 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4139 if (ret != PMINFO_R_OK)
4141 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4142 if (ret != PMINFO_R_OK) {
4143 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4146 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4147 if (ret != PMINFO_R_OK) {
4148 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4151 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4156 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4159 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4160 * @brief This API destroys the application's metadata information filter handle.
4162 * @par This API is for package-manager client application
4163 * @par Sync (or) Async : Synchronous API
4165 * @param[in] handle pointer to the application metadata info filter handle.
4166 * @return 0 if success, error code(<0) if fail
4167 * @retval PMINFO_R_OK success
4168 * @retval PMINFO_R_EINVAL invalid argument
4169 * @retval PMINFO_R_ERROR internal error
4170 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4172 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4174 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4177 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4178 printf("appid : %s\n", appid);
4182 static int get_app_list(const char *mkey, const char *mvalue)
4185 pkgmgrinfo_appinfo_metadata_filter_h handle;
4186 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4187 if (ret != PMINFO_R_OK)
4189 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4190 if (ret != PMINFO_R_OK) {
4191 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4194 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4195 if (ret != PMINFO_R_OK) {
4196 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4199 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4204 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4207 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4208 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4209 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4211 * @par This API is for package-manager client application
4212 * @par Sync (or) Async : Synchronous API
4214 * @param[in] handle pointer to the application metadata info filter handle.
4215 * @param[in] key pointer to metadata key
4216 * @param[in] value pointer to metadata value
4217 * @return 0 if success, error code(<0) if fail
4218 * @retval PMINFO_R_OK success
4219 * @retval PMINFO_R_EINVAL invalid argument
4220 * @retval PMINFO_R_ERROR internal error
4221 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4222 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4223 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4225 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4228 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4229 printf("appid : %s\n", appid);
4233 static int get_app_list(const char *mkey, const char *mvalue)
4236 pkgmgrinfo_appinfo_metadata_filter_h handle;
4237 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4238 if (ret != PMINFO_R_OK)
4240 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4241 if (ret != PMINFO_R_OK) {
4242 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4245 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4246 if (ret != PMINFO_R_OK) {
4247 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4250 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4255 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4256 const char *key, const char *value);
4259 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4260 * @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)
4261 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4262 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4263 * negative value, no more callbacks will be called and API will return.
4265 * @par This API is for package-manager client application
4266 * @par Sync (or) Async : Synchronous API
4268 * @param[in] handle pointer to the application metadata info filter handle.
4269 * @param[in] app_cb function pointer to callback
4270 * @param[in] user_data pointer to user data
4271 * @param[in] uid the addressee user id of the instruction
4272 * @return 0 if success, error code(<0) if fail
4273 * @retval PMINFO_R_OK success
4274 * @retval PMINFO_R_EINVAL invalid argument
4275 * @retval PMINFO_R_ERROR internal error
4276 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4277 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4279 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4282 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4283 printf("appid : %s\n", appid);
4287 static int get_app_list(const char *mkey, const char *mvalue)
4290 pkgmgrinfo_appinfo_metadata_filter_h handle;
4291 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4292 if (ret != PMINFO_R_OK)
4294 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4295 if (ret != PMINFO_R_OK) {
4296 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4299 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4300 if (ret != PMINFO_R_OK) {
4301 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4304 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4309 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4310 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4311 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4312 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4314 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4315 * @brief This API creates the package cert information handle to get data from db.
4317 * @par This API is for package-manager client application
4318 * @par Sync (or) Async : Synchronous API
4320 * @param[out] handle pointer to the package cert handle.
4321 * @return 0 if success, error code(<0) if fail
4322 * @retval PMINFO_R_OK success
4323 * @retval PMINFO_R_EINVAL invalid argument
4324 * @retval PMINFO_R_ERROR internal error
4326 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4327 * @see pkgmgrinfo_pkginfo_get_cert_value()
4328 * @see pkgmgrinfo_pkginfo_load_certinfo()
4330 static int get_cert_info(const char *pkgid)
4333 pkgmgrinfo_certinfo_h handle;
4334 char *auth_cert = NULL;
4335 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4336 if (ret != PMINFO_R_OK)
4338 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4339 if (ret != PMINFO_R_OK) {
4340 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4343 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4344 if (ret != PMINFO_R_OK) {
4345 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4348 printf("Author root certificate: %s\n", auth_root);
4349 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4354 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4357 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4358 * @brief This API loads the package cert information handle with data from db.
4360 * @par This API is for package-manager client application
4361 * @par Sync (or) Async : Synchronous API
4363 * @param[in] pkgid pointer to the package ID.
4364 * @param[in] handle pointer to the package cert handle.
4365 * @return 0 if success, error code(<0) if fail
4366 * @retval PMINFO_R_OK success
4367 * @retval PMINFO_R_EINVAL invalid argument
4368 * @retval PMINFO_R_ERROR internal error
4369 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4370 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4371 * @see pkgmgrinfo_pkginfo_get_cert_value()
4373 static int get_cert_info(const char *pkgid)
4376 pkgmgrinfo_certinfo_h handle;
4377 char *auth_cert = NULL;
4378 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4379 if (ret != PMINFO_R_OK)
4381 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4382 if (ret != PMINFO_R_OK) {
4383 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4386 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4387 if (ret != PMINFO_R_OK) {
4388 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4391 printf("Author root certificate: %s\n", auth_root);
4392 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4397 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4400 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4401 * @brief This API gets the package cert information from the handle
4403 * @par This API is for package-manager client application
4404 * @par Sync (or) Async : Synchronous API
4406 * @param[in] handle pointer to the package cert handle.
4407 * @param[in] cert_type certificate type
4408 * @param[out] cert_value pointer to hold certificate value
4409 * @return 0 if success, error code(<0) if fail
4410 * @retval PMINFO_R_OK success
4411 * @retval PMINFO_R_EINVAL invalid argument
4412 * @retval PMINFO_R_ERROR internal error
4413 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4414 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4415 * @see pkgmgrinfo_pkginfo_load_certinfo()
4417 static int get_cert_info(const char *pkgid)
4420 pkgmgrinfo_certinfo_h handle;
4421 char *auth_cert = NULL;
4422 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4423 if (ret != PMINFO_R_OK)
4425 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4426 if (ret != PMINFO_R_OK) {
4427 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4430 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4431 if (ret != PMINFO_R_OK) {
4432 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4435 printf("Author root certificate: %s\n", auth_root);
4436 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4441 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4444 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4445 * @brief This API destroys the package cert information handle freeing up all the resources
4447 * @par This API is for package-manager client application
4448 * @par Sync (or) Async : Synchronous API
4450 * @param[in] handle pointer to the package cert handle.
4451 * @return 0 if success, error code(<0) if fail
4452 * @retval PMINFO_R_OK success
4453 * @retval PMINFO_R_EINVAL invalid argument
4454 * @retval PMINFO_R_ERROR internal error
4455 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4457 * @see pkgmgrinfo_pkginfo_load_certinfo()
4459 static int get_cert_info(const char *pkgid)
4462 pkgmgrinfo_certinfo_h handle;
4463 char *auth_cert = NULL;
4464 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4465 if (ret != PMINFO_R_OK)
4467 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4468 if (ret != PMINFO_R_OK) {
4469 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4472 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4473 if (ret != PMINFO_R_OK) {
4474 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4477 printf("Author root certificate: %s\n", auth_root);
4478 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4483 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4486 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4487 * @brief This API deletes the package cert information from DB
4489 * @par This API is for package-manager client application
4490 * @par Sync (or) Async : Synchronous API
4492 * @param[in] pkgid pointer to the package ID.
4493 * @return 0 if success, error code(<0) if fail
4494 * @retval PMINFO_R_OK success
4495 * @retval PMINFO_R_EINVAL invalid argument
4496 * @retval PMINFO_R_ERROR internal error
4500 static int delete_cert_info(const char *pkgid)
4503 ret = pkgmgrinfo_delete_certinfo(pkgid);
4504 if (ret != PMINFO_R_OK)
4510 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4511 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4513 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4514 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4515 * @brief This API creates the package db information handle to set data in db.
4517 * @par This API is for package-manager client application
4518 * @par Sync (or) Async : Synchronous API
4520 * @param[in] pkgid pointer to the package ID.
4521 * @param[in] uid the addressee user id of the instruction
4522 * @param[out] handle pointer to the package db info handle.
4523 * @return 0 if success, error code(<0) if fail
4524 * @retval PMINFO_R_OK success
4525 * @retval PMINFO_R_EINVAL invalid argument
4526 * @retval PMINFO_R_ERROR internal error
4528 * @post pkgmgrinfo_destroy_pkgdbinfo()
4529 * @see pkgmgrinfo_save_pkgdbinfo()
4530 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4532 static int set_pkg_in_db(const char *pkgid)
4535 pkgmgrinfo_pkgdbinfo_h handle;
4536 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4537 if (ret != PMINFO_R_OK)
4539 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4540 if (ret != PMINFO_R_OK) {
4541 pkgmgrinfo_destroy_pkgdbinfo(handle);
4544 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4545 if (ret != PMINFO_R_OK) {
4546 pkgmgrinfo_destroy_pkgdbinfo(handle);
4549 pkgmgrinfo_destroy_pkgdbinfo(handle);
4554 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4555 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4558 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4559 * @brief This API sets the package type in db handle
4561 * @par This API is for package-manager client application
4562 * @par Sync (or) Async : Synchronous API
4564 * @param[in] handle pointer to the pkgdbinfo handle.
4565 * @param[in] type pointer to the package type.
4566 * @return 0 if success, error code(<0) if fail
4567 * @retval PMINFO_R_OK success
4568 * @retval PMINFO_R_EINVAL invalid argument
4569 * @retval PMINFO_R_ERROR internal error
4570 * @pre pkgmgrinfo_create_pkgdbinfo()
4571 * @post pkgmgrinfo_destroy_pkgdbinfo()
4572 * @see pkgmgrinfo_save_pkgdbinfo()
4573 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4575 static int set_pkg_type_in_db(const char *pkgid)
4578 pkgmgrinfo_pkgdbinfo_h handle;
4579 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4580 if (ret != PMINFO_R_OK)
4582 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4583 if (ret != PMINFO_R_OK) {
4584 pkgmgrinfo_destroy_pkgdbinfo(handle);
4587 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4588 if (ret != PMINFO_R_OK) {
4589 pkgmgrinfo_destroy_pkgdbinfo(handle);
4592 pkgmgrinfo_destroy_pkgdbinfo(handle);
4597 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4600 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4601 * @brief This API sets the package version in db handle
4603 * @par This API is for package-manager client application
4604 * @par Sync (or) Async : Synchronous API
4606 * @param[in] handle pointer to the pkgdbinfo handle.
4607 * @param[in] version pointer to the package version
4608 * @return 0 if success, error code(<0) if fail
4609 * @retval PMINFO_R_OK success
4610 * @retval PMINFO_R_EINVAL invalid argument
4611 * @retval PMINFO_R_ERROR internal error
4612 * @pre pkgmgrinfo_create_pkgdbinfo()
4613 * @post pkgmgrinfo_destroy_pkgdbinfo()
4614 * @see pkgmgrinfo_save_pkgdbinfo()
4615 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4617 static int set_pkg_version_in_db(const char *pkgid)
4620 pkgmgrinfo_pkgdbinfo_h handle;
4621 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4622 if (ret != PMINFO_R_OK)
4624 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4625 if (ret != PMINFO_R_OK) {
4626 pkgmgrinfo_destroy_pkgdbinfo(handle);
4629 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4630 if (ret != PMINFO_R_OK) {
4631 pkgmgrinfo_destroy_pkgdbinfo(handle);
4634 pkgmgrinfo_destroy_pkgdbinfo(handle);
4639 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4642 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4643 * @brief This API sets the package install location in db handle
4645 * @par This API is for package-manager client application
4646 * @par Sync (or) Async : Synchronous API
4648 * @param[in] handle pointer to the pkgdbinfo handle.
4649 * @param[in] location package install location
4650 * @return 0 if success, error code(<0) if fail
4651 * @retval PMINFO_R_OK success
4652 * @retval PMINFO_R_EINVAL invalid argument
4653 * @retval PMINFO_R_ERROR internal error
4654 * @pre pkgmgrinfo_create_pkgdbinfo()
4655 * @post pkgmgrinfo_destroy_pkgdbinfo()
4656 * @see pkgmgrinfo_save_pkgdbinfo()
4657 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4659 static int set_pkg_install_location_in_db(const char *pkgid)
4662 pkgmgrinfo_pkgdbinfo_h handle;
4663 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4664 if (ret != PMINFO_R_OK)
4666 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4667 if (ret != PMINFO_R_OK) {
4668 pkgmgrinfo_destroy_pkgdbinfo(handle);
4671 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4672 if (ret != PMINFO_R_OK) {
4673 pkgmgrinfo_destroy_pkgdbinfo(handle);
4676 pkgmgrinfo_destroy_pkgdbinfo(handle);
4681 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4684 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4685 * @brief This API sets the package size in db handle
4687 * @par This API is for package-manager client application
4688 * @par Sync (or) Async : Synchronous API
4690 * @param[in] handle pointer to the pkgdbinfo handle.
4691 * @param[in] size pointer to the package size
4692 * @return 0 if success, error code(<0) if fail
4693 * @retval PMINFO_R_OK success
4694 * @retval PMINFO_R_EINVAL invalid argument
4695 * @retval PMINFO_R_ERROR internal error
4696 * @pre pkgmgrinfo_create_pkgdbinfo()
4697 * @post pkgmgrinfo_destroy_pkgdbinfo()
4698 * @see pkgmgrinfo_save_pkgdbinfo()
4699 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4701 static int set_pkg_size_in_db(const char *pkgid)
4704 pkgmgrinfo_pkgdbinfo_h handle;
4705 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4706 if (ret != PMINFO_R_OK)
4708 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4709 if (ret != PMINFO_R_OK) {
4710 pkgmgrinfo_destroy_pkgdbinfo(handle);
4713 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4714 if (ret != PMINFO_R_OK) {
4715 pkgmgrinfo_destroy_pkgdbinfo(handle);
4718 pkgmgrinfo_destroy_pkgdbinfo(handle);
4723 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4726 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4727 * @brief This API sets the package label in db handle
4729 * @par This API is for package-manager client application
4730 * @par Sync (or) Async : Synchronous API
4732 * @param[in] handle pointer to the pkgdbinfo handle.
4733 * @param[in] label pointer to the package label
4734 * @param[in] locale pointer to the locale
4735 * @return 0 if success, error code(<0) if fail
4736 * @retval PMINFO_R_OK success
4737 * @retval PMINFO_R_EINVAL invalid argument
4738 * @retval PMINFO_R_ERROR internal error
4739 * @pre pkgmgrinfo_create_pkgdbinfo()
4740 * @post pkgmgrinfo_destroy_pkgdbinfo()
4741 * @see pkgmgrinfo_save_pkgdbinfo()
4742 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4744 static int set_pkg_label_in_db(const char *pkgid)
4747 pkgmgrinfo_pkgdbinfo_h handle;
4748 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4749 if (ret != PMINFO_R_OK)
4751 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4752 if (ret != PMINFO_R_OK) {
4753 pkgmgrinfo_destroy_pkgdbinfo(handle);
4756 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4757 if (ret != PMINFO_R_OK) {
4758 pkgmgrinfo_destroy_pkgdbinfo(handle);
4761 pkgmgrinfo_destroy_pkgdbinfo(handle);
4766 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4769 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4770 * @brief This API sets the package icon in db handle
4772 * @par This API is for package-manager client application
4773 * @par Sync (or) Async : Synchronous API
4775 * @param[in] handle pointer to the pkgdbinfo handle.
4776 * @param[in] icon pointer to the package icon
4777 * @param[in] locale pointer to the locale
4778 * @return 0 if success, error code(<0) if fail
4779 * @retval PMINFO_R_OK success
4780 * @retval PMINFO_R_EINVAL invalid argument
4781 * @retval PMINFO_R_ERROR internal error
4782 * @pre pkgmgrinfo_create_pkgdbinfo()
4783 * @post pkgmgrinfo_destroy_pkgdbinfo()
4784 * @see pkgmgrinfo_save_pkgdbinfo()
4785 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4787 static int set_pkg_icon_in_db(const char *pkgid)
4790 pkgmgrinfo_pkgdbinfo_h handle;
4791 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4792 if (ret != PMINFO_R_OK)
4794 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4795 if (ret != PMINFO_R_OK) {
4796 pkgmgrinfo_destroy_pkgdbinfo(handle);
4799 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4800 if (ret != PMINFO_R_OK) {
4801 pkgmgrinfo_destroy_pkgdbinfo(handle);
4804 pkgmgrinfo_destroy_pkgdbinfo(handle);
4809 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4812 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4813 * @brief This API sets the package description in db handle
4815 * @par This API is for package-manager client application
4816 * @par Sync (or) Async : Synchronous API
4818 * @param[in] handle pointer to the pkgdbinfo handle.
4819 * @param[in] description pointer to the package description
4820 * @param[in] locale pointer to the locale
4821 * @return 0 if success, error code(<0) if fail
4822 * @retval PMINFO_R_OK success
4823 * @retval PMINFO_R_EINVAL invalid argument
4824 * @retval PMINFO_R_ERROR internal error
4825 * @pre pkgmgrinfo_create_pkgdbinfo()
4826 * @post pkgmgrinfo_destroy_pkgdbinfo()
4827 * @see pkgmgrinfo_save_pkgdbinfo()
4828 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4830 static int set_pkg_description_in_db(const char *pkgid)
4833 pkgmgrinfo_pkgdbinfo_h handle;
4834 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4835 if (ret != PMINFO_R_OK)
4837 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4838 if (ret != PMINFO_R_OK) {
4839 pkgmgrinfo_destroy_pkgdbinfo(handle);
4842 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4843 if (ret != PMINFO_R_OK) {
4844 pkgmgrinfo_destroy_pkgdbinfo(handle);
4847 pkgmgrinfo_destroy_pkgdbinfo(handle);
4852 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4855 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4856 const char *author_email, const char *author_href, const char *locale)
4857 * @brief This API sets the package author info in db handle
4859 * @par This API is for package-manager client application
4860 * @par Sync (or) Async : Synchronous API
4862 * @param[in] handle pointer to the pkgdbinfo handle.
4863 * @param[in] author_name pointer to the package author name
4864 * @param[in] author_email pointer to the package author email
4865 * @param[in] author_href pointer to the package author href
4866 * @param[in] locale pointer to the locale
4867 * @return 0 if success, error code(<0) if fail
4868 * @retval PMINFO_R_OK success
4869 * @retval PMINFO_R_EINVAL invalid argument
4870 * @retval PMINFO_R_ERROR internal error
4871 * @pre pkgmgrinfo_create_pkgdbinfo()
4872 * @post pkgmgrinfo_destroy_pkgdbinfo()
4873 * @see pkgmgrinfo_save_pkgdbinfo()
4874 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4876 static int set_pkg_author_in_db(const char *pkgid)
4879 pkgmgrinfo_pkgdbinfo_h handle;
4880 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4881 if (ret != PMINFO_R_OK)
4883 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4884 if (ret != PMINFO_R_OK) {
4885 pkgmgrinfo_destroy_pkgdbinfo(handle);
4888 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4889 if (ret != PMINFO_R_OK) {
4890 pkgmgrinfo_destroy_pkgdbinfo(handle);
4893 pkgmgrinfo_destroy_pkgdbinfo(handle);
4898 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4899 const char *author_email, const char *author_href, const char *locale);
4902 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4903 * @brief This API sets the package 'removable' value in db handle
4905 * @par This API is for package-manager client application
4906 * @par Sync (or) Async : Synchronous API
4908 * @param[in] handle pointer to the pkgdbinfo handle.
4909 * @param[in] removable package removable value
4910 * @return 0 if success, error code(<0) if fail
4911 * @retval PMINFO_R_OK success
4912 * @retval PMINFO_R_EINVAL invalid argument
4913 * @retval PMINFO_R_ERROR internal error
4914 * @pre pkgmgrinfo_create_pkgdbinfo()
4915 * @post pkgmgrinfo_destroy_pkgdbinfo()
4916 * @see pkgmgrinfo_save_pkgdbinfo()
4917 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4919 static int set_pkg_removable_in_db(const char *pkgid)
4922 pkgmgrinfo_pkgdbinfo_h handle;
4923 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4924 if (ret != PMINFO_R_OK)
4926 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4927 if (ret != PMINFO_R_OK) {
4928 pkgmgrinfo_destroy_pkgdbinfo(handle);
4931 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4932 if (ret != PMINFO_R_OK) {
4933 pkgmgrinfo_destroy_pkgdbinfo(handle);
4936 pkgmgrinfo_destroy_pkgdbinfo(handle);
4941 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4944 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4945 * @brief This API sets the package 'preload' value in db handle
4947 * @par This API is for package-manager client application
4948 * @par Sync (or) Async : Synchronous API
4950 * @param[in] handle pointer to the pkgdbinfo handle.
4951 * @param[in] preload package preload value
4952 * @return 0 if success, error code(<0) if fail
4953 * @retval PMINFO_R_OK success
4954 * @retval PMINFO_R_EINVAL invalid argument
4955 * @retval PMINFO_R_ERROR internal error
4956 * @pre pkgmgrinfo_create_pkgdbinfo()
4957 * @post pkgmgrinfo_destroy_pkgdbinfo()
4958 * @see pkgmgrinfo_save_pkgdbinfo()
4959 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4961 static int set_pkg_preload_in_db(const char *pkgid)
4964 pkgmgrinfo_pkgdbinfo_h handle;
4965 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4966 if (ret != PMINFO_R_OK)
4968 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4969 if (ret != PMINFO_R_OK) {
4970 pkgmgrinfo_destroy_pkgdbinfo(handle);
4973 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4974 if (ret != PMINFO_R_OK) {
4975 pkgmgrinfo_destroy_pkgdbinfo(handle);
4978 pkgmgrinfo_destroy_pkgdbinfo(handle);
4983 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4986 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4987 * @brief This API sets the package 'installed_storage' value in db handle
4989 * @par This API is for package-manager client application
4990 * @par Sync (or) Async : Synchronous API
4992 * @param[in] handle pointer to the pkgdbinfo handle.
4993 * @param[in] location installed_storage value
4994 * @return 0 if success, error code(<0) if fail
4995 * @retval PMINFO_R_OK success
4996 * @retval PMINFO_R_EINVAL invalid argument
4997 * @retval PMINFO_R_ERROR internal error
4998 * @pre pkgmgrinfo_create_pkgdbinfo()
4999 * @post pkgmgrinfo_destroy_pkgdbinfo()
5000 * @see pkgmgrinfo_save_pkgdbinfo()
5002 static int set_pkg_installed_storage_in_db(const char *pkgid)
5005 pkgmgrinfo_pkgdbinfo_h handle;
5006 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5007 if (ret != PMINFO_R_OK)
5009 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5010 if (ret != PMINFO_R_OK) {
5011 pkgmgrinfo_destroy_pkgdbinfo(handle);
5014 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5015 if (ret != PMINFO_R_OK) {
5016 pkgmgrinfo_destroy_pkgdbinfo(handle);
5019 pkgmgrinfo_destroy_pkgdbinfo(handle);
5024 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5027 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5028 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5029 * @brief This API saves all the information from the handle to the DB.
5031 * @par This API is for package-manager client application
5032 * @par Sync (or) Async : Synchronous API
5034 * @param[in] handle pointer to the package db info handle.
5035 * @param[in] uid the addressee user id of the instruction
5036 * @return 0 if success, error code(<0) if fail
5037 * @retval PMINFO_R_OK success
5038 * @retval PMINFO_R_EINVAL invalid argument
5039 * @retval PMINFO_R_ERROR internal error
5040 * @pre pkgmgrinfo_create_pkgdbinfo()
5041 * @post pkgmgrinfo_destroy_pkgdbinfo()
5042 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5044 static int set_pkg_in_db(const char *pkgid)
5047 pkgmgrinfo_pkgdbinfo_h handle;
5048 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5049 if (ret != PMINFO_R_OK)
5051 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5052 if (ret != PMINFO_R_OK) {
5053 pkgmgrinfo_destroy_pkgdbinfo(handle);
5056 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5057 if (ret != PMINFO_R_OK) {
5058 pkgmgrinfo_destroy_pkgdbinfo(handle);
5061 pkgmgrinfo_destroy_pkgdbinfo(handle);
5066 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5067 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5069 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5070 * @brief This API destroys the package db information handle freeing up all the resources
5072 * @par This API is for package-manager client application
5073 * @par Sync (or) Async : Synchronous API
5075 * @param[in] handle pointer to the package db info handle.
5076 * @return 0 if success, error code(<0) if fail
5077 * @retval PMINFO_R_OK success
5078 * @retval PMINFO_R_EINVAL invalid argument
5079 * @retval PMINFO_R_ERROR internal error
5080 * @pre pkgmgrinfo_create_pkgdbinfo()
5082 * @see pkgmgrinfo_save_pkgdbinfo()
5083 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5085 static int set_pkg_in_db(const char *pkgid)
5088 pkgmgrinfo_pkgdbinfo_h handle;
5089 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5090 if (ret != PMINFO_R_OK)
5092 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5093 if (ret != PMINFO_R_OK) {
5094 pkgmgrinfo_destroy_pkgdbinfo(handle);
5097 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5098 if (ret != PMINFO_R_OK) {
5099 pkgmgrinfo_destroy_pkgdbinfo(handle);
5102 pkgmgrinfo_destroy_pkgdbinfo(handle);
5107 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5111 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5112 * @brief This API creates the package cert information handle to set data in db.
5114 * @par This API is for package-manager client application
5115 * @par Sync (or) Async : Synchronous API
5117 * @param[out] handle pointer to the package cert handle.
5118 * @return 0 if success, error code(<0) if fail
5119 * @retval PMINFO_R_OK success
5120 * @retval PMINFO_R_EINVAL invalid argument
5121 * @retval PMINFO_R_ERROR internal error
5123 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5124 * @see pkgmgrinfo_set_cert_value()
5125 * @see pkgmgrinfo_save_certinfo()
5127 static int set_cert_in_db(const char *pkgid)
5130 pkgmgrinfo_instcertinfo_h handle;
5131 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5132 if (ret != PMINFO_R_OK)
5134 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5135 if (ret != PMINFO_R_OK) {
5136 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5139 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5140 if (ret != PMINFO_R_OK) {
5141 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5144 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5149 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5152 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5153 * @brief This API sets the package cert information in the handle.
5155 * @par This API is for package-manager client application
5156 * @par Sync (or) Async : Synchronous API
5158 * @param[in] handle pointer to the package cert handle.
5159 * @param[in] cert_type certificate type.
5160 * @param[in] cert_value certificate value.
5161 * @return 0 if success, error code(<0) if fail
5162 * @retval PMINFO_R_OK success
5163 * @retval PMINFO_R_EINVAL invalid argument
5164 * @retval PMINFO_R_ERROR internal error
5165 * @pre pkgmgrinfo_create_certinfo_set_handle()
5166 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5167 * @see pkgmgrinfo_save_certinfo()
5169 static int set_cert_in_db(const char *pkgid)
5172 pkgmgrinfo_instcertinfo_h handle;
5173 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5174 if (ret != PMINFO_R_OK)
5176 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5177 if (ret != PMINFO_R_OK) {
5178 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5181 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5182 if (ret != PMINFO_R_OK) {
5183 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5186 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5191 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5194 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5195 * @brief This API saves the package cert information in the DB.
5197 * @par This API is for package-manager client application
5198 * @par Sync (or) Async : Synchronous API
5200 * @param[in] pkgid pointer to the package ID.
5201 * @param[in] handle pointer to the package cert handle.
5202 * @return 0 if success, error code(<0) if fail
5203 * @retval PMINFO_R_OK success
5204 * @retval PMINFO_R_EINVAL invalid argument
5205 * @retval PMINFO_R_ERROR internal error
5206 * @pre pkgmgrinfo_create_certinfo_set_handle()
5207 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5208 * @see pkgmgrinfo_save_certinfo()
5210 static int set_cert_in_db(const char *pkgid)
5213 pkgmgrinfo_instcertinfo_h handle;
5214 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5215 if (ret != PMINFO_R_OK)
5217 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5218 if (ret != PMINFO_R_OK) {
5219 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5222 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5223 if (ret != PMINFO_R_OK) {
5224 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5227 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5232 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5235 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5236 * @brief This API destroys the package cert information handle freeing up all the resources.
5238 * @par This API is for package-manager client application
5239 * @par Sync (or) Async : Synchronous API
5241 * @param[in] handle pointer to the package cert handle.
5242 * @return 0 if success, error code(<0) if fail
5243 * @retval PMINFO_R_OK success
5244 * @retval PMINFO_R_EINVAL invalid argument
5245 * @retval PMINFO_R_ERROR internal error
5246 * @pre pkgmgrinfo_create_certinfo_set_handle()
5248 * @see pkgmgrinfo_save_certinfo()
5250 static int set_cert_in_db(const char *pkgid)
5253 pkgmgrinfo_instcertinfo_h handle;
5254 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5255 if (ret != PMINFO_R_OK)
5257 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5258 if (ret != PMINFO_R_OK) {
5259 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5262 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5263 if (ret != PMINFO_R_OK) {
5264 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5267 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5272 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5275 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5276 * @brief This API gets the datacontrol info
5278 * @par This API is for package-manager client application
5279 * @par Sync (or) Async : Synchronous API
5281 * @param[in] providerid pointer to the providerid of dataconltrol.
5282 * @param[in] type pointer to the type of dataconltrol.
5283 * @param[out] appid pointer to hold appid, need to free after using
5284 * @param[out] access pointer to hold access, need to free after using
5285 * @return 0 if success, error code(<0) if fail
5286 * @retval PMINFO_R_OK success
5287 * @retval PMINFO_R_EINVAL invalid argument
5288 * @retval PMINFO_R_ERROR internal error
5291 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5294 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5295 * @brief This API gets the application 'guest mode visibility' value from the DB
5297 * @par This API is for package-manager client application
5298 * @par Sync (or) Async : Synchronous API
5300 * @param[in] handle pointer to application info handle
5301 * @param[out] status pointer to hold app guest mode visibility value
5302 * @return 0 if success, error code(<0) if fail
5303 * @retval PMINFO_R_OK success
5304 * @retval PMINFO_R_EINVAL invalid argument
5305 * @retval PMINFO_R_ERROR internal error
5306 * @pre pkgmgrinfo_appinfo_get_appinfo()
5307 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5308 * @see pkgmgrinfo_appinfo_get_appid()
5309 * @see pkgmgrinfo_appinfo_is_multiple()
5311 static int get_app_guestmode_visibility(const char *appid)
5315 pkgmgrinfo_appinfo_h handle;
5316 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5317 if (ret != PMINFO_R_OK)
5319 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5320 if (ret != PMINFO_R_OK) {
5321 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5324 printf("app guest mode visibility: %d\n", status);
5325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5330 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5333 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5334 * @brief This API sets the application 'guest mode visibility' value in the DB
5336 * @par This API is for package-manager client application
5337 * @par Sync (or) Async : Synchronous API
5339 * @param[in] handle pointer to application info handle
5340 * @param[out] status app guest mode visibility value
5341 * @return 0 if success, error code(<0) if fail
5342 * @retval PMINFO_R_OK success
5343 * @retval PMINFO_R_EINVAL invalid argument
5344 * @retval PMINFO_R_ERROR internal error
5345 * @pre pkgmgrinfo_appinfo_get_appinfo()
5346 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5347 * @see pkgmgrinfo_appinfo_get_appid()
5348 * @see pkgmgrinfo_appinfo_is_multiple()
5350 static int set_app_guestmode_visibility(const char *appid, bool value)
5353 pkgmgrinfo_appinfo_h handle;
5354 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5355 if (ret != PMINFO_R_OK)
5357 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5358 if (ret != PMINFO_R_OK) {
5359 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5367 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5368 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5370 * @pkgmgrinfo client API
5374 * @brief listening status type in pkgmgrinfo.
5376 #define PMINFO_CLIENT_STATUS_ALL 0x00
5377 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5378 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5379 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5380 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5381 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5382 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5385 * @brief type definition.
5387 typedef void pkgmgrinfo_client;
5388 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5389 const char *pkgid, const char *key,
5390 const char *val, const void *pmsg, void *data);
5396 }pkgmgrinfo_client_type;
5399 * @brief This APIs provides pkgmgrinfo client listener
5401 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5402 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5403 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5404 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5405 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5408 * @pkgmgrinfo client API end
5416 #endif /* __PKG_INFO_H__ */