4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
76 * @brief A type to retrieve uid information from the manifest handle
80 } pkgmgrinfo_uidinfo_t;
83 * @brief A handle to insert certificate information
85 typedef void* pkgmgrinfo_instcertinfo_h;
88 * @brief Certificate Types to be used for setting information
91 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
92 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
93 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
94 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
95 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
96 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
97 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
98 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
99 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
100 }pkgmgrinfo_instcert_type;
103 PMINFO_CERT_COMPARE_MATCH,
104 PMINFO_CERT_COMPARE_MISMATCH,
105 PMINFO_CERT_COMPARE_LHS_NO_CERT,
106 PMINFO_CERT_COMPARE_RHS_NO_CERT,
107 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
108 PMINFO_CERT_COMPARE_ERROR,
109 } pkgmgrinfo_cert_compare_result_type_e;
112 * @brief API return values
115 PMINFO_R_EINVAL = -2, /**< Invalid argument */
116 PMINFO_R_ERROR = -1, /**< General error */
117 PMINFO_R_OK = 0 /**< General success */
121 * @brief Value to be used when filtering based on install location
123 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
126 * @brief Value to be used when filtering based on install location
128 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
131 * @brief Value to be used when filtering based on install location
133 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
136 * @brief Value to be used when filtering based on app-component
138 #define PMINFO_APPINFO_UI_APP "UI_APP"
141 * @brief Value to be used when filtering based on app-component
143 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
146 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
147 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
148 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
149 }pkgmgrinfo_app_hwacceleration;
152 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
153 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
154 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
155 }pkgmgrinfo_app_screenreader;
158 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
159 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
160 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
161 }pkgmgrinfo_app_recentimage;
164 * @brief A handle to get package information
166 typedef void* pkgmgrinfo_pkginfo_h;
169 * @brief A handle to get application information
171 typedef void* pkgmgrinfo_appinfo_h;
174 * @brief A handle to get certificate information
176 typedef void* pkgmgrinfo_certinfo_h;
179 * @brief A handle to insert package information
181 typedef void* pkgmgrinfo_pkgdbinfo_h;
184 * @brief A handle to filter package information
186 typedef void* pkgmgrinfo_pkginfo_filter_h;
189 * @brief A handle to filter application information
191 typedef void* pkgmgrinfo_appinfo_filter_h;
194 * @brief A handle to filter application metadata information
196 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
199 * @brief A handle to get appcontrol information
201 typedef void* pkgmgrinfo_appcontrol_h;
204 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
206 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
208 * @param[in] handle the pkginfo handle
209 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
211 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
213 * @see pkgmgrinfo_pkginfo_get_list()
214 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
216 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
220 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
222 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
224 * @param[in] handle the appinfo handle
225 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
227 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
229 * @see pkgmgrinfo_appinfo_get_list()
230 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
231 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
233 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
237 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
239 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
241 * @param[in] category_name the name of the category
242 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
244 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
246 * @see pkgmgrinfo_appinfo_foreach_category()
248 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
252 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
254 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
256 * @param[in] permission_name the name of the permission
257 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
259 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
261 * @see pkgmgrinfo_appinfo_foreach_category()
263 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
267 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
269 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
271 * @param[in] privilege_name the name of the privilege
272 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
274 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
276 * @see pkgmgrinfo_pkginfo_foreach_privilege()
278 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
282 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
284 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
286 * @param[in] metadata_name the name of the metadata
287 * @param[in] metadata_value the value of the metadata
288 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
290 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
292 * @see pkgmgrinfo_appinfo_foreach_metadata()
294 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
295 const char *metadata_value, void *user_data);
298 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
300 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
302 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
303 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
305 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
307 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
309 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
313 * @brief Install Location Types
316 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
317 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
318 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
319 }pkgmgrinfo_install_location;
322 * @brief Application Component Types
325 PMINFO_ALL_APP = 0, /**< All Application*/
326 PMINFO_UI_APP, /**< UI Application*/
327 PMINFO_SVC_APP, /**< Service Application*/
328 }pkgmgrinfo_app_component;
331 * @brief Application Storage Types
334 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
335 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
336 }pkgmgrinfo_installed_storage;
339 * @brief Certificate Types to be used for getting information
342 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
343 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
344 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
345 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
346 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
347 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
348 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
349 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
350 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
351 }pkgmgrinfo_cert_type;
354 * @brief Install Location Types to be used when setting data in DB
357 INSTALL_INTERNAL = 0, /**< Internal Installation*/
358 INSTALL_EXTERNAL, /**< External Installation*/
362 * @brief permission Types
365 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
366 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
367 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
368 }pkgmgrinfo_permission_type;
371 /** String property for filtering based on package info*/
372 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
381 /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
383 /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
385 /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
388 /** Boolean property for filtering based on package info*/
389 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
394 /** Boolean property for filtering based on package info*/
395 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
396 /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
398 /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
401 /** Integer property for filtering based on package info*/
402 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
404 /** String property for filtering based on app info*/
405 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
420 /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
422 /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
424 /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
427 /** Boolean property for filtering based on app info*/
428 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
433 /** Boolean property for filtering based on app info*/
434 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
435 /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
437 /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
440 /** will be updated*/
441 /** string property for filtering based on pkg info*/
442 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
444 /* For multiuser support */
445 char *getUserPkgParserDBPath(void);
446 char *getUserPkgParserDBPathUID(uid_t uid);
447 char *getUserPkgCertDBPath(void);
448 char *getUserPkgCertDBPathUID(uid_t uid);
449 const char* getUserDesktopPath(uid_t uid);
450 const char* getUserManifestPath(uid_t uid);
453 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
454 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
455 * @brief This API gets list of installed packages
457 * @par This API is for package-manager client application
458 * @par Sync (or) Async : Synchronous API
459 * @param[in] pkg_list_cb iteration function for list
460 * @param[in] user_data user data to be passed to callback function
461 * @param[in] uid the addressee user id of the instruction
462 * @return 0 if success, error code(<0) if fail
463 * @retval PMINFO_R_OK success
464 * @retval PMINFO_R_EINVAL invalid argument
465 * @retval PMINFO_R_ERROR internal error
469 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
473 pkgid1 = (char *)user_data;
474 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
475 if (strcmp(pkgid1, pkgid2) == 0) {
482 static int list_pkgs()
485 char *name = "helloworld";
486 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
487 if (ret != PMINFO_R_OK) {
494 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
495 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
497 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
498 * @brief This API creates the package information handle from db
500 * @par This API is for package-manager client application
501 * @par Sync (or) Async : Synchronous API
503 * @param[in] pkgid pointer to package ID
504 * @param[in] uid the addressee user id of the instruction
505 * @param[out] handle pointer to the package info handle.
506 * @return 0 if success, error code(<0) if fail
507 * @retval PMINFO_R_OK success
508 * @retval PMINFO_R_EINVAL invalid argument
509 * @retval PMINFO_R_ERROR internal error
511 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
512 * @see pkgmgrinfo_pkginfo_get_pkgid()
513 * @see pkgmgrinfo_pkginfo_is_removable()
515 static int get_pkg_type(const char *pkgid)
519 pkgmgrinfo_pkginfo_h handle;
520 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
521 if (ret != PMINFO_R_OK)
523 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
524 if (ret != PMINFO_R_OK) {
525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
528 printf("pkgtype: %s\n", type);
529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
534 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
535 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
538 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
539 * @brief This API gets the package name from the package ID
541 * @par This API is for package-manager client application
542 * @par Sync (or) Async : Synchronous API
544 * @param[in] handle pointer to package info handle
545 * @param[out] pkg_name pointer to hold package name
546 * @return 0 if success, error code(<0) if fail
547 * @retval PMINFO_R_OK success
548 * @retval PMINFO_R_EINVAL invalid argument
549 * @retval PMINFO_R_ERROR internal error
550 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
551 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
552 * @see pkgmgrinfo_pkginfo_get_type()
553 * @see pkgmgrinfo_pkginfo_is_removable()
555 static int get_pkg_name(const char *pkgid)
558 char *pkgname = NULL;
559 pkgmgrinfo_pkginfo_h handle;
560 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
561 if (ret != PMINFO_R_OK)
563 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
564 if (ret != PMINFO_R_OK) {
565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
568 printf("pkgname: %s\n", pkgname);
569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
574 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
577 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
578 * @brief This API gets the package id from the package ID
580 * @par This API is for package-manager client application
581 * @par Sync (or) Async : Synchronous API
583 * @param[in] handle pointer to package info handle
584 * @param[out] pkgid pointer to hold package id
585 * @return 0 if success, error code(<0) if fail
586 * @retval PMINFO_R_OK success
587 * @retval PMINFO_R_EINVAL invalid argument
588 * @retval PMINFO_R_ERROR internal error
589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
591 * @see pkgmgrinfo_pkginfo_get_type()
592 * @see pkgmgrinfo_pkginfo_is_removable()
594 static int get_pkgid(const char *pkgid)
598 pkgmgrinfo_pkginfo_h handle;
599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
600 if (ret != PMINFO_R_OK)
602 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
603 if (ret != PMINFO_R_OK) {
604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
607 printf("pkg id: %s\n", pkg_id);
608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
616 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
617 * @brief This API gets the package type from the package ID
619 * @par This API is for package-manager client application
620 * @par Sync (or) Async : Synchronous API
622 * @param[in] handle pointer to package info handle
623 * @param[out] type pointer to hold package type
624 * @return 0 if success, error code(<0) if fail
625 * @retval PMINFO_R_OK success
626 * @retval PMINFO_R_EINVAL invalid argument
627 * @retval PMINFO_R_ERROR internal error
628 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
629 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
630 * @see pkgmgrinfo_pkginfo_get_pkgid()
631 * @see pkgmgrinfo_pkginfo_is_removable()
633 static int get_pkg_type(const char *pkgid)
637 pkgmgrinfo_pkginfo_h handle;
638 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
639 if (ret != PMINFO_R_OK)
641 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
642 if (ret != PMINFO_R_OK) {
643 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
646 printf("pkgtype: %s\n", type);
647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
652 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
655 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
656 * @brief This API gets the package version from the package ID
658 * @par This API is for package-manager client application
659 * @par Sync (or) Async : Synchronous API
661 * @param[in] handle pointer to package info handle
662 * @param[out] version pointer to hold package version
663 * @return 0 if success, error code(<0) if fail
664 * @retval PMINFO_R_OK success
665 * @retval PMINFO_R_EINVAL invalid argument
666 * @retval PMINFO_R_ERROR internal error
667 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
668 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
669 * @see pkgmgrinfo_pkginfo_get_pkgid()
670 * @see pkgmgrinfo_pkginfo_is_removable()
672 static int get_pkg_version(const char *pkgid)
675 char *version = NULL;
676 pkgmgrinfo_pkginfo_h handle;
677 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
678 if (ret != PMINFO_R_OK)
680 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
681 if (ret != PMINFO_R_OK) {
682 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
685 printf("pkg version: %s\n", version);
686 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
691 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
694 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
695 * @brief This API gets the package install location from the package ID
697 * @par This API is for package-manager client application
698 * @par Sync (or) Async : Synchronous API
700 * @param[in] handle pointer to package info handle
701 * @param[out] location pointer to hold package install location
702 * @return 0 if success, error code(<0) if fail
703 * @retval PMINFO_R_OK success
704 * @retval PMINFO_R_EINVAL invalid argument
705 * @retval PMINFO_R_ERROR internal error
706 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
707 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
708 * @see pkgmgrinfo_pkginfo_get_pkgid()
709 * @see pkgmgrinfo_pkginfo_is_removable()
711 static int get_pkg_install_location(const char *pkgid)
714 pkgmgrinfo_install_location location;
715 pkgmgrinfo_pkginfo_h handle;
716 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
717 if (ret != PMINFO_R_OK)
719 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
720 if (ret != PMINFO_R_OK) {
721 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
724 printf("pkg install location: %d\n", location);
725 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
730 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
733 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
734 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
735 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
736 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
738 * @par This API is for package-manager client application
739 * @par Sync (or) Async : Synchronous API
741 * @param[in] handle pointer to package info handle
742 * @param[out] size pointer to hold package size
743 * @return 0 if success, error code(<0) if fail
744 * @retval PMINFO_R_OK success
745 * @retval PMINFO_R_EINVAL invalid argument
746 * @retval PMINFO_R_ERROR internal error
747 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
748 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
749 * @see pkgmgrinfo_pkginfo_get_pkgid()
750 * @see pkgmgrinfo_pkginfo_is_removable()
752 static int get_pkg_size(const char *pkgid)
756 pkgmgrinfo_pkginfo_h handle;
757 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
758 if (ret != PMINFO_R_OK)
760 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
761 if (ret != PMINFO_R_OK) {
762 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
765 printf("pkgsize: %d\n", size);
766 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
771 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
774 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
775 * @brief This API gets the installed package total size on the target.
777 * @par This API is for package-manager client application
778 * @par Sync (or) Async : Synchronous API
780 * @param[in] handle pointer to package info handle
781 * @param[out] size pointer to hold package total size
782 * @return 0 if success, error code(<0) if fail
783 * @retval PMINFO_R_OK success
784 * @retval PMINFO_R_EINVAL invalid argument
785 * @retval PMINFO_R_ERROR internal error
787 static int get_pkg_total_size(const char *pkgid)
791 pkgmgrinfo_pkginfo_h handle;
792 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
793 if (ret != PMINFO_R_OK)
795 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
796 if (ret != PMINFO_R_OK) {
797 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
800 printf("pkg total size: %d\n", size);
801 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
806 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
809 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
810 * @brief This API gets the installed package data size on the target.
812 * @par This API is for package-manager client application
813 * @par Sync (or) Async : Synchronous API
815 * @param[in] handle pointer to package info handle
816 * @param[out] size pointer to hold package data size
817 * @return 0 if success, error code(<0) if fail
818 * @retval PMINFO_R_OK success
819 * @retval PMINFO_R_EINVAL invalid argument
820 * @retval PMINFO_R_ERROR internal error
822 static int get_pkg_data_size(const char *pkgid)
826 pkgmgrinfo_pkginfo_h handle;
827 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
828 if (ret != PMINFO_R_OK)
830 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
831 if (ret != PMINFO_R_OK) {
832 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
835 printf("pkg data size: %d\n", size);
836 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
841 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
844 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
845 * @brief This API gets the package icon from the package ID
847 * @par This API is for package-manager client application
848 * @par Sync (or) Async : Synchronous API
850 * @param[in] handle pointer to package info handle
851 * @param[out] icon pointer to hold package icon
852 * @return 0 if success, error code(<0) if fail
853 * @retval PMINFO_R_OK success
854 * @retval PMINFO_R_EINVAL invalid argument
855 * @retval PMINFO_R_ERROR internal error
856 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
857 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
858 * @see pkgmgrinfo_pkginfo_get_pkgid()
859 * @see pkgmgrinfo_pkginfo_is_removable()
861 static int get_pkg_icon(const char *pkgid)
865 pkgmgrinfo_pkginfo_h handle;
866 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
867 if (ret != PMINFO_R_OK)
869 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
870 if (ret != PMINFO_R_OK) {
871 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
874 printf("pkg icon: %s\n", icon);
875 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
880 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
883 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
884 * @brief This API gets the package description from the package ID
886 * @par This API is for package-manager client application
887 * @par Sync (or) Async : Synchronous API
889 * @param[in] handle pointer to package info handle
890 * @param[out] description pointer to hold package description
891 * @return 0 if success, error code(<0) if fail
892 * @retval PMINFO_R_OK success
893 * @retval PMINFO_R_EINVAL invalid argument
894 * @retval PMINFO_R_ERROR internal error
895 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
896 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
897 * @see pkgmgrinfo_pkginfo_get_pkgid()
898 * @see pkgmgrinfo_pkginfo_is_removable()
900 static int get_pkg_description(const char *pkgid)
903 char *description = NULL;
904 pkgmgrinfo_pkginfo_h handle;
905 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
906 if (ret != PMINFO_R_OK)
908 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
909 if (ret != PMINFO_R_OK) {
910 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
913 printf("pkg description: %s\n", description);
914 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
919 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
922 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
923 * @brief This API gets the package's author name from the package ID
925 * @par This API is for package-manager client application
926 * @par Sync (or) Async : Synchronous API
928 * @param[in] handle pointer to package info handle
929 * @param[out] author_name pointer to hold package author name
930 * @return 0 if success, error code(<0) if fail
931 * @retval PMINFO_R_OK success
932 * @retval PMINFO_R_EINVAL invalid argument
933 * @retval PMINFO_R_ERROR internal error
934 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
935 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
936 * @see pkgmgrinfo_pkginfo_get_pkgid()
937 * @see pkgmgrinfo_pkginfo_is_removable()
939 static int get_pkg_author_name(const char *pkgid)
942 char *author_name = NULL;
943 pkgmgrinfo_pkginfo_h handle;
944 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
945 if (ret != PMINFO_R_OK)
947 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
948 if (ret != PMINFO_R_OK) {
949 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
952 printf("pkg author name: %s\n", author_name);
953 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
958 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
961 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
962 * @brief This API gets the package's author email from the package ID
964 * @par This API is for package-manager client application
965 * @par Sync (or) Async : Synchronous API
967 * @param[in] handle pointer to package info handle
968 * @param[out] author_email pointer to hold package author email
969 * @return 0 if success, error code(<0) if fail
970 * @retval PMINFO_R_OK success
971 * @retval PMINFO_R_EINVAL invalid argument
972 * @retval PMINFO_R_ERROR internal error
973 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
974 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
975 * @see pkgmgrinfo_pkginfo_get_pkgid()
976 * @see pkgmgrinfo_pkginfo_is_removable()
978 static int get_pkg_author_email(const char *pkgid)
981 char *author_email = NULL;
982 pkgmgrinfo_pkginfo_h handle;
983 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
984 if (ret != PMINFO_R_OK)
986 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
987 if (ret != PMINFO_R_OK) {
988 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
991 printf("pkg author email: %s\n", author_email);
992 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
997 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1000 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1001 * @brief This API gets the package's author href from the package ID
1003 * @par This API is for package-manager client application
1004 * @par Sync (or) Async : Synchronous API
1006 * @param[in] handle pointer to package info handle
1007 * @param[out] author_href pointer to hold package author href
1008 * @return 0 if success, error code(<0) if fail
1009 * @retval PMINFO_R_OK success
1010 * @retval PMINFO_R_EINVAL invalid argument
1011 * @retval PMINFO_R_ERROR internal error
1012 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1013 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1014 * @see pkgmgrinfo_pkginfo_get_pkgid()
1015 * @see pkgmgrinfo_pkginfo_is_removable()
1017 static int get_pkg_author_href(const char *pkgid)
1020 char *author_href = NULL;
1021 pkgmgrinfo_pkginfo_h handle;
1022 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1023 if (ret != PMINFO_R_OK)
1025 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1026 if (ret != PMINFO_R_OK) {
1027 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1030 printf("pkg author href: %s\n", author_href);
1031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1036 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1039 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1040 * @brief This API gets the package installed storagae value from the package ID
1042 * @par This API is for package-manager client application
1043 * @par Sync (or) Async : Synchronous API
1045 * @param[in] handle pointer to package info handle
1046 * @param[out] storage pointer to hold package installed storage
1047 * @return 0 if success, error code(<0) if fail
1048 * @retval PMINFO_R_OK success
1049 * @retval PMINFO_R_EINVAL invalid argument
1050 * @retval PMINFO_R_ERROR internal error
1051 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1052 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1053 * @see pkgmgrinfo_pkginfo_get_pkgid()
1054 * @see pkgmgrinfo_pkginfo_is_removable()
1056 static int get_pkg_installed_storage(const char *pkgid)
1059 pkgmgrinfo_installed_storage storage;
1060 pkgmgrinfo_pkginfo_h handle;
1061 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1062 if (ret != PMINFO_R_OK)
1064 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1065 if (ret != PMINFO_R_OK) {
1066 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1069 printf("pkg installed storage: %d\n", storage);
1070 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1075 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1078 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1079 * @brief This API gets the installed time of package from the package ID
1081 * @par This API is for package-manager client application
1082 * @par Sync (or) Async : Synchronous API
1084 * @param[in] handle pointer to package info handle
1085 * @param[out] installed_time pointer to hold installed time of package
1086 * @return 0 if success, error code(<0) if fail
1087 * @retval PMINFO_R_OK success
1088 * @retval PMINFO_R_EINVAL invalid argument
1089 * @retval PMINFO_R_ERROR internal error
1090 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1091 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1092 * @see pkgmgrinfo_pkginfo_get_pkgid()
1093 * @see pkgmgrinfo_pkginfo_is_removable()
1095 static int get_pkg_installed_time(const char *pkgid)
1098 int installed_time = 0;
1099 pkgmgrinfo_pkginfo_h handle;
1100 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1101 if (ret != PMINFO_R_OK)
1103 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1104 if (ret != PMINFO_R_OK) {
1105 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1108 printf("installed_time: %d\n", installed_time);
1109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1114 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1117 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1118 * @brief This API gets the store client id of package from the package ID
1120 * @par This API is for package-manager client application
1121 * @par Sync (or) Async : Synchronous API
1123 * @param[in] handle pointer to package info handle
1124 * @param[out] storeclientid pointer to hold store client id of package
1125 * @return 0 if success, error code(<0) if fail
1126 * @retval PMINFO_R_OK success
1127 * @retval PMINFO_R_EINVAL invalid argument
1128 * @retval PMINFO_R_ERROR internal error
1129 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1130 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1131 * @see pkgmgrinfo_pkginfo_get_pkgid()
1132 * @see pkgmgrinfo_pkginfo_is_removable()
1134 static int get_pkg_storeclientid(const char *pkgid)
1137 char *storeclientid = 0;
1138 pkgmgrinfo_pkginfo_h handle;
1139 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1140 if (ret != PMINFO_R_OK)
1142 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1143 if (ret != PMINFO_R_OK) {
1144 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1147 printf(store client id: %s\n", storeclientid);
1148 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1153 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1156 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1157 * @brief This API gets the main app id of package from the package ID
1159 * @par This API is for package-manager client application
1160 * @par Sync (or) Async : Synchronous API
1162 * @param[in] handle pointer to package info handle
1163 * @param[out] mainappid pointer to hold main app id of package
1164 * @return 0 if success, error code(<0) if fail
1165 * @retval PMINFO_R_OK success
1166 * @retval PMINFO_R_EINVAL invalid argument
1167 * @retval PMINFO_R_ERROR internal error
1168 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1169 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1170 * @see pkgmgrinfo_pkginfo_get_pkgid()
1171 * @see pkgmgrinfo_pkginfo_is_removable()
1173 static int get_pkg_mainappid(const char *pkgid)
1176 char *mainappid = 0;
1177 pkgmgrinfo_pkginfo_h handle;
1178 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1179 if (ret != PMINFO_R_OK)
1181 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1182 if (ret != PMINFO_R_OK) {
1183 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1186 printf(main app id: %s\n", mainappid);
1187 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1192 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1195 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1196 * @brief This API gets the url of package from the package ID
1198 * @par This API is for package-manager client application
1199 * @par Sync (or) Async : Synchronous API
1201 * @param[in] handle pointer to package info handle
1202 * @param[out] url pointer to hold url of package
1203 * @return 0 if success, error code(<0) if fail
1204 * @retval PMINFO_R_OK success
1205 * @retval PMINFO_R_EINVAL invalid argument
1206 * @retval PMINFO_R_ERROR internal error
1207 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1208 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1209 * @see pkgmgrinfo_pkginfo_get_pkgid()
1210 * @see pkgmgrinfo_pkginfo_is_removable()
1212 static int get_pkg_url(const char *pkgid)
1216 pkgmgrinfo_pkginfo_h handle;
1217 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1218 if (ret != PMINFO_R_OK)
1220 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1221 if (ret != PMINFO_R_OK) {
1222 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1225 printf("url : %s\n", url);
1226 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1231 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1235 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1236 * @brief This API gets the root path of package
1238 * @par Sync (or) Async : Synchronous API
1240 * @param[in] handle pointer to package info handle
1241 * @param[out] path pointer to hold root path of package
1242 * @return 0 if success, error code(<0) if fail
1243 * @retval PMINFO_R_OK success
1244 * @retval PMINFO_R_EINVAL invalid argument
1245 * @retval PMINFO_R_ERROR internal error
1247 static int get_root_path(const char *pkgid)
1251 pkgmgrinfo_pkginfo_h handle;
1252 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1253 if (ret != PMINFO_R_OK)
1256 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1257 if (ret != PMINFO_R_OK) {
1258 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1261 printf("path : %s\n", path);
1262 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1268 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1272 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1273 * @brief This API gets the csc path of package
1275 * @par Sync (or) Async : Synchronous API
1277 * @param[in] handle pointer to package info handle
1278 * @param[out] path pointer to hold csc path of package
1279 * @return 0 if success, error code(<0) if fail
1280 * @retval PMINFO_R_OK success
1281 * @retval PMINFO_R_EINVAL invalid argument
1282 * @retval PMINFO_R_ERROR internal error
1284 static int get_csc_path(const char *pkgid)
1288 pkgmgrinfo_pkginfo_h handle;
1289 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1290 if (ret != PMINFO_R_OK)
1293 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1294 if (ret != PMINFO_R_OK) {
1295 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1298 printf("path : %s\n", path);
1299 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1305 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1308 * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1309 * @brief This API compare the cert information from given package id
1311 * @par This API is for package-manager client application
1312 * @par Sync (or) Async : Synchronous API
1314 * @param[in] lhs_package_id pointer to first package ID
1315 * @param[in] rhs_package_id pointer to second package ID
1316 * @param[out] compare_result pointer to the compare result.
1317 * @return 0 if success, error code(<0) if fail
1318 * @retval PMINFO_R_OK success
1319 * @retval PMINFO_R_EINVAL invalid argument
1320 * @retval PMINFO_R_ERROR internal error
1322 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1323 * @see pkgmgrinfo_pkginfo_get_pkgid()
1324 * @see pkgmgrinfo_pkginfo_is_removable()
1326 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1329 pkgmgrinfo_cert_compare_result_type_e result;
1331 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1332 if (ret != PMINFO_R_OK) {
1335 printf("result: %d\n", result);
1340 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1341 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1343 * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1344 * @brief This API compare the cert information from given app id
1346 * @par This API is for package-manager client application
1347 * @par Sync (or) Async : Synchronous API
1349 * @param[in] lhs_app_id pointer to first app ID
1350 * @param[in] rhs_app_id pointer to second app ID
1351 * @param[out] compare_result pointer to the compare result.
1352 * @return 0 if success, error code(<0) if fail
1353 * @retval PMINFO_R_OK success
1354 * @retval PMINFO_R_EINVAL invalid argument
1355 * @retval PMINFO_R_ERROR internal error
1357 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1358 * @see pkgmgrinfo_pkginfo_get_pkgid()
1359 * @see pkgmgrinfo_pkginfo_is_removable()
1361 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1364 pkgmgrinfo_cert_compare_result_type_e result;
1366 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1367 if (ret != PMINFO_R_OK) {
1370 printf("result: %d\n", result);
1375 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1376 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1378 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1379 * @brief This API gets the package 'removable' value from the package ID
1381 * @par This API is for package-manager client application
1382 * @par Sync (or) Async : Synchronous API
1384 * @param[in] handle pointer to package info handle
1385 * @param[out] removable pointer to hold package removable value
1386 * @return 0 if success, error code(<0) if fail
1387 * @retval PMINFO_R_OK success
1388 * @retval PMINFO_R_EINVAL invalid argument
1389 * @retval PMINFO_R_ERROR internal error
1390 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1391 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1392 * @see pkgmgrinfo_pkginfo_get_pkgid()
1393 * @see pkgmgrinfo_pkginfo_is_readonly()
1395 static int get_pkg_removable(const char *pkgid)
1399 pkgmgrinfo_pkginfo_h handle;
1400 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1401 if (ret != PMINFO_R_OK)
1403 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1404 if (ret != PMINFO_R_OK) {
1405 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1408 printf("pkg removable: %d\n", removable);
1409 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1414 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1417 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1418 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1420 * @par This API is for package-manager client application
1421 * @par Sync (or) Async : Synchronous API
1423 * @param[in] handle pointer to package info handle
1424 * @param[out] movable pointer to hold package movable state
1425 * @return 0 if success, error code(<0) if fail
1426 * @retval PMINFO_R_OK success
1427 * @retval PMINFO_R_EINVAL invalid argument
1428 * @retval PMINFO_R_ERROR internal error
1429 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1430 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1431 * @see pkgmgrinfo_pkginfo_get_pkgid()
1433 static int get_pkg_movable(const char *pkgid)
1437 pkgmgrinfo_pkginfo_h handle;
1438 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1439 if (ret != PMINFO_R_OK)
1441 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1442 if (ret != PMINFO_R_OK) {
1443 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 printf("pkg movable: %d\n", movable);
1447 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1452 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1455 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1456 * @brief This API gets the package 'preload' value from the package ID
1458 * @par This API is for package-manager client application
1459 * @par Sync (or) Async : Synchronous API
1461 * @param[in] handle pointer to package info handle
1462 * @param[out] preload pointer to hold package preload value
1463 * @return 0 if success, error code(<0) if fail
1464 * @retval PMINFO_R_OK success
1465 * @retval PMINFO_R_EINVAL invalid argument
1466 * @retval PMINFO_R_ERROR internal error
1467 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1468 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1469 * @see pkgmgrinfo_pkginfo_get_pkgid()
1470 * @see pkgmgrinfo_pkginfo_is_readonly()
1472 static int get_pkg_preload(const char *pkgid)
1476 pkgmgrinfo_pkginfo_h handle;
1477 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1478 if (ret != PMINFO_R_OK)
1480 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1481 if (ret != PMINFO_R_OK) {
1482 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1485 printf("pkg preload: %d\n", preload);
1486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1491 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1494 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1495 * @brief This API gets the value for given handle is system or not
1497 * @par This API is for package-manager client application
1498 * @par Sync (or) Async : Synchronous API
1500 * @param[in] handle pointer to package info handle
1501 * @param[out] system pointer to hold system is or not
1502 * @return 0 if success, error code(<0) if fail
1503 * @retval PMINFO_R_OK success
1504 * @retval PMINFO_R_EINVAL invalid argument
1505 * @retval PMINFO_R_ERROR internal error
1506 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1507 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1508 * @see pkgmgrinfo_pkginfo_get_pkgid()
1509 * @see pkgmgrinfo_pkginfo_is_readonly()
1511 static int get_pkg_system(const char *pkgid)
1514 bool system = false;
1515 pkgmgrinfo_pkginfo_h handle = NULL;
1516 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1517 if (ret != PMINFO_R_OK)
1519 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1520 if (ret != PMINFO_R_OK) {
1521 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1524 printf("pkg system: %d\n", system);
1525 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1530 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1533 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1534 * @brief This API gets the package 'readonly' value from the package ID
1536 * @par This API is for package-manager client application
1537 * @par Sync (or) Async : Synchronous API
1539 * @param[in] handle pointer to package info handle
1540 * @param[out] readonly pointer to hold package readonly value
1541 * @return 0 if success, error code(<0) if fail
1542 * @retval PMINFO_R_OK success
1543 * @retval PMINFO_R_EINVAL invalid argument
1544 * @retval PMINFO_R_ERROR internal error
1545 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1546 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1547 * @see pkgmgrinfo_pkginfo_get_pkgid()
1548 * @see pkgmgrinfo_pkginfo_is_removable()
1550 static int get_pkg_readonly(const char *pkgid)
1554 pkgmgrinfo_pkginfo_h handle;
1555 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1556 if (ret != PMINFO_R_OK)
1558 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1559 if (ret != PMINFO_R_OK) {
1560 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1563 printf("pkg readonly: %d\n", readonly);
1564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1569 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1573 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1574 * @brief This API gets the package 'upate' value from the package ID
1576 * @par This API is for package-manager client application
1577 * @par Sync (or) Async : Synchronous API
1579 * @param[in] handle pointer to package info handle
1580 * @param[out] update pointer to hold package update value
1581 * @return 0 if success, error code(<0) if fail
1582 * @retval PMINFO_R_OK success
1583 * @retval PMINFO_R_EINVAL invalid argument
1584 * @retval PMINFO_R_ERROR internal error
1585 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1586 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1587 * @see pkgmgrinfo_pkginfo_get_pkgid()
1589 static int get_pkg_update(const char *pkgid)
1593 pkgmgrinfo_pkginfo_h handle;
1594 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1595 if (ret != PMINFO_R_OK)
1597 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1598 if (ret != PMINFO_R_OK) {
1599 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1602 printf("pkg update: %d\n", update);
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1608 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1611 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1612 * @brief This API gets the package 'accessible' value from the package ID
1614 * @par This API is for package-manager client application
1615 * @par Sync (or) Async : Synchronous API
1617 * @param[in] handle pointer to package info handle
1618 * @param[out] accessible pointer to hold package accessible value
1619 * @return 0 if success, error code(<0) if fail
1620 * @retval PMINFO_R_OK success
1621 * @retval PMINFO_R_EINVAL invalid argument
1622 * @retval PMINFO_R_ERROR internal error
1623 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1624 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1625 * @see pkgmgrinfo_pkginfo_get_pkgid()
1626 * @see pkgmgrinfo_pkginfo_is_readonly()
1628 static int get_pkg_accessible(const char *pkgid)
1632 pkgmgrinfo_pkginfo_h handle;
1633 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1634 if (ret != PMINFO_R_OK)
1636 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1637 if (ret != PMINFO_R_OK) {
1638 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1641 printf("pkg accessible: %d\n", accessible);
1642 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1647 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1650 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1651 * @brief This API destroys the package information handle freeing up all the resources
1653 * @par This API is for package-manager client application
1654 * @par Sync (or) Async : Synchronous API
1656 * @param[in] handle pointer to the package info handle
1657 * @return 0 if success, error code(<0) if fail
1658 * @retval PMINFO_R_OK success
1659 * @retval PMINFO_R_EINVAL invalid argument
1660 * @retval PMINFO_R_ERROR internal error
1661 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1663 * @see pkgmgrinfo_pkginfo_get_pkgid()
1664 * @see pkgmgrinfo_pkginfo_is_removable()
1666 static int get_pkg_type(const char *pkgid)
1670 pkgmgrinfo_pkginfo_h handle;
1671 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1672 if (ret != PMINFO_R_OK)
1674 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1675 if (ret != PMINFO_R_OK) {
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 printf("pkgtype: %s\n", type);
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1685 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1688 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1689 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1690 The query will search the entire package information collected from the manifest file of all the installed packages
1692 * @par This API is for package-manager client application
1693 * @par Sync (or) Async : Synchronous API
1695 * @param[out] handle pointer to the package info filter handle.
1696 * @return 0 if success, error code(<0) if fail
1697 * @retval PMINFO_R_OK success
1698 * @retval PMINFO_R_EINVAL invalid argument
1699 * @retval PMINFO_R_ERROR internal error
1701 * @post pkgmgrinfo_pkginfo_filter_destroy()
1702 * @see pkgmgrinfo_pkginfo_filter_count()
1703 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1705 static int get_rpm_pkg_count()
1709 pkgmgrinfo_pkginfo_filter_h handle;
1710 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1711 if (ret != PMINFO_R_OK)
1713 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1714 if (ret != PMINFO_R_OK) {
1715 pkgmgrinfo_pkginfo_filter_destroy(handle);
1718 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1719 if (ret != PMINFO_R_OK) {
1720 pkgmgrinfo_pkginfo_filter_destroy(handle);
1723 printf("No of rpm pkgs: %d\n", count);
1724 pkgmgrinfo_pkginfo_filter_destroy(handle);
1729 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1732 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1733 * @brief This API destroys the package information filter handle freeing up all the resources
1735 * @par This API is for package-manager client application
1736 * @par Sync (or) Async : Synchronous API
1738 * @param[in] handle pointer to the package info filter handle.
1739 * @return 0 if success, error code(<0) if fail
1740 * @retval PMINFO_R_OK success
1741 * @retval PMINFO_R_EINVAL invalid argument
1742 * @retval PMINFO_R_ERROR internal error
1743 * @pre pkgmgrinfo_pkginfo_filter_create()
1745 * @see pkgmgrinfo_pkginfo_filter_count()
1746 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1748 static int get_rpm_pkg_count()
1752 pkgmgrinfo_pkginfo_filter_h handle;
1753 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1754 if (ret != PMINFO_R_OK)
1756 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1757 if (ret != PMINFO_R_OK) {
1758 pkgmgrinfo_pkginfo_filter_destroy(handle);
1761 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1762 if (ret != PMINFO_R_OK) {
1763 pkgmgrinfo_pkginfo_filter_destroy(handle);
1766 printf("No of rpm pkgs: %d\n", count);
1767 pkgmgrinfo_pkginfo_filter_destroy(handle);
1772 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1775 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1776 * @brief This API adds a boolean filter property to the filter handle
1778 * @par This API is for package-manager client application
1779 * @par Sync (or) Async : Synchronous API
1781 * @param[in] handle pointer to the package info filter handle.
1782 * @param[in] property boolean property name.
1783 * @param[in] value value corresponding to the property.
1784 * @return 0 if success, error code(<0) if fail
1785 * @retval PMINFO_R_OK success
1786 * @retval PMINFO_R_EINVAL invalid argument
1787 * @retval PMINFO_R_ERROR internal error
1788 * @pre pkgmgrinfo_pkginfo_filter_create()
1789 * @post pkgmgrinfo_pkginfo_filter_destroy()
1790 * @see pkgmgrinfo_pkginfo_filter_count()
1791 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1793 static int get_preload_pkg_count()
1797 pkgmgrinfo_pkginfo_filter_h handle;
1798 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1799 if (ret != PMINFO_R_OK)
1801 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1802 if (ret != PMINFO_R_OK) {
1803 pkgmgrinfo_pkginfo_filter_destroy(handle);
1806 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1807 if (ret != PMINFO_R_OK) {
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 printf("No of preload pkgs: %d\n", count);
1812 pkgmgrinfo_pkginfo_filter_destroy(handle);
1817 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1818 const char *property, const bool value);
1821 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1822 * @brief This API adds an integer filter property to the filter handle
1824 * @par This API is for package-manager client application
1825 * @par Sync (or) Async : Synchronous API
1827 * @param[in] handle pointer to the package info filter handle.
1828 * @param[in] property integer property name.
1829 * @param[in] value value corresponding to the property.
1830 * @return 0 if success, error code(<0) if fail
1831 * @retval PMINFO_R_OK success
1832 * @retval PMINFO_R_EINVAL invalid argument
1833 * @retval PMINFO_R_ERROR internal error
1834 * @pre pkgmgrinfo_pkginfo_filter_create()
1835 * @post pkgmgrinfo_pkginfo_filter_destroy()
1836 * @see pkgmgrinfo_pkginfo_filter_count()
1837 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1839 static int get_pkg_count()
1843 pkgmgrinfo_pkginfo_filter_h handle;
1844 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1845 if (ret != PMINFO_R_OK)
1847 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1848 if (ret != PMINFO_R_OK) {
1849 pkgmgrinfo_pkginfo_filter_destroy(handle);
1852 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1853 if (ret != PMINFO_R_OK) {
1854 pkgmgrinfo_pkginfo_filter_destroy(handle);
1857 printf("No of preload pkgs: %d\n", count);
1858 pkgmgrinfo_pkginfo_filter_destroy(handle);
1863 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1864 const char *property, const int value);
1867 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1868 * @brief This API adds a string filter property to the filter handle
1870 * @par This API is for package-manager client application
1871 * @par Sync (or) Async : Synchronous API
1873 * @param[in] handle pointer to the package info filter handle.
1874 * @param[in] property string property name.
1875 * @param[in] value value corresponding to the property.
1876 * @return 0 if success, error code(<0) if fail
1877 * @retval PMINFO_R_OK success
1878 * @retval PMINFO_R_EINVAL invalid argument
1879 * @retval PMINFO_R_ERROR internal error
1880 * @pre pkgmgrinfo_pkginfo_filter_create()
1881 * @post pkgmgrinfo_pkginfo_filter_destroy()
1882 * @see pkgmgrinfo_pkginfo_filter_count()
1883 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1885 static int get_rpm_pkg_count()
1889 pkgmgrinfo_pkginfo_filter_h handle;
1890 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1891 if (ret != PMINFO_R_OK)
1893 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1894 if (ret != PMINFO_R_OK) {
1895 pkgmgrinfo_pkginfo_filter_destroy(handle);
1898 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1899 if (ret != PMINFO_R_OK) {
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 printf("No of rpm pkgs: %d\n", count);
1904 pkgmgrinfo_pkginfo_filter_destroy(handle);
1909 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1910 const char *property, const char *value);
1913 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1914 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1916 * @par This API is for package-manager client application
1917 * @par Sync (or) Async : Synchronous API
1919 * @param[in] handle pointer to the package info filter handle.
1920 * @param[in] pkg_cb callback function.
1921 * @param[in] user_data user data to be passed to the callback function
1922 * @return 0 if success, error code(<0) if fail
1923 * @retval PMINFO_R_OK success
1924 * @retval PMINFO_R_EINVAL invalid argument
1925 * @retval PMINFO_R_ERROR internal error
1926 * @pre pkgmgrinfo_pkginfo_filter_create()
1927 * @post pkgmgrinfo_pkginfo_filter_destroy()
1928 * @see pkgmgrinfo_pkginfo_filter_count()
1930 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1933 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1934 printf("pkg id : %s\n", pkgid);
1938 static int get_rpm_pkg_list()
1941 pkgmgrinfo_pkginfo_filter_h handle;
1942 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1943 if (ret != PMINFO_R_OK)
1945 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1946 if (ret != PMINFO_R_OK) {
1947 pkgmgrinfo_pkginfo_filter_destroy(handle);
1950 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1951 if (ret != PMINFO_R_OK) {
1952 pkgmgrinfo_pkginfo_filter_destroy(handle);
1955 pkgmgrinfo_pkginfo_filter_destroy(handle);
1960 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1961 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1962 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1963 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1966 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1967 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1968 * @brief This API counts the package that satisfy the filter conditions
1970 * @par This API is for package-manager client application
1971 * @par Sync (or) Async : Synchronous API
1973 * @param[in] handle pointer to the package info filter handle.
1974 * @param[in] count pointer to store the count value.
1975 * @param[in] uid the addressee user id of the instruction
1976 * @return 0 if success, error code(<0) if fail
1977 * @retval PMINFO_R_OK success
1978 * @retval PMINFO_R_EINVAL invalid argument
1979 * @retval PMINFO_R_ERROR internal error
1980 * @pre pkgmgrinfo_pkginfo_filter_create()
1981 * @post pkgmgrinfo_pkginfo_filter_destroy()
1982 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1984 static int get_rpm_pkg_count()
1988 pkgmgrinfo_pkginfo_filter_h handle;
1989 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1990 if (ret != PMINFO_R_OK)
1992 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1993 if (ret != PMINFO_R_OK) {
1994 pkgmgrinfo_pkginfo_filter_destroy(handle);
1997 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1998 if (ret != PMINFO_R_OK) {
1999 pkgmgrinfo_pkginfo_filter_destroy(handle);
2002 printf("No of rpm pkgs: %d\n", count);
2003 pkgmgrinfo_pkginfo_filter_destroy(handle);
2008 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2009 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2011 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2012 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2013 * @brief This API gets the list of privilege for a particular package
2015 * @par This API is for package-manager client application
2016 * @par Sync (or) Async : Synchronous API
2017 * @param[in] handle pointer to the package info handle.
2018 * @param[in] privilege_func callback function for list
2019 * @param[in] user_data user data to be passed to callback function
2020 * @return 0 if success, error code(<0) if fail
2021 * @retval PMINFO_R_OK success
2022 * @retval PMINFO_R_EINVAL invalid argument
2023 * @retval PMINFO_R_ERROR internal error
2024 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2025 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2027 int privilege_func(const char *name, void *user_data)
2029 if (strcmp(name, (char *)user_data) == 0)
2035 static int list_privilege(const char *package, char *privilege)
2038 pkgmgrinfo_pkginfo_h handle;
2039 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2040 if (ret != PMINFO_R_OK)
2042 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2043 if (ret != PMINFO_R_OK) {
2044 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2047 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2052 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2053 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2056 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2057 pkgmgrinfo_app_list_cb app_func, void *user_data)
2058 * @brief This API gets list of installed applications for a particular package
2060 * @par This API is for package-manager client application
2061 * @par Sync (or) Async : Synchronous API
2062 * @param[in] handle package info handle
2063 * @param[in] component application component
2064 * @param[in] app_func iteration function for list
2065 * @param[in] user_data user data to be passed to callback function
2066 * @return 0 if success, error code(<0) if fail
2067 * @retval PMINFO_R_OK success
2068 * @retval PMINFO_R_EINVAL invalid argument
2069 * @retval PMINFO_R_ERROR internal error
2070 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2071 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2073 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2076 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2077 printf("appid : %s\n", appid);
2081 static int list_apps(const char *pkgid)
2084 pkgmgrinfo_pkginfo_h handle;
2085 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2086 if (ret != PMINFO_R_OK)
2088 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2089 if (ret != PMINFO_R_OK) {
2090 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2093 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2098 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2099 pkgmgrinfo_app_list_cb app_func, void *user_data);
2100 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2101 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2103 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2104 * @brief This API gets list of installed applications from all packages with minimum informaion.
2106 * @par This API is for package-manager client application
2107 * @par Sync (or) Async : Synchronous API
2108 * @param[in] app_func iteration function for list
2109 * @param[in] user_data user data to be passed to callback function
2110 * @return 0 if success, error code(<0) if fail
2111 * @retval PMINFO_R_OK success
2112 * @retval PMINFO_R_EINVAL invalid argument
2113 * @retval PMINFO_R_ERROR internal error
2117 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2119 char *pkgid1 = NULL;
2120 char *pkgid2 = NULL;
2121 pkgid1 = (char *)user_data;
2122 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2123 if (strcmp(pkgid1, pkgid2) == 0) {
2130 static int list_apps()
2133 char *name = "helloworld";
2134 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2135 if (ret != PMINFO_R_OK) {
2142 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2143 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2145 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2146 * @brief This API gets list of installed applications from all packages.
2148 * @par This API is for package-manager client application
2149 * @par Sync (or) Async : Synchronous API
2150 * @param[in] app_func iteration function for list
2151 * @param[in] user_data user data to be passed to callback function
2152 * @return 0 if success, error code(<0) if fail
2153 * @retval PMINFO_R_OK success
2154 * @retval PMINFO_R_EINVAL invalid argument
2155 * @retval PMINFO_R_ERROR internal error
2159 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2161 char *pkgid1 = NULL;
2162 char *pkgid2 = NULL;
2163 pkgid1 = (char *)user_data;
2164 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2165 if (strcmp(pkgid1, pkgid2) == 0) {
2172 static int list_apps()
2175 char *name = "helloworld";
2176 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2177 if (ret != PMINFO_R_OK) {
2184 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2185 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2188 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2189 * @brief This API creates the application information handle from db
2191 * @par This API is for package-manager client application
2192 * @par Sync (or) Async : Synchronous API
2194 * @param[in] appid pointer to appid
2195 * @param[out] handle pointer to the application info handle.
2196 * @return 0 if success, error code(<0) if fail
2197 * @retval PMINFO_R_OK success
2198 * @retval PMINFO_R_EINVAL invalid argument
2199 * @retval PMINFO_R_ERROR internal error
2201 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2202 * @see pkgmgrinfo_appinfo_get_pkgid()
2203 * @see pkgmgrinfo_appinfo_is_multiple()
2205 static int get_app_type(const char *appid)
2209 pkgmgrinfo_appinfo_h handle;
2210 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2211 if (ret != PMINFO_R_OK)
2213 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2214 if (ret != PMINFO_R_OK) {
2215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2218 printf("apptype: %s\n", type);
2219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2224 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2225 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2227 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2228 * @brief This API gets the application ID
2230 * @par This API is for package-manager client application
2231 * @par Sync (or) Async : Synchronous API
2233 * @param[in] handle pointer to the application info handle.
2234 * @param[out] appid pointer to hold appid
2235 * @return 0 if success, error code(<0) if fail
2236 * @retval PMINFO_R_OK success
2237 * @retval PMINFO_R_EINVAL invalid argument
2238 * @retval PMINFO_R_ERROR internal error
2239 * @pre pkgmgrinfo_appinfo_get_appinfo()
2240 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2241 * @see pkgmgrinfo_appinfo_get_pkgid()
2242 * @see pkgmgrinfo_appinfo_is_multiple()
2244 static int get_app_id(const char *appid)
2247 char *app_id = NULL;
2248 pkgmgrinfo_appinfo_h handle;
2249 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2250 if (ret != PMINFO_R_OK)
2252 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2253 if (ret != PMINFO_R_OK) {
2254 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2257 printf("app id: %s\n", app_id);
2258 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2263 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2266 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2267 * @brief This API gets the package name of the application
2269 * @par This API is for package-manager client application
2270 * @par Sync (or) Async : Synchronous API
2272 * @param[in] handle pointer to the application info handle.
2273 * @param[out] pkg_name pointer to hold package name
2274 * @return 0 if success, error code(<0) if fail
2275 * @retval PMINFO_R_OK success
2276 * @retval PMINFO_R_EINVAL invalid argument
2277 * @retval PMINFO_R_ERROR internal error
2278 * @pre pkgmgrinfo_appinfo_get_appinfo()
2279 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2280 * @see pkgmgrinfo_appinfo_get_appid()
2281 * @see pkgmgrinfo_appinfo_is_multiple()
2283 static int get_app_pkgname(const char *appid)
2286 char *pkgname = NULL;
2287 pkgmgrinfo_appinfo_h handle;
2288 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2289 if (ret != PMINFO_R_OK)
2291 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2292 if (ret != PMINFO_R_OK) {
2293 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2296 printf("pkg name: %s\n", pkgname);
2297 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2302 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2305 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2306 * @brief This API gets the package id of the application
2308 * @par This API is for package-manager client application
2309 * @par Sync (or) Async : Synchronous API
2311 * @param[in] handle pointer to the application info handle.
2312 * @param[out] pkgid pointer to hold package id
2313 * @return 0 if success, error code(<0) if fail
2314 * @retval PMINFO_R_OK success
2315 * @retval PMINFO_R_EINVAL invalid argument
2316 * @retval PMINFO_R_ERROR internal error
2317 * @pre pkgmgrinfo_appinfo_get_appinfo()
2318 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2319 * @see pkgmgrinfo_appinfo_get_appid()
2320 * @see pkgmgrinfo_appinfo_is_multiple()
2322 static int get_app_pkgid(const char *appid)
2326 pkgmgrinfo_appinfo_h handle;
2327 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2328 if (ret != PMINFO_R_OK)
2330 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2331 if (ret != PMINFO_R_OK) {
2332 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2335 printf("pkg id: %s\n", pkgid);
2336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2341 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2344 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2345 * @brief This API gets the executable name of the application
2347 * @par This API is for package-manager client application
2348 * @par Sync (or) Async : Synchronous API
2350 * @param[in] handle pointer to the application info handle.
2351 * @param[out] exec pointer to hold app exec name
2352 * @return 0 if success, error code(<0) if fail
2353 * @retval PMINFO_R_OK success
2354 * @retval PMINFO_R_EINVAL invalid argument
2355 * @retval PMINFO_R_ERROR internal error
2356 * @pre pkgmgrinfo_appinfo_get_appinfo()
2357 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2358 * @see pkgmgrinfo_appinfo_get_appid()
2359 * @see pkgmgrinfo_appinfo_is_multiple()
2361 static int get_app_exec(const char *appid)
2365 pkgmgrinfo_appinfo_h handle;
2366 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2367 if (ret != PMINFO_R_OK)
2369 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2370 if (ret != PMINFO_R_OK) {
2371 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2374 printf("exec name: %s\n", exec);
2375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2380 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2383 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2384 * @brief This API gets the icon name of the application
2386 * @par This API is for package-manager client application
2387 * @par Sync (or) Async : Synchronous API
2389 * @param[in] handle pointer to the application info handle.
2390 * @param[out] icon pointer to hold app icon name
2391 * @return 0 if success, error code(<0) if fail
2392 * @retval PMINFO_R_OK success
2393 * @retval PMINFO_R_EINVAL invalid argument
2394 * @retval PMINFO_R_ERROR internal error
2395 * @pre pkgmgrinfo_appinfo_get_appinfo()
2396 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2397 * @see pkgmgrinfo_appinfo_get_appid()
2398 * @see pkgmgrinfo_appinfo_is_multiple()
2400 static int get_app_icon(const char *appid)
2404 pkgmgrinfo_appinfo_h handle;
2405 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2406 if (ret != PMINFO_R_OK)
2408 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2409 if (ret != PMINFO_R_OK) {
2410 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2413 printf("icon name: %s\n", icon);
2414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2419 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2422 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2423 * @brief This API gets the label of the application
2425 * @par This API is for package-manager client application
2426 * @par Sync (or) Async : Synchronous API
2428 * @param[in] handle pointer to the application info handle.
2429 * @param[out] label pointer to hold app label
2430 * @return 0 if success, error code(<0) if fail
2431 * @retval PMINFO_R_OK success
2432 * @retval PMINFO_R_EINVAL invalid argument
2433 * @retval PMINFO_R_ERROR internal error
2434 * @pre pkgmgrinfo_appinfo_get_appinfo()
2435 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2436 * @see pkgmgrinfo_appinfo_get_appid()
2437 * @see pkgmgrinfo_appinfo_is_multiple()
2439 static int get_app_label(const char *appid)
2443 pkgmgrinfo_appinfo_h handle;
2444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2445 if (ret != PMINFO_R_OK)
2447 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2448 if (ret != PMINFO_R_OK) {
2449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2452 printf("label : %s\n", label);
2453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2458 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2461 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2462 * @brief This API gets the component of the application
2464 * @par This API is for package-manager client application
2465 * @par Sync (or) Async : Synchronous API
2467 * @param[in] handle pointer to the application info handle.
2468 * @param[out] component pointer to hold app component
2469 * @return 0 if success, error code(<0) if fail
2470 * @retval PMINFO_R_OK success
2471 * @retval PMINFO_R_EINVAL invalid argument
2472 * @retval PMINFO_R_ERROR internal error
2473 * @pre pkgmgrinfo_appinfo_get_appinfo()
2474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2475 * @see pkgmgrinfo_appinfo_get_appid()
2476 * @see pkgmgrinfo_appinfo_is_multiple()
2478 static int get_app_component(const char *appid)
2481 pkgmgrinfo_app_component component;
2482 pkgmgrinfo_appinfo_h handle;
2483 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2484 if (ret != PMINFO_R_OK)
2486 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2487 if (ret != PMINFO_R_OK) {
2488 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2491 printf("component : %s\n", component);
2492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2497 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2500 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2501 * @brief This API gets the apptype of the application
2503 * @par This API is for package-manager client application
2504 * @par Sync (or) Async : Synchronous API
2506 * @param[in] handle pointer to the application info handle.
2507 * @param[out] app_type pointer to hold apptype
2508 * @return 0 if success, error code(<0) if fail
2509 * @retval PMINFO_R_OK success
2510 * @retval PMINFO_R_EINVAL invalid argument
2511 * @retval PMINFO_R_ERROR internal error
2512 * @pre pkgmgrinfo_appinfo_get_appinfo()
2513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2514 * @see pkgmgrinfo_appinfo_get_appid()
2515 * @see pkgmgrinfo_appinfo_is_multiple()
2517 static int get_app_type(const char *appid)
2520 char *apptype = NULL;
2521 pkgmgrinfo_appinfo_h handle;
2522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2523 if (ret != PMINFO_R_OK)
2525 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2526 if (ret != PMINFO_R_OK) {
2527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2530 printf("apptype : %s\n", apptype);
2531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2536 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2539 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2540 int *operation_count, char ***operation)
2541 * @brief This API gets the list of operation of the application
2543 * @par This API is for package-manager client application
2544 * @par Sync (or) Async : Synchronous API
2546 * @param[in] handle pointer to the appcontrol handle.
2547 * @param[out] operation_count pointer to hold number of operations
2548 * @param[out] operation pointer to hold list of operations
2549 * @return 0 if success, error code(<0) if fail
2550 * @retval PMINFO_R_OK success
2551 * @retval PMINFO_R_EINVAL invalid argument
2552 * @retval PMINFO_R_ERROR internal error
2553 * @pre pkgmgrinfo_appinfo_get_appinfo()
2554 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2555 * @see pkgmgrinfo_appinfo_get_uri()
2556 * @see pkgmgrinfo_appinfo_get_mime()
2558 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2563 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2564 for (i = 0; i < oc; i++) {
2565 if (strcmp(operation[i], (char *)user_data) == 0)
2572 static int check_operation(const char *appid, char *operation)
2575 pkgmgrinfo_appinfo_h handle;
2576 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2577 if (ret != PMINFO_R_OK)
2579 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2580 if (ret != PMINFO_R_OK) {
2581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2584 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2589 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2590 int *operation_count, char ***operation);
2593 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2594 int *uri_count, char ***uri)
2595 * @brief This API gets the list of uri of the application
2597 * @par This API is for package-manager client application
2598 * @par Sync (or) Async : Synchronous API
2600 * @param[in] handle pointer to the appcontrol handle.
2601 * @param[out] uri_count pointer to hold number of uris
2602 * @param[out] uri pointer to hold list of uris
2603 * @return 0 if success, error code(<0) if fail
2604 * @retval PMINFO_R_OK success
2605 * @retval PMINFO_R_EINVAL invalid argument
2606 * @retval PMINFO_R_ERROR internal error
2607 * @pre pkgmgrinfo_appinfo_get_appinfo()
2608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2609 * @see pkgmgrinfo_appinfo_get_operation()
2610 * @see pkgmgrinfo_appinfo_get_mime()
2612 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2617 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2618 for (i = 0; i < uc; i++) {
2619 if (strcmp(uri[i], (char *)user_data) == 0)
2626 static int check_uri(const char *appid, char *uri)
2629 pkgmgrinfo_appinfo_h handle;
2630 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2631 if (ret != PMINFO_R_OK)
2633 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2634 if (ret != PMINFO_R_OK) {
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2643 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2644 int *uri_count, char ***uri);
2647 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2648 int *mime_count, char ***mime)
2649 * @brief This API gets the list of mime of the application
2651 * @par This API is for package-manager client application
2652 * @par Sync (or) Async : Synchronous API
2654 * @param[in] handle pointer to the appcontrol handle.
2655 * @param[out] mime_count pointer to hold number of mimes
2656 * @param[out] mime pointer to hold list of mimes
2657 * @return 0 if success, error code(<0) if fail
2658 * @retval PMINFO_R_OK success
2659 * @retval PMINFO_R_EINVAL invalid argument
2660 * @retval PMINFO_R_ERROR internal error
2661 * @pre pkgmgrinfo_appinfo_get_appinfo()
2662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2663 * @see pkgmgrinfo_appinfo_get_uri()
2664 * @see pkgmgrinfo_appinfo_get_operation()
2666 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2671 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2672 for (i = 0; i < mc; i++) {
2673 if (strcmp(mime[i], (char *)user_data) == 0)
2680 static int check_mime(const char *appid, char *mime)
2683 pkgmgrinfo_appinfo_h handle;
2684 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2685 if (ret != PMINFO_R_OK)
2687 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2688 if (ret != PMINFO_R_OK) {
2689 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2697 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2698 int *mime_count, char ***mime);
2701 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2702 int *subapp_count, char ***subapp)
2703 * @brief This API gets the list of subapp of the application
2705 * @par This API is for package-manager client application
2706 * @par Sync (or) Async : Synchronous API
2708 * @param[in] handle pointer to the appcontrol handle.
2709 * @param[out] subapp_count pointer to hold number of subapp
2710 * @param[out] subapp pointer to hold list of subapp
2711 * @return 0 if success, error code(<0) if fail
2712 * @retval PMINFO_R_OK success
2713 * @retval PMINFO_R_EINVAL invalid argument
2714 * @retval PMINFO_R_ERROR internal error
2715 * @pre pkgmgrinfo_appinfo_get_appinfo()
2716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2717 * @see pkgmgrinfo_appinfo_get_uri()
2718 * @see pkgmgrinfo_appinfo_get_operation()
2720 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2724 char **subapp = NULL;
2725 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2726 for (i = 0; i < sc; i++) {
2727 if (strcmp(subapp[i], (char *)user_data) == 0)
2734 static int check_subapp(const char *appid, char *subapp)
2737 pkgmgrinfo_appinfo_h handle = NULL;
2738 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2739 if (ret != PMINFO_R_OK)
2741 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2742 if (ret != PMINFO_R_OK) {
2743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2751 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2752 int *subapp_count, char ***subapp);
2755 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2756 * @brief This API gets the notification icon of the application
2758 * @par This API is for package-manager client application
2759 * @par Sync (or) Async : Synchronous API
2761 * @param[in] handle pointer to the application info handle.
2762 * @param[out] path pointer to hold notification icon
2763 * @return 0 if success, error code(<0) if fail
2764 * @retval PMINFO_R_OK success
2765 * @retval PMINFO_R_EINVAL invalid argument
2766 * @retval PMINFO_R_ERROR internal error
2767 * @pre pkgmgrinfo_appinfo_get_appinfo()
2768 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2769 * @see pkgmgrinfo_appinfo_get_appid()
2770 * @see pkgmgrinfo_appinfo_is_multiple()
2772 static int get_app_notification_icon(const char *appid)
2775 char *notification_icon = NULL;
2776 pkgmgrinfo_appinfo_h handle;
2777 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2778 if (ret != PMINFO_R_OK)
2780 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2781 if (ret != PMINFO_R_OK) {
2782 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2785 printf("notification icon : %s\n", notification_icon);
2786 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2791 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2794 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2795 * @brief This API gets the setting icon of the application
2797 * @par This API is for package-manager client application
2798 * @par Sync (or) Async : Synchronous API
2800 * @param[in] handle pointer to the application info handle.
2801 * @param[out] path pointer to hold setting icon
2802 * @return 0 if success, error code(<0) if fail
2803 * @retval PMINFO_R_OK success
2804 * @retval PMINFO_R_EINVAL invalid argument
2805 * @retval PMINFO_R_ERROR internal error
2806 * @pre pkgmgrinfo_appinfo_get_appinfo()
2807 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2808 * @see pkgmgrinfo_appinfo_get_appid()
2809 * @see pkgmgrinfo_appinfo_is_multiple()
2811 static int get_app_setting_icon(const char *appid)
2814 char *setting_icon = NULL;
2815 pkgmgrinfo_appinfo_h handle;
2816 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2817 if (ret != PMINFO_R_OK)
2819 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2820 if (ret != PMINFO_R_OK) {
2821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2824 printf("setting icon : %s\n", setting_icon);
2825 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2830 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2833 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2834 * @brief This API gets the type of recent image on app-tray
2836 * @par This API is for package-manager client application
2837 * @par Sync (or) Async : Synchronous API
2839 * @param[in] handle pointer to the application info handle.
2840 * @param[out] type pointer to hold image type
2841 * @return 0 if success, error code(<0) if fail
2842 * @retval PMINFO_R_OK success
2843 * @retval PMINFO_R_EINVAL invalid argument
2844 * @retval PMINFO_R_ERROR internal error
2845 * @pre pkgmgrinfo_appinfo_get_appinfo()
2846 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2847 * @see pkgmgrinfo_appinfo_get_appid()
2848 * @see pkgmgrinfo_appinfo_is_multiple()
2850 static int get_app_recent_image_type(const char *appid)
2853 pkgmgrinfo_app_recentimage type;
2854 pkgmgrinfo_appinfo_h handle;
2855 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2856 if (ret != PMINFO_R_OK)
2858 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2859 if (ret != PMINFO_R_OK) {
2860 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2863 printf("recent image type: %d\n", type);
2864 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2869 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2873 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2874 * @brief This API gets the preview image of application
2876 * @par Sync (or) Async : Synchronous API
2878 * @param[in] handle pointer to the application info handle.
2879 * @param[out] preview_img pointer to hold preview image path
2880 * @return 0 if success, error code(<0) if fail
2881 * @retval PMINFO_R_OK success
2882 * @retval PMINFO_R_EINVAL invalid argument
2883 * @retval PMINFO_R_ERROR internal error
2884 * @pre pkgmgrinfo_appinfo_get_appinfo()
2885 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2886 * @see pkgmgrinfo_appinfo_get_appid()
2888 static int get_app_previewimage(const char *appid)
2891 char *preview = NULL;
2892 pkgmgrinfo_appinfo_h handle = NULL;
2893 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2894 if (ret != PMINFO_R_OK)
2896 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2897 if (ret != PMINFO_R_OK) {
2898 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2901 printf("preview image path : %s\n", preview);
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2907 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2911 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2912 * @brief This API gets the package permission type of the application
2914 * @par This API is for package-manager client application
2915 * @par Sync (or) Async : Synchronous API
2917 * @param[in] handle pointer to the application info handle.
2918 * @param[out] permission pointer to hold package permission
2919 * @return 0 if success, error code(<0) if fail
2920 * @retval PMINFO_R_OK success
2921 * @retval PMINFO_R_EINVAL invalid argument
2922 * @retval PMINFO_R_ERROR internal error
2923 * @pre pkgmgrinfo_appinfo_get_appinfo()
2924 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2925 * @see pkgmgrinfo_appinfo_get_appid()
2927 static int get_app_permission(const char *appid)
2930 pkgmgrinfo_permission_type permission = 0;
2931 pkgmgrinfo_appinfo_h handle;
2933 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2934 if (ret != PMINFO_R_OK)
2936 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2937 if (ret != PMINFO_R_OK) {
2938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2941 printf("permission type: %d\n", permission);
2942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2947 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2950 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2951 * @brief This API gets the component_type
2953 * @par This API is for package-manager client application
2954 * @par Sync (or) Async : Synchronous API
2956 * @param[in] handle pointer to the application info handle.
2957 * @param[out] component_type pointer to hold component_type
2958 * @return 0 if success, error code(<0) if fail
2959 * @retval PMINFO_R_OK success
2960 * @retval PMINFO_R_EINVAL invalid argument
2961 * @retval PMINFO_R_ERROR internal error
2962 * @pre pkgmgrinfo_appinfo_get_appinfo()
2963 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2964 * @see pkgmgrinfo_appinfo_get_pkgid()
2965 * @see pkgmgrinfo_appinfo_is_multiple()
2967 static int get_component_type(const char *appid)
2970 char *component_type = NULL;
2971 pkgmgrinfo_appinfo_h handle;
2972 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2973 if (ret != PMINFO_R_OK)
2975 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2976 if (ret != PMINFO_R_OK) {
2977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2980 printf("component_type: %s\n", component_type);
2981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2986 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2989 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2990 * @brief This API gets the application 'hwacceleration' value from the app ID
2992 * @par This API is for package-manager client application
2993 * @par Sync (or) Async : Synchronous API
2995 * @param[in] handle pointer to application info handle
2996 * @param[out] hwacceleration pointer to hold package hwacceleration value
2997 * @return 0 if success, error code(<0) if fail
2998 * @retval PMINFO_R_OK success
2999 * @retval PMINFO_R_EINVAL invalid argument
3000 * @retval PMINFO_R_ERROR internal error
3001 * @pre pkgmgrinfo_appinfo_get_appinfo()
3002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3003 * @see pkgmgrinfo_appinfo_get_appid()
3004 * @see pkgmgrinfo_appinfo_is_multiple()
3006 static int get_app_hwacceleration(const char *appid)
3009 pkgmgrinfo_app_hwacceleration hwacceleration;
3010 pkgmgrinfo_appinfo_h handle;
3011 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3012 if (ret != PMINFO_R_OK)
3014 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3015 if (ret != PMINFO_R_OK) {
3016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3019 printf("app hwacceleration: %d\n", hwacceleration);
3020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3025 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3028 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3029 * @brief This API gets the application 'screenreader' value from the app ID
3031 * @par This API is for package-manager client application
3032 * @par Sync (or) Async : Synchronous API
3034 * @param[in] handle pointer to application info handle
3035 * @param[out] screenreader pointer to hold package accessibility value
3036 * @return 0 if success, error code(<0) if fail
3037 * @retval PMINFO_R_OK success
3038 * @retval PMINFO_R_EINVAL invalid argument
3039 * @retval PMINFO_R_ERROR internal error
3040 * @pre pkgmgrinfo_appinfo_get_appinfo()
3041 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3042 * @see pkgmgrinfo_appinfo_get_appid()
3043 * @see pkgmgrinfo_appinfo_is_multiple()
3045 static int get_app_screenreader(const char *appid)
3048 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3049 pkgmgrinfo_appinfo_h handle = NULL;
3050 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3051 if (ret != PMINFO_R_OK)
3053 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3054 if (ret != PMINFO_R_OK) {
3055 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3058 printf("app screenreader: %d\n", screenreader);
3059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3064 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3067 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3068 * @brief This API gets the application's landscape & portrait effect images
3070 * @par This API is for package-manager client application
3071 * @par Sync (or) Async : Synchronous API
3073 * @param[in] handle pointer to application info handle
3074 * @param[out] portrait_img contains portrait mode effect image
3075 * @param[out] landscape_img contains landscape mode effect image
3076 * @return 0 if success, error code(<0) if fail
3077 * @retval PMINFO_R_OK success
3078 * @retval PMINFO_R_EINVAL invalid argument
3079 * @retval PMINFO_R_ERROR internal error
3080 * @pre pkgmgrinfo_appinfo_get_appinfo()
3081 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3082 * @see pkgmgrinfo_appinfo_get_appid()
3083 * @see pkgmgrinfo_appinfo_is_nodisplay()
3085 static int get_app_effectimages(const char *appid)
3088 char *portraitimg = NULL;
3089 char *landscapeimg = NULL;
3090 pkgmgrinfo_appinfo_h handle;
3091 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3092 if (ret != PMINFO_R_OK)
3094 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3095 if (ret != PMINFO_R_OK) {
3096 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3099 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3100 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3105 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3108 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3109 * @brief This API gets the submode_mainid of the application
3111 * @par This API is for package-manager client application
3112 * @par Sync (or) Async : Synchronous API
3114 * @param[in] handle pointer to the application info handle.
3115 * @param[out] submode_mainid pointer to hold package name
3116 * @return 0 if success, error code(<0) if fail
3117 * @retval PMINFO_R_OK success
3118 * @retval PMINFO_R_EINVAL invalid argument
3119 * @retval PMINFO_R_ERROR internal error
3120 * @pre pkgmgrinfo_appinfo_get_appinfo()
3121 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3122 * @see pkgmgrinfo_appinfo_get_appid()
3123 * @see pkgmgrinfo_appinfo_is_multiple()
3125 static int get_app_submode_mainid(const char *appid)
3128 char *submode_mainid = NULL;
3129 pkgmgrinfo_appinfo_h handle = NULL;
3130 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3131 if (ret != PMINFO_R_OK)
3133 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3134 if (ret != PMINFO_R_OK) {
3135 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3138 printf("submode_mainid: %s\n", submode_mainid);
3139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3144 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3147 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3148 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3149 * @brief This API gets the list of permission for a particular application
3151 * @par This API is for package-manager client application
3152 * @par Sync (or) Async : Synchronous API
3153 * @param[in] handle pointer to the application info handle.
3154 * @param[in] permission_func callback function for list
3155 * @param[in] user_data user data to be passed to callback function
3156 * @return 0 if success, error code(<0) if fail
3157 * @retval PMINFO_R_OK success
3158 * @retval PMINFO_R_EINVAL invalid argument
3159 * @retval PMINFO_R_ERROR internal error
3160 * @pre pkgmgrinfo_appinfo_get_appinfo()
3161 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3163 int permission_func(const char *name, void *user_data)
3165 if (strcmp(name, (char *)user_data) == 0)
3171 static int list_permission(const char *appid, char *permission)
3174 pkgmgrinfo_appinfo_h handle;
3175 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3176 if (ret != PMINFO_R_OK)
3178 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3179 if (ret != PMINFO_R_OK) {
3180 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3183 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3188 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3189 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3192 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3193 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3194 * @brief This API gets the list of category for a particular application
3196 * @par This API is for package-manager client application
3197 * @par Sync (or) Async : Synchronous API
3198 * @param[in] handle pointer to the application info handle.
3199 * @param[in] category_func callback function for list
3200 * @param[in] user_data user data to be passed to callback function
3201 * @return 0 if success, error code(<0) if fail
3202 * @retval PMINFO_R_OK success
3203 * @retval PMINFO_R_EINVAL invalid argument
3204 * @retval PMINFO_R_ERROR internal error
3205 * @pre pkgmgrinfo_appinfo_get_appinfo()
3206 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3208 int category_func(const char *name, void *user_data)
3210 if (strcmp(name, (char *)user_data) == 0)
3216 static int list_category(const char *appid, char *category)
3219 pkgmgrinfo_appinfo_h handle;
3220 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3221 if (ret != PMINFO_R_OK)
3223 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3224 if (ret != PMINFO_R_OK) {
3225 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3233 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3234 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3237 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3238 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3239 * @brief This API gets the list of metadata for a particular application
3241 * @par This API is for package-manager client application
3242 * @par Sync (or) Async : Synchronous API
3243 * @param[in] handle pointer to the application info handle.
3244 * @param[in] metadata_func callback function for list
3245 * @param[in] user_data user data to be passed to callback function
3246 * @return 0 if success, error code(<0) if fail
3247 * @retval PMINFO_R_OK success
3248 * @retval PMINFO_R_EINVAL invalid argument
3249 * @retval PMINFO_R_ERROR internal error
3250 * @pre pkgmgrinfo_appinfo_get_appinfo()
3251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3253 int metadata_func(const char *key, const char *value, void *user_data)
3255 if (strcmp(key, (char *)user_data) == 0) {
3256 printf("Value is %s\n", value);
3263 static int list_metadata(const char *appid, char *key)
3266 pkgmgrinfo_appinfo_h handle;
3267 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3268 if (ret != PMINFO_R_OK)
3270 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3271 if (ret != PMINFO_R_OK) {
3272 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3275 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3280 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3281 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3285 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3286 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3287 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3288 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3289 * @brief This API gets the list of app-control for a particular application
3291 * @par This API is for package-manager client application
3292 * @par Sync (or) Async : Synchronous API
3293 * @param[in] handle pointer to the application info handle.
3294 * @param[in] appcontrol_func callback function for list
3295 * @param[in] user_data user data to be passed to callback function
3296 * @param[in] uid the addressee user id of the instruction
3297 * @return 0 if success, error code(<0) if fail
3298 * @retval PMINFO_R_OK success
3299 * @retval PMINFO_R_EINVAL invalid argument
3300 * @retval PMINFO_R_ERROR internal error
3301 * @pre pkgmgrinfo_appinfo_get_appinfo()
3302 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3304 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3309 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3310 for (i = 0; i < oc; i++) {
3311 if (strcmp(operation[i], (char *)user_data) == 0)
3318 static int check_operation(const char *appid, char *operation)
3321 pkgmgrinfo_appinfo_h handle;
3322 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3323 if (ret != PMINFO_R_OK)
3325 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3326 if (ret != PMINFO_R_OK) {
3327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3330 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3335 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3336 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3337 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3338 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3341 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3342 * @brief This API gets the application 'nodisplay' value from the app ID
3344 * @par This API is for package-manager client application
3345 * @par Sync (or) Async : Synchronous API
3347 * @param[in] handle pointer to application info handle
3348 * @param[out] nodisplay pointer to hold package nodisplay value
3349 * @return 0 if success, error code(<0) if fail
3350 * @retval PMINFO_R_OK success
3351 * @retval PMINFO_R_EINVAL invalid argument
3352 * @retval PMINFO_R_ERROR internal error
3353 * @pre pkgmgrinfo_appinfo_get_appinfo()
3354 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3355 * @see pkgmgrinfo_appinfo_get_appid()
3356 * @see pkgmgrinfo_appinfo_is_multiple()
3358 static int get_app_nodisplay(const char *appid)
3362 pkgmgrinfo_appinfo_h handle;
3363 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3364 if (ret != PMINFO_R_OK)
3366 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3367 if (ret != PMINFO_R_OK) {
3368 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3371 printf("app nodisplay: %d\n", nodisplay);
3372 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3377 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3380 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3381 * @brief This API gets the application 'multiple' value from the app ID
3383 * @par This API is for package-manager client application
3384 * @par Sync (or) Async : Synchronous API
3386 * @param[in] handle pointer to application info handle
3387 * @param[out] multiple pointer to hold package multiple value
3388 * @return 0 if success, error code(<0) if fail
3389 * @retval PMINFO_R_OK success
3390 * @retval PMINFO_R_EINVAL invalid argument
3391 * @retval PMINFO_R_ERROR internal error
3392 * @pre pkgmgrinfo_appinfo_get_appinfo()
3393 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3394 * @see pkgmgrinfo_appinfo_get_appid()
3395 * @see pkgmgrinfo_appinfo_is_nodisplay()
3397 static int get_app_multiple(const char *appid)
3401 pkgmgrinfo_appinfo_h handle;
3402 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3403 if (ret != PMINFO_R_OK)
3405 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3406 if (ret != PMINFO_R_OK) {
3407 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3410 printf("app multiple: %d\n", multiple);
3411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3416 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3419 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3420 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3421 * application launching effect. If fales, indicator will be hidden during application launching effect
3423 * @par This API is for package-manager client application
3424 * @par Sync (or) Async : Synchronous API
3426 * @param[in] handle pointer to application info handle
3427 * @param[out] indicator_disp contains indicator display status for application launching effect
3428 * @return 0 if success, error code(<0) if fail
3429 * @retval PMINFO_R_OK success
3430 * @retval PMINFO_R_EINVAL invalid argument
3431 * @retval PMINFO_R_ERROR internal error
3432 * @pre pkgmgrinfo_appinfo_get_appinfo()
3433 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3434 * @see pkgmgrinfo_appinfo_get_appid()
3435 * @see pkgmgrinfo_appinfo_is_nodisplay()
3437 static int get_app_indicator_display(const char *appid)
3440 bool indicator_disp;
3441 pkgmgrinfo_appinfo_h handle;
3442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3443 if (ret != PMINFO_R_OK)
3445 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3446 if (ret != PMINFO_R_OK){
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 printf("app indicator disp : %d\n", indicator_disp);
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3459 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3460 * @brief This API gets the application 'taskmanage' value from the app ID
3462 * @par This API is for package-manager client application
3463 * @par Sync (or) Async : Synchronous API
3465 * @param[in] handle pointer to application info handle
3466 * @param[out] taskmanage pointer to hold package taskmanage value
3467 * @return 0 if success, error code(<0) if fail
3468 * @retval PMINFO_R_OK success
3469 * @retval PMINFO_R_EINVAL invalid argument
3470 * @retval PMINFO_R_ERROR internal error
3471 * @pre pkgmgrinfo_appinfo_get_appinfo()
3472 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3473 * @see pkgmgrinfo_appinfo_get_appid()
3474 * @see pkgmgrinfo_appinfo_is_multiple()
3476 static int get_app_taskmanage(const char *appid)
3480 pkgmgrinfo_appinfo_h handle;
3481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3482 if (ret != PMINFO_R_OK)
3484 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3485 if (ret != PMINFO_R_OK) {
3486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3489 printf("app taskmanage: %d\n", taskmanage);
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3495 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3498 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3499 * @brief This API gets the application 'taskmanage' value from the app ID
3501 * @par This API is for package-manager client application
3502 * @par Sync (or) Async : Synchronous API
3504 * @param[in] handle pointer to application info handle
3505 * @param[out] enabled pointer to hold package enabled value
3506 * @return 0 if success, error code(<0) if fail
3507 * @retval PMINFO_R_OK success
3508 * @retval PMINFO_R_EINVAL invalid argument
3509 * @retval PMINFO_R_ERROR internal error
3510 * @pre pkgmgrinfo_appinfo_get_appinfo()
3511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3512 * @see pkgmgrinfo_appinfo_get_appid()
3513 * @see pkgmgrinfo_appinfo_is_multiple()
3515 static int get_app_enabled(const char *appid)
3519 pkgmgrinfo_appinfo_h handle;
3520 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3521 if (ret != PMINFO_R_OK)
3523 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3524 if (ret != PMINFO_R_OK) {
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3528 printf("app enabled: %d\n", enabled);
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3537 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3538 * @brief This API gets the application 'onboot' value from the app ID
3540 * @par This API is for package-manager client application
3541 * @par Sync (or) Async : Synchronous API
3543 * @param[in] handle pointer to application info handle
3544 * @param[out] onboot pointer to hold package onboot value
3545 * @return 0 if success, error code(<0) if fail
3546 * @retval PMINFO_R_OK success
3547 * @retval PMINFO_R_EINVAL invalid argument
3548 * @retval PMINFO_R_ERROR internal error
3549 * @pre pkgmgrinfo_appinfo_get_appinfo()
3550 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3551 * @see pkgmgrinfo_appinfo_get_appid()
3552 * @see pkgmgrinfo_appinfo_is_multiple()
3554 static int get_app_onboot(const char *appid)
3558 pkgmgrinfo_appinfo_h handle;
3559 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3560 if (ret != PMINFO_R_OK)
3562 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3563 if (ret != PMINFO_R_OK) {
3564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3567 printf("app onboot: %d\n", onboot);
3568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3573 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3576 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3577 * @brief This API gets the application 'autorestart' value from the app ID
3579 * @par This API is for package-manager client application
3580 * @par Sync (or) Async : Synchronous API
3582 * @param[in] handle pointer to application info handle
3583 * @param[out] autorestart pointer to hold package autorestart value
3584 * @return 0 if success, error code(<0) if fail
3585 * @retval PMINFO_R_OK success
3586 * @retval PMINFO_R_EINVAL invalid argument
3587 * @retval PMINFO_R_ERROR internal error
3588 * @pre pkgmgrinfo_appinfo_get_appinfo()
3589 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3590 * @see pkgmgrinfo_appinfo_get_appid()
3591 * @see pkgmgrinfo_appinfo_is_multiple()
3593 static int get_app_autorestart(const char *appid)
3597 pkgmgrinfo_appinfo_h handle;
3598 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3599 if (ret != PMINFO_R_OK)
3601 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3602 if (ret != PMINFO_R_OK) {
3603 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3606 printf("app autorestart: %d\n", autorestart);
3607 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3612 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3615 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3616 * @brief This API gets the value for given application is main app or not from handle
3618 * @par This API is for package-manager client application
3619 * @par Sync (or) Async : Synchronous API
3621 * @param[in] handle pointer to application info handle
3622 * @param[out] mainapp pointer to hold package mainapp is or not
3623 * @return 0 if success, error code(<0) if fail
3624 * @retval PMINFO_R_OK success
3625 * @retval PMINFO_R_EINVAL invalid argument
3626 * @retval PMINFO_R_ERROR internal error
3627 * @pre pkgmgrinfo_appinfo_get_appinfo()
3628 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3629 * @see pkgmgrinfo_appinfo_get_appid()
3630 * @see pkgmgrinfo_appinfo_is_multiple()
3632 static int get_app_mainapp(const char *appid)
3636 pkgmgrinfo_appinfo_h handle;
3637 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3638 if (ret != PMINFO_R_OK)
3640 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3641 if (ret != PMINFO_R_OK) {
3642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3645 printf("mainapp: %d\n", mainapp);
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3651 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3655 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3656 * @brief This API gets the value for given application is preload or not from handle
3658 * @par This API is for package-manager client application
3659 * @par Sync (or) Async : Synchronous API
3661 * @param[in] handle pointer to application info handle
3662 * @param[out] preload pointer to hold preload is or not
3663 * @return 0 if success, error code(<0) if fail
3664 * @retval PMINFO_R_OK success
3665 * @retval PMINFO_R_EINVAL invalid argument
3666 * @retval PMINFO_R_ERROR internal error
3667 * @pre pkgmgrinfo_appinfo_get_appinfo()
3668 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3669 * @see pkgmgrinfo_appinfo_get_appid()
3670 * @see pkgmgrinfo_appinfo_is_multiple()
3672 static int get_app_preload(const char *appid)
3676 pkgmgrinfo_appinfo_h handle = NULL;
3677 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3678 if (ret != PMINFO_R_OK)
3680 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3681 if (ret != PMINFO_R_OK) {
3682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 printf("preload: %d\n", preload);
3686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3691 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3694 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3695 * @brief This API gets the value for given application is submode or not from handle
3697 * @par This API is for package-manager client application
3698 * @par Sync (or) Async : Synchronous API
3700 * @param[in] handle pointer to application info handle
3701 * @param[out] submode pointer to hold submode is or not
3702 * @return 0 if success, error code(<0) if fail
3703 * @retval PMINFO_R_OK success
3704 * @retval PMINFO_R_EINVAL invalid argument
3705 * @retval PMINFO_R_ERROR internal error
3706 * @pre pkgmgrinfo_appinfo_get_appinfo()
3707 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3708 * @see pkgmgrinfo_appinfo_get_appid()
3709 * @see pkgmgrinfo_appinfo_is_multiple()
3711 static int get_app_submode(const char *appid)
3715 pkgmgrinfo_appinfo_h handle = NULL;
3716 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3717 if (ret != PMINFO_R_OK)
3719 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3720 if (ret != PMINFO_R_OK) {
3721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3724 printf("submode: %d\n", submode);
3725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3730 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3733 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3734 * @brief This API destroys the application information handle freeing up all the resources
3736 * @par This API is for package-manager client application
3737 * @par Sync (or) Async : Synchronous API
3739 * @param[in] handle pointer to the application info handle.
3740 * @return 0 if success, error code(<0) if fail
3741 * @retval PMINFO_R_OK success
3742 * @retval PMINFO_R_EINVAL invalid argument
3743 * @retval PMINFO_R_ERROR internal error
3744 * @pre pkgmgrinfo_appinfo_get_appinfo()
3746 * @see pkgmgrinfo_appinfo_get_pkgid()
3747 * @see pkgmgrinfo_appinfo_is_multiple()
3749 static int get_app_type(const char *appid)
3753 pkgmgrinfo_appinfo_h handle;
3754 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3755 if (ret != PMINFO_R_OK)
3757 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3758 if (ret != PMINFO_R_OK) {
3759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3762 printf("apptype: %s\n", type);
3763 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3768 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3771 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3772 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3773 The query will search the entire application information collected from the manifest file of all the installed packages
3775 * @par This API is for package-manager client application
3776 * @par Sync (or) Async : Synchronous API
3778 * @param[out] handle pointer to the application info filter handle.
3779 * @return 0 if success, error code(<0) if fail
3780 * @retval PMINFO_R_OK success
3781 * @retval PMINFO_R_EINVAL invalid argument
3782 * @retval PMINFO_R_ERROR internal error
3784 * @post pkgmgrinfo_appinfo_filter_destroy()
3785 * @see pkgmgrinfo_appinfo_filter_count()
3786 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3788 static int get_capp_count()
3792 pkgmgrinfo_appinfo_filter_h handle;
3793 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3794 if (ret != PMINFO_R_OK)
3796 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3797 if (ret != PMINFO_R_OK) {
3798 pkgmgrinfo_appinfo_filter_destroy(handle);
3801 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3802 if (ret != PMINFO_R_OK) {
3803 pkgmgrinfo_appinfo_filter_destroy(handle);
3806 printf("No of capp: %d\n", count);
3807 pkgmgrinfo_appinfo_filter_destroy(handle);
3812 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3815 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3816 * @brief This API destroys the application information filter handle freeing up all the resources
3818 * @par This API is for package-manager client application
3819 * @par Sync (or) Async : Synchronous API
3821 * @param[in] handle pointer to the application info filter handle.
3822 * @return 0 if success, error code(<0) if fail
3823 * @retval PMINFO_R_OK success
3824 * @retval PMINFO_R_EINVAL invalid argument
3825 * @retval PMINFO_R_ERROR internal error
3826 * @pre pkgmgrinfo_appinfo_filter_create()
3828 * @see pkgmgrinfo_appinfo_filter_count()
3829 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3831 static int get_capp_count()
3835 pkgmgrinfo_appinfo_filter_h handle;
3836 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3837 if (ret != PMINFO_R_OK)
3839 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3840 if (ret != PMINFO_R_OK) {
3841 pkgmgrinfo_appinfo_filter_destroy(handle);
3844 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3845 if (ret != PMINFO_R_OK) {
3846 pkgmgrinfo_appinfo_filter_destroy(handle);
3849 printf("No of capp: %d\n", count);
3850 pkgmgrinfo_appinfo_filter_destroy(handle);
3855 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3858 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3859 * @brief This API adds a boolean filter property to the filter handle
3861 * @par This API is for package-manager client application
3862 * @par Sync (or) Async : Synchronous API
3864 * @param[in] handle pointer to the application info filter handle.
3865 * @param[in] property boolean property name.
3866 * @param[in] value value corresponding to the property.
3867 * @return 0 if success, error code(<0) if fail
3868 * @retval PMINFO_R_OK success
3869 * @retval PMINFO_R_EINVAL invalid argument
3870 * @retval PMINFO_R_ERROR internal error
3871 * @pre pkgmgrinfo_appinfo_filter_create()
3872 * @post pkgmgrinfo_appinfo_filter_destroy()
3873 * @see pkgmgrinfo_appinfo_filter_count()
3874 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3876 static int get_taskmanageable_app_count()
3880 pkgmgrinfo_appinfo_filter_h handle;
3881 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3882 if (ret != PMINFO_R_OK)
3884 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3885 if (ret != PMINFO_R_OK) {
3886 pkgmgrinfo_appinfo_filter_destroy(handle);
3889 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3890 if (ret != PMINFO_R_OK) {
3891 pkgmgrinfo_appinfo_filter_destroy(handle);
3894 printf("No of taskmanageable apps: %d\n", count);
3895 pkgmgrinfo_appinfo_filter_destroy(handle);
3900 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3901 const char *property, const bool value);
3904 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3905 * @brief This API adds an integer filter property to the filter handle
3907 * @par This API is for package-manager client application
3908 * @par Sync (or) Async : Synchronous API
3910 * @param[in] handle pointer to the application info filter handle.
3911 * @param[in] property integer property name.
3912 * @param[in] value value corresponding to the property.
3913 * @return 0 if success, error code(<0) if fail
3914 * @retval PMINFO_R_OK success
3915 * @retval PMINFO_R_EINVAL invalid argument
3916 * @retval PMINFO_R_ERROR internal error
3917 * @pre pkgmgrinfo_appinfo_filter_create()
3918 * @post pkgmgrinfo_appinfo_filter_destroy()
3919 * @see pkgmgrinfo_appinfo_filter_count()
3920 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3922 static int get_taskmanageable_app_count()
3926 pkgmgrinfo_appinfo_filter_h handle;
3927 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3928 if (ret != PMINFO_R_OK)
3930 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3931 if (ret != PMINFO_R_OK) {
3932 pkgmgrinfo_appinfo_filter_destroy(handle);
3935 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3936 if (ret != PMINFO_R_OK) {
3937 pkgmgrinfo_appinfo_filter_destroy(handle);
3940 printf("No of apps: %d\n", count);
3941 pkgmgrinfo_appinfo_filter_destroy(handle);
3946 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3947 const char *property, const int value);
3950 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3951 * @brief This API adds a string filter property to the filter handle
3953 * @par This API is for package-manager client application
3954 * @par Sync (or) Async : Synchronous API
3956 * @param[in] handle pointer to the application info filter handle.
3957 * @param[in] property string property name.
3958 * @param[in] value value corresponding to the property.
3959 * @return 0 if success, error code(<0) if fail
3960 * @retval PMINFO_R_OK success
3961 * @retval PMINFO_R_EINVAL invalid argument
3962 * @retval PMINFO_R_ERROR internal error
3963 * @pre pkgmgrinfo_appinfo_filter_create()
3964 * @post pkgmgrinfo_appinfo_filter_destroy()
3965 * @see pkgmgrinfo_appinfo_filter_count()
3966 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3968 static int get_capp_count()
3972 pkgmgrinfo_appinfo_filter_h handle;
3973 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3974 if (ret != PMINFO_R_OK)
3976 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3977 if (ret != PMINFO_R_OK) {
3978 pkgmgrinfo_appinfo_filter_destroy(handle);
3981 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3982 if (ret != PMINFO_R_OK) {
3983 pkgmgrinfo_appinfo_filter_destroy(handle);
3986 printf("No of capp: %d\n", count);
3987 pkgmgrinfo_appinfo_filter_destroy(handle);
3992 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3993 const char *property, const char *value);
3996 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3997 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3999 * @par This API is for package-manager client application
4000 * @par Sync (or) Async : Synchronous API
4002 * @param[in] handle pointer to the application info filter handle.
4003 * @param[in] app_cb callback function.
4004 * @param[in] user_data user data to be passed to the callback function
4005 * @return 0 if success, error code(<0) if fail
4006 * @retval PMINFO_R_OK success
4007 * @retval PMINFO_R_EINVAL invalid argument
4008 * @retval PMINFO_R_ERROR internal error
4009 * @pre pkgmgrinfo_appinfo_filter_create()
4010 * @post pkgmgrinfo_appinfo_filter_destroy()
4011 * @see pkgmgrinfo_appinfo_filter_count()
4013 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4016 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4017 printf("appid : %s\n", appid);
4021 static int get_capp_list()
4024 pkgmgrinfo_appinfo_filter_h handle;
4025 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4026 if (ret != PMINFO_R_OK)
4028 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4029 if (ret != PMINFO_R_OK) {
4030 pkgmgrinfo_appinfo_filter_destroy(handle);
4033 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4034 if (ret != PMINFO_R_OK) {
4035 pkgmgrinfo_appinfo_filter_destroy(handle);
4038 pkgmgrinfo_appinfo_filter_destroy(handle);
4043 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4044 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4045 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4046 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4049 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4050 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4051 * @brief This API counts the application that satisfy the filter conditions
4053 * @par This API is for package-manager client application
4054 * @par Sync (or) Async : Synchronous API
4056 * @param[in] handle pointer to the application info filter handle.
4057 * @param[in] count pointer to store count value
4058 * @param[in] uid the addressee user id of the instruction
4059 * @return 0 if success, error code(<0) if fail
4060 * @retval PMINFO_R_OK success
4061 * @retval PMINFO_R_EINVAL invalid argument
4062 * @retval PMINFO_R_ERROR internal error
4063 * @pre pkgmgrinfo_appinfo_filter_create()
4064 * @post pkgmgrinfo_appinfo_filter_destroy()
4065 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4067 static int get_capp_count()
4071 pkgmgrinfo_appinfo_filter_h handle;
4072 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4073 if (ret != PMINFO_R_OK)
4075 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4076 if (ret != PMINFO_R_OK) {
4077 pkgmgrinfo_appinfo_filter_destroy(handle);
4080 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4081 if (ret != PMINFO_R_OK) {
4082 pkgmgrinfo_appinfo_filter_destroy(handle);
4085 printf("No of capp: %d\n", count);
4086 pkgmgrinfo_appinfo_filter_destroy(handle);
4091 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4092 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4094 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4095 * @brief This API creates the application's metadata information filter handle from db.
4097 * @par This API is for package-manager client application
4098 * @par Sync (or) Async : Synchronous API
4100 * @param[out] handle pointer to the application metadata info filter handle.
4101 * @return 0 if success, error code(<0) if fail
4102 * @retval PMINFO_R_OK success
4103 * @retval PMINFO_R_EINVAL invalid argument
4104 * @retval PMINFO_R_ERROR internal error
4106 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4107 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4109 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4112 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4113 printf("appid : %s\n", appid);
4117 static int get_app_list(const char *mkey, const char *mvalue)
4120 pkgmgrinfo_appinfo_metadata_filter_h handle;
4121 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4122 if (ret != PMINFO_R_OK)
4124 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4125 if (ret != PMINFO_R_OK) {
4126 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4129 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4130 if (ret != PMINFO_R_OK) {
4131 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4134 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4139 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4142 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4143 * @brief This API destroys the application's metadata information filter handle.
4145 * @par This API is for package-manager client application
4146 * @par Sync (or) Async : Synchronous API
4148 * @param[in] handle pointer to the application metadata info filter handle.
4149 * @return 0 if success, error code(<0) if fail
4150 * @retval PMINFO_R_OK success
4151 * @retval PMINFO_R_EINVAL invalid argument
4152 * @retval PMINFO_R_ERROR internal error
4153 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4155 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4157 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4160 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4161 printf("appid : %s\n", appid);
4165 static int get_app_list(const char *mkey, const char *mvalue)
4168 pkgmgrinfo_appinfo_metadata_filter_h handle;
4169 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4170 if (ret != PMINFO_R_OK)
4172 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4173 if (ret != PMINFO_R_OK) {
4174 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4177 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4178 if (ret != PMINFO_R_OK) {
4179 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4182 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4187 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4190 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4191 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4192 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4194 * @par This API is for package-manager client application
4195 * @par Sync (or) Async : Synchronous API
4197 * @param[in] handle pointer to the application metadata info filter handle.
4198 * @param[in] key pointer to metadata key
4199 * @param[in] value pointer to metadata value
4200 * @return 0 if success, error code(<0) if fail
4201 * @retval PMINFO_R_OK success
4202 * @retval PMINFO_R_EINVAL invalid argument
4203 * @retval PMINFO_R_ERROR internal error
4204 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4205 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4206 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4208 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4211 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4212 printf("appid : %s\n", appid);
4216 static int get_app_list(const char *mkey, const char *mvalue)
4219 pkgmgrinfo_appinfo_metadata_filter_h handle;
4220 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4221 if (ret != PMINFO_R_OK)
4223 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4224 if (ret != PMINFO_R_OK) {
4225 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4228 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4229 if (ret != PMINFO_R_OK) {
4230 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4233 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4238 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4239 const char *key, const char *value);
4242 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4243 * @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)
4244 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4245 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4246 * negative value, no more callbacks will be called and API will return.
4248 * @par This API is for package-manager client application
4249 * @par Sync (or) Async : Synchronous API
4251 * @param[in] handle pointer to the application metadata info filter handle.
4252 * @param[in] app_cb function pointer to callback
4253 * @param[in] user_data pointer to user data
4254 * @param[in] uid the addressee user id of the instruction
4255 * @return 0 if success, error code(<0) if fail
4256 * @retval PMINFO_R_OK success
4257 * @retval PMINFO_R_EINVAL invalid argument
4258 * @retval PMINFO_R_ERROR internal error
4259 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4260 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4262 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4265 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4266 printf("appid : %s\n", appid);
4270 static int get_app_list(const char *mkey, const char *mvalue)
4273 pkgmgrinfo_appinfo_metadata_filter_h handle;
4274 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4275 if (ret != PMINFO_R_OK)
4277 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4278 if (ret != PMINFO_R_OK) {
4279 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4282 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4283 if (ret != PMINFO_R_OK) {
4284 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4287 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4292 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4293 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4294 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4295 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4297 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4298 * @brief This API creates the package cert information handle to get data from db.
4300 * @par This API is for package-manager client application
4301 * @par Sync (or) Async : Synchronous API
4303 * @param[out] handle pointer to the package cert handle.
4304 * @return 0 if success, error code(<0) if fail
4305 * @retval PMINFO_R_OK success
4306 * @retval PMINFO_R_EINVAL invalid argument
4307 * @retval PMINFO_R_ERROR internal error
4309 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4310 * @see pkgmgrinfo_pkginfo_get_cert_value()
4311 * @see pkgmgrinfo_pkginfo_load_certinfo()
4313 static int get_cert_info(const char *pkgid)
4316 pkgmgrinfo_certinfo_h handle;
4317 char *auth_cert = NULL;
4318 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4319 if (ret != PMINFO_R_OK)
4321 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4322 if (ret != PMINFO_R_OK) {
4323 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4326 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4327 if (ret != PMINFO_R_OK) {
4328 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4331 printf("Author root certificate: %s\n", auth_root);
4332 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4337 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4340 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4341 * @brief This API loads the package cert information handle with data from db.
4343 * @par This API is for package-manager client application
4344 * @par Sync (or) Async : Synchronous API
4346 * @param[in] pkgid pointer to the package ID.
4347 * @param[in] handle pointer to the package cert handle.
4348 * @return 0 if success, error code(<0) if fail
4349 * @retval PMINFO_R_OK success
4350 * @retval PMINFO_R_EINVAL invalid argument
4351 * @retval PMINFO_R_ERROR internal error
4352 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4353 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4354 * @see pkgmgrinfo_pkginfo_get_cert_value()
4356 static int get_cert_info(const char *pkgid)
4359 pkgmgrinfo_certinfo_h handle;
4360 char *auth_cert = NULL;
4361 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4362 if (ret != PMINFO_R_OK)
4364 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4365 if (ret != PMINFO_R_OK) {
4366 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4369 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4370 if (ret != PMINFO_R_OK) {
4371 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4374 printf("Author root certificate: %s\n", auth_root);
4375 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4380 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
4383 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4384 * @brief This API gets the package cert information from the handle
4386 * @par This API is for package-manager client application
4387 * @par Sync (or) Async : Synchronous API
4389 * @param[in] handle pointer to the package cert handle.
4390 * @param[in] cert_type certificate type
4391 * @param[out] cert_value pointer to hold certificate value
4392 * @return 0 if success, error code(<0) if fail
4393 * @retval PMINFO_R_OK success
4394 * @retval PMINFO_R_EINVAL invalid argument
4395 * @retval PMINFO_R_ERROR internal error
4396 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4397 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4398 * @see pkgmgrinfo_pkginfo_load_certinfo()
4400 static int get_cert_info(const char *pkgid)
4403 pkgmgrinfo_certinfo_h handle;
4404 char *auth_cert = NULL;
4405 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4406 if (ret != PMINFO_R_OK)
4408 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4409 if (ret != PMINFO_R_OK) {
4410 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4413 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4414 if (ret != PMINFO_R_OK) {
4415 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4418 printf("Author root certificate: %s\n", auth_root);
4419 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4424 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4427 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4428 * @brief This API destroys the package cert information handle freeing up all the resources
4430 * @par This API is for package-manager client application
4431 * @par Sync (or) Async : Synchronous API
4433 * @param[in] handle pointer to the package cert handle.
4434 * @return 0 if success, error code(<0) if fail
4435 * @retval PMINFO_R_OK success
4436 * @retval PMINFO_R_EINVAL invalid argument
4437 * @retval PMINFO_R_ERROR internal error
4438 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4440 * @see pkgmgrinfo_pkginfo_load_certinfo()
4442 static int get_cert_info(const char *pkgid)
4445 pkgmgrinfo_certinfo_h handle;
4446 char *auth_cert = NULL;
4447 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4448 if (ret != PMINFO_R_OK)
4450 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4451 if (ret != PMINFO_R_OK) {
4452 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4455 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4456 if (ret != PMINFO_R_OK) {
4457 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4460 printf("Author root certificate: %s\n", auth_root);
4461 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4466 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4469 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4470 * @brief This API deletes the package cert information from DB
4472 * @par This API is for package-manager client application
4473 * @par Sync (or) Async : Synchronous API
4475 * @param[in] pkgid pointer to the package ID.
4476 * @return 0 if success, error code(<0) if fail
4477 * @retval PMINFO_R_OK success
4478 * @retval PMINFO_R_EINVAL invalid argument
4479 * @retval PMINFO_R_ERROR internal error
4483 static int delete_cert_info(const char *pkgid)
4486 ret = pkgmgrinfo_delete_certinfo(pkgid);
4487 if (ret != PMINFO_R_OK)
4493 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4494 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4496 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4497 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4498 * @brief This API creates the package db information handle to set data in db.
4500 * @par This API is for package-manager client application
4501 * @par Sync (or) Async : Synchronous API
4503 * @param[in] pkgid pointer to the package ID.
4504 * @param[in] uid the addressee user id of the instruction
4505 * @param[out] handle pointer to the package db info handle.
4506 * @return 0 if success, error code(<0) if fail
4507 * @retval PMINFO_R_OK success
4508 * @retval PMINFO_R_EINVAL invalid argument
4509 * @retval PMINFO_R_ERROR internal error
4511 * @post pkgmgrinfo_destroy_pkgdbinfo()
4512 * @see pkgmgrinfo_save_pkgdbinfo()
4513 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4515 static int set_pkg_in_db(const char *pkgid)
4518 pkgmgrinfo_pkgdbinfo_h handle;
4519 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4520 if (ret != PMINFO_R_OK)
4522 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4523 if (ret != PMINFO_R_OK) {
4524 pkgmgrinfo_destroy_pkgdbinfo(handle);
4527 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4528 if (ret != PMINFO_R_OK) {
4529 pkgmgrinfo_destroy_pkgdbinfo(handle);
4532 pkgmgrinfo_destroy_pkgdbinfo(handle);
4537 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4538 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4541 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4542 * @brief This API sets the package type in db handle
4544 * @par This API is for package-manager client application
4545 * @par Sync (or) Async : Synchronous API
4547 * @param[in] handle pointer to the pkgdbinfo handle.
4548 * @param[in] type pointer to the package type.
4549 * @return 0 if success, error code(<0) if fail
4550 * @retval PMINFO_R_OK success
4551 * @retval PMINFO_R_EINVAL invalid argument
4552 * @retval PMINFO_R_ERROR internal error
4553 * @pre pkgmgrinfo_create_pkgdbinfo()
4554 * @post pkgmgrinfo_destroy_pkgdbinfo()
4555 * @see pkgmgrinfo_save_pkgdbinfo()
4556 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4558 static int set_pkg_type_in_db(const char *pkgid)
4561 pkgmgrinfo_pkgdbinfo_h handle;
4562 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4563 if (ret != PMINFO_R_OK)
4565 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4566 if (ret != PMINFO_R_OK) {
4567 pkgmgrinfo_destroy_pkgdbinfo(handle);
4570 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4571 if (ret != PMINFO_R_OK) {
4572 pkgmgrinfo_destroy_pkgdbinfo(handle);
4575 pkgmgrinfo_destroy_pkgdbinfo(handle);
4580 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4583 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4584 * @brief This API sets the package version in db handle
4586 * @par This API is for package-manager client application
4587 * @par Sync (or) Async : Synchronous API
4589 * @param[in] handle pointer to the pkgdbinfo handle.
4590 * @param[in] version pointer to the package version
4591 * @return 0 if success, error code(<0) if fail
4592 * @retval PMINFO_R_OK success
4593 * @retval PMINFO_R_EINVAL invalid argument
4594 * @retval PMINFO_R_ERROR internal error
4595 * @pre pkgmgrinfo_create_pkgdbinfo()
4596 * @post pkgmgrinfo_destroy_pkgdbinfo()
4597 * @see pkgmgrinfo_save_pkgdbinfo()
4598 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4600 static int set_pkg_version_in_db(const char *pkgid)
4603 pkgmgrinfo_pkgdbinfo_h handle;
4604 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4605 if (ret != PMINFO_R_OK)
4607 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4608 if (ret != PMINFO_R_OK) {
4609 pkgmgrinfo_destroy_pkgdbinfo(handle);
4612 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4613 if (ret != PMINFO_R_OK) {
4614 pkgmgrinfo_destroy_pkgdbinfo(handle);
4617 pkgmgrinfo_destroy_pkgdbinfo(handle);
4622 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4625 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4626 * @brief This API sets the package install location in db handle
4628 * @par This API is for package-manager client application
4629 * @par Sync (or) Async : Synchronous API
4631 * @param[in] handle pointer to the pkgdbinfo handle.
4632 * @param[in] location package install location
4633 * @return 0 if success, error code(<0) if fail
4634 * @retval PMINFO_R_OK success
4635 * @retval PMINFO_R_EINVAL invalid argument
4636 * @retval PMINFO_R_ERROR internal error
4637 * @pre pkgmgrinfo_create_pkgdbinfo()
4638 * @post pkgmgrinfo_destroy_pkgdbinfo()
4639 * @see pkgmgrinfo_save_pkgdbinfo()
4640 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4642 static int set_pkg_install_location_in_db(const char *pkgid)
4645 pkgmgrinfo_pkgdbinfo_h handle;
4646 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4647 if (ret != PMINFO_R_OK)
4649 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4650 if (ret != PMINFO_R_OK) {
4651 pkgmgrinfo_destroy_pkgdbinfo(handle);
4654 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4655 if (ret != PMINFO_R_OK) {
4656 pkgmgrinfo_destroy_pkgdbinfo(handle);
4659 pkgmgrinfo_destroy_pkgdbinfo(handle);
4664 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4667 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4668 * @brief This API sets the package size in db handle
4670 * @par This API is for package-manager client application
4671 * @par Sync (or) Async : Synchronous API
4673 * @param[in] handle pointer to the pkgdbinfo handle.
4674 * @param[in] size pointer to the package size
4675 * @return 0 if success, error code(<0) if fail
4676 * @retval PMINFO_R_OK success
4677 * @retval PMINFO_R_EINVAL invalid argument
4678 * @retval PMINFO_R_ERROR internal error
4679 * @pre pkgmgrinfo_create_pkgdbinfo()
4680 * @post pkgmgrinfo_destroy_pkgdbinfo()
4681 * @see pkgmgrinfo_save_pkgdbinfo()
4682 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4684 static int set_pkg_size_in_db(const char *pkgid)
4687 pkgmgrinfo_pkgdbinfo_h handle;
4688 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4689 if (ret != PMINFO_R_OK)
4691 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4692 if (ret != PMINFO_R_OK) {
4693 pkgmgrinfo_destroy_pkgdbinfo(handle);
4696 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4697 if (ret != PMINFO_R_OK) {
4698 pkgmgrinfo_destroy_pkgdbinfo(handle);
4701 pkgmgrinfo_destroy_pkgdbinfo(handle);
4706 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4709 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4710 * @brief This API sets the package label in db handle
4712 * @par This API is for package-manager client application
4713 * @par Sync (or) Async : Synchronous API
4715 * @param[in] handle pointer to the pkgdbinfo handle.
4716 * @param[in] label pointer to the package label
4717 * @param[in] locale pointer to the locale
4718 * @return 0 if success, error code(<0) if fail
4719 * @retval PMINFO_R_OK success
4720 * @retval PMINFO_R_EINVAL invalid argument
4721 * @retval PMINFO_R_ERROR internal error
4722 * @pre pkgmgrinfo_create_pkgdbinfo()
4723 * @post pkgmgrinfo_destroy_pkgdbinfo()
4724 * @see pkgmgrinfo_save_pkgdbinfo()
4725 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4727 static int set_pkg_label_in_db(const char *pkgid)
4730 pkgmgrinfo_pkgdbinfo_h handle;
4731 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4732 if (ret != PMINFO_R_OK)
4734 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4735 if (ret != PMINFO_R_OK) {
4736 pkgmgrinfo_destroy_pkgdbinfo(handle);
4739 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4740 if (ret != PMINFO_R_OK) {
4741 pkgmgrinfo_destroy_pkgdbinfo(handle);
4744 pkgmgrinfo_destroy_pkgdbinfo(handle);
4749 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4752 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4753 * @brief This API sets the package icon in db handle
4755 * @par This API is for package-manager client application
4756 * @par Sync (or) Async : Synchronous API
4758 * @param[in] handle pointer to the pkgdbinfo handle.
4759 * @param[in] icon pointer to the package icon
4760 * @param[in] locale pointer to the locale
4761 * @return 0 if success, error code(<0) if fail
4762 * @retval PMINFO_R_OK success
4763 * @retval PMINFO_R_EINVAL invalid argument
4764 * @retval PMINFO_R_ERROR internal error
4765 * @pre pkgmgrinfo_create_pkgdbinfo()
4766 * @post pkgmgrinfo_destroy_pkgdbinfo()
4767 * @see pkgmgrinfo_save_pkgdbinfo()
4768 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4770 static int set_pkg_icon_in_db(const char *pkgid)
4773 pkgmgrinfo_pkgdbinfo_h handle;
4774 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4775 if (ret != PMINFO_R_OK)
4777 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4778 if (ret != PMINFO_R_OK) {
4779 pkgmgrinfo_destroy_pkgdbinfo(handle);
4782 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4783 if (ret != PMINFO_R_OK) {
4784 pkgmgrinfo_destroy_pkgdbinfo(handle);
4787 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4795 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4796 * @brief This API sets the package description in db handle
4798 * @par This API is for package-manager client application
4799 * @par Sync (or) Async : Synchronous API
4801 * @param[in] handle pointer to the pkgdbinfo handle.
4802 * @param[in] description pointer to the package description
4803 * @param[in] locale pointer to the locale
4804 * @return 0 if success, error code(<0) if fail
4805 * @retval PMINFO_R_OK success
4806 * @retval PMINFO_R_EINVAL invalid argument
4807 * @retval PMINFO_R_ERROR internal error
4808 * @pre pkgmgrinfo_create_pkgdbinfo()
4809 * @post pkgmgrinfo_destroy_pkgdbinfo()
4810 * @see pkgmgrinfo_save_pkgdbinfo()
4811 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4813 static int set_pkg_description_in_db(const char *pkgid)
4816 pkgmgrinfo_pkgdbinfo_h handle;
4817 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4818 if (ret != PMINFO_R_OK)
4820 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4821 if (ret != PMINFO_R_OK) {
4822 pkgmgrinfo_destroy_pkgdbinfo(handle);
4825 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4826 if (ret != PMINFO_R_OK) {
4827 pkgmgrinfo_destroy_pkgdbinfo(handle);
4830 pkgmgrinfo_destroy_pkgdbinfo(handle);
4835 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4838 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4839 const char *author_email, const char *author_href, const char *locale)
4840 * @brief This API sets the package author info in db handle
4842 * @par This API is for package-manager client application
4843 * @par Sync (or) Async : Synchronous API
4845 * @param[in] handle pointer to the pkgdbinfo handle.
4846 * @param[in] author_name pointer to the package author name
4847 * @param[in] author_email pointer to the package author email
4848 * @param[in] author_href pointer to the package author href
4849 * @param[in] locale pointer to the locale
4850 * @return 0 if success, error code(<0) if fail
4851 * @retval PMINFO_R_OK success
4852 * @retval PMINFO_R_EINVAL invalid argument
4853 * @retval PMINFO_R_ERROR internal error
4854 * @pre pkgmgrinfo_create_pkgdbinfo()
4855 * @post pkgmgrinfo_destroy_pkgdbinfo()
4856 * @see pkgmgrinfo_save_pkgdbinfo()
4857 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4859 static int set_pkg_author_in_db(const char *pkgid)
4862 pkgmgrinfo_pkgdbinfo_h handle;
4863 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4864 if (ret != PMINFO_R_OK)
4866 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4867 if (ret != PMINFO_R_OK) {
4868 pkgmgrinfo_destroy_pkgdbinfo(handle);
4871 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4872 if (ret != PMINFO_R_OK) {
4873 pkgmgrinfo_destroy_pkgdbinfo(handle);
4876 pkgmgrinfo_destroy_pkgdbinfo(handle);
4881 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4882 const char *author_email, const char *author_href, const char *locale);
4885 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4886 * @brief This API sets the package 'removable' value in db handle
4888 * @par This API is for package-manager client application
4889 * @par Sync (or) Async : Synchronous API
4891 * @param[in] handle pointer to the pkgdbinfo handle.
4892 * @param[in] removable package removable value
4893 * @return 0 if success, error code(<0) if fail
4894 * @retval PMINFO_R_OK success
4895 * @retval PMINFO_R_EINVAL invalid argument
4896 * @retval PMINFO_R_ERROR internal error
4897 * @pre pkgmgrinfo_create_pkgdbinfo()
4898 * @post pkgmgrinfo_destroy_pkgdbinfo()
4899 * @see pkgmgrinfo_save_pkgdbinfo()
4900 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4902 static int set_pkg_removable_in_db(const char *pkgid)
4905 pkgmgrinfo_pkgdbinfo_h handle;
4906 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4907 if (ret != PMINFO_R_OK)
4909 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4910 if (ret != PMINFO_R_OK) {
4911 pkgmgrinfo_destroy_pkgdbinfo(handle);
4914 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4915 if (ret != PMINFO_R_OK) {
4916 pkgmgrinfo_destroy_pkgdbinfo(handle);
4919 pkgmgrinfo_destroy_pkgdbinfo(handle);
4924 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4927 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4928 * @brief This API sets the package 'preload' value in db handle
4930 * @par This API is for package-manager client application
4931 * @par Sync (or) Async : Synchronous API
4933 * @param[in] handle pointer to the pkgdbinfo handle.
4934 * @param[in] preload package preload value
4935 * @return 0 if success, error code(<0) if fail
4936 * @retval PMINFO_R_OK success
4937 * @retval PMINFO_R_EINVAL invalid argument
4938 * @retval PMINFO_R_ERROR internal error
4939 * @pre pkgmgrinfo_create_pkgdbinfo()
4940 * @post pkgmgrinfo_destroy_pkgdbinfo()
4941 * @see pkgmgrinfo_save_pkgdbinfo()
4942 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4944 static int set_pkg_preload_in_db(const char *pkgid)
4947 pkgmgrinfo_pkgdbinfo_h handle;
4948 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_destroy_pkgdbinfo(handle);
4956 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_destroy_pkgdbinfo(handle);
4961 pkgmgrinfo_destroy_pkgdbinfo(handle);
4966 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4969 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4970 * @brief This API sets the package 'installed_storage' value in db handle
4972 * @par This API is for package-manager client application
4973 * @par Sync (or) Async : Synchronous API
4975 * @param[in] handle pointer to the pkgdbinfo handle.
4976 * @param[in] location installed_storage value
4977 * @return 0 if success, error code(<0) if fail
4978 * @retval PMINFO_R_OK success
4979 * @retval PMINFO_R_EINVAL invalid argument
4980 * @retval PMINFO_R_ERROR internal error
4981 * @pre pkgmgrinfo_create_pkgdbinfo()
4982 * @post pkgmgrinfo_destroy_pkgdbinfo()
4983 * @see pkgmgrinfo_save_pkgdbinfo()
4985 static int set_pkg_installed_storage_in_db(const char *pkgid)
4988 pkgmgrinfo_pkgdbinfo_h handle;
4989 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4990 if (ret != PMINFO_R_OK)
4992 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4993 if (ret != PMINFO_R_OK) {
4994 pkgmgrinfo_destroy_pkgdbinfo(handle);
4997 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4998 if (ret != PMINFO_R_OK) {
4999 pkgmgrinfo_destroy_pkgdbinfo(handle);
5002 pkgmgrinfo_destroy_pkgdbinfo(handle);
5007 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5010 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5011 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5012 * @brief This API saves all the information from the handle to the DB.
5014 * @par This API is for package-manager client application
5015 * @par Sync (or) Async : Synchronous API
5017 * @param[in] handle pointer to the package db info handle.
5018 * @param[in] uid the addressee user id of the instruction
5019 * @return 0 if success, error code(<0) if fail
5020 * @retval PMINFO_R_OK success
5021 * @retval PMINFO_R_EINVAL invalid argument
5022 * @retval PMINFO_R_ERROR internal error
5023 * @pre pkgmgrinfo_create_pkgdbinfo()
5024 * @post pkgmgrinfo_destroy_pkgdbinfo()
5025 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5027 static int set_pkg_in_db(const char *pkgid)
5030 pkgmgrinfo_pkgdbinfo_h handle;
5031 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5032 if (ret != PMINFO_R_OK)
5034 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5035 if (ret != PMINFO_R_OK) {
5036 pkgmgrinfo_destroy_pkgdbinfo(handle);
5039 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5040 if (ret != PMINFO_R_OK) {
5041 pkgmgrinfo_destroy_pkgdbinfo(handle);
5044 pkgmgrinfo_destroy_pkgdbinfo(handle);
5049 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5050 int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5052 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5053 * @brief This API destroys the package db information handle freeing up all the resources
5055 * @par This API is for package-manager client application
5056 * @par Sync (or) Async : Synchronous API
5058 * @param[in] handle pointer to the package db info handle.
5059 * @return 0 if success, error code(<0) if fail
5060 * @retval PMINFO_R_OK success
5061 * @retval PMINFO_R_EINVAL invalid argument
5062 * @retval PMINFO_R_ERROR internal error
5063 * @pre pkgmgrinfo_create_pkgdbinfo()
5065 * @see pkgmgrinfo_save_pkgdbinfo()
5066 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5068 static int set_pkg_in_db(const char *pkgid)
5071 pkgmgrinfo_pkgdbinfo_h handle;
5072 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5073 if (ret != PMINFO_R_OK)
5075 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5076 if (ret != PMINFO_R_OK) {
5077 pkgmgrinfo_destroy_pkgdbinfo(handle);
5080 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5081 if (ret != PMINFO_R_OK) {
5082 pkgmgrinfo_destroy_pkgdbinfo(handle);
5085 pkgmgrinfo_destroy_pkgdbinfo(handle);
5090 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5094 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5095 * @brief This API creates the package cert information handle to set data in db.
5097 * @par This API is for package-manager client application
5098 * @par Sync (or) Async : Synchronous API
5100 * @param[out] handle pointer to the package cert handle.
5101 * @return 0 if success, error code(<0) if fail
5102 * @retval PMINFO_R_OK success
5103 * @retval PMINFO_R_EINVAL invalid argument
5104 * @retval PMINFO_R_ERROR internal error
5106 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5107 * @see pkgmgrinfo_set_cert_value()
5108 * @see pkgmgrinfo_save_certinfo()
5110 static int set_cert_in_db(const char *pkgid)
5113 pkgmgrinfo_instcertinfo_h handle;
5114 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5115 if (ret != PMINFO_R_OK)
5117 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5118 if (ret != PMINFO_R_OK) {
5119 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5122 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5123 if (ret != PMINFO_R_OK) {
5124 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5127 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5132 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5135 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5136 * @brief This API sets the package cert information in the handle.
5138 * @par This API is for package-manager client application
5139 * @par Sync (or) Async : Synchronous API
5141 * @param[in] handle pointer to the package cert handle.
5142 * @param[in] cert_type certificate type.
5143 * @param[in] cert_value certificate value.
5144 * @return 0 if success, error code(<0) if fail
5145 * @retval PMINFO_R_OK success
5146 * @retval PMINFO_R_EINVAL invalid argument
5147 * @retval PMINFO_R_ERROR internal error
5148 * @pre pkgmgrinfo_create_certinfo_set_handle()
5149 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5150 * @see pkgmgrinfo_save_certinfo()
5152 static int set_cert_in_db(const char *pkgid)
5155 pkgmgrinfo_instcertinfo_h handle;
5156 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5157 if (ret != PMINFO_R_OK)
5159 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5160 if (ret != PMINFO_R_OK) {
5161 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5164 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5165 if (ret != PMINFO_R_OK) {
5166 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5169 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5174 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5177 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5178 * @brief This API saves the package cert information in the DB.
5180 * @par This API is for package-manager client application
5181 * @par Sync (or) Async : Synchronous API
5183 * @param[in] pkgid pointer to the package ID.
5184 * @param[in] handle pointer to the package cert handle.
5185 * @return 0 if success, error code(<0) if fail
5186 * @retval PMINFO_R_OK success
5187 * @retval PMINFO_R_EINVAL invalid argument
5188 * @retval PMINFO_R_ERROR internal error
5189 * @pre pkgmgrinfo_create_certinfo_set_handle()
5190 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5191 * @see pkgmgrinfo_save_certinfo()
5193 static int set_cert_in_db(const char *pkgid)
5196 pkgmgrinfo_instcertinfo_h handle;
5197 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5198 if (ret != PMINFO_R_OK)
5200 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5201 if (ret != PMINFO_R_OK) {
5202 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5205 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5206 if (ret != PMINFO_R_OK) {
5207 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5210 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5215 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5218 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5219 * @brief This API destroys the package cert information handle freeing up all the resources.
5221 * @par This API is for package-manager client application
5222 * @par Sync (or) Async : Synchronous API
5224 * @param[in] handle pointer to the package cert handle.
5225 * @return 0 if success, error code(<0) if fail
5226 * @retval PMINFO_R_OK success
5227 * @retval PMINFO_R_EINVAL invalid argument
5228 * @retval PMINFO_R_ERROR internal error
5229 * @pre pkgmgrinfo_create_certinfo_set_handle()
5231 * @see pkgmgrinfo_save_certinfo()
5233 static int set_cert_in_db(const char *pkgid)
5236 pkgmgrinfo_instcertinfo_h handle;
5237 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5238 if (ret != PMINFO_R_OK)
5240 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5241 if (ret != PMINFO_R_OK) {
5242 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5245 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5246 if (ret != PMINFO_R_OK) {
5247 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5250 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5255 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5258 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5259 * @brief This API gets the datacontrol info
5261 * @par This API is for package-manager client application
5262 * @par Sync (or) Async : Synchronous API
5264 * @param[in] providerid pointer to the providerid of dataconltrol.
5265 * @param[in] type pointer to the type of dataconltrol.
5266 * @param[out] appid pointer to hold appid, need to free after using
5267 * @param[out] access pointer to hold access, need to free after using
5268 * @return 0 if success, error code(<0) if fail
5269 * @retval PMINFO_R_OK success
5270 * @retval PMINFO_R_EINVAL invalid argument
5271 * @retval PMINFO_R_ERROR internal error
5274 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5277 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5278 * @brief This API gets the application 'guest mode visibility' value from the DB
5280 * @par This API is for package-manager client application
5281 * @par Sync (or) Async : Synchronous API
5283 * @param[in] handle pointer to application info handle
5284 * @param[out] status pointer to hold app guest mode visibility value
5285 * @return 0 if success, error code(<0) if fail
5286 * @retval PMINFO_R_OK success
5287 * @retval PMINFO_R_EINVAL invalid argument
5288 * @retval PMINFO_R_ERROR internal error
5289 * @pre pkgmgrinfo_appinfo_get_appinfo()
5290 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5291 * @see pkgmgrinfo_appinfo_get_appid()
5292 * @see pkgmgrinfo_appinfo_is_multiple()
5294 static int get_app_guestmode_visibility(const char *appid)
5298 pkgmgrinfo_appinfo_h handle;
5299 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5300 if (ret != PMINFO_R_OK)
5302 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5303 if (ret != PMINFO_R_OK) {
5304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5307 printf("app guest mode visibility: %d\n", status);
5308 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5313 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5316 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5317 * @brief This API sets the application 'guest mode visibility' value in the DB
5319 * @par This API is for package-manager client application
5320 * @par Sync (or) Async : Synchronous API
5322 * @param[in] handle pointer to application info handle
5323 * @param[out] status app guest mode visibility value
5324 * @return 0 if success, error code(<0) if fail
5325 * @retval PMINFO_R_OK success
5326 * @retval PMINFO_R_EINVAL invalid argument
5327 * @retval PMINFO_R_ERROR internal error
5328 * @pre pkgmgrinfo_appinfo_get_appinfo()
5329 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5330 * @see pkgmgrinfo_appinfo_get_appid()
5331 * @see pkgmgrinfo_appinfo_is_multiple()
5333 static int set_app_guestmode_visibility(const char *appid, bool value)
5336 pkgmgrinfo_appinfo_h handle;
5337 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5338 if (ret != PMINFO_R_OK)
5340 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5341 if (ret != PMINFO_R_OK) {
5342 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5350 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5351 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5353 * @pkgmgrinfo client API
5357 * @brief listening status type in pkgmgrinfo.
5359 #define PMINFO_CLIENT_STATUS_ALL 0x00
5360 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5361 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5362 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5363 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5364 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5365 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5368 * @brief type definition.
5370 typedef void pkgmgrinfo_client;
5371 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5372 const char *pkgid, const char *key,
5373 const char *val, const void *pmsg, void *data);
5379 }pkgmgrinfo_client_type;
5382 * @brief This APIs provides pkgmgrinfo client listener
5384 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5385 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5386 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5387 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5388 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5391 * @pkgmgrinfo client API end
5399 #endif /* __PKG_INFO_H__ */