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_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3165 * @brief This API gets the datacontrol info
3167 * @par This API is for package-manager client application
3168 * @par Sync (or) Async : Synchronous API
3170 * @param[in] providerid pointer to the providerid of dataconltrol.
3171 * @param[in] type pointer to the type of dataconltrol.
3172 * @param[out] appid pointer to hold appid, need to free after using
3173 * @param[out] access pointer to hold access, need to free after using
3174 * @return 0 if success, error code(<0) if fail
3175 * @retval PMINFO_R_OK success
3176 * @retval PMINFO_R_EINVAL invalid argument
3177 * @retval PMINFO_R_ERROR internal error
3180 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3183 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3184 * @brief This API gets the appid of datacontrol
3186 * @par This API is for package-manager client application
3187 * @par Sync (or) Async : Synchronous API
3189 * @param[in] providerid pointer to the providerid of dataconltrol.
3190 * @param[out] appid pointer to hold appid, need to free after using
3191 * @return 0 if success, error code(<0) if fail
3192 * @retval PMINFO_R_OK success
3193 * @retval PMINFO_R_EINVAL invalid argument
3194 * @retval PMINFO_R_ERROR internal error
3197 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3200 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3201 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3202 * @brief This API gets the list of permission for a particular application
3204 * @par This API is for package-manager client application
3205 * @par Sync (or) Async : Synchronous API
3206 * @param[in] handle pointer to the application info handle.
3207 * @param[in] permission_func callback function for list
3208 * @param[in] user_data user data to be passed to callback function
3209 * @return 0 if success, error code(<0) if fail
3210 * @retval PMINFO_R_OK success
3211 * @retval PMINFO_R_EINVAL invalid argument
3212 * @retval PMINFO_R_ERROR internal error
3213 * @pre pkgmgrinfo_appinfo_get_appinfo()
3214 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3216 int permission_func(const char *name, void *user_data)
3218 if (strcmp(name, (char *)user_data) == 0)
3224 static int list_permission(const char *appid, char *permission)
3227 pkgmgrinfo_appinfo_h handle;
3228 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3229 if (ret != PMINFO_R_OK)
3231 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3232 if (ret != PMINFO_R_OK) {
3233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3236 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3241 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3242 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3245 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3246 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3247 * @brief This API gets the list of category for a particular application
3249 * @par This API is for package-manager client application
3250 * @par Sync (or) Async : Synchronous API
3251 * @param[in] handle pointer to the application info handle.
3252 * @param[in] category_func callback function for list
3253 * @param[in] user_data user data to be passed to callback function
3254 * @return 0 if success, error code(<0) if fail
3255 * @retval PMINFO_R_OK success
3256 * @retval PMINFO_R_EINVAL invalid argument
3257 * @retval PMINFO_R_ERROR internal error
3258 * @pre pkgmgrinfo_appinfo_get_appinfo()
3259 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3261 int category_func(const char *name, void *user_data)
3263 if (strcmp(name, (char *)user_data) == 0)
3269 static int list_category(const char *appid, char *category)
3272 pkgmgrinfo_appinfo_h handle;
3273 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3274 if (ret != PMINFO_R_OK)
3276 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3277 if (ret != PMINFO_R_OK) {
3278 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3286 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3287 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3290 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3291 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3292 * @brief This API gets the list of metadata for a particular application
3294 * @par This API is for package-manager client application
3295 * @par Sync (or) Async : Synchronous API
3296 * @param[in] handle pointer to the application info handle.
3297 * @param[in] metadata_func callback function for list
3298 * @param[in] user_data user data to be passed to callback function
3299 * @return 0 if success, error code(<0) if fail
3300 * @retval PMINFO_R_OK success
3301 * @retval PMINFO_R_EINVAL invalid argument
3302 * @retval PMINFO_R_ERROR internal error
3303 * @pre pkgmgrinfo_appinfo_get_appinfo()
3304 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3306 int metadata_func(const char *key, const char *value, void *user_data)
3308 if (strcmp(key, (char *)user_data) == 0) {
3309 printf("Value is %s\n", value);
3316 static int list_metadata(const char *appid, char *key)
3319 pkgmgrinfo_appinfo_h handle;
3320 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3321 if (ret != PMINFO_R_OK)
3323 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3324 if (ret != PMINFO_R_OK) {
3325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3328 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3333 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3334 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3338 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3339 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3340 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3341 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3342 * @brief This API gets the list of app-control for a particular application
3344 * @par This API is for package-manager client application
3345 * @par Sync (or) Async : Synchronous API
3346 * @param[in] handle pointer to the application info handle.
3347 * @param[in] appcontrol_func callback function for list
3348 * @param[in] user_data user data to be passed to callback function
3349 * @param[in] uid the addressee user id of the instruction
3350 * @return 0 if success, error code(<0) if fail
3351 * @retval PMINFO_R_OK success
3352 * @retval PMINFO_R_EINVAL invalid argument
3353 * @retval PMINFO_R_ERROR internal error
3354 * @pre pkgmgrinfo_appinfo_get_appinfo()
3355 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3357 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3362 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3363 for (i = 0; i < oc; i++) {
3364 if (strcmp(operation[i], (char *)user_data) == 0)
3371 static int check_operation(const char *appid, char *operation)
3374 pkgmgrinfo_appinfo_h handle;
3375 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3376 if (ret != PMINFO_R_OK)
3378 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3379 if (ret != PMINFO_R_OK) {
3380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3383 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3388 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3389 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3390 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3391 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3394 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3395 * @brief This API gets the application 'nodisplay' value from the app ID
3397 * @par This API is for package-manager client application
3398 * @par Sync (or) Async : Synchronous API
3400 * @param[in] handle pointer to application info handle
3401 * @param[out] nodisplay pointer to hold package nodisplay value
3402 * @return 0 if success, error code(<0) if fail
3403 * @retval PMINFO_R_OK success
3404 * @retval PMINFO_R_EINVAL invalid argument
3405 * @retval PMINFO_R_ERROR internal error
3406 * @pre pkgmgrinfo_appinfo_get_appinfo()
3407 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3408 * @see pkgmgrinfo_appinfo_get_appid()
3409 * @see pkgmgrinfo_appinfo_is_multiple()
3411 static int get_app_nodisplay(const char *appid)
3415 pkgmgrinfo_appinfo_h handle;
3416 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3417 if (ret != PMINFO_R_OK)
3419 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3420 if (ret != PMINFO_R_OK) {
3421 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3424 printf("app nodisplay: %d\n", nodisplay);
3425 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3430 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3433 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3434 * @brief This API gets the application 'multiple' value from the app ID
3436 * @par This API is for package-manager client application
3437 * @par Sync (or) Async : Synchronous API
3439 * @param[in] handle pointer to application info handle
3440 * @param[out] multiple pointer to hold package multiple value
3441 * @return 0 if success, error code(<0) if fail
3442 * @retval PMINFO_R_OK success
3443 * @retval PMINFO_R_EINVAL invalid argument
3444 * @retval PMINFO_R_ERROR internal error
3445 * @pre pkgmgrinfo_appinfo_get_appinfo()
3446 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3447 * @see pkgmgrinfo_appinfo_get_appid()
3448 * @see pkgmgrinfo_appinfo_is_nodisplay()
3450 static int get_app_multiple(const char *appid)
3454 pkgmgrinfo_appinfo_h handle;
3455 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3456 if (ret != PMINFO_R_OK)
3458 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3459 if (ret != PMINFO_R_OK) {
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3463 printf("app multiple: %d\n", multiple);
3464 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3469 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3472 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3473 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3474 * application launching effect. If fales, indicator will be hidden during application launching effect
3476 * @par This API is for package-manager client application
3477 * @par Sync (or) Async : Synchronous API
3479 * @param[in] handle pointer to application info handle
3480 * @param[out] indicator_disp contains indicator display status for application launching effect
3481 * @return 0 if success, error code(<0) if fail
3482 * @retval PMINFO_R_OK success
3483 * @retval PMINFO_R_EINVAL invalid argument
3484 * @retval PMINFO_R_ERROR internal error
3485 * @pre pkgmgrinfo_appinfo_get_appinfo()
3486 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3487 * @see pkgmgrinfo_appinfo_get_appid()
3488 * @see pkgmgrinfo_appinfo_is_nodisplay()
3490 static int get_app_indicator_display(const char *appid)
3493 bool indicator_disp;
3494 pkgmgrinfo_appinfo_h handle;
3495 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3496 if (ret != PMINFO_R_OK)
3498 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3499 if (ret != PMINFO_R_OK){
3500 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3503 printf("app indicator disp : %d\n", indicator_disp);
3504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3509 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3512 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3513 * @brief This API gets the application 'taskmanage' value from the app ID
3515 * @par This API is for package-manager client application
3516 * @par Sync (or) Async : Synchronous API
3518 * @param[in] handle pointer to application info handle
3519 * @param[out] taskmanage pointer to hold package taskmanage value
3520 * @return 0 if success, error code(<0) if fail
3521 * @retval PMINFO_R_OK success
3522 * @retval PMINFO_R_EINVAL invalid argument
3523 * @retval PMINFO_R_ERROR internal error
3524 * @pre pkgmgrinfo_appinfo_get_appinfo()
3525 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3526 * @see pkgmgrinfo_appinfo_get_appid()
3527 * @see pkgmgrinfo_appinfo_is_multiple()
3529 static int get_app_taskmanage(const char *appid)
3533 pkgmgrinfo_appinfo_h handle;
3534 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3535 if (ret != PMINFO_R_OK)
3537 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3538 if (ret != PMINFO_R_OK) {
3539 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3542 printf("app taskmanage: %d\n", taskmanage);
3543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3548 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3551 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3552 * @brief This API gets the application 'taskmanage' value from the app ID
3554 * @par This API is for package-manager client application
3555 * @par Sync (or) Async : Synchronous API
3557 * @param[in] handle pointer to application info handle
3558 * @param[out] enabled pointer to hold package enabled value
3559 * @return 0 if success, error code(<0) if fail
3560 * @retval PMINFO_R_OK success
3561 * @retval PMINFO_R_EINVAL invalid argument
3562 * @retval PMINFO_R_ERROR internal error
3563 * @pre pkgmgrinfo_appinfo_get_appinfo()
3564 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3565 * @see pkgmgrinfo_appinfo_get_appid()
3566 * @see pkgmgrinfo_appinfo_is_multiple()
3568 static int get_app_enabled(const char *appid)
3572 pkgmgrinfo_appinfo_h handle;
3573 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3574 if (ret != PMINFO_R_OK)
3576 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3577 if (ret != PMINFO_R_OK) {
3578 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3581 printf("app enabled: %d\n", enabled);
3582 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3587 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3590 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3591 * @brief This API gets the application 'onboot' value from the app ID
3593 * @par This API is for package-manager client application
3594 * @par Sync (or) Async : Synchronous API
3596 * @param[in] handle pointer to application info handle
3597 * @param[out] onboot pointer to hold package onboot value
3598 * @return 0 if success, error code(<0) if fail
3599 * @retval PMINFO_R_OK success
3600 * @retval PMINFO_R_EINVAL invalid argument
3601 * @retval PMINFO_R_ERROR internal error
3602 * @pre pkgmgrinfo_appinfo_get_appinfo()
3603 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3604 * @see pkgmgrinfo_appinfo_get_appid()
3605 * @see pkgmgrinfo_appinfo_is_multiple()
3607 static int get_app_onboot(const char *appid)
3611 pkgmgrinfo_appinfo_h handle;
3612 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3613 if (ret != PMINFO_R_OK)
3615 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3616 if (ret != PMINFO_R_OK) {
3617 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3620 printf("app onboot: %d\n", onboot);
3621 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3626 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3629 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3630 * @brief This API gets the application 'autorestart' value from the app ID
3632 * @par This API is for package-manager client application
3633 * @par Sync (or) Async : Synchronous API
3635 * @param[in] handle pointer to application info handle
3636 * @param[out] autorestart pointer to hold package autorestart value
3637 * @return 0 if success, error code(<0) if fail
3638 * @retval PMINFO_R_OK success
3639 * @retval PMINFO_R_EINVAL invalid argument
3640 * @retval PMINFO_R_ERROR internal error
3641 * @pre pkgmgrinfo_appinfo_get_appinfo()
3642 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3643 * @see pkgmgrinfo_appinfo_get_appid()
3644 * @see pkgmgrinfo_appinfo_is_multiple()
3646 static int get_app_autorestart(const char *appid)
3650 pkgmgrinfo_appinfo_h handle;
3651 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3652 if (ret != PMINFO_R_OK)
3654 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3655 if (ret != PMINFO_R_OK) {
3656 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3659 printf("app autorestart: %d\n", autorestart);
3660 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3665 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3668 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3669 * @brief This API gets the value for given application is main app or not from handle
3671 * @par This API is for package-manager client application
3672 * @par Sync (or) Async : Synchronous API
3674 * @param[in] handle pointer to application info handle
3675 * @param[out] mainapp pointer to hold package mainapp is or not
3676 * @return 0 if success, error code(<0) if fail
3677 * @retval PMINFO_R_OK success
3678 * @retval PMINFO_R_EINVAL invalid argument
3679 * @retval PMINFO_R_ERROR internal error
3680 * @pre pkgmgrinfo_appinfo_get_appinfo()
3681 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3682 * @see pkgmgrinfo_appinfo_get_appid()
3683 * @see pkgmgrinfo_appinfo_is_multiple()
3685 static int get_app_mainapp(const char *appid)
3689 pkgmgrinfo_appinfo_h handle;
3690 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3691 if (ret != PMINFO_R_OK)
3693 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3694 if (ret != PMINFO_R_OK) {
3695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3698 printf("mainapp: %d\n", mainapp);
3699 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3704 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3708 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3709 * @brief This API gets the value for given application is preload or not from handle
3711 * @par This API is for package-manager client application
3712 * @par Sync (or) Async : Synchronous API
3714 * @param[in] handle pointer to application info handle
3715 * @param[out] preload pointer to hold preload is or not
3716 * @return 0 if success, error code(<0) if fail
3717 * @retval PMINFO_R_OK success
3718 * @retval PMINFO_R_EINVAL invalid argument
3719 * @retval PMINFO_R_ERROR internal error
3720 * @pre pkgmgrinfo_appinfo_get_appinfo()
3721 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3722 * @see pkgmgrinfo_appinfo_get_appid()
3723 * @see pkgmgrinfo_appinfo_is_multiple()
3725 static int get_app_preload(const char *appid)
3729 pkgmgrinfo_appinfo_h handle = NULL;
3730 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3731 if (ret != PMINFO_R_OK)
3733 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3734 if (ret != PMINFO_R_OK) {
3735 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3738 printf("preload: %d\n", preload);
3739 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3744 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3747 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3748 * @brief This API gets the value for given application is submode or not from handle
3750 * @par This API is for package-manager client application
3751 * @par Sync (or) Async : Synchronous API
3753 * @param[in] handle pointer to application info handle
3754 * @param[out] submode pointer to hold submode is or not
3755 * @return 0 if success, error code(<0) if fail
3756 * @retval PMINFO_R_OK success
3757 * @retval PMINFO_R_EINVAL invalid argument
3758 * @retval PMINFO_R_ERROR internal error
3759 * @pre pkgmgrinfo_appinfo_get_appinfo()
3760 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3761 * @see pkgmgrinfo_appinfo_get_appid()
3762 * @see pkgmgrinfo_appinfo_is_multiple()
3764 static int get_app_submode(const char *appid)
3768 pkgmgrinfo_appinfo_h handle = NULL;
3769 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3770 if (ret != PMINFO_R_OK)
3772 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3773 if (ret != PMINFO_R_OK) {
3774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3777 printf("submode: %d\n", submode);
3778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3783 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3786 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3787 * @brief This API destroys the application information handle freeing up all the resources
3789 * @par This API is for package-manager client application
3790 * @par Sync (or) Async : Synchronous API
3792 * @param[in] handle pointer to the application info handle.
3793 * @return 0 if success, error code(<0) if fail
3794 * @retval PMINFO_R_OK success
3795 * @retval PMINFO_R_EINVAL invalid argument
3796 * @retval PMINFO_R_ERROR internal error
3797 * @pre pkgmgrinfo_appinfo_get_appinfo()
3799 * @see pkgmgrinfo_appinfo_get_pkgid()
3800 * @see pkgmgrinfo_appinfo_is_multiple()
3802 static int get_app_type(const char *appid)
3806 pkgmgrinfo_appinfo_h handle;
3807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3808 if (ret != PMINFO_R_OK)
3810 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3815 printf("apptype: %s\n", type);
3816 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3821 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3824 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3825 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3826 The query will search the entire application information collected from the manifest file of all the installed packages
3828 * @par This API is for package-manager client application
3829 * @par Sync (or) Async : Synchronous API
3831 * @param[out] handle pointer to the application info filter handle.
3832 * @return 0 if success, error code(<0) if fail
3833 * @retval PMINFO_R_OK success
3834 * @retval PMINFO_R_EINVAL invalid argument
3835 * @retval PMINFO_R_ERROR internal error
3837 * @post pkgmgrinfo_appinfo_filter_destroy()
3838 * @see pkgmgrinfo_appinfo_filter_count()
3839 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3841 static int get_capp_count()
3845 pkgmgrinfo_appinfo_filter_h handle;
3846 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3847 if (ret != PMINFO_R_OK)
3849 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3850 if (ret != PMINFO_R_OK) {
3851 pkgmgrinfo_appinfo_filter_destroy(handle);
3854 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3855 if (ret != PMINFO_R_OK) {
3856 pkgmgrinfo_appinfo_filter_destroy(handle);
3859 printf("No of capp: %d\n", count);
3860 pkgmgrinfo_appinfo_filter_destroy(handle);
3865 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3868 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3869 * @brief This API destroys the application information filter handle freeing up all the resources
3871 * @par This API is for package-manager client application
3872 * @par Sync (or) Async : Synchronous API
3874 * @param[in] handle pointer to the application info filter handle.
3875 * @return 0 if success, error code(<0) if fail
3876 * @retval PMINFO_R_OK success
3877 * @retval PMINFO_R_EINVAL invalid argument
3878 * @retval PMINFO_R_ERROR internal error
3879 * @pre pkgmgrinfo_appinfo_filter_create()
3881 * @see pkgmgrinfo_appinfo_filter_count()
3882 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3884 static int get_capp_count()
3888 pkgmgrinfo_appinfo_filter_h handle;
3889 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3890 if (ret != PMINFO_R_OK)
3892 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3893 if (ret != PMINFO_R_OK) {
3894 pkgmgrinfo_appinfo_filter_destroy(handle);
3897 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3898 if (ret != PMINFO_R_OK) {
3899 pkgmgrinfo_appinfo_filter_destroy(handle);
3902 printf("No of capp: %d\n", count);
3903 pkgmgrinfo_appinfo_filter_destroy(handle);
3908 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3911 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3912 * @brief This API adds a boolean filter property to the filter handle
3914 * @par This API is for package-manager client application
3915 * @par Sync (or) Async : Synchronous API
3917 * @param[in] handle pointer to the application info filter handle.
3918 * @param[in] property boolean property name.
3919 * @param[in] value value corresponding to the property.
3920 * @return 0 if success, error code(<0) if fail
3921 * @retval PMINFO_R_OK success
3922 * @retval PMINFO_R_EINVAL invalid argument
3923 * @retval PMINFO_R_ERROR internal error
3924 * @pre pkgmgrinfo_appinfo_filter_create()
3925 * @post pkgmgrinfo_appinfo_filter_destroy()
3926 * @see pkgmgrinfo_appinfo_filter_count()
3927 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3929 static int get_taskmanageable_app_count()
3933 pkgmgrinfo_appinfo_filter_h handle;
3934 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3935 if (ret != PMINFO_R_OK)
3937 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3938 if (ret != PMINFO_R_OK) {
3939 pkgmgrinfo_appinfo_filter_destroy(handle);
3942 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3943 if (ret != PMINFO_R_OK) {
3944 pkgmgrinfo_appinfo_filter_destroy(handle);
3947 printf("No of taskmanageable apps: %d\n", count);
3948 pkgmgrinfo_appinfo_filter_destroy(handle);
3953 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3954 const char *property, const bool value);
3957 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3958 * @brief This API adds an integer filter property to the filter handle
3960 * @par This API is for package-manager client application
3961 * @par Sync (or) Async : Synchronous API
3963 * @param[in] handle pointer to the application info filter handle.
3964 * @param[in] property integer property name.
3965 * @param[in] value value corresponding to the property.
3966 * @return 0 if success, error code(<0) if fail
3967 * @retval PMINFO_R_OK success
3968 * @retval PMINFO_R_EINVAL invalid argument
3969 * @retval PMINFO_R_ERROR internal error
3970 * @pre pkgmgrinfo_appinfo_filter_create()
3971 * @post pkgmgrinfo_appinfo_filter_destroy()
3972 * @see pkgmgrinfo_appinfo_filter_count()
3973 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3975 static int get_taskmanageable_app_count()
3979 pkgmgrinfo_appinfo_filter_h handle;
3980 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3981 if (ret != PMINFO_R_OK)
3983 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3984 if (ret != PMINFO_R_OK) {
3985 pkgmgrinfo_appinfo_filter_destroy(handle);
3988 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3989 if (ret != PMINFO_R_OK) {
3990 pkgmgrinfo_appinfo_filter_destroy(handle);
3993 printf("No of apps: %d\n", count);
3994 pkgmgrinfo_appinfo_filter_destroy(handle);
3999 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4000 const char *property, const int value);
4003 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4004 * @brief This API adds a string filter property to the filter handle
4006 * @par This API is for package-manager client application
4007 * @par Sync (or) Async : Synchronous API
4009 * @param[in] handle pointer to the application info filter handle.
4010 * @param[in] property string property name.
4011 * @param[in] value value corresponding to the property.
4012 * @return 0 if success, error code(<0) if fail
4013 * @retval PMINFO_R_OK success
4014 * @retval PMINFO_R_EINVAL invalid argument
4015 * @retval PMINFO_R_ERROR internal error
4016 * @pre pkgmgrinfo_appinfo_filter_create()
4017 * @post pkgmgrinfo_appinfo_filter_destroy()
4018 * @see pkgmgrinfo_appinfo_filter_count()
4019 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4021 static int get_capp_count()
4025 pkgmgrinfo_appinfo_filter_h handle;
4026 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4027 if (ret != PMINFO_R_OK)
4029 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4030 if (ret != PMINFO_R_OK) {
4031 pkgmgrinfo_appinfo_filter_destroy(handle);
4034 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4035 if (ret != PMINFO_R_OK) {
4036 pkgmgrinfo_appinfo_filter_destroy(handle);
4039 printf("No of capp: %d\n", count);
4040 pkgmgrinfo_appinfo_filter_destroy(handle);
4045 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4046 const char *property, const char *value);
4049 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4050 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4052 * @par This API is for package-manager client application
4053 * @par Sync (or) Async : Synchronous API
4055 * @param[in] handle pointer to the application info filter handle.
4056 * @param[in] app_cb callback function.
4057 * @param[in] user_data user data to be passed to the callback function
4058 * @return 0 if success, error code(<0) if fail
4059 * @retval PMINFO_R_OK success
4060 * @retval PMINFO_R_EINVAL invalid argument
4061 * @retval PMINFO_R_ERROR internal error
4062 * @pre pkgmgrinfo_appinfo_filter_create()
4063 * @post pkgmgrinfo_appinfo_filter_destroy()
4064 * @see pkgmgrinfo_appinfo_filter_count()
4066 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4069 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4070 printf("appid : %s\n", appid);
4074 static int get_capp_list()
4077 pkgmgrinfo_appinfo_filter_h handle;
4078 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4079 if (ret != PMINFO_R_OK)
4081 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4082 if (ret != PMINFO_R_OK) {
4083 pkgmgrinfo_appinfo_filter_destroy(handle);
4086 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4087 if (ret != PMINFO_R_OK) {
4088 pkgmgrinfo_appinfo_filter_destroy(handle);
4091 pkgmgrinfo_appinfo_filter_destroy(handle);
4096 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4097 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4098 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4099 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4102 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4103 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4104 * @brief This API counts the application that satisfy the filter conditions
4106 * @par This API is for package-manager client application
4107 * @par Sync (or) Async : Synchronous API
4109 * @param[in] handle pointer to the application info filter handle.
4110 * @param[in] count pointer to store count value
4111 * @param[in] uid the addressee user id of the instruction
4112 * @return 0 if success, error code(<0) if fail
4113 * @retval PMINFO_R_OK success
4114 * @retval PMINFO_R_EINVAL invalid argument
4115 * @retval PMINFO_R_ERROR internal error
4116 * @pre pkgmgrinfo_appinfo_filter_create()
4117 * @post pkgmgrinfo_appinfo_filter_destroy()
4118 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4120 static int get_capp_count()
4124 pkgmgrinfo_appinfo_filter_h handle;
4125 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4126 if (ret != PMINFO_R_OK)
4128 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4129 if (ret != PMINFO_R_OK) {
4130 pkgmgrinfo_appinfo_filter_destroy(handle);
4133 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4134 if (ret != PMINFO_R_OK) {
4135 pkgmgrinfo_appinfo_filter_destroy(handle);
4138 printf("No of capp: %d\n", count);
4139 pkgmgrinfo_appinfo_filter_destroy(handle);
4144 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4145 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4147 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4148 * @brief This API creates the application's metadata information filter handle from db.
4150 * @par This API is for package-manager client application
4151 * @par Sync (or) Async : Synchronous API
4153 * @param[out] handle pointer to the application metadata info filter handle.
4154 * @return 0 if success, error code(<0) if fail
4155 * @retval PMINFO_R_OK success
4156 * @retval PMINFO_R_EINVAL invalid argument
4157 * @retval PMINFO_R_ERROR internal error
4159 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4160 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4162 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4165 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4166 printf("appid : %s\n", appid);
4170 static int get_app_list(const char *mkey, const char *mvalue)
4173 pkgmgrinfo_appinfo_metadata_filter_h handle;
4174 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4175 if (ret != PMINFO_R_OK)
4177 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4178 if (ret != PMINFO_R_OK) {
4179 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4182 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4183 if (ret != PMINFO_R_OK) {
4184 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4187 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4192 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4195 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4196 * @brief This API destroys the application's metadata information filter handle.
4198 * @par This API is for package-manager client application
4199 * @par Sync (or) Async : Synchronous API
4201 * @param[in] handle pointer to the application metadata info filter handle.
4202 * @return 0 if success, error code(<0) if fail
4203 * @retval PMINFO_R_OK success
4204 * @retval PMINFO_R_EINVAL invalid argument
4205 * @retval PMINFO_R_ERROR internal error
4206 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4208 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4210 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4213 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4214 printf("appid : %s\n", appid);
4218 static int get_app_list(const char *mkey, const char *mvalue)
4221 pkgmgrinfo_appinfo_metadata_filter_h handle;
4222 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4223 if (ret != PMINFO_R_OK)
4225 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4226 if (ret != PMINFO_R_OK) {
4227 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4230 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4231 if (ret != PMINFO_R_OK) {
4232 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4235 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4240 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4243 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4244 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4245 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4247 * @par This API is for package-manager client application
4248 * @par Sync (or) Async : Synchronous API
4250 * @param[in] handle pointer to the application metadata info filter handle.
4251 * @param[in] key pointer to metadata key
4252 * @param[in] value pointer to metadata value
4253 * @return 0 if success, error code(<0) if fail
4254 * @retval PMINFO_R_OK success
4255 * @retval PMINFO_R_EINVAL invalid argument
4256 * @retval PMINFO_R_ERROR internal error
4257 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4258 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4259 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4261 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4264 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4265 printf("appid : %s\n", appid);
4269 static int get_app_list(const char *mkey, const char *mvalue)
4272 pkgmgrinfo_appinfo_metadata_filter_h handle;
4273 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4274 if (ret != PMINFO_R_OK)
4276 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4277 if (ret != PMINFO_R_OK) {
4278 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4281 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4282 if (ret != PMINFO_R_OK) {
4283 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4286 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4291 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4292 const char *key, const char *value);
4295 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4296 * @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)
4297 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4298 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4299 * negative value, no more callbacks will be called and API will return.
4301 * @par This API is for package-manager client application
4302 * @par Sync (or) Async : Synchronous API
4304 * @param[in] handle pointer to the application metadata info filter handle.
4305 * @param[in] app_cb function pointer to callback
4306 * @param[in] user_data pointer to user data
4307 * @param[in] uid the addressee user id of the instruction
4308 * @return 0 if success, error code(<0) if fail
4309 * @retval PMINFO_R_OK success
4310 * @retval PMINFO_R_EINVAL invalid argument
4311 * @retval PMINFO_R_ERROR internal error
4312 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4313 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4315 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4318 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4319 printf("appid : %s\n", appid);
4323 static int get_app_list(const char *mkey, const char *mvalue)
4326 pkgmgrinfo_appinfo_metadata_filter_h handle;
4327 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4328 if (ret != PMINFO_R_OK)
4330 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4331 if (ret != PMINFO_R_OK) {
4332 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4335 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4336 if (ret != PMINFO_R_OK) {
4337 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4340 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4345 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4346 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4347 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4348 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4350 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4351 * @brief This API creates the package cert information handle to get data from db.
4353 * @par This API is for package-manager client application
4354 * @par Sync (or) Async : Synchronous API
4356 * @param[out] handle pointer to the package cert handle.
4357 * @return 0 if success, error code(<0) if fail
4358 * @retval PMINFO_R_OK success
4359 * @retval PMINFO_R_EINVAL invalid argument
4360 * @retval PMINFO_R_ERROR internal error
4362 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4363 * @see pkgmgrinfo_pkginfo_get_cert_value()
4364 * @see pkgmgrinfo_pkginfo_load_certinfo()
4366 static int get_cert_info(const char *pkgid)
4369 pkgmgrinfo_certinfo_h handle;
4370 char *auth_cert = NULL;
4371 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4372 if (ret != PMINFO_R_OK)
4374 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4375 if (ret != PMINFO_R_OK) {
4376 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4379 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4380 if (ret != PMINFO_R_OK) {
4381 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4384 printf("Author root certificate: %s\n", auth_root);
4385 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4390 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4393 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4394 * @brief This API loads the package cert information handle with data from db.
4396 * @par This API is for package-manager client application
4397 * @par Sync (or) Async : Synchronous API
4399 * @param[in] pkgid pointer to the package ID.
4400 * @param[in] handle pointer to the package cert handle.
4401 * @return 0 if success, error code(<0) if fail
4402 * @retval PMINFO_R_OK success
4403 * @retval PMINFO_R_EINVAL invalid argument
4404 * @retval PMINFO_R_ERROR internal error
4405 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4406 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4407 * @see pkgmgrinfo_pkginfo_get_cert_value()
4409 static int get_cert_info(const char *pkgid)
4412 pkgmgrinfo_certinfo_h handle;
4413 char *auth_cert = NULL;
4414 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4415 if (ret != PMINFO_R_OK)
4417 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4418 if (ret != PMINFO_R_OK) {
4419 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4422 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4423 if (ret != PMINFO_R_OK) {
4424 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4427 printf("Author root certificate: %s\n", auth_root);
4428 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4433 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4436 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4437 * @brief This API gets the package cert information from the handle
4439 * @par This API is for package-manager client application
4440 * @par Sync (or) Async : Synchronous API
4442 * @param[in] handle pointer to the package cert handle.
4443 * @param[in] cert_type certificate type
4444 * @param[out] cert_value pointer to hold certificate value
4445 * @return 0 if success, error code(<0) if fail
4446 * @retval PMINFO_R_OK success
4447 * @retval PMINFO_R_EINVAL invalid argument
4448 * @retval PMINFO_R_ERROR internal error
4449 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4450 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4451 * @see pkgmgrinfo_pkginfo_load_certinfo()
4453 static int get_cert_info(const char *pkgid)
4456 pkgmgrinfo_certinfo_h handle;
4457 char *auth_cert = NULL;
4458 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4459 if (ret != PMINFO_R_OK)
4461 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4462 if (ret != PMINFO_R_OK) {
4463 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4466 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4467 if (ret != PMINFO_R_OK) {
4468 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4471 printf("Author root certificate: %s\n", auth_root);
4472 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4477 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4480 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4481 * @brief This API destroys the package cert information handle freeing up all the resources
4483 * @par This API is for package-manager client application
4484 * @par Sync (or) Async : Synchronous API
4486 * @param[in] handle pointer to the package cert handle.
4487 * @return 0 if success, error code(<0) if fail
4488 * @retval PMINFO_R_OK success
4489 * @retval PMINFO_R_EINVAL invalid argument
4490 * @retval PMINFO_R_ERROR internal error
4491 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4493 * @see pkgmgrinfo_pkginfo_load_certinfo()
4495 static int get_cert_info(const char *pkgid)
4498 pkgmgrinfo_certinfo_h handle;
4499 char *auth_cert = NULL;
4500 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4501 if (ret != PMINFO_R_OK)
4503 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4504 if (ret != PMINFO_R_OK) {
4505 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4508 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4509 if (ret != PMINFO_R_OK) {
4510 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4513 printf("Author root certificate: %s\n", auth_root);
4514 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4519 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4522 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4523 * @brief This API deletes the package cert information from DB
4525 * @par This API is for package-manager client application
4526 * @par Sync (or) Async : Synchronous API
4528 * @param[in] pkgid pointer to the package ID.
4529 * @return 0 if success, error code(<0) if fail
4530 * @retval PMINFO_R_OK success
4531 * @retval PMINFO_R_EINVAL invalid argument
4532 * @retval PMINFO_R_ERROR internal error
4536 static int delete_cert_info(const char *pkgid)
4539 ret = pkgmgrinfo_delete_certinfo(pkgid);
4540 if (ret != PMINFO_R_OK)
4546 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4547 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4549 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4550 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4551 * @brief This API creates the package db information handle to set data in db.
4553 * @par This API is for package-manager client application
4554 * @par Sync (or) Async : Synchronous API
4556 * @param[in] pkgid pointer to the package ID.
4557 * @param[in] uid the addressee user id of the instruction
4558 * @param[out] handle pointer to the package db info handle.
4559 * @return 0 if success, error code(<0) if fail
4560 * @retval PMINFO_R_OK success
4561 * @retval PMINFO_R_EINVAL invalid argument
4562 * @retval PMINFO_R_ERROR internal error
4564 * @post pkgmgrinfo_destroy_pkgdbinfo()
4565 * @see pkgmgrinfo_save_pkgdbinfo()
4566 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4568 static int set_pkg_in_db(const char *pkgid)
4571 pkgmgrinfo_pkgdbinfo_h handle;
4572 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4573 if (ret != PMINFO_R_OK)
4575 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4576 if (ret != PMINFO_R_OK) {
4577 pkgmgrinfo_destroy_pkgdbinfo(handle);
4580 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4581 if (ret != PMINFO_R_OK) {
4582 pkgmgrinfo_destroy_pkgdbinfo(handle);
4585 pkgmgrinfo_destroy_pkgdbinfo(handle);
4590 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4591 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4594 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4595 * @brief This API sets the package type in db handle
4597 * @par This API is for package-manager client application
4598 * @par Sync (or) Async : Synchronous API
4600 * @param[in] handle pointer to the pkgdbinfo handle.
4601 * @param[in] type pointer to the package type.
4602 * @return 0 if success, error code(<0) if fail
4603 * @retval PMINFO_R_OK success
4604 * @retval PMINFO_R_EINVAL invalid argument
4605 * @retval PMINFO_R_ERROR internal error
4606 * @pre pkgmgrinfo_create_pkgdbinfo()
4607 * @post pkgmgrinfo_destroy_pkgdbinfo()
4608 * @see pkgmgrinfo_save_pkgdbinfo()
4609 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4611 static int set_pkg_type_in_db(const char *pkgid)
4614 pkgmgrinfo_pkgdbinfo_h handle;
4615 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4616 if (ret != PMINFO_R_OK)
4618 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4619 if (ret != PMINFO_R_OK) {
4620 pkgmgrinfo_destroy_pkgdbinfo(handle);
4623 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4624 if (ret != PMINFO_R_OK) {
4625 pkgmgrinfo_destroy_pkgdbinfo(handle);
4628 pkgmgrinfo_destroy_pkgdbinfo(handle);
4633 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4636 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4637 * @brief This API sets the package version in db handle
4639 * @par This API is for package-manager client application
4640 * @par Sync (or) Async : Synchronous API
4642 * @param[in] handle pointer to the pkgdbinfo handle.
4643 * @param[in] version pointer to the package version
4644 * @return 0 if success, error code(<0) if fail
4645 * @retval PMINFO_R_OK success
4646 * @retval PMINFO_R_EINVAL invalid argument
4647 * @retval PMINFO_R_ERROR internal error
4648 * @pre pkgmgrinfo_create_pkgdbinfo()
4649 * @post pkgmgrinfo_destroy_pkgdbinfo()
4650 * @see pkgmgrinfo_save_pkgdbinfo()
4651 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4653 static int set_pkg_version_in_db(const char *pkgid)
4656 pkgmgrinfo_pkgdbinfo_h handle;
4657 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4658 if (ret != PMINFO_R_OK)
4660 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4661 if (ret != PMINFO_R_OK) {
4662 pkgmgrinfo_destroy_pkgdbinfo(handle);
4665 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4666 if (ret != PMINFO_R_OK) {
4667 pkgmgrinfo_destroy_pkgdbinfo(handle);
4670 pkgmgrinfo_destroy_pkgdbinfo(handle);
4675 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4678 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4679 * @brief This API sets the package install location in db handle
4681 * @par This API is for package-manager client application
4682 * @par Sync (or) Async : Synchronous API
4684 * @param[in] handle pointer to the pkgdbinfo handle.
4685 * @param[in] location package install location
4686 * @return 0 if success, error code(<0) if fail
4687 * @retval PMINFO_R_OK success
4688 * @retval PMINFO_R_EINVAL invalid argument
4689 * @retval PMINFO_R_ERROR internal error
4690 * @pre pkgmgrinfo_create_pkgdbinfo()
4691 * @post pkgmgrinfo_destroy_pkgdbinfo()
4692 * @see pkgmgrinfo_save_pkgdbinfo()
4693 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4695 static int set_pkg_install_location_in_db(const char *pkgid)
4698 pkgmgrinfo_pkgdbinfo_h handle;
4699 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4700 if (ret != PMINFO_R_OK)
4702 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4703 if (ret != PMINFO_R_OK) {
4704 pkgmgrinfo_destroy_pkgdbinfo(handle);
4707 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4708 if (ret != PMINFO_R_OK) {
4709 pkgmgrinfo_destroy_pkgdbinfo(handle);
4712 pkgmgrinfo_destroy_pkgdbinfo(handle);
4717 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4720 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4721 * @brief This API sets the package size in db handle
4723 * @par This API is for package-manager client application
4724 * @par Sync (or) Async : Synchronous API
4726 * @param[in] handle pointer to the pkgdbinfo handle.
4727 * @param[in] size pointer to the package size
4728 * @return 0 if success, error code(<0) if fail
4729 * @retval PMINFO_R_OK success
4730 * @retval PMINFO_R_EINVAL invalid argument
4731 * @retval PMINFO_R_ERROR internal error
4732 * @pre pkgmgrinfo_create_pkgdbinfo()
4733 * @post pkgmgrinfo_destroy_pkgdbinfo()
4734 * @see pkgmgrinfo_save_pkgdbinfo()
4735 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4737 static int set_pkg_size_in_db(const char *pkgid)
4740 pkgmgrinfo_pkgdbinfo_h handle;
4741 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4742 if (ret != PMINFO_R_OK)
4744 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4745 if (ret != PMINFO_R_OK) {
4746 pkgmgrinfo_destroy_pkgdbinfo(handle);
4749 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4750 if (ret != PMINFO_R_OK) {
4751 pkgmgrinfo_destroy_pkgdbinfo(handle);
4754 pkgmgrinfo_destroy_pkgdbinfo(handle);
4759 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4762 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4763 * @brief This API sets the package label in db handle
4765 * @par This API is for package-manager client application
4766 * @par Sync (or) Async : Synchronous API
4768 * @param[in] handle pointer to the pkgdbinfo handle.
4769 * @param[in] label pointer to the package label
4770 * @param[in] locale pointer to the locale
4771 * @return 0 if success, error code(<0) if fail
4772 * @retval PMINFO_R_OK success
4773 * @retval PMINFO_R_EINVAL invalid argument
4774 * @retval PMINFO_R_ERROR internal error
4775 * @pre pkgmgrinfo_create_pkgdbinfo()
4776 * @post pkgmgrinfo_destroy_pkgdbinfo()
4777 * @see pkgmgrinfo_save_pkgdbinfo()
4778 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4780 static int set_pkg_label_in_db(const char *pkgid)
4783 pkgmgrinfo_pkgdbinfo_h handle;
4784 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4785 if (ret != PMINFO_R_OK)
4787 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4788 if (ret != PMINFO_R_OK) {
4789 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4793 if (ret != PMINFO_R_OK) {
4794 pkgmgrinfo_destroy_pkgdbinfo(handle);
4797 pkgmgrinfo_destroy_pkgdbinfo(handle);
4802 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4805 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4806 * @brief This API sets the package icon in db handle
4808 * @par This API is for package-manager client application
4809 * @par Sync (or) Async : Synchronous API
4811 * @param[in] handle pointer to the pkgdbinfo handle.
4812 * @param[in] icon pointer to the package icon
4813 * @param[in] locale pointer to the locale
4814 * @return 0 if success, error code(<0) if fail
4815 * @retval PMINFO_R_OK success
4816 * @retval PMINFO_R_EINVAL invalid argument
4817 * @retval PMINFO_R_ERROR internal error
4818 * @pre pkgmgrinfo_create_pkgdbinfo()
4819 * @post pkgmgrinfo_destroy_pkgdbinfo()
4820 * @see pkgmgrinfo_save_pkgdbinfo()
4821 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4823 static int set_pkg_icon_in_db(const char *pkgid)
4826 pkgmgrinfo_pkgdbinfo_h handle;
4827 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4828 if (ret != PMINFO_R_OK)
4830 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4831 if (ret != PMINFO_R_OK) {
4832 pkgmgrinfo_destroy_pkgdbinfo(handle);
4835 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4836 if (ret != PMINFO_R_OK) {
4837 pkgmgrinfo_destroy_pkgdbinfo(handle);
4840 pkgmgrinfo_destroy_pkgdbinfo(handle);
4845 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4848 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4849 * @brief This API sets the package description in db handle
4851 * @par This API is for package-manager client application
4852 * @par Sync (or) Async : Synchronous API
4854 * @param[in] handle pointer to the pkgdbinfo handle.
4855 * @param[in] description pointer to the package description
4856 * @param[in] locale pointer to the locale
4857 * @return 0 if success, error code(<0) if fail
4858 * @retval PMINFO_R_OK success
4859 * @retval PMINFO_R_EINVAL invalid argument
4860 * @retval PMINFO_R_ERROR internal error
4861 * @pre pkgmgrinfo_create_pkgdbinfo()
4862 * @post pkgmgrinfo_destroy_pkgdbinfo()
4863 * @see pkgmgrinfo_save_pkgdbinfo()
4864 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4866 static int set_pkg_description_in_db(const char *pkgid)
4869 pkgmgrinfo_pkgdbinfo_h handle;
4870 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4871 if (ret != PMINFO_R_OK)
4873 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4874 if (ret != PMINFO_R_OK) {
4875 pkgmgrinfo_destroy_pkgdbinfo(handle);
4878 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4879 if (ret != PMINFO_R_OK) {
4880 pkgmgrinfo_destroy_pkgdbinfo(handle);
4883 pkgmgrinfo_destroy_pkgdbinfo(handle);
4888 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4891 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4892 const char *author_email, const char *author_href, const char *locale)
4893 * @brief This API sets the package author info in db handle
4895 * @par This API is for package-manager client application
4896 * @par Sync (or) Async : Synchronous API
4898 * @param[in] handle pointer to the pkgdbinfo handle.
4899 * @param[in] author_name pointer to the package author name
4900 * @param[in] author_email pointer to the package author email
4901 * @param[in] author_href pointer to the package author href
4902 * @param[in] locale pointer to the locale
4903 * @return 0 if success, error code(<0) if fail
4904 * @retval PMINFO_R_OK success
4905 * @retval PMINFO_R_EINVAL invalid argument
4906 * @retval PMINFO_R_ERROR internal error
4907 * @pre pkgmgrinfo_create_pkgdbinfo()
4908 * @post pkgmgrinfo_destroy_pkgdbinfo()
4909 * @see pkgmgrinfo_save_pkgdbinfo()
4910 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4912 static int set_pkg_author_in_db(const char *pkgid)
4915 pkgmgrinfo_pkgdbinfo_h handle;
4916 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4917 if (ret != PMINFO_R_OK)
4919 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4920 if (ret != PMINFO_R_OK) {
4921 pkgmgrinfo_destroy_pkgdbinfo(handle);
4924 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4925 if (ret != PMINFO_R_OK) {
4926 pkgmgrinfo_destroy_pkgdbinfo(handle);
4929 pkgmgrinfo_destroy_pkgdbinfo(handle);
4934 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4935 const char *author_email, const char *author_href, const char *locale);
4938 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4939 * @brief This API sets the package 'removable' value in db handle
4941 * @par This API is for package-manager client application
4942 * @par Sync (or) Async : Synchronous API
4944 * @param[in] handle pointer to the pkgdbinfo handle.
4945 * @param[in] removable package removable value
4946 * @return 0 if success, error code(<0) if fail
4947 * @retval PMINFO_R_OK success
4948 * @retval PMINFO_R_EINVAL invalid argument
4949 * @retval PMINFO_R_ERROR internal error
4950 * @pre pkgmgrinfo_create_pkgdbinfo()
4951 * @post pkgmgrinfo_destroy_pkgdbinfo()
4952 * @see pkgmgrinfo_save_pkgdbinfo()
4953 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4955 static int set_pkg_removable_in_db(const char *pkgid)
4958 pkgmgrinfo_pkgdbinfo_h handle;
4959 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4960 if (ret != PMINFO_R_OK)
4962 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4963 if (ret != PMINFO_R_OK) {
4964 pkgmgrinfo_destroy_pkgdbinfo(handle);
4967 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4968 if (ret != PMINFO_R_OK) {
4969 pkgmgrinfo_destroy_pkgdbinfo(handle);
4972 pkgmgrinfo_destroy_pkgdbinfo(handle);
4977 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4980 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4981 * @brief This API sets the package 'preload' value in db handle
4983 * @par This API is for package-manager client application
4984 * @par Sync (or) Async : Synchronous API
4986 * @param[in] handle pointer to the pkgdbinfo handle.
4987 * @param[in] preload package preload value
4988 * @return 0 if success, error code(<0) if fail
4989 * @retval PMINFO_R_OK success
4990 * @retval PMINFO_R_EINVAL invalid argument
4991 * @retval PMINFO_R_ERROR internal error
4992 * @pre pkgmgrinfo_create_pkgdbinfo()
4993 * @post pkgmgrinfo_destroy_pkgdbinfo()
4994 * @see pkgmgrinfo_save_pkgdbinfo()
4995 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4997 static int set_pkg_preload_in_db(const char *pkgid)
5000 pkgmgrinfo_pkgdbinfo_h handle;
5001 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5002 if (ret != PMINFO_R_OK)
5004 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5005 if (ret != PMINFO_R_OK) {
5006 pkgmgrinfo_destroy_pkgdbinfo(handle);
5009 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5010 if (ret != PMINFO_R_OK) {
5011 pkgmgrinfo_destroy_pkgdbinfo(handle);
5014 pkgmgrinfo_destroy_pkgdbinfo(handle);
5019 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5022 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5023 * @brief This API sets the package 'installed_storage' value in db handle
5025 * @par This API is for package-manager client application
5026 * @par Sync (or) Async : Synchronous API
5028 * @param[in] handle pointer to the pkgdbinfo handle.
5029 * @param[in] location installed_storage value
5030 * @return 0 if success, error code(<0) if fail
5031 * @retval PMINFO_R_OK success
5032 * @retval PMINFO_R_EINVAL invalid argument
5033 * @retval PMINFO_R_ERROR internal error
5034 * @pre pkgmgrinfo_create_pkgdbinfo()
5035 * @post pkgmgrinfo_destroy_pkgdbinfo()
5036 * @see pkgmgrinfo_save_pkgdbinfo()
5038 static int set_pkg_installed_storage_in_db(const char *pkgid)
5041 pkgmgrinfo_pkgdbinfo_h handle;
5042 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5043 if (ret != PMINFO_R_OK)
5045 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5046 if (ret != PMINFO_R_OK) {
5047 pkgmgrinfo_destroy_pkgdbinfo(handle);
5050 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5051 if (ret != PMINFO_R_OK) {
5052 pkgmgrinfo_destroy_pkgdbinfo(handle);
5055 pkgmgrinfo_destroy_pkgdbinfo(handle);
5060 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5063 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5064 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5065 * @brief This API saves all the information from the handle to the DB.
5067 * @par This API is for package-manager client application
5068 * @par Sync (or) Async : Synchronous API
5070 * @param[in] handle pointer to the package db info handle.
5071 * @param[in] uid the addressee user id of the instruction
5072 * @return 0 if success, error code(<0) if fail
5073 * @retval PMINFO_R_OK success
5074 * @retval PMINFO_R_EINVAL invalid argument
5075 * @retval PMINFO_R_ERROR internal error
5076 * @pre pkgmgrinfo_create_pkgdbinfo()
5077 * @post pkgmgrinfo_destroy_pkgdbinfo()
5078 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5080 static int set_pkg_in_db(const char *pkgid)
5083 pkgmgrinfo_pkgdbinfo_h handle;
5084 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5085 if (ret != PMINFO_R_OK)
5087 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5088 if (ret != PMINFO_R_OK) {
5089 pkgmgrinfo_destroy_pkgdbinfo(handle);
5092 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5093 if (ret != PMINFO_R_OK) {
5094 pkgmgrinfo_destroy_pkgdbinfo(handle);
5097 pkgmgrinfo_destroy_pkgdbinfo(handle);
5102 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5103 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5105 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5106 * @brief This API destroys the package db information handle freeing up all the resources
5108 * @par This API is for package-manager client application
5109 * @par Sync (or) Async : Synchronous API
5111 * @param[in] handle pointer to the package db info handle.
5112 * @return 0 if success, error code(<0) if fail
5113 * @retval PMINFO_R_OK success
5114 * @retval PMINFO_R_EINVAL invalid argument
5115 * @retval PMINFO_R_ERROR internal error
5116 * @pre pkgmgrinfo_create_pkgdbinfo()
5118 * @see pkgmgrinfo_save_pkgdbinfo()
5119 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5121 static int set_pkg_in_db(const char *pkgid)
5124 pkgmgrinfo_pkgdbinfo_h handle;
5125 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5126 if (ret != PMINFO_R_OK)
5128 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5129 if (ret != PMINFO_R_OK) {
5130 pkgmgrinfo_destroy_pkgdbinfo(handle);
5133 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5134 if (ret != PMINFO_R_OK) {
5135 pkgmgrinfo_destroy_pkgdbinfo(handle);
5138 pkgmgrinfo_destroy_pkgdbinfo(handle);
5143 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5147 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5148 * @brief This API creates the package cert information handle to set data in db.
5150 * @par This API is for package-manager client application
5151 * @par Sync (or) Async : Synchronous API
5153 * @param[out] handle pointer to the package cert handle.
5154 * @return 0 if success, error code(<0) if fail
5155 * @retval PMINFO_R_OK success
5156 * @retval PMINFO_R_EINVAL invalid argument
5157 * @retval PMINFO_R_ERROR internal error
5159 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5160 * @see pkgmgrinfo_set_cert_value()
5161 * @see pkgmgrinfo_save_certinfo()
5163 static int set_cert_in_db(const char *pkgid)
5166 pkgmgrinfo_instcertinfo_h handle;
5167 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5168 if (ret != PMINFO_R_OK)
5170 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5171 if (ret != PMINFO_R_OK) {
5172 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5175 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5176 if (ret != PMINFO_R_OK) {
5177 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5180 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5185 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5188 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5189 * @brief This API sets the package cert information in the handle.
5191 * @par This API is for package-manager client application
5192 * @par Sync (or) Async : Synchronous API
5194 * @param[in] handle pointer to the package cert handle.
5195 * @param[in] cert_type certificate type.
5196 * @param[in] cert_value certificate value.
5197 * @return 0 if success, error code(<0) if fail
5198 * @retval PMINFO_R_OK success
5199 * @retval PMINFO_R_EINVAL invalid argument
5200 * @retval PMINFO_R_ERROR internal error
5201 * @pre pkgmgrinfo_create_certinfo_set_handle()
5202 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5203 * @see pkgmgrinfo_save_certinfo()
5205 static int set_cert_in_db(const char *pkgid)
5208 pkgmgrinfo_instcertinfo_h handle;
5209 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5210 if (ret != PMINFO_R_OK)
5212 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5213 if (ret != PMINFO_R_OK) {
5214 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5217 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5218 if (ret != PMINFO_R_OK) {
5219 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5222 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5227 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5230 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5231 * @brief This API saves the package cert information in the DB.
5233 * @par This API is for package-manager client application
5234 * @par Sync (or) Async : Synchronous API
5236 * @param[in] pkgid pointer to the package ID.
5237 * @param[in] handle pointer to the package cert handle.
5238 * @return 0 if success, error code(<0) if fail
5239 * @retval PMINFO_R_OK success
5240 * @retval PMINFO_R_EINVAL invalid argument
5241 * @retval PMINFO_R_ERROR internal error
5242 * @pre pkgmgrinfo_create_certinfo_set_handle()
5243 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5244 * @see pkgmgrinfo_save_certinfo()
5246 static int set_cert_in_db(const char *pkgid)
5249 pkgmgrinfo_instcertinfo_h handle;
5250 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5251 if (ret != PMINFO_R_OK)
5253 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5254 if (ret != PMINFO_R_OK) {
5255 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5258 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5259 if (ret != PMINFO_R_OK) {
5260 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5263 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5268 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5271 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5272 * @brief This API destroys the package cert information handle freeing up all the resources.
5274 * @par This API is for package-manager client application
5275 * @par Sync (or) Async : Synchronous API
5277 * @param[in] handle pointer to the package cert handle.
5278 * @return 0 if success, error code(<0) if fail
5279 * @retval PMINFO_R_OK success
5280 * @retval PMINFO_R_EINVAL invalid argument
5281 * @retval PMINFO_R_ERROR internal error
5282 * @pre pkgmgrinfo_create_certinfo_set_handle()
5284 * @see pkgmgrinfo_save_certinfo()
5286 static int set_cert_in_db(const char *pkgid)
5289 pkgmgrinfo_instcertinfo_h handle;
5290 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5291 if (ret != PMINFO_R_OK)
5293 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5294 if (ret != PMINFO_R_OK) {
5295 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5298 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5299 if (ret != PMINFO_R_OK) {
5300 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5303 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5308 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5311 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5312 * @brief This API gets the datacontrol info
5314 * @par This API is for package-manager client application
5315 * @par Sync (or) Async : Synchronous API
5317 * @param[in] providerid pointer to the providerid of dataconltrol.
5318 * @param[in] type pointer to the type of dataconltrol.
5319 * @param[out] appid pointer to hold appid, need to free after using
5320 * @param[out] access pointer to hold access, need to free after using
5321 * @return 0 if success, error code(<0) if fail
5322 * @retval PMINFO_R_OK success
5323 * @retval PMINFO_R_EINVAL invalid argument
5324 * @retval PMINFO_R_ERROR internal error
5327 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5330 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5331 * @brief This API gets the application 'guest mode visibility' value from the DB
5333 * @par This API is for package-manager client application
5334 * @par Sync (or) Async : Synchronous API
5336 * @param[in] handle pointer to application info handle
5337 * @param[out] status pointer to hold app guest mode visibility value
5338 * @return 0 if success, error code(<0) if fail
5339 * @retval PMINFO_R_OK success
5340 * @retval PMINFO_R_EINVAL invalid argument
5341 * @retval PMINFO_R_ERROR internal error
5342 * @pre pkgmgrinfo_appinfo_get_appinfo()
5343 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5344 * @see pkgmgrinfo_appinfo_get_appid()
5345 * @see pkgmgrinfo_appinfo_is_multiple()
5347 static int get_app_guestmode_visibility(const char *appid)
5351 pkgmgrinfo_appinfo_h handle;
5352 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5353 if (ret != PMINFO_R_OK)
5355 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5356 if (ret != PMINFO_R_OK) {
5357 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5360 printf("app guest mode visibility: %d\n", status);
5361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5366 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5369 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5370 * @brief This API sets the application 'guest mode visibility' value in the DB
5372 * @par This API is for package-manager client application
5373 * @par Sync (or) Async : Synchronous API
5375 * @param[in] handle pointer to application info handle
5376 * @param[out] status app guest mode visibility value
5377 * @return 0 if success, error code(<0) if fail
5378 * @retval PMINFO_R_OK success
5379 * @retval PMINFO_R_EINVAL invalid argument
5380 * @retval PMINFO_R_ERROR internal error
5381 * @pre pkgmgrinfo_appinfo_get_appinfo()
5382 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5383 * @see pkgmgrinfo_appinfo_get_appid()
5384 * @see pkgmgrinfo_appinfo_is_multiple()
5386 static int set_app_guestmode_visibility(const char *appid, bool value)
5389 pkgmgrinfo_appinfo_h handle;
5390 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5391 if (ret != PMINFO_R_OK)
5393 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5394 if (ret != PMINFO_R_OK) {
5395 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5398 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5403 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5404 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5406 * @pkgmgrinfo client API
5410 * @brief listening status type in pkgmgrinfo.
5412 #define PMINFO_CLIENT_STATUS_ALL 0x00
5413 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5414 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5415 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5416 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5417 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5418 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5421 * @brief type definition.
5423 typedef void pkgmgrinfo_client;
5424 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5425 const char *pkgid, const char *key,
5426 const char *val, const void *pmsg, void *data);
5432 }pkgmgrinfo_client_type;
5435 * @brief This APIs provides pkgmgrinfo client listener
5437 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5438 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5439 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5440 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5441 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5444 * @pkgmgrinfo client API end
5452 #endif /* __PKG_INFO_H__ */