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__
52 #include <sys/types.h>
62 * This is package information library
64 * Package Information Library is used to get package related information.\n
65 * It uses the package manifest information database to get any package related information\n
66 * It also provides API to set information in the package info database\n
72 * @brief Package Information Library Header File
74 * Generated by Sewook Park <sewook7.park@samsung.com>
78 * @brief A type to retrieve uid information from the manifest handle
82 } pkgmgrinfo_uidinfo_t;
85 * @brief A handle to insert certificate information
87 typedef void* pkgmgrinfo_instcertinfo_h;
90 * @brief Certificate Types to be used for setting information
93 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
94 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
95 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
96 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
97 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
98 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
99 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
100 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
101 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
102 }pkgmgrinfo_instcert_type;
105 PMINFO_CERT_COMPARE_MATCH,
106 PMINFO_CERT_COMPARE_MISMATCH,
107 PMINFO_CERT_COMPARE_LHS_NO_CERT,
108 PMINFO_CERT_COMPARE_RHS_NO_CERT,
109 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
110 PMINFO_CERT_COMPARE_ERROR,
111 } pkgmgrinfo_cert_compare_result_type_e;
114 * @brief API return values
117 PMINFO_R_EINVAL = -2, /**< Invalid argument */
118 PMINFO_R_ERROR = -1, /**< General error */
119 PMINFO_R_OK = 0 /**< General success */
123 * @brief Value to be used when filtering based on install location
125 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
128 * @brief Value to be used when filtering based on install location
130 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
133 * @brief Value to be used when filtering based on install location
135 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
138 * @brief Value to be used when filtering based on app-component
140 #define PMINFO_APPINFO_UI_APP "UI_APP"
143 * @brief Value to be used when filtering based on app-component
145 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
148 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
149 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
150 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
151 }pkgmgrinfo_app_hwacceleration;
154 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
155 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
156 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
157 }pkgmgrinfo_app_screenreader;
160 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
161 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
162 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
163 }pkgmgrinfo_app_recentimage;
166 * @brief A handle to get package information
168 typedef void* pkgmgrinfo_pkginfo_h;
171 * @brief A handle to get application information
173 typedef void* pkgmgrinfo_appinfo_h;
176 * @brief A handle to get certificate information
178 typedef void* pkgmgrinfo_certinfo_h;
181 * @brief A handle to insert package information
183 typedef void* pkgmgrinfo_pkgdbinfo_h;
186 * @brief A handle to filter package information
188 typedef void* pkgmgrinfo_pkginfo_filter_h;
191 * @brief A handle to filter application information
193 typedef void* pkgmgrinfo_appinfo_filter_h;
196 * @brief A handle to filter application metadata information
198 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
201 * @brief A handle to get appcontrol information
203 typedef void* pkgmgrinfo_appcontrol_h;
206 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
208 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210 * @param[in] handle the pkginfo handle
211 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
213 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
215 * @see pkgmgrinfo_pkginfo_get_list()
216 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
218 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
222 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
224 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
226 * @param[in] handle the appinfo handle
227 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
229 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
231 * @see pkgmgrinfo_appinfo_get_list()
232 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
233 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
235 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
239 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
241 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
243 * @param[in] category_name the name of the category
244 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
246 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
248 * @see pkgmgrinfo_appinfo_foreach_category()
250 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
254 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
256 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
258 * @param[in] permission_name the name of the permission
259 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
261 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
263 * @see pkgmgrinfo_appinfo_foreach_category()
265 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
269 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
271 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
273 * @param[in] privilege_name the name of the privilege
274 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
276 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
278 * @see pkgmgrinfo_pkginfo_foreach_privilege()
280 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
284 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
286 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
288 * @param[in] metadata_name the name of the metadata
289 * @param[in] metadata_value the value of the metadata
290 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
292 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
294 * @see pkgmgrinfo_appinfo_foreach_metadata()
296 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
297 const char *metadata_value, void *user_data);
300 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
302 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
304 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
305 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
307 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
309 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
311 typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const char *uri, const char *mime,
315 * @brief Install Location Types
318 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
319 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
320 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
321 }pkgmgrinfo_install_location;
324 * @brief Application Component Types
327 PMINFO_ALL_APP = 0, /**< All Application*/
328 PMINFO_UI_APP, /**< UI Application*/
329 PMINFO_SVC_APP, /**< Service Application*/
330 }pkgmgrinfo_app_component;
333 * @brief Application Storage Types
336 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
337 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
338 }pkgmgrinfo_installed_storage;
341 * @brief Certificate Types to be used for getting information
344 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
345 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
346 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
347 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
348 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
349 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
350 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
351 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
352 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
353 }pkgmgrinfo_cert_type;
356 * @brief Install Location Types to be used when setting data in DB
359 INSTALL_INTERNAL = 0, /**< Internal Installation*/
360 INSTALL_EXTERNAL, /**< External Installation*/
364 * @brief permission Types
367 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
368 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
369 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
370 }pkgmgrinfo_permission_type;
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
381 /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
383 /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
385 /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
387 /** String property for filtering based on package info*/
388 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
394 /** Boolean property for filtering based on package info*/
395 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
396 /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
398 /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
400 /** Boolean property for filtering based on package info*/
401 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
403 /** Integer property for filtering based on package info*/
404 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
420 /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
422 /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
424 /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
426 /** String property for filtering based on app info*/
427 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
428 /** String property for filtering based on app info*/
429 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
433 /** Boolean property for filtering based on app info*/
434 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
435 /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
437 /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
439 /** Boolean property for filtering based on app info*/
440 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
441 /** Boolean property for filtering based on app info*/
442 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
444 /** will be updated*/
445 /** string property for filtering based on pkg info*/
446 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
448 /* For multiuser support */
449 const char *getIconPath(uid_t uid);
450 const char *getUserPkgParserDBPath(void);
451 const char *getUserPkgParserDBPathUID(uid_t uid);
452 const char *getUserPkgCertDBPath(void);
453 const char *getUserPkgCertDBPathUID(uid_t uid);
454 const char *getUserDesktopPath(uid_t uid);
455 const char *getUserManifestPath(uid_t uid);
458 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
459 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
460 * @brief This API gets list of installed packages
462 * @par This API is for package-manager client application
463 * @par Sync (or) Async : Synchronous API
464 * @param[in] pkg_list_cb iteration function for list
465 * @param[in] user_data user data to be passed to callback function
466 * @param[in] uid the addressee user id of the instruction
467 * @return 0 if success, error code(<0) if fail
468 * @retval PMINFO_R_OK success
469 * @retval PMINFO_R_EINVAL invalid argument
470 * @retval PMINFO_R_ERROR internal error
474 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
478 pkgid1 = (char *)user_data;
479 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
480 if (strcmp(pkgid1, pkgid2) == 0) {
487 static int list_pkgs()
490 char *name = "helloworld";
491 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
492 if (ret != PMINFO_R_OK) {
499 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
500 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
502 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
503 * @brief This API creates the package information handle from db
505 * @par This API is for package-manager client application
506 * @par Sync (or) Async : Synchronous API
508 * @param[in] pkgid pointer to package ID
509 * @param[in] uid the addressee user id of the instruction
510 * @param[out] handle pointer to the package info handle.
511 * @return 0 if success, error code(<0) if fail
512 * @retval PMINFO_R_OK success
513 * @retval PMINFO_R_EINVAL invalid argument
514 * @retval PMINFO_R_ERROR internal error
516 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
517 * @see pkgmgrinfo_pkginfo_get_pkgid()
518 * @see pkgmgrinfo_pkginfo_is_removable()
520 static int get_pkg_type(const char *pkgid)
524 pkgmgrinfo_pkginfo_h handle;
525 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
526 if (ret != PMINFO_R_OK)
528 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
529 if (ret != PMINFO_R_OK) {
530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
533 printf("pkgtype: %s\n", type);
534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
539 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
540 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
543 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
544 * @brief This API gets the package name from the package ID
546 * @par This API is for package-manager client application
547 * @par Sync (or) Async : Synchronous API
549 * @param[in] handle pointer to package info handle
550 * @param[out] pkg_name pointer to hold package name
551 * @return 0 if success, error code(<0) if fail
552 * @retval PMINFO_R_OK success
553 * @retval PMINFO_R_EINVAL invalid argument
554 * @retval PMINFO_R_ERROR internal error
555 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
556 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
557 * @see pkgmgrinfo_pkginfo_get_type()
558 * @see pkgmgrinfo_pkginfo_is_removable()
560 static int get_pkg_name(const char *pkgid)
563 char *pkgname = NULL;
564 pkgmgrinfo_pkginfo_h handle;
565 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
566 if (ret != PMINFO_R_OK)
568 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
569 if (ret != PMINFO_R_OK) {
570 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
573 printf("pkgname: %s\n", pkgname);
574 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
579 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
582 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
583 * @brief This API gets the package id from the package ID
585 * @par This API is for package-manager client application
586 * @par Sync (or) Async : Synchronous API
588 * @param[in] handle pointer to package info handle
589 * @param[out] pkgid pointer to hold package id
590 * @return 0 if success, error code(<0) if fail
591 * @retval PMINFO_R_OK success
592 * @retval PMINFO_R_EINVAL invalid argument
593 * @retval PMINFO_R_ERROR internal error
594 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
595 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
596 * @see pkgmgrinfo_pkginfo_get_type()
597 * @see pkgmgrinfo_pkginfo_is_removable()
599 static int get_pkgid(const char *pkgid)
603 pkgmgrinfo_pkginfo_h handle;
604 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
605 if (ret != PMINFO_R_OK)
607 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
608 if (ret != PMINFO_R_OK) {
609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
612 printf("pkg id: %s\n", pkg_id);
613 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
618 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
621 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
622 * @brief This API gets the package type from the package ID
624 * @par This API is for package-manager client application
625 * @par Sync (or) Async : Synchronous API
627 * @param[in] handle pointer to package info handle
628 * @param[out] type pointer to hold package type
629 * @return 0 if success, error code(<0) if fail
630 * @retval PMINFO_R_OK success
631 * @retval PMINFO_R_EINVAL invalid argument
632 * @retval PMINFO_R_ERROR internal error
633 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
634 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
635 * @see pkgmgrinfo_pkginfo_get_pkgid()
636 * @see pkgmgrinfo_pkginfo_is_removable()
638 static int get_pkg_type(const char *pkgid)
642 pkgmgrinfo_pkginfo_h handle;
643 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
644 if (ret != PMINFO_R_OK)
646 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
647 if (ret != PMINFO_R_OK) {
648 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
651 printf("pkgtype: %s\n", type);
652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
657 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
660 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
661 * @brief This API gets the package version from the package ID
663 * @par This API is for package-manager client application
664 * @par Sync (or) Async : Synchronous API
666 * @param[in] handle pointer to package info handle
667 * @param[out] version pointer to hold package version
668 * @return 0 if success, error code(<0) if fail
669 * @retval PMINFO_R_OK success
670 * @retval PMINFO_R_EINVAL invalid argument
671 * @retval PMINFO_R_ERROR internal error
672 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
673 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
674 * @see pkgmgrinfo_pkginfo_get_pkgid()
675 * @see pkgmgrinfo_pkginfo_is_removable()
677 static int get_pkg_version(const char *pkgid)
680 char *version = NULL;
681 pkgmgrinfo_pkginfo_h handle;
682 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
683 if (ret != PMINFO_R_OK)
685 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
686 if (ret != PMINFO_R_OK) {
687 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
690 printf("pkg version: %s\n", version);
691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
696 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
699 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
700 * @brief This API gets the package install location from the package ID
702 * @par This API is for package-manager client application
703 * @par Sync (or) Async : Synchronous API
705 * @param[in] handle pointer to package info handle
706 * @param[out] location pointer to hold package install location
707 * @return 0 if success, error code(<0) if fail
708 * @retval PMINFO_R_OK success
709 * @retval PMINFO_R_EINVAL invalid argument
710 * @retval PMINFO_R_ERROR internal error
711 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
712 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
713 * @see pkgmgrinfo_pkginfo_get_pkgid()
714 * @see pkgmgrinfo_pkginfo_is_removable()
716 static int get_pkg_install_location(const char *pkgid)
719 pkgmgrinfo_install_location location;
720 pkgmgrinfo_pkginfo_h handle;
721 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
722 if (ret != PMINFO_R_OK)
724 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
725 if (ret != PMINFO_R_OK) {
726 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
729 printf("pkg install location: %d\n", location);
730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
735 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
738 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
739 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
740 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
741 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
743 * @par This API is for package-manager client application
744 * @par Sync (or) Async : Synchronous API
746 * @param[in] handle pointer to package info handle
747 * @param[out] size pointer to hold package size
748 * @return 0 if success, error code(<0) if fail
749 * @retval PMINFO_R_OK success
750 * @retval PMINFO_R_EINVAL invalid argument
751 * @retval PMINFO_R_ERROR internal error
752 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
753 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
754 * @see pkgmgrinfo_pkginfo_get_pkgid()
755 * @see pkgmgrinfo_pkginfo_is_removable()
757 static int get_pkg_size(const char *pkgid)
761 pkgmgrinfo_pkginfo_h handle;
762 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
763 if (ret != PMINFO_R_OK)
765 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
766 if (ret != PMINFO_R_OK) {
767 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
770 printf("pkgsize: %d\n", size);
771 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
776 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
779 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
780 * @brief This API gets the installed package total size on the target.
782 * @par This API is for package-manager client application
783 * @par Sync (or) Async : Synchronous API
785 * @param[in] handle pointer to package info handle
786 * @param[out] size pointer to hold package total size
787 * @return 0 if success, error code(<0) if fail
788 * @retval PMINFO_R_OK success
789 * @retval PMINFO_R_EINVAL invalid argument
790 * @retval PMINFO_R_ERROR internal error
792 static int get_pkg_total_size(const char *pkgid)
796 pkgmgrinfo_pkginfo_h handle;
797 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
798 if (ret != PMINFO_R_OK)
800 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
801 if (ret != PMINFO_R_OK) {
802 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
805 printf("pkg total size: %d\n", size);
806 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
811 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
814 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
815 * @brief This API gets the installed package data size on the target.
817 * @par This API is for package-manager client application
818 * @par Sync (or) Async : Synchronous API
820 * @param[in] handle pointer to package info handle
821 * @param[out] size pointer to hold package data size
822 * @return 0 if success, error code(<0) if fail
823 * @retval PMINFO_R_OK success
824 * @retval PMINFO_R_EINVAL invalid argument
825 * @retval PMINFO_R_ERROR internal error
827 static int get_pkg_data_size(const char *pkgid)
831 pkgmgrinfo_pkginfo_h handle;
832 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
833 if (ret != PMINFO_R_OK)
835 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
836 if (ret != PMINFO_R_OK) {
837 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
840 printf("pkg data size: %d\n", size);
841 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
846 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
849 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
850 * @brief This API gets the package icon from the package ID
852 * @par This API is for package-manager client application
853 * @par Sync (or) Async : Synchronous API
855 * @param[in] handle pointer to package info handle
856 * @param[out] icon pointer to hold package icon
857 * @return 0 if success, error code(<0) if fail
858 * @retval PMINFO_R_OK success
859 * @retval PMINFO_R_EINVAL invalid argument
860 * @retval PMINFO_R_ERROR internal error
861 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
862 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
863 * @see pkgmgrinfo_pkginfo_get_pkgid()
864 * @see pkgmgrinfo_pkginfo_is_removable()
866 static int get_pkg_icon(const char *pkgid)
870 pkgmgrinfo_pkginfo_h handle;
871 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
872 if (ret != PMINFO_R_OK)
874 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
875 if (ret != PMINFO_R_OK) {
876 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
879 printf("pkg icon: %s\n", icon);
880 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
885 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
888 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
889 * @brief This API gets the package label from the package ID
891 * @par This API is for package-manager client application
892 * @par Sync (or) Async : Synchronous API
894 * @param[in] handle pointer to package info handle
895 * @param[out] label pointer to hold package label
896 * @return 0 if success, error code(<0) if fail
897 * @retval PMINFO_R_OK success
898 * @retval PMINFO_R_EINVAL invalid argument
899 * @retval PMINFO_R_ERROR internal error
900 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
901 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
902 * @see pkgmgrinfo_pkginfo_get_pkgid()
903 * @see pkgmgrinfo_pkginfo_is_removable()
905 static int get_pkg_label(const char *pkgid)
909 pkgmgrinfo_pkginfo_h handle;
910 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
911 if (ret != PMINFO_R_OK)
913 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
914 if (ret != PMINFO_R_OK) {
915 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
918 printf("pkg label: %s\n", label);
919 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
924 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
927 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
928 * @brief This API gets the package description from the package ID
930 * @par This API is for package-manager client application
931 * @par Sync (or) Async : Synchronous API
933 * @param[in] handle pointer to package info handle
934 * @param[out] description pointer to hold package description
935 * @return 0 if success, error code(<0) if fail
936 * @retval PMINFO_R_OK success
937 * @retval PMINFO_R_EINVAL invalid argument
938 * @retval PMINFO_R_ERROR internal error
939 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
940 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
941 * @see pkgmgrinfo_pkginfo_get_pkgid()
942 * @see pkgmgrinfo_pkginfo_is_removable()
944 static int get_pkg_description(const char *pkgid)
947 char *description = NULL;
948 pkgmgrinfo_pkginfo_h handle;
949 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
950 if (ret != PMINFO_R_OK)
952 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
953 if (ret != PMINFO_R_OK) {
954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
957 printf("pkg description: %s\n", description);
958 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
963 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
966 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
967 * @brief This API gets the package's author name from the package ID
969 * @par This API is for package-manager client application
970 * @par Sync (or) Async : Synchronous API
972 * @param[in] handle pointer to package info handle
973 * @param[out] author_name pointer to hold package author name
974 * @return 0 if success, error code(<0) if fail
975 * @retval PMINFO_R_OK success
976 * @retval PMINFO_R_EINVAL invalid argument
977 * @retval PMINFO_R_ERROR internal error
978 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
979 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
980 * @see pkgmgrinfo_pkginfo_get_pkgid()
981 * @see pkgmgrinfo_pkginfo_is_removable()
983 static int get_pkg_author_name(const char *pkgid)
986 char *author_name = NULL;
987 pkgmgrinfo_pkginfo_h handle;
988 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
989 if (ret != PMINFO_R_OK)
991 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
992 if (ret != PMINFO_R_OK) {
993 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
996 printf("pkg author name: %s\n", author_name);
997 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1002 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
1005 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
1006 * @brief This API gets the package's author email from the package ID
1008 * @par This API is for package-manager client application
1009 * @par Sync (or) Async : Synchronous API
1011 * @param[in] handle pointer to package info handle
1012 * @param[out] author_email pointer to hold package author email
1013 * @return 0 if success, error code(<0) if fail
1014 * @retval PMINFO_R_OK success
1015 * @retval PMINFO_R_EINVAL invalid argument
1016 * @retval PMINFO_R_ERROR internal error
1017 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1018 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1019 * @see pkgmgrinfo_pkginfo_get_pkgid()
1020 * @see pkgmgrinfo_pkginfo_is_removable()
1022 static int get_pkg_author_email(const char *pkgid)
1025 char *author_email = NULL;
1026 pkgmgrinfo_pkginfo_h handle;
1027 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1028 if (ret != PMINFO_R_OK)
1030 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1031 if (ret != PMINFO_R_OK) {
1032 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1035 printf("pkg author email: %s\n", author_email);
1036 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1041 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1044 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1045 * @brief This API gets the package's author href from the package ID
1047 * @par This API is for package-manager client application
1048 * @par Sync (or) Async : Synchronous API
1050 * @param[in] handle pointer to package info handle
1051 * @param[out] author_href pointer to hold package author href
1052 * @return 0 if success, error code(<0) if fail
1053 * @retval PMINFO_R_OK success
1054 * @retval PMINFO_R_EINVAL invalid argument
1055 * @retval PMINFO_R_ERROR internal error
1056 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1057 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1058 * @see pkgmgrinfo_pkginfo_get_pkgid()
1059 * @see pkgmgrinfo_pkginfo_is_removable()
1061 static int get_pkg_author_href(const char *pkgid)
1064 char *author_href = NULL;
1065 pkgmgrinfo_pkginfo_h handle;
1066 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1067 if (ret != PMINFO_R_OK)
1069 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1070 if (ret != PMINFO_R_OK) {
1071 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1074 printf("pkg author href: %s\n", author_href);
1075 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1080 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1083 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1084 * @brief This API gets the package installed storagae value from the package ID
1086 * @par This API is for package-manager client application
1087 * @par Sync (or) Async : Synchronous API
1089 * @param[in] handle pointer to package info handle
1090 * @param[out] storage pointer to hold package installed storage
1091 * @return 0 if success, error code(<0) if fail
1092 * @retval PMINFO_R_OK success
1093 * @retval PMINFO_R_EINVAL invalid argument
1094 * @retval PMINFO_R_ERROR internal error
1095 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1096 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1097 * @see pkgmgrinfo_pkginfo_get_pkgid()
1098 * @see pkgmgrinfo_pkginfo_is_removable()
1100 static int get_pkg_installed_storage(const char *pkgid)
1103 pkgmgrinfo_installed_storage storage;
1104 pkgmgrinfo_pkginfo_h handle;
1105 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1106 if (ret != PMINFO_R_OK)
1108 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1109 if (ret != PMINFO_R_OK) {
1110 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1113 printf("pkg installed storage: %d\n", storage);
1114 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1119 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1122 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1123 * @brief This API gets the installed time of package from the package ID
1125 * @par This API is for package-manager client application
1126 * @par Sync (or) Async : Synchronous API
1128 * @param[in] handle pointer to package info handle
1129 * @param[out] installed_time pointer to hold installed time of package
1130 * @return 0 if success, error code(<0) if fail
1131 * @retval PMINFO_R_OK success
1132 * @retval PMINFO_R_EINVAL invalid argument
1133 * @retval PMINFO_R_ERROR internal error
1134 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1135 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1136 * @see pkgmgrinfo_pkginfo_get_pkgid()
1137 * @see pkgmgrinfo_pkginfo_is_removable()
1139 static int get_pkg_installed_time(const char *pkgid)
1142 int installed_time = 0;
1143 pkgmgrinfo_pkginfo_h handle;
1144 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1145 if (ret != PMINFO_R_OK)
1147 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1148 if (ret != PMINFO_R_OK) {
1149 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1152 printf("installed_time: %d\n", installed_time);
1153 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1158 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1161 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1162 * @brief This API gets the launch mode of package from the package ID
1164 * @par This API is for package-manager client application
1165 * @par Sync (or) Async : Synchronous API
1167 * @param[in] handle pointer to package info handle
1168 * @param[out] mode pointer to hold launch mode of package
1169 * @return 0 if success, error code(<0) if fail
1170 * @retval PMINFO_R_OK success
1171 * @retval PMINFO_R_EINVAL invalid argument
1172 * @retval PMINFO_R_ERROR internal error
1173 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1174 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1175 * @see pkgmgrinfo_pkginfo_get_pkgid()
1176 * @see pkgmgrinfo_pkginfo_is_removable()
1178 static int get_pkg_launch_mode(const char *pkgid)
1181 char *launch_mode = NULL;
1182 pkgmgrinfo_pkginfo_h handle;
1183 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1184 if (ret != PMINFO_R_OK)
1186 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1187 if (ret != PMINFO_R_OK) {
1188 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1191 printf("launch mode: %s\n", mode);
1192 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1197 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1200 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1201 * @brief This API gets the store client id of package from the package ID
1203 * @par This API is for package-manager client application
1204 * @par Sync (or) Async : Synchronous API
1206 * @param[in] handle pointer to package info handle
1207 * @param[out] storeclientid pointer to hold store client id of package
1208 * @return 0 if success, error code(<0) if fail
1209 * @retval PMINFO_R_OK success
1210 * @retval PMINFO_R_EINVAL invalid argument
1211 * @retval PMINFO_R_ERROR internal error
1212 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1213 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1214 * @see pkgmgrinfo_pkginfo_get_pkgid()
1215 * @see pkgmgrinfo_pkginfo_is_removable()
1217 static int get_pkg_storeclientid(const char *pkgid)
1220 char *storeclientid = 0;
1221 pkgmgrinfo_pkginfo_h handle;
1222 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1223 if (ret != PMINFO_R_OK)
1225 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1226 if (ret != PMINFO_R_OK) {
1227 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1230 printf(store client id: %s\n", storeclientid);
1231 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1236 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1239 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1240 * @brief This API gets the main app id of package from the package ID
1242 * @par This API is for package-manager client application
1243 * @par Sync (or) Async : Synchronous API
1245 * @param[in] handle pointer to package info handle
1246 * @param[out] mainappid pointer to hold main app id of package
1247 * @return 0 if success, error code(<0) if fail
1248 * @retval PMINFO_R_OK success
1249 * @retval PMINFO_R_EINVAL invalid argument
1250 * @retval PMINFO_R_ERROR internal error
1251 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1252 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1253 * @see pkgmgrinfo_pkginfo_get_pkgid()
1254 * @see pkgmgrinfo_pkginfo_is_removable()
1256 static int get_pkg_mainappid(const char *pkgid)
1259 char *mainappid = 0;
1260 pkgmgrinfo_pkginfo_h handle;
1261 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1262 if (ret != PMINFO_R_OK)
1264 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1265 if (ret != PMINFO_R_OK) {
1266 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1269 printf(main app id: %s\n", mainappid);
1270 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1275 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1278 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1279 * @brief This API gets the url of package from the package ID
1281 * @par This API is for package-manager client application
1282 * @par Sync (or) Async : Synchronous API
1284 * @param[in] handle pointer to package info handle
1285 * @param[out] url pointer to hold url of package
1286 * @return 0 if success, error code(<0) if fail
1287 * @retval PMINFO_R_OK success
1288 * @retval PMINFO_R_EINVAL invalid argument
1289 * @retval PMINFO_R_ERROR internal error
1290 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1291 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1292 * @see pkgmgrinfo_pkginfo_get_pkgid()
1293 * @see pkgmgrinfo_pkginfo_is_removable()
1295 static int get_pkg_url(const char *pkgid)
1299 pkgmgrinfo_pkginfo_h handle;
1300 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1301 if (ret != PMINFO_R_OK)
1303 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1304 if (ret != PMINFO_R_OK) {
1305 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1308 printf("url : %s\n", url);
1309 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1314 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1318 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1319 * @brief This API gets the root path of package
1321 * @par Sync (or) Async : Synchronous API
1323 * @param[in] handle pointer to package info handle
1324 * @param[out] path pointer to hold root path of package
1325 * @return 0 if success, error code(<0) if fail
1326 * @retval PMINFO_R_OK success
1327 * @retval PMINFO_R_EINVAL invalid argument
1328 * @retval PMINFO_R_ERROR internal error
1330 static int get_root_path(const char *pkgid)
1334 pkgmgrinfo_pkginfo_h handle;
1335 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1336 if (ret != PMINFO_R_OK)
1339 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1340 if (ret != PMINFO_R_OK) {
1341 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1344 printf("path : %s\n", path);
1345 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1351 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1355 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1356 * @brief This API gets the csc path of package
1358 * @par Sync (or) Async : Synchronous API
1360 * @param[in] handle pointer to package info handle
1361 * @param[out] path pointer to hold csc path of package
1362 * @return 0 if success, error code(<0) if fail
1363 * @retval PMINFO_R_OK success
1364 * @retval PMINFO_R_EINVAL invalid argument
1365 * @retval PMINFO_R_ERROR internal error
1367 static int get_csc_path(const char *pkgid)
1371 pkgmgrinfo_pkginfo_h handle;
1372 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1373 if (ret != PMINFO_R_OK)
1376 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1377 if (ret != PMINFO_R_OK) {
1378 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1381 printf("path : %s\n", path);
1382 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1388 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1391 * @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)
1392 * @brief This API compare the cert information from given package id
1394 * @par This API is for package-manager client application
1395 * @par Sync (or) Async : Synchronous API
1397 * @param[in] lhs_package_id pointer to first package ID
1398 * @param[in] rhs_package_id pointer to second package ID
1399 * @param[out] compare_result pointer to the compare result.
1400 * @return 0 if success, error code(<0) if fail
1401 * @retval PMINFO_R_OK success
1402 * @retval PMINFO_R_EINVAL invalid argument
1403 * @retval PMINFO_R_ERROR internal error
1405 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1406 * @see pkgmgrinfo_pkginfo_get_pkgid()
1407 * @see pkgmgrinfo_pkginfo_is_removable()
1409 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1412 pkgmgrinfo_cert_compare_result_type_e result;
1414 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1415 if (ret != PMINFO_R_OK) {
1418 printf("result: %d\n", result);
1423 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);
1424 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);
1426 * @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)
1427 * @brief This API compare the cert information from given app id
1429 * @par This API is for package-manager client application
1430 * @par Sync (or) Async : Synchronous API
1432 * @param[in] lhs_app_id pointer to first app ID
1433 * @param[in] rhs_app_id pointer to second app ID
1434 * @param[out] compare_result pointer to the compare result.
1435 * @return 0 if success, error code(<0) if fail
1436 * @retval PMINFO_R_OK success
1437 * @retval PMINFO_R_EINVAL invalid argument
1438 * @retval PMINFO_R_ERROR internal error
1440 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1441 * @see pkgmgrinfo_pkginfo_get_pkgid()
1442 * @see pkgmgrinfo_pkginfo_is_removable()
1444 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1447 pkgmgrinfo_cert_compare_result_type_e result;
1449 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1450 if (ret != PMINFO_R_OK) {
1453 printf("result: %d\n", result);
1458 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);
1459 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);
1461 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1462 * @brief This API gets the package 'removable' value from the package ID
1464 * @par This API is for package-manager client application
1465 * @par Sync (or) Async : Synchronous API
1467 * @param[in] handle pointer to package info handle
1468 * @param[out] removable pointer to hold package removable value
1469 * @return 0 if success, error code(<0) if fail
1470 * @retval PMINFO_R_OK success
1471 * @retval PMINFO_R_EINVAL invalid argument
1472 * @retval PMINFO_R_ERROR internal error
1473 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1474 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1475 * @see pkgmgrinfo_pkginfo_get_pkgid()
1476 * @see pkgmgrinfo_pkginfo_is_readonly()
1478 static int get_pkg_removable(const char *pkgid)
1482 pkgmgrinfo_pkginfo_h handle;
1483 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1484 if (ret != PMINFO_R_OK)
1486 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1487 if (ret != PMINFO_R_OK) {
1488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 printf("pkg removable: %d\n", removable);
1492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1497 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1500 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1501 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1503 * @par This API is for package-manager client application
1504 * @par Sync (or) Async : Synchronous API
1506 * @param[in] handle pointer to package info handle
1507 * @param[out] movable pointer to hold package movable state
1508 * @return 0 if success, error code(<0) if fail
1509 * @retval PMINFO_R_OK success
1510 * @retval PMINFO_R_EINVAL invalid argument
1511 * @retval PMINFO_R_ERROR internal error
1512 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1513 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1514 * @see pkgmgrinfo_pkginfo_get_pkgid()
1516 static int get_pkg_movable(const char *pkgid)
1520 pkgmgrinfo_pkginfo_h handle;
1521 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1522 if (ret != PMINFO_R_OK)
1524 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1525 if (ret != PMINFO_R_OK) {
1526 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1529 printf("pkg movable: %d\n", movable);
1530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1535 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1538 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1539 * @brief This API gets the package 'preload' value from the package ID
1541 * @par This API is for package-manager client application
1542 * @par Sync (or) Async : Synchronous API
1544 * @param[in] handle pointer to package info handle
1545 * @param[out] preload pointer to hold package preload value
1546 * @return 0 if success, error code(<0) if fail
1547 * @retval PMINFO_R_OK success
1548 * @retval PMINFO_R_EINVAL invalid argument
1549 * @retval PMINFO_R_ERROR internal error
1550 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1551 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1552 * @see pkgmgrinfo_pkginfo_get_pkgid()
1553 * @see pkgmgrinfo_pkginfo_is_readonly()
1555 static int get_pkg_preload(const char *pkgid)
1559 pkgmgrinfo_pkginfo_h handle;
1560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1561 if (ret != PMINFO_R_OK)
1563 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1564 if (ret != PMINFO_R_OK) {
1565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1568 printf("pkg preload: %d\n", preload);
1569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1574 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1577 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1578 * @brief This API gets the value for given handle is system or not
1580 * @par This API is for package-manager client application
1581 * @par Sync (or) Async : Synchronous API
1583 * @param[in] handle pointer to package info handle
1584 * @param[out] system pointer to hold system is or not
1585 * @return 0 if success, error code(<0) if fail
1586 * @retval PMINFO_R_OK success
1587 * @retval PMINFO_R_EINVAL invalid argument
1588 * @retval PMINFO_R_ERROR internal error
1589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1591 * @see pkgmgrinfo_pkginfo_get_pkgid()
1592 * @see pkgmgrinfo_pkginfo_is_readonly()
1594 static int get_pkg_system(const char *pkgid)
1597 bool system = false;
1598 pkgmgrinfo_pkginfo_h handle = NULL;
1599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1600 if (ret != PMINFO_R_OK)
1602 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1603 if (ret != PMINFO_R_OK) {
1604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1607 printf("pkg system: %d\n", system);
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1616 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1617 * @brief This API gets the package 'readonly' value from the package ID
1619 * @par This API is for package-manager client application
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to package info handle
1623 * @param[out] readonly pointer to hold package readonly value
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1628 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1629 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1630 * @see pkgmgrinfo_pkginfo_get_pkgid()
1631 * @see pkgmgrinfo_pkginfo_is_removable()
1633 static int get_pkg_readonly(const char *pkgid)
1637 pkgmgrinfo_pkginfo_h handle;
1638 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1639 if (ret != PMINFO_R_OK)
1641 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1642 if (ret != PMINFO_R_OK) {
1643 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1646 printf("pkg readonly: %d\n", readonly);
1647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1652 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1656 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1657 * @brief This API gets the package 'upate' value from the package ID
1659 * @par This API is for package-manager client application
1660 * @par Sync (or) Async : Synchronous API
1662 * @param[in] handle pointer to package info handle
1663 * @param[out] update pointer to hold package update value
1664 * @return 0 if success, error code(<0) if fail
1665 * @retval PMINFO_R_OK success
1666 * @retval PMINFO_R_EINVAL invalid argument
1667 * @retval PMINFO_R_ERROR internal error
1668 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1669 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1670 * @see pkgmgrinfo_pkginfo_get_pkgid()
1672 static int get_pkg_update(const char *pkgid)
1676 pkgmgrinfo_pkginfo_h handle;
1677 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1678 if (ret != PMINFO_R_OK)
1680 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1681 if (ret != PMINFO_R_OK) {
1682 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1685 printf("pkg update: %d\n", update);
1686 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1691 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1695 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1696 * @brief This API gets the package 'uid' value from the view table of user database
1698 * @par This API is for package-manager client application
1699 * @par Sync (or) Async : Synchronous API
1701 * @param[in] uid uid of the user to determine the database
1702 * @param[in] pkgid id of the current package
1703 * @return 1 if it a global package, 0 else
1706 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1710 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1711 * @brief This API gets the package 'accessible' value from the package ID
1713 * @par This API is for package-manager client application
1714 * @par Sync (or) Async : Synchronous API
1716 * @param[in] handle pointer to package info handle
1717 * @param[out] accessible pointer to hold package accessible value
1718 * @return 0 if success, error code(<0) if fail
1719 * @retval PMINFO_R_OK success
1720 * @retval PMINFO_R_EINVAL invalid argument
1721 * @retval PMINFO_R_ERROR internal error
1722 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1723 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1724 * @see pkgmgrinfo_pkginfo_get_pkgid()
1725 * @see pkgmgrinfo_pkginfo_is_readonly()
1727 static int get_pkg_accessible(const char *pkgid)
1731 pkgmgrinfo_pkginfo_h handle;
1732 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1733 if (ret != PMINFO_R_OK)
1735 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1736 if (ret != PMINFO_R_OK) {
1737 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1740 printf("pkg accessible: %d\n", accessible);
1741 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1746 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1749 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1750 * @brief This API destroys the package information 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 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_get_pkginfo()
1762 * @see pkgmgrinfo_pkginfo_get_pkgid()
1763 * @see pkgmgrinfo_pkginfo_is_removable()
1765 static int get_pkg_type(const char *pkgid)
1769 pkgmgrinfo_pkginfo_h handle;
1770 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1771 if (ret != PMINFO_R_OK)
1773 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1774 if (ret != PMINFO_R_OK) {
1775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1778 printf("pkgtype: %s\n", type);
1779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1784 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1787 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1788 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1789 The query will search the entire package information collected from the manifest file of all the installed packages
1791 * @par This API is for package-manager client application
1792 * @par Sync (or) Async : Synchronous API
1794 * @param[out] handle pointer to the package info filter handle.
1795 * @return 0 if success, error code(<0) if fail
1796 * @retval PMINFO_R_OK success
1797 * @retval PMINFO_R_EINVAL invalid argument
1798 * @retval PMINFO_R_ERROR internal error
1800 * @post pkgmgrinfo_pkginfo_filter_destroy()
1801 * @see pkgmgrinfo_pkginfo_filter_count()
1802 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1804 static int get_rpm_pkg_count()
1808 pkgmgrinfo_pkginfo_filter_h handle;
1809 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1810 if (ret != PMINFO_R_OK)
1812 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1813 if (ret != PMINFO_R_OK) {
1814 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1818 if (ret != PMINFO_R_OK) {
1819 pkgmgrinfo_pkginfo_filter_destroy(handle);
1822 printf("No of rpm pkgs: %d\n", count);
1823 pkgmgrinfo_pkginfo_filter_destroy(handle);
1828 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1831 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1832 * @brief This API destroys the package information filter handle freeing up all the resources
1834 * @par This API is for package-manager client application
1835 * @par Sync (or) Async : Synchronous API
1837 * @param[in] handle pointer to the package info filter handle.
1838 * @return 0 if success, error code(<0) if fail
1839 * @retval PMINFO_R_OK success
1840 * @retval PMINFO_R_EINVAL invalid argument
1841 * @retval PMINFO_R_ERROR internal error
1842 * @pre pkgmgrinfo_pkginfo_filter_create()
1844 * @see pkgmgrinfo_pkginfo_filter_count()
1845 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1847 static int get_rpm_pkg_count()
1851 pkgmgrinfo_pkginfo_filter_h handle;
1852 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1853 if (ret != PMINFO_R_OK)
1855 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1856 if (ret != PMINFO_R_OK) {
1857 pkgmgrinfo_pkginfo_filter_destroy(handle);
1860 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1861 if (ret != PMINFO_R_OK) {
1862 pkgmgrinfo_pkginfo_filter_destroy(handle);
1865 printf("No of rpm pkgs: %d\n", count);
1866 pkgmgrinfo_pkginfo_filter_destroy(handle);
1871 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1874 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1875 * @brief This API adds a boolean filter property to the filter handle
1877 * @par This API is for package-manager client application
1878 * @par Sync (or) Async : Synchronous API
1880 * @param[in] handle pointer to the package info filter handle.
1881 * @param[in] property boolean property name.
1882 * @param[in] value value corresponding to the property.
1883 * @return 0 if success, error code(<0) if fail
1884 * @retval PMINFO_R_OK success
1885 * @retval PMINFO_R_EINVAL invalid argument
1886 * @retval PMINFO_R_ERROR internal error
1887 * @pre pkgmgrinfo_pkginfo_filter_create()
1888 * @post pkgmgrinfo_pkginfo_filter_destroy()
1889 * @see pkgmgrinfo_pkginfo_filter_count()
1890 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1892 static int get_preload_pkg_count()
1896 pkgmgrinfo_pkginfo_filter_h handle;
1897 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1898 if (ret != PMINFO_R_OK)
1900 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1901 if (ret != PMINFO_R_OK) {
1902 pkgmgrinfo_pkginfo_filter_destroy(handle);
1905 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1906 if (ret != PMINFO_R_OK) {
1907 pkgmgrinfo_pkginfo_filter_destroy(handle);
1910 printf("No of preload pkgs: %d\n", count);
1911 pkgmgrinfo_pkginfo_filter_destroy(handle);
1916 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1917 const char *property, const bool value);
1920 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1921 * @brief This API adds an integer filter property to the filter handle
1923 * @par This API is for package-manager client application
1924 * @par Sync (or) Async : Synchronous API
1926 * @param[in] handle pointer to the package info filter handle.
1927 * @param[in] property integer property name.
1928 * @param[in] value value corresponding to the property.
1929 * @return 0 if success, error code(<0) if fail
1930 * @retval PMINFO_R_OK success
1931 * @retval PMINFO_R_EINVAL invalid argument
1932 * @retval PMINFO_R_ERROR internal error
1933 * @pre pkgmgrinfo_pkginfo_filter_create()
1934 * @post pkgmgrinfo_pkginfo_filter_destroy()
1935 * @see pkgmgrinfo_pkginfo_filter_count()
1936 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1938 static int get_pkg_count()
1942 pkgmgrinfo_pkginfo_filter_h handle;
1943 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1944 if (ret != PMINFO_R_OK)
1946 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1947 if (ret != PMINFO_R_OK) {
1948 pkgmgrinfo_pkginfo_filter_destroy(handle);
1951 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1952 if (ret != PMINFO_R_OK) {
1953 pkgmgrinfo_pkginfo_filter_destroy(handle);
1956 printf("No of preload pkgs: %d\n", count);
1957 pkgmgrinfo_pkginfo_filter_destroy(handle);
1962 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1963 const char *property, const int value);
1966 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1967 * @brief This API adds a string filter property to the filter handle
1969 * @par This API is for package-manager client application
1970 * @par Sync (or) Async : Synchronous API
1972 * @param[in] handle pointer to the package info filter handle.
1973 * @param[in] property string property name.
1974 * @param[in] value value corresponding to the property.
1975 * @return 0 if success, error code(<0) if fail
1976 * @retval PMINFO_R_OK success
1977 * @retval PMINFO_R_EINVAL invalid argument
1978 * @retval PMINFO_R_ERROR internal error
1979 * @pre pkgmgrinfo_pkginfo_filter_create()
1980 * @post pkgmgrinfo_pkginfo_filter_destroy()
1981 * @see pkgmgrinfo_pkginfo_filter_count()
1982 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1984 static int get_rpm_pkg_count()
1988 pkgmgrinfo_pkginfo_filter_h handle;
1989 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1990 if (ret != PMINFO_R_OK)
1992 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1993 if (ret != PMINFO_R_OK) {
1994 pkgmgrinfo_pkginfo_filter_destroy(handle);
1997 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1998 if (ret != PMINFO_R_OK) {
1999 pkgmgrinfo_pkginfo_filter_destroy(handle);
2002 printf("No of rpm pkgs: %d\n", count);
2003 pkgmgrinfo_pkginfo_filter_destroy(handle);
2008 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2009 const char *property, const char *value);
2012 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2013 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2015 * @par This API is for package-manager client application
2016 * @par Sync (or) Async : Synchronous API
2018 * @param[in] handle pointer to the package info filter handle.
2019 * @param[in] pkg_cb callback function.
2020 * @param[in] user_data user data to be passed to the callback function
2021 * @return 0 if success, error code(<0) if fail
2022 * @retval PMINFO_R_OK success
2023 * @retval PMINFO_R_EINVAL invalid argument
2024 * @retval PMINFO_R_ERROR internal error
2025 * @pre pkgmgrinfo_pkginfo_filter_create()
2026 * @post pkgmgrinfo_pkginfo_filter_destroy()
2027 * @see pkgmgrinfo_pkginfo_filter_count()
2029 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2032 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2033 printf("pkg id : %s\n", pkgid);
2037 static int get_rpm_pkg_list()
2040 pkgmgrinfo_pkginfo_filter_h handle;
2041 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2042 if (ret != PMINFO_R_OK)
2044 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2045 if (ret != PMINFO_R_OK) {
2046 pkgmgrinfo_pkginfo_filter_destroy(handle);
2049 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2050 if (ret != PMINFO_R_OK) {
2051 pkgmgrinfo_pkginfo_filter_destroy(handle);
2054 pkgmgrinfo_pkginfo_filter_destroy(handle);
2059 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2060 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2061 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2062 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2065 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2066 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2067 * @brief This API counts the package that satisfy the filter conditions
2069 * @par This API is for package-manager client application
2070 * @par Sync (or) Async : Synchronous API
2072 * @param[in] handle pointer to the package info filter handle.
2073 * @param[in] count pointer to store the count value.
2074 * @param[in] uid the addressee user id of the instruction
2075 * @return 0 if success, error code(<0) if fail
2076 * @retval PMINFO_R_OK success
2077 * @retval PMINFO_R_EINVAL invalid argument
2078 * @retval PMINFO_R_ERROR internal error
2079 * @pre pkgmgrinfo_pkginfo_filter_create()
2080 * @post pkgmgrinfo_pkginfo_filter_destroy()
2081 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2083 static int get_rpm_pkg_count()
2087 pkgmgrinfo_pkginfo_filter_h handle;
2088 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2089 if (ret != PMINFO_R_OK)
2091 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2092 if (ret != PMINFO_R_OK) {
2093 pkgmgrinfo_pkginfo_filter_destroy(handle);
2096 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2097 if (ret != PMINFO_R_OK) {
2098 pkgmgrinfo_pkginfo_filter_destroy(handle);
2101 printf("No of rpm pkgs: %d\n", count);
2102 pkgmgrinfo_pkginfo_filter_destroy(handle);
2107 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2108 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2110 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2111 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2112 * @brief This API gets the list of privilege for a particular package
2114 * @par This API is for package-manager client application
2115 * @par Sync (or) Async : Synchronous API
2116 * @param[in] handle pointer to the package info handle.
2117 * @param[in] privilege_func callback function for list
2118 * @param[in] user_data user data to be passed to callback function
2119 * @return 0 if success, error code(<0) if fail
2120 * @retval PMINFO_R_OK success
2121 * @retval PMINFO_R_EINVAL invalid argument
2122 * @retval PMINFO_R_ERROR internal error
2123 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2124 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2126 int privilege_func(const char *name, void *user_data)
2128 if (strcmp(name, (char *)user_data) == 0)
2134 static int list_privilege(const char *package, char *privilege)
2137 pkgmgrinfo_pkginfo_h handle;
2138 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2139 if (ret != PMINFO_R_OK)
2141 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2142 if (ret != PMINFO_R_OK) {
2143 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2146 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2151 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2152 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2154 /* TODO: add doxygen comment here */
2155 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2156 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2157 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2158 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2159 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2160 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2161 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2164 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2165 pkgmgrinfo_app_list_cb app_func, void *user_data)
2166 * @brief This API gets list of installed applications for a particular package
2168 * @par This API is for package-manager client application
2169 * @par Sync (or) Async : Synchronous API
2170 * @param[in] handle package info handle
2171 * @param[in] component application component
2172 * @param[in] app_func iteration function for list
2173 * @param[in] user_data user data to be passed to callback function
2174 * @return 0 if success, error code(<0) if fail
2175 * @retval PMINFO_R_OK success
2176 * @retval PMINFO_R_EINVAL invalid argument
2177 * @retval PMINFO_R_ERROR internal error
2178 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2179 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2181 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2184 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2185 printf("appid : %s\n", appid);
2189 static int list_apps(const char *pkgid)
2192 pkgmgrinfo_pkginfo_h handle;
2193 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2194 if (ret != PMINFO_R_OK)
2196 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2197 if (ret != PMINFO_R_OK) {
2198 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2201 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2206 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2207 pkgmgrinfo_app_list_cb app_func, void *user_data);
2208 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2209 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2211 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2212 * @brief This API gets list of installed applications from all packages with minimum informaion.
2214 * @par This API is for package-manager client application
2215 * @par Sync (or) Async : Synchronous API
2216 * @param[in] app_func iteration function for list
2217 * @param[in] user_data user data to be passed to callback function
2218 * @return 0 if success, error code(<0) if fail
2219 * @retval PMINFO_R_OK success
2220 * @retval PMINFO_R_EINVAL invalid argument
2221 * @retval PMINFO_R_ERROR internal error
2225 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2227 char *pkgid1 = NULL;
2228 char *pkgid2 = NULL;
2229 pkgid1 = (char *)user_data;
2230 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2231 if (strcmp(pkgid1, pkgid2) == 0) {
2238 static int list_apps()
2241 char *name = "helloworld";
2242 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2243 if (ret != PMINFO_R_OK) {
2250 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2251 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2253 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2254 * @brief This API gets list of installed applications from all packages.
2256 * @par This API is for package-manager client application
2257 * @par Sync (or) Async : Synchronous API
2258 * @param[in] app_func iteration function for list
2259 * @param[in] user_data user data to be passed to callback function
2260 * @return 0 if success, error code(<0) if fail
2261 * @retval PMINFO_R_OK success
2262 * @retval PMINFO_R_EINVAL invalid argument
2263 * @retval PMINFO_R_ERROR internal error
2267 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2269 char *pkgid1 = NULL;
2270 char *pkgid2 = NULL;
2271 pkgid1 = (char *)user_data;
2272 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2273 if (strcmp(pkgid1, pkgid2) == 0) {
2280 static int list_apps()
2283 char *name = "helloworld";
2284 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2285 if (ret != PMINFO_R_OK) {
2292 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2293 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2296 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2297 * @brief This API creates the application information handle from db
2299 * @par This API is for package-manager client application
2300 * @par Sync (or) Async : Synchronous API
2302 * @param[in] appid pointer to appid
2303 * @param[out] handle pointer to the application info handle.
2304 * @return 0 if success, error code(<0) if fail
2305 * @retval PMINFO_R_OK success
2306 * @retval PMINFO_R_EINVAL invalid argument
2307 * @retval PMINFO_R_ERROR internal error
2309 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2310 * @see pkgmgrinfo_appinfo_get_pkgid()
2311 * @see pkgmgrinfo_appinfo_is_multiple()
2313 static int get_app_type(const char *appid)
2317 pkgmgrinfo_appinfo_h handle;
2318 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2319 if (ret != PMINFO_R_OK)
2321 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2322 if (ret != PMINFO_R_OK) {
2323 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2326 printf("apptype: %s\n", type);
2327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2332 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2333 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2335 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2336 * @brief This API gets the application ID
2338 * @par This API is for package-manager client application
2339 * @par Sync (or) Async : Synchronous API
2341 * @param[in] handle pointer to the application info handle.
2342 * @param[out] appid pointer to hold appid
2343 * @return 0 if success, error code(<0) if fail
2344 * @retval PMINFO_R_OK success
2345 * @retval PMINFO_R_EINVAL invalid argument
2346 * @retval PMINFO_R_ERROR internal error
2347 * @pre pkgmgrinfo_appinfo_get_appinfo()
2348 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2349 * @see pkgmgrinfo_appinfo_get_pkgid()
2350 * @see pkgmgrinfo_appinfo_is_multiple()
2352 static int get_app_id(const char *appid)
2355 char *app_id = NULL;
2356 pkgmgrinfo_appinfo_h handle;
2357 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2358 if (ret != PMINFO_R_OK)
2360 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2361 if (ret != PMINFO_R_OK) {
2362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2365 printf("app id: %s\n", app_id);
2366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2371 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2374 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2375 * @brief This API gets the package name of the application
2377 * @par This API is for package-manager client application
2378 * @par Sync (or) Async : Synchronous API
2380 * @param[in] handle pointer to the application info handle.
2381 * @param[out] pkg_name pointer to hold package name
2382 * @return 0 if success, error code(<0) if fail
2383 * @retval PMINFO_R_OK success
2384 * @retval PMINFO_R_EINVAL invalid argument
2385 * @retval PMINFO_R_ERROR internal error
2386 * @pre pkgmgrinfo_appinfo_get_appinfo()
2387 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2388 * @see pkgmgrinfo_appinfo_get_appid()
2389 * @see pkgmgrinfo_appinfo_is_multiple()
2391 static int get_app_pkgname(const char *appid)
2394 char *pkgname = NULL;
2395 pkgmgrinfo_appinfo_h handle;
2396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2397 if (ret != PMINFO_R_OK)
2399 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2400 if (ret != PMINFO_R_OK) {
2401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2404 printf("pkg name: %s\n", pkgname);
2405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2410 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2413 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2414 * @brief This API gets the package id of the application
2416 * @par This API is for package-manager client application
2417 * @par Sync (or) Async : Synchronous API
2419 * @param[in] handle pointer to the application info handle.
2420 * @param[out] pkgid pointer to hold package id
2421 * @return 0 if success, error code(<0) if fail
2422 * @retval PMINFO_R_OK success
2423 * @retval PMINFO_R_EINVAL invalid argument
2424 * @retval PMINFO_R_ERROR internal error
2425 * @pre pkgmgrinfo_appinfo_get_appinfo()
2426 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2427 * @see pkgmgrinfo_appinfo_get_appid()
2428 * @see pkgmgrinfo_appinfo_is_multiple()
2430 static int get_app_pkgid(const char *appid)
2434 pkgmgrinfo_appinfo_h handle;
2435 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2436 if (ret != PMINFO_R_OK)
2438 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2439 if (ret != PMINFO_R_OK) {
2440 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2443 printf("pkg id: %s\n", pkgid);
2444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2449 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2452 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2453 * @brief This API gets the executable name of the application
2455 * @par This API is for package-manager client application
2456 * @par Sync (or) Async : Synchronous API
2458 * @param[in] handle pointer to the application info handle.
2459 * @param[out] exec pointer to hold app exec name
2460 * @return 0 if success, error code(<0) if fail
2461 * @retval PMINFO_R_OK success
2462 * @retval PMINFO_R_EINVAL invalid argument
2463 * @retval PMINFO_R_ERROR internal error
2464 * @pre pkgmgrinfo_appinfo_get_appinfo()
2465 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2466 * @see pkgmgrinfo_appinfo_get_appid()
2467 * @see pkgmgrinfo_appinfo_is_multiple()
2469 static int get_app_exec(const char *appid)
2473 pkgmgrinfo_appinfo_h handle;
2474 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2475 if (ret != PMINFO_R_OK)
2477 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2478 if (ret != PMINFO_R_OK) {
2479 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2482 printf("exec name: %s\n", exec);
2483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2488 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2491 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2492 * @brief This API gets the icon name of the application
2494 * @par This API is for package-manager client application
2495 * @par Sync (or) Async : Synchronous API
2497 * @param[in] handle pointer to the application info handle.
2498 * @param[out] icon pointer to hold app icon name
2499 * @return 0 if success, error code(<0) if fail
2500 * @retval PMINFO_R_OK success
2501 * @retval PMINFO_R_EINVAL invalid argument
2502 * @retval PMINFO_R_ERROR internal error
2503 * @pre pkgmgrinfo_appinfo_get_appinfo()
2504 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2505 * @see pkgmgrinfo_appinfo_get_appid()
2506 * @see pkgmgrinfo_appinfo_is_multiple()
2508 static int get_app_icon(const char *appid)
2512 pkgmgrinfo_appinfo_h handle;
2513 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2514 if (ret != PMINFO_R_OK)
2516 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2517 if (ret != PMINFO_R_OK) {
2518 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2521 printf("icon name: %s\n", icon);
2522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2527 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2530 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2531 * @brief This API gets the label of the application
2533 * @par This API is for package-manager client application
2534 * @par Sync (or) Async : Synchronous API
2536 * @param[in] handle pointer to the application info handle.
2537 * @param[out] label pointer to hold app label
2538 * @return 0 if success, error code(<0) if fail
2539 * @retval PMINFO_R_OK success
2540 * @retval PMINFO_R_EINVAL invalid argument
2541 * @retval PMINFO_R_ERROR internal error
2542 * @pre pkgmgrinfo_appinfo_get_appinfo()
2543 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2544 * @see pkgmgrinfo_appinfo_get_appid()
2545 * @see pkgmgrinfo_appinfo_is_multiple()
2547 static int get_app_label(const char *appid)
2551 pkgmgrinfo_appinfo_h handle;
2552 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2553 if (ret != PMINFO_R_OK)
2555 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2556 if (ret != PMINFO_R_OK) {
2557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2560 printf("label : %s\n", label);
2561 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2566 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2569 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2570 * @brief This API gets exactly matched label by given appid and locale
2572 * @par This API is for package-manager client application
2573 * @par Sync (or) Async : Synchronous API
2575 * @param[in] appid pointer to appid
2576 * @param[in] locale pointer to locale
2577 * @param[out] label pointer to hold app label
2578 * @return 0 if success, error code(<0) if fail
2579 * @retval PMINFO_R_OK success
2580 * @retval PMINFO_R_EINVAL invalid argument
2581 * @retval PMINFO_R_ERROR internal error
2583 static int get_localed_label(const char *appid, const char *locale)
2588 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2589 if (ret != PMINFO_R_OK)
2592 printf("localed label: %s\n", label);
2600 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2601 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2604 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2605 * @brief This API gets the component of the application
2607 * @par This API is for package-manager client application
2608 * @par Sync (or) Async : Synchronous API
2610 * @param[in] handle pointer to the application info handle.
2611 * @param[out] component pointer to hold app component
2612 * @return 0 if success, error code(<0) if fail
2613 * @retval PMINFO_R_OK success
2614 * @retval PMINFO_R_EINVAL invalid argument
2615 * @retval PMINFO_R_ERROR internal error
2616 * @pre pkgmgrinfo_appinfo_get_appinfo()
2617 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2618 * @see pkgmgrinfo_appinfo_get_appid()
2619 * @see pkgmgrinfo_appinfo_is_multiple()
2621 static int get_app_component(const char *appid)
2624 pkgmgrinfo_app_component component;
2625 pkgmgrinfo_appinfo_h handle;
2626 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2627 if (ret != PMINFO_R_OK)
2629 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2630 if (ret != PMINFO_R_OK) {
2631 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2634 printf("component : %s\n", component);
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2640 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2643 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2644 * @brief This API gets the apptype of the application
2646 * @par This API is for package-manager client application
2647 * @par Sync (or) Async : Synchronous API
2649 * @param[in] handle pointer to the application info handle.
2650 * @param[out] app_type pointer to hold apptype
2651 * @return 0 if success, error code(<0) if fail
2652 * @retval PMINFO_R_OK success
2653 * @retval PMINFO_R_EINVAL invalid argument
2654 * @retval PMINFO_R_ERROR internal error
2655 * @pre pkgmgrinfo_appinfo_get_appinfo()
2656 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2657 * @see pkgmgrinfo_appinfo_get_appid()
2658 * @see pkgmgrinfo_appinfo_is_multiple()
2660 static int get_app_type(const char *appid)
2663 char *apptype = NULL;
2664 pkgmgrinfo_appinfo_h handle;
2665 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2666 if (ret != PMINFO_R_OK)
2668 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2669 if (ret != PMINFO_R_OK) {
2670 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2673 printf("apptype : %s\n", apptype);
2674 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2679 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2682 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2683 int *operation_count, char ***operation)
2684 * @brief This API gets the list of operation of the application
2686 * @par This API is for package-manager client application
2687 * @par Sync (or) Async : Synchronous API
2689 * @param[in] handle pointer to the appcontrol handle.
2690 * @param[out] operation_count pointer to hold number of operations
2691 * @param[out] operation pointer to hold list of operations
2692 * @return 0 if success, error code(<0) if fail
2693 * @retval PMINFO_R_OK success
2694 * @retval PMINFO_R_EINVAL invalid argument
2695 * @retval PMINFO_R_ERROR internal error
2696 * @pre pkgmgrinfo_appinfo_get_appinfo()
2697 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2698 * @see pkgmgrinfo_appinfo_get_uri()
2699 * @see pkgmgrinfo_appinfo_get_mime()
2701 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2706 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2707 for (i = 0; i < oc; i++) {
2708 if (strcmp(operation[i], (char *)user_data) == 0)
2715 static int check_operation(const char *appid, char *operation)
2718 pkgmgrinfo_appinfo_h handle;
2719 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2720 if (ret != PMINFO_R_OK)
2722 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2723 if (ret != PMINFO_R_OK) {
2724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2727 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2732 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2733 int *operation_count, char ***operation);
2736 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2737 int *uri_count, char ***uri)
2738 * @brief This API gets the list of uri of the application
2740 * @par This API is for package-manager client application
2741 * @par Sync (or) Async : Synchronous API
2743 * @param[in] handle pointer to the appcontrol handle.
2744 * @param[out] uri_count pointer to hold number of uris
2745 * @param[out] uri pointer to hold list of uris
2746 * @return 0 if success, error code(<0) if fail
2747 * @retval PMINFO_R_OK success
2748 * @retval PMINFO_R_EINVAL invalid argument
2749 * @retval PMINFO_R_ERROR internal error
2750 * @pre pkgmgrinfo_appinfo_get_appinfo()
2751 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2752 * @see pkgmgrinfo_appinfo_get_operation()
2753 * @see pkgmgrinfo_appinfo_get_mime()
2755 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2760 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2761 for (i = 0; i < uc; i++) {
2762 if (strcmp(uri[i], (char *)user_data) == 0)
2769 static int check_uri(const char *appid, char *uri)
2772 pkgmgrinfo_appinfo_h handle;
2773 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2774 if (ret != PMINFO_R_OK)
2776 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2777 if (ret != PMINFO_R_OK) {
2778 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2781 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2786 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2787 int *uri_count, char ***uri);
2790 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2791 int *mime_count, char ***mime)
2792 * @brief This API gets the list of mime of the application
2794 * @par This API is for package-manager client application
2795 * @par Sync (or) Async : Synchronous API
2797 * @param[in] handle pointer to the appcontrol handle.
2798 * @param[out] mime_count pointer to hold number of mimes
2799 * @param[out] mime pointer to hold list of mimes
2800 * @return 0 if success, error code(<0) if fail
2801 * @retval PMINFO_R_OK success
2802 * @retval PMINFO_R_EINVAL invalid argument
2803 * @retval PMINFO_R_ERROR internal error
2804 * @pre pkgmgrinfo_appinfo_get_appinfo()
2805 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2806 * @see pkgmgrinfo_appinfo_get_uri()
2807 * @see pkgmgrinfo_appinfo_get_operation()
2809 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2814 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2815 for (i = 0; i < mc; i++) {
2816 if (strcmp(mime[i], (char *)user_data) == 0)
2823 static int check_mime(const char *appid, char *mime)
2826 pkgmgrinfo_appinfo_h handle;
2827 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2828 if (ret != PMINFO_R_OK)
2830 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2831 if (ret != PMINFO_R_OK) {
2832 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2835 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2840 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2841 int *mime_count, char ***mime);
2844 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2845 int *subapp_count, char ***subapp)
2846 * @brief This API gets the list of subapp of the application
2848 * @par This API is for package-manager client application
2849 * @par Sync (or) Async : Synchronous API
2851 * @param[in] handle pointer to the appcontrol handle.
2852 * @param[out] subapp_count pointer to hold number of subapp
2853 * @param[out] subapp pointer to hold list of subapp
2854 * @return 0 if success, error code(<0) if fail
2855 * @retval PMINFO_R_OK success
2856 * @retval PMINFO_R_EINVAL invalid argument
2857 * @retval PMINFO_R_ERROR internal error
2858 * @pre pkgmgrinfo_appinfo_get_appinfo()
2859 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2860 * @see pkgmgrinfo_appinfo_get_uri()
2861 * @see pkgmgrinfo_appinfo_get_operation()
2863 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2867 char **subapp = NULL;
2868 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2869 for (i = 0; i < sc; i++) {
2870 if (strcmp(subapp[i], (char *)user_data) == 0)
2877 static int check_subapp(const char *appid, char *subapp)
2880 pkgmgrinfo_appinfo_h handle = NULL;
2881 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2882 if (ret != PMINFO_R_OK)
2884 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2885 if (ret != PMINFO_R_OK) {
2886 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2889 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2894 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2895 int *subapp_count, char ***subapp);
2898 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2899 * @brief This API gets the notification icon of the application
2901 * @par This API is for package-manager client application
2902 * @par Sync (or) Async : Synchronous API
2904 * @param[in] handle pointer to the application info handle.
2905 * @param[out] path pointer to hold notification icon
2906 * @return 0 if success, error code(<0) if fail
2907 * @retval PMINFO_R_OK success
2908 * @retval PMINFO_R_EINVAL invalid argument
2909 * @retval PMINFO_R_ERROR internal error
2910 * @pre pkgmgrinfo_appinfo_get_appinfo()
2911 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2912 * @see pkgmgrinfo_appinfo_get_appid()
2913 * @see pkgmgrinfo_appinfo_is_multiple()
2915 static int get_app_notification_icon(const char *appid)
2918 char *notification_icon = NULL;
2919 pkgmgrinfo_appinfo_h handle;
2920 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2921 if (ret != PMINFO_R_OK)
2923 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2924 if (ret != PMINFO_R_OK) {
2925 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2928 printf("notification icon : %s\n", notification_icon);
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2934 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2937 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2938 * @brief This API gets the setting icon of the application
2940 * @par This API is for package-manager client application
2941 * @par Sync (or) Async : Synchronous API
2943 * @param[in] handle pointer to the application info handle.
2944 * @param[out] path pointer to hold setting icon
2945 * @return 0 if success, error code(<0) if fail
2946 * @retval PMINFO_R_OK success
2947 * @retval PMINFO_R_EINVAL invalid argument
2948 * @retval PMINFO_R_ERROR internal error
2949 * @pre pkgmgrinfo_appinfo_get_appinfo()
2950 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2951 * @see pkgmgrinfo_appinfo_get_appid()
2952 * @see pkgmgrinfo_appinfo_is_multiple()
2954 static int get_app_setting_icon(const char *appid)
2957 char *setting_icon = NULL;
2958 pkgmgrinfo_appinfo_h handle;
2959 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2960 if (ret != PMINFO_R_OK)
2962 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2963 if (ret != PMINFO_R_OK) {
2964 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2967 printf("setting icon : %s\n", setting_icon);
2968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2973 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2976 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2977 * @brief This API gets the type of recent image on app-tray
2979 * @par This API is for package-manager client application
2980 * @par Sync (or) Async : Synchronous API
2982 * @param[in] handle pointer to the application info handle.
2983 * @param[out] type pointer to hold image type
2984 * @return 0 if success, error code(<0) if fail
2985 * @retval PMINFO_R_OK success
2986 * @retval PMINFO_R_EINVAL invalid argument
2987 * @retval PMINFO_R_ERROR internal error
2988 * @pre pkgmgrinfo_appinfo_get_appinfo()
2989 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2990 * @see pkgmgrinfo_appinfo_get_appid()
2991 * @see pkgmgrinfo_appinfo_is_multiple()
2993 static int get_app_recent_image_type(const char *appid)
2996 pkgmgrinfo_app_recentimage type;
2997 pkgmgrinfo_appinfo_h handle;
2998 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2999 if (ret != PMINFO_R_OK)
3001 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3002 if (ret != PMINFO_R_OK) {
3003 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3006 printf("recent image type: %d\n", type);
3007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3012 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3016 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3017 * @brief This API gets the preview image of application
3019 * @par Sync (or) Async : Synchronous API
3021 * @param[in] handle pointer to the application info handle.
3022 * @param[out] preview_img pointer to hold preview image path
3023 * @return 0 if success, error code(<0) if fail
3024 * @retval PMINFO_R_OK success
3025 * @retval PMINFO_R_EINVAL invalid argument
3026 * @retval PMINFO_R_ERROR internal error
3027 * @pre pkgmgrinfo_appinfo_get_appinfo()
3028 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3029 * @see pkgmgrinfo_appinfo_get_appid()
3031 static int get_app_previewimage(const char *appid)
3034 char *preview = NULL;
3035 pkgmgrinfo_appinfo_h handle = NULL;
3036 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3037 if (ret != PMINFO_R_OK)
3039 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3040 if (ret != PMINFO_R_OK) {
3041 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3044 printf("preview image path : %s\n", preview);
3045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3050 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3054 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3055 * @brief This API gets the package permission type of the application
3057 * @par This API is for package-manager client application
3058 * @par Sync (or) Async : Synchronous API
3060 * @param[in] handle pointer to the application info handle.
3061 * @param[out] permission pointer to hold package permission
3062 * @return 0 if success, error code(<0) if fail
3063 * @retval PMINFO_R_OK success
3064 * @retval PMINFO_R_EINVAL invalid argument
3065 * @retval PMINFO_R_ERROR internal error
3066 * @pre pkgmgrinfo_appinfo_get_appinfo()
3067 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3068 * @see pkgmgrinfo_appinfo_get_appid()
3070 static int get_app_permission(const char *appid)
3073 pkgmgrinfo_permission_type permission = 0;
3074 pkgmgrinfo_appinfo_h handle;
3076 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3077 if (ret != PMINFO_R_OK)
3079 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3080 if (ret != PMINFO_R_OK) {
3081 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3084 printf("permission type: %d\n", permission);
3085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3090 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3093 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3094 * @brief This API gets the component_type
3096 * @par This API is for package-manager client application
3097 * @par Sync (or) Async : Synchronous API
3099 * @param[in] handle pointer to the application info handle.
3100 * @param[out] component_type pointer to hold component_type
3101 * @return 0 if success, error code(<0) if fail
3102 * @retval PMINFO_R_OK success
3103 * @retval PMINFO_R_EINVAL invalid argument
3104 * @retval PMINFO_R_ERROR internal error
3105 * @pre pkgmgrinfo_appinfo_get_appinfo()
3106 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3107 * @see pkgmgrinfo_appinfo_get_pkgid()
3108 * @see pkgmgrinfo_appinfo_is_multiple()
3110 static int get_component_type(const char *appid)
3113 char *component_type = NULL;
3114 pkgmgrinfo_appinfo_h handle;
3115 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3116 if (ret != PMINFO_R_OK)
3118 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3119 if (ret != PMINFO_R_OK) {
3120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3123 printf("component_type: %s\n", component_type);
3124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3129 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3132 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3133 * @brief This API gets the application 'hwacceleration' value from the app ID
3135 * @par This API is for package-manager client application
3136 * @par Sync (or) Async : Synchronous API
3138 * @param[in] handle pointer to application info handle
3139 * @param[out] hwacceleration pointer to hold package hwacceleration value
3140 * @return 0 if success, error code(<0) if fail
3141 * @retval PMINFO_R_OK success
3142 * @retval PMINFO_R_EINVAL invalid argument
3143 * @retval PMINFO_R_ERROR internal error
3144 * @pre pkgmgrinfo_appinfo_get_appinfo()
3145 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3146 * @see pkgmgrinfo_appinfo_get_appid()
3147 * @see pkgmgrinfo_appinfo_is_multiple()
3149 static int get_app_hwacceleration(const char *appid)
3152 pkgmgrinfo_app_hwacceleration hwacceleration;
3153 pkgmgrinfo_appinfo_h handle;
3154 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3155 if (ret != PMINFO_R_OK)
3157 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3158 if (ret != PMINFO_R_OK) {
3159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3162 printf("app hwacceleration: %d\n", hwacceleration);
3163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3168 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3171 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3172 * @brief This API gets the application 'screenreader' value from the app ID
3174 * @par This API is for package-manager client application
3175 * @par Sync (or) Async : Synchronous API
3177 * @param[in] handle pointer to application info handle
3178 * @param[out] screenreader pointer to hold package accessibility value
3179 * @return 0 if success, error code(<0) if fail
3180 * @retval PMINFO_R_OK success
3181 * @retval PMINFO_R_EINVAL invalid argument
3182 * @retval PMINFO_R_ERROR internal error
3183 * @pre pkgmgrinfo_appinfo_get_appinfo()
3184 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3185 * @see pkgmgrinfo_appinfo_get_appid()
3186 * @see pkgmgrinfo_appinfo_is_multiple()
3188 static int get_app_screenreader(const char *appid)
3191 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3192 pkgmgrinfo_appinfo_h handle = NULL;
3193 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3194 if (ret != PMINFO_R_OK)
3196 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3197 if (ret != PMINFO_R_OK) {
3198 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3201 printf("app screenreader: %d\n", screenreader);
3202 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3207 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3210 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3211 * @brief This API gets the application's landscape & portrait effect images
3213 * @par This API is for package-manager client application
3214 * @par Sync (or) Async : Synchronous API
3216 * @param[in] handle pointer to application info handle
3217 * @param[out] portrait_img contains portrait mode effect image
3218 * @param[out] landscape_img contains landscape mode effect image
3219 * @return 0 if success, error code(<0) if fail
3220 * @retval PMINFO_R_OK success
3221 * @retval PMINFO_R_EINVAL invalid argument
3222 * @retval PMINFO_R_ERROR internal error
3223 * @pre pkgmgrinfo_appinfo_get_appinfo()
3224 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3225 * @see pkgmgrinfo_appinfo_get_appid()
3226 * @see pkgmgrinfo_appinfo_is_nodisplay()
3228 static int get_app_effectimages(const char *appid)
3231 char *portraitimg = NULL;
3232 char *landscapeimg = NULL;
3233 pkgmgrinfo_appinfo_h handle;
3234 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3235 if (ret != PMINFO_R_OK)
3237 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3238 if (ret != PMINFO_R_OK) {
3239 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3242 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3248 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3251 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3252 * @brief This API gets the submode_mainid of the application
3254 * @par This API is for package-manager client application
3255 * @par Sync (or) Async : Synchronous API
3257 * @param[in] handle pointer to the application info handle.
3258 * @param[out] submode_mainid pointer to hold package name
3259 * @return 0 if success, error code(<0) if fail
3260 * @retval PMINFO_R_OK success
3261 * @retval PMINFO_R_EINVAL invalid argument
3262 * @retval PMINFO_R_ERROR internal error
3263 * @pre pkgmgrinfo_appinfo_get_appinfo()
3264 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3265 * @see pkgmgrinfo_appinfo_get_appid()
3266 * @see pkgmgrinfo_appinfo_is_multiple()
3268 static int get_app_submode_mainid(const char *appid)
3271 char *submode_mainid = NULL;
3272 pkgmgrinfo_appinfo_h handle = NULL;
3273 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3274 if (ret != PMINFO_R_OK)
3276 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3277 if (ret != PMINFO_R_OK) {
3278 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3281 printf("submode_mainid: %s\n", submode_mainid);
3282 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3287 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3290 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3291 * @brief This API gets the datacontrol info
3293 * @par This API is for package-manager client application
3294 * @par Sync (or) Async : Synchronous API
3296 * @param[in] providerid pointer to the providerid of dataconltrol.
3297 * @param[in] type pointer to the type of dataconltrol.
3298 * @param[out] appid pointer to hold appid, need to free after using
3299 * @param[out] access pointer to hold access, need to free after using
3300 * @return 0 if success, error code(<0) if fail
3301 * @retval PMINFO_R_OK success
3302 * @retval PMINFO_R_EINVAL invalid argument
3303 * @retval PMINFO_R_ERROR internal error
3306 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3307 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3310 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3311 * @brief This API gets the appid of datacontrol
3313 * @par This API is for package-manager client application
3314 * @par Sync (or) Async : Synchronous API
3316 * @param[in] providerid pointer to the providerid of dataconltrol.
3317 * @param[out] appid pointer to hold appid, need to free after using
3318 * @return 0 if success, error code(<0) if fail
3319 * @retval PMINFO_R_OK success
3320 * @retval PMINFO_R_EINVAL invalid argument
3321 * @retval PMINFO_R_ERROR internal error
3324 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3325 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3328 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3329 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3330 * @brief This API gets the list of permission for a particular application
3332 * @par This API is for package-manager client application
3333 * @par Sync (or) Async : Synchronous API
3334 * @param[in] handle pointer to the application info handle.
3335 * @param[in] permission_func callback function for list
3336 * @param[in] user_data user data to be passed to callback function
3337 * @return 0 if success, error code(<0) if fail
3338 * @retval PMINFO_R_OK success
3339 * @retval PMINFO_R_EINVAL invalid argument
3340 * @retval PMINFO_R_ERROR internal error
3341 * @pre pkgmgrinfo_appinfo_get_appinfo()
3342 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3344 int permission_func(const char *name, void *user_data)
3346 if (strcmp(name, (char *)user_data) == 0)
3352 static int list_permission(const char *appid, char *permission)
3355 pkgmgrinfo_appinfo_h handle;
3356 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3357 if (ret != PMINFO_R_OK)
3359 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3360 if (ret != PMINFO_R_OK) {
3361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3369 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3370 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3373 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3374 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3375 * @brief This API gets the list of category for a particular application
3377 * @par This API is for package-manager client application
3378 * @par Sync (or) Async : Synchronous API
3379 * @param[in] handle pointer to the application info handle.
3380 * @param[in] category_func callback function for list
3381 * @param[in] user_data user data to be passed to callback function
3382 * @return 0 if success, error code(<0) if fail
3383 * @retval PMINFO_R_OK success
3384 * @retval PMINFO_R_EINVAL invalid argument
3385 * @retval PMINFO_R_ERROR internal error
3386 * @pre pkgmgrinfo_appinfo_get_appinfo()
3387 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3389 int category_func(const char *name, void *user_data)
3391 if (strcmp(name, (char *)user_data) == 0)
3397 static int list_category(const char *appid, char *category)
3400 pkgmgrinfo_appinfo_h handle;
3401 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3402 if (ret != PMINFO_R_OK)
3404 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3405 if (ret != PMINFO_R_OK) {
3406 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3414 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3415 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3418 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3419 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3420 * @brief This API gets the list of metadata for a particular application
3422 * @par This API is for package-manager client application
3423 * @par Sync (or) Async : Synchronous API
3424 * @param[in] handle pointer to the application info handle.
3425 * @param[in] metadata_func callback function for list
3426 * @param[in] user_data user data to be passed to callback function
3427 * @return 0 if success, error code(<0) if fail
3428 * @retval PMINFO_R_OK success
3429 * @retval PMINFO_R_EINVAL invalid argument
3430 * @retval PMINFO_R_ERROR internal error
3431 * @pre pkgmgrinfo_appinfo_get_appinfo()
3432 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3434 int metadata_func(const char *key, const char *value, void *user_data)
3436 if (strcmp(key, (char *)user_data) == 0) {
3437 printf("Value is %s\n", value);
3444 static int list_metadata(const char *appid, char *key)
3447 pkgmgrinfo_appinfo_h handle;
3448 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3449 if (ret != PMINFO_R_OK)
3451 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3452 if (ret != PMINFO_R_OK) {
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3461 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3462 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3466 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3467 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3468 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3469 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3470 * @brief This API gets the list of app-control for a particular application
3472 * @par This API is for package-manager client application
3473 * @par Sync (or) Async : Synchronous API
3474 * @param[in] handle pointer to the application info handle.
3475 * @param[in] appcontrol_func callback function for list
3476 * @param[in] user_data user data to be passed to callback function
3477 * @param[in] uid the addressee user id of the instruction
3478 * @return 0 if success, error code(<0) if fail
3479 * @retval PMINFO_R_OK success
3480 * @retval PMINFO_R_EINVAL invalid argument
3481 * @retval PMINFO_R_ERROR internal error
3482 * @pre pkgmgrinfo_appinfo_get_appinfo()
3483 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3485 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3490 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3491 for (i = 0; i < oc; i++) {
3492 if (strcmp(operation[i], (char *)user_data) == 0)
3499 static int check_operation(const char *appid, char *operation)
3502 pkgmgrinfo_appinfo_h handle;
3503 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3504 if (ret != PMINFO_R_OK)
3506 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3507 if (ret != PMINFO_R_OK) {
3508 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3516 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3517 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3520 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3521 * @brief This API gets the application 'nodisplay' value from the app ID
3523 * @par This API is for package-manager client application
3524 * @par Sync (or) Async : Synchronous API
3526 * @param[in] handle pointer to application info handle
3527 * @param[out] nodisplay pointer to hold package nodisplay value
3528 * @return 0 if success, error code(<0) if fail
3529 * @retval PMINFO_R_OK success
3530 * @retval PMINFO_R_EINVAL invalid argument
3531 * @retval PMINFO_R_ERROR internal error
3532 * @pre pkgmgrinfo_appinfo_get_appinfo()
3533 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3534 * @see pkgmgrinfo_appinfo_get_appid()
3535 * @see pkgmgrinfo_appinfo_is_multiple()
3537 static int get_app_nodisplay(const char *appid)
3541 pkgmgrinfo_appinfo_h handle;
3542 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3543 if (ret != PMINFO_R_OK)
3545 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3546 if (ret != PMINFO_R_OK) {
3547 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3550 printf("app nodisplay: %d\n", nodisplay);
3551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3556 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3559 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3560 * @brief This API gets the application 'multiple' value from the app ID
3562 * @par This API is for package-manager client application
3563 * @par Sync (or) Async : Synchronous API
3565 * @param[in] handle pointer to application info handle
3566 * @param[out] multiple pointer to hold package multiple value
3567 * @return 0 if success, error code(<0) if fail
3568 * @retval PMINFO_R_OK success
3569 * @retval PMINFO_R_EINVAL invalid argument
3570 * @retval PMINFO_R_ERROR internal error
3571 * @pre pkgmgrinfo_appinfo_get_appinfo()
3572 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3573 * @see pkgmgrinfo_appinfo_get_appid()
3574 * @see pkgmgrinfo_appinfo_is_nodisplay()
3576 static int get_app_multiple(const char *appid)
3580 pkgmgrinfo_appinfo_h handle;
3581 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3582 if (ret != PMINFO_R_OK)
3584 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3585 if (ret != PMINFO_R_OK) {
3586 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3589 printf("app multiple: %d\n", multiple);
3590 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3595 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3598 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3599 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3600 * application launching effect. If fales, indicator will be hidden during application launching effect
3602 * @par This API is for package-manager client application
3603 * @par Sync (or) Async : Synchronous API
3605 * @param[in] handle pointer to application info handle
3606 * @param[out] indicator_disp contains indicator display status for application launching effect
3607 * @return 0 if success, error code(<0) if fail
3608 * @retval PMINFO_R_OK success
3609 * @retval PMINFO_R_EINVAL invalid argument
3610 * @retval PMINFO_R_ERROR internal error
3611 * @pre pkgmgrinfo_appinfo_get_appinfo()
3612 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3613 * @see pkgmgrinfo_appinfo_get_appid()
3614 * @see pkgmgrinfo_appinfo_is_nodisplay()
3616 static int get_app_indicator_display(const char *appid)
3619 bool indicator_disp;
3620 pkgmgrinfo_appinfo_h handle;
3621 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3622 if (ret != PMINFO_R_OK)
3624 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3625 if (ret != PMINFO_R_OK){
3626 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3629 printf("app indicator disp : %d\n", indicator_disp);
3630 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3635 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3638 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3639 * @brief This API gets the application 'taskmanage' value from the app ID
3641 * @par This API is for package-manager client application
3642 * @par Sync (or) Async : Synchronous API
3644 * @param[in] handle pointer to application info handle
3645 * @param[out] taskmanage pointer to hold package taskmanage value
3646 * @return 0 if success, error code(<0) if fail
3647 * @retval PMINFO_R_OK success
3648 * @retval PMINFO_R_EINVAL invalid argument
3649 * @retval PMINFO_R_ERROR internal error
3650 * @pre pkgmgrinfo_appinfo_get_appinfo()
3651 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3652 * @see pkgmgrinfo_appinfo_get_appid()
3653 * @see pkgmgrinfo_appinfo_is_multiple()
3655 static int get_app_taskmanage(const char *appid)
3659 pkgmgrinfo_appinfo_h handle;
3660 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3661 if (ret != PMINFO_R_OK)
3663 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3664 if (ret != PMINFO_R_OK) {
3665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3668 printf("app taskmanage: %d\n", taskmanage);
3669 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3674 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3677 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3678 * @brief This API gets the application 'taskmanage' value from the app ID
3680 * @par This API is for package-manager client application
3681 * @par Sync (or) Async : Synchronous API
3683 * @param[in] handle pointer to application info handle
3684 * @param[out] enabled pointer to hold package enabled value
3685 * @return 0 if success, error code(<0) if fail
3686 * @retval PMINFO_R_OK success
3687 * @retval PMINFO_R_EINVAL invalid argument
3688 * @retval PMINFO_R_ERROR internal error
3689 * @pre pkgmgrinfo_appinfo_get_appinfo()
3690 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3691 * @see pkgmgrinfo_appinfo_get_appid()
3692 * @see pkgmgrinfo_appinfo_is_multiple()
3694 static int get_app_enabled(const char *appid)
3698 pkgmgrinfo_appinfo_h handle;
3699 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3700 if (ret != PMINFO_R_OK)
3702 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3703 if (ret != PMINFO_R_OK) {
3704 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3707 printf("app enabled: %d\n", enabled);
3708 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3713 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3716 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3717 * @brief This API gets the application 'onboot' value from the app ID
3719 * @par This API is for package-manager client application
3720 * @par Sync (or) Async : Synchronous API
3722 * @param[in] handle pointer to application info handle
3723 * @param[out] onboot pointer to hold package onboot value
3724 * @return 0 if success, error code(<0) if fail
3725 * @retval PMINFO_R_OK success
3726 * @retval PMINFO_R_EINVAL invalid argument
3727 * @retval PMINFO_R_ERROR internal error
3728 * @pre pkgmgrinfo_appinfo_get_appinfo()
3729 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3730 * @see pkgmgrinfo_appinfo_get_appid()
3731 * @see pkgmgrinfo_appinfo_is_multiple()
3733 static int get_app_onboot(const char *appid)
3737 pkgmgrinfo_appinfo_h handle;
3738 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3739 if (ret != PMINFO_R_OK)
3741 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3742 if (ret != PMINFO_R_OK) {
3743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3746 printf("app onboot: %d\n", onboot);
3747 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3752 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3755 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3756 * @brief This API gets the application 'autorestart' value from the app ID
3758 * @par This API is for package-manager client application
3759 * @par Sync (or) Async : Synchronous API
3761 * @param[in] handle pointer to application info handle
3762 * @param[out] autorestart pointer to hold package autorestart value
3763 * @return 0 if success, error code(<0) if fail
3764 * @retval PMINFO_R_OK success
3765 * @retval PMINFO_R_EINVAL invalid argument
3766 * @retval PMINFO_R_ERROR internal error
3767 * @pre pkgmgrinfo_appinfo_get_appinfo()
3768 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3769 * @see pkgmgrinfo_appinfo_get_appid()
3770 * @see pkgmgrinfo_appinfo_is_multiple()
3772 static int get_app_autorestart(const char *appid)
3776 pkgmgrinfo_appinfo_h handle;
3777 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3778 if (ret != PMINFO_R_OK)
3780 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3781 if (ret != PMINFO_R_OK) {
3782 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3785 printf("app autorestart: %d\n", autorestart);
3786 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3791 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3794 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3795 * @brief This API gets the value for given application is main app or not from handle
3797 * @par This API is for package-manager client application
3798 * @par Sync (or) Async : Synchronous API
3800 * @param[in] handle pointer to application info handle
3801 * @param[out] mainapp pointer to hold package mainapp is or not
3802 * @return 0 if success, error code(<0) if fail
3803 * @retval PMINFO_R_OK success
3804 * @retval PMINFO_R_EINVAL invalid argument
3805 * @retval PMINFO_R_ERROR internal error
3806 * @pre pkgmgrinfo_appinfo_get_appinfo()
3807 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3808 * @see pkgmgrinfo_appinfo_get_appid()
3809 * @see pkgmgrinfo_appinfo_is_multiple()
3811 static int get_app_mainapp(const char *appid)
3815 pkgmgrinfo_appinfo_h handle;
3816 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3817 if (ret != PMINFO_R_OK)
3819 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3820 if (ret != PMINFO_R_OK) {
3821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3824 printf("mainapp: %d\n", mainapp);
3825 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3830 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3834 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3835 * @brief This API gets the value for given application is preload or not from handle
3837 * @par This API is for package-manager client application
3838 * @par Sync (or) Async : Synchronous API
3840 * @param[in] handle pointer to application info handle
3841 * @param[out] preload pointer to hold preload is or not
3842 * @return 0 if success, error code(<0) if fail
3843 * @retval PMINFO_R_OK success
3844 * @retval PMINFO_R_EINVAL invalid argument
3845 * @retval PMINFO_R_ERROR internal error
3846 * @pre pkgmgrinfo_appinfo_get_appinfo()
3847 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3848 * @see pkgmgrinfo_appinfo_get_appid()
3849 * @see pkgmgrinfo_appinfo_is_multiple()
3851 static int get_app_preload(const char *appid)
3855 pkgmgrinfo_appinfo_h handle = NULL;
3856 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3857 if (ret != PMINFO_R_OK)
3859 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3860 if (ret != PMINFO_R_OK) {
3861 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3864 printf("preload: %d\n", preload);
3865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3870 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3873 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3874 * @brief This API gets the value for given application is submode or not from handle
3876 * @par This API is for package-manager client application
3877 * @par Sync (or) Async : Synchronous API
3879 * @param[in] handle pointer to application info handle
3880 * @param[out] submode pointer to hold submode is or not
3881 * @return 0 if success, error code(<0) if fail
3882 * @retval PMINFO_R_OK success
3883 * @retval PMINFO_R_EINVAL invalid argument
3884 * @retval PMINFO_R_ERROR internal error
3885 * @pre pkgmgrinfo_appinfo_get_appinfo()
3886 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3887 * @see pkgmgrinfo_appinfo_get_appid()
3888 * @see pkgmgrinfo_appinfo_is_multiple()
3890 static int get_app_submode(const char *appid)
3894 pkgmgrinfo_appinfo_h handle = NULL;
3895 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3896 if (ret != PMINFO_R_OK)
3898 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3899 if (ret != PMINFO_R_OK) {
3900 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3903 printf("submode: %d\n", submode);
3904 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3909 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3912 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3913 * @brief This API checks if the application has the given category
3915 * @par This API is for package-manager client application
3916 * @par Sync (or) Async : Synchronous API
3918 * @param[in] handle pointer to the application info handle
3919 * @param[in] category category
3920 * @param[out] exist value Gets whether the application has the given category
3921 * @return 0 if success, error code(<0) if fail
3922 * @retval PMINFO_R_OK success
3923 * @retval PMINFO_R_EINVAL invalid argument
3924 * @retval PMINFO_R_ERROR internal error
3926 static int is_category_exist(const char *appid, const char *category)
3929 pkgmgrinfo_appinfo_h handle;
3932 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3933 if (ret != PMINFO_R_OK)
3936 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3937 if (ret != PMINFO_R_OK) {
3938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3947 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3950 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3951 * @brief This API destroys the application information handle freeing up all the resources
3953 * @par This API is for package-manager client application
3954 * @par Sync (or) Async : Synchronous API
3956 * @param[in] handle pointer to the application info handle.
3957 * @return 0 if success, error code(<0) if fail
3958 * @retval PMINFO_R_OK success
3959 * @retval PMINFO_R_EINVAL invalid argument
3960 * @retval PMINFO_R_ERROR internal error
3961 * @pre pkgmgrinfo_appinfo_get_appinfo()
3963 * @see pkgmgrinfo_appinfo_get_pkgid()
3964 * @see pkgmgrinfo_appinfo_is_multiple()
3966 static int get_app_type(const char *appid)
3970 pkgmgrinfo_appinfo_h handle;
3971 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3972 if (ret != PMINFO_R_OK)
3974 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3975 if (ret != PMINFO_R_OK) {
3976 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3979 printf("apptype: %s\n", type);
3980 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3985 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3988 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3989 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3990 The query will search the entire application information collected from the manifest file of all the installed packages
3992 * @par This API is for package-manager client application
3993 * @par Sync (or) Async : Synchronous API
3995 * @param[out] handle pointer to the application info filter handle.
3996 * @return 0 if success, error code(<0) if fail
3997 * @retval PMINFO_R_OK success
3998 * @retval PMINFO_R_EINVAL invalid argument
3999 * @retval PMINFO_R_ERROR internal error
4001 * @post pkgmgrinfo_appinfo_filter_destroy()
4002 * @see pkgmgrinfo_appinfo_filter_count()
4003 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4005 static int get_capp_count()
4009 pkgmgrinfo_appinfo_filter_h handle;
4010 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4011 if (ret != PMINFO_R_OK)
4013 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4014 if (ret != PMINFO_R_OK) {
4015 pkgmgrinfo_appinfo_filter_destroy(handle);
4018 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4019 if (ret != PMINFO_R_OK) {
4020 pkgmgrinfo_appinfo_filter_destroy(handle);
4023 printf("No of capp: %d\n", count);
4024 pkgmgrinfo_appinfo_filter_destroy(handle);
4029 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4032 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4033 * @brief This API destroys the application information filter handle freeing up all the resources
4035 * @par This API is for package-manager client application
4036 * @par Sync (or) Async : Synchronous API
4038 * @param[in] handle pointer to the application info filter handle.
4039 * @return 0 if success, error code(<0) if fail
4040 * @retval PMINFO_R_OK success
4041 * @retval PMINFO_R_EINVAL invalid argument
4042 * @retval PMINFO_R_ERROR internal error
4043 * @pre pkgmgrinfo_appinfo_filter_create()
4045 * @see pkgmgrinfo_appinfo_filter_count()
4046 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4048 static int get_capp_count()
4052 pkgmgrinfo_appinfo_filter_h handle;
4053 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4054 if (ret != PMINFO_R_OK)
4056 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4057 if (ret != PMINFO_R_OK) {
4058 pkgmgrinfo_appinfo_filter_destroy(handle);
4061 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4062 if (ret != PMINFO_R_OK) {
4063 pkgmgrinfo_appinfo_filter_destroy(handle);
4066 printf("No of capp: %d\n", count);
4067 pkgmgrinfo_appinfo_filter_destroy(handle);
4072 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4075 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4076 * @brief This API adds a boolean filter property to the filter handle
4078 * @par This API is for package-manager client application
4079 * @par Sync (or) Async : Synchronous API
4081 * @param[in] handle pointer to the application info filter handle.
4082 * @param[in] property boolean property name.
4083 * @param[in] value value corresponding to the property.
4084 * @return 0 if success, error code(<0) if fail
4085 * @retval PMINFO_R_OK success
4086 * @retval PMINFO_R_EINVAL invalid argument
4087 * @retval PMINFO_R_ERROR internal error
4088 * @pre pkgmgrinfo_appinfo_filter_create()
4089 * @post pkgmgrinfo_appinfo_filter_destroy()
4090 * @see pkgmgrinfo_appinfo_filter_count()
4091 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4093 static int get_taskmanageable_app_count()
4097 pkgmgrinfo_appinfo_filter_h handle;
4098 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4099 if (ret != PMINFO_R_OK)
4101 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4102 if (ret != PMINFO_R_OK) {
4103 pkgmgrinfo_appinfo_filter_destroy(handle);
4106 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4107 if (ret != PMINFO_R_OK) {
4108 pkgmgrinfo_appinfo_filter_destroy(handle);
4111 printf("No of taskmanageable apps: %d\n", count);
4112 pkgmgrinfo_appinfo_filter_destroy(handle);
4117 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4118 const char *property, const bool value);
4121 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4122 * @brief This API adds an integer filter property to the filter handle
4124 * @par This API is for package-manager client application
4125 * @par Sync (or) Async : Synchronous API
4127 * @param[in] handle pointer to the application info filter handle.
4128 * @param[in] property integer property name.
4129 * @param[in] value value corresponding to the property.
4130 * @return 0 if success, error code(<0) if fail
4131 * @retval PMINFO_R_OK success
4132 * @retval PMINFO_R_EINVAL invalid argument
4133 * @retval PMINFO_R_ERROR internal error
4134 * @pre pkgmgrinfo_appinfo_filter_create()
4135 * @post pkgmgrinfo_appinfo_filter_destroy()
4136 * @see pkgmgrinfo_appinfo_filter_count()
4137 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4139 static int get_taskmanageable_app_count()
4143 pkgmgrinfo_appinfo_filter_h handle;
4144 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4145 if (ret != PMINFO_R_OK)
4147 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4148 if (ret != PMINFO_R_OK) {
4149 pkgmgrinfo_appinfo_filter_destroy(handle);
4152 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4153 if (ret != PMINFO_R_OK) {
4154 pkgmgrinfo_appinfo_filter_destroy(handle);
4157 printf("No of apps: %d\n", count);
4158 pkgmgrinfo_appinfo_filter_destroy(handle);
4163 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4164 const char *property, const int value);
4167 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4168 * @brief This API adds a string filter property to the filter handle
4170 * @par This API is for package-manager client application
4171 * @par Sync (or) Async : Synchronous API
4173 * @param[in] handle pointer to the application info filter handle.
4174 * @param[in] property string property name.
4175 * @param[in] value value corresponding to the property.
4176 * @return 0 if success, error code(<0) if fail
4177 * @retval PMINFO_R_OK success
4178 * @retval PMINFO_R_EINVAL invalid argument
4179 * @retval PMINFO_R_ERROR internal error
4180 * @pre pkgmgrinfo_appinfo_filter_create()
4181 * @post pkgmgrinfo_appinfo_filter_destroy()
4182 * @see pkgmgrinfo_appinfo_filter_count()
4183 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4185 static int get_capp_count()
4189 pkgmgrinfo_appinfo_filter_h handle;
4190 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4191 if (ret != PMINFO_R_OK)
4193 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4194 if (ret != PMINFO_R_OK) {
4195 pkgmgrinfo_appinfo_filter_destroy(handle);
4198 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4199 if (ret != PMINFO_R_OK) {
4200 pkgmgrinfo_appinfo_filter_destroy(handle);
4203 printf("No of capp: %d\n", count);
4204 pkgmgrinfo_appinfo_filter_destroy(handle);
4209 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4210 const char *property, const char *value);
4213 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4214 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4216 * @par This API is for package-manager client application
4217 * @par Sync (or) Async : Synchronous API
4219 * @param[in] handle pointer to the application info filter handle.
4220 * @param[in] app_cb callback function.
4221 * @param[in] user_data user data to be passed to the callback function
4222 * @return 0 if success, error code(<0) if fail
4223 * @retval PMINFO_R_OK success
4224 * @retval PMINFO_R_EINVAL invalid argument
4225 * @retval PMINFO_R_ERROR internal error
4226 * @pre pkgmgrinfo_appinfo_filter_create()
4227 * @post pkgmgrinfo_appinfo_filter_destroy()
4228 * @see pkgmgrinfo_appinfo_filter_count()
4230 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4233 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4234 printf("appid : %s\n", appid);
4238 static int get_capp_list()
4241 pkgmgrinfo_appinfo_filter_h handle;
4242 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4243 if (ret != PMINFO_R_OK)
4245 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4246 if (ret != PMINFO_R_OK) {
4247 pkgmgrinfo_appinfo_filter_destroy(handle);
4250 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4251 if (ret != PMINFO_R_OK) {
4252 pkgmgrinfo_appinfo_filter_destroy(handle);
4255 pkgmgrinfo_appinfo_filter_destroy(handle);
4260 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4261 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4262 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4263 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4266 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4267 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4268 * @brief This API counts the application that satisfy the filter conditions
4270 * @par This API is for package-manager client application
4271 * @par Sync (or) Async : Synchronous API
4273 * @param[in] handle pointer to the application info filter handle.
4274 * @param[in] count pointer to store count value
4275 * @param[in] uid the addressee user id of the instruction
4276 * @return 0 if success, error code(<0) if fail
4277 * @retval PMINFO_R_OK success
4278 * @retval PMINFO_R_EINVAL invalid argument
4279 * @retval PMINFO_R_ERROR internal error
4280 * @pre pkgmgrinfo_appinfo_filter_create()
4281 * @post pkgmgrinfo_appinfo_filter_destroy()
4282 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4284 static int get_capp_count()
4288 pkgmgrinfo_appinfo_filter_h handle;
4289 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4290 if (ret != PMINFO_R_OK)
4292 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4293 if (ret != PMINFO_R_OK) {
4294 pkgmgrinfo_appinfo_filter_destroy(handle);
4297 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4298 if (ret != PMINFO_R_OK) {
4299 pkgmgrinfo_appinfo_filter_destroy(handle);
4302 printf("No of capp: %d\n", count);
4303 pkgmgrinfo_appinfo_filter_destroy(handle);
4308 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4309 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4311 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4312 * @brief This API creates the application's metadata information filter handle from db.
4314 * @par This API is for package-manager client application
4315 * @par Sync (or) Async : Synchronous API
4317 * @param[out] handle pointer to the application metadata info filter handle.
4318 * @return 0 if success, error code(<0) if fail
4319 * @retval PMINFO_R_OK success
4320 * @retval PMINFO_R_EINVAL invalid argument
4321 * @retval PMINFO_R_ERROR internal error
4323 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4324 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4326 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4329 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4330 printf("appid : %s\n", appid);
4334 static int get_app_list(const char *mkey, const char *mvalue)
4337 pkgmgrinfo_appinfo_metadata_filter_h handle;
4338 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4339 if (ret != PMINFO_R_OK)
4341 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4342 if (ret != PMINFO_R_OK) {
4343 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4346 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4347 if (ret != PMINFO_R_OK) {
4348 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4351 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4356 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4359 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4360 * @brief This API destroys the application's metadata information filter handle.
4362 * @par This API is for package-manager client application
4363 * @par Sync (or) Async : Synchronous API
4365 * @param[in] handle pointer to the application metadata info filter handle.
4366 * @return 0 if success, error code(<0) if fail
4367 * @retval PMINFO_R_OK success
4368 * @retval PMINFO_R_EINVAL invalid argument
4369 * @retval PMINFO_R_ERROR internal error
4370 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4372 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4374 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4377 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4378 printf("appid : %s\n", appid);
4382 static int get_app_list(const char *mkey, const char *mvalue)
4385 pkgmgrinfo_appinfo_metadata_filter_h handle;
4386 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4387 if (ret != PMINFO_R_OK)
4389 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4390 if (ret != PMINFO_R_OK) {
4391 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4394 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4395 if (ret != PMINFO_R_OK) {
4396 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4399 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4404 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4407 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4408 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4409 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4411 * @par This API is for package-manager client application
4412 * @par Sync (or) Async : Synchronous API
4414 * @param[in] handle pointer to the application metadata info filter handle.
4415 * @param[in] key pointer to metadata key
4416 * @param[in] value pointer to metadata value
4417 * @return 0 if success, error code(<0) if fail
4418 * @retval PMINFO_R_OK success
4419 * @retval PMINFO_R_EINVAL invalid argument
4420 * @retval PMINFO_R_ERROR internal error
4421 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4422 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4423 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4425 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4428 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4429 printf("appid : %s\n", appid);
4433 static int get_app_list(const char *mkey, const char *mvalue)
4436 pkgmgrinfo_appinfo_metadata_filter_h handle;
4437 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4438 if (ret != PMINFO_R_OK)
4440 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4441 if (ret != PMINFO_R_OK) {
4442 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4445 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4446 if (ret != PMINFO_R_OK) {
4447 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4450 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4455 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4456 const char *key, const char *value);
4459 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4460 * @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)
4461 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4462 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4463 * negative value, no more callbacks will be called and API will return.
4465 * @par This API is for package-manager client application
4466 * @par Sync (or) Async : Synchronous API
4468 * @param[in] handle pointer to the application metadata info filter handle.
4469 * @param[in] app_cb function pointer to callback
4470 * @param[in] user_data pointer to user data
4471 * @param[in] uid the addressee user id of the instruction
4472 * @return 0 if success, error code(<0) if fail
4473 * @retval PMINFO_R_OK success
4474 * @retval PMINFO_R_EINVAL invalid argument
4475 * @retval PMINFO_R_ERROR internal error
4476 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4477 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4479 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4482 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4483 printf("appid : %s\n", appid);
4487 static int get_app_list(const char *mkey, const char *mvalue)
4490 pkgmgrinfo_appinfo_metadata_filter_h handle;
4491 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4492 if (ret != PMINFO_R_OK)
4494 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4495 if (ret != PMINFO_R_OK) {
4496 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4499 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4500 if (ret != PMINFO_R_OK) {
4501 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4504 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4509 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4510 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4511 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4512 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4514 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4515 * @brief This API creates the package cert information handle to get data from db.
4517 * @par This API is for package-manager client application
4518 * @par Sync (or) Async : Synchronous API
4520 * @param[out] handle pointer to the package cert handle.
4521 * @return 0 if success, error code(<0) if fail
4522 * @retval PMINFO_R_OK success
4523 * @retval PMINFO_R_EINVAL invalid argument
4524 * @retval PMINFO_R_ERROR internal error
4526 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4527 * @see pkgmgrinfo_pkginfo_get_cert_value()
4528 * @see pkgmgrinfo_pkginfo_load_certinfo()
4530 static int get_cert_info(const char *pkgid)
4533 pkgmgrinfo_certinfo_h handle;
4534 char *auth_cert = NULL;
4535 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4536 if (ret != PMINFO_R_OK)
4538 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4539 if (ret != PMINFO_R_OK) {
4540 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4543 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4544 if (ret != PMINFO_R_OK) {
4545 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4548 printf("Author root certificate: %s\n", auth_root);
4549 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4554 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4557 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4558 * @brief This API loads the package cert information handle with data from db.
4560 * @par This API is for package-manager client application
4561 * @par Sync (or) Async : Synchronous API
4563 * @param[in] pkgid pointer to the package ID.
4564 * @param[in] handle pointer to the package cert handle.
4565 * @return 0 if success, error code(<0) if fail
4566 * @retval PMINFO_R_OK success
4567 * @retval PMINFO_R_EINVAL invalid argument
4568 * @retval PMINFO_R_ERROR internal error
4569 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4570 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4571 * @see pkgmgrinfo_pkginfo_get_cert_value()
4573 static int get_cert_info(const char *pkgid)
4576 pkgmgrinfo_certinfo_h handle;
4577 char *auth_cert = NULL;
4578 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4579 if (ret != PMINFO_R_OK)
4581 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4582 if (ret != PMINFO_R_OK) {
4583 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4586 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4587 if (ret != PMINFO_R_OK) {
4588 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4591 printf("Author root certificate: %s\n", auth_root);
4592 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4597 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4600 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4601 * @brief This API gets the package cert information from the handle
4603 * @par This API is for package-manager client application
4604 * @par Sync (or) Async : Synchronous API
4606 * @param[in] handle pointer to the package cert handle.
4607 * @param[in] cert_type certificate type
4608 * @param[out] cert_value pointer to hold certificate value
4609 * @return 0 if success, error code(<0) if fail
4610 * @retval PMINFO_R_OK success
4611 * @retval PMINFO_R_EINVAL invalid argument
4612 * @retval PMINFO_R_ERROR internal error
4613 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4614 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4615 * @see pkgmgrinfo_pkginfo_load_certinfo()
4617 static int get_cert_info(const char *pkgid)
4620 pkgmgrinfo_certinfo_h handle;
4621 char *auth_cert = NULL;
4622 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4623 if (ret != PMINFO_R_OK)
4625 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4626 if (ret != PMINFO_R_OK) {
4627 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4630 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4631 if (ret != PMINFO_R_OK) {
4632 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4635 printf("Author root certificate: %s\n", auth_root);
4636 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4641 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4644 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4645 * @brief This API destroys the package cert information handle freeing up all the resources
4647 * @par This API is for package-manager client application
4648 * @par Sync (or) Async : Synchronous API
4650 * @param[in] handle pointer to the package cert handle.
4651 * @return 0 if success, error code(<0) if fail
4652 * @retval PMINFO_R_OK success
4653 * @retval PMINFO_R_EINVAL invalid argument
4654 * @retval PMINFO_R_ERROR internal error
4655 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4657 * @see pkgmgrinfo_pkginfo_load_certinfo()
4659 static int get_cert_info(const char *pkgid)
4662 pkgmgrinfo_certinfo_h handle;
4663 char *auth_cert = NULL;
4664 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4665 if (ret != PMINFO_R_OK)
4667 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4668 if (ret != PMINFO_R_OK) {
4669 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4672 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4673 if (ret != PMINFO_R_OK) {
4674 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4677 printf("Author root certificate: %s\n", auth_root);
4678 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4683 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4686 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4687 * @brief This API deletes the package cert information from DB
4689 * @par This API is for package-manager client application
4690 * @par Sync (or) Async : Synchronous API
4692 * @param[in] pkgid pointer to the package ID.
4693 * @return 0 if success, error code(<0) if fail
4694 * @retval PMINFO_R_OK success
4695 * @retval PMINFO_R_EINVAL invalid argument
4696 * @retval PMINFO_R_ERROR internal error
4700 static int delete_cert_info(const char *pkgid)
4703 ret = pkgmgrinfo_delete_certinfo(pkgid);
4704 if (ret != PMINFO_R_OK)
4710 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4711 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4713 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4714 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4715 * @brief This API creates the package db information handle to set data in db.
4717 * @par This API is for package-manager client application
4718 * @par Sync (or) Async : Synchronous API
4720 * @param[in] pkgid pointer to the package ID.
4721 * @param[in] uid the addressee user id of the instruction
4722 * @param[out] handle pointer to the package db info handle.
4723 * @return 0 if success, error code(<0) if fail
4724 * @retval PMINFO_R_OK success
4725 * @retval PMINFO_R_EINVAL invalid argument
4726 * @retval PMINFO_R_ERROR internal error
4728 * @post pkgmgrinfo_destroy_pkgdbinfo()
4729 * @see pkgmgrinfo_save_pkgdbinfo()
4730 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4732 static int set_pkg_in_db(const char *pkgid)
4735 pkgmgrinfo_pkgdbinfo_h handle;
4736 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4737 if (ret != PMINFO_R_OK)
4739 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4740 if (ret != PMINFO_R_OK) {
4741 pkgmgrinfo_destroy_pkgdbinfo(handle);
4744 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4745 if (ret != PMINFO_R_OK) {
4746 pkgmgrinfo_destroy_pkgdbinfo(handle);
4749 pkgmgrinfo_destroy_pkgdbinfo(handle);
4754 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4755 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4758 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4759 * @brief This API sets the package type in db handle
4761 * @par This API is for package-manager client application
4762 * @par Sync (or) Async : Synchronous API
4764 * @param[in] handle pointer to the pkgdbinfo handle.
4765 * @param[in] type pointer to the package type.
4766 * @return 0 if success, error code(<0) if fail
4767 * @retval PMINFO_R_OK success
4768 * @retval PMINFO_R_EINVAL invalid argument
4769 * @retval PMINFO_R_ERROR internal error
4770 * @pre pkgmgrinfo_create_pkgdbinfo()
4771 * @post pkgmgrinfo_destroy_pkgdbinfo()
4772 * @see pkgmgrinfo_save_pkgdbinfo()
4773 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4775 static int set_pkg_type_in_db(const char *pkgid)
4778 pkgmgrinfo_pkgdbinfo_h handle;
4779 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4780 if (ret != PMINFO_R_OK)
4782 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4783 if (ret != PMINFO_R_OK) {
4784 pkgmgrinfo_destroy_pkgdbinfo(handle);
4787 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4788 if (ret != PMINFO_R_OK) {
4789 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 pkgmgrinfo_destroy_pkgdbinfo(handle);
4797 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4800 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4801 * @brief This API sets the package version in db handle
4803 * @par This API is for package-manager client application
4804 * @par Sync (or) Async : Synchronous API
4806 * @param[in] handle pointer to the pkgdbinfo handle.
4807 * @param[in] version pointer to the package version
4808 * @return 0 if success, error code(<0) if fail
4809 * @retval PMINFO_R_OK success
4810 * @retval PMINFO_R_EINVAL invalid argument
4811 * @retval PMINFO_R_ERROR internal error
4812 * @pre pkgmgrinfo_create_pkgdbinfo()
4813 * @post pkgmgrinfo_destroy_pkgdbinfo()
4814 * @see pkgmgrinfo_save_pkgdbinfo()
4815 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4817 static int set_pkg_version_in_db(const char *pkgid)
4820 pkgmgrinfo_pkgdbinfo_h handle;
4821 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4822 if (ret != PMINFO_R_OK)
4824 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4825 if (ret != PMINFO_R_OK) {
4826 pkgmgrinfo_destroy_pkgdbinfo(handle);
4829 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4830 if (ret != PMINFO_R_OK) {
4831 pkgmgrinfo_destroy_pkgdbinfo(handle);
4834 pkgmgrinfo_destroy_pkgdbinfo(handle);
4839 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4842 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4843 * @brief This API sets the package install location in db handle
4845 * @par This API is for package-manager client application
4846 * @par Sync (or) Async : Synchronous API
4848 * @param[in] handle pointer to the pkgdbinfo handle.
4849 * @param[in] location package install location
4850 * @return 0 if success, error code(<0) if fail
4851 * @retval PMINFO_R_OK success
4852 * @retval PMINFO_R_EINVAL invalid argument
4853 * @retval PMINFO_R_ERROR internal error
4854 * @pre pkgmgrinfo_create_pkgdbinfo()
4855 * @post pkgmgrinfo_destroy_pkgdbinfo()
4856 * @see pkgmgrinfo_save_pkgdbinfo()
4857 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4859 static int set_pkg_install_location_in_db(const char *pkgid)
4862 pkgmgrinfo_pkgdbinfo_h handle;
4863 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4864 if (ret != PMINFO_R_OK)
4866 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4867 if (ret != PMINFO_R_OK) {
4868 pkgmgrinfo_destroy_pkgdbinfo(handle);
4871 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4872 if (ret != PMINFO_R_OK) {
4873 pkgmgrinfo_destroy_pkgdbinfo(handle);
4876 pkgmgrinfo_destroy_pkgdbinfo(handle);
4881 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4884 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4885 * @brief This API sets the package size in db handle
4887 * @par This API is for package-manager client application
4888 * @par Sync (or) Async : Synchronous API
4890 * @param[in] handle pointer to the pkgdbinfo handle.
4891 * @param[in] size pointer to the package size
4892 * @return 0 if success, error code(<0) if fail
4893 * @retval PMINFO_R_OK success
4894 * @retval PMINFO_R_EINVAL invalid argument
4895 * @retval PMINFO_R_ERROR internal error
4896 * @pre pkgmgrinfo_create_pkgdbinfo()
4897 * @post pkgmgrinfo_destroy_pkgdbinfo()
4898 * @see pkgmgrinfo_save_pkgdbinfo()
4899 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4901 static int set_pkg_size_in_db(const char *pkgid)
4904 pkgmgrinfo_pkgdbinfo_h handle;
4905 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4906 if (ret != PMINFO_R_OK)
4908 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4909 if (ret != PMINFO_R_OK) {
4910 pkgmgrinfo_destroy_pkgdbinfo(handle);
4913 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4914 if (ret != PMINFO_R_OK) {
4915 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 pkgmgrinfo_destroy_pkgdbinfo(handle);
4923 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4926 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4927 * @brief This API sets the package label in db handle
4929 * @par This API is for package-manager client application
4930 * @par Sync (or) Async : Synchronous API
4932 * @param[in] handle pointer to the pkgdbinfo handle.
4933 * @param[in] label pointer to the package label
4934 * @param[in] locale pointer to the locale
4935 * @return 0 if success, error code(<0) if fail
4936 * @retval PMINFO_R_OK success
4937 * @retval PMINFO_R_EINVAL invalid argument
4938 * @retval PMINFO_R_ERROR internal error
4939 * @pre pkgmgrinfo_create_pkgdbinfo()
4940 * @post pkgmgrinfo_destroy_pkgdbinfo()
4941 * @see pkgmgrinfo_save_pkgdbinfo()
4942 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4944 static int set_pkg_label_in_db(const char *pkgid)
4947 pkgmgrinfo_pkgdbinfo_h handle;
4948 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_destroy_pkgdbinfo(handle);
4956 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_destroy_pkgdbinfo(handle);
4961 pkgmgrinfo_destroy_pkgdbinfo(handle);
4966 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4969 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4970 * @brief This API sets the package icon in db handle
4972 * @par This API is for package-manager client application
4973 * @par Sync (or) Async : Synchronous API
4975 * @param[in] handle pointer to the pkgdbinfo handle.
4976 * @param[in] icon pointer to the package icon
4977 * @param[in] locale pointer to the locale
4978 * @return 0 if success, error code(<0) if fail
4979 * @retval PMINFO_R_OK success
4980 * @retval PMINFO_R_EINVAL invalid argument
4981 * @retval PMINFO_R_ERROR internal error
4982 * @pre pkgmgrinfo_create_pkgdbinfo()
4983 * @post pkgmgrinfo_destroy_pkgdbinfo()
4984 * @see pkgmgrinfo_save_pkgdbinfo()
4985 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4987 static int set_pkg_icon_in_db(const char *pkgid)
4990 pkgmgrinfo_pkgdbinfo_h handle;
4991 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4992 if (ret != PMINFO_R_OK)
4994 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4995 if (ret != PMINFO_R_OK) {
4996 pkgmgrinfo_destroy_pkgdbinfo(handle);
4999 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5000 if (ret != PMINFO_R_OK) {
5001 pkgmgrinfo_destroy_pkgdbinfo(handle);
5004 pkgmgrinfo_destroy_pkgdbinfo(handle);
5009 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5012 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5013 * @brief This API sets the package description in db handle
5015 * @par This API is for package-manager client application
5016 * @par Sync (or) Async : Synchronous API
5018 * @param[in] handle pointer to the pkgdbinfo handle.
5019 * @param[in] description pointer to the package description
5020 * @param[in] locale pointer to the locale
5021 * @return 0 if success, error code(<0) if fail
5022 * @retval PMINFO_R_OK success
5023 * @retval PMINFO_R_EINVAL invalid argument
5024 * @retval PMINFO_R_ERROR internal error
5025 * @pre pkgmgrinfo_create_pkgdbinfo()
5026 * @post pkgmgrinfo_destroy_pkgdbinfo()
5027 * @see pkgmgrinfo_save_pkgdbinfo()
5028 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5030 static int set_pkg_description_in_db(const char *pkgid)
5033 pkgmgrinfo_pkgdbinfo_h handle;
5034 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5035 if (ret != PMINFO_R_OK)
5037 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5038 if (ret != PMINFO_R_OK) {
5039 pkgmgrinfo_destroy_pkgdbinfo(handle);
5042 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5043 if (ret != PMINFO_R_OK) {
5044 pkgmgrinfo_destroy_pkgdbinfo(handle);
5047 pkgmgrinfo_destroy_pkgdbinfo(handle);
5052 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5055 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5056 const char *author_email, const char *author_href, const char *locale)
5057 * @brief This API sets the package author info in db handle
5059 * @par This API is for package-manager client application
5060 * @par Sync (or) Async : Synchronous API
5062 * @param[in] handle pointer to the pkgdbinfo handle.
5063 * @param[in] author_name pointer to the package author name
5064 * @param[in] author_email pointer to the package author email
5065 * @param[in] author_href pointer to the package author href
5066 * @param[in] locale pointer to the locale
5067 * @return 0 if success, error code(<0) if fail
5068 * @retval PMINFO_R_OK success
5069 * @retval PMINFO_R_EINVAL invalid argument
5070 * @retval PMINFO_R_ERROR internal error
5071 * @pre pkgmgrinfo_create_pkgdbinfo()
5072 * @post pkgmgrinfo_destroy_pkgdbinfo()
5073 * @see pkgmgrinfo_save_pkgdbinfo()
5074 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5076 static int set_pkg_author_in_db(const char *pkgid)
5079 pkgmgrinfo_pkgdbinfo_h handle;
5080 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5081 if (ret != PMINFO_R_OK)
5083 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5084 if (ret != PMINFO_R_OK) {
5085 pkgmgrinfo_destroy_pkgdbinfo(handle);
5088 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5089 if (ret != PMINFO_R_OK) {
5090 pkgmgrinfo_destroy_pkgdbinfo(handle);
5093 pkgmgrinfo_destroy_pkgdbinfo(handle);
5098 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5099 const char *author_email, const char *author_href, const char *locale);
5102 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5103 * @brief This API sets the package 'removable' value in db handle
5105 * @par This API is for package-manager client application
5106 * @par Sync (or) Async : Synchronous API
5108 * @param[in] handle pointer to the pkgdbinfo handle.
5109 * @param[in] removable package removable value
5110 * @return 0 if success, error code(<0) if fail
5111 * @retval PMINFO_R_OK success
5112 * @retval PMINFO_R_EINVAL invalid argument
5113 * @retval PMINFO_R_ERROR internal error
5114 * @pre pkgmgrinfo_create_pkgdbinfo()
5115 * @post pkgmgrinfo_destroy_pkgdbinfo()
5116 * @see pkgmgrinfo_save_pkgdbinfo()
5117 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5119 static int set_pkg_removable_in_db(const char *pkgid)
5122 pkgmgrinfo_pkgdbinfo_h handle;
5123 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5124 if (ret != PMINFO_R_OK)
5126 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5127 if (ret != PMINFO_R_OK) {
5128 pkgmgrinfo_destroy_pkgdbinfo(handle);
5131 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5132 if (ret != PMINFO_R_OK) {
5133 pkgmgrinfo_destroy_pkgdbinfo(handle);
5136 pkgmgrinfo_destroy_pkgdbinfo(handle);
5141 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5144 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5145 * @brief This API sets the package 'preload' value in db handle
5147 * @par This API is for package-manager client application
5148 * @par Sync (or) Async : Synchronous API
5150 * @param[in] handle pointer to the pkgdbinfo handle.
5151 * @param[in] preload package preload value
5152 * @return 0 if success, error code(<0) if fail
5153 * @retval PMINFO_R_OK success
5154 * @retval PMINFO_R_EINVAL invalid argument
5155 * @retval PMINFO_R_ERROR internal error
5156 * @pre pkgmgrinfo_create_pkgdbinfo()
5157 * @post pkgmgrinfo_destroy_pkgdbinfo()
5158 * @see pkgmgrinfo_save_pkgdbinfo()
5159 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5161 static int set_pkg_preload_in_db(const char *pkgid)
5164 pkgmgrinfo_pkgdbinfo_h handle;
5165 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5166 if (ret != PMINFO_R_OK)
5168 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5169 if (ret != PMINFO_R_OK) {
5170 pkgmgrinfo_destroy_pkgdbinfo(handle);
5173 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5174 if (ret != PMINFO_R_OK) {
5175 pkgmgrinfo_destroy_pkgdbinfo(handle);
5178 pkgmgrinfo_destroy_pkgdbinfo(handle);
5183 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5186 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5187 * @brief This API sets the package 'installed_storage' value in db handle
5189 * @par This API is for package-manager client application
5190 * @par Sync (or) Async : Synchronous API
5192 * @param[in] handle pointer to the pkgdbinfo handle.
5193 * @param[in] location installed_storage value
5194 * @return 0 if success, error code(<0) if fail
5195 * @retval PMINFO_R_OK success
5196 * @retval PMINFO_R_EINVAL invalid argument
5197 * @retval PMINFO_R_ERROR internal error
5198 * @pre pkgmgrinfo_create_pkgdbinfo()
5199 * @post pkgmgrinfo_destroy_pkgdbinfo()
5200 * @see pkgmgrinfo_save_pkgdbinfo()
5202 static int set_pkg_installed_storage_in_db(const char *pkgid)
5205 pkgmgrinfo_pkgdbinfo_h handle;
5206 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5207 if (ret != PMINFO_R_OK)
5209 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5210 if (ret != PMINFO_R_OK) {
5211 pkgmgrinfo_destroy_pkgdbinfo(handle);
5214 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5215 if (ret != PMINFO_R_OK) {
5216 pkgmgrinfo_destroy_pkgdbinfo(handle);
5219 pkgmgrinfo_destroy_pkgdbinfo(handle);
5224 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5227 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5228 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5229 * @brief This API saves all the information from the handle to the DB.
5231 * @par This API is for package-manager client application
5232 * @par Sync (or) Async : Synchronous API
5234 * @param[in] handle pointer to the package db info handle.
5235 * @param[in] uid the addressee user id of the instruction
5236 * @return 0 if success, error code(<0) if fail
5237 * @retval PMINFO_R_OK success
5238 * @retval PMINFO_R_EINVAL invalid argument
5239 * @retval PMINFO_R_ERROR internal error
5240 * @pre pkgmgrinfo_create_pkgdbinfo()
5241 * @post pkgmgrinfo_destroy_pkgdbinfo()
5242 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5244 static int set_pkg_in_db(const char *pkgid)
5247 pkgmgrinfo_pkgdbinfo_h handle;
5248 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5249 if (ret != PMINFO_R_OK)
5251 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5252 if (ret != PMINFO_R_OK) {
5253 pkgmgrinfo_destroy_pkgdbinfo(handle);
5256 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5257 if (ret != PMINFO_R_OK) {
5258 pkgmgrinfo_destroy_pkgdbinfo(handle);
5261 pkgmgrinfo_destroy_pkgdbinfo(handle);
5266 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5267 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5269 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5270 * @brief This API destroys the package db information handle freeing up all the resources
5272 * @par This API is for package-manager client application
5273 * @par Sync (or) Async : Synchronous API
5275 * @param[in] handle pointer to the package db info handle.
5276 * @return 0 if success, error code(<0) if fail
5277 * @retval PMINFO_R_OK success
5278 * @retval PMINFO_R_EINVAL invalid argument
5279 * @retval PMINFO_R_ERROR internal error
5280 * @pre pkgmgrinfo_create_pkgdbinfo()
5282 * @see pkgmgrinfo_save_pkgdbinfo()
5283 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5285 static int set_pkg_in_db(const char *pkgid)
5288 pkgmgrinfo_pkgdbinfo_h handle;
5289 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5290 if (ret != PMINFO_R_OK)
5292 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5293 if (ret != PMINFO_R_OK) {
5294 pkgmgrinfo_destroy_pkgdbinfo(handle);
5297 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5298 if (ret != PMINFO_R_OK) {
5299 pkgmgrinfo_destroy_pkgdbinfo(handle);
5302 pkgmgrinfo_destroy_pkgdbinfo(handle);
5307 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5311 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5312 * @brief This API creates the package cert information handle to set data in db.
5314 * @par This API is for package-manager client application
5315 * @par Sync (or) Async : Synchronous API
5317 * @param[out] handle pointer to the package cert handle.
5318 * @return 0 if success, error code(<0) if fail
5319 * @retval PMINFO_R_OK success
5320 * @retval PMINFO_R_EINVAL invalid argument
5321 * @retval PMINFO_R_ERROR internal error
5323 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5324 * @see pkgmgrinfo_set_cert_value()
5325 * @see pkgmgrinfo_save_certinfo()
5327 static int set_cert_in_db(const char *pkgid)
5330 pkgmgrinfo_instcertinfo_h handle;
5331 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5332 if (ret != PMINFO_R_OK)
5334 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5335 if (ret != PMINFO_R_OK) {
5336 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5339 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5340 if (ret != PMINFO_R_OK) {
5341 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5344 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5349 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5352 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5353 * @brief This API sets the package cert information in the handle.
5355 * @par This API is for package-manager client application
5356 * @par Sync (or) Async : Synchronous API
5358 * @param[in] handle pointer to the package cert handle.
5359 * @param[in] cert_type certificate type.
5360 * @param[in] cert_value certificate value.
5361 * @return 0 if success, error code(<0) if fail
5362 * @retval PMINFO_R_OK success
5363 * @retval PMINFO_R_EINVAL invalid argument
5364 * @retval PMINFO_R_ERROR internal error
5365 * @pre pkgmgrinfo_create_certinfo_set_handle()
5366 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5367 * @see pkgmgrinfo_save_certinfo()
5369 static int set_cert_in_db(const char *pkgid)
5372 pkgmgrinfo_instcertinfo_h handle;
5373 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5374 if (ret != PMINFO_R_OK)
5376 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5377 if (ret != PMINFO_R_OK) {
5378 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5381 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5382 if (ret != PMINFO_R_OK) {
5383 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5386 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5391 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5394 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5395 * @brief This API saves the package cert information in the DB.
5397 * @par This API is for package-manager client application
5398 * @par Sync (or) Async : Synchronous API
5400 * @param[in] pkgid pointer to the package ID.
5401 * @param[in] handle pointer to the package cert handle.
5402 * @return 0 if success, error code(<0) if fail
5403 * @retval PMINFO_R_OK success
5404 * @retval PMINFO_R_EINVAL invalid argument
5405 * @retval PMINFO_R_ERROR internal error
5406 * @pre pkgmgrinfo_create_certinfo_set_handle()
5407 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5408 * @see pkgmgrinfo_save_certinfo()
5410 static int set_cert_in_db(const char *pkgid)
5413 pkgmgrinfo_instcertinfo_h handle;
5414 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5415 if (ret != PMINFO_R_OK)
5417 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5418 if (ret != PMINFO_R_OK) {
5419 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5422 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5423 if (ret != PMINFO_R_OK) {
5424 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5427 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5432 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5435 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5436 * @brief This API destroys the package cert information handle freeing up all the resources.
5438 * @par This API is for package-manager client application
5439 * @par Sync (or) Async : Synchronous API
5441 * @param[in] handle pointer to the package cert handle.
5442 * @return 0 if success, error code(<0) if fail
5443 * @retval PMINFO_R_OK success
5444 * @retval PMINFO_R_EINVAL invalid argument
5445 * @retval PMINFO_R_ERROR internal error
5446 * @pre pkgmgrinfo_create_certinfo_set_handle()
5448 * @see pkgmgrinfo_save_certinfo()
5450 static int set_cert_in_db(const char *pkgid)
5453 pkgmgrinfo_instcertinfo_h handle;
5454 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5455 if (ret != PMINFO_R_OK)
5457 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5458 if (ret != PMINFO_R_OK) {
5459 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5462 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5463 if (ret != PMINFO_R_OK) {
5464 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5467 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5472 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5475 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5476 * @brief This API gets the datacontrol info
5478 * @par This API is for package-manager client application
5479 * @par Sync (or) Async : Synchronous API
5481 * @param[in] providerid pointer to the providerid of dataconltrol.
5482 * @param[in] type pointer to the type of dataconltrol.
5483 * @param[out] appid pointer to hold appid, need to free after using
5484 * @param[out] access pointer to hold access, need to free after using
5485 * @return 0 if success, error code(<0) if fail
5486 * @retval PMINFO_R_OK success
5487 * @retval PMINFO_R_EINVAL invalid argument
5488 * @retval PMINFO_R_ERROR internal error
5491 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5494 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5495 * @brief This API gets the application 'guest mode visibility' value from the DB
5497 * @par This API is for package-manager client application
5498 * @par Sync (or) Async : Synchronous API
5500 * @param[in] handle pointer to application info handle
5501 * @param[out] status pointer to hold app guest mode visibility value
5502 * @return 0 if success, error code(<0) if fail
5503 * @retval PMINFO_R_OK success
5504 * @retval PMINFO_R_EINVAL invalid argument
5505 * @retval PMINFO_R_ERROR internal error
5506 * @pre pkgmgrinfo_appinfo_get_appinfo()
5507 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5508 * @see pkgmgrinfo_appinfo_get_appid()
5509 * @see pkgmgrinfo_appinfo_is_multiple()
5511 static int get_app_guestmode_visibility(const char *appid)
5515 pkgmgrinfo_appinfo_h handle;
5516 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5517 if (ret != PMINFO_R_OK)
5519 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5520 if (ret != PMINFO_R_OK) {
5521 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5524 printf("app guest mode visibility: %d\n", status);
5525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5530 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5533 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5534 * @brief This API sets the application 'guest mode visibility' value in the DB
5536 * @par This API is for package-manager client application
5537 * @par Sync (or) Async : Synchronous API
5539 * @param[in] handle pointer to application info handle
5540 * @param[out] status app guest mode visibility value
5541 * @return 0 if success, error code(<0) if fail
5542 * @retval PMINFO_R_OK success
5543 * @retval PMINFO_R_EINVAL invalid argument
5544 * @retval PMINFO_R_ERROR internal error
5545 * @pre pkgmgrinfo_appinfo_get_appinfo()
5546 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5547 * @see pkgmgrinfo_appinfo_get_appid()
5548 * @see pkgmgrinfo_appinfo_is_multiple()
5550 static int set_app_guestmode_visibility(const char *appid, bool value)
5553 pkgmgrinfo_appinfo_h handle;
5554 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5555 if (ret != PMINFO_R_OK)
5557 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5558 if (ret != PMINFO_R_OK) {
5559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5567 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5568 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5570 * @pkgmgrinfo client API
5574 * @brief listening status type in pkgmgrinfo.
5576 #define PMINFO_CLIENT_STATUS_ALL 0x00
5577 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5578 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5579 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5580 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5581 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5582 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5585 * @brief type definition.
5587 typedef void pkgmgrinfo_client;
5588 typedef int (*pkgmgrinfo_handler)(uid_t target_uid, int req_id, const char *pkg_type,
5589 const char *pkgid, const char *key,
5590 const char *val, const void *pmsg, void *data);
5596 }pkgmgrinfo_client_type;
5599 * @brief This APIs provides pkgmgrinfo client listener
5601 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5602 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5603 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5604 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5605 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5609 * @pkgmgrinfo client API end
5617 #endif /* __PKG_INFO_H__ */