4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
52 #include <sys/types.h>
62 * This is package information library
64 * Package Information Library is used to get package related information.\n
65 * It uses the package manifest information database to get any package related information\n
66 * It also provides API to set information in the package info database\n
72 * @brief Package Information Library Header File
74 * Generated by Sewook Park <sewook7.park@samsung.com>
78 * @brief A type to retrieve uid information from the manifest handle
82 } pkgmgrinfo_uidinfo_t;
85 * @brief A handle to insert certificate information
87 typedef void* pkgmgrinfo_instcertinfo_h;
90 * @brief Certificate Types to be used for setting information
93 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
94 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
95 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
96 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
97 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
98 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
99 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
100 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
101 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
102 }pkgmgrinfo_instcert_type;
105 PMINFO_CERT_COMPARE_MATCH,
106 PMINFO_CERT_COMPARE_MISMATCH,
107 PMINFO_CERT_COMPARE_LHS_NO_CERT,
108 PMINFO_CERT_COMPARE_RHS_NO_CERT,
109 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
110 PMINFO_CERT_COMPARE_ERROR,
111 } pkgmgrinfo_cert_compare_result_type_e;
114 * @brief API return values
117 PMINFO_R_EINVAL = -2, /**< Invalid argument */
118 PMINFO_R_ERROR = -1, /**< General error */
119 PMINFO_R_OK = 0 /**< General success */
123 * @brief Value to be used when filtering based on install location
125 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
128 * @brief Value to be used when filtering based on install location
130 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
133 * @brief Value to be used when filtering based on install location
135 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
138 * @brief Value to be used when filtering based on app-component
140 #define PMINFO_APPINFO_UI_APP "UI_APP"
143 * @brief Value to be used when filtering based on app-component
145 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
148 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
149 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
150 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
151 }pkgmgrinfo_app_hwacceleration;
154 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
155 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
156 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
157 }pkgmgrinfo_app_screenreader;
160 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
161 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
162 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
163 }pkgmgrinfo_app_recentimage;
166 * @brief A handle to get package information
168 typedef void* pkgmgrinfo_pkginfo_h;
171 * @brief A handle to get application information
173 typedef void* pkgmgrinfo_appinfo_h;
176 * @brief A handle to get certificate information
178 typedef void* pkgmgrinfo_certinfo_h;
181 * @brief A handle to insert package information
183 typedef void* pkgmgrinfo_pkgdbinfo_h;
186 * @brief A handle to filter package information
188 typedef void* pkgmgrinfo_pkginfo_filter_h;
191 * @brief A handle to filter application information
193 typedef void* pkgmgrinfo_appinfo_filter_h;
196 * @brief A handle to filter application metadata information
198 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
201 * @brief A handle to get appcontrol information
203 typedef void* pkgmgrinfo_appcontrol_h;
206 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
208 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
210 * @param[in] handle the pkginfo handle
211 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
213 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
215 * @see pkgmgrinfo_pkginfo_get_list()
216 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
218 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
222 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
224 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
226 * @param[in] handle the appinfo handle
227 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
229 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
231 * @see pkgmgrinfo_appinfo_get_list()
232 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
233 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
235 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
239 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
241 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
243 * @param[in] category_name the name of the category
244 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
246 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
248 * @see pkgmgrinfo_appinfo_foreach_category()
250 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
254 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
256 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
258 * @param[in] permission_name the name of the permission
259 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
261 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
263 * @see pkgmgrinfo_appinfo_foreach_category()
265 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
269 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
271 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
273 * @param[in] privilege_name the name of the privilege
274 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
276 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
278 * @see pkgmgrinfo_pkginfo_foreach_privilege()
280 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
284 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
286 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
288 * @param[in] metadata_name the name of the metadata
289 * @param[in] metadata_value the value of the metadata
290 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
292 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
294 * @see pkgmgrinfo_appinfo_foreach_metadata()
296 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
297 const char *metadata_value, void *user_data);
300 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
302 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
304 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
305 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
307 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
309 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
311 typedef int (*pkgmgrinfo_app_control_list_cb ) (const char *operation, const char *uri, const char *mime,
315 * @brief Install Location Types
318 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
319 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
320 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
321 }pkgmgrinfo_install_location;
324 * @brief Application Component Types
327 PMINFO_ALL_APP = 0, /**< All Application*/
328 PMINFO_UI_APP, /**< UI Application*/
329 PMINFO_SVC_APP, /**< Service Application*/
330 }pkgmgrinfo_app_component;
333 * @brief Application Storage Types
336 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
337 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
338 }pkgmgrinfo_installed_storage;
341 * @brief Certificate Types to be used for getting information
344 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
345 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
346 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
347 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
348 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
349 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
350 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
351 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
352 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
353 }pkgmgrinfo_cert_type;
356 * @brief Install Location Types to be used when setting data in DB
359 INSTALL_INTERNAL = 0, /**< Internal Installation*/
360 INSTALL_EXTERNAL, /**< External Installation*/
364 * @brief permission Types
367 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
368 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
369 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
370 }pkgmgrinfo_permission_type;
373 /** String property for filtering based on package info*/
374 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
375 /** String property for filtering based on package info*/
376 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
377 /** String property for filtering based on package info*/
378 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
381 /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
383 /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
385 /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
387 /** String property for filtering based on package info*/
388 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
390 /** Boolean property for filtering based on package info*/
391 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
392 /** Boolean property for filtering based on package info*/
393 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
394 /** Boolean property for filtering based on package info*/
395 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
396 /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
398 /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
400 /** Boolean property for filtering based on package info*/
401 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
403 /** Integer property for filtering based on package info*/
404 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
406 /** String property for filtering based on app info*/
407 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
408 /** String property for filtering based on app info*/
409 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
410 /** String property for filtering based on app info*/
411 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
420 /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
422 /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
424 /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
426 /** String property for filtering based on app info*/
427 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
429 /** Boolean property for filtering based on app info*/
430 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
431 /** Boolean property for filtering based on app info*/
432 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
433 /** Boolean property for filtering based on app info*/
434 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
435 /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
437 /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
439 /** Boolean property for filtering based on app info*/
440 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
442 /** will be updated*/
443 /** string property for filtering based on pkg info*/
444 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
446 /* For multiuser support */
447 char *getIconPath(uid_t uid);
448 char *getUserPkgParserDBPath(void);
449 char *getUserPkgParserDBPathUID(uid_t uid);
450 char *getUserPkgCertDBPath(void);
451 char *getUserPkgCertDBPathUID(uid_t uid);
452 const char* getUserDesktopPath(uid_t uid);
453 const char* getUserManifestPath(uid_t uid);
456 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
457 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
458 * @brief This API gets list of installed packages
460 * @par This API is for package-manager client application
461 * @par Sync (or) Async : Synchronous API
462 * @param[in] pkg_list_cb iteration function for list
463 * @param[in] user_data user data to be passed to callback function
464 * @param[in] uid the addressee user id of the instruction
465 * @return 0 if success, error code(<0) if fail
466 * @retval PMINFO_R_OK success
467 * @retval PMINFO_R_EINVAL invalid argument
468 * @retval PMINFO_R_ERROR internal error
472 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
476 pkgid1 = (char *)user_data;
477 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
478 if (strcmp(pkgid1, pkgid2) == 0) {
485 static int list_pkgs()
488 char *name = "helloworld";
489 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
490 if (ret != PMINFO_R_OK) {
497 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
498 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
500 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
501 * @brief This API creates the package information handle from db
503 * @par This API is for package-manager client application
504 * @par Sync (or) Async : Synchronous API
506 * @param[in] pkgid pointer to package ID
507 * @param[in] uid the addressee user id of the instruction
508 * @param[out] handle pointer to the package info handle.
509 * @return 0 if success, error code(<0) if fail
510 * @retval PMINFO_R_OK success
511 * @retval PMINFO_R_EINVAL invalid argument
512 * @retval PMINFO_R_ERROR internal error
514 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
515 * @see pkgmgrinfo_pkginfo_get_pkgid()
516 * @see pkgmgrinfo_pkginfo_is_removable()
518 static int get_pkg_type(const char *pkgid)
522 pkgmgrinfo_pkginfo_h handle;
523 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
524 if (ret != PMINFO_R_OK)
526 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
527 if (ret != PMINFO_R_OK) {
528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
531 printf("pkgtype: %s\n", type);
532 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
537 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
538 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
541 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
542 * @brief This API gets the package name from the package ID
544 * @par This API is for package-manager client application
545 * @par Sync (or) Async : Synchronous API
547 * @param[in] handle pointer to package info handle
548 * @param[out] pkg_name pointer to hold package name
549 * @return 0 if success, error code(<0) if fail
550 * @retval PMINFO_R_OK success
551 * @retval PMINFO_R_EINVAL invalid argument
552 * @retval PMINFO_R_ERROR internal error
553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
555 * @see pkgmgrinfo_pkginfo_get_type()
556 * @see pkgmgrinfo_pkginfo_is_removable()
558 static int get_pkg_name(const char *pkgid)
561 char *pkgname = NULL;
562 pkgmgrinfo_pkginfo_h handle;
563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
564 if (ret != PMINFO_R_OK)
566 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
567 if (ret != PMINFO_R_OK) {
568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
571 printf("pkgname: %s\n", pkgname);
572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
577 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
580 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
581 * @brief This API gets the package id from the package ID
583 * @par This API is for package-manager client application
584 * @par Sync (or) Async : Synchronous API
586 * @param[in] handle pointer to package info handle
587 * @param[out] pkgid pointer to hold package id
588 * @return 0 if success, error code(<0) if fail
589 * @retval PMINFO_R_OK success
590 * @retval PMINFO_R_EINVAL invalid argument
591 * @retval PMINFO_R_ERROR internal error
592 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
593 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
594 * @see pkgmgrinfo_pkginfo_get_type()
595 * @see pkgmgrinfo_pkginfo_is_removable()
597 static int get_pkgid(const char *pkgid)
601 pkgmgrinfo_pkginfo_h handle;
602 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
603 if (ret != PMINFO_R_OK)
605 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
606 if (ret != PMINFO_R_OK) {
607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
610 printf("pkg id: %s\n", pkg_id);
611 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
616 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
619 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
620 * @brief This API gets the package type from the package ID
622 * @par This API is for package-manager client application
623 * @par Sync (or) Async : Synchronous API
625 * @param[in] handle pointer to package info handle
626 * @param[out] type pointer to hold package type
627 * @return 0 if success, error code(<0) if fail
628 * @retval PMINFO_R_OK success
629 * @retval PMINFO_R_EINVAL invalid argument
630 * @retval PMINFO_R_ERROR internal error
631 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
632 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
633 * @see pkgmgrinfo_pkginfo_get_pkgid()
634 * @see pkgmgrinfo_pkginfo_is_removable()
636 static int get_pkg_type(const char *pkgid)
640 pkgmgrinfo_pkginfo_h handle;
641 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
642 if (ret != PMINFO_R_OK)
644 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
645 if (ret != PMINFO_R_OK) {
646 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
649 printf("pkgtype: %s\n", type);
650 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
655 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
658 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
659 * @brief This API gets the package version from the package ID
661 * @par This API is for package-manager client application
662 * @par Sync (or) Async : Synchronous API
664 * @param[in] handle pointer to package info handle
665 * @param[out] version pointer to hold package version
666 * @return 0 if success, error code(<0) if fail
667 * @retval PMINFO_R_OK success
668 * @retval PMINFO_R_EINVAL invalid argument
669 * @retval PMINFO_R_ERROR internal error
670 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
671 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
672 * @see pkgmgrinfo_pkginfo_get_pkgid()
673 * @see pkgmgrinfo_pkginfo_is_removable()
675 static int get_pkg_version(const char *pkgid)
678 char *version = NULL;
679 pkgmgrinfo_pkginfo_h handle;
680 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
681 if (ret != PMINFO_R_OK)
683 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
684 if (ret != PMINFO_R_OK) {
685 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
688 printf("pkg version: %s\n", version);
689 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
697 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
698 * @brief This API gets the package install location from the package ID
700 * @par This API is for package-manager client application
701 * @par Sync (or) Async : Synchronous API
703 * @param[in] handle pointer to package info handle
704 * @param[out] location pointer to hold package install location
705 * @return 0 if success, error code(<0) if fail
706 * @retval PMINFO_R_OK success
707 * @retval PMINFO_R_EINVAL invalid argument
708 * @retval PMINFO_R_ERROR internal error
709 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
710 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
711 * @see pkgmgrinfo_pkginfo_get_pkgid()
712 * @see pkgmgrinfo_pkginfo_is_removable()
714 static int get_pkg_install_location(const char *pkgid)
717 pkgmgrinfo_install_location location;
718 pkgmgrinfo_pkginfo_h handle;
719 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
720 if (ret != PMINFO_R_OK)
722 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
723 if (ret != PMINFO_R_OK) {
724 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
727 printf("pkg install location: %d\n", location);
728 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
733 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
736 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
737 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
738 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
739 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
741 * @par This API is for package-manager client application
742 * @par Sync (or) Async : Synchronous API
744 * @param[in] handle pointer to package info handle
745 * @param[out] size pointer to hold package size
746 * @return 0 if success, error code(<0) if fail
747 * @retval PMINFO_R_OK success
748 * @retval PMINFO_R_EINVAL invalid argument
749 * @retval PMINFO_R_ERROR internal error
750 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
751 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
752 * @see pkgmgrinfo_pkginfo_get_pkgid()
753 * @see pkgmgrinfo_pkginfo_is_removable()
755 static int get_pkg_size(const char *pkgid)
759 pkgmgrinfo_pkginfo_h handle;
760 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
761 if (ret != PMINFO_R_OK)
763 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
764 if (ret != PMINFO_R_OK) {
765 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
768 printf("pkgsize: %d\n", size);
769 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
774 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
777 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
778 * @brief This API gets the installed package total size on the target.
780 * @par This API is for package-manager client application
781 * @par Sync (or) Async : Synchronous API
783 * @param[in] handle pointer to package info handle
784 * @param[out] size pointer to hold package total size
785 * @return 0 if success, error code(<0) if fail
786 * @retval PMINFO_R_OK success
787 * @retval PMINFO_R_EINVAL invalid argument
788 * @retval PMINFO_R_ERROR internal error
790 static int get_pkg_total_size(const char *pkgid)
794 pkgmgrinfo_pkginfo_h handle;
795 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
796 if (ret != PMINFO_R_OK)
798 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
799 if (ret != PMINFO_R_OK) {
800 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
803 printf("pkg total size: %d\n", size);
804 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
809 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
812 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
813 * @brief This API gets the installed package data size on the target.
815 * @par This API is for package-manager client application
816 * @par Sync (or) Async : Synchronous API
818 * @param[in] handle pointer to package info handle
819 * @param[out] size pointer to hold package data size
820 * @return 0 if success, error code(<0) if fail
821 * @retval PMINFO_R_OK success
822 * @retval PMINFO_R_EINVAL invalid argument
823 * @retval PMINFO_R_ERROR internal error
825 static int get_pkg_data_size(const char *pkgid)
829 pkgmgrinfo_pkginfo_h handle;
830 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
831 if (ret != PMINFO_R_OK)
833 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
834 if (ret != PMINFO_R_OK) {
835 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
838 printf("pkg data size: %d\n", size);
839 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
844 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
847 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
848 * @brief This API gets the package icon from the package ID
850 * @par This API is for package-manager client application
851 * @par Sync (or) Async : Synchronous API
853 * @param[in] handle pointer to package info handle
854 * @param[out] icon pointer to hold package icon
855 * @return 0 if success, error code(<0) if fail
856 * @retval PMINFO_R_OK success
857 * @retval PMINFO_R_EINVAL invalid argument
858 * @retval PMINFO_R_ERROR internal error
859 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
860 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
861 * @see pkgmgrinfo_pkginfo_get_pkgid()
862 * @see pkgmgrinfo_pkginfo_is_removable()
864 static int get_pkg_icon(const char *pkgid)
868 pkgmgrinfo_pkginfo_h handle;
869 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
870 if (ret != PMINFO_R_OK)
872 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
873 if (ret != PMINFO_R_OK) {
874 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
877 printf("pkg icon: %s\n", icon);
878 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
883 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
886 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
887 * @brief This API gets the package label from the package ID
889 * @par This API is for package-manager client application
890 * @par Sync (or) Async : Synchronous API
892 * @param[in] handle pointer to package info handle
893 * @param[out] label pointer to hold package label
894 * @return 0 if success, error code(<0) if fail
895 * @retval PMINFO_R_OK success
896 * @retval PMINFO_R_EINVAL invalid argument
897 * @retval PMINFO_R_ERROR internal error
898 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
899 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
900 * @see pkgmgrinfo_pkginfo_get_pkgid()
901 * @see pkgmgrinfo_pkginfo_is_removable()
903 static int get_pkg_label(const char *pkgid)
907 pkgmgrinfo_pkginfo_h handle;
908 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
909 if (ret != PMINFO_R_OK)
911 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
912 if (ret != PMINFO_R_OK) {
913 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
916 printf("pkg label: %s\n", label);
917 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
922 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
925 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
926 * @brief This API gets the package description from the package ID
928 * @par This API is for package-manager client application
929 * @par Sync (or) Async : Synchronous API
931 * @param[in] handle pointer to package info handle
932 * @param[out] description pointer to hold package description
933 * @return 0 if success, error code(<0) if fail
934 * @retval PMINFO_R_OK success
935 * @retval PMINFO_R_EINVAL invalid argument
936 * @retval PMINFO_R_ERROR internal error
937 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
938 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
939 * @see pkgmgrinfo_pkginfo_get_pkgid()
940 * @see pkgmgrinfo_pkginfo_is_removable()
942 static int get_pkg_description(const char *pkgid)
945 char *description = NULL;
946 pkgmgrinfo_pkginfo_h handle;
947 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
948 if (ret != PMINFO_R_OK)
950 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
951 if (ret != PMINFO_R_OK) {
952 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
955 printf("pkg description: %s\n", description);
956 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
961 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
964 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
965 * @brief This API gets the package's author name from the package ID
967 * @par This API is for package-manager client application
968 * @par Sync (or) Async : Synchronous API
970 * @param[in] handle pointer to package info handle
971 * @param[out] author_name pointer to hold package author name
972 * @return 0 if success, error code(<0) if fail
973 * @retval PMINFO_R_OK success
974 * @retval PMINFO_R_EINVAL invalid argument
975 * @retval PMINFO_R_ERROR internal error
976 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
977 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
978 * @see pkgmgrinfo_pkginfo_get_pkgid()
979 * @see pkgmgrinfo_pkginfo_is_removable()
981 static int get_pkg_author_name(const char *pkgid)
984 char *author_name = NULL;
985 pkgmgrinfo_pkginfo_h handle;
986 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
987 if (ret != PMINFO_R_OK)
989 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
990 if (ret != PMINFO_R_OK) {
991 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
994 printf("pkg author name: %s\n", author_name);
995 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1000 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
1003 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
1004 * @brief This API gets the package's author email from the package ID
1006 * @par This API is for package-manager client application
1007 * @par Sync (or) Async : Synchronous API
1009 * @param[in] handle pointer to package info handle
1010 * @param[out] author_email pointer to hold package author email
1011 * @return 0 if success, error code(<0) if fail
1012 * @retval PMINFO_R_OK success
1013 * @retval PMINFO_R_EINVAL invalid argument
1014 * @retval PMINFO_R_ERROR internal error
1015 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1016 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1017 * @see pkgmgrinfo_pkginfo_get_pkgid()
1018 * @see pkgmgrinfo_pkginfo_is_removable()
1020 static int get_pkg_author_email(const char *pkgid)
1023 char *author_email = NULL;
1024 pkgmgrinfo_pkginfo_h handle;
1025 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1026 if (ret != PMINFO_R_OK)
1028 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1029 if (ret != PMINFO_R_OK) {
1030 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1033 printf("pkg author email: %s\n", author_email);
1034 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1039 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1042 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1043 * @brief This API gets the package's author href from the package ID
1045 * @par This API is for package-manager client application
1046 * @par Sync (or) Async : Synchronous API
1048 * @param[in] handle pointer to package info handle
1049 * @param[out] author_href pointer to hold package author href
1050 * @return 0 if success, error code(<0) if fail
1051 * @retval PMINFO_R_OK success
1052 * @retval PMINFO_R_EINVAL invalid argument
1053 * @retval PMINFO_R_ERROR internal error
1054 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1055 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1056 * @see pkgmgrinfo_pkginfo_get_pkgid()
1057 * @see pkgmgrinfo_pkginfo_is_removable()
1059 static int get_pkg_author_href(const char *pkgid)
1062 char *author_href = NULL;
1063 pkgmgrinfo_pkginfo_h handle;
1064 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1065 if (ret != PMINFO_R_OK)
1067 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1068 if (ret != PMINFO_R_OK) {
1069 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1072 printf("pkg author href: %s\n", author_href);
1073 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1078 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1081 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1082 * @brief This API gets the package installed storagae value from the package ID
1084 * @par This API is for package-manager client application
1085 * @par Sync (or) Async : Synchronous API
1087 * @param[in] handle pointer to package info handle
1088 * @param[out] storage pointer to hold package installed storage
1089 * @return 0 if success, error code(<0) if fail
1090 * @retval PMINFO_R_OK success
1091 * @retval PMINFO_R_EINVAL invalid argument
1092 * @retval PMINFO_R_ERROR internal error
1093 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1094 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1095 * @see pkgmgrinfo_pkginfo_get_pkgid()
1096 * @see pkgmgrinfo_pkginfo_is_removable()
1098 static int get_pkg_installed_storage(const char *pkgid)
1101 pkgmgrinfo_installed_storage storage;
1102 pkgmgrinfo_pkginfo_h handle;
1103 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1104 if (ret != PMINFO_R_OK)
1106 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1107 if (ret != PMINFO_R_OK) {
1108 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1111 printf("pkg installed storage: %d\n", storage);
1112 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1117 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1120 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1121 * @brief This API gets the installed time of package from the package ID
1123 * @par This API is for package-manager client application
1124 * @par Sync (or) Async : Synchronous API
1126 * @param[in] handle pointer to package info handle
1127 * @param[out] installed_time pointer to hold installed time of package
1128 * @return 0 if success, error code(<0) if fail
1129 * @retval PMINFO_R_OK success
1130 * @retval PMINFO_R_EINVAL invalid argument
1131 * @retval PMINFO_R_ERROR internal error
1132 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1133 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1134 * @see pkgmgrinfo_pkginfo_get_pkgid()
1135 * @see pkgmgrinfo_pkginfo_is_removable()
1137 static int get_pkg_installed_time(const char *pkgid)
1140 int installed_time = 0;
1141 pkgmgrinfo_pkginfo_h handle;
1142 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1143 if (ret != PMINFO_R_OK)
1145 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1146 if (ret != PMINFO_R_OK) {
1147 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1150 printf("installed_time: %d\n", installed_time);
1151 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1156 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1159 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1160 * @brief This API gets the launch mode of package from the package ID
1162 * @par This API is for package-manager client application
1163 * @par Sync (or) Async : Synchronous API
1165 * @param[in] handle pointer to package info handle
1166 * @param[out] mode pointer to hold launch mode of package
1167 * @return 0 if success, error code(<0) if fail
1168 * @retval PMINFO_R_OK success
1169 * @retval PMINFO_R_EINVAL invalid argument
1170 * @retval PMINFO_R_ERROR internal error
1171 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1172 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1173 * @see pkgmgrinfo_pkginfo_get_pkgid()
1174 * @see pkgmgrinfo_pkginfo_is_removable()
1176 static int get_pkg_launch_mode(const char *pkgid)
1179 char *launch_mode = NULL;
1180 pkgmgrinfo_pkginfo_h handle;
1181 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1182 if (ret != PMINFO_R_OK)
1184 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1185 if (ret != PMINFO_R_OK) {
1186 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1189 printf("launch mode: %s\n", mode);
1190 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1195 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1198 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1199 * @brief This API gets the store client id of package from the package ID
1201 * @par This API is for package-manager client application
1202 * @par Sync (or) Async : Synchronous API
1204 * @param[in] handle pointer to package info handle
1205 * @param[out] storeclientid pointer to hold store client id of package
1206 * @return 0 if success, error code(<0) if fail
1207 * @retval PMINFO_R_OK success
1208 * @retval PMINFO_R_EINVAL invalid argument
1209 * @retval PMINFO_R_ERROR internal error
1210 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1211 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1212 * @see pkgmgrinfo_pkginfo_get_pkgid()
1213 * @see pkgmgrinfo_pkginfo_is_removable()
1215 static int get_pkg_storeclientid(const char *pkgid)
1218 char *storeclientid = 0;
1219 pkgmgrinfo_pkginfo_h handle;
1220 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1221 if (ret != PMINFO_R_OK)
1223 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1224 if (ret != PMINFO_R_OK) {
1225 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1228 printf(store client id: %s\n", storeclientid);
1229 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1234 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1237 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1238 * @brief This API gets the main app id of package from the package ID
1240 * @par This API is for package-manager client application
1241 * @par Sync (or) Async : Synchronous API
1243 * @param[in] handle pointer to package info handle
1244 * @param[out] mainappid pointer to hold main app id of package
1245 * @return 0 if success, error code(<0) if fail
1246 * @retval PMINFO_R_OK success
1247 * @retval PMINFO_R_EINVAL invalid argument
1248 * @retval PMINFO_R_ERROR internal error
1249 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1250 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1251 * @see pkgmgrinfo_pkginfo_get_pkgid()
1252 * @see pkgmgrinfo_pkginfo_is_removable()
1254 static int get_pkg_mainappid(const char *pkgid)
1257 char *mainappid = 0;
1258 pkgmgrinfo_pkginfo_h handle;
1259 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1260 if (ret != PMINFO_R_OK)
1262 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1263 if (ret != PMINFO_R_OK) {
1264 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1267 printf(main app id: %s\n", mainappid);
1268 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1273 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1276 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1277 * @brief This API gets the url of package from the package ID
1279 * @par This API is for package-manager client application
1280 * @par Sync (or) Async : Synchronous API
1282 * @param[in] handle pointer to package info handle
1283 * @param[out] url pointer to hold url of package
1284 * @return 0 if success, error code(<0) if fail
1285 * @retval PMINFO_R_OK success
1286 * @retval PMINFO_R_EINVAL invalid argument
1287 * @retval PMINFO_R_ERROR internal error
1288 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1289 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1290 * @see pkgmgrinfo_pkginfo_get_pkgid()
1291 * @see pkgmgrinfo_pkginfo_is_removable()
1293 static int get_pkg_url(const char *pkgid)
1297 pkgmgrinfo_pkginfo_h handle;
1298 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1299 if (ret != PMINFO_R_OK)
1301 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1302 if (ret != PMINFO_R_OK) {
1303 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1306 printf("url : %s\n", url);
1307 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1312 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1316 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1317 * @brief This API gets the root path of package
1319 * @par Sync (or) Async : Synchronous API
1321 * @param[in] handle pointer to package info handle
1322 * @param[out] path pointer to hold root path of package
1323 * @return 0 if success, error code(<0) if fail
1324 * @retval PMINFO_R_OK success
1325 * @retval PMINFO_R_EINVAL invalid argument
1326 * @retval PMINFO_R_ERROR internal error
1328 static int get_root_path(const char *pkgid)
1332 pkgmgrinfo_pkginfo_h handle;
1333 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1334 if (ret != PMINFO_R_OK)
1337 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1338 if (ret != PMINFO_R_OK) {
1339 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1342 printf("path : %s\n", path);
1343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1349 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1353 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1354 * @brief This API gets the csc path of package
1356 * @par Sync (or) Async : Synchronous API
1358 * @param[in] handle pointer to package info handle
1359 * @param[out] path pointer to hold csc path of package
1360 * @return 0 if success, error code(<0) if fail
1361 * @retval PMINFO_R_OK success
1362 * @retval PMINFO_R_EINVAL invalid argument
1363 * @retval PMINFO_R_ERROR internal error
1365 static int get_csc_path(const char *pkgid)
1369 pkgmgrinfo_pkginfo_h handle;
1370 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1371 if (ret != PMINFO_R_OK)
1374 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1375 if (ret != PMINFO_R_OK) {
1376 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1379 printf("path : %s\n", path);
1380 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1386 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1389 * @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)
1390 * @brief This API compare the cert information from given package id
1392 * @par This API is for package-manager client application
1393 * @par Sync (or) Async : Synchronous API
1395 * @param[in] lhs_package_id pointer to first package ID
1396 * @param[in] rhs_package_id pointer to second package ID
1397 * @param[out] compare_result pointer to the compare result.
1398 * @return 0 if success, error code(<0) if fail
1399 * @retval PMINFO_R_OK success
1400 * @retval PMINFO_R_EINVAL invalid argument
1401 * @retval PMINFO_R_ERROR internal error
1403 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1404 * @see pkgmgrinfo_pkginfo_get_pkgid()
1405 * @see pkgmgrinfo_pkginfo_is_removable()
1407 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1410 pkgmgrinfo_cert_compare_result_type_e result;
1412 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1413 if (ret != PMINFO_R_OK) {
1416 printf("result: %d\n", result);
1421 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);
1422 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);
1424 * @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)
1425 * @brief This API compare the cert information from given app id
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] lhs_app_id pointer to first app ID
1431 * @param[in] rhs_app_id pointer to second app ID
1432 * @param[out] compare_result pointer to the compare result.
1433 * @return 0 if success, error code(<0) if fail
1434 * @retval PMINFO_R_OK success
1435 * @retval PMINFO_R_EINVAL invalid argument
1436 * @retval PMINFO_R_ERROR internal error
1438 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1439 * @see pkgmgrinfo_pkginfo_get_pkgid()
1440 * @see pkgmgrinfo_pkginfo_is_removable()
1442 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1445 pkgmgrinfo_cert_compare_result_type_e result;
1447 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1448 if (ret != PMINFO_R_OK) {
1451 printf("result: %d\n", result);
1456 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);
1457 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);
1459 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1460 * @brief This API gets the package 'removable' value from the package ID
1462 * @par This API is for package-manager client application
1463 * @par Sync (or) Async : Synchronous API
1465 * @param[in] handle pointer to package info handle
1466 * @param[out] removable pointer to hold package removable value
1467 * @return 0 if success, error code(<0) if fail
1468 * @retval PMINFO_R_OK success
1469 * @retval PMINFO_R_EINVAL invalid argument
1470 * @retval PMINFO_R_ERROR internal error
1471 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1472 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1473 * @see pkgmgrinfo_pkginfo_get_pkgid()
1474 * @see pkgmgrinfo_pkginfo_is_readonly()
1476 static int get_pkg_removable(const char *pkgid)
1480 pkgmgrinfo_pkginfo_h handle;
1481 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1482 if (ret != PMINFO_R_OK)
1484 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1485 if (ret != PMINFO_R_OK) {
1486 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1489 printf("pkg removable: %d\n", removable);
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1495 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1498 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1499 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1501 * @par This API is for package-manager client application
1502 * @par Sync (or) Async : Synchronous API
1504 * @param[in] handle pointer to package info handle
1505 * @param[out] movable pointer to hold package movable state
1506 * @return 0 if success, error code(<0) if fail
1507 * @retval PMINFO_R_OK success
1508 * @retval PMINFO_R_EINVAL invalid argument
1509 * @retval PMINFO_R_ERROR internal error
1510 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1511 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1512 * @see pkgmgrinfo_pkginfo_get_pkgid()
1514 static int get_pkg_movable(const char *pkgid)
1518 pkgmgrinfo_pkginfo_h handle;
1519 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1520 if (ret != PMINFO_R_OK)
1522 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1523 if (ret != PMINFO_R_OK) {
1524 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1527 printf("pkg movable: %d\n", movable);
1528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1533 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1536 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1537 * @brief This API gets the package 'preload' value from the package ID
1539 * @par This API is for package-manager client application
1540 * @par Sync (or) Async : Synchronous API
1542 * @param[in] handle pointer to package info handle
1543 * @param[out] preload pointer to hold package preload value
1544 * @return 0 if success, error code(<0) if fail
1545 * @retval PMINFO_R_OK success
1546 * @retval PMINFO_R_EINVAL invalid argument
1547 * @retval PMINFO_R_ERROR internal error
1548 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1549 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1550 * @see pkgmgrinfo_pkginfo_get_pkgid()
1551 * @see pkgmgrinfo_pkginfo_is_readonly()
1553 static int get_pkg_preload(const char *pkgid)
1557 pkgmgrinfo_pkginfo_h handle;
1558 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1559 if (ret != PMINFO_R_OK)
1561 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1562 if (ret != PMINFO_R_OK) {
1563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1566 printf("pkg preload: %d\n", preload);
1567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1572 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1575 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1576 * @brief This API gets the value for given handle is system or not
1578 * @par This API is for package-manager client application
1579 * @par Sync (or) Async : Synchronous API
1581 * @param[in] handle pointer to package info handle
1582 * @param[out] system pointer to hold system is or not
1583 * @return 0 if success, error code(<0) if fail
1584 * @retval PMINFO_R_OK success
1585 * @retval PMINFO_R_EINVAL invalid argument
1586 * @retval PMINFO_R_ERROR internal error
1587 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1588 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1589 * @see pkgmgrinfo_pkginfo_get_pkgid()
1590 * @see pkgmgrinfo_pkginfo_is_readonly()
1592 static int get_pkg_system(const char *pkgid)
1595 bool system = false;
1596 pkgmgrinfo_pkginfo_h handle = NULL;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1600 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1601 if (ret != PMINFO_R_OK) {
1602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1605 printf("pkg system: %d\n", system);
1606 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1614 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1615 * @brief This API gets the package 'readonly' value from the package ID
1617 * @par This API is for package-manager client application
1618 * @par Sync (or) Async : Synchronous API
1620 * @param[in] handle pointer to package info handle
1621 * @param[out] readonly pointer to hold package readonly value
1622 * @return 0 if success, error code(<0) if fail
1623 * @retval PMINFO_R_OK success
1624 * @retval PMINFO_R_EINVAL invalid argument
1625 * @retval PMINFO_R_ERROR internal error
1626 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1627 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1628 * @see pkgmgrinfo_pkginfo_get_pkgid()
1629 * @see pkgmgrinfo_pkginfo_is_removable()
1631 static int get_pkg_readonly(const char *pkgid)
1635 pkgmgrinfo_pkginfo_h handle;
1636 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1637 if (ret != PMINFO_R_OK)
1639 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1640 if (ret != PMINFO_R_OK) {
1641 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1644 printf("pkg readonly: %d\n", readonly);
1645 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1654 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1655 * @brief This API gets the package 'upate' value from the package ID
1657 * @par This API is for package-manager client application
1658 * @par Sync (or) Async : Synchronous API
1660 * @param[in] handle pointer to package info handle
1661 * @param[out] update pointer to hold package update value
1662 * @return 0 if success, error code(<0) if fail
1663 * @retval PMINFO_R_OK success
1664 * @retval PMINFO_R_EINVAL invalid argument
1665 * @retval PMINFO_R_ERROR internal error
1666 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1667 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1668 * @see pkgmgrinfo_pkginfo_get_pkgid()
1670 static int get_pkg_update(const char *pkgid)
1674 pkgmgrinfo_pkginfo_h handle;
1675 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1676 if (ret != PMINFO_R_OK)
1678 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1679 if (ret != PMINFO_R_OK) {
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1683 printf("pkg update: %d\n", update);
1684 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1689 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1693 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1694 * @brief This API gets the package 'uid' value from the view table of user database
1696 * @par This API is for package-manager client application
1697 * @par Sync (or) Async : Synchronous API
1699 * @param[in] uid uid of the user to determine the database
1700 * @param[in] pkgid id of the current package
1701 * @return 1 if it a global package, 0 else
1704 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1708 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1709 * @brief This API gets the package 'accessible' value from the package ID
1711 * @par This API is for package-manager client application
1712 * @par Sync (or) Async : Synchronous API
1714 * @param[in] handle pointer to package info handle
1715 * @param[out] accessible pointer to hold package accessible value
1716 * @return 0 if success, error code(<0) if fail
1717 * @retval PMINFO_R_OK success
1718 * @retval PMINFO_R_EINVAL invalid argument
1719 * @retval PMINFO_R_ERROR internal error
1720 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1721 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1722 * @see pkgmgrinfo_pkginfo_get_pkgid()
1723 * @see pkgmgrinfo_pkginfo_is_readonly()
1725 static int get_pkg_accessible(const char *pkgid)
1729 pkgmgrinfo_pkginfo_h handle;
1730 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1731 if (ret != PMINFO_R_OK)
1733 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1734 if (ret != PMINFO_R_OK) {
1735 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1738 printf("pkg accessible: %d\n", accessible);
1739 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1744 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1747 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1748 * @brief This API destroys the package information handle freeing up all the resources
1750 * @par This API is for package-manager client application
1751 * @par Sync (or) Async : Synchronous API
1753 * @param[in] handle pointer to the package info handle
1754 * @return 0 if success, error code(<0) if fail
1755 * @retval PMINFO_R_OK success
1756 * @retval PMINFO_R_EINVAL invalid argument
1757 * @retval PMINFO_R_ERROR internal error
1758 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1760 * @see pkgmgrinfo_pkginfo_get_pkgid()
1761 * @see pkgmgrinfo_pkginfo_is_removable()
1763 static int get_pkg_type(const char *pkgid)
1767 pkgmgrinfo_pkginfo_h handle;
1768 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1769 if (ret != PMINFO_R_OK)
1771 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1772 if (ret != PMINFO_R_OK) {
1773 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1776 printf("pkgtype: %s\n", type);
1777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1782 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1785 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1786 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1787 The query will search the entire package information collected from the manifest file of all the installed packages
1789 * @par This API is for package-manager client application
1790 * @par Sync (or) Async : Synchronous API
1792 * @param[out] handle pointer to the package info filter handle.
1793 * @return 0 if success, error code(<0) if fail
1794 * @retval PMINFO_R_OK success
1795 * @retval PMINFO_R_EINVAL invalid argument
1796 * @retval PMINFO_R_ERROR internal error
1798 * @post pkgmgrinfo_pkginfo_filter_destroy()
1799 * @see pkgmgrinfo_pkginfo_filter_count()
1800 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1802 static int get_rpm_pkg_count()
1806 pkgmgrinfo_pkginfo_filter_h handle;
1807 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1808 if (ret != PMINFO_R_OK)
1810 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1811 if (ret != PMINFO_R_OK) {
1812 pkgmgrinfo_pkginfo_filter_destroy(handle);
1815 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1816 if (ret != PMINFO_R_OK) {
1817 pkgmgrinfo_pkginfo_filter_destroy(handle);
1820 printf("No of rpm pkgs: %d\n", count);
1821 pkgmgrinfo_pkginfo_filter_destroy(handle);
1826 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1829 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1830 * @brief This API destroys the package information filter handle freeing up all the resources
1832 * @par This API is for package-manager client application
1833 * @par Sync (or) Async : Synchronous API
1835 * @param[in] handle pointer to the package info filter handle.
1836 * @return 0 if success, error code(<0) if fail
1837 * @retval PMINFO_R_OK success
1838 * @retval PMINFO_R_EINVAL invalid argument
1839 * @retval PMINFO_R_ERROR internal error
1840 * @pre pkgmgrinfo_pkginfo_filter_create()
1842 * @see pkgmgrinfo_pkginfo_filter_count()
1843 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1845 static int get_rpm_pkg_count()
1849 pkgmgrinfo_pkginfo_filter_h handle;
1850 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1851 if (ret != PMINFO_R_OK)
1853 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1854 if (ret != PMINFO_R_OK) {
1855 pkgmgrinfo_pkginfo_filter_destroy(handle);
1858 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1859 if (ret != PMINFO_R_OK) {
1860 pkgmgrinfo_pkginfo_filter_destroy(handle);
1863 printf("No of rpm pkgs: %d\n", count);
1864 pkgmgrinfo_pkginfo_filter_destroy(handle);
1869 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1872 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1873 * @brief This API adds a boolean filter property to the filter handle
1875 * @par This API is for package-manager client application
1876 * @par Sync (or) Async : Synchronous API
1878 * @param[in] handle pointer to the package info filter handle.
1879 * @param[in] property boolean property name.
1880 * @param[in] value value corresponding to the property.
1881 * @return 0 if success, error code(<0) if fail
1882 * @retval PMINFO_R_OK success
1883 * @retval PMINFO_R_EINVAL invalid argument
1884 * @retval PMINFO_R_ERROR internal error
1885 * @pre pkgmgrinfo_pkginfo_filter_create()
1886 * @post pkgmgrinfo_pkginfo_filter_destroy()
1887 * @see pkgmgrinfo_pkginfo_filter_count()
1888 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1890 static int get_preload_pkg_count()
1894 pkgmgrinfo_pkginfo_filter_h handle;
1895 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1896 if (ret != PMINFO_R_OK)
1898 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1899 if (ret != PMINFO_R_OK) {
1900 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1904 if (ret != PMINFO_R_OK) {
1905 pkgmgrinfo_pkginfo_filter_destroy(handle);
1908 printf("No of preload pkgs: %d\n", count);
1909 pkgmgrinfo_pkginfo_filter_destroy(handle);
1914 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1915 const char *property, const bool value);
1918 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1919 * @brief This API adds an integer filter property to the filter handle
1921 * @par This API is for package-manager client application
1922 * @par Sync (or) Async : Synchronous API
1924 * @param[in] handle pointer to the package info filter handle.
1925 * @param[in] property integer property name.
1926 * @param[in] value value corresponding to the property.
1927 * @return 0 if success, error code(<0) if fail
1928 * @retval PMINFO_R_OK success
1929 * @retval PMINFO_R_EINVAL invalid argument
1930 * @retval PMINFO_R_ERROR internal error
1931 * @pre pkgmgrinfo_pkginfo_filter_create()
1932 * @post pkgmgrinfo_pkginfo_filter_destroy()
1933 * @see pkgmgrinfo_pkginfo_filter_count()
1934 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1936 static int get_pkg_count()
1940 pkgmgrinfo_pkginfo_filter_h handle;
1941 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1942 if (ret != PMINFO_R_OK)
1944 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1949 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1950 if (ret != PMINFO_R_OK) {
1951 pkgmgrinfo_pkginfo_filter_destroy(handle);
1954 printf("No of preload pkgs: %d\n", count);
1955 pkgmgrinfo_pkginfo_filter_destroy(handle);
1960 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1961 const char *property, const int value);
1964 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1965 * @brief This API adds a string filter property to the filter handle
1967 * @par This API is for package-manager client application
1968 * @par Sync (or) Async : Synchronous API
1970 * @param[in] handle pointer to the package info filter handle.
1971 * @param[in] property string property name.
1972 * @param[in] value value corresponding to the property.
1973 * @return 0 if success, error code(<0) if fail
1974 * @retval PMINFO_R_OK success
1975 * @retval PMINFO_R_EINVAL invalid argument
1976 * @retval PMINFO_R_ERROR internal error
1977 * @pre pkgmgrinfo_pkginfo_filter_create()
1978 * @post pkgmgrinfo_pkginfo_filter_destroy()
1979 * @see pkgmgrinfo_pkginfo_filter_count()
1980 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1982 static int get_rpm_pkg_count()
1986 pkgmgrinfo_pkginfo_filter_h handle;
1987 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1988 if (ret != PMINFO_R_OK)
1990 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1991 if (ret != PMINFO_R_OK) {
1992 pkgmgrinfo_pkginfo_filter_destroy(handle);
1995 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1996 if (ret != PMINFO_R_OK) {
1997 pkgmgrinfo_pkginfo_filter_destroy(handle);
2000 printf("No of rpm pkgs: %d\n", count);
2001 pkgmgrinfo_pkginfo_filter_destroy(handle);
2006 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2007 const char *property, const char *value);
2010 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2011 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2013 * @par This API is for package-manager client application
2014 * @par Sync (or) Async : Synchronous API
2016 * @param[in] handle pointer to the package info filter handle.
2017 * @param[in] pkg_cb callback function.
2018 * @param[in] user_data user data to be passed to the callback function
2019 * @return 0 if success, error code(<0) if fail
2020 * @retval PMINFO_R_OK success
2021 * @retval PMINFO_R_EINVAL invalid argument
2022 * @retval PMINFO_R_ERROR internal error
2023 * @pre pkgmgrinfo_pkginfo_filter_create()
2024 * @post pkgmgrinfo_pkginfo_filter_destroy()
2025 * @see pkgmgrinfo_pkginfo_filter_count()
2027 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2030 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2031 printf("pkg id : %s\n", pkgid);
2035 static int get_rpm_pkg_list()
2038 pkgmgrinfo_pkginfo_filter_h handle;
2039 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2040 if (ret != PMINFO_R_OK)
2042 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2043 if (ret != PMINFO_R_OK) {
2044 pkgmgrinfo_pkginfo_filter_destroy(handle);
2047 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2048 if (ret != PMINFO_R_OK) {
2049 pkgmgrinfo_pkginfo_filter_destroy(handle);
2052 pkgmgrinfo_pkginfo_filter_destroy(handle);
2057 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2058 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2059 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2060 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2063 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2064 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2065 * @brief This API counts the package that satisfy the filter conditions
2067 * @par This API is for package-manager client application
2068 * @par Sync (or) Async : Synchronous API
2070 * @param[in] handle pointer to the package info filter handle.
2071 * @param[in] count pointer to store the count value.
2072 * @param[in] uid the addressee user id of the instruction
2073 * @return 0 if success, error code(<0) if fail
2074 * @retval PMINFO_R_OK success
2075 * @retval PMINFO_R_EINVAL invalid argument
2076 * @retval PMINFO_R_ERROR internal error
2077 * @pre pkgmgrinfo_pkginfo_filter_create()
2078 * @post pkgmgrinfo_pkginfo_filter_destroy()
2079 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2081 static int get_rpm_pkg_count()
2085 pkgmgrinfo_pkginfo_filter_h handle;
2086 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2087 if (ret != PMINFO_R_OK)
2089 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2090 if (ret != PMINFO_R_OK) {
2091 pkgmgrinfo_pkginfo_filter_destroy(handle);
2094 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2095 if (ret != PMINFO_R_OK) {
2096 pkgmgrinfo_pkginfo_filter_destroy(handle);
2099 printf("No of rpm pkgs: %d\n", count);
2100 pkgmgrinfo_pkginfo_filter_destroy(handle);
2105 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2106 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2108 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2109 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2110 * @brief This API gets the list of privilege for a particular package
2112 * @par This API is for package-manager client application
2113 * @par Sync (or) Async : Synchronous API
2114 * @param[in] handle pointer to the package info handle.
2115 * @param[in] privilege_func callback function for list
2116 * @param[in] user_data user data to be passed to callback function
2117 * @return 0 if success, error code(<0) if fail
2118 * @retval PMINFO_R_OK success
2119 * @retval PMINFO_R_EINVAL invalid argument
2120 * @retval PMINFO_R_ERROR internal error
2121 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2122 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2124 int privilege_func(const char *name, void *user_data)
2126 if (strcmp(name, (char *)user_data) == 0)
2132 static int list_privilege(const char *package, char *privilege)
2135 pkgmgrinfo_pkginfo_h handle;
2136 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2137 if (ret != PMINFO_R_OK)
2139 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2140 if (ret != PMINFO_R_OK) {
2141 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2144 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2149 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2150 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2152 /* TODO: add doxygen comment here */
2153 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2154 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2155 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2156 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2157 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2158 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2159 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2162 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2163 pkgmgrinfo_app_list_cb app_func, void *user_data)
2164 * @brief This API gets list of installed applications for a particular package
2166 * @par This API is for package-manager client application
2167 * @par Sync (or) Async : Synchronous API
2168 * @param[in] handle package info handle
2169 * @param[in] component application component
2170 * @param[in] app_func iteration function for list
2171 * @param[in] user_data user data to be passed to callback function
2172 * @return 0 if success, error code(<0) if fail
2173 * @retval PMINFO_R_OK success
2174 * @retval PMINFO_R_EINVAL invalid argument
2175 * @retval PMINFO_R_ERROR internal error
2176 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2177 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2179 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2182 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2183 printf("appid : %s\n", appid);
2187 static int list_apps(const char *pkgid)
2190 pkgmgrinfo_pkginfo_h handle;
2191 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2192 if (ret != PMINFO_R_OK)
2194 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2195 if (ret != PMINFO_R_OK) {
2196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2199 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2204 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2205 pkgmgrinfo_app_list_cb app_func, void *user_data);
2206 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2207 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2209 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2210 * @brief This API gets list of installed applications from all packages with minimum informaion.
2212 * @par This API is for package-manager client application
2213 * @par Sync (or) Async : Synchronous API
2214 * @param[in] app_func iteration function for list
2215 * @param[in] user_data user data to be passed to callback function
2216 * @return 0 if success, error code(<0) if fail
2217 * @retval PMINFO_R_OK success
2218 * @retval PMINFO_R_EINVAL invalid argument
2219 * @retval PMINFO_R_ERROR internal error
2223 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2225 char *pkgid1 = NULL;
2226 char *pkgid2 = NULL;
2227 pkgid1 = (char *)user_data;
2228 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2229 if (strcmp(pkgid1, pkgid2) == 0) {
2236 static int list_apps()
2239 char *name = "helloworld";
2240 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2241 if (ret != PMINFO_R_OK) {
2248 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2249 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2251 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2252 * @brief This API gets list of installed applications from all packages.
2254 * @par This API is for package-manager client application
2255 * @par Sync (or) Async : Synchronous API
2256 * @param[in] app_func iteration function for list
2257 * @param[in] user_data user data to be passed to callback function
2258 * @return 0 if success, error code(<0) if fail
2259 * @retval PMINFO_R_OK success
2260 * @retval PMINFO_R_EINVAL invalid argument
2261 * @retval PMINFO_R_ERROR internal error
2265 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2267 char *pkgid1 = NULL;
2268 char *pkgid2 = NULL;
2269 pkgid1 = (char *)user_data;
2270 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2271 if (strcmp(pkgid1, pkgid2) == 0) {
2278 static int list_apps()
2281 char *name = "helloworld";
2282 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2283 if (ret != PMINFO_R_OK) {
2290 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2291 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2294 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2295 * @brief This API creates the application information handle from db
2297 * @par This API is for package-manager client application
2298 * @par Sync (or) Async : Synchronous API
2300 * @param[in] appid pointer to appid
2301 * @param[out] handle pointer to the application info handle.
2302 * @return 0 if success, error code(<0) if fail
2303 * @retval PMINFO_R_OK success
2304 * @retval PMINFO_R_EINVAL invalid argument
2305 * @retval PMINFO_R_ERROR internal error
2307 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2308 * @see pkgmgrinfo_appinfo_get_pkgid()
2309 * @see pkgmgrinfo_appinfo_is_multiple()
2311 static int get_app_type(const char *appid)
2315 pkgmgrinfo_appinfo_h handle;
2316 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2317 if (ret != PMINFO_R_OK)
2319 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2320 if (ret != PMINFO_R_OK) {
2321 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2324 printf("apptype: %s\n", type);
2325 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2330 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2331 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2333 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2334 * @brief This API gets the application ID
2336 * @par This API is for package-manager client application
2337 * @par Sync (or) Async : Synchronous API
2339 * @param[in] handle pointer to the application info handle.
2340 * @param[out] appid pointer to hold appid
2341 * @return 0 if success, error code(<0) if fail
2342 * @retval PMINFO_R_OK success
2343 * @retval PMINFO_R_EINVAL invalid argument
2344 * @retval PMINFO_R_ERROR internal error
2345 * @pre pkgmgrinfo_appinfo_get_appinfo()
2346 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2347 * @see pkgmgrinfo_appinfo_get_pkgid()
2348 * @see pkgmgrinfo_appinfo_is_multiple()
2350 static int get_app_id(const char *appid)
2353 char *app_id = NULL;
2354 pkgmgrinfo_appinfo_h handle;
2355 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2356 if (ret != PMINFO_R_OK)
2358 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2359 if (ret != PMINFO_R_OK) {
2360 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2363 printf("app id: %s\n", app_id);
2364 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2369 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2372 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2373 * @brief This API gets the package name of the application
2375 * @par This API is for package-manager client application
2376 * @par Sync (or) Async : Synchronous API
2378 * @param[in] handle pointer to the application info handle.
2379 * @param[out] pkg_name pointer to hold package name
2380 * @return 0 if success, error code(<0) if fail
2381 * @retval PMINFO_R_OK success
2382 * @retval PMINFO_R_EINVAL invalid argument
2383 * @retval PMINFO_R_ERROR internal error
2384 * @pre pkgmgrinfo_appinfo_get_appinfo()
2385 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2386 * @see pkgmgrinfo_appinfo_get_appid()
2387 * @see pkgmgrinfo_appinfo_is_multiple()
2389 static int get_app_pkgname(const char *appid)
2392 char *pkgname = NULL;
2393 pkgmgrinfo_appinfo_h handle;
2394 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2395 if (ret != PMINFO_R_OK)
2397 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2398 if (ret != PMINFO_R_OK) {
2399 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2402 printf("pkg name: %s\n", pkgname);
2403 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2408 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2411 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2412 * @brief This API gets the package id of the application
2414 * @par This API is for package-manager client application
2415 * @par Sync (or) Async : Synchronous API
2417 * @param[in] handle pointer to the application info handle.
2418 * @param[out] pkgid pointer to hold package id
2419 * @return 0 if success, error code(<0) if fail
2420 * @retval PMINFO_R_OK success
2421 * @retval PMINFO_R_EINVAL invalid argument
2422 * @retval PMINFO_R_ERROR internal error
2423 * @pre pkgmgrinfo_appinfo_get_appinfo()
2424 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2425 * @see pkgmgrinfo_appinfo_get_appid()
2426 * @see pkgmgrinfo_appinfo_is_multiple()
2428 static int get_app_pkgid(const char *appid)
2432 pkgmgrinfo_appinfo_h handle;
2433 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2434 if (ret != PMINFO_R_OK)
2436 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2437 if (ret != PMINFO_R_OK) {
2438 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2441 printf("pkg id: %s\n", pkgid);
2442 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2447 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2450 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2451 * @brief This API gets the executable name of the application
2453 * @par This API is for package-manager client application
2454 * @par Sync (or) Async : Synchronous API
2456 * @param[in] handle pointer to the application info handle.
2457 * @param[out] exec pointer to hold app exec name
2458 * @return 0 if success, error code(<0) if fail
2459 * @retval PMINFO_R_OK success
2460 * @retval PMINFO_R_EINVAL invalid argument
2461 * @retval PMINFO_R_ERROR internal error
2462 * @pre pkgmgrinfo_appinfo_get_appinfo()
2463 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2464 * @see pkgmgrinfo_appinfo_get_appid()
2465 * @see pkgmgrinfo_appinfo_is_multiple()
2467 static int get_app_exec(const char *appid)
2471 pkgmgrinfo_appinfo_h handle;
2472 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2473 if (ret != PMINFO_R_OK)
2475 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2476 if (ret != PMINFO_R_OK) {
2477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2480 printf("exec name: %s\n", exec);
2481 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2486 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2489 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2490 * @brief This API gets the icon name of the application
2492 * @par This API is for package-manager client application
2493 * @par Sync (or) Async : Synchronous API
2495 * @param[in] handle pointer to the application info handle.
2496 * @param[out] icon pointer to hold app icon name
2497 * @return 0 if success, error code(<0) if fail
2498 * @retval PMINFO_R_OK success
2499 * @retval PMINFO_R_EINVAL invalid argument
2500 * @retval PMINFO_R_ERROR internal error
2501 * @pre pkgmgrinfo_appinfo_get_appinfo()
2502 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2503 * @see pkgmgrinfo_appinfo_get_appid()
2504 * @see pkgmgrinfo_appinfo_is_multiple()
2506 static int get_app_icon(const char *appid)
2510 pkgmgrinfo_appinfo_h handle;
2511 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2512 if (ret != PMINFO_R_OK)
2514 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2515 if (ret != PMINFO_R_OK) {
2516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2519 printf("icon name: %s\n", icon);
2520 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2525 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2528 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2529 * @brief This API gets the label of the application
2531 * @par This API is for package-manager client application
2532 * @par Sync (or) Async : Synchronous API
2534 * @param[in] handle pointer to the application info handle.
2535 * @param[out] label pointer to hold app label
2536 * @return 0 if success, error code(<0) if fail
2537 * @retval PMINFO_R_OK success
2538 * @retval PMINFO_R_EINVAL invalid argument
2539 * @retval PMINFO_R_ERROR internal error
2540 * @pre pkgmgrinfo_appinfo_get_appinfo()
2541 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2542 * @see pkgmgrinfo_appinfo_get_appid()
2543 * @see pkgmgrinfo_appinfo_is_multiple()
2545 static int get_app_label(const char *appid)
2549 pkgmgrinfo_appinfo_h handle;
2550 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2551 if (ret != PMINFO_R_OK)
2553 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2554 if (ret != PMINFO_R_OK) {
2555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2558 printf("label : %s\n", label);
2559 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2564 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2567 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2568 * @brief This API gets exactly matched label by given appid and locale
2570 * @par This API is for package-manager client application
2571 * @par Sync (or) Async : Synchronous API
2573 * @param[in] appid pointer to appid
2574 * @param[in] locale pointer to locale
2575 * @param[out] label pointer to hold app label
2576 * @return 0 if success, error code(<0) if fail
2577 * @retval PMINFO_R_OK success
2578 * @retval PMINFO_R_EINVAL invalid argument
2579 * @retval PMINFO_R_ERROR internal error
2581 static int get_localed_label(const char *appid, const char *locale)
2586 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2587 if (ret != PMINFO_R_OK)
2590 printf("localed label: %s\n", label);
2598 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2599 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2602 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2603 * @brief This API gets the component of the application
2605 * @par This API is for package-manager client application
2606 * @par Sync (or) Async : Synchronous API
2608 * @param[in] handle pointer to the application info handle.
2609 * @param[out] component pointer to hold app component
2610 * @return 0 if success, error code(<0) if fail
2611 * @retval PMINFO_R_OK success
2612 * @retval PMINFO_R_EINVAL invalid argument
2613 * @retval PMINFO_R_ERROR internal error
2614 * @pre pkgmgrinfo_appinfo_get_appinfo()
2615 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2616 * @see pkgmgrinfo_appinfo_get_appid()
2617 * @see pkgmgrinfo_appinfo_is_multiple()
2619 static int get_app_component(const char *appid)
2622 pkgmgrinfo_app_component component;
2623 pkgmgrinfo_appinfo_h handle;
2624 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2625 if (ret != PMINFO_R_OK)
2627 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2628 if (ret != PMINFO_R_OK) {
2629 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2632 printf("component : %s\n", component);
2633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2638 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2641 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2642 * @brief This API gets the apptype of the application
2644 * @par This API is for package-manager client application
2645 * @par Sync (or) Async : Synchronous API
2647 * @param[in] handle pointer to the application info handle.
2648 * @param[out] app_type pointer to hold apptype
2649 * @return 0 if success, error code(<0) if fail
2650 * @retval PMINFO_R_OK success
2651 * @retval PMINFO_R_EINVAL invalid argument
2652 * @retval PMINFO_R_ERROR internal error
2653 * @pre pkgmgrinfo_appinfo_get_appinfo()
2654 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2655 * @see pkgmgrinfo_appinfo_get_appid()
2656 * @see pkgmgrinfo_appinfo_is_multiple()
2658 static int get_app_type(const char *appid)
2661 char *apptype = NULL;
2662 pkgmgrinfo_appinfo_h handle;
2663 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2664 if (ret != PMINFO_R_OK)
2666 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2667 if (ret != PMINFO_R_OK) {
2668 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2671 printf("apptype : %s\n", apptype);
2672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2677 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2680 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2681 int *operation_count, char ***operation)
2682 * @brief This API gets the list of operation of the application
2684 * @par This API is for package-manager client application
2685 * @par Sync (or) Async : Synchronous API
2687 * @param[in] handle pointer to the appcontrol handle.
2688 * @param[out] operation_count pointer to hold number of operations
2689 * @param[out] operation pointer to hold list of operations
2690 * @return 0 if success, error code(<0) if fail
2691 * @retval PMINFO_R_OK success
2692 * @retval PMINFO_R_EINVAL invalid argument
2693 * @retval PMINFO_R_ERROR internal error
2694 * @pre pkgmgrinfo_appinfo_get_appinfo()
2695 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2696 * @see pkgmgrinfo_appinfo_get_uri()
2697 * @see pkgmgrinfo_appinfo_get_mime()
2699 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2704 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2705 for (i = 0; i < oc; i++) {
2706 if (strcmp(operation[i], (char *)user_data) == 0)
2713 static int check_operation(const char *appid, char *operation)
2716 pkgmgrinfo_appinfo_h handle;
2717 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2718 if (ret != PMINFO_R_OK)
2720 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2721 if (ret != PMINFO_R_OK) {
2722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2730 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2731 int *operation_count, char ***operation);
2734 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2735 int *uri_count, char ***uri)
2736 * @brief This API gets the list of uri of the application
2738 * @par This API is for package-manager client application
2739 * @par Sync (or) Async : Synchronous API
2741 * @param[in] handle pointer to the appcontrol handle.
2742 * @param[out] uri_count pointer to hold number of uris
2743 * @param[out] uri pointer to hold list of uris
2744 * @return 0 if success, error code(<0) if fail
2745 * @retval PMINFO_R_OK success
2746 * @retval PMINFO_R_EINVAL invalid argument
2747 * @retval PMINFO_R_ERROR internal error
2748 * @pre pkgmgrinfo_appinfo_get_appinfo()
2749 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2750 * @see pkgmgrinfo_appinfo_get_operation()
2751 * @see pkgmgrinfo_appinfo_get_mime()
2753 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2758 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2759 for (i = 0; i < uc; i++) {
2760 if (strcmp(uri[i], (char *)user_data) == 0)
2767 static int check_uri(const char *appid, char *uri)
2770 pkgmgrinfo_appinfo_h handle;
2771 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2772 if (ret != PMINFO_R_OK)
2774 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2775 if (ret != PMINFO_R_OK) {
2776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2779 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2784 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2785 int *uri_count, char ***uri);
2788 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2789 int *mime_count, char ***mime)
2790 * @brief This API gets the list of mime of the application
2792 * @par This API is for package-manager client application
2793 * @par Sync (or) Async : Synchronous API
2795 * @param[in] handle pointer to the appcontrol handle.
2796 * @param[out] mime_count pointer to hold number of mimes
2797 * @param[out] mime pointer to hold list of mimes
2798 * @return 0 if success, error code(<0) if fail
2799 * @retval PMINFO_R_OK success
2800 * @retval PMINFO_R_EINVAL invalid argument
2801 * @retval PMINFO_R_ERROR internal error
2802 * @pre pkgmgrinfo_appinfo_get_appinfo()
2803 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2804 * @see pkgmgrinfo_appinfo_get_uri()
2805 * @see pkgmgrinfo_appinfo_get_operation()
2807 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2812 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2813 for (i = 0; i < mc; i++) {
2814 if (strcmp(mime[i], (char *)user_data) == 0)
2821 static int check_mime(const char *appid, char *mime)
2824 pkgmgrinfo_appinfo_h handle;
2825 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2826 if (ret != PMINFO_R_OK)
2828 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2829 if (ret != PMINFO_R_OK) {
2830 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2838 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2839 int *mime_count, char ***mime);
2842 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2843 int *subapp_count, char ***subapp)
2844 * @brief This API gets the list of subapp of the application
2846 * @par This API is for package-manager client application
2847 * @par Sync (or) Async : Synchronous API
2849 * @param[in] handle pointer to the appcontrol handle.
2850 * @param[out] subapp_count pointer to hold number of subapp
2851 * @param[out] subapp pointer to hold list of subapp
2852 * @return 0 if success, error code(<0) if fail
2853 * @retval PMINFO_R_OK success
2854 * @retval PMINFO_R_EINVAL invalid argument
2855 * @retval PMINFO_R_ERROR internal error
2856 * @pre pkgmgrinfo_appinfo_get_appinfo()
2857 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2858 * @see pkgmgrinfo_appinfo_get_uri()
2859 * @see pkgmgrinfo_appinfo_get_operation()
2861 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2865 char **subapp = NULL;
2866 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2867 for (i = 0; i < sc; i++) {
2868 if (strcmp(subapp[i], (char *)user_data) == 0)
2875 static int check_subapp(const char *appid, char *subapp)
2878 pkgmgrinfo_appinfo_h handle = NULL;
2879 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2880 if (ret != PMINFO_R_OK)
2882 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2883 if (ret != PMINFO_R_OK) {
2884 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2887 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2892 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2893 int *subapp_count, char ***subapp);
2896 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2897 * @brief This API gets the notification icon of the application
2899 * @par This API is for package-manager client application
2900 * @par Sync (or) Async : Synchronous API
2902 * @param[in] handle pointer to the application info handle.
2903 * @param[out] path pointer to hold notification icon
2904 * @return 0 if success, error code(<0) if fail
2905 * @retval PMINFO_R_OK success
2906 * @retval PMINFO_R_EINVAL invalid argument
2907 * @retval PMINFO_R_ERROR internal error
2908 * @pre pkgmgrinfo_appinfo_get_appinfo()
2909 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2910 * @see pkgmgrinfo_appinfo_get_appid()
2911 * @see pkgmgrinfo_appinfo_is_multiple()
2913 static int get_app_notification_icon(const char *appid)
2916 char *notification_icon = NULL;
2917 pkgmgrinfo_appinfo_h handle;
2918 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2919 if (ret != PMINFO_R_OK)
2921 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2922 if (ret != PMINFO_R_OK) {
2923 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2926 printf("notification icon : %s\n", notification_icon);
2927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2932 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2935 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2936 * @brief This API gets the setting icon of the application
2938 * @par This API is for package-manager client application
2939 * @par Sync (or) Async : Synchronous API
2941 * @param[in] handle pointer to the application info handle.
2942 * @param[out] path pointer to hold setting icon
2943 * @return 0 if success, error code(<0) if fail
2944 * @retval PMINFO_R_OK success
2945 * @retval PMINFO_R_EINVAL invalid argument
2946 * @retval PMINFO_R_ERROR internal error
2947 * @pre pkgmgrinfo_appinfo_get_appinfo()
2948 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2949 * @see pkgmgrinfo_appinfo_get_appid()
2950 * @see pkgmgrinfo_appinfo_is_multiple()
2952 static int get_app_setting_icon(const char *appid)
2955 char *setting_icon = NULL;
2956 pkgmgrinfo_appinfo_h handle;
2957 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2958 if (ret != PMINFO_R_OK)
2960 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2961 if (ret != PMINFO_R_OK) {
2962 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2965 printf("setting icon : %s\n", setting_icon);
2966 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2971 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2974 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2975 * @brief This API gets the type of recent image on app-tray
2977 * @par This API is for package-manager client application
2978 * @par Sync (or) Async : Synchronous API
2980 * @param[in] handle pointer to the application info handle.
2981 * @param[out] type pointer to hold image type
2982 * @return 0 if success, error code(<0) if fail
2983 * @retval PMINFO_R_OK success
2984 * @retval PMINFO_R_EINVAL invalid argument
2985 * @retval PMINFO_R_ERROR internal error
2986 * @pre pkgmgrinfo_appinfo_get_appinfo()
2987 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2988 * @see pkgmgrinfo_appinfo_get_appid()
2989 * @see pkgmgrinfo_appinfo_is_multiple()
2991 static int get_app_recent_image_type(const char *appid)
2994 pkgmgrinfo_app_recentimage type;
2995 pkgmgrinfo_appinfo_h handle;
2996 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2997 if (ret != PMINFO_R_OK)
2999 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3000 if (ret != PMINFO_R_OK) {
3001 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3004 printf("recent image type: %d\n", type);
3005 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3010 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3014 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3015 * @brief This API gets the preview image of application
3017 * @par Sync (or) Async : Synchronous API
3019 * @param[in] handle pointer to the application info handle.
3020 * @param[out] preview_img pointer to hold preview image path
3021 * @return 0 if success, error code(<0) if fail
3022 * @retval PMINFO_R_OK success
3023 * @retval PMINFO_R_EINVAL invalid argument
3024 * @retval PMINFO_R_ERROR internal error
3025 * @pre pkgmgrinfo_appinfo_get_appinfo()
3026 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3027 * @see pkgmgrinfo_appinfo_get_appid()
3029 static int get_app_previewimage(const char *appid)
3032 char *preview = NULL;
3033 pkgmgrinfo_appinfo_h handle = NULL;
3034 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3035 if (ret != PMINFO_R_OK)
3037 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3038 if (ret != PMINFO_R_OK) {
3039 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3042 printf("preview image path : %s\n", preview);
3043 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3048 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3052 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3053 * @brief This API gets the package permission type of the application
3055 * @par This API is for package-manager client application
3056 * @par Sync (or) Async : Synchronous API
3058 * @param[in] handle pointer to the application info handle.
3059 * @param[out] permission pointer to hold package permission
3060 * @return 0 if success, error code(<0) if fail
3061 * @retval PMINFO_R_OK success
3062 * @retval PMINFO_R_EINVAL invalid argument
3063 * @retval PMINFO_R_ERROR internal error
3064 * @pre pkgmgrinfo_appinfo_get_appinfo()
3065 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3066 * @see pkgmgrinfo_appinfo_get_appid()
3068 static int get_app_permission(const char *appid)
3071 pkgmgrinfo_permission_type permission = 0;
3072 pkgmgrinfo_appinfo_h handle;
3074 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3075 if (ret != PMINFO_R_OK)
3077 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3078 if (ret != PMINFO_R_OK) {
3079 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3082 printf("permission type: %d\n", permission);
3083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3088 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3091 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3092 * @brief This API gets the component_type
3094 * @par This API is for package-manager client application
3095 * @par Sync (or) Async : Synchronous API
3097 * @param[in] handle pointer to the application info handle.
3098 * @param[out] component_type pointer to hold component_type
3099 * @return 0 if success, error code(<0) if fail
3100 * @retval PMINFO_R_OK success
3101 * @retval PMINFO_R_EINVAL invalid argument
3102 * @retval PMINFO_R_ERROR internal error
3103 * @pre pkgmgrinfo_appinfo_get_appinfo()
3104 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3105 * @see pkgmgrinfo_appinfo_get_pkgid()
3106 * @see pkgmgrinfo_appinfo_is_multiple()
3108 static int get_component_type(const char *appid)
3111 char *component_type = NULL;
3112 pkgmgrinfo_appinfo_h handle;
3113 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3114 if (ret != PMINFO_R_OK)
3116 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3117 if (ret != PMINFO_R_OK) {
3118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3121 printf("component_type: %s\n", component_type);
3122 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3127 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3130 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3131 * @brief This API gets the application 'hwacceleration' value from the app ID
3133 * @par This API is for package-manager client application
3134 * @par Sync (or) Async : Synchronous API
3136 * @param[in] handle pointer to application info handle
3137 * @param[out] hwacceleration pointer to hold package hwacceleration value
3138 * @return 0 if success, error code(<0) if fail
3139 * @retval PMINFO_R_OK success
3140 * @retval PMINFO_R_EINVAL invalid argument
3141 * @retval PMINFO_R_ERROR internal error
3142 * @pre pkgmgrinfo_appinfo_get_appinfo()
3143 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3144 * @see pkgmgrinfo_appinfo_get_appid()
3145 * @see pkgmgrinfo_appinfo_is_multiple()
3147 static int get_app_hwacceleration(const char *appid)
3150 pkgmgrinfo_app_hwacceleration hwacceleration;
3151 pkgmgrinfo_appinfo_h handle;
3152 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3153 if (ret != PMINFO_R_OK)
3155 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3156 if (ret != PMINFO_R_OK) {
3157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3160 printf("app hwacceleration: %d\n", hwacceleration);
3161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3166 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3169 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3170 * @brief This API gets the application 'screenreader' value from the app ID
3172 * @par This API is for package-manager client application
3173 * @par Sync (or) Async : Synchronous API
3175 * @param[in] handle pointer to application info handle
3176 * @param[out] screenreader pointer to hold package accessibility value
3177 * @return 0 if success, error code(<0) if fail
3178 * @retval PMINFO_R_OK success
3179 * @retval PMINFO_R_EINVAL invalid argument
3180 * @retval PMINFO_R_ERROR internal error
3181 * @pre pkgmgrinfo_appinfo_get_appinfo()
3182 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3183 * @see pkgmgrinfo_appinfo_get_appid()
3184 * @see pkgmgrinfo_appinfo_is_multiple()
3186 static int get_app_screenreader(const char *appid)
3189 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3190 pkgmgrinfo_appinfo_h handle = NULL;
3191 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3192 if (ret != PMINFO_R_OK)
3194 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3195 if (ret != PMINFO_R_OK) {
3196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3199 printf("app screenreader: %d\n", screenreader);
3200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3205 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3208 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3209 * @brief This API gets the application's landscape & portrait effect images
3211 * @par This API is for package-manager client application
3212 * @par Sync (or) Async : Synchronous API
3214 * @param[in] handle pointer to application info handle
3215 * @param[out] portrait_img contains portrait mode effect image
3216 * @param[out] landscape_img contains landscape mode effect image
3217 * @return 0 if success, error code(<0) if fail
3218 * @retval PMINFO_R_OK success
3219 * @retval PMINFO_R_EINVAL invalid argument
3220 * @retval PMINFO_R_ERROR internal error
3221 * @pre pkgmgrinfo_appinfo_get_appinfo()
3222 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3223 * @see pkgmgrinfo_appinfo_get_appid()
3224 * @see pkgmgrinfo_appinfo_is_nodisplay()
3226 static int get_app_effectimages(const char *appid)
3229 char *portraitimg = NULL;
3230 char *landscapeimg = NULL;
3231 pkgmgrinfo_appinfo_h handle;
3232 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3233 if (ret != PMINFO_R_OK)
3235 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3236 if (ret != PMINFO_R_OK) {
3237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3240 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3241 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3246 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3249 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3250 * @brief This API gets the submode_mainid of the application
3252 * @par This API is for package-manager client application
3253 * @par Sync (or) Async : Synchronous API
3255 * @param[in] handle pointer to the application info handle.
3256 * @param[out] submode_mainid pointer to hold package name
3257 * @return 0 if success, error code(<0) if fail
3258 * @retval PMINFO_R_OK success
3259 * @retval PMINFO_R_EINVAL invalid argument
3260 * @retval PMINFO_R_ERROR internal error
3261 * @pre pkgmgrinfo_appinfo_get_appinfo()
3262 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3263 * @see pkgmgrinfo_appinfo_get_appid()
3264 * @see pkgmgrinfo_appinfo_is_multiple()
3266 static int get_app_submode_mainid(const char *appid)
3269 char *submode_mainid = NULL;
3270 pkgmgrinfo_appinfo_h handle = NULL;
3271 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3272 if (ret != PMINFO_R_OK)
3274 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3275 if (ret != PMINFO_R_OK) {
3276 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3279 printf("submode_mainid: %s\n", submode_mainid);
3280 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3285 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3288 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3289 * @brief This API gets the datacontrol info
3291 * @par This API is for package-manager client application
3292 * @par Sync (or) Async : Synchronous API
3294 * @param[in] providerid pointer to the providerid of dataconltrol.
3295 * @param[in] type pointer to the type of dataconltrol.
3296 * @param[out] appid pointer to hold appid, need to free after using
3297 * @param[out] access pointer to hold access, need to free after using
3298 * @return 0 if success, error code(<0) if fail
3299 * @retval PMINFO_R_OK success
3300 * @retval PMINFO_R_EINVAL invalid argument
3301 * @retval PMINFO_R_ERROR internal error
3304 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3305 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3308 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3309 * @brief This API gets the appid of datacontrol
3311 * @par This API is for package-manager client application
3312 * @par Sync (or) Async : Synchronous API
3314 * @param[in] providerid pointer to the providerid of dataconltrol.
3315 * @param[out] appid pointer to hold appid, need to free after using
3316 * @return 0 if success, error code(<0) if fail
3317 * @retval PMINFO_R_OK success
3318 * @retval PMINFO_R_EINVAL invalid argument
3319 * @retval PMINFO_R_ERROR internal error
3322 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3323 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3326 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3327 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3328 * @brief This API gets the list of permission for a particular application
3330 * @par This API is for package-manager client application
3331 * @par Sync (or) Async : Synchronous API
3332 * @param[in] handle pointer to the application info handle.
3333 * @param[in] permission_func callback function for list
3334 * @param[in] user_data user data to be passed to callback function
3335 * @return 0 if success, error code(<0) if fail
3336 * @retval PMINFO_R_OK success
3337 * @retval PMINFO_R_EINVAL invalid argument
3338 * @retval PMINFO_R_ERROR internal error
3339 * @pre pkgmgrinfo_appinfo_get_appinfo()
3340 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3342 int permission_func(const char *name, void *user_data)
3344 if (strcmp(name, (char *)user_data) == 0)
3350 static int list_permission(const char *appid, char *permission)
3353 pkgmgrinfo_appinfo_h handle;
3354 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3355 if (ret != PMINFO_R_OK)
3357 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3358 if (ret != PMINFO_R_OK) {
3359 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3367 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3368 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3371 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3372 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3373 * @brief This API gets the list of category for a particular application
3375 * @par This API is for package-manager client application
3376 * @par Sync (or) Async : Synchronous API
3377 * @param[in] handle pointer to the application info handle.
3378 * @param[in] category_func callback function for list
3379 * @param[in] user_data user data to be passed to callback function
3380 * @return 0 if success, error code(<0) if fail
3381 * @retval PMINFO_R_OK success
3382 * @retval PMINFO_R_EINVAL invalid argument
3383 * @retval PMINFO_R_ERROR internal error
3384 * @pre pkgmgrinfo_appinfo_get_appinfo()
3385 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3387 int category_func(const char *name, void *user_data)
3389 if (strcmp(name, (char *)user_data) == 0)
3395 static int list_category(const char *appid, char *category)
3398 pkgmgrinfo_appinfo_h handle;
3399 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3400 if (ret != PMINFO_R_OK)
3402 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3403 if (ret != PMINFO_R_OK) {
3404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3407 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3412 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3413 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3416 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3417 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3418 * @brief This API gets the list of metadata for a particular application
3420 * @par This API is for package-manager client application
3421 * @par Sync (or) Async : Synchronous API
3422 * @param[in] handle pointer to the application info handle.
3423 * @param[in] metadata_func callback function for list
3424 * @param[in] user_data user data to be passed to callback function
3425 * @return 0 if success, error code(<0) if fail
3426 * @retval PMINFO_R_OK success
3427 * @retval PMINFO_R_EINVAL invalid argument
3428 * @retval PMINFO_R_ERROR internal error
3429 * @pre pkgmgrinfo_appinfo_get_appinfo()
3430 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3432 int metadata_func(const char *key, const char *value, void *user_data)
3434 if (strcmp(key, (char *)user_data) == 0) {
3435 printf("Value is %s\n", value);
3442 static int list_metadata(const char *appid, char *key)
3445 pkgmgrinfo_appinfo_h handle;
3446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447 if (ret != PMINFO_R_OK)
3449 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3450 if (ret != PMINFO_R_OK) {
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3454 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3460 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3464 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3465 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3466 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3467 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3468 * @brief This API gets the list of app-control for a particular application
3470 * @par This API is for package-manager client application
3471 * @par Sync (or) Async : Synchronous API
3472 * @param[in] handle pointer to the application info handle.
3473 * @param[in] appcontrol_func callback function for list
3474 * @param[in] user_data user data to be passed to callback function
3475 * @param[in] uid the addressee user id of the instruction
3476 * @return 0 if success, error code(<0) if fail
3477 * @retval PMINFO_R_OK success
3478 * @retval PMINFO_R_EINVAL invalid argument
3479 * @retval PMINFO_R_ERROR internal error
3480 * @pre pkgmgrinfo_appinfo_get_appinfo()
3481 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3483 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3488 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3489 for (i = 0; i < oc; i++) {
3490 if (strcmp(operation[i], (char *)user_data) == 0)
3497 static int check_operation(const char *appid, char *operation)
3500 pkgmgrinfo_appinfo_h handle;
3501 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3502 if (ret != PMINFO_R_OK)
3504 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3505 if (ret != PMINFO_R_OK) {
3506 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3514 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3515 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3518 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3519 * @brief This API gets the application 'nodisplay' value from the app ID
3521 * @par This API is for package-manager client application
3522 * @par Sync (or) Async : Synchronous API
3524 * @param[in] handle pointer to application info handle
3525 * @param[out] nodisplay pointer to hold package nodisplay value
3526 * @return 0 if success, error code(<0) if fail
3527 * @retval PMINFO_R_OK success
3528 * @retval PMINFO_R_EINVAL invalid argument
3529 * @retval PMINFO_R_ERROR internal error
3530 * @pre pkgmgrinfo_appinfo_get_appinfo()
3531 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3532 * @see pkgmgrinfo_appinfo_get_appid()
3533 * @see pkgmgrinfo_appinfo_is_multiple()
3535 static int get_app_nodisplay(const char *appid)
3539 pkgmgrinfo_appinfo_h handle;
3540 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3541 if (ret != PMINFO_R_OK)
3543 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3544 if (ret != PMINFO_R_OK) {
3545 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3548 printf("app nodisplay: %d\n", nodisplay);
3549 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3554 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3557 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3558 * @brief This API gets the application 'multiple' value from the app ID
3560 * @par This API is for package-manager client application
3561 * @par Sync (or) Async : Synchronous API
3563 * @param[in] handle pointer to application info handle
3564 * @param[out] multiple pointer to hold package multiple value
3565 * @return 0 if success, error code(<0) if fail
3566 * @retval PMINFO_R_OK success
3567 * @retval PMINFO_R_EINVAL invalid argument
3568 * @retval PMINFO_R_ERROR internal error
3569 * @pre pkgmgrinfo_appinfo_get_appinfo()
3570 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3571 * @see pkgmgrinfo_appinfo_get_appid()
3572 * @see pkgmgrinfo_appinfo_is_nodisplay()
3574 static int get_app_multiple(const char *appid)
3578 pkgmgrinfo_appinfo_h handle;
3579 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3580 if (ret != PMINFO_R_OK)
3582 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3583 if (ret != PMINFO_R_OK) {
3584 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3587 printf("app multiple: %d\n", multiple);
3588 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3593 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3596 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3597 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3598 * application launching effect. If fales, indicator will be hidden during application launching effect
3600 * @par This API is for package-manager client application
3601 * @par Sync (or) Async : Synchronous API
3603 * @param[in] handle pointer to application info handle
3604 * @param[out] indicator_disp contains indicator display status for application launching effect
3605 * @return 0 if success, error code(<0) if fail
3606 * @retval PMINFO_R_OK success
3607 * @retval PMINFO_R_EINVAL invalid argument
3608 * @retval PMINFO_R_ERROR internal error
3609 * @pre pkgmgrinfo_appinfo_get_appinfo()
3610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3611 * @see pkgmgrinfo_appinfo_get_appid()
3612 * @see pkgmgrinfo_appinfo_is_nodisplay()
3614 static int get_app_indicator_display(const char *appid)
3617 bool indicator_disp;
3618 pkgmgrinfo_appinfo_h handle;
3619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3620 if (ret != PMINFO_R_OK)
3622 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3623 if (ret != PMINFO_R_OK){
3624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3627 printf("app indicator disp : %d\n", indicator_disp);
3628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3633 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3636 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3637 * @brief This API gets the application 'taskmanage' value from the app ID
3639 * @par This API is for package-manager client application
3640 * @par Sync (or) Async : Synchronous API
3642 * @param[in] handle pointer to application info handle
3643 * @param[out] taskmanage pointer to hold package taskmanage value
3644 * @return 0 if success, error code(<0) if fail
3645 * @retval PMINFO_R_OK success
3646 * @retval PMINFO_R_EINVAL invalid argument
3647 * @retval PMINFO_R_ERROR internal error
3648 * @pre pkgmgrinfo_appinfo_get_appinfo()
3649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3650 * @see pkgmgrinfo_appinfo_get_appid()
3651 * @see pkgmgrinfo_appinfo_is_multiple()
3653 static int get_app_taskmanage(const char *appid)
3657 pkgmgrinfo_appinfo_h handle;
3658 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3659 if (ret != PMINFO_R_OK)
3661 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3662 if (ret != PMINFO_R_OK) {
3663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3666 printf("app taskmanage: %d\n", taskmanage);
3667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3672 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3675 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3676 * @brief This API gets the application 'taskmanage' value from the app ID
3678 * @par This API is for package-manager client application
3679 * @par Sync (or) Async : Synchronous API
3681 * @param[in] handle pointer to application info handle
3682 * @param[out] enabled pointer to hold package enabled value
3683 * @return 0 if success, error code(<0) if fail
3684 * @retval PMINFO_R_OK success
3685 * @retval PMINFO_R_EINVAL invalid argument
3686 * @retval PMINFO_R_ERROR internal error
3687 * @pre pkgmgrinfo_appinfo_get_appinfo()
3688 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3689 * @see pkgmgrinfo_appinfo_get_appid()
3690 * @see pkgmgrinfo_appinfo_is_multiple()
3692 static int get_app_enabled(const char *appid)
3696 pkgmgrinfo_appinfo_h handle;
3697 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3698 if (ret != PMINFO_R_OK)
3700 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3701 if (ret != PMINFO_R_OK) {
3702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3705 printf("app enabled: %d\n", enabled);
3706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3711 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3714 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3715 * @brief This API gets the application 'onboot' value from the app ID
3717 * @par This API is for package-manager client application
3718 * @par Sync (or) Async : Synchronous API
3720 * @param[in] handle pointer to application info handle
3721 * @param[out] onboot pointer to hold package onboot value
3722 * @return 0 if success, error code(<0) if fail
3723 * @retval PMINFO_R_OK success
3724 * @retval PMINFO_R_EINVAL invalid argument
3725 * @retval PMINFO_R_ERROR internal error
3726 * @pre pkgmgrinfo_appinfo_get_appinfo()
3727 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3728 * @see pkgmgrinfo_appinfo_get_appid()
3729 * @see pkgmgrinfo_appinfo_is_multiple()
3731 static int get_app_onboot(const char *appid)
3735 pkgmgrinfo_appinfo_h handle;
3736 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3737 if (ret != PMINFO_R_OK)
3739 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3740 if (ret != PMINFO_R_OK) {
3741 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3744 printf("app onboot: %d\n", onboot);
3745 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3750 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3753 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3754 * @brief This API gets the application 'autorestart' value from the app ID
3756 * @par This API is for package-manager client application
3757 * @par Sync (or) Async : Synchronous API
3759 * @param[in] handle pointer to application info handle
3760 * @param[out] autorestart pointer to hold package autorestart value
3761 * @return 0 if success, error code(<0) if fail
3762 * @retval PMINFO_R_OK success
3763 * @retval PMINFO_R_EINVAL invalid argument
3764 * @retval PMINFO_R_ERROR internal error
3765 * @pre pkgmgrinfo_appinfo_get_appinfo()
3766 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3767 * @see pkgmgrinfo_appinfo_get_appid()
3768 * @see pkgmgrinfo_appinfo_is_multiple()
3770 static int get_app_autorestart(const char *appid)
3774 pkgmgrinfo_appinfo_h handle;
3775 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3776 if (ret != PMINFO_R_OK)
3778 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3779 if (ret != PMINFO_R_OK) {
3780 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3783 printf("app autorestart: %d\n", autorestart);
3784 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3789 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3792 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3793 * @brief This API gets the value for given application is main app or not from handle
3795 * @par This API is for package-manager client application
3796 * @par Sync (or) Async : Synchronous API
3798 * @param[in] handle pointer to application info handle
3799 * @param[out] mainapp pointer to hold package mainapp is or not
3800 * @return 0 if success, error code(<0) if fail
3801 * @retval PMINFO_R_OK success
3802 * @retval PMINFO_R_EINVAL invalid argument
3803 * @retval PMINFO_R_ERROR internal error
3804 * @pre pkgmgrinfo_appinfo_get_appinfo()
3805 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3806 * @see pkgmgrinfo_appinfo_get_appid()
3807 * @see pkgmgrinfo_appinfo_is_multiple()
3809 static int get_app_mainapp(const char *appid)
3813 pkgmgrinfo_appinfo_h handle;
3814 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3815 if (ret != PMINFO_R_OK)
3817 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3818 if (ret != PMINFO_R_OK) {
3819 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3822 printf("mainapp: %d\n", mainapp);
3823 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3828 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3832 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3833 * @brief This API gets the value for given application is preload or not from handle
3835 * @par This API is for package-manager client application
3836 * @par Sync (or) Async : Synchronous API
3838 * @param[in] handle pointer to application info handle
3839 * @param[out] preload pointer to hold preload is or not
3840 * @return 0 if success, error code(<0) if fail
3841 * @retval PMINFO_R_OK success
3842 * @retval PMINFO_R_EINVAL invalid argument
3843 * @retval PMINFO_R_ERROR internal error
3844 * @pre pkgmgrinfo_appinfo_get_appinfo()
3845 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3846 * @see pkgmgrinfo_appinfo_get_appid()
3847 * @see pkgmgrinfo_appinfo_is_multiple()
3849 static int get_app_preload(const char *appid)
3853 pkgmgrinfo_appinfo_h handle = NULL;
3854 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3855 if (ret != PMINFO_R_OK)
3857 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3858 if (ret != PMINFO_R_OK) {
3859 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3862 printf("preload: %d\n", preload);
3863 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3868 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3871 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3872 * @brief This API gets the value for given application is submode or not from handle
3874 * @par This API is for package-manager client application
3875 * @par Sync (or) Async : Synchronous API
3877 * @param[in] handle pointer to application info handle
3878 * @param[out] submode pointer to hold submode is or not
3879 * @return 0 if success, error code(<0) if fail
3880 * @retval PMINFO_R_OK success
3881 * @retval PMINFO_R_EINVAL invalid argument
3882 * @retval PMINFO_R_ERROR internal error
3883 * @pre pkgmgrinfo_appinfo_get_appinfo()
3884 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3885 * @see pkgmgrinfo_appinfo_get_appid()
3886 * @see pkgmgrinfo_appinfo_is_multiple()
3888 static int get_app_submode(const char *appid)
3892 pkgmgrinfo_appinfo_h handle = NULL;
3893 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3894 if (ret != PMINFO_R_OK)
3896 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3897 if (ret != PMINFO_R_OK) {
3898 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3901 printf("submode: %d\n", submode);
3902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3907 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3910 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3911 * @brief This API checks if the application has the given category
3913 * @par This API is for package-manager client application
3914 * @par Sync (or) Async : Synchronous API
3916 * @param[in] handle pointer to the application info handle
3917 * @param[in] category category
3918 * @param[out] exist value Gets whether the application has the given category
3919 * @return 0 if success, error code(<0) if fail
3920 * @retval PMINFO_R_OK success
3921 * @retval PMINFO_R_EINVAL invalid argument
3922 * @retval PMINFO_R_ERROR internal error
3924 static int is_category_exist(const char *appid, const char *category)
3927 pkgmgrinfo_appinfo_h handle;
3930 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3931 if (ret != PMINFO_R_OK)
3934 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3935 if (ret != PMINFO_R_OK) {
3936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3940 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3945 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3948 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3949 * @brief This API destroys the application information handle freeing up all the resources
3951 * @par This API is for package-manager client application
3952 * @par Sync (or) Async : Synchronous API
3954 * @param[in] handle pointer to the application info handle.
3955 * @return 0 if success, error code(<0) if fail
3956 * @retval PMINFO_R_OK success
3957 * @retval PMINFO_R_EINVAL invalid argument
3958 * @retval PMINFO_R_ERROR internal error
3959 * @pre pkgmgrinfo_appinfo_get_appinfo()
3961 * @see pkgmgrinfo_appinfo_get_pkgid()
3962 * @see pkgmgrinfo_appinfo_is_multiple()
3964 static int get_app_type(const char *appid)
3968 pkgmgrinfo_appinfo_h handle;
3969 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3970 if (ret != PMINFO_R_OK)
3972 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3973 if (ret != PMINFO_R_OK) {
3974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3977 printf("apptype: %s\n", type);
3978 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3983 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3986 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3987 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3988 The query will search the entire application information collected from the manifest file of all the installed packages
3990 * @par This API is for package-manager client application
3991 * @par Sync (or) Async : Synchronous API
3993 * @param[out] handle pointer to the application info filter handle.
3994 * @return 0 if success, error code(<0) if fail
3995 * @retval PMINFO_R_OK success
3996 * @retval PMINFO_R_EINVAL invalid argument
3997 * @retval PMINFO_R_ERROR internal error
3999 * @post pkgmgrinfo_appinfo_filter_destroy()
4000 * @see pkgmgrinfo_appinfo_filter_count()
4001 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4003 static int get_capp_count()
4007 pkgmgrinfo_appinfo_filter_h handle;
4008 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4009 if (ret != PMINFO_R_OK)
4011 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4012 if (ret != PMINFO_R_OK) {
4013 pkgmgrinfo_appinfo_filter_destroy(handle);
4016 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4017 if (ret != PMINFO_R_OK) {
4018 pkgmgrinfo_appinfo_filter_destroy(handle);
4021 printf("No of capp: %d\n", count);
4022 pkgmgrinfo_appinfo_filter_destroy(handle);
4027 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4030 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4031 * @brief This API destroys the application information filter handle freeing up all the resources
4033 * @par This API is for package-manager client application
4034 * @par Sync (or) Async : Synchronous API
4036 * @param[in] handle pointer to the application info filter handle.
4037 * @return 0 if success, error code(<0) if fail
4038 * @retval PMINFO_R_OK success
4039 * @retval PMINFO_R_EINVAL invalid argument
4040 * @retval PMINFO_R_ERROR internal error
4041 * @pre pkgmgrinfo_appinfo_filter_create()
4043 * @see pkgmgrinfo_appinfo_filter_count()
4044 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4046 static int get_capp_count()
4050 pkgmgrinfo_appinfo_filter_h handle;
4051 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4052 if (ret != PMINFO_R_OK)
4054 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4055 if (ret != PMINFO_R_OK) {
4056 pkgmgrinfo_appinfo_filter_destroy(handle);
4059 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4060 if (ret != PMINFO_R_OK) {
4061 pkgmgrinfo_appinfo_filter_destroy(handle);
4064 printf("No of capp: %d\n", count);
4065 pkgmgrinfo_appinfo_filter_destroy(handle);
4070 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4073 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4074 * @brief This API adds a boolean filter property to the filter handle
4076 * @par This API is for package-manager client application
4077 * @par Sync (or) Async : Synchronous API
4079 * @param[in] handle pointer to the application info filter handle.
4080 * @param[in] property boolean property name.
4081 * @param[in] value value corresponding to the property.
4082 * @return 0 if success, error code(<0) if fail
4083 * @retval PMINFO_R_OK success
4084 * @retval PMINFO_R_EINVAL invalid argument
4085 * @retval PMINFO_R_ERROR internal error
4086 * @pre pkgmgrinfo_appinfo_filter_create()
4087 * @post pkgmgrinfo_appinfo_filter_destroy()
4088 * @see pkgmgrinfo_appinfo_filter_count()
4089 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4091 static int get_taskmanageable_app_count()
4095 pkgmgrinfo_appinfo_filter_h handle;
4096 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4097 if (ret != PMINFO_R_OK)
4099 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4100 if (ret != PMINFO_R_OK) {
4101 pkgmgrinfo_appinfo_filter_destroy(handle);
4104 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4105 if (ret != PMINFO_R_OK) {
4106 pkgmgrinfo_appinfo_filter_destroy(handle);
4109 printf("No of taskmanageable apps: %d\n", count);
4110 pkgmgrinfo_appinfo_filter_destroy(handle);
4115 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4116 const char *property, const bool value);
4119 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4120 * @brief This API adds an integer filter property to the filter handle
4122 * @par This API is for package-manager client application
4123 * @par Sync (or) Async : Synchronous API
4125 * @param[in] handle pointer to the application info filter handle.
4126 * @param[in] property integer property name.
4127 * @param[in] value value corresponding to the property.
4128 * @return 0 if success, error code(<0) if fail
4129 * @retval PMINFO_R_OK success
4130 * @retval PMINFO_R_EINVAL invalid argument
4131 * @retval PMINFO_R_ERROR internal error
4132 * @pre pkgmgrinfo_appinfo_filter_create()
4133 * @post pkgmgrinfo_appinfo_filter_destroy()
4134 * @see pkgmgrinfo_appinfo_filter_count()
4135 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4137 static int get_taskmanageable_app_count()
4141 pkgmgrinfo_appinfo_filter_h handle;
4142 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4143 if (ret != PMINFO_R_OK)
4145 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4146 if (ret != PMINFO_R_OK) {
4147 pkgmgrinfo_appinfo_filter_destroy(handle);
4150 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4151 if (ret != PMINFO_R_OK) {
4152 pkgmgrinfo_appinfo_filter_destroy(handle);
4155 printf("No of apps: %d\n", count);
4156 pkgmgrinfo_appinfo_filter_destroy(handle);
4161 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4162 const char *property, const int value);
4165 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4166 * @brief This API adds a string filter property to the filter handle
4168 * @par This API is for package-manager client application
4169 * @par Sync (or) Async : Synchronous API
4171 * @param[in] handle pointer to the application info filter handle.
4172 * @param[in] property string property name.
4173 * @param[in] value value corresponding to the property.
4174 * @return 0 if success, error code(<0) if fail
4175 * @retval PMINFO_R_OK success
4176 * @retval PMINFO_R_EINVAL invalid argument
4177 * @retval PMINFO_R_ERROR internal error
4178 * @pre pkgmgrinfo_appinfo_filter_create()
4179 * @post pkgmgrinfo_appinfo_filter_destroy()
4180 * @see pkgmgrinfo_appinfo_filter_count()
4181 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4183 static int get_capp_count()
4187 pkgmgrinfo_appinfo_filter_h handle;
4188 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4189 if (ret != PMINFO_R_OK)
4191 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4192 if (ret != PMINFO_R_OK) {
4193 pkgmgrinfo_appinfo_filter_destroy(handle);
4196 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4197 if (ret != PMINFO_R_OK) {
4198 pkgmgrinfo_appinfo_filter_destroy(handle);
4201 printf("No of capp: %d\n", count);
4202 pkgmgrinfo_appinfo_filter_destroy(handle);
4207 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4208 const char *property, const char *value);
4211 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4212 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4214 * @par This API is for package-manager client application
4215 * @par Sync (or) Async : Synchronous API
4217 * @param[in] handle pointer to the application info filter handle.
4218 * @param[in] app_cb callback function.
4219 * @param[in] user_data user data to be passed to the callback function
4220 * @return 0 if success, error code(<0) if fail
4221 * @retval PMINFO_R_OK success
4222 * @retval PMINFO_R_EINVAL invalid argument
4223 * @retval PMINFO_R_ERROR internal error
4224 * @pre pkgmgrinfo_appinfo_filter_create()
4225 * @post pkgmgrinfo_appinfo_filter_destroy()
4226 * @see pkgmgrinfo_appinfo_filter_count()
4228 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4231 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4232 printf("appid : %s\n", appid);
4236 static int get_capp_list()
4239 pkgmgrinfo_appinfo_filter_h handle;
4240 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4241 if (ret != PMINFO_R_OK)
4243 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4244 if (ret != PMINFO_R_OK) {
4245 pkgmgrinfo_appinfo_filter_destroy(handle);
4248 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4249 if (ret != PMINFO_R_OK) {
4250 pkgmgrinfo_appinfo_filter_destroy(handle);
4253 pkgmgrinfo_appinfo_filter_destroy(handle);
4258 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4259 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4260 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4261 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4264 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4265 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4266 * @brief This API counts the application that satisfy the filter conditions
4268 * @par This API is for package-manager client application
4269 * @par Sync (or) Async : Synchronous API
4271 * @param[in] handle pointer to the application info filter handle.
4272 * @param[in] count pointer to store count value
4273 * @param[in] uid the addressee user id of the instruction
4274 * @return 0 if success, error code(<0) if fail
4275 * @retval PMINFO_R_OK success
4276 * @retval PMINFO_R_EINVAL invalid argument
4277 * @retval PMINFO_R_ERROR internal error
4278 * @pre pkgmgrinfo_appinfo_filter_create()
4279 * @post pkgmgrinfo_appinfo_filter_destroy()
4280 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4282 static int get_capp_count()
4286 pkgmgrinfo_appinfo_filter_h handle;
4287 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4288 if (ret != PMINFO_R_OK)
4290 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4291 if (ret != PMINFO_R_OK) {
4292 pkgmgrinfo_appinfo_filter_destroy(handle);
4295 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4296 if (ret != PMINFO_R_OK) {
4297 pkgmgrinfo_appinfo_filter_destroy(handle);
4300 printf("No of capp: %d\n", count);
4301 pkgmgrinfo_appinfo_filter_destroy(handle);
4306 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4307 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4309 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4310 * @brief This API creates the application's metadata information filter handle from db.
4312 * @par This API is for package-manager client application
4313 * @par Sync (or) Async : Synchronous API
4315 * @param[out] handle pointer to the application metadata info filter handle.
4316 * @return 0 if success, error code(<0) if fail
4317 * @retval PMINFO_R_OK success
4318 * @retval PMINFO_R_EINVAL invalid argument
4319 * @retval PMINFO_R_ERROR internal error
4321 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4322 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4324 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4327 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4328 printf("appid : %s\n", appid);
4332 static int get_app_list(const char *mkey, const char *mvalue)
4335 pkgmgrinfo_appinfo_metadata_filter_h handle;
4336 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4337 if (ret != PMINFO_R_OK)
4339 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4340 if (ret != PMINFO_R_OK) {
4341 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4344 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4345 if (ret != PMINFO_R_OK) {
4346 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4349 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4354 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4357 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4358 * @brief This API destroys the application's metadata information filter handle.
4360 * @par This API is for package-manager client application
4361 * @par Sync (or) Async : Synchronous API
4363 * @param[in] handle pointer to the application metadata info filter handle.
4364 * @return 0 if success, error code(<0) if fail
4365 * @retval PMINFO_R_OK success
4366 * @retval PMINFO_R_EINVAL invalid argument
4367 * @retval PMINFO_R_ERROR internal error
4368 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4370 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4372 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4375 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4376 printf("appid : %s\n", appid);
4380 static int get_app_list(const char *mkey, const char *mvalue)
4383 pkgmgrinfo_appinfo_metadata_filter_h handle;
4384 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4385 if (ret != PMINFO_R_OK)
4387 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4388 if (ret != PMINFO_R_OK) {
4389 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4392 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4393 if (ret != PMINFO_R_OK) {
4394 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4397 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4402 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4405 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4406 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4407 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4409 * @par This API is for package-manager client application
4410 * @par Sync (or) Async : Synchronous API
4412 * @param[in] handle pointer to the application metadata info filter handle.
4413 * @param[in] key pointer to metadata key
4414 * @param[in] value pointer to metadata value
4415 * @return 0 if success, error code(<0) if fail
4416 * @retval PMINFO_R_OK success
4417 * @retval PMINFO_R_EINVAL invalid argument
4418 * @retval PMINFO_R_ERROR internal error
4419 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4420 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4421 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4423 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4426 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4427 printf("appid : %s\n", appid);
4431 static int get_app_list(const char *mkey, const char *mvalue)
4434 pkgmgrinfo_appinfo_metadata_filter_h handle;
4435 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4436 if (ret != PMINFO_R_OK)
4438 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4439 if (ret != PMINFO_R_OK) {
4440 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4443 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4444 if (ret != PMINFO_R_OK) {
4445 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4448 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4453 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4454 const char *key, const char *value);
4457 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4458 * @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)
4459 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4460 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4461 * negative value, no more callbacks will be called and API will return.
4463 * @par This API is for package-manager client application
4464 * @par Sync (or) Async : Synchronous API
4466 * @param[in] handle pointer to the application metadata info filter handle.
4467 * @param[in] app_cb function pointer to callback
4468 * @param[in] user_data pointer to user data
4469 * @param[in] uid the addressee user id of the instruction
4470 * @return 0 if success, error code(<0) if fail
4471 * @retval PMINFO_R_OK success
4472 * @retval PMINFO_R_EINVAL invalid argument
4473 * @retval PMINFO_R_ERROR internal error
4474 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4475 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4477 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4480 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4481 printf("appid : %s\n", appid);
4485 static int get_app_list(const char *mkey, const char *mvalue)
4488 pkgmgrinfo_appinfo_metadata_filter_h handle;
4489 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4490 if (ret != PMINFO_R_OK)
4492 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4493 if (ret != PMINFO_R_OK) {
4494 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4497 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4498 if (ret != PMINFO_R_OK) {
4499 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4502 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4507 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4508 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4509 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4510 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4512 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4513 * @brief This API creates the package cert information handle to get data from db.
4515 * @par This API is for package-manager client application
4516 * @par Sync (or) Async : Synchronous API
4518 * @param[out] handle pointer to the package cert handle.
4519 * @return 0 if success, error code(<0) if fail
4520 * @retval PMINFO_R_OK success
4521 * @retval PMINFO_R_EINVAL invalid argument
4522 * @retval PMINFO_R_ERROR internal error
4524 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4525 * @see pkgmgrinfo_pkginfo_get_cert_value()
4526 * @see pkgmgrinfo_pkginfo_load_certinfo()
4528 static int get_cert_info(const char *pkgid)
4531 pkgmgrinfo_certinfo_h handle;
4532 char *auth_cert = NULL;
4533 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4534 if (ret != PMINFO_R_OK)
4536 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4537 if (ret != PMINFO_R_OK) {
4538 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4541 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4542 if (ret != PMINFO_R_OK) {
4543 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4546 printf("Author root certificate: %s\n", auth_root);
4547 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4552 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4555 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4556 * @brief This API loads the package cert information handle with data from db.
4558 * @par This API is for package-manager client application
4559 * @par Sync (or) Async : Synchronous API
4561 * @param[in] pkgid pointer to the package ID.
4562 * @param[in] handle pointer to the package cert handle.
4563 * @return 0 if success, error code(<0) if fail
4564 * @retval PMINFO_R_OK success
4565 * @retval PMINFO_R_EINVAL invalid argument
4566 * @retval PMINFO_R_ERROR internal error
4567 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4568 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4569 * @see pkgmgrinfo_pkginfo_get_cert_value()
4571 static int get_cert_info(const char *pkgid)
4574 pkgmgrinfo_certinfo_h handle;
4575 char *auth_cert = NULL;
4576 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4577 if (ret != PMINFO_R_OK)
4579 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4580 if (ret != PMINFO_R_OK) {
4581 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4584 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4585 if (ret != PMINFO_R_OK) {
4586 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4589 printf("Author root certificate: %s\n", auth_root);
4590 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4595 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4598 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4599 * @brief This API gets the package cert information from the handle
4601 * @par This API is for package-manager client application
4602 * @par Sync (or) Async : Synchronous API
4604 * @param[in] handle pointer to the package cert handle.
4605 * @param[in] cert_type certificate type
4606 * @param[out] cert_value pointer to hold certificate value
4607 * @return 0 if success, error code(<0) if fail
4608 * @retval PMINFO_R_OK success
4609 * @retval PMINFO_R_EINVAL invalid argument
4610 * @retval PMINFO_R_ERROR internal error
4611 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4612 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4613 * @see pkgmgrinfo_pkginfo_load_certinfo()
4615 static int get_cert_info(const char *pkgid)
4618 pkgmgrinfo_certinfo_h handle;
4619 char *auth_cert = NULL;
4620 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4621 if (ret != PMINFO_R_OK)
4623 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4624 if (ret != PMINFO_R_OK) {
4625 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4628 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4629 if (ret != PMINFO_R_OK) {
4630 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4633 printf("Author root certificate: %s\n", auth_root);
4634 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4639 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4642 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4643 * @brief This API destroys the package cert information handle freeing up all the resources
4645 * @par This API is for package-manager client application
4646 * @par Sync (or) Async : Synchronous API
4648 * @param[in] handle pointer to the package cert handle.
4649 * @return 0 if success, error code(<0) if fail
4650 * @retval PMINFO_R_OK success
4651 * @retval PMINFO_R_EINVAL invalid argument
4652 * @retval PMINFO_R_ERROR internal error
4653 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4655 * @see pkgmgrinfo_pkginfo_load_certinfo()
4657 static int get_cert_info(const char *pkgid)
4660 pkgmgrinfo_certinfo_h handle;
4661 char *auth_cert = NULL;
4662 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4663 if (ret != PMINFO_R_OK)
4665 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4666 if (ret != PMINFO_R_OK) {
4667 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4670 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4671 if (ret != PMINFO_R_OK) {
4672 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4675 printf("Author root certificate: %s\n", auth_root);
4676 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4681 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4684 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4685 * @brief This API deletes the package cert information from DB
4687 * @par This API is for package-manager client application
4688 * @par Sync (or) Async : Synchronous API
4690 * @param[in] pkgid pointer to the package ID.
4691 * @return 0 if success, error code(<0) if fail
4692 * @retval PMINFO_R_OK success
4693 * @retval PMINFO_R_EINVAL invalid argument
4694 * @retval PMINFO_R_ERROR internal error
4698 static int delete_cert_info(const char *pkgid)
4701 ret = pkgmgrinfo_delete_certinfo(pkgid);
4702 if (ret != PMINFO_R_OK)
4708 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4709 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4711 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4712 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4713 * @brief This API creates the package db information handle to set data in db.
4715 * @par This API is for package-manager client application
4716 * @par Sync (or) Async : Synchronous API
4718 * @param[in] pkgid pointer to the package ID.
4719 * @param[in] uid the addressee user id of the instruction
4720 * @param[out] handle pointer to the package db info handle.
4721 * @return 0 if success, error code(<0) if fail
4722 * @retval PMINFO_R_OK success
4723 * @retval PMINFO_R_EINVAL invalid argument
4724 * @retval PMINFO_R_ERROR internal error
4726 * @post pkgmgrinfo_destroy_pkgdbinfo()
4727 * @see pkgmgrinfo_save_pkgdbinfo()
4728 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4730 static int set_pkg_in_db(const char *pkgid)
4733 pkgmgrinfo_pkgdbinfo_h handle;
4734 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4735 if (ret != PMINFO_R_OK)
4737 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4738 if (ret != PMINFO_R_OK) {
4739 pkgmgrinfo_destroy_pkgdbinfo(handle);
4742 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4743 if (ret != PMINFO_R_OK) {
4744 pkgmgrinfo_destroy_pkgdbinfo(handle);
4747 pkgmgrinfo_destroy_pkgdbinfo(handle);
4752 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4753 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4756 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4757 * @brief This API sets the package type in db handle
4759 * @par This API is for package-manager client application
4760 * @par Sync (or) Async : Synchronous API
4762 * @param[in] handle pointer to the pkgdbinfo handle.
4763 * @param[in] type pointer to the package type.
4764 * @return 0 if success, error code(<0) if fail
4765 * @retval PMINFO_R_OK success
4766 * @retval PMINFO_R_EINVAL invalid argument
4767 * @retval PMINFO_R_ERROR internal error
4768 * @pre pkgmgrinfo_create_pkgdbinfo()
4769 * @post pkgmgrinfo_destroy_pkgdbinfo()
4770 * @see pkgmgrinfo_save_pkgdbinfo()
4771 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4773 static int set_pkg_type_in_db(const char *pkgid)
4776 pkgmgrinfo_pkgdbinfo_h handle;
4777 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4778 if (ret != PMINFO_R_OK)
4780 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4781 if (ret != PMINFO_R_OK) {
4782 pkgmgrinfo_destroy_pkgdbinfo(handle);
4785 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4786 if (ret != PMINFO_R_OK) {
4787 pkgmgrinfo_destroy_pkgdbinfo(handle);
4790 pkgmgrinfo_destroy_pkgdbinfo(handle);
4795 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4798 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4799 * @brief This API sets the package version in db handle
4801 * @par This API is for package-manager client application
4802 * @par Sync (or) Async : Synchronous API
4804 * @param[in] handle pointer to the pkgdbinfo handle.
4805 * @param[in] version pointer to the package version
4806 * @return 0 if success, error code(<0) if fail
4807 * @retval PMINFO_R_OK success
4808 * @retval PMINFO_R_EINVAL invalid argument
4809 * @retval PMINFO_R_ERROR internal error
4810 * @pre pkgmgrinfo_create_pkgdbinfo()
4811 * @post pkgmgrinfo_destroy_pkgdbinfo()
4812 * @see pkgmgrinfo_save_pkgdbinfo()
4813 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4815 static int set_pkg_version_in_db(const char *pkgid)
4818 pkgmgrinfo_pkgdbinfo_h handle;
4819 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4820 if (ret != PMINFO_R_OK)
4822 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4823 if (ret != PMINFO_R_OK) {
4824 pkgmgrinfo_destroy_pkgdbinfo(handle);
4827 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4828 if (ret != PMINFO_R_OK) {
4829 pkgmgrinfo_destroy_pkgdbinfo(handle);
4832 pkgmgrinfo_destroy_pkgdbinfo(handle);
4837 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4840 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4841 * @brief This API sets the package install location in db handle
4843 * @par This API is for package-manager client application
4844 * @par Sync (or) Async : Synchronous API
4846 * @param[in] handle pointer to the pkgdbinfo handle.
4847 * @param[in] location package install location
4848 * @return 0 if success, error code(<0) if fail
4849 * @retval PMINFO_R_OK success
4850 * @retval PMINFO_R_EINVAL invalid argument
4851 * @retval PMINFO_R_ERROR internal error
4852 * @pre pkgmgrinfo_create_pkgdbinfo()
4853 * @post pkgmgrinfo_destroy_pkgdbinfo()
4854 * @see pkgmgrinfo_save_pkgdbinfo()
4855 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4857 static int set_pkg_install_location_in_db(const char *pkgid)
4860 pkgmgrinfo_pkgdbinfo_h handle;
4861 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4862 if (ret != PMINFO_R_OK)
4864 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4865 if (ret != PMINFO_R_OK) {
4866 pkgmgrinfo_destroy_pkgdbinfo(handle);
4869 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4870 if (ret != PMINFO_R_OK) {
4871 pkgmgrinfo_destroy_pkgdbinfo(handle);
4874 pkgmgrinfo_destroy_pkgdbinfo(handle);
4879 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4882 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4883 * @brief This API sets the package size in db handle
4885 * @par This API is for package-manager client application
4886 * @par Sync (or) Async : Synchronous API
4888 * @param[in] handle pointer to the pkgdbinfo handle.
4889 * @param[in] size pointer to the package size
4890 * @return 0 if success, error code(<0) if fail
4891 * @retval PMINFO_R_OK success
4892 * @retval PMINFO_R_EINVAL invalid argument
4893 * @retval PMINFO_R_ERROR internal error
4894 * @pre pkgmgrinfo_create_pkgdbinfo()
4895 * @post pkgmgrinfo_destroy_pkgdbinfo()
4896 * @see pkgmgrinfo_save_pkgdbinfo()
4897 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4899 static int set_pkg_size_in_db(const char *pkgid)
4902 pkgmgrinfo_pkgdbinfo_h handle;
4903 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4904 if (ret != PMINFO_R_OK)
4906 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4907 if (ret != PMINFO_R_OK) {
4908 pkgmgrinfo_destroy_pkgdbinfo(handle);
4911 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4912 if (ret != PMINFO_R_OK) {
4913 pkgmgrinfo_destroy_pkgdbinfo(handle);
4916 pkgmgrinfo_destroy_pkgdbinfo(handle);
4921 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4924 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4925 * @brief This API sets the package label in db handle
4927 * @par This API is for package-manager client application
4928 * @par Sync (or) Async : Synchronous API
4930 * @param[in] handle pointer to the pkgdbinfo handle.
4931 * @param[in] label pointer to the package label
4932 * @param[in] locale pointer to the locale
4933 * @return 0 if success, error code(<0) if fail
4934 * @retval PMINFO_R_OK success
4935 * @retval PMINFO_R_EINVAL invalid argument
4936 * @retval PMINFO_R_ERROR internal error
4937 * @pre pkgmgrinfo_create_pkgdbinfo()
4938 * @post pkgmgrinfo_destroy_pkgdbinfo()
4939 * @see pkgmgrinfo_save_pkgdbinfo()
4940 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4942 static int set_pkg_label_in_db(const char *pkgid)
4945 pkgmgrinfo_pkgdbinfo_h handle;
4946 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4947 if (ret != PMINFO_R_OK)
4949 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4950 if (ret != PMINFO_R_OK) {
4951 pkgmgrinfo_destroy_pkgdbinfo(handle);
4954 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4955 if (ret != PMINFO_R_OK) {
4956 pkgmgrinfo_destroy_pkgdbinfo(handle);
4959 pkgmgrinfo_destroy_pkgdbinfo(handle);
4964 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4967 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4968 * @brief This API sets the package icon in db handle
4970 * @par This API is for package-manager client application
4971 * @par Sync (or) Async : Synchronous API
4973 * @param[in] handle pointer to the pkgdbinfo handle.
4974 * @param[in] icon pointer to the package icon
4975 * @param[in] locale pointer to the locale
4976 * @return 0 if success, error code(<0) if fail
4977 * @retval PMINFO_R_OK success
4978 * @retval PMINFO_R_EINVAL invalid argument
4979 * @retval PMINFO_R_ERROR internal error
4980 * @pre pkgmgrinfo_create_pkgdbinfo()
4981 * @post pkgmgrinfo_destroy_pkgdbinfo()
4982 * @see pkgmgrinfo_save_pkgdbinfo()
4983 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4985 static int set_pkg_icon_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_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
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_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5010 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5011 * @brief This API sets the package description in db handle
5013 * @par This API is for package-manager client application
5014 * @par Sync (or) Async : Synchronous API
5016 * @param[in] handle pointer to the pkgdbinfo handle.
5017 * @param[in] description pointer to the package description
5018 * @param[in] locale pointer to the locale
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_save_pkgdbinfo()
5026 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5028 static int set_pkg_description_in_db(const char *pkgid)
5031 pkgmgrinfo_pkgdbinfo_h handle;
5032 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5033 if (ret != PMINFO_R_OK)
5035 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5036 if (ret != PMINFO_R_OK) {
5037 pkgmgrinfo_destroy_pkgdbinfo(handle);
5040 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5041 if (ret != PMINFO_R_OK) {
5042 pkgmgrinfo_destroy_pkgdbinfo(handle);
5045 pkgmgrinfo_destroy_pkgdbinfo(handle);
5050 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5053 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5054 const char *author_email, const char *author_href, const char *locale)
5055 * @brief This API sets the package author info in db handle
5057 * @par This API is for package-manager client application
5058 * @par Sync (or) Async : Synchronous API
5060 * @param[in] handle pointer to the pkgdbinfo handle.
5061 * @param[in] author_name pointer to the package author name
5062 * @param[in] author_email pointer to the package author email
5063 * @param[in] author_href pointer to the package author href
5064 * @param[in] locale pointer to the locale
5065 * @return 0 if success, error code(<0) if fail
5066 * @retval PMINFO_R_OK success
5067 * @retval PMINFO_R_EINVAL invalid argument
5068 * @retval PMINFO_R_ERROR internal error
5069 * @pre pkgmgrinfo_create_pkgdbinfo()
5070 * @post pkgmgrinfo_destroy_pkgdbinfo()
5071 * @see pkgmgrinfo_save_pkgdbinfo()
5072 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5074 static int set_pkg_author_in_db(const char *pkgid)
5077 pkgmgrinfo_pkgdbinfo_h handle;
5078 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5079 if (ret != PMINFO_R_OK)
5081 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_destroy_pkgdbinfo(handle);
5086 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5087 if (ret != PMINFO_R_OK) {
5088 pkgmgrinfo_destroy_pkgdbinfo(handle);
5091 pkgmgrinfo_destroy_pkgdbinfo(handle);
5096 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5097 const char *author_email, const char *author_href, const char *locale);
5100 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5101 * @brief This API sets the package 'removable' value in db handle
5103 * @par This API is for package-manager client application
5104 * @par Sync (or) Async : Synchronous API
5106 * @param[in] handle pointer to the pkgdbinfo handle.
5107 * @param[in] removable package removable value
5108 * @return 0 if success, error code(<0) if fail
5109 * @retval PMINFO_R_OK success
5110 * @retval PMINFO_R_EINVAL invalid argument
5111 * @retval PMINFO_R_ERROR internal error
5112 * @pre pkgmgrinfo_create_pkgdbinfo()
5113 * @post pkgmgrinfo_destroy_pkgdbinfo()
5114 * @see pkgmgrinfo_save_pkgdbinfo()
5115 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5117 static int set_pkg_removable_in_db(const char *pkgid)
5120 pkgmgrinfo_pkgdbinfo_h handle;
5121 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5122 if (ret != PMINFO_R_OK)
5124 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5125 if (ret != PMINFO_R_OK) {
5126 pkgmgrinfo_destroy_pkgdbinfo(handle);
5129 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5130 if (ret != PMINFO_R_OK) {
5131 pkgmgrinfo_destroy_pkgdbinfo(handle);
5134 pkgmgrinfo_destroy_pkgdbinfo(handle);
5139 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5142 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5143 * @brief This API sets the package 'preload' value in db handle
5145 * @par This API is for package-manager client application
5146 * @par Sync (or) Async : Synchronous API
5148 * @param[in] handle pointer to the pkgdbinfo handle.
5149 * @param[in] preload package preload value
5150 * @return 0 if success, error code(<0) if fail
5151 * @retval PMINFO_R_OK success
5152 * @retval PMINFO_R_EINVAL invalid argument
5153 * @retval PMINFO_R_ERROR internal error
5154 * @pre pkgmgrinfo_create_pkgdbinfo()
5155 * @post pkgmgrinfo_destroy_pkgdbinfo()
5156 * @see pkgmgrinfo_save_pkgdbinfo()
5157 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5159 static int set_pkg_preload_in_db(const char *pkgid)
5162 pkgmgrinfo_pkgdbinfo_h handle;
5163 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5164 if (ret != PMINFO_R_OK)
5166 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5167 if (ret != PMINFO_R_OK) {
5168 pkgmgrinfo_destroy_pkgdbinfo(handle);
5171 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5172 if (ret != PMINFO_R_OK) {
5173 pkgmgrinfo_destroy_pkgdbinfo(handle);
5176 pkgmgrinfo_destroy_pkgdbinfo(handle);
5181 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5184 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5185 * @brief This API sets the package 'installed_storage' value in db handle
5187 * @par This API is for package-manager client application
5188 * @par Sync (or) Async : Synchronous API
5190 * @param[in] handle pointer to the pkgdbinfo handle.
5191 * @param[in] location installed_storage value
5192 * @return 0 if success, error code(<0) if fail
5193 * @retval PMINFO_R_OK success
5194 * @retval PMINFO_R_EINVAL invalid argument
5195 * @retval PMINFO_R_ERROR internal error
5196 * @pre pkgmgrinfo_create_pkgdbinfo()
5197 * @post pkgmgrinfo_destroy_pkgdbinfo()
5198 * @see pkgmgrinfo_save_pkgdbinfo()
5200 static int set_pkg_installed_storage_in_db(const char *pkgid)
5203 pkgmgrinfo_pkgdbinfo_h handle;
5204 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5205 if (ret != PMINFO_R_OK)
5207 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5208 if (ret != PMINFO_R_OK) {
5209 pkgmgrinfo_destroy_pkgdbinfo(handle);
5212 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5213 if (ret != PMINFO_R_OK) {
5214 pkgmgrinfo_destroy_pkgdbinfo(handle);
5217 pkgmgrinfo_destroy_pkgdbinfo(handle);
5222 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5225 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5226 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5227 * @brief This API saves all the information from the handle to the DB.
5229 * @par This API is for package-manager client application
5230 * @par Sync (or) Async : Synchronous API
5232 * @param[in] handle pointer to the package db info handle.
5233 * @param[in] uid the addressee user id of the instruction
5234 * @return 0 if success, error code(<0) if fail
5235 * @retval PMINFO_R_OK success
5236 * @retval PMINFO_R_EINVAL invalid argument
5237 * @retval PMINFO_R_ERROR internal error
5238 * @pre pkgmgrinfo_create_pkgdbinfo()
5239 * @post pkgmgrinfo_destroy_pkgdbinfo()
5240 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5242 static int set_pkg_in_db(const char *pkgid)
5245 pkgmgrinfo_pkgdbinfo_h handle;
5246 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5247 if (ret != PMINFO_R_OK)
5249 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5250 if (ret != PMINFO_R_OK) {
5251 pkgmgrinfo_destroy_pkgdbinfo(handle);
5254 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5255 if (ret != PMINFO_R_OK) {
5256 pkgmgrinfo_destroy_pkgdbinfo(handle);
5259 pkgmgrinfo_destroy_pkgdbinfo(handle);
5264 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5265 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5267 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5268 * @brief This API destroys the package db information handle freeing up all the resources
5270 * @par This API is for package-manager client application
5271 * @par Sync (or) Async : Synchronous API
5273 * @param[in] handle pointer to the package db info handle.
5274 * @return 0 if success, error code(<0) if fail
5275 * @retval PMINFO_R_OK success
5276 * @retval PMINFO_R_EINVAL invalid argument
5277 * @retval PMINFO_R_ERROR internal error
5278 * @pre pkgmgrinfo_create_pkgdbinfo()
5280 * @see pkgmgrinfo_save_pkgdbinfo()
5281 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5283 static int set_pkg_in_db(const char *pkgid)
5286 pkgmgrinfo_pkgdbinfo_h handle;
5287 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5288 if (ret != PMINFO_R_OK)
5290 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5291 if (ret != PMINFO_R_OK) {
5292 pkgmgrinfo_destroy_pkgdbinfo(handle);
5295 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5296 if (ret != PMINFO_R_OK) {
5297 pkgmgrinfo_destroy_pkgdbinfo(handle);
5300 pkgmgrinfo_destroy_pkgdbinfo(handle);
5305 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5309 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5310 * @brief This API creates the package cert information handle to set data in db.
5312 * @par This API is for package-manager client application
5313 * @par Sync (or) Async : Synchronous API
5315 * @param[out] handle pointer to the package cert handle.
5316 * @return 0 if success, error code(<0) if fail
5317 * @retval PMINFO_R_OK success
5318 * @retval PMINFO_R_EINVAL invalid argument
5319 * @retval PMINFO_R_ERROR internal error
5321 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5322 * @see pkgmgrinfo_set_cert_value()
5323 * @see pkgmgrinfo_save_certinfo()
5325 static int set_cert_in_db(const char *pkgid)
5328 pkgmgrinfo_instcertinfo_h handle;
5329 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5330 if (ret != PMINFO_R_OK)
5332 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5333 if (ret != PMINFO_R_OK) {
5334 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5337 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5338 if (ret != PMINFO_R_OK) {
5339 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5342 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5347 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5350 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5351 * @brief This API sets the package cert information in the handle.
5353 * @par This API is for package-manager client application
5354 * @par Sync (or) Async : Synchronous API
5356 * @param[in] handle pointer to the package cert handle.
5357 * @param[in] cert_type certificate type.
5358 * @param[in] cert_value certificate value.
5359 * @return 0 if success, error code(<0) if fail
5360 * @retval PMINFO_R_OK success
5361 * @retval PMINFO_R_EINVAL invalid argument
5362 * @retval PMINFO_R_ERROR internal error
5363 * @pre pkgmgrinfo_create_certinfo_set_handle()
5364 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5365 * @see pkgmgrinfo_save_certinfo()
5367 static int set_cert_in_db(const char *pkgid)
5370 pkgmgrinfo_instcertinfo_h handle;
5371 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5372 if (ret != PMINFO_R_OK)
5374 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5375 if (ret != PMINFO_R_OK) {
5376 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5379 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5380 if (ret != PMINFO_R_OK) {
5381 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5384 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5389 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5392 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5393 * @brief This API saves the package cert information in the DB.
5395 * @par This API is for package-manager client application
5396 * @par Sync (or) Async : Synchronous API
5398 * @param[in] pkgid pointer to the package ID.
5399 * @param[in] handle pointer to the package cert handle.
5400 * @return 0 if success, error code(<0) if fail
5401 * @retval PMINFO_R_OK success
5402 * @retval PMINFO_R_EINVAL invalid argument
5403 * @retval PMINFO_R_ERROR internal error
5404 * @pre pkgmgrinfo_create_certinfo_set_handle()
5405 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5406 * @see pkgmgrinfo_save_certinfo()
5408 static int set_cert_in_db(const char *pkgid)
5411 pkgmgrinfo_instcertinfo_h handle;
5412 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5413 if (ret != PMINFO_R_OK)
5415 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5416 if (ret != PMINFO_R_OK) {
5417 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5420 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5421 if (ret != PMINFO_R_OK) {
5422 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5425 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5430 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5433 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5434 * @brief This API destroys the package cert information handle freeing up all the resources.
5436 * @par This API is for package-manager client application
5437 * @par Sync (or) Async : Synchronous API
5439 * @param[in] handle pointer to the package cert handle.
5440 * @return 0 if success, error code(<0) if fail
5441 * @retval PMINFO_R_OK success
5442 * @retval PMINFO_R_EINVAL invalid argument
5443 * @retval PMINFO_R_ERROR internal error
5444 * @pre pkgmgrinfo_create_certinfo_set_handle()
5446 * @see pkgmgrinfo_save_certinfo()
5448 static int set_cert_in_db(const char *pkgid)
5451 pkgmgrinfo_instcertinfo_h handle;
5452 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5453 if (ret != PMINFO_R_OK)
5455 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5456 if (ret != PMINFO_R_OK) {
5457 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5460 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5461 if (ret != PMINFO_R_OK) {
5462 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5465 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5470 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5473 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5474 * @brief This API gets the datacontrol info
5476 * @par This API is for package-manager client application
5477 * @par Sync (or) Async : Synchronous API
5479 * @param[in] providerid pointer to the providerid of dataconltrol.
5480 * @param[in] type pointer to the type of dataconltrol.
5481 * @param[out] appid pointer to hold appid, need to free after using
5482 * @param[out] access pointer to hold access, need to free after using
5483 * @return 0 if success, error code(<0) if fail
5484 * @retval PMINFO_R_OK success
5485 * @retval PMINFO_R_EINVAL invalid argument
5486 * @retval PMINFO_R_ERROR internal error
5489 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5492 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5493 * @brief This API gets the application 'guest mode visibility' value from the DB
5495 * @par This API is for package-manager client application
5496 * @par Sync (or) Async : Synchronous API
5498 * @param[in] handle pointer to application info handle
5499 * @param[out] status pointer to hold app guest mode visibility value
5500 * @return 0 if success, error code(<0) if fail
5501 * @retval PMINFO_R_OK success
5502 * @retval PMINFO_R_EINVAL invalid argument
5503 * @retval PMINFO_R_ERROR internal error
5504 * @pre pkgmgrinfo_appinfo_get_appinfo()
5505 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5506 * @see pkgmgrinfo_appinfo_get_appid()
5507 * @see pkgmgrinfo_appinfo_is_multiple()
5509 static int get_app_guestmode_visibility(const char *appid)
5513 pkgmgrinfo_appinfo_h handle;
5514 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5515 if (ret != PMINFO_R_OK)
5517 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5518 if (ret != PMINFO_R_OK) {
5519 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5522 printf("app guest mode visibility: %d\n", status);
5523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5528 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5531 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5532 * @brief This API sets the application 'guest mode visibility' value in the DB
5534 * @par This API is for package-manager client application
5535 * @par Sync (or) Async : Synchronous API
5537 * @param[in] handle pointer to application info handle
5538 * @param[out] status app guest mode visibility value
5539 * @return 0 if success, error code(<0) if fail
5540 * @retval PMINFO_R_OK success
5541 * @retval PMINFO_R_EINVAL invalid argument
5542 * @retval PMINFO_R_ERROR internal error
5543 * @pre pkgmgrinfo_appinfo_get_appinfo()
5544 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5545 * @see pkgmgrinfo_appinfo_get_appid()
5546 * @see pkgmgrinfo_appinfo_is_multiple()
5548 static int set_app_guestmode_visibility(const char *appid, bool value)
5551 pkgmgrinfo_appinfo_h handle;
5552 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5553 if (ret != PMINFO_R_OK)
5555 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5556 if (ret != PMINFO_R_OK) {
5557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5560 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5565 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5566 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5568 * @pkgmgrinfo client API
5572 * @brief listening status type in pkgmgrinfo.
5574 #define PMINFO_CLIENT_STATUS_ALL 0x00
5575 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5576 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5577 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5578 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5579 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5580 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5583 * @brief type definition.
5585 typedef void pkgmgrinfo_client;
5586 typedef int (*pkgmgrinfo_handler)(uid_t target_uid, int req_id, const char *pkg_type,
5587 const char *pkgid, const char *key,
5588 const char *val, const void *pmsg, void *data);
5594 }pkgmgrinfo_client_type;
5597 * @brief This APIs provides pkgmgrinfo client listener
5599 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5600 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5601 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5602 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5603 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5607 * @pkgmgrinfo client API end
5615 #endif /* __PKG_INFO_H__ */