4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 * @brief A handle to insert certificate information
79 typedef void* pkgmgrinfo_instcertinfo_h;
82 * @brief Certificate Types to be used for setting information
85 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
86 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
87 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
88 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
89 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
90 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
91 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
92 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
93 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
94 }pkgmgrinfo_instcert_type;
97 PMINFO_CERT_COMPARE_MATCH,
98 PMINFO_CERT_COMPARE_MISMATCH,
99 PMINFO_CERT_COMPARE_LHS_NO_CERT,
100 PMINFO_CERT_COMPARE_RHS_NO_CERT,
101 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
102 PMINFO_CERT_COMPARE_ERROR,
103 } pkgmgrinfo_cert_compare_result_type_e;
106 * @brief API return values
109 PMINFO_R_EINVAL = -2, /**< Invalid argument */
110 PMINFO_R_ERROR = -1, /**< General error */
111 PMINFO_R_OK = 0 /**< General success */
115 * @brief Value to be used when filtering based on install location
117 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
120 * @brief Value to be used when filtering based on install location
122 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
125 * @brief Value to be used when filtering based on install location
127 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
130 * @brief Value to be used when filtering based on app-component
132 #define PMINFO_APPINFO_UI_APP "UI_APP"
135 * @brief Value to be used when filtering based on app-component
137 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
140 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
141 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
142 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
143 }pkgmgrinfo_app_hwacceleration;
146 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
147 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
148 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
149 }pkgmgrinfo_app_screenreader;
152 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
153 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
154 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
155 }pkgmgrinfo_app_recentimage;
158 * @brief A handle to get package information
160 typedef void* pkgmgrinfo_pkginfo_h;
163 * @brief A handle to get application information
165 typedef void* pkgmgrinfo_appinfo_h;
168 * @brief A handle to get certificate information
170 typedef void* pkgmgrinfo_certinfo_h;
173 * @brief A handle to insert package information
175 typedef void* pkgmgrinfo_pkgdbinfo_h;
178 * @brief A handle to filter package information
180 typedef void* pkgmgrinfo_pkginfo_filter_h;
183 * @brief A handle to filter application information
185 typedef void* pkgmgrinfo_appinfo_filter_h;
188 * @brief A handle to filter application metadata information
190 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
193 * @brief A handle to get appcontrol information
195 typedef void* pkgmgrinfo_appcontrol_h;
198 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
200 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
202 * @param[in] handle the pkginfo handle
203 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
205 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
207 * @see pkgmgrinfo_pkginfo_get_list()
208 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
214 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
216 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
218 * @param[in] handle the appinfo handle
219 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
221 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
223 * @see pkgmgrinfo_appinfo_get_list()
224 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
225 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
227 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
231 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
233 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
235 * @param[in] category_name the name of the category
236 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
238 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
240 * @see pkgmgrinfo_appinfo_foreach_category()
242 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
246 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
248 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
250 * @param[in] permission_name the name of the permission
251 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
253 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
255 * @see pkgmgrinfo_appinfo_foreach_category()
257 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
261 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
263 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
265 * @param[in] privilege_name the name of the privilege
266 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
268 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
270 * @see pkgmgrinfo_pkginfo_foreach_privilege()
272 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
276 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
278 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
280 * @param[in] metadata_name the name of the metadata
281 * @param[in] metadata_value the value of the metadata
282 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
284 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
286 * @see pkgmgrinfo_appinfo_foreach_metadata()
288 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
289 const char *metadata_value, void *user_data);
292 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
294 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
296 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
297 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
299 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
301 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
303 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
307 * @brief Install Location Types
310 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
311 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
312 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
313 }pkgmgrinfo_install_location;
316 * @brief Application Component Types
319 PMINFO_ALL_APP = 0, /**< All Application*/
320 PMINFO_UI_APP, /**< UI Application*/
321 PMINFO_SVC_APP, /**< Service Application*/
322 }pkgmgrinfo_app_component;
325 * @brief Application Storage Types
328 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
329 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
330 }pkgmgrinfo_installed_storage;
333 * @brief Certificate Types to be used for getting information
336 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
337 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
338 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
339 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
340 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
341 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
342 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
343 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
344 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
345 }pkgmgrinfo_cert_type;
348 * @brief Install Location Types to be used when setting data in DB
351 INSTALL_INTERNAL = 0, /**< Internal Installation*/
352 INSTALL_EXTERNAL, /**< External Installation*/
356 * @brief permission Types
359 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
360 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
361 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
362 }pkgmgrinfo_permission_type;
365 /** String property for filtering based on package info*/
366 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
367 /** String property for filtering based on package info*/
368 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
369 /** String property for filtering based on package info*/
370 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
382 /** Boolean property for filtering based on package info*/
383 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
384 /** Boolean property for filtering based on package info*/
385 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
386 /** Boolean property for filtering based on package info*/
387 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
388 /** Boolean property for filtering based on package info*/
389 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
395 /** Integer property for filtering based on package info*/
396 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
398 /** String property for filtering based on app info*/
399 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
400 /** String property for filtering based on app info*/
401 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
402 /** String property for filtering based on app info*/
403 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
421 /** Boolean property for filtering based on app info*/
422 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
423 /** Boolean property for filtering based on app info*/
424 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
425 /** Boolean property for filtering based on app info*/
426 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
427 /** Boolean property for filtering based on app info*/
428 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
434 /** will be updated*/
435 /** string property for filtering based on pkg info*/
436 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
438 /* For multiuser support */
439 char *getUserPkgParserDBPath(void);
440 char *getUserPkgParserDBPathUID(uid_t uid);
441 char *getUserPkgCertDBPath(void);
442 char *getUserPkgCertDBPathUID(uid_t uid);
443 const char* getUserDesktopPath(uid_t uid);
444 const char* getUserManifestPath(uid_t uid);
447 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
448 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
449 * @brief This API gets list of installed packages
451 * @par This API is for package-manager client application
452 * @par Sync (or) Async : Synchronous API
453 * @param[in] pkg_list_cb iteration function for list
454 * @param[in] user_data user data to be passed to callback function
455 * @param[in] uid the addressee user id of the instruction
456 * @return 0 if success, error code(<0) if fail
457 * @retval PMINFO_R_OK success
458 * @retval PMINFO_R_EINVAL invalid argument
459 * @retval PMINFO_R_ERROR internal error
463 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
467 pkgid1 = (char *)user_data;
468 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
469 if (strcmp(pkgid1, pkgid2) == 0) {
476 static int list_pkgs()
479 char *name = "helloworld";
480 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
481 if (ret != PMINFO_R_OK) {
488 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
489 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
491 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
492 * @brief This API creates the package information handle from db
494 * @par This API is for package-manager client application
495 * @par Sync (or) Async : Synchronous API
497 * @param[in] pkgid pointer to package ID
498 * @param[in] uid the addressee user id of the instruction
499 * @param[out] handle pointer to the package info handle.
500 * @return 0 if success, error code(<0) if fail
501 * @retval PMINFO_R_OK success
502 * @retval PMINFO_R_EINVAL invalid argument
503 * @retval PMINFO_R_ERROR internal error
505 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
506 * @see pkgmgrinfo_pkginfo_get_pkgid()
507 * @see pkgmgrinfo_pkginfo_is_removable()
509 static int get_pkg_type(const char *pkgid)
513 pkgmgrinfo_pkginfo_h handle;
514 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
515 if (ret != PMINFO_R_OK)
517 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
518 if (ret != PMINFO_R_OK) {
519 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
522 printf("pkgtype: %s\n", type);
523 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
528 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
529 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
532 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
533 * @brief This API gets the package name from the package ID
535 * @par This API is for package-manager client application
536 * @par Sync (or) Async : Synchronous API
538 * @param[in] handle pointer to package info handle
539 * @param[out] pkg_name pointer to hold package name
540 * @return 0 if success, error code(<0) if fail
541 * @retval PMINFO_R_OK success
542 * @retval PMINFO_R_EINVAL invalid argument
543 * @retval PMINFO_R_ERROR internal error
544 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
545 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
546 * @see pkgmgrinfo_pkginfo_get_type()
547 * @see pkgmgrinfo_pkginfo_is_removable()
549 static int get_pkg_name(const char *pkgid)
552 char *pkgname = NULL;
553 pkgmgrinfo_pkginfo_h handle;
554 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
555 if (ret != PMINFO_R_OK)
557 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
558 if (ret != PMINFO_R_OK) {
559 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
562 printf("pkgname: %s\n", pkgname);
563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
568 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
571 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
572 * @brief This API gets the package id from the package ID
574 * @par This API is for package-manager client application
575 * @par Sync (or) Async : Synchronous API
577 * @param[in] handle pointer to package info handle
578 * @param[out] pkgid pointer to hold package id
579 * @return 0 if success, error code(<0) if fail
580 * @retval PMINFO_R_OK success
581 * @retval PMINFO_R_EINVAL invalid argument
582 * @retval PMINFO_R_ERROR internal error
583 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
584 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
585 * @see pkgmgrinfo_pkginfo_get_type()
586 * @see pkgmgrinfo_pkginfo_is_removable()
588 static int get_pkgid(const char *pkgid)
592 pkgmgrinfo_pkginfo_h handle;
593 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
594 if (ret != PMINFO_R_OK)
596 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
597 if (ret != PMINFO_R_OK) {
598 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
601 printf("pkg id: %s\n", pkg_id);
602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
607 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
610 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
611 * @brief This API gets the package type from the package ID
613 * @par This API is for package-manager client application
614 * @par Sync (or) Async : Synchronous API
616 * @param[in] handle pointer to package info handle
617 * @param[out] type pointer to hold package type
618 * @return 0 if success, error code(<0) if fail
619 * @retval PMINFO_R_OK success
620 * @retval PMINFO_R_EINVAL invalid argument
621 * @retval PMINFO_R_ERROR internal error
622 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
623 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
624 * @see pkgmgrinfo_pkginfo_get_pkgid()
625 * @see pkgmgrinfo_pkginfo_is_removable()
627 static int get_pkg_type(const char *pkgid)
631 pkgmgrinfo_pkginfo_h handle;
632 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
633 if (ret != PMINFO_R_OK)
635 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
636 if (ret != PMINFO_R_OK) {
637 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
640 printf("pkgtype: %s\n", type);
641 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
646 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
649 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
650 * @brief This API gets the package version from the package ID
652 * @par This API is for package-manager client application
653 * @par Sync (or) Async : Synchronous API
655 * @param[in] handle pointer to package info handle
656 * @param[out] version pointer to hold package version
657 * @return 0 if success, error code(<0) if fail
658 * @retval PMINFO_R_OK success
659 * @retval PMINFO_R_EINVAL invalid argument
660 * @retval PMINFO_R_ERROR internal error
661 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
662 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
663 * @see pkgmgrinfo_pkginfo_get_pkgid()
664 * @see pkgmgrinfo_pkginfo_is_removable()
666 static int get_pkg_version(const char *pkgid)
669 char *version = NULL;
670 pkgmgrinfo_pkginfo_h handle;
671 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
672 if (ret != PMINFO_R_OK)
674 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
675 if (ret != PMINFO_R_OK) {
676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
679 printf("pkg version: %s\n", version);
680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
685 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
688 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
689 * @brief This API gets the package install location from the package ID
691 * @par This API is for package-manager client application
692 * @par Sync (or) Async : Synchronous API
694 * @param[in] handle pointer to package info handle
695 * @param[out] location pointer to hold package install location
696 * @return 0 if success, error code(<0) if fail
697 * @retval PMINFO_R_OK success
698 * @retval PMINFO_R_EINVAL invalid argument
699 * @retval PMINFO_R_ERROR internal error
700 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
701 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
702 * @see pkgmgrinfo_pkginfo_get_pkgid()
703 * @see pkgmgrinfo_pkginfo_is_removable()
705 static int get_pkg_install_location(const char *pkgid)
708 pkgmgrinfo_install_location location;
709 pkgmgrinfo_pkginfo_h handle;
710 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
711 if (ret != PMINFO_R_OK)
713 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
714 if (ret != PMINFO_R_OK) {
715 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
718 printf("pkg install location: %d\n", location);
719 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
724 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
727 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
728 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
729 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
730 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
732 * @par This API is for package-manager client application
733 * @par Sync (or) Async : Synchronous API
735 * @param[in] handle pointer to package info handle
736 * @param[out] size pointer to hold package size
737 * @return 0 if success, error code(<0) if fail
738 * @retval PMINFO_R_OK success
739 * @retval PMINFO_R_EINVAL invalid argument
740 * @retval PMINFO_R_ERROR internal error
741 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
742 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
743 * @see pkgmgrinfo_pkginfo_get_pkgid()
744 * @see pkgmgrinfo_pkginfo_is_removable()
746 static int get_pkg_size(const char *pkgid)
750 pkgmgrinfo_pkginfo_h handle;
751 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
752 if (ret != PMINFO_R_OK)
754 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
755 if (ret != PMINFO_R_OK) {
756 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
759 printf("pkgsize: %d\n", size);
760 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
765 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
768 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
769 * @brief This API gets the installed package total size on the target.
771 * @par This API is for package-manager client application
772 * @par Sync (or) Async : Synchronous API
774 * @param[in] handle pointer to package info handle
775 * @param[out] size pointer to hold package total size
776 * @return 0 if success, error code(<0) if fail
777 * @retval PMINFO_R_OK success
778 * @retval PMINFO_R_EINVAL invalid argument
779 * @retval PMINFO_R_ERROR internal error
781 static int get_pkg_total_size(const char *pkgid)
785 pkgmgrinfo_pkginfo_h handle;
786 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
787 if (ret != PMINFO_R_OK)
789 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
790 if (ret != PMINFO_R_OK) {
791 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
794 printf("pkg total size: %d\n", size);
795 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
800 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
803 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
804 * @brief This API gets the installed package data size on the target.
806 * @par This API is for package-manager client application
807 * @par Sync (or) Async : Synchronous API
809 * @param[in] handle pointer to package info handle
810 * @param[out] size pointer to hold package data size
811 * @return 0 if success, error code(<0) if fail
812 * @retval PMINFO_R_OK success
813 * @retval PMINFO_R_EINVAL invalid argument
814 * @retval PMINFO_R_ERROR internal error
816 static int get_pkg_data_size(const char *pkgid)
820 pkgmgrinfo_pkginfo_h handle;
821 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
822 if (ret != PMINFO_R_OK)
824 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
825 if (ret != PMINFO_R_OK) {
826 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
829 printf("pkg data size: %d\n", size);
830 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
835 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
838 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
839 * @brief This API gets the package icon from the package ID
841 * @par This API is for package-manager client application
842 * @par Sync (or) Async : Synchronous API
844 * @param[in] handle pointer to package info handle
845 * @param[out] icon pointer to hold package icon
846 * @return 0 if success, error code(<0) if fail
847 * @retval PMINFO_R_OK success
848 * @retval PMINFO_R_EINVAL invalid argument
849 * @retval PMINFO_R_ERROR internal error
850 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
851 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
852 * @see pkgmgrinfo_pkginfo_get_pkgid()
853 * @see pkgmgrinfo_pkginfo_is_removable()
855 static int get_pkg_icon(const char *pkgid)
859 pkgmgrinfo_pkginfo_h handle;
860 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
861 if (ret != PMINFO_R_OK)
863 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
864 if (ret != PMINFO_R_OK) {
865 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
868 printf("pkg icon: %s\n", icon);
869 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
874 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
877 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
878 * @brief This API gets the package description from the package ID
880 * @par This API is for package-manager client application
881 * @par Sync (or) Async : Synchronous API
883 * @param[in] handle pointer to package info handle
884 * @param[out] description pointer to hold package description
885 * @return 0 if success, error code(<0) if fail
886 * @retval PMINFO_R_OK success
887 * @retval PMINFO_R_EINVAL invalid argument
888 * @retval PMINFO_R_ERROR internal error
889 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
890 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
891 * @see pkgmgrinfo_pkginfo_get_pkgid()
892 * @see pkgmgrinfo_pkginfo_is_removable()
894 static int get_pkg_description(const char *pkgid)
897 char *description = NULL;
898 pkgmgrinfo_pkginfo_h handle;
899 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
900 if (ret != PMINFO_R_OK)
902 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
903 if (ret != PMINFO_R_OK) {
904 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
907 printf("pkg description: %s\n", description);
908 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
913 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
916 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
917 * @brief This API gets the package's author name from the package ID
919 * @par This API is for package-manager client application
920 * @par Sync (or) Async : Synchronous API
922 * @param[in] handle pointer to package info handle
923 * @param[out] author_name pointer to hold package author name
924 * @return 0 if success, error code(<0) if fail
925 * @retval PMINFO_R_OK success
926 * @retval PMINFO_R_EINVAL invalid argument
927 * @retval PMINFO_R_ERROR internal error
928 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
929 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
930 * @see pkgmgrinfo_pkginfo_get_pkgid()
931 * @see pkgmgrinfo_pkginfo_is_removable()
933 static int get_pkg_author_name(const char *pkgid)
936 char *author_name = NULL;
937 pkgmgrinfo_pkginfo_h handle;
938 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
939 if (ret != PMINFO_R_OK)
941 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
942 if (ret != PMINFO_R_OK) {
943 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
946 printf("pkg author name: %s\n", author_name);
947 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
952 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
955 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
956 * @brief This API gets the package's author email from the package ID
958 * @par This API is for package-manager client application
959 * @par Sync (or) Async : Synchronous API
961 * @param[in] handle pointer to package info handle
962 * @param[out] author_email pointer to hold package author email
963 * @return 0 if success, error code(<0) if fail
964 * @retval PMINFO_R_OK success
965 * @retval PMINFO_R_EINVAL invalid argument
966 * @retval PMINFO_R_ERROR internal error
967 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
968 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
969 * @see pkgmgrinfo_pkginfo_get_pkgid()
970 * @see pkgmgrinfo_pkginfo_is_removable()
972 static int get_pkg_author_email(const char *pkgid)
975 char *author_email = NULL;
976 pkgmgrinfo_pkginfo_h handle;
977 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
978 if (ret != PMINFO_R_OK)
980 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
981 if (ret != PMINFO_R_OK) {
982 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
985 printf("pkg author email: %s\n", author_email);
986 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
991 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
994 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
995 * @brief This API gets the package's author href from the package ID
997 * @par This API is for package-manager client application
998 * @par Sync (or) Async : Synchronous API
1000 * @param[in] handle pointer to package info handle
1001 * @param[out] author_href pointer to hold package author href
1002 * @return 0 if success, error code(<0) if fail
1003 * @retval PMINFO_R_OK success
1004 * @retval PMINFO_R_EINVAL invalid argument
1005 * @retval PMINFO_R_ERROR internal error
1006 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1007 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1008 * @see pkgmgrinfo_pkginfo_get_pkgid()
1009 * @see pkgmgrinfo_pkginfo_is_removable()
1011 static int get_pkg_author_href(const char *pkgid)
1014 char *author_href = NULL;
1015 pkgmgrinfo_pkginfo_h handle;
1016 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1017 if (ret != PMINFO_R_OK)
1019 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1020 if (ret != PMINFO_R_OK) {
1021 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1024 printf("pkg author href: %s\n", author_href);
1025 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1030 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1033 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1034 * @brief This API gets the package installed storagae value from the package ID
1036 * @par This API is for package-manager client application
1037 * @par Sync (or) Async : Synchronous API
1039 * @param[in] handle pointer to package info handle
1040 * @param[out] storage pointer to hold package installed storage
1041 * @return 0 if success, error code(<0) if fail
1042 * @retval PMINFO_R_OK success
1043 * @retval PMINFO_R_EINVAL invalid argument
1044 * @retval PMINFO_R_ERROR internal error
1045 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1046 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1047 * @see pkgmgrinfo_pkginfo_get_pkgid()
1048 * @see pkgmgrinfo_pkginfo_is_removable()
1050 static int get_pkg_installed_storage(const char *pkgid)
1053 pkgmgrinfo_installed_storage storage;
1054 pkgmgrinfo_pkginfo_h handle;
1055 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1056 if (ret != PMINFO_R_OK)
1058 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1059 if (ret != PMINFO_R_OK) {
1060 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1063 printf("pkg installed storage: %d\n", storage);
1064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1069 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1072 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1073 * @brief This API gets the installed time of package from the package ID
1075 * @par This API is for package-manager client application
1076 * @par Sync (or) Async : Synchronous API
1078 * @param[in] handle pointer to package info handle
1079 * @param[out] installed_time pointer to hold installed time of package
1080 * @return 0 if success, error code(<0) if fail
1081 * @retval PMINFO_R_OK success
1082 * @retval PMINFO_R_EINVAL invalid argument
1083 * @retval PMINFO_R_ERROR internal error
1084 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1085 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1086 * @see pkgmgrinfo_pkginfo_get_pkgid()
1087 * @see pkgmgrinfo_pkginfo_is_removable()
1089 static int get_pkg_installed_time(const char *pkgid)
1092 int installed_time = 0;
1093 pkgmgrinfo_pkginfo_h handle;
1094 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1095 if (ret != PMINFO_R_OK)
1097 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1098 if (ret != PMINFO_R_OK) {
1099 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1102 printf("installed_time: %d\n", installed_time);
1103 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1108 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1111 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1112 * @brief This API gets the store client id of package from the package ID
1114 * @par This API is for package-manager client application
1115 * @par Sync (or) Async : Synchronous API
1117 * @param[in] handle pointer to package info handle
1118 * @param[out] storeclientid pointer to hold store client id of package
1119 * @return 0 if success, error code(<0) if fail
1120 * @retval PMINFO_R_OK success
1121 * @retval PMINFO_R_EINVAL invalid argument
1122 * @retval PMINFO_R_ERROR internal error
1123 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1124 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1125 * @see pkgmgrinfo_pkginfo_get_pkgid()
1126 * @see pkgmgrinfo_pkginfo_is_removable()
1128 static int get_pkg_storeclientid(const char *pkgid)
1131 char *storeclientid = 0;
1132 pkgmgrinfo_pkginfo_h handle;
1133 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1134 if (ret != PMINFO_R_OK)
1136 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1137 if (ret != PMINFO_R_OK) {
1138 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1141 printf(store client id: %s\n", storeclientid);
1142 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1147 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1150 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1151 * @brief This API gets the main app id of package from the package ID
1153 * @par This API is for package-manager client application
1154 * @par Sync (or) Async : Synchronous API
1156 * @param[in] handle pointer to package info handle
1157 * @param[out] mainappid pointer to hold main app id of package
1158 * @return 0 if success, error code(<0) if fail
1159 * @retval PMINFO_R_OK success
1160 * @retval PMINFO_R_EINVAL invalid argument
1161 * @retval PMINFO_R_ERROR internal error
1162 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1163 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1164 * @see pkgmgrinfo_pkginfo_get_pkgid()
1165 * @see pkgmgrinfo_pkginfo_is_removable()
1167 static int get_pkg_mainappid(const char *pkgid)
1170 char *mainappid = 0;
1171 pkgmgrinfo_pkginfo_h handle;
1172 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1173 if (ret != PMINFO_R_OK)
1175 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1176 if (ret != PMINFO_R_OK) {
1177 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1180 printf(main app id: %s\n", mainappid);
1181 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1186 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1189 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1190 * @brief This API gets the url of package from the package ID
1192 * @par This API is for package-manager client application
1193 * @par Sync (or) Async : Synchronous API
1195 * @param[in] handle pointer to package info handle
1196 * @param[out] url pointer to hold url of package
1197 * @return 0 if success, error code(<0) if fail
1198 * @retval PMINFO_R_OK success
1199 * @retval PMINFO_R_EINVAL invalid argument
1200 * @retval PMINFO_R_ERROR internal error
1201 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1202 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1203 * @see pkgmgrinfo_pkginfo_get_pkgid()
1204 * @see pkgmgrinfo_pkginfo_is_removable()
1206 static int get_pkg_url(const char *pkgid)
1210 pkgmgrinfo_pkginfo_h handle;
1211 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1212 if (ret != PMINFO_R_OK)
1214 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1215 if (ret != PMINFO_R_OK) {
1216 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1219 printf("url : %s\n", url);
1220 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1225 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1229 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1230 * @brief This API gets the root path of package
1232 * @par Sync (or) Async : Synchronous API
1234 * @param[in] handle pointer to package info handle
1235 * @param[out] path pointer to hold root path of package
1236 * @return 0 if success, error code(<0) if fail
1237 * @retval PMINFO_R_OK success
1238 * @retval PMINFO_R_EINVAL invalid argument
1239 * @retval PMINFO_R_ERROR internal error
1241 static int get_root_path(const char *pkgid)
1245 pkgmgrinfo_pkginfo_h handle;
1246 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1247 if (ret != PMINFO_R_OK)
1250 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1251 if (ret != PMINFO_R_OK) {
1252 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1255 printf("path : %s\n", path);
1256 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1262 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1266 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1267 * @brief This API gets the csc path of package
1269 * @par Sync (or) Async : Synchronous API
1271 * @param[in] handle pointer to package info handle
1272 * @param[out] path pointer to hold csc path of package
1273 * @return 0 if success, error code(<0) if fail
1274 * @retval PMINFO_R_OK success
1275 * @retval PMINFO_R_EINVAL invalid argument
1276 * @retval PMINFO_R_ERROR internal error
1278 static int get_csc_path(const char *pkgid)
1282 pkgmgrinfo_pkginfo_h handle;
1283 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1284 if (ret != PMINFO_R_OK)
1287 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1288 if (ret != PMINFO_R_OK) {
1289 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1292 printf("path : %s\n", path);
1293 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1299 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1302 * @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)
1303 * @brief This API compare the cert information from given package id
1305 * @par This API is for package-manager client application
1306 * @par Sync (or) Async : Synchronous API
1308 * @param[in] lhs_package_id pointer to first package ID
1309 * @param[in] rhs_package_id pointer to second package ID
1310 * @param[out] compare_result pointer to the compare result.
1311 * @return 0 if success, error code(<0) if fail
1312 * @retval PMINFO_R_OK success
1313 * @retval PMINFO_R_EINVAL invalid argument
1314 * @retval PMINFO_R_ERROR internal error
1316 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1317 * @see pkgmgrinfo_pkginfo_get_pkgid()
1318 * @see pkgmgrinfo_pkginfo_is_removable()
1320 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1323 pkgmgrinfo_cert_compare_result_type_e result;
1325 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1326 if (ret != PMINFO_R_OK) {
1329 printf("result: %d\n", result);
1334 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);
1335 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);
1337 * @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)
1338 * @brief This API compare the cert information from given app id
1340 * @par This API is for package-manager client application
1341 * @par Sync (or) Async : Synchronous API
1343 * @param[in] lhs_app_id pointer to first app ID
1344 * @param[in] rhs_app_id pointer to second app ID
1345 * @param[out] compare_result pointer to the compare result.
1346 * @return 0 if success, error code(<0) if fail
1347 * @retval PMINFO_R_OK success
1348 * @retval PMINFO_R_EINVAL invalid argument
1349 * @retval PMINFO_R_ERROR internal error
1351 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1352 * @see pkgmgrinfo_pkginfo_get_pkgid()
1353 * @see pkgmgrinfo_pkginfo_is_removable()
1355 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1358 pkgmgrinfo_cert_compare_result_type_e result;
1360 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1361 if (ret != PMINFO_R_OK) {
1364 printf("result: %d\n", result);
1369 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);
1370 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);
1372 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1373 * @brief This API gets the package 'removable' value from the package ID
1375 * @par This API is for package-manager client application
1376 * @par Sync (or) Async : Synchronous API
1378 * @param[in] handle pointer to package info handle
1379 * @param[out] removable pointer to hold package removable value
1380 * @return 0 if success, error code(<0) if fail
1381 * @retval PMINFO_R_OK success
1382 * @retval PMINFO_R_EINVAL invalid argument
1383 * @retval PMINFO_R_ERROR internal error
1384 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1385 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1386 * @see pkgmgrinfo_pkginfo_get_pkgid()
1387 * @see pkgmgrinfo_pkginfo_is_readonly()
1389 static int get_pkg_removable(const char *pkgid)
1393 pkgmgrinfo_pkginfo_h handle;
1394 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1395 if (ret != PMINFO_R_OK)
1397 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1398 if (ret != PMINFO_R_OK) {
1399 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1402 printf("pkg removable: %d\n", removable);
1403 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1408 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1411 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1412 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1414 * @par This API is for package-manager client application
1415 * @par Sync (or) Async : Synchronous API
1417 * @param[in] handle pointer to package info handle
1418 * @param[out] movable pointer to hold package movable state
1419 * @return 0 if success, error code(<0) if fail
1420 * @retval PMINFO_R_OK success
1421 * @retval PMINFO_R_EINVAL invalid argument
1422 * @retval PMINFO_R_ERROR internal error
1423 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1424 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1425 * @see pkgmgrinfo_pkginfo_get_pkgid()
1427 static int get_pkg_movable(const char *pkgid)
1431 pkgmgrinfo_pkginfo_h handle;
1432 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1433 if (ret != PMINFO_R_OK)
1435 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1436 if (ret != PMINFO_R_OK) {
1437 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1440 printf("pkg movable: %d\n", movable);
1441 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1449 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1450 * @brief This API gets the package 'preload' value from the package ID
1452 * @par This API is for package-manager client application
1453 * @par Sync (or) Async : Synchronous API
1455 * @param[in] handle pointer to package info handle
1456 * @param[out] preload pointer to hold package preload value
1457 * @return 0 if success, error code(<0) if fail
1458 * @retval PMINFO_R_OK success
1459 * @retval PMINFO_R_EINVAL invalid argument
1460 * @retval PMINFO_R_ERROR internal error
1461 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1462 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1463 * @see pkgmgrinfo_pkginfo_get_pkgid()
1464 * @see pkgmgrinfo_pkginfo_is_readonly()
1466 static int get_pkg_preload(const char *pkgid)
1470 pkgmgrinfo_pkginfo_h handle;
1471 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1472 if (ret != PMINFO_R_OK)
1474 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1475 if (ret != PMINFO_R_OK) {
1476 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1479 printf("pkg preload: %d\n", preload);
1480 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1485 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1488 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1489 * @brief This API gets the value for given handle is system or not
1491 * @par This API is for package-manager client application
1492 * @par Sync (or) Async : Synchronous API
1494 * @param[in] handle pointer to package info handle
1495 * @param[out] system pointer to hold system is or not
1496 * @return 0 if success, error code(<0) if fail
1497 * @retval PMINFO_R_OK success
1498 * @retval PMINFO_R_EINVAL invalid argument
1499 * @retval PMINFO_R_ERROR internal error
1500 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1501 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1502 * @see pkgmgrinfo_pkginfo_get_pkgid()
1503 * @see pkgmgrinfo_pkginfo_is_readonly()
1505 static int get_pkg_system(const char *pkgid)
1508 bool system = false;
1509 pkgmgrinfo_pkginfo_h handle = NULL;
1510 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1511 if (ret != PMINFO_R_OK)
1513 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1514 if (ret != PMINFO_R_OK) {
1515 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1518 printf("pkg system: %d\n", system);
1519 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1524 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1527 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1528 * @brief This API gets the package 'readonly' value from the package ID
1530 * @par This API is for package-manager client application
1531 * @par Sync (or) Async : Synchronous API
1533 * @param[in] handle pointer to package info handle
1534 * @param[out] readonly pointer to hold package readonly value
1535 * @return 0 if success, error code(<0) if fail
1536 * @retval PMINFO_R_OK success
1537 * @retval PMINFO_R_EINVAL invalid argument
1538 * @retval PMINFO_R_ERROR internal error
1539 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1540 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1541 * @see pkgmgrinfo_pkginfo_get_pkgid()
1542 * @see pkgmgrinfo_pkginfo_is_removable()
1544 static int get_pkg_readonly(const char *pkgid)
1548 pkgmgrinfo_pkginfo_h handle;
1549 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1550 if (ret != PMINFO_R_OK)
1552 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1553 if (ret != PMINFO_R_OK) {
1554 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1557 printf("pkg readonly: %d\n", readonly);
1558 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1563 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1567 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1568 * @brief This API gets the package 'upate' value from the package ID
1570 * @par This API is for package-manager client application
1571 * @par Sync (or) Async : Synchronous API
1573 * @param[in] handle pointer to package info handle
1574 * @param[out] update pointer to hold package update value
1575 * @return 0 if success, error code(<0) if fail
1576 * @retval PMINFO_R_OK success
1577 * @retval PMINFO_R_EINVAL invalid argument
1578 * @retval PMINFO_R_ERROR internal error
1579 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1580 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1581 * @see pkgmgrinfo_pkginfo_get_pkgid()
1583 static int get_pkg_update(const char *pkgid)
1587 pkgmgrinfo_pkginfo_h handle;
1588 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1589 if (ret != PMINFO_R_OK)
1591 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1592 if (ret != PMINFO_R_OK) {
1593 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1596 printf("pkg update: %d\n", update);
1597 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1602 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1605 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1606 * @brief This API gets the package 'accessible' value from the package ID
1608 * @par This API is for package-manager client application
1609 * @par Sync (or) Async : Synchronous API
1611 * @param[in] handle pointer to package info handle
1612 * @param[out] accessible pointer to hold package accessible value
1613 * @return 0 if success, error code(<0) if fail
1614 * @retval PMINFO_R_OK success
1615 * @retval PMINFO_R_EINVAL invalid argument
1616 * @retval PMINFO_R_ERROR internal error
1617 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1618 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1619 * @see pkgmgrinfo_pkginfo_get_pkgid()
1620 * @see pkgmgrinfo_pkginfo_is_readonly()
1622 static int get_pkg_accessible(const char *pkgid)
1626 pkgmgrinfo_pkginfo_h handle;
1627 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1628 if (ret != PMINFO_R_OK)
1630 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1631 if (ret != PMINFO_R_OK) {
1632 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1635 printf("pkg accessible: %d\n", accessible);
1636 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1641 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1644 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1645 * @brief This API destroys the package information handle freeing up all the resources
1647 * @par This API is for package-manager client application
1648 * @par Sync (or) Async : Synchronous API
1650 * @param[in] handle pointer to the package info handle
1651 * @return 0 if success, error code(<0) if fail
1652 * @retval PMINFO_R_OK success
1653 * @retval PMINFO_R_EINVAL invalid argument
1654 * @retval PMINFO_R_ERROR internal error
1655 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1657 * @see pkgmgrinfo_pkginfo_get_pkgid()
1658 * @see pkgmgrinfo_pkginfo_is_removable()
1660 static int get_pkg_type(const char *pkgid)
1664 pkgmgrinfo_pkginfo_h handle;
1665 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1666 if (ret != PMINFO_R_OK)
1668 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1669 if (ret != PMINFO_R_OK) {
1670 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1673 printf("pkgtype: %s\n", type);
1674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1682 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1683 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1684 The query will search the entire package information collected from the manifest file of all the installed packages
1686 * @par This API is for package-manager client application
1687 * @par Sync (or) Async : Synchronous API
1689 * @param[out] handle pointer to the package info filter handle.
1690 * @return 0 if success, error code(<0) if fail
1691 * @retval PMINFO_R_OK success
1692 * @retval PMINFO_R_EINVAL invalid argument
1693 * @retval PMINFO_R_ERROR internal error
1695 * @post pkgmgrinfo_pkginfo_filter_destroy()
1696 * @see pkgmgrinfo_pkginfo_filter_count()
1697 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1699 static int get_rpm_pkg_count()
1703 pkgmgrinfo_pkginfo_filter_h handle;
1704 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1705 if (ret != PMINFO_R_OK)
1707 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1708 if (ret != PMINFO_R_OK) {
1709 pkgmgrinfo_pkginfo_filter_destroy(handle);
1712 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1713 if (ret != PMINFO_R_OK) {
1714 pkgmgrinfo_pkginfo_filter_destroy(handle);
1717 printf("No of rpm pkgs: %d\n", count);
1718 pkgmgrinfo_pkginfo_filter_destroy(handle);
1723 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1726 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1727 * @brief This API destroys the package information filter handle freeing up all the resources
1729 * @par This API is for package-manager client application
1730 * @par Sync (or) Async : Synchronous API
1732 * @param[in] handle pointer to the package info filter handle.
1733 * @return 0 if success, error code(<0) if fail
1734 * @retval PMINFO_R_OK success
1735 * @retval PMINFO_R_EINVAL invalid argument
1736 * @retval PMINFO_R_ERROR internal error
1737 * @pre pkgmgrinfo_pkginfo_filter_create()
1739 * @see pkgmgrinfo_pkginfo_filter_count()
1740 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1742 static int get_rpm_pkg_count()
1746 pkgmgrinfo_pkginfo_filter_h handle;
1747 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1748 if (ret != PMINFO_R_OK)
1750 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1751 if (ret != PMINFO_R_OK) {
1752 pkgmgrinfo_pkginfo_filter_destroy(handle);
1755 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1756 if (ret != PMINFO_R_OK) {
1757 pkgmgrinfo_pkginfo_filter_destroy(handle);
1760 printf("No of rpm pkgs: %d\n", count);
1761 pkgmgrinfo_pkginfo_filter_destroy(handle);
1766 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1769 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1770 * @brief This API adds a boolean filter property to the filter handle
1772 * @par This API is for package-manager client application
1773 * @par Sync (or) Async : Synchronous API
1775 * @param[in] handle pointer to the package info filter handle.
1776 * @param[in] property boolean property name.
1777 * @param[in] value value corresponding to the property.
1778 * @return 0 if success, error code(<0) if fail
1779 * @retval PMINFO_R_OK success
1780 * @retval PMINFO_R_EINVAL invalid argument
1781 * @retval PMINFO_R_ERROR internal error
1782 * @pre pkgmgrinfo_pkginfo_filter_create()
1783 * @post pkgmgrinfo_pkginfo_filter_destroy()
1784 * @see pkgmgrinfo_pkginfo_filter_count()
1785 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1787 static int get_preload_pkg_count()
1791 pkgmgrinfo_pkginfo_filter_h handle;
1792 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1793 if (ret != PMINFO_R_OK)
1795 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1796 if (ret != PMINFO_R_OK) {
1797 pkgmgrinfo_pkginfo_filter_destroy(handle);
1800 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1801 if (ret != PMINFO_R_OK) {
1802 pkgmgrinfo_pkginfo_filter_destroy(handle);
1805 printf("No of preload pkgs: %d\n", count);
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1812 const char *property, const bool value);
1815 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1816 * @brief This API adds an integer filter property to the filter handle
1818 * @par This API is for package-manager client application
1819 * @par Sync (or) Async : Synchronous API
1821 * @param[in] handle pointer to the package info filter handle.
1822 * @param[in] property integer property name.
1823 * @param[in] value value corresponding to the property.
1824 * @return 0 if success, error code(<0) if fail
1825 * @retval PMINFO_R_OK success
1826 * @retval PMINFO_R_EINVAL invalid argument
1827 * @retval PMINFO_R_ERROR internal error
1828 * @pre pkgmgrinfo_pkginfo_filter_create()
1829 * @post pkgmgrinfo_pkginfo_filter_destroy()
1830 * @see pkgmgrinfo_pkginfo_filter_count()
1831 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1833 static int get_pkg_count()
1837 pkgmgrinfo_pkginfo_filter_h handle;
1838 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1839 if (ret != PMINFO_R_OK)
1841 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1842 if (ret != PMINFO_R_OK) {
1843 pkgmgrinfo_pkginfo_filter_destroy(handle);
1846 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1847 if (ret != PMINFO_R_OK) {
1848 pkgmgrinfo_pkginfo_filter_destroy(handle);
1851 printf("No of preload pkgs: %d\n", count);
1852 pkgmgrinfo_pkginfo_filter_destroy(handle);
1857 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1858 const char *property, const int value);
1861 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1862 * @brief This API adds a string filter property to the filter handle
1864 * @par This API is for package-manager client application
1865 * @par Sync (or) Async : Synchronous API
1867 * @param[in] handle pointer to the package info filter handle.
1868 * @param[in] property string property name.
1869 * @param[in] value value corresponding to the property.
1870 * @return 0 if success, error code(<0) if fail
1871 * @retval PMINFO_R_OK success
1872 * @retval PMINFO_R_EINVAL invalid argument
1873 * @retval PMINFO_R_ERROR internal error
1874 * @pre pkgmgrinfo_pkginfo_filter_create()
1875 * @post pkgmgrinfo_pkginfo_filter_destroy()
1876 * @see pkgmgrinfo_pkginfo_filter_count()
1877 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1879 static int get_rpm_pkg_count()
1883 pkgmgrinfo_pkginfo_filter_h handle;
1884 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1885 if (ret != PMINFO_R_OK)
1887 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1888 if (ret != PMINFO_R_OK) {
1889 pkgmgrinfo_pkginfo_filter_destroy(handle);
1892 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_filter_destroy(handle);
1897 printf("No of rpm pkgs: %d\n", count);
1898 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1904 const char *property, const char *value);
1907 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1908 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1910 * @par This API is for package-manager client application
1911 * @par Sync (or) Async : Synchronous API
1913 * @param[in] handle pointer to the package info filter handle.
1914 * @param[in] pkg_cb callback function.
1915 * @param[in] user_data user data to be passed to the callback function
1916 * @return 0 if success, error code(<0) if fail
1917 * @retval PMINFO_R_OK success
1918 * @retval PMINFO_R_EINVAL invalid argument
1919 * @retval PMINFO_R_ERROR internal error
1920 * @pre pkgmgrinfo_pkginfo_filter_create()
1921 * @post pkgmgrinfo_pkginfo_filter_destroy()
1922 * @see pkgmgrinfo_pkginfo_filter_count()
1924 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1927 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1928 printf("pkg id : %s\n", pkgid);
1932 static int get_rpm_pkg_list()
1935 pkgmgrinfo_pkginfo_filter_h handle;
1936 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1937 if (ret != PMINFO_R_OK)
1939 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1940 if (ret != PMINFO_R_OK) {
1941 pkgmgrinfo_pkginfo_filter_destroy(handle);
1944 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1949 pkgmgrinfo_pkginfo_filter_destroy(handle);
1954 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1955 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1956 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1957 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1960 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1961 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1962 * @brief This API counts the package that satisfy the filter conditions
1964 * @par This API is for package-manager client application
1965 * @par Sync (or) Async : Synchronous API
1967 * @param[in] handle pointer to the package info filter handle.
1968 * @param[in] count pointer to store the count value.
1969 * @param[in] uid the addressee user id of the instruction
1970 * @return 0 if success, error code(<0) if fail
1971 * @retval PMINFO_R_OK success
1972 * @retval PMINFO_R_EINVAL invalid argument
1973 * @retval PMINFO_R_ERROR internal error
1974 * @pre pkgmgrinfo_pkginfo_filter_create()
1975 * @post pkgmgrinfo_pkginfo_filter_destroy()
1976 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1978 static int get_rpm_pkg_count()
1982 pkgmgrinfo_pkginfo_filter_h handle;
1983 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1984 if (ret != PMINFO_R_OK)
1986 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_filter_destroy(handle);
1991 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1992 if (ret != PMINFO_R_OK) {
1993 pkgmgrinfo_pkginfo_filter_destroy(handle);
1996 printf("No of rpm pkgs: %d\n", count);
1997 pkgmgrinfo_pkginfo_filter_destroy(handle);
2002 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2003 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2005 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2006 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2007 * @brief This API gets the list of privilege for a particular package
2009 * @par This API is for package-manager client application
2010 * @par Sync (or) Async : Synchronous API
2011 * @param[in] handle pointer to the package info handle.
2012 * @param[in] privilege_func callback function for list
2013 * @param[in] user_data user data to be passed to callback function
2014 * @return 0 if success, error code(<0) if fail
2015 * @retval PMINFO_R_OK success
2016 * @retval PMINFO_R_EINVAL invalid argument
2017 * @retval PMINFO_R_ERROR internal error
2018 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2019 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2021 int privilege_func(const char *name, void *user_data)
2023 if (strcmp(name, (char *)user_data) == 0)
2029 static int list_privilege(const char *package, char *privilege)
2032 pkgmgrinfo_pkginfo_h handle;
2033 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2034 if (ret != PMINFO_R_OK)
2036 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2037 if (ret != PMINFO_R_OK) {
2038 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2041 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2046 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2047 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2050 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2051 pkgmgrinfo_app_list_cb app_func, void *user_data)
2052 * @brief This API gets list of installed applications for a particular package
2054 * @par This API is for package-manager client application
2055 * @par Sync (or) Async : Synchronous API
2056 * @param[in] handle package info handle
2057 * @param[in] component application component
2058 * @param[in] app_func iteration function for list
2059 * @param[in] user_data user data to be passed to callback function
2060 * @return 0 if success, error code(<0) if fail
2061 * @retval PMINFO_R_OK success
2062 * @retval PMINFO_R_EINVAL invalid argument
2063 * @retval PMINFO_R_ERROR internal error
2064 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2065 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2067 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2070 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2071 printf("appid : %s\n", appid);
2075 static int list_apps(const char *pkgid)
2078 pkgmgrinfo_pkginfo_h handle;
2079 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2080 if (ret != PMINFO_R_OK)
2082 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2083 if (ret != PMINFO_R_OK) {
2084 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2087 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2092 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2093 pkgmgrinfo_app_list_cb app_func, void *user_data);
2094 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2095 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2097 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2098 * @brief This API gets list of installed applications from all packages with minimum informaion.
2100 * @par This API is for package-manager client application
2101 * @par Sync (or) Async : Synchronous API
2102 * @param[in] app_func iteration function for list
2103 * @param[in] user_data user data to be passed to callback function
2104 * @return 0 if success, error code(<0) if fail
2105 * @retval PMINFO_R_OK success
2106 * @retval PMINFO_R_EINVAL invalid argument
2107 * @retval PMINFO_R_ERROR internal error
2111 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2113 char *pkgid1 = NULL;
2114 char *pkgid2 = NULL;
2115 pkgid1 = (char *)user_data;
2116 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2117 if (strcmp(pkgid1, pkgid2) == 0) {
2124 static int list_apps()
2127 char *name = "helloworld";
2128 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2129 if (ret != PMINFO_R_OK) {
2136 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2137 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2139 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2140 * @brief This API gets list of installed applications from all packages.
2142 * @par This API is for package-manager client application
2143 * @par Sync (or) Async : Synchronous API
2144 * @param[in] app_func iteration function for list
2145 * @param[in] user_data user data to be passed to callback function
2146 * @return 0 if success, error code(<0) if fail
2147 * @retval PMINFO_R_OK success
2148 * @retval PMINFO_R_EINVAL invalid argument
2149 * @retval PMINFO_R_ERROR internal error
2153 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2155 char *pkgid1 = NULL;
2156 char *pkgid2 = NULL;
2157 pkgid1 = (char *)user_data;
2158 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2159 if (strcmp(pkgid1, pkgid2) == 0) {
2166 static int list_apps()
2169 char *name = "helloworld";
2170 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2171 if (ret != PMINFO_R_OK) {
2178 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2179 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2182 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2183 * @brief This API creates the application information handle from db
2185 * @par This API is for package-manager client application
2186 * @par Sync (or) Async : Synchronous API
2188 * @param[in] appid pointer to appid
2189 * @param[out] handle pointer to the application info handle.
2190 * @return 0 if success, error code(<0) if fail
2191 * @retval PMINFO_R_OK success
2192 * @retval PMINFO_R_EINVAL invalid argument
2193 * @retval PMINFO_R_ERROR internal error
2195 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2196 * @see pkgmgrinfo_appinfo_get_pkgid()
2197 * @see pkgmgrinfo_appinfo_is_multiple()
2199 static int get_app_type(const char *appid)
2203 pkgmgrinfo_appinfo_h handle;
2204 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2205 if (ret != PMINFO_R_OK)
2207 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2208 if (ret != PMINFO_R_OK) {
2209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2212 printf("apptype: %s\n", type);
2213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2218 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2219 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2221 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2222 * @brief This API gets the application ID
2224 * @par This API is for package-manager client application
2225 * @par Sync (or) Async : Synchronous API
2227 * @param[in] handle pointer to the application info handle.
2228 * @param[out] appid pointer to hold appid
2229 * @return 0 if success, error code(<0) if fail
2230 * @retval PMINFO_R_OK success
2231 * @retval PMINFO_R_EINVAL invalid argument
2232 * @retval PMINFO_R_ERROR internal error
2233 * @pre pkgmgrinfo_appinfo_get_appinfo()
2234 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2235 * @see pkgmgrinfo_appinfo_get_pkgid()
2236 * @see pkgmgrinfo_appinfo_is_multiple()
2238 static int get_app_id(const char *appid)
2241 char *app_id = NULL;
2242 pkgmgrinfo_appinfo_h handle;
2243 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2244 if (ret != PMINFO_R_OK)
2246 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2247 if (ret != PMINFO_R_OK) {
2248 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2251 printf("app id: %s\n", app_id);
2252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2257 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2260 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2261 * @brief This API gets the package name of the application
2263 * @par This API is for package-manager client application
2264 * @par Sync (or) Async : Synchronous API
2266 * @param[in] handle pointer to the application info handle.
2267 * @param[out] pkg_name pointer to hold package name
2268 * @return 0 if success, error code(<0) if fail
2269 * @retval PMINFO_R_OK success
2270 * @retval PMINFO_R_EINVAL invalid argument
2271 * @retval PMINFO_R_ERROR internal error
2272 * @pre pkgmgrinfo_appinfo_get_appinfo()
2273 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2274 * @see pkgmgrinfo_appinfo_get_appid()
2275 * @see pkgmgrinfo_appinfo_is_multiple()
2277 static int get_app_pkgname(const char *appid)
2280 char *pkgname = NULL;
2281 pkgmgrinfo_appinfo_h handle;
2282 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2283 if (ret != PMINFO_R_OK)
2285 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2286 if (ret != PMINFO_R_OK) {
2287 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2290 printf("pkg name: %s\n", pkgname);
2291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2296 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2299 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2300 * @brief This API gets the package id of the application
2302 * @par This API is for package-manager client application
2303 * @par Sync (or) Async : Synchronous API
2305 * @param[in] handle pointer to the application info handle.
2306 * @param[out] pkgid pointer to hold package id
2307 * @return 0 if success, error code(<0) if fail
2308 * @retval PMINFO_R_OK success
2309 * @retval PMINFO_R_EINVAL invalid argument
2310 * @retval PMINFO_R_ERROR internal error
2311 * @pre pkgmgrinfo_appinfo_get_appinfo()
2312 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2313 * @see pkgmgrinfo_appinfo_get_appid()
2314 * @see pkgmgrinfo_appinfo_is_multiple()
2316 static int get_app_pkgid(const char *appid)
2320 pkgmgrinfo_appinfo_h handle;
2321 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2322 if (ret != PMINFO_R_OK)
2324 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2325 if (ret != PMINFO_R_OK) {
2326 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2329 printf("pkg id: %s\n", pkgid);
2330 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2335 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2338 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2339 * @brief This API gets the executable name of the application
2341 * @par This API is for package-manager client application
2342 * @par Sync (or) Async : Synchronous API
2344 * @param[in] handle pointer to the application info handle.
2345 * @param[out] exec pointer to hold app exec name
2346 * @return 0 if success, error code(<0) if fail
2347 * @retval PMINFO_R_OK success
2348 * @retval PMINFO_R_EINVAL invalid argument
2349 * @retval PMINFO_R_ERROR internal error
2350 * @pre pkgmgrinfo_appinfo_get_appinfo()
2351 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2352 * @see pkgmgrinfo_appinfo_get_appid()
2353 * @see pkgmgrinfo_appinfo_is_multiple()
2355 static int get_app_exec(const char *appid)
2359 pkgmgrinfo_appinfo_h handle;
2360 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2361 if (ret != PMINFO_R_OK)
2363 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2364 if (ret != PMINFO_R_OK) {
2365 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2368 printf("exec name: %s\n", exec);
2369 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2374 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2377 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2378 * @brief This API gets the icon name of the application
2380 * @par This API is for package-manager client application
2381 * @par Sync (or) Async : Synchronous API
2383 * @param[in] handle pointer to the application info handle.
2384 * @param[out] icon pointer to hold app icon name
2385 * @return 0 if success, error code(<0) if fail
2386 * @retval PMINFO_R_OK success
2387 * @retval PMINFO_R_EINVAL invalid argument
2388 * @retval PMINFO_R_ERROR internal error
2389 * @pre pkgmgrinfo_appinfo_get_appinfo()
2390 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2391 * @see pkgmgrinfo_appinfo_get_appid()
2392 * @see pkgmgrinfo_appinfo_is_multiple()
2394 static int get_app_icon(const char *appid)
2398 pkgmgrinfo_appinfo_h handle;
2399 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2400 if (ret != PMINFO_R_OK)
2402 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2403 if (ret != PMINFO_R_OK) {
2404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2407 printf("icon name: %s\n", icon);
2408 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2413 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2416 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2417 * @brief This API gets the label of the application
2419 * @par This API is for package-manager client application
2420 * @par Sync (or) Async : Synchronous API
2422 * @param[in] handle pointer to the application info handle.
2423 * @param[out] label pointer to hold app label
2424 * @return 0 if success, error code(<0) if fail
2425 * @retval PMINFO_R_OK success
2426 * @retval PMINFO_R_EINVAL invalid argument
2427 * @retval PMINFO_R_ERROR internal error
2428 * @pre pkgmgrinfo_appinfo_get_appinfo()
2429 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2430 * @see pkgmgrinfo_appinfo_get_appid()
2431 * @see pkgmgrinfo_appinfo_is_multiple()
2433 static int get_app_label(const char *appid)
2437 pkgmgrinfo_appinfo_h handle;
2438 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2439 if (ret != PMINFO_R_OK)
2441 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2442 if (ret != PMINFO_R_OK) {
2443 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2446 printf("label : %s\n", label);
2447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2452 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2455 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2456 * @brief This API gets the component of the application
2458 * @par This API is for package-manager client application
2459 * @par Sync (or) Async : Synchronous API
2461 * @param[in] handle pointer to the application info handle.
2462 * @param[out] component pointer to hold app component
2463 * @return 0 if success, error code(<0) if fail
2464 * @retval PMINFO_R_OK success
2465 * @retval PMINFO_R_EINVAL invalid argument
2466 * @retval PMINFO_R_ERROR internal error
2467 * @pre pkgmgrinfo_appinfo_get_appinfo()
2468 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2469 * @see pkgmgrinfo_appinfo_get_appid()
2470 * @see pkgmgrinfo_appinfo_is_multiple()
2472 static int get_app_component(const char *appid)
2475 pkgmgrinfo_app_component component;
2476 pkgmgrinfo_appinfo_h handle;
2477 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2478 if (ret != PMINFO_R_OK)
2480 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2481 if (ret != PMINFO_R_OK) {
2482 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2485 printf("component : %s\n", component);
2486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2491 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2494 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2495 * @brief This API gets the apptype of the application
2497 * @par This API is for package-manager client application
2498 * @par Sync (or) Async : Synchronous API
2500 * @param[in] handle pointer to the application info handle.
2501 * @param[out] app_type pointer to hold apptype
2502 * @return 0 if success, error code(<0) if fail
2503 * @retval PMINFO_R_OK success
2504 * @retval PMINFO_R_EINVAL invalid argument
2505 * @retval PMINFO_R_ERROR internal error
2506 * @pre pkgmgrinfo_appinfo_get_appinfo()
2507 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2508 * @see pkgmgrinfo_appinfo_get_appid()
2509 * @see pkgmgrinfo_appinfo_is_multiple()
2511 static int get_app_type(const char *appid)
2514 char *apptype = NULL;
2515 pkgmgrinfo_appinfo_h handle;
2516 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2517 if (ret != PMINFO_R_OK)
2519 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2520 if (ret != PMINFO_R_OK) {
2521 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2524 printf("apptype : %s\n", apptype);
2525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2530 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2533 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2534 int *operation_count, char ***operation)
2535 * @brief This API gets the list of operation of the application
2537 * @par This API is for package-manager client application
2538 * @par Sync (or) Async : Synchronous API
2540 * @param[in] handle pointer to the appcontrol handle.
2541 * @param[out] operation_count pointer to hold number of operations
2542 * @param[out] operation pointer to hold list of operations
2543 * @return 0 if success, error code(<0) if fail
2544 * @retval PMINFO_R_OK success
2545 * @retval PMINFO_R_EINVAL invalid argument
2546 * @retval PMINFO_R_ERROR internal error
2547 * @pre pkgmgrinfo_appinfo_get_appinfo()
2548 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2549 * @see pkgmgrinfo_appinfo_get_uri()
2550 * @see pkgmgrinfo_appinfo_get_mime()
2552 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2557 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2558 for (i = 0; i < oc; i++) {
2559 if (strcmp(operation[i], (char *)user_data) == 0)
2566 static int check_operation(const char *appid, char *operation)
2569 pkgmgrinfo_appinfo_h handle;
2570 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2571 if (ret != PMINFO_R_OK)
2573 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2574 if (ret != PMINFO_R_OK) {
2575 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2578 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2583 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2584 int *operation_count, char ***operation);
2587 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2588 int *uri_count, char ***uri)
2589 * @brief This API gets the list of uri of the application
2591 * @par This API is for package-manager client application
2592 * @par Sync (or) Async : Synchronous API
2594 * @param[in] handle pointer to the appcontrol handle.
2595 * @param[out] uri_count pointer to hold number of uris
2596 * @param[out] uri pointer to hold list of uris
2597 * @return 0 if success, error code(<0) if fail
2598 * @retval PMINFO_R_OK success
2599 * @retval PMINFO_R_EINVAL invalid argument
2600 * @retval PMINFO_R_ERROR internal error
2601 * @pre pkgmgrinfo_appinfo_get_appinfo()
2602 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2603 * @see pkgmgrinfo_appinfo_get_operation()
2604 * @see pkgmgrinfo_appinfo_get_mime()
2606 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2611 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2612 for (i = 0; i < uc; i++) {
2613 if (strcmp(uri[i], (char *)user_data) == 0)
2620 static int check_uri(const char *appid, char *uri)
2623 pkgmgrinfo_appinfo_h handle;
2624 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2625 if (ret != PMINFO_R_OK)
2627 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2628 if (ret != PMINFO_R_OK) {
2629 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2632 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2637 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2638 int *uri_count, char ***uri);
2641 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2642 int *mime_count, char ***mime)
2643 * @brief This API gets the list of mime of the application
2645 * @par This API is for package-manager client application
2646 * @par Sync (or) Async : Synchronous API
2648 * @param[in] handle pointer to the appcontrol handle.
2649 * @param[out] mime_count pointer to hold number of mimes
2650 * @param[out] mime pointer to hold list of mimes
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_uri()
2658 * @see pkgmgrinfo_appinfo_get_operation()
2660 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2665 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2666 for (i = 0; i < mc; i++) {
2667 if (strcmp(mime[i], (char *)user_data) == 0)
2674 static int check_mime(const char *appid, char *mime)
2677 pkgmgrinfo_appinfo_h handle;
2678 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2679 if (ret != PMINFO_R_OK)
2681 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2682 if (ret != PMINFO_R_OK) {
2683 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2691 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2692 int *mime_count, char ***mime);
2695 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2696 int *subapp_count, char ***subapp)
2697 * @brief This API gets the list of subapp of the application
2699 * @par This API is for package-manager client application
2700 * @par Sync (or) Async : Synchronous API
2702 * @param[in] handle pointer to the appcontrol handle.
2703 * @param[out] subapp_count pointer to hold number of subapp
2704 * @param[out] subapp pointer to hold list of subapp
2705 * @return 0 if success, error code(<0) if fail
2706 * @retval PMINFO_R_OK success
2707 * @retval PMINFO_R_EINVAL invalid argument
2708 * @retval PMINFO_R_ERROR internal error
2709 * @pre pkgmgrinfo_appinfo_get_appinfo()
2710 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2711 * @see pkgmgrinfo_appinfo_get_uri()
2712 * @see pkgmgrinfo_appinfo_get_operation()
2714 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2718 char **subapp = NULL;
2719 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2720 for (i = 0; i < sc; i++) {
2721 if (strcmp(subapp[i], (char *)user_data) == 0)
2728 static int check_subapp(const char *appid, char *subapp)
2731 pkgmgrinfo_appinfo_h handle = NULL;
2732 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2733 if (ret != PMINFO_R_OK)
2735 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2736 if (ret != PMINFO_R_OK) {
2737 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2745 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2746 int *subapp_count, char ***subapp);
2749 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2750 * @brief This API gets the notification icon of the application
2752 * @par This API is for package-manager client application
2753 * @par Sync (or) Async : Synchronous API
2755 * @param[in] handle pointer to the application info handle.
2756 * @param[out] path pointer to hold notification icon
2757 * @return 0 if success, error code(<0) if fail
2758 * @retval PMINFO_R_OK success
2759 * @retval PMINFO_R_EINVAL invalid argument
2760 * @retval PMINFO_R_ERROR internal error
2761 * @pre pkgmgrinfo_appinfo_get_appinfo()
2762 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2763 * @see pkgmgrinfo_appinfo_get_appid()
2764 * @see pkgmgrinfo_appinfo_is_multiple()
2766 static int get_app_notification_icon(const char *appid)
2769 char *notification_icon = NULL;
2770 pkgmgrinfo_appinfo_h handle;
2771 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2772 if (ret != PMINFO_R_OK)
2774 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2775 if (ret != PMINFO_R_OK) {
2776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 printf("notification icon : %s\n", notification_icon);
2780 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2785 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2788 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2789 * @brief This API gets the setting icon of the application
2791 * @par This API is for package-manager client application
2792 * @par Sync (or) Async : Synchronous API
2794 * @param[in] handle pointer to the application info handle.
2795 * @param[out] path pointer to hold setting icon
2796 * @return 0 if success, error code(<0) if fail
2797 * @retval PMINFO_R_OK success
2798 * @retval PMINFO_R_EINVAL invalid argument
2799 * @retval PMINFO_R_ERROR internal error
2800 * @pre pkgmgrinfo_appinfo_get_appinfo()
2801 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2802 * @see pkgmgrinfo_appinfo_get_appid()
2803 * @see pkgmgrinfo_appinfo_is_multiple()
2805 static int get_app_setting_icon(const char *appid)
2808 char *setting_icon = NULL;
2809 pkgmgrinfo_appinfo_h handle;
2810 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2811 if (ret != PMINFO_R_OK)
2813 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2814 if (ret != PMINFO_R_OK) {
2815 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2818 printf("setting icon : %s\n", setting_icon);
2819 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2824 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2827 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2828 * @brief This API gets the type of recent image on app-tray
2830 * @par This API is for package-manager client application
2831 * @par Sync (or) Async : Synchronous API
2833 * @param[in] handle pointer to the application info handle.
2834 * @param[out] type pointer to hold image type
2835 * @return 0 if success, error code(<0) if fail
2836 * @retval PMINFO_R_OK success
2837 * @retval PMINFO_R_EINVAL invalid argument
2838 * @retval PMINFO_R_ERROR internal error
2839 * @pre pkgmgrinfo_appinfo_get_appinfo()
2840 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2841 * @see pkgmgrinfo_appinfo_get_appid()
2842 * @see pkgmgrinfo_appinfo_is_multiple()
2844 static int get_app_recent_image_type(const char *appid)
2847 pkgmgrinfo_app_recentimage type;
2848 pkgmgrinfo_appinfo_h handle;
2849 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2850 if (ret != PMINFO_R_OK)
2852 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2853 if (ret != PMINFO_R_OK) {
2854 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2857 printf("recent image type: %d\n", type);
2858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2863 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2867 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2868 * @brief This API gets the preview image of application
2870 * @par Sync (or) Async : Synchronous API
2872 * @param[in] handle pointer to the application info handle.
2873 * @param[out] preview_img pointer to hold preview image path
2874 * @return 0 if success, error code(<0) if fail
2875 * @retval PMINFO_R_OK success
2876 * @retval PMINFO_R_EINVAL invalid argument
2877 * @retval PMINFO_R_ERROR internal error
2878 * @pre pkgmgrinfo_appinfo_get_appinfo()
2879 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2880 * @see pkgmgrinfo_appinfo_get_appid()
2882 static int get_app_previewimage(const char *appid)
2885 char *preview = NULL;
2886 pkgmgrinfo_appinfo_h handle = NULL;
2887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2888 if (ret != PMINFO_R_OK)
2890 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2891 if (ret != PMINFO_R_OK) {
2892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2895 printf("preview image path : %s\n", preview);
2896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2901 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2905 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2906 * @brief This API gets the package permission type of the application
2908 * @par This API is for package-manager client application
2909 * @par Sync (or) Async : Synchronous API
2911 * @param[in] handle pointer to the application info handle.
2912 * @param[out] permission pointer to hold package permission
2913 * @return 0 if success, error code(<0) if fail
2914 * @retval PMINFO_R_OK success
2915 * @retval PMINFO_R_EINVAL invalid argument
2916 * @retval PMINFO_R_ERROR internal error
2917 * @pre pkgmgrinfo_appinfo_get_appinfo()
2918 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2919 * @see pkgmgrinfo_appinfo_get_appid()
2921 static int get_app_permission(const char *appid)
2924 pkgmgrinfo_permission_type permission = 0;
2925 pkgmgrinfo_appinfo_h handle;
2927 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2928 if (ret != PMINFO_R_OK)
2930 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2931 if (ret != PMINFO_R_OK) {
2932 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2935 printf("permission type: %d\n", permission);
2936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2941 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2944 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2945 * @brief This API gets the component_type
2947 * @par This API is for package-manager client application
2948 * @par Sync (or) Async : Synchronous API
2950 * @param[in] handle pointer to the application info handle.
2951 * @param[out] component_type pointer to hold component_type
2952 * @return 0 if success, error code(<0) if fail
2953 * @retval PMINFO_R_OK success
2954 * @retval PMINFO_R_EINVAL invalid argument
2955 * @retval PMINFO_R_ERROR internal error
2956 * @pre pkgmgrinfo_appinfo_get_appinfo()
2957 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2958 * @see pkgmgrinfo_appinfo_get_pkgid()
2959 * @see pkgmgrinfo_appinfo_is_multiple()
2961 static int get_component_type(const char *appid)
2964 char *component_type = NULL;
2965 pkgmgrinfo_appinfo_h handle;
2966 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2967 if (ret != PMINFO_R_OK)
2969 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2970 if (ret != PMINFO_R_OK) {
2971 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2974 printf("component_type: %s\n", component_type);
2975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2980 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2983 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2984 * @brief This API gets the application 'hwacceleration' value from the app ID
2986 * @par This API is for package-manager client application
2987 * @par Sync (or) Async : Synchronous API
2989 * @param[in] handle pointer to application info handle
2990 * @param[out] hwacceleration pointer to hold package hwacceleration value
2991 * @return 0 if success, error code(<0) if fail
2992 * @retval PMINFO_R_OK success
2993 * @retval PMINFO_R_EINVAL invalid argument
2994 * @retval PMINFO_R_ERROR internal error
2995 * @pre pkgmgrinfo_appinfo_get_appinfo()
2996 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2997 * @see pkgmgrinfo_appinfo_get_appid()
2998 * @see pkgmgrinfo_appinfo_is_multiple()
3000 static int get_app_hwacceleration(const char *appid)
3003 pkgmgrinfo_app_hwacceleration hwacceleration;
3004 pkgmgrinfo_appinfo_h handle;
3005 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3006 if (ret != PMINFO_R_OK)
3008 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3009 if (ret != PMINFO_R_OK) {
3010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3013 printf("app hwacceleration: %d\n", hwacceleration);
3014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3019 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3022 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3023 * @brief This API gets the application 'screenreader' value from the app ID
3025 * @par This API is for package-manager client application
3026 * @par Sync (or) Async : Synchronous API
3028 * @param[in] handle pointer to application info handle
3029 * @param[out] screenreader pointer to hold package accessibility value
3030 * @return 0 if success, error code(<0) if fail
3031 * @retval PMINFO_R_OK success
3032 * @retval PMINFO_R_EINVAL invalid argument
3033 * @retval PMINFO_R_ERROR internal error
3034 * @pre pkgmgrinfo_appinfo_get_appinfo()
3035 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3036 * @see pkgmgrinfo_appinfo_get_appid()
3037 * @see pkgmgrinfo_appinfo_is_multiple()
3039 static int get_app_screenreader(const char *appid)
3042 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3043 pkgmgrinfo_appinfo_h handle = NULL;
3044 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3045 if (ret != PMINFO_R_OK)
3047 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3048 if (ret != PMINFO_R_OK) {
3049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3052 printf("app screenreader: %d\n", screenreader);
3053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3058 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3061 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3062 * @brief This API gets the application's landscape & portrait effect images
3064 * @par This API is for package-manager client application
3065 * @par Sync (or) Async : Synchronous API
3067 * @param[in] handle pointer to application info handle
3068 * @param[out] portrait_img contains portrait mode effect image
3069 * @param[out] landscape_img contains landscape mode effect image
3070 * @return 0 if success, error code(<0) if fail
3071 * @retval PMINFO_R_OK success
3072 * @retval PMINFO_R_EINVAL invalid argument
3073 * @retval PMINFO_R_ERROR internal error
3074 * @pre pkgmgrinfo_appinfo_get_appinfo()
3075 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3076 * @see pkgmgrinfo_appinfo_get_appid()
3077 * @see pkgmgrinfo_appinfo_is_nodisplay()
3079 static int get_app_effectimages(const char *appid)
3082 char *portraitimg = NULL;
3083 char *landscapeimg = NULL;
3084 pkgmgrinfo_appinfo_h handle;
3085 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3086 if (ret != PMINFO_R_OK)
3088 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3089 if (ret != PMINFO_R_OK) {
3090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3093 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3094 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3099 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3102 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3103 * @brief This API gets the submode_mainid of the application
3105 * @par This API is for package-manager client application
3106 * @par Sync (or) Async : Synchronous API
3108 * @param[in] handle pointer to the application info handle.
3109 * @param[out] submode_mainid pointer to hold package name
3110 * @return 0 if success, error code(<0) if fail
3111 * @retval PMINFO_R_OK success
3112 * @retval PMINFO_R_EINVAL invalid argument
3113 * @retval PMINFO_R_ERROR internal error
3114 * @pre pkgmgrinfo_appinfo_get_appinfo()
3115 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3116 * @see pkgmgrinfo_appinfo_get_appid()
3117 * @see pkgmgrinfo_appinfo_is_multiple()
3119 static int get_app_submode_mainid(const char *appid)
3122 char *submode_mainid = NULL;
3123 pkgmgrinfo_appinfo_h handle = NULL;
3124 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3125 if (ret != PMINFO_R_OK)
3127 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3128 if (ret != PMINFO_R_OK) {
3129 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3132 printf("submode_mainid: %s\n", submode_mainid);
3133 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3138 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3141 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3142 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3143 * @brief This API gets the list of permission for a particular application
3145 * @par This API is for package-manager client application
3146 * @par Sync (or) Async : Synchronous API
3147 * @param[in] handle pointer to the application info handle.
3148 * @param[in] permission_func callback function for list
3149 * @param[in] user_data user data to be passed to callback function
3150 * @return 0 if success, error code(<0) if fail
3151 * @retval PMINFO_R_OK success
3152 * @retval PMINFO_R_EINVAL invalid argument
3153 * @retval PMINFO_R_ERROR internal error
3154 * @pre pkgmgrinfo_appinfo_get_appinfo()
3155 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3157 int permission_func(const char *name, void *user_data)
3159 if (strcmp(name, (char *)user_data) == 0)
3165 static int list_permission(const char *appid, char *permission)
3168 pkgmgrinfo_appinfo_h handle;
3169 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3170 if (ret != PMINFO_R_OK)
3172 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3173 if (ret != PMINFO_R_OK) {
3174 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3182 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3183 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3186 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3187 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3188 * @brief This API gets the list of category for a particular application
3190 * @par This API is for package-manager client application
3191 * @par Sync (or) Async : Synchronous API
3192 * @param[in] handle pointer to the application info handle.
3193 * @param[in] category_func callback function for list
3194 * @param[in] user_data user data to be passed to callback function
3195 * @return 0 if success, error code(<0) if fail
3196 * @retval PMINFO_R_OK success
3197 * @retval PMINFO_R_EINVAL invalid argument
3198 * @retval PMINFO_R_ERROR internal error
3199 * @pre pkgmgrinfo_appinfo_get_appinfo()
3200 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3202 int category_func(const char *name, void *user_data)
3204 if (strcmp(name, (char *)user_data) == 0)
3210 static int list_category(const char *appid, char *category)
3213 pkgmgrinfo_appinfo_h handle;
3214 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3215 if (ret != PMINFO_R_OK)
3217 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3218 if (ret != PMINFO_R_OK) {
3219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3222 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3227 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3228 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3231 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3232 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3233 * @brief This API gets the list of metadata for a particular application
3235 * @par This API is for package-manager client application
3236 * @par Sync (or) Async : Synchronous API
3237 * @param[in] handle pointer to the application info handle.
3238 * @param[in] metadata_func callback function for list
3239 * @param[in] user_data user data to be passed to callback function
3240 * @return 0 if success, error code(<0) if fail
3241 * @retval PMINFO_R_OK success
3242 * @retval PMINFO_R_EINVAL invalid argument
3243 * @retval PMINFO_R_ERROR internal error
3244 * @pre pkgmgrinfo_appinfo_get_appinfo()
3245 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3247 int metadata_func(const char *key, const char *value, void *user_data)
3249 if (strcmp(key, (char *)user_data) == 0) {
3250 printf("Value is %s\n", value);
3257 static int list_metadata(const char *appid, char *key)
3260 pkgmgrinfo_appinfo_h handle;
3261 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3262 if (ret != PMINFO_R_OK)
3264 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3265 if (ret != PMINFO_R_OK) {
3266 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3274 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3275 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3279 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3280 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3281 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3282 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3283 * @brief This API gets the list of app-control for a particular application
3285 * @par This API is for package-manager client application
3286 * @par Sync (or) Async : Synchronous API
3287 * @param[in] handle pointer to the application info handle.
3288 * @param[in] appcontrol_func callback function for list
3289 * @param[in] user_data user data to be passed to callback function
3290 * @param[in] uid the addressee user id of the instruction
3291 * @return 0 if success, error code(<0) if fail
3292 * @retval PMINFO_R_OK success
3293 * @retval PMINFO_R_EINVAL invalid argument
3294 * @retval PMINFO_R_ERROR internal error
3295 * @pre pkgmgrinfo_appinfo_get_appinfo()
3296 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3298 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3303 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3304 for (i = 0; i < oc; i++) {
3305 if (strcmp(operation[i], (char *)user_data) == 0)
3312 static int check_operation(const char *appid, char *operation)
3315 pkgmgrinfo_appinfo_h handle;
3316 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3317 if (ret != PMINFO_R_OK)
3319 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3320 if (ret != PMINFO_R_OK) {
3321 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3329 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3330 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3331 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3332 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3335 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3336 * @brief This API gets the application 'nodisplay' value from the app ID
3338 * @par This API is for package-manager client application
3339 * @par Sync (or) Async : Synchronous API
3341 * @param[in] handle pointer to application info handle
3342 * @param[out] nodisplay pointer to hold package nodisplay value
3343 * @return 0 if success, error code(<0) if fail
3344 * @retval PMINFO_R_OK success
3345 * @retval PMINFO_R_EINVAL invalid argument
3346 * @retval PMINFO_R_ERROR internal error
3347 * @pre pkgmgrinfo_appinfo_get_appinfo()
3348 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3349 * @see pkgmgrinfo_appinfo_get_appid()
3350 * @see pkgmgrinfo_appinfo_is_multiple()
3352 static int get_app_nodisplay(const char *appid)
3356 pkgmgrinfo_appinfo_h handle;
3357 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3358 if (ret != PMINFO_R_OK)
3360 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3361 if (ret != PMINFO_R_OK) {
3362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3365 printf("app nodisplay: %d\n", nodisplay);
3366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3371 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3374 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3375 * @brief This API gets the application 'multiple' value from the app ID
3377 * @par This API is for package-manager client application
3378 * @par Sync (or) Async : Synchronous API
3380 * @param[in] handle pointer to application info handle
3381 * @param[out] multiple pointer to hold package multiple value
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()
3388 * @see pkgmgrinfo_appinfo_get_appid()
3389 * @see pkgmgrinfo_appinfo_is_nodisplay()
3391 static int get_app_multiple(const char *appid)
3395 pkgmgrinfo_appinfo_h handle;
3396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3397 if (ret != PMINFO_R_OK)
3399 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3400 if (ret != PMINFO_R_OK) {
3401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3404 printf("app multiple: %d\n", multiple);
3405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3410 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3413 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3414 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3415 * application launching effect. If fales, indicator will be hidden during application launching effect
3417 * @par This API is for package-manager client application
3418 * @par Sync (or) Async : Synchronous API
3420 * @param[in] handle pointer to application info handle
3421 * @param[out] indicator_disp contains indicator display status for application launching effect
3422 * @return 0 if success, error code(<0) if fail
3423 * @retval PMINFO_R_OK success
3424 * @retval PMINFO_R_EINVAL invalid argument
3425 * @retval PMINFO_R_ERROR internal error
3426 * @pre pkgmgrinfo_appinfo_get_appinfo()
3427 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3428 * @see pkgmgrinfo_appinfo_get_appid()
3429 * @see pkgmgrinfo_appinfo_is_nodisplay()
3431 static int get_app_indicator_display(const char *appid)
3434 bool indicator_disp;
3435 pkgmgrinfo_appinfo_h handle;
3436 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3437 if (ret != PMINFO_R_OK)
3439 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3440 if (ret != PMINFO_R_OK){
3441 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3444 printf("app indicator disp : %d\n", indicator_disp);
3445 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3453 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3454 * @brief This API gets the application 'taskmanage' value from the app ID
3456 * @par This API is for package-manager client application
3457 * @par Sync (or) Async : Synchronous API
3459 * @param[in] handle pointer to application info handle
3460 * @param[out] taskmanage pointer to hold package taskmanage value
3461 * @return 0 if success, error code(<0) if fail
3462 * @retval PMINFO_R_OK success
3463 * @retval PMINFO_R_EINVAL invalid argument
3464 * @retval PMINFO_R_ERROR internal error
3465 * @pre pkgmgrinfo_appinfo_get_appinfo()
3466 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3467 * @see pkgmgrinfo_appinfo_get_appid()
3468 * @see pkgmgrinfo_appinfo_is_multiple()
3470 static int get_app_taskmanage(const char *appid)
3474 pkgmgrinfo_appinfo_h handle;
3475 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3476 if (ret != PMINFO_R_OK)
3478 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3479 if (ret != PMINFO_R_OK) {
3480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3483 printf("app taskmanage: %d\n", taskmanage);
3484 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3489 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3492 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3493 * @brief This API gets the application 'taskmanage' value from the app ID
3495 * @par This API is for package-manager client application
3496 * @par Sync (or) Async : Synchronous API
3498 * @param[in] handle pointer to application info handle
3499 * @param[out] enabled pointer to hold package enabled value
3500 * @return 0 if success, error code(<0) if fail
3501 * @retval PMINFO_R_OK success
3502 * @retval PMINFO_R_EINVAL invalid argument
3503 * @retval PMINFO_R_ERROR internal error
3504 * @pre pkgmgrinfo_appinfo_get_appinfo()
3505 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3506 * @see pkgmgrinfo_appinfo_get_appid()
3507 * @see pkgmgrinfo_appinfo_is_multiple()
3509 static int get_app_enabled(const char *appid)
3513 pkgmgrinfo_appinfo_h handle;
3514 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3515 if (ret != PMINFO_R_OK)
3517 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3518 if (ret != PMINFO_R_OK) {
3519 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3522 printf("app enabled: %d\n", enabled);
3523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3528 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3531 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3532 * @brief This API gets the application 'onboot' value from the app ID
3534 * @par This API is for package-manager client application
3535 * @par Sync (or) Async : Synchronous API
3537 * @param[in] handle pointer to application info handle
3538 * @param[out] onboot pointer to hold package onboot value
3539 * @return 0 if success, error code(<0) if fail
3540 * @retval PMINFO_R_OK success
3541 * @retval PMINFO_R_EINVAL invalid argument
3542 * @retval PMINFO_R_ERROR internal error
3543 * @pre pkgmgrinfo_appinfo_get_appinfo()
3544 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3545 * @see pkgmgrinfo_appinfo_get_appid()
3546 * @see pkgmgrinfo_appinfo_is_multiple()
3548 static int get_app_onboot(const char *appid)
3552 pkgmgrinfo_appinfo_h handle;
3553 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3554 if (ret != PMINFO_R_OK)
3556 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3557 if (ret != PMINFO_R_OK) {
3558 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3561 printf("app onboot: %d\n", onboot);
3562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3567 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3570 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3571 * @brief This API gets the application 'autorestart' value from the app ID
3573 * @par This API is for package-manager client application
3574 * @par Sync (or) Async : Synchronous API
3576 * @param[in] handle pointer to application info handle
3577 * @param[out] autorestart pointer to hold package autorestart value
3578 * @return 0 if success, error code(<0) if fail
3579 * @retval PMINFO_R_OK success
3580 * @retval PMINFO_R_EINVAL invalid argument
3581 * @retval PMINFO_R_ERROR internal error
3582 * @pre pkgmgrinfo_appinfo_get_appinfo()
3583 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3584 * @see pkgmgrinfo_appinfo_get_appid()
3585 * @see pkgmgrinfo_appinfo_is_multiple()
3587 static int get_app_autorestart(const char *appid)
3591 pkgmgrinfo_appinfo_h handle;
3592 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3593 if (ret != PMINFO_R_OK)
3595 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3596 if (ret != PMINFO_R_OK) {
3597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3600 printf("app autorestart: %d\n", autorestart);
3601 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3606 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3609 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3610 * @brief This API gets the value for given application is main app or not from handle
3612 * @par This API is for package-manager client application
3613 * @par Sync (or) Async : Synchronous API
3615 * @param[in] handle pointer to application info handle
3616 * @param[out] mainapp pointer to hold package mainapp is or not
3617 * @return 0 if success, error code(<0) if fail
3618 * @retval PMINFO_R_OK success
3619 * @retval PMINFO_R_EINVAL invalid argument
3620 * @retval PMINFO_R_ERROR internal error
3621 * @pre pkgmgrinfo_appinfo_get_appinfo()
3622 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3623 * @see pkgmgrinfo_appinfo_get_appid()
3624 * @see pkgmgrinfo_appinfo_is_multiple()
3626 static int get_app_mainapp(const char *appid)
3630 pkgmgrinfo_appinfo_h handle;
3631 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3632 if (ret != PMINFO_R_OK)
3634 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3635 if (ret != PMINFO_R_OK) {
3636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3639 printf("mainapp: %d\n", mainapp);
3640 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3645 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3649 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3650 * @brief This API gets the value for given application is preload or not from handle
3652 * @par This API is for package-manager client application
3653 * @par Sync (or) Async : Synchronous API
3655 * @param[in] handle pointer to application info handle
3656 * @param[out] preload pointer to hold preload is or not
3657 * @return 0 if success, error code(<0) if fail
3658 * @retval PMINFO_R_OK success
3659 * @retval PMINFO_R_EINVAL invalid argument
3660 * @retval PMINFO_R_ERROR internal error
3661 * @pre pkgmgrinfo_appinfo_get_appinfo()
3662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3663 * @see pkgmgrinfo_appinfo_get_appid()
3664 * @see pkgmgrinfo_appinfo_is_multiple()
3666 static int get_app_preload(const char *appid)
3670 pkgmgrinfo_appinfo_h handle = NULL;
3671 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3672 if (ret != PMINFO_R_OK)
3674 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3675 if (ret != PMINFO_R_OK) {
3676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3679 printf("preload: %d\n", preload);
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3688 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3689 * @brief This API gets the value for given application is submode or not from handle
3691 * @par This API is for package-manager client application
3692 * @par Sync (or) Async : Synchronous API
3694 * @param[in] handle pointer to application info handle
3695 * @param[out] submode pointer to hold submode is or not
3696 * @return 0 if success, error code(<0) if fail
3697 * @retval PMINFO_R_OK success
3698 * @retval PMINFO_R_EINVAL invalid argument
3699 * @retval PMINFO_R_ERROR internal error
3700 * @pre pkgmgrinfo_appinfo_get_appinfo()
3701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3702 * @see pkgmgrinfo_appinfo_get_appid()
3703 * @see pkgmgrinfo_appinfo_is_multiple()
3705 static int get_app_submode(const char *appid)
3709 pkgmgrinfo_appinfo_h handle = NULL;
3710 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3711 if (ret != PMINFO_R_OK)
3713 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3714 if (ret != PMINFO_R_OK) {
3715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3718 printf("submode: %d\n", submode);
3719 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3724 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3727 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3728 * @brief This API destroys the application information handle freeing up all the resources
3730 * @par This API is for package-manager client application
3731 * @par Sync (or) Async : Synchronous API
3733 * @param[in] handle pointer to the application info handle.
3734 * @return 0 if success, error code(<0) if fail
3735 * @retval PMINFO_R_OK success
3736 * @retval PMINFO_R_EINVAL invalid argument
3737 * @retval PMINFO_R_ERROR internal error
3738 * @pre pkgmgrinfo_appinfo_get_appinfo()
3740 * @see pkgmgrinfo_appinfo_get_pkgid()
3741 * @see pkgmgrinfo_appinfo_is_multiple()
3743 static int get_app_type(const char *appid)
3747 pkgmgrinfo_appinfo_h handle;
3748 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3749 if (ret != PMINFO_R_OK)
3751 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3752 if (ret != PMINFO_R_OK) {
3753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3756 printf("apptype: %s\n", type);
3757 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3762 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3765 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3766 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3767 The query will search the entire application information collected from the manifest file of all the installed packages
3769 * @par This API is for package-manager client application
3770 * @par Sync (or) Async : Synchronous API
3772 * @param[out] handle pointer to the application info filter handle.
3773 * @return 0 if success, error code(<0) if fail
3774 * @retval PMINFO_R_OK success
3775 * @retval PMINFO_R_EINVAL invalid argument
3776 * @retval PMINFO_R_ERROR internal error
3778 * @post pkgmgrinfo_appinfo_filter_destroy()
3779 * @see pkgmgrinfo_appinfo_filter_count()
3780 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3782 static int get_capp_count()
3786 pkgmgrinfo_appinfo_filter_h handle;
3787 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3788 if (ret != PMINFO_R_OK)
3790 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3791 if (ret != PMINFO_R_OK) {
3792 pkgmgrinfo_appinfo_filter_destroy(handle);
3795 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3796 if (ret != PMINFO_R_OK) {
3797 pkgmgrinfo_appinfo_filter_destroy(handle);
3800 printf("No of capp: %d\n", count);
3801 pkgmgrinfo_appinfo_filter_destroy(handle);
3806 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3809 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3810 * @brief This API destroys the application information filter handle freeing up all the resources
3812 * @par This API is for package-manager client application
3813 * @par Sync (or) Async : Synchronous API
3815 * @param[in] handle pointer to the application info filter handle.
3816 * @return 0 if success, error code(<0) if fail
3817 * @retval PMINFO_R_OK success
3818 * @retval PMINFO_R_EINVAL invalid argument
3819 * @retval PMINFO_R_ERROR internal error
3820 * @pre pkgmgrinfo_appinfo_filter_create()
3822 * @see pkgmgrinfo_appinfo_filter_count()
3823 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3825 static int get_capp_count()
3829 pkgmgrinfo_appinfo_filter_h handle;
3830 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3831 if (ret != PMINFO_R_OK)
3833 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3834 if (ret != PMINFO_R_OK) {
3835 pkgmgrinfo_appinfo_filter_destroy(handle);
3838 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3839 if (ret != PMINFO_R_OK) {
3840 pkgmgrinfo_appinfo_filter_destroy(handle);
3843 printf("No of capp: %d\n", count);
3844 pkgmgrinfo_appinfo_filter_destroy(handle);
3849 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3852 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3853 * @brief This API adds a boolean filter property to the filter handle
3855 * @par This API is for package-manager client application
3856 * @par Sync (or) Async : Synchronous API
3858 * @param[in] handle pointer to the application info filter handle.
3859 * @param[in] property boolean property name.
3860 * @param[in] value value corresponding to the property.
3861 * @return 0 if success, error code(<0) if fail
3862 * @retval PMINFO_R_OK success
3863 * @retval PMINFO_R_EINVAL invalid argument
3864 * @retval PMINFO_R_ERROR internal error
3865 * @pre pkgmgrinfo_appinfo_filter_create()
3866 * @post pkgmgrinfo_appinfo_filter_destroy()
3867 * @see pkgmgrinfo_appinfo_filter_count()
3868 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3870 static int get_taskmanageable_app_count()
3874 pkgmgrinfo_appinfo_filter_h handle;
3875 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3876 if (ret != PMINFO_R_OK)
3878 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3879 if (ret != PMINFO_R_OK) {
3880 pkgmgrinfo_appinfo_filter_destroy(handle);
3883 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3884 if (ret != PMINFO_R_OK) {
3885 pkgmgrinfo_appinfo_filter_destroy(handle);
3888 printf("No of taskmanageable apps: %d\n", count);
3889 pkgmgrinfo_appinfo_filter_destroy(handle);
3894 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3895 const char *property, const bool value);
3898 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3899 * @brief This API adds an integer filter property to the filter handle
3901 * @par This API is for package-manager client application
3902 * @par Sync (or) Async : Synchronous API
3904 * @param[in] handle pointer to the application info filter handle.
3905 * @param[in] property integer property name.
3906 * @param[in] value value corresponding to the property.
3907 * @return 0 if success, error code(<0) if fail
3908 * @retval PMINFO_R_OK success
3909 * @retval PMINFO_R_EINVAL invalid argument
3910 * @retval PMINFO_R_ERROR internal error
3911 * @pre pkgmgrinfo_appinfo_filter_create()
3912 * @post pkgmgrinfo_appinfo_filter_destroy()
3913 * @see pkgmgrinfo_appinfo_filter_count()
3914 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3916 static int get_taskmanageable_app_count()
3920 pkgmgrinfo_appinfo_filter_h handle;
3921 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3922 if (ret != PMINFO_R_OK)
3924 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3925 if (ret != PMINFO_R_OK) {
3926 pkgmgrinfo_appinfo_filter_destroy(handle);
3929 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3930 if (ret != PMINFO_R_OK) {
3931 pkgmgrinfo_appinfo_filter_destroy(handle);
3934 printf("No of apps: %d\n", count);
3935 pkgmgrinfo_appinfo_filter_destroy(handle);
3940 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3941 const char *property, const int value);
3944 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3945 * @brief This API adds a string filter property to the filter handle
3947 * @par This API is for package-manager client application
3948 * @par Sync (or) Async : Synchronous API
3950 * @param[in] handle pointer to the application info filter handle.
3951 * @param[in] property string property name.
3952 * @param[in] value value corresponding to the property.
3953 * @return 0 if success, error code(<0) if fail
3954 * @retval PMINFO_R_OK success
3955 * @retval PMINFO_R_EINVAL invalid argument
3956 * @retval PMINFO_R_ERROR internal error
3957 * @pre pkgmgrinfo_appinfo_filter_create()
3958 * @post pkgmgrinfo_appinfo_filter_destroy()
3959 * @see pkgmgrinfo_appinfo_filter_count()
3960 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3962 static int get_capp_count()
3966 pkgmgrinfo_appinfo_filter_h handle;
3967 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3968 if (ret != PMINFO_R_OK)
3970 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3971 if (ret != PMINFO_R_OK) {
3972 pkgmgrinfo_appinfo_filter_destroy(handle);
3975 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3976 if (ret != PMINFO_R_OK) {
3977 pkgmgrinfo_appinfo_filter_destroy(handle);
3980 printf("No of capp: %d\n", count);
3981 pkgmgrinfo_appinfo_filter_destroy(handle);
3986 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3987 const char *property, const char *value);
3990 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3991 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3993 * @par This API is for package-manager client application
3994 * @par Sync (or) Async : Synchronous API
3996 * @param[in] handle pointer to the application info filter handle.
3997 * @param[in] app_cb callback function.
3998 * @param[in] user_data user data to be passed to the callback function
3999 * @return 0 if success, error code(<0) if fail
4000 * @retval PMINFO_R_OK success
4001 * @retval PMINFO_R_EINVAL invalid argument
4002 * @retval PMINFO_R_ERROR internal error
4003 * @pre pkgmgrinfo_appinfo_filter_create()
4004 * @post pkgmgrinfo_appinfo_filter_destroy()
4005 * @see pkgmgrinfo_appinfo_filter_count()
4007 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4010 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4011 printf("appid : %s\n", appid);
4015 static int get_capp_list()
4018 pkgmgrinfo_appinfo_filter_h handle;
4019 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4020 if (ret != PMINFO_R_OK)
4022 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4023 if (ret != PMINFO_R_OK) {
4024 pkgmgrinfo_appinfo_filter_destroy(handle);
4027 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4028 if (ret != PMINFO_R_OK) {
4029 pkgmgrinfo_appinfo_filter_destroy(handle);
4032 pkgmgrinfo_appinfo_filter_destroy(handle);
4037 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4038 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4039 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4040 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4043 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4044 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4045 * @brief This API counts the application that satisfy the filter conditions
4047 * @par This API is for package-manager client application
4048 * @par Sync (or) Async : Synchronous API
4050 * @param[in] handle pointer to the application info filter handle.
4051 * @param[in] count pointer to store count value
4052 * @param[in] uid the addressee user id of the instruction
4053 * @return 0 if success, error code(<0) if fail
4054 * @retval PMINFO_R_OK success
4055 * @retval PMINFO_R_EINVAL invalid argument
4056 * @retval PMINFO_R_ERROR internal error
4057 * @pre pkgmgrinfo_appinfo_filter_create()
4058 * @post pkgmgrinfo_appinfo_filter_destroy()
4059 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4061 static int get_capp_count()
4065 pkgmgrinfo_appinfo_filter_h handle;
4066 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4067 if (ret != PMINFO_R_OK)
4069 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4070 if (ret != PMINFO_R_OK) {
4071 pkgmgrinfo_appinfo_filter_destroy(handle);
4074 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4075 if (ret != PMINFO_R_OK) {
4076 pkgmgrinfo_appinfo_filter_destroy(handle);
4079 printf("No of capp: %d\n", count);
4080 pkgmgrinfo_appinfo_filter_destroy(handle);
4085 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4086 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4088 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4089 * @brief This API creates the application's metadata information filter handle from db.
4091 * @par This API is for package-manager client application
4092 * @par Sync (or) Async : Synchronous API
4094 * @param[out] handle pointer to the application metadata info filter handle.
4095 * @return 0 if success, error code(<0) if fail
4096 * @retval PMINFO_R_OK success
4097 * @retval PMINFO_R_EINVAL invalid argument
4098 * @retval PMINFO_R_ERROR internal error
4100 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4101 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4103 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4106 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4107 printf("appid : %s\n", appid);
4111 static int get_app_list(const char *mkey, const char *mvalue)
4114 pkgmgrinfo_appinfo_metadata_filter_h handle;
4115 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4116 if (ret != PMINFO_R_OK)
4118 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4119 if (ret != PMINFO_R_OK) {
4120 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4123 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4124 if (ret != PMINFO_R_OK) {
4125 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4128 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4133 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4136 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4137 * @brief This API destroys the application's metadata information filter handle.
4139 * @par This API is for package-manager client application
4140 * @par Sync (or) Async : Synchronous API
4142 * @param[in] handle pointer to the application metadata info filter handle.
4143 * @return 0 if success, error code(<0) if fail
4144 * @retval PMINFO_R_OK success
4145 * @retval PMINFO_R_EINVAL invalid argument
4146 * @retval PMINFO_R_ERROR internal error
4147 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4149 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4151 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4154 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4155 printf("appid : %s\n", appid);
4159 static int get_app_list(const char *mkey, const char *mvalue)
4162 pkgmgrinfo_appinfo_metadata_filter_h handle;
4163 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4164 if (ret != PMINFO_R_OK)
4166 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4167 if (ret != PMINFO_R_OK) {
4168 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4171 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4172 if (ret != PMINFO_R_OK) {
4173 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4176 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4181 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4184 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4185 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4186 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4188 * @par This API is for package-manager client application
4189 * @par Sync (or) Async : Synchronous API
4191 * @param[in] handle pointer to the application metadata info filter handle.
4192 * @param[in] key pointer to metadata key
4193 * @param[in] value pointer to metadata value
4194 * @return 0 if success, error code(<0) if fail
4195 * @retval PMINFO_R_OK success
4196 * @retval PMINFO_R_EINVAL invalid argument
4197 * @retval PMINFO_R_ERROR internal error
4198 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4199 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4200 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4202 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4205 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4206 printf("appid : %s\n", appid);
4210 static int get_app_list(const char *mkey, const char *mvalue)
4213 pkgmgrinfo_appinfo_metadata_filter_h handle;
4214 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4215 if (ret != PMINFO_R_OK)
4217 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4218 if (ret != PMINFO_R_OK) {
4219 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4222 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4223 if (ret != PMINFO_R_OK) {
4224 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4227 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4232 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4233 const char *key, const char *value);
4236 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4237 * @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)
4238 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4239 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4240 * negative value, no more callbacks will be called and API will return.
4242 * @par This API is for package-manager client application
4243 * @par Sync (or) Async : Synchronous API
4245 * @param[in] handle pointer to the application metadata info filter handle.
4246 * @param[in] app_cb function pointer to callback
4247 * @param[in] user_data pointer to user data
4248 * @param[in] uid the addressee user id of the instruction
4249 * @return 0 if success, error code(<0) if fail
4250 * @retval PMINFO_R_OK success
4251 * @retval PMINFO_R_EINVAL invalid argument
4252 * @retval PMINFO_R_ERROR internal error
4253 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4254 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4256 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4259 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4260 printf("appid : %s\n", appid);
4264 static int get_app_list(const char *mkey, const char *mvalue)
4267 pkgmgrinfo_appinfo_metadata_filter_h handle;
4268 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4269 if (ret != PMINFO_R_OK)
4271 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4272 if (ret != PMINFO_R_OK) {
4273 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4276 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4277 if (ret != PMINFO_R_OK) {
4278 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4281 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4286 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4287 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4288 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4289 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4291 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4292 * @brief This API creates the package cert information handle to get data from db.
4294 * @par This API is for package-manager client application
4295 * @par Sync (or) Async : Synchronous API
4297 * @param[out] handle pointer to the package cert handle.
4298 * @return 0 if success, error code(<0) if fail
4299 * @retval PMINFO_R_OK success
4300 * @retval PMINFO_R_EINVAL invalid argument
4301 * @retval PMINFO_R_ERROR internal error
4303 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4304 * @see pkgmgrinfo_pkginfo_get_cert_value()
4305 * @see pkgmgrinfo_pkginfo_load_certinfo()
4307 static int get_cert_info(const char *pkgid)
4310 pkgmgrinfo_certinfo_h handle;
4311 char *auth_cert = NULL;
4312 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4313 if (ret != PMINFO_R_OK)
4315 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4316 if (ret != PMINFO_R_OK) {
4317 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4320 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4321 if (ret != PMINFO_R_OK) {
4322 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4325 printf("Author root certificate: %s\n", auth_root);
4326 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4331 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4334 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4335 * @brief This API loads the package cert information handle with data from db.
4337 * @par This API is for package-manager client application
4338 * @par Sync (or) Async : Synchronous API
4340 * @param[in] pkgid pointer to the package ID.
4341 * @param[in] handle pointer to the package cert handle.
4342 * @return 0 if success, error code(<0) if fail
4343 * @retval PMINFO_R_OK success
4344 * @retval PMINFO_R_EINVAL invalid argument
4345 * @retval PMINFO_R_ERROR internal error
4346 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4347 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4348 * @see pkgmgrinfo_pkginfo_get_cert_value()
4350 static int get_cert_info(const char *pkgid)
4353 pkgmgrinfo_certinfo_h handle;
4354 char *auth_cert = NULL;
4355 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4356 if (ret != PMINFO_R_OK)
4358 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4359 if (ret != PMINFO_R_OK) {
4360 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4363 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4364 if (ret != PMINFO_R_OK) {
4365 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4368 printf("Author root certificate: %s\n", auth_root);
4369 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4374 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4377 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4378 * @brief This API gets the package cert information from the handle
4380 * @par This API is for package-manager client application
4381 * @par Sync (or) Async : Synchronous API
4383 * @param[in] handle pointer to the package cert handle.
4384 * @param[in] cert_type certificate type
4385 * @param[out] cert_value pointer to hold certificate value
4386 * @return 0 if success, error code(<0) if fail
4387 * @retval PMINFO_R_OK success
4388 * @retval PMINFO_R_EINVAL invalid argument
4389 * @retval PMINFO_R_ERROR internal error
4390 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4391 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4392 * @see pkgmgrinfo_pkginfo_load_certinfo()
4394 static int get_cert_info(const char *pkgid)
4397 pkgmgrinfo_certinfo_h handle;
4398 char *auth_cert = NULL;
4399 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4400 if (ret != PMINFO_R_OK)
4402 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4403 if (ret != PMINFO_R_OK) {
4404 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4407 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4408 if (ret != PMINFO_R_OK) {
4409 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4412 printf("Author root certificate: %s\n", auth_root);
4413 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4418 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4421 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4422 * @brief This API destroys the package cert information handle freeing up all the resources
4424 * @par This API is for package-manager client application
4425 * @par Sync (or) Async : Synchronous API
4427 * @param[in] handle pointer to the package cert handle.
4428 * @return 0 if success, error code(<0) if fail
4429 * @retval PMINFO_R_OK success
4430 * @retval PMINFO_R_EINVAL invalid argument
4431 * @retval PMINFO_R_ERROR internal error
4432 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4434 * @see pkgmgrinfo_pkginfo_load_certinfo()
4436 static int get_cert_info(const char *pkgid)
4439 pkgmgrinfo_certinfo_h handle;
4440 char *auth_cert = NULL;
4441 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4442 if (ret != PMINFO_R_OK)
4444 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4445 if (ret != PMINFO_R_OK) {
4446 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4449 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4450 if (ret != PMINFO_R_OK) {
4451 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4454 printf("Author root certificate: %s\n", auth_root);
4455 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4460 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4463 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4464 * @brief This API deletes the package cert information from DB
4466 * @par This API is for package-manager client application
4467 * @par Sync (or) Async : Synchronous API
4469 * @param[in] pkgid pointer to the package ID.
4470 * @return 0 if success, error code(<0) if fail
4471 * @retval PMINFO_R_OK success
4472 * @retval PMINFO_R_EINVAL invalid argument
4473 * @retval PMINFO_R_ERROR internal error
4477 static int delete_cert_info(const char *pkgid)
4480 ret = pkgmgrinfo_delete_certinfo(pkgid);
4481 if (ret != PMINFO_R_OK)
4487 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4490 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4491 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4492 * @brief This API creates the package db information handle to set data in db.
4494 * @par This API is for package-manager client application
4495 * @par Sync (or) Async : Synchronous API
4497 * @param[in] pkgid pointer to the package ID.
4498 * @param[in] uid the addressee user id of the instruction
4499 * @param[out] handle pointer to the package db info handle.
4500 * @return 0 if success, error code(<0) if fail
4501 * @retval PMINFO_R_OK success
4502 * @retval PMINFO_R_EINVAL invalid argument
4503 * @retval PMINFO_R_ERROR internal error
4505 * @post pkgmgrinfo_destroy_pkgdbinfo()
4506 * @see pkgmgrinfo_save_pkgdbinfo()
4507 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4509 static int set_pkg_in_db(const char *pkgid)
4512 pkgmgrinfo_pkgdbinfo_h handle;
4513 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4514 if (ret != PMINFO_R_OK)
4516 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4517 if (ret != PMINFO_R_OK) {
4518 pkgmgrinfo_destroy_pkgdbinfo(handle);
4521 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4522 if (ret != PMINFO_R_OK) {
4523 pkgmgrinfo_destroy_pkgdbinfo(handle);
4526 pkgmgrinfo_destroy_pkgdbinfo(handle);
4531 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4532 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4535 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4536 * @brief This API sets the package type in db handle
4538 * @par This API is for package-manager client application
4539 * @par Sync (or) Async : Synchronous API
4541 * @param[in] handle pointer to the pkgdbinfo handle.
4542 * @param[in] type pointer to the package type.
4543 * @return 0 if success, error code(<0) if fail
4544 * @retval PMINFO_R_OK success
4545 * @retval PMINFO_R_EINVAL invalid argument
4546 * @retval PMINFO_R_ERROR internal error
4547 * @pre pkgmgrinfo_create_pkgdbinfo()
4548 * @post pkgmgrinfo_destroy_pkgdbinfo()
4549 * @see pkgmgrinfo_save_pkgdbinfo()
4550 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4552 static int set_pkg_type_in_db(const char *pkgid)
4555 pkgmgrinfo_pkgdbinfo_h handle;
4556 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4557 if (ret != PMINFO_R_OK)
4559 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4560 if (ret != PMINFO_R_OK) {
4561 pkgmgrinfo_destroy_pkgdbinfo(handle);
4564 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4565 if (ret != PMINFO_R_OK) {
4566 pkgmgrinfo_destroy_pkgdbinfo(handle);
4569 pkgmgrinfo_destroy_pkgdbinfo(handle);
4574 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4577 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4578 * @brief This API sets the package version in db handle
4580 * @par This API is for package-manager client application
4581 * @par Sync (or) Async : Synchronous API
4583 * @param[in] handle pointer to the pkgdbinfo handle.
4584 * @param[in] version pointer to the package version
4585 * @return 0 if success, error code(<0) if fail
4586 * @retval PMINFO_R_OK success
4587 * @retval PMINFO_R_EINVAL invalid argument
4588 * @retval PMINFO_R_ERROR internal error
4589 * @pre pkgmgrinfo_create_pkgdbinfo()
4590 * @post pkgmgrinfo_destroy_pkgdbinfo()
4591 * @see pkgmgrinfo_save_pkgdbinfo()
4592 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4594 static int set_pkg_version_in_db(const char *pkgid)
4597 pkgmgrinfo_pkgdbinfo_h handle;
4598 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4599 if (ret != PMINFO_R_OK)
4601 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4602 if (ret != PMINFO_R_OK) {
4603 pkgmgrinfo_destroy_pkgdbinfo(handle);
4606 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4607 if (ret != PMINFO_R_OK) {
4608 pkgmgrinfo_destroy_pkgdbinfo(handle);
4611 pkgmgrinfo_destroy_pkgdbinfo(handle);
4616 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4619 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4620 * @brief This API sets the package install location in db handle
4622 * @par This API is for package-manager client application
4623 * @par Sync (or) Async : Synchronous API
4625 * @param[in] handle pointer to the pkgdbinfo handle.
4626 * @param[in] location package install location
4627 * @return 0 if success, error code(<0) if fail
4628 * @retval PMINFO_R_OK success
4629 * @retval PMINFO_R_EINVAL invalid argument
4630 * @retval PMINFO_R_ERROR internal error
4631 * @pre pkgmgrinfo_create_pkgdbinfo()
4632 * @post pkgmgrinfo_destroy_pkgdbinfo()
4633 * @see pkgmgrinfo_save_pkgdbinfo()
4634 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4636 static int set_pkg_install_location_in_db(const char *pkgid)
4639 pkgmgrinfo_pkgdbinfo_h handle;
4640 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4641 if (ret != PMINFO_R_OK)
4643 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4644 if (ret != PMINFO_R_OK) {
4645 pkgmgrinfo_destroy_pkgdbinfo(handle);
4648 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4649 if (ret != PMINFO_R_OK) {
4650 pkgmgrinfo_destroy_pkgdbinfo(handle);
4653 pkgmgrinfo_destroy_pkgdbinfo(handle);
4658 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4661 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4662 * @brief This API sets the package size in db handle
4664 * @par This API is for package-manager client application
4665 * @par Sync (or) Async : Synchronous API
4667 * @param[in] handle pointer to the pkgdbinfo handle.
4668 * @param[in] size pointer to the package size
4669 * @return 0 if success, error code(<0) if fail
4670 * @retval PMINFO_R_OK success
4671 * @retval PMINFO_R_EINVAL invalid argument
4672 * @retval PMINFO_R_ERROR internal error
4673 * @pre pkgmgrinfo_create_pkgdbinfo()
4674 * @post pkgmgrinfo_destroy_pkgdbinfo()
4675 * @see pkgmgrinfo_save_pkgdbinfo()
4676 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4678 static int set_pkg_size_in_db(const char *pkgid)
4681 pkgmgrinfo_pkgdbinfo_h handle;
4682 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4683 if (ret != PMINFO_R_OK)
4685 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4686 if (ret != PMINFO_R_OK) {
4687 pkgmgrinfo_destroy_pkgdbinfo(handle);
4690 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4691 if (ret != PMINFO_R_OK) {
4692 pkgmgrinfo_destroy_pkgdbinfo(handle);
4695 pkgmgrinfo_destroy_pkgdbinfo(handle);
4700 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4703 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4704 * @brief This API sets the package label in db handle
4706 * @par This API is for package-manager client application
4707 * @par Sync (or) Async : Synchronous API
4709 * @param[in] handle pointer to the pkgdbinfo handle.
4710 * @param[in] label pointer to the package label
4711 * @param[in] locale pointer to the locale
4712 * @return 0 if success, error code(<0) if fail
4713 * @retval PMINFO_R_OK success
4714 * @retval PMINFO_R_EINVAL invalid argument
4715 * @retval PMINFO_R_ERROR internal error
4716 * @pre pkgmgrinfo_create_pkgdbinfo()
4717 * @post pkgmgrinfo_destroy_pkgdbinfo()
4718 * @see pkgmgrinfo_save_pkgdbinfo()
4719 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4721 static int set_pkg_label_in_db(const char *pkgid)
4724 pkgmgrinfo_pkgdbinfo_h handle;
4725 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4726 if (ret != PMINFO_R_OK)
4728 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4729 if (ret != PMINFO_R_OK) {
4730 pkgmgrinfo_destroy_pkgdbinfo(handle);
4733 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_destroy_pkgdbinfo(handle);
4738 pkgmgrinfo_destroy_pkgdbinfo(handle);
4743 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4746 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4747 * @brief This API sets the package icon in db handle
4749 * @par This API is for package-manager client application
4750 * @par Sync (or) Async : Synchronous API
4752 * @param[in] handle pointer to the pkgdbinfo handle.
4753 * @param[in] icon pointer to the package icon
4754 * @param[in] locale pointer to the locale
4755 * @return 0 if success, error code(<0) if fail
4756 * @retval PMINFO_R_OK success
4757 * @retval PMINFO_R_EINVAL invalid argument
4758 * @retval PMINFO_R_ERROR internal error
4759 * @pre pkgmgrinfo_create_pkgdbinfo()
4760 * @post pkgmgrinfo_destroy_pkgdbinfo()
4761 * @see pkgmgrinfo_save_pkgdbinfo()
4762 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4764 static int set_pkg_icon_in_db(const char *pkgid)
4767 pkgmgrinfo_pkgdbinfo_h handle;
4768 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4769 if (ret != PMINFO_R_OK)
4771 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4772 if (ret != PMINFO_R_OK) {
4773 pkgmgrinfo_destroy_pkgdbinfo(handle);
4776 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4777 if (ret != PMINFO_R_OK) {
4778 pkgmgrinfo_destroy_pkgdbinfo(handle);
4781 pkgmgrinfo_destroy_pkgdbinfo(handle);
4786 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4789 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4790 * @brief This API sets the package description in db handle
4792 * @par This API is for package-manager client application
4793 * @par Sync (or) Async : Synchronous API
4795 * @param[in] handle pointer to the pkgdbinfo handle.
4796 * @param[in] description pointer to the package description
4797 * @param[in] locale pointer to the locale
4798 * @return 0 if success, error code(<0) if fail
4799 * @retval PMINFO_R_OK success
4800 * @retval PMINFO_R_EINVAL invalid argument
4801 * @retval PMINFO_R_ERROR internal error
4802 * @pre pkgmgrinfo_create_pkgdbinfo()
4803 * @post pkgmgrinfo_destroy_pkgdbinfo()
4804 * @see pkgmgrinfo_save_pkgdbinfo()
4805 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4807 static int set_pkg_description_in_db(const char *pkgid)
4810 pkgmgrinfo_pkgdbinfo_h handle;
4811 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4812 if (ret != PMINFO_R_OK)
4814 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4815 if (ret != PMINFO_R_OK) {
4816 pkgmgrinfo_destroy_pkgdbinfo(handle);
4819 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4820 if (ret != PMINFO_R_OK) {
4821 pkgmgrinfo_destroy_pkgdbinfo(handle);
4824 pkgmgrinfo_destroy_pkgdbinfo(handle);
4829 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4832 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4833 const char *author_email, const char *author_href, const char *locale)
4834 * @brief This API sets the package author info in db handle
4836 * @par This API is for package-manager client application
4837 * @par Sync (or) Async : Synchronous API
4839 * @param[in] handle pointer to the pkgdbinfo handle.
4840 * @param[in] author_name pointer to the package author name
4841 * @param[in] author_email pointer to the package author email
4842 * @param[in] author_href pointer to the package author href
4843 * @param[in] locale pointer to the locale
4844 * @return 0 if success, error code(<0) if fail
4845 * @retval PMINFO_R_OK success
4846 * @retval PMINFO_R_EINVAL invalid argument
4847 * @retval PMINFO_R_ERROR internal error
4848 * @pre pkgmgrinfo_create_pkgdbinfo()
4849 * @post pkgmgrinfo_destroy_pkgdbinfo()
4850 * @see pkgmgrinfo_save_pkgdbinfo()
4851 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4853 static int set_pkg_author_in_db(const char *pkgid)
4856 pkgmgrinfo_pkgdbinfo_h handle;
4857 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4858 if (ret != PMINFO_R_OK)
4860 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4861 if (ret != PMINFO_R_OK) {
4862 pkgmgrinfo_destroy_pkgdbinfo(handle);
4865 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4866 if (ret != PMINFO_R_OK) {
4867 pkgmgrinfo_destroy_pkgdbinfo(handle);
4870 pkgmgrinfo_destroy_pkgdbinfo(handle);
4875 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4876 const char *author_email, const char *author_href, const char *locale);
4879 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4880 * @brief This API sets the package 'removable' value in db handle
4882 * @par This API is for package-manager client application
4883 * @par Sync (or) Async : Synchronous API
4885 * @param[in] handle pointer to the pkgdbinfo handle.
4886 * @param[in] removable package removable value
4887 * @return 0 if success, error code(<0) if fail
4888 * @retval PMINFO_R_OK success
4889 * @retval PMINFO_R_EINVAL invalid argument
4890 * @retval PMINFO_R_ERROR internal error
4891 * @pre pkgmgrinfo_create_pkgdbinfo()
4892 * @post pkgmgrinfo_destroy_pkgdbinfo()
4893 * @see pkgmgrinfo_save_pkgdbinfo()
4894 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4896 static int set_pkg_removable_in_db(const char *pkgid)
4899 pkgmgrinfo_pkgdbinfo_h handle;
4900 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4901 if (ret != PMINFO_R_OK)
4903 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4904 if (ret != PMINFO_R_OK) {
4905 pkgmgrinfo_destroy_pkgdbinfo(handle);
4908 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4909 if (ret != PMINFO_R_OK) {
4910 pkgmgrinfo_destroy_pkgdbinfo(handle);
4913 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4921 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4922 * @brief This API sets the package 'preload' value in db handle
4924 * @par This API is for package-manager client application
4925 * @par Sync (or) Async : Synchronous API
4927 * @param[in] handle pointer to the pkgdbinfo handle.
4928 * @param[in] preload package preload value
4929 * @return 0 if success, error code(<0) if fail
4930 * @retval PMINFO_R_OK success
4931 * @retval PMINFO_R_EINVAL invalid argument
4932 * @retval PMINFO_R_ERROR internal error
4933 * @pre pkgmgrinfo_create_pkgdbinfo()
4934 * @post pkgmgrinfo_destroy_pkgdbinfo()
4935 * @see pkgmgrinfo_save_pkgdbinfo()
4936 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4938 static int set_pkg_preload_in_db(const char *pkgid)
4941 pkgmgrinfo_pkgdbinfo_h handle;
4942 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4943 if (ret != PMINFO_R_OK)
4945 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4946 if (ret != PMINFO_R_OK) {
4947 pkgmgrinfo_destroy_pkgdbinfo(handle);
4950 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4951 if (ret != PMINFO_R_OK) {
4952 pkgmgrinfo_destroy_pkgdbinfo(handle);
4955 pkgmgrinfo_destroy_pkgdbinfo(handle);
4960 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4963 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4964 * @brief This API sets the package 'installed_storage' value in db handle
4966 * @par This API is for package-manager client application
4967 * @par Sync (or) Async : Synchronous API
4969 * @param[in] handle pointer to the pkgdbinfo handle.
4970 * @param[in] location installed_storage value
4971 * @return 0 if success, error code(<0) if fail
4972 * @retval PMINFO_R_OK success
4973 * @retval PMINFO_R_EINVAL invalid argument
4974 * @retval PMINFO_R_ERROR internal error
4975 * @pre pkgmgrinfo_create_pkgdbinfo()
4976 * @post pkgmgrinfo_destroy_pkgdbinfo()
4977 * @see pkgmgrinfo_save_pkgdbinfo()
4979 static int set_pkg_installed_storage_in_db(const char *pkgid)
4982 pkgmgrinfo_pkgdbinfo_h handle;
4983 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4984 if (ret != PMINFO_R_OK)
4986 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4987 if (ret != PMINFO_R_OK) {
4988 pkgmgrinfo_destroy_pkgdbinfo(handle);
4991 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4992 if (ret != PMINFO_R_OK) {
4993 pkgmgrinfo_destroy_pkgdbinfo(handle);
4996 pkgmgrinfo_destroy_pkgdbinfo(handle);
5001 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5004 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5005 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5006 * @brief This API saves all the information from the handle to the DB.
5008 * @par This API is for package-manager client application
5009 * @par Sync (or) Async : Synchronous API
5011 * @param[in] handle pointer to the package db info handle.
5012 * @param[in] uid the addressee user id of the instruction
5013 * @return 0 if success, error code(<0) if fail
5014 * @retval PMINFO_R_OK success
5015 * @retval PMINFO_R_EINVAL invalid argument
5016 * @retval PMINFO_R_ERROR internal error
5017 * @pre pkgmgrinfo_create_pkgdbinfo()
5018 * @post pkgmgrinfo_destroy_pkgdbinfo()
5019 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5021 static int set_pkg_in_db(const char *pkgid)
5024 pkgmgrinfo_pkgdbinfo_h handle;
5025 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5026 if (ret != PMINFO_R_OK)
5028 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5029 if (ret != PMINFO_R_OK) {
5030 pkgmgrinfo_destroy_pkgdbinfo(handle);
5033 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5034 if (ret != PMINFO_R_OK) {
5035 pkgmgrinfo_destroy_pkgdbinfo(handle);
5038 pkgmgrinfo_destroy_pkgdbinfo(handle);
5043 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5044 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5046 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5047 * @brief This API destroys the package db information handle freeing up all the resources
5049 * @par This API is for package-manager client application
5050 * @par Sync (or) Async : Synchronous API
5052 * @param[in] handle pointer to the package db info handle.
5053 * @return 0 if success, error code(<0) if fail
5054 * @retval PMINFO_R_OK success
5055 * @retval PMINFO_R_EINVAL invalid argument
5056 * @retval PMINFO_R_ERROR internal error
5057 * @pre pkgmgrinfo_create_pkgdbinfo()
5059 * @see pkgmgrinfo_save_pkgdbinfo()
5060 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5062 static int set_pkg_in_db(const char *pkgid)
5065 pkgmgrinfo_pkgdbinfo_h handle;
5066 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5067 if (ret != PMINFO_R_OK)
5069 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5070 if (ret != PMINFO_R_OK) {
5071 pkgmgrinfo_destroy_pkgdbinfo(handle);
5074 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5075 if (ret != PMINFO_R_OK) {
5076 pkgmgrinfo_destroy_pkgdbinfo(handle);
5079 pkgmgrinfo_destroy_pkgdbinfo(handle);
5084 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5088 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5089 * @brief This API creates the package cert information handle to set data in db.
5091 * @par This API is for package-manager client application
5092 * @par Sync (or) Async : Synchronous API
5094 * @param[out] handle pointer to the package cert handle.
5095 * @return 0 if success, error code(<0) if fail
5096 * @retval PMINFO_R_OK success
5097 * @retval PMINFO_R_EINVAL invalid argument
5098 * @retval PMINFO_R_ERROR internal error
5100 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5101 * @see pkgmgrinfo_set_cert_value()
5102 * @see pkgmgrinfo_save_certinfo()
5104 static int set_cert_in_db(const char *pkgid)
5107 pkgmgrinfo_instcertinfo_h handle;
5108 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5109 if (ret != PMINFO_R_OK)
5111 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5112 if (ret != PMINFO_R_OK) {
5113 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5116 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5117 if (ret != PMINFO_R_OK) {
5118 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5121 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5126 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5129 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5130 * @brief This API sets the package cert information in the handle.
5132 * @par This API is for package-manager client application
5133 * @par Sync (or) Async : Synchronous API
5135 * @param[in] handle pointer to the package cert handle.
5136 * @param[in] cert_type certificate type.
5137 * @param[in] cert_value certificate value.
5138 * @return 0 if success, error code(<0) if fail
5139 * @retval PMINFO_R_OK success
5140 * @retval PMINFO_R_EINVAL invalid argument
5141 * @retval PMINFO_R_ERROR internal error
5142 * @pre pkgmgrinfo_create_certinfo_set_handle()
5143 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5144 * @see pkgmgrinfo_save_certinfo()
5146 static int set_cert_in_db(const char *pkgid)
5149 pkgmgrinfo_instcertinfo_h handle;
5150 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5151 if (ret != PMINFO_R_OK)
5153 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5154 if (ret != PMINFO_R_OK) {
5155 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5158 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5159 if (ret != PMINFO_R_OK) {
5160 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5163 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5168 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5171 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5172 * @brief This API saves the package cert information in the DB.
5174 * @par This API is for package-manager client application
5175 * @par Sync (or) Async : Synchronous API
5177 * @param[in] pkgid pointer to the package ID.
5178 * @param[in] handle pointer to the package cert handle.
5179 * @return 0 if success, error code(<0) if fail
5180 * @retval PMINFO_R_OK success
5181 * @retval PMINFO_R_EINVAL invalid argument
5182 * @retval PMINFO_R_ERROR internal error
5183 * @pre pkgmgrinfo_create_certinfo_set_handle()
5184 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5185 * @see pkgmgrinfo_save_certinfo()
5187 static int set_cert_in_db(const char *pkgid)
5190 pkgmgrinfo_instcertinfo_h handle;
5191 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5192 if (ret != PMINFO_R_OK)
5194 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5195 if (ret != PMINFO_R_OK) {
5196 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5199 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5200 if (ret != PMINFO_R_OK) {
5201 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5204 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5209 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5212 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5213 * @brief This API destroys the package cert information handle freeing up all the resources.
5215 * @par This API is for package-manager client application
5216 * @par Sync (or) Async : Synchronous API
5218 * @param[in] handle pointer to the package cert handle.
5219 * @return 0 if success, error code(<0) if fail
5220 * @retval PMINFO_R_OK success
5221 * @retval PMINFO_R_EINVAL invalid argument
5222 * @retval PMINFO_R_ERROR internal error
5223 * @pre pkgmgrinfo_create_certinfo_set_handle()
5225 * @see pkgmgrinfo_save_certinfo()
5227 static int set_cert_in_db(const char *pkgid)
5230 pkgmgrinfo_instcertinfo_h handle;
5231 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5232 if (ret != PMINFO_R_OK)
5234 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5235 if (ret != PMINFO_R_OK) {
5236 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5239 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5240 if (ret != PMINFO_R_OK) {
5241 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5244 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5249 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5252 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5253 * @brief This API gets the datacontrol info
5255 * @par This API is for package-manager client application
5256 * @par Sync (or) Async : Synchronous API
5258 * @param[in] providerid pointer to the providerid of dataconltrol.
5259 * @param[in] type pointer to the type of dataconltrol.
5260 * @param[out] appid pointer to hold appid, need to free after using
5261 * @param[out] access pointer to hold access, need to free after using
5262 * @return 0 if success, error code(<0) if fail
5263 * @retval PMINFO_R_OK success
5264 * @retval PMINFO_R_EINVAL invalid argument
5265 * @retval PMINFO_R_ERROR internal error
5268 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5271 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5272 * @brief This API gets the application 'guest mode visibility' value from the DB
5274 * @par This API is for package-manager client application
5275 * @par Sync (or) Async : Synchronous API
5277 * @param[in] handle pointer to application info handle
5278 * @param[out] status pointer to hold app guest mode visibility value
5279 * @return 0 if success, error code(<0) if fail
5280 * @retval PMINFO_R_OK success
5281 * @retval PMINFO_R_EINVAL invalid argument
5282 * @retval PMINFO_R_ERROR internal error
5283 * @pre pkgmgrinfo_appinfo_get_appinfo()
5284 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5285 * @see pkgmgrinfo_appinfo_get_appid()
5286 * @see pkgmgrinfo_appinfo_is_multiple()
5288 static int get_app_guestmode_visibility(const char *appid)
5292 pkgmgrinfo_appinfo_h handle;
5293 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5294 if (ret != PMINFO_R_OK)
5296 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5297 if (ret != PMINFO_R_OK) {
5298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5301 printf("app guest mode visibility: %d\n", status);
5302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5307 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5310 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5311 * @brief This API sets the application 'guest mode visibility' value in the DB
5313 * @par This API is for package-manager client application
5314 * @par Sync (or) Async : Synchronous API
5316 * @param[in] handle pointer to application info handle
5317 * @param[out] status app guest mode visibility value
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
5322 * @pre pkgmgrinfo_appinfo_get_appinfo()
5323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5324 * @see pkgmgrinfo_appinfo_get_appid()
5325 * @see pkgmgrinfo_appinfo_is_multiple()
5327 static int set_app_guestmode_visibility(const char *appid, bool value)
5330 pkgmgrinfo_appinfo_h handle;
5331 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5332 if (ret != PMINFO_R_OK)
5334 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5335 if (ret != PMINFO_R_OK) {
5336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5344 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5345 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5347 * @pkgmgrinfo client API
5351 * @brief listening status type in pkgmgrinfo.
5353 #define PMINFO_CLIENT_STATUS_ALL 0x00
5354 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5355 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5356 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5357 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5358 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5359 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5362 * @brief type definition.
5364 typedef void pkgmgrinfo_client;
5365 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5366 const char *pkgid, const char *key,
5367 const char *val, const void *pmsg, void *data);
5373 }pkgmgrinfo_client_type;
5376 * @brief This APIs provides pkgmgrinfo client listener
5378 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5379 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5380 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5381 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5382 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5385 * @pkgmgrinfo client API end
5393 #endif /* __PKG_INFO_H__ */