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__
53 #include <sys/types.h>
63 * This is package information library
65 * Package Information Library is used to get package related information.\n
66 * It uses the package manifest information database to get any package related information\n
67 * It also provides API to set information in the package info database\n
73 * @brief Package Information Library Header File
75 * Generated by Sewook Park <sewook7.park@samsung.com>
79 * @brief A type to retrieve uid information from the manifest handle
83 } pkgmgrinfo_uidinfo_t;
86 * @brief A handle to insert certificate information
88 typedef void* pkgmgrinfo_instcertinfo_h;
91 * @brief Certificate Types to be used for setting information
94 PMINFO_SET_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
95 PMINFO_SET_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
96 PMINFO_SET_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
97 PMINFO_SET_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
98 PMINFO_SET_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
99 PMINFO_SET_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
100 PMINFO_SET_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
101 PMINFO_SET_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
102 PMINFO_SET_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
103 }pkgmgrinfo_instcert_type;
106 PMINFO_CERT_COMPARE_MATCH,
107 PMINFO_CERT_COMPARE_MISMATCH,
108 PMINFO_CERT_COMPARE_LHS_NO_CERT,
109 PMINFO_CERT_COMPARE_RHS_NO_CERT,
110 PMINFO_CERT_COMPARE_BOTH_NO_CERT,
111 PMINFO_CERT_COMPARE_ERROR,
112 } pkgmgrinfo_cert_compare_result_type_e;
115 * @brief API return values
118 PMINFO_R_EINVAL = -2, /**< Invalid argument */
119 PMINFO_R_ERROR = -1, /**< General error */
120 PMINFO_R_OK = 0 /**< General success */
124 * @brief Value to be used when filtering based on install location
126 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
129 * @brief Value to be used when filtering based on install location
131 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
134 * @brief Value to be used when filtering based on install location
136 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
139 * @brief Value to be used when filtering based on app-component
141 #define PMINFO_APPINFO_UI_APP "UI_APP"
144 * @brief Value to be used when filtering based on app-component
146 #define PMINFO_APPINFO_SVC_APP "SVC_APP"
149 PMINFO_HWACCELERATION_NOT_USE_GL = 0, /**< Don't use hardware acceleration*/
150 PMINFO_HWACCELERATION_USE_GL = 1, /**< Use hardware acceleration*/
151 PMINFO_HWACCELERATION_USE_SYSTEM_SETTING = 2 /**< Follow system setting for hardware acceleration */
152 }pkgmgrinfo_app_hwacceleration;
155 PMINFO_SCREENREADER_OFF = 0, /**< Don't use screen reader*/
156 PMINFO_SCREENREADER_ON = 1, /**< Use screen reader*/
157 PMINFO_SCREENREADER_USE_SYSTEM_SETTING = 2 /**< Follow system setting for screen reader */
158 }pkgmgrinfo_app_screenreader;
161 PMINFO_RECENTIMAGE_USE_ICON = 0, /**<Use icon for recent image*/
162 PMINFO_RECENTIMAGE_USE_CAPTURE = 1, /**< Use capture for recent image*/
163 PMINFO_RECENTIMAGE_USE_NOTHING = 2 /**< Don't use recent image */
164 }pkgmgrinfo_app_recentimage;
167 * @brief A handle to get package information
169 typedef void* pkgmgrinfo_pkginfo_h;
172 * @brief A handle to get application information
174 typedef void* pkgmgrinfo_appinfo_h;
177 * @brief A handle to get certificate information
179 typedef void* pkgmgrinfo_certinfo_h;
182 * @brief A handle to insert package information
184 typedef void* pkgmgrinfo_pkgdbinfo_h;
187 * @brief A handle to filter package information
189 typedef void* pkgmgrinfo_pkginfo_filter_h;
192 * @brief A handle to filter application information
194 typedef void* pkgmgrinfo_appinfo_filter_h;
197 * @brief A handle to filter application metadata information
199 typedef void* pkgmgrinfo_appinfo_metadata_filter_h;
202 * @brief A handle to get appcontrol information
204 typedef void* pkgmgrinfo_appcontrol_h;
207 * @fn int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle, void *user_data)
209 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
211 * @param[in] handle the pkginfo handle
212 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_get_list(), pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
214 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
216 * @see pkgmgrinfo_pkginfo_get_list()
217 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
219 typedef int (*pkgmgrinfo_pkg_list_cb ) (const pkgmgrinfo_pkginfo_h handle,
223 * @fn int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle, void *user_data)
225 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
227 * @param[in] handle the appinfo handle
228 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_get_list(), pkgmgrinfo_appinfo_filter_foreach_appinfo(), pkgmgrinfo_appinfo_metadata_filter_foreach()
230 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
232 * @see pkgmgrinfo_appinfo_get_list()
233 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
234 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
236 typedef int (*pkgmgrinfo_app_list_cb ) (const pkgmgrinfo_appinfo_h handle,
240 * @fn int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name, void *user_data)
242 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
244 * @param[in] category_name the name of the category
245 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
247 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
249 * @see pkgmgrinfo_appinfo_foreach_category()
251 typedef int (*pkgmgrinfo_app_category_list_cb ) (const char *category_name,
255 * @fn int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type, void *user_data)
257 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_category()
259 * @param[in] permission_name the name of the permission
260 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_category()
262 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
264 * @see pkgmgrinfo_appinfo_foreach_category()
266 typedef int (*pkgmgrinfo_app_permission_list_cb ) (const char *permission_type,
270 * @fn int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name, void *user_data)
272 * @brief Specifies the type of function passed to pkgmgrinfo_pkginfo_foreach_privilege()
274 * @param[in] privilege_name the name of the privilege
275 * @param[in] user_data user data passed to pkgmgrinfo_pkginfo_foreach_privilege()
277 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
279 * @see pkgmgrinfo_pkginfo_foreach_privilege()
281 typedef int (*pkgmgrinfo_pkg_privilege_list_cb ) (const char *privilege_name,
285 * @fn int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key, const char *metadata_value, void *user_data)
287 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_metadata()
289 * @param[in] metadata_name the name of the metadata
290 * @param[in] metadata_value the value of the metadata
291 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_metadata()
293 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
295 * @see pkgmgrinfo_appinfo_foreach_metadata()
297 typedef int (*pkgmgrinfo_app_metadata_list_cb ) (const char *metadata_key,
298 const char *metadata_value, void *user_data);
301 * @fn int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle, void *user_data)
303 * @brief Specifies the type of function passed to pkgmgrinfo_appinfo_foreach_appcontrol()
305 * @param[in] handle the appcontrol handle to be used to get operation, uri and mime info
306 * @param[in] user_data user data passed to pkgmgrinfo_appinfo_foreach_appcontrol()
308 * @return 0 if success, negative value(<0) if fail. Callback is not called if return value is negative.\n
310 * @see pkgmgrinfo_appinfo_foreach_appcontrol()
312 typedef int (*pkgmgrinfo_app_control_list_cb ) (pkgmgrinfo_appcontrol_h handle,
315 typedef struct eventsystem_info {
318 } eventsystem_info_s;
321 * @brief Install Location Types
324 PMINFO_INSTALL_LOCATION_AUTO = 0, /**< Auto*/
325 PMINFO_INSTALL_LOCATION_INTERNAL_ONLY, /**< Internal Installation*/
326 PMINFO_INSTALL_LOCATION_PREFER_EXTERNAL, /**< External Installation*/
327 }pkgmgrinfo_install_location;
330 * @brief Application Component Types
333 PMINFO_ALL_APP = 0, /**< All Application*/
334 PMINFO_UI_APP, /**< UI Application*/
335 PMINFO_SVC_APP, /**< Service Application*/
336 }pkgmgrinfo_app_component;
339 * @brief Application Storage Types
342 PMINFO_INTERNAL_STORAGE = 0, /**< Internal Storage*/
343 PMINFO_EXTERNAL_STORAGE = 1, /**< External Storage*/
344 }pkgmgrinfo_installed_storage;
347 * @brief Certificate Types to be used for getting information
350 PMINFO_AUTHOR_ROOT_CERT = 0, /**< Author Root Certificate*/
351 PMINFO_AUTHOR_INTERMEDIATE_CERT = 1, /**< Author Intermediate Certificate*/
352 PMINFO_AUTHOR_SIGNER_CERT = 2, /**< Author Signer Certificate*/
353 PMINFO_DISTRIBUTOR_ROOT_CERT = 3, /**< Distributor Root Certificate*/
354 PMINFO_DISTRIBUTOR_INTERMEDIATE_CERT = 4, /**< Distributor Intermediate Certificate*/
355 PMINFO_DISTRIBUTOR_SIGNER_CERT = 5, /**< Distributor Signer Certificate*/
356 PMINFO_DISTRIBUTOR2_ROOT_CERT = 6, /**< End Entity Root Certificate*/
357 PMINFO_DISTRIBUTOR2_INTERMEDIATE_CERT = 7, /**< End Entity Intermediate Certificate*/
358 PMINFO_DISTRIBUTOR2_SIGNER_CERT = 8, /**< End Entity Signer Certificate*/
359 }pkgmgrinfo_cert_type;
362 * @brief Install Location Types to be used when setting data in DB
365 INSTALL_INTERNAL = 0, /**< Internal Installation*/
366 INSTALL_EXTERNAL, /**< External Installation*/
370 * @brief permission Types
373 PMINFO_PERMISSION_NORMAL = 0, /**< permission normal*/
374 PMINFO_PERMISSION_SIGNATURE, /**< permission type is signature*/
375 PMINFO_PERMISSION_PRIVILEGE, /**< permission type is privilege*/
376 }pkgmgrinfo_permission_type;
379 /** String property for filtering based on package info*/
380 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
381 /** String property for filtering based on package info*/
382 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
383 /** String property for filtering based on package info*/
384 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
385 /** String property for filtering based on package info*/
386 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
387 /** String property for filtering based on package info*/
388 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
389 /** String property for filtering based on package info*/
390 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
391 /** String property for filtering based on package info*/
392 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
393 /** String property for filtering based on package info*/
394 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
396 /** Boolean property for filtering based on package info*/
397 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
398 /** Boolean property for filtering based on package info*/
399 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
400 /** Boolean property for filtering based on package info*/
401 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
402 /** Boolean property for filtering based on package info*/
403 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
404 /** Boolean property for filtering based on package info*/
405 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
406 /** Boolean property for filtering based on package info*/
407 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
409 /** Integer property for filtering based on package info*/
410 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
412 /** String property for filtering based on app info*/
413 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
414 /** String property for filtering based on app info*/
415 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
416 /** String property for filtering based on app info*/
417 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
418 /** String property for filtering based on app info*/
419 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
420 /** String property for filtering based on app info*/
421 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
422 /** String property for filtering based on app info*/
423 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
424 /** String property for filtering based on app info*/
425 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
426 /** String property for filtering based on app info*/
427 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
428 /** String property for filtering based on app info*/
429 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
430 /** String property for filtering based on app info*/
431 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
432 /** String property for filtering based on app info*/
433 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
435 /** Boolean property for filtering based on app info*/
436 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
437 /** Boolean property for filtering based on app info*/
438 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
439 /** Boolean property for filtering based on app info*/
440 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
441 /** Boolean property for filtering based on app info*/
442 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
443 /** Boolean property for filtering based on app info*/
444 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
445 /** Boolean property for filtering based on app info*/
446 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
448 /** will be updated*/
449 /** string property for filtering based on pkg info*/
450 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
452 /* For multiuser support */
453 char *getIconPath(uid_t uid);
454 char *getUserPkgParserDBPath(void);
455 char *getUserPkgParserDBPathUID(uid_t uid);
456 char *getUserPkgCertDBPath(void);
457 char *getUserPkgCertDBPathUID(uid_t uid);
458 const char* getUserDesktopPath(uid_t uid);
459 const char* getUserManifestPath(uid_t uid);
462 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
463 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
464 * @brief This API gets list of installed packages
466 * @par This API is for package-manager client application
467 * @par Sync (or) Async : Synchronous API
468 * @param[in] pkg_list_cb iteration function for list
469 * @param[in] user_data user data to be passed to callback function
470 * @param[in] uid the addressee user id of the instruction
471 * @return 0 if success, error code(<0) if fail
472 * @retval PMINFO_R_OK success
473 * @retval PMINFO_R_EINVAL invalid argument
474 * @retval PMINFO_R_ERROR internal error
478 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
482 pkgid1 = (char *)user_data;
483 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
484 if (strcmp(pkgid1, pkgid2) == 0) {
491 static int list_pkgs()
494 char *name = "helloworld";
495 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
496 if (ret != PMINFO_R_OK) {
503 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
504 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
506 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
507 * @brief This API creates the package information handle from db
509 * @par This API is for package-manager client application
510 * @par Sync (or) Async : Synchronous API
512 * @param[in] pkgid pointer to package ID
513 * @param[in] uid the addressee user id of the instruction
514 * @param[out] handle pointer to the package info handle.
515 * @return 0 if success, error code(<0) if fail
516 * @retval PMINFO_R_OK success
517 * @retval PMINFO_R_EINVAL invalid argument
518 * @retval PMINFO_R_ERROR internal error
520 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
521 * @see pkgmgrinfo_pkginfo_get_pkgid()
522 * @see pkgmgrinfo_pkginfo_is_removable()
524 static int get_pkg_type(const char *pkgid)
528 pkgmgrinfo_pkginfo_h handle;
529 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
530 if (ret != PMINFO_R_OK)
532 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
533 if (ret != PMINFO_R_OK) {
534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
537 printf("pkgtype: %s\n", type);
538 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
544 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
547 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
548 * @brief This API gets the package name from the package ID
550 * @par This API is for package-manager client application
551 * @par Sync (or) Async : Synchronous API
553 * @param[in] handle pointer to package info handle
554 * @param[out] pkg_name pointer to hold package name
555 * @return 0 if success, error code(<0) if fail
556 * @retval PMINFO_R_OK success
557 * @retval PMINFO_R_EINVAL invalid argument
558 * @retval PMINFO_R_ERROR internal error
559 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
560 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
561 * @see pkgmgrinfo_pkginfo_get_type()
562 * @see pkgmgrinfo_pkginfo_is_removable()
564 static int get_pkg_name(const char *pkgid)
567 char *pkgname = NULL;
568 pkgmgrinfo_pkginfo_h handle;
569 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
570 if (ret != PMINFO_R_OK)
572 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
573 if (ret != PMINFO_R_OK) {
574 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
577 printf("pkgname: %s\n", pkgname);
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
583 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
586 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
587 * @brief This API gets the package id from the package ID
589 * @par This API is for package-manager client application
590 * @par Sync (or) Async : Synchronous API
592 * @param[in] handle pointer to package info handle
593 * @param[out] pkgid pointer to hold package id
594 * @return 0 if success, error code(<0) if fail
595 * @retval PMINFO_R_OK success
596 * @retval PMINFO_R_EINVAL invalid argument
597 * @retval PMINFO_R_ERROR internal error
598 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
599 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
600 * @see pkgmgrinfo_pkginfo_get_type()
601 * @see pkgmgrinfo_pkginfo_is_removable()
603 static int get_pkgid(const char *pkgid)
607 pkgmgrinfo_pkginfo_h handle;
608 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
609 if (ret != PMINFO_R_OK)
611 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
612 if (ret != PMINFO_R_OK) {
613 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
616 printf("pkg id: %s\n", pkg_id);
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
622 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
625 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
626 * @brief This API gets the package type from the package ID
628 * @par This API is for package-manager client application
629 * @par Sync (or) Async : Synchronous API
631 * @param[in] handle pointer to package info handle
632 * @param[out] type pointer to hold package type
633 * @return 0 if success, error code(<0) if fail
634 * @retval PMINFO_R_OK success
635 * @retval PMINFO_R_EINVAL invalid argument
636 * @retval PMINFO_R_ERROR internal error
637 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
638 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
639 * @see pkgmgrinfo_pkginfo_get_pkgid()
640 * @see pkgmgrinfo_pkginfo_is_removable()
642 static int get_pkg_type(const char *pkgid)
646 pkgmgrinfo_pkginfo_h handle;
647 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
648 if (ret != PMINFO_R_OK)
650 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
651 if (ret != PMINFO_R_OK) {
652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
655 printf("pkgtype: %s\n", type);
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
661 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
664 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
665 * @brief This API gets the package version from the package ID
667 * @par This API is for package-manager client application
668 * @par Sync (or) Async : Synchronous API
670 * @param[in] handle pointer to package info handle
671 * @param[out] version pointer to hold package version
672 * @return 0 if success, error code(<0) if fail
673 * @retval PMINFO_R_OK success
674 * @retval PMINFO_R_EINVAL invalid argument
675 * @retval PMINFO_R_ERROR internal error
676 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
677 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
678 * @see pkgmgrinfo_pkginfo_get_pkgid()
679 * @see pkgmgrinfo_pkginfo_is_removable()
681 static int get_pkg_version(const char *pkgid)
684 char *version = NULL;
685 pkgmgrinfo_pkginfo_h handle;
686 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
687 if (ret != PMINFO_R_OK)
689 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
690 if (ret != PMINFO_R_OK) {
691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
694 printf("pkg version: %s\n", version);
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
703 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
704 * @brief This API gets the package install location from the package ID
706 * @par This API is for package-manager client application
707 * @par Sync (or) Async : Synchronous API
709 * @param[in] handle pointer to package info handle
710 * @param[out] location pointer to hold package install location
711 * @return 0 if success, error code(<0) if fail
712 * @retval PMINFO_R_OK success
713 * @retval PMINFO_R_EINVAL invalid argument
714 * @retval PMINFO_R_ERROR internal error
715 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
716 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
717 * @see pkgmgrinfo_pkginfo_get_pkgid()
718 * @see pkgmgrinfo_pkginfo_is_removable()
720 static int get_pkg_install_location(const char *pkgid)
723 pkgmgrinfo_install_location location;
724 pkgmgrinfo_pkginfo_h handle;
725 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
726 if (ret != PMINFO_R_OK)
728 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
729 if (ret != PMINFO_R_OK) {
730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
733 printf("pkg install location: %d\n", location);
734 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
742 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
743 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
744 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
745 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
747 * @par This API is for package-manager client application
748 * @par Sync (or) Async : Synchronous API
750 * @param[in] handle pointer to package info handle
751 * @param[out] size pointer to hold package size
752 * @return 0 if success, error code(<0) if fail
753 * @retval PMINFO_R_OK success
754 * @retval PMINFO_R_EINVAL invalid argument
755 * @retval PMINFO_R_ERROR internal error
756 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
757 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
758 * @see pkgmgrinfo_pkginfo_get_pkgid()
759 * @see pkgmgrinfo_pkginfo_is_removable()
761 static int get_pkg_size(const char *pkgid)
765 pkgmgrinfo_pkginfo_h handle;
766 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
767 if (ret != PMINFO_R_OK)
769 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
770 if (ret != PMINFO_R_OK) {
771 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
774 printf("pkgsize: %d\n", size);
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
783 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
784 * @brief This API gets the installed package total size on the target.
786 * @par This API is for package-manager client application
787 * @par Sync (or) Async : Synchronous API
789 * @param[in] handle pointer to package info handle
790 * @param[out] size pointer to hold package total size
791 * @return 0 if success, error code(<0) if fail
792 * @retval PMINFO_R_OK success
793 * @retval PMINFO_R_EINVAL invalid argument
794 * @retval PMINFO_R_ERROR internal error
796 static int get_pkg_total_size(const char *pkgid)
800 pkgmgrinfo_pkginfo_h handle;
801 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
802 if (ret != PMINFO_R_OK)
804 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
805 if (ret != PMINFO_R_OK) {
806 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
809 printf("pkg total size: %d\n", size);
810 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
815 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
818 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
819 * @brief This API gets the installed package data size on the target.
821 * @par This API is for package-manager client application
822 * @par Sync (or) Async : Synchronous API
824 * @param[in] handle pointer to package info handle
825 * @param[out] size pointer to hold package data size
826 * @return 0 if success, error code(<0) if fail
827 * @retval PMINFO_R_OK success
828 * @retval PMINFO_R_EINVAL invalid argument
829 * @retval PMINFO_R_ERROR internal error
831 static int get_pkg_data_size(const char *pkgid)
835 pkgmgrinfo_pkginfo_h handle;
836 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
837 if (ret != PMINFO_R_OK)
839 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
840 if (ret != PMINFO_R_OK) {
841 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
844 printf("pkg data size: %d\n", size);
845 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
850 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
853 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
854 * @brief This API gets the package icon from the package ID
856 * @par This API is for package-manager client application
857 * @par Sync (or) Async : Synchronous API
859 * @param[in] handle pointer to package info handle
860 * @param[out] icon pointer to hold package icon
861 * @return 0 if success, error code(<0) if fail
862 * @retval PMINFO_R_OK success
863 * @retval PMINFO_R_EINVAL invalid argument
864 * @retval PMINFO_R_ERROR internal error
865 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
866 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
867 * @see pkgmgrinfo_pkginfo_get_pkgid()
868 * @see pkgmgrinfo_pkginfo_is_removable()
870 static int get_pkg_icon(const char *pkgid)
874 pkgmgrinfo_pkginfo_h handle;
875 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
876 if (ret != PMINFO_R_OK)
878 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
879 if (ret != PMINFO_R_OK) {
880 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
883 printf("pkg icon: %s\n", icon);
884 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
889 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
892 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
893 * @brief This API gets the package label from the package ID
895 * @par This API is for package-manager client application
896 * @par Sync (or) Async : Synchronous API
898 * @param[in] handle pointer to package info handle
899 * @param[out] label pointer to hold package label
900 * @return 0 if success, error code(<0) if fail
901 * @retval PMINFO_R_OK success
902 * @retval PMINFO_R_EINVAL invalid argument
903 * @retval PMINFO_R_ERROR internal error
904 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
905 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
906 * @see pkgmgrinfo_pkginfo_get_pkgid()
907 * @see pkgmgrinfo_pkginfo_is_removable()
909 static int get_pkg_label(const char *pkgid)
913 pkgmgrinfo_pkginfo_h handle;
914 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
915 if (ret != PMINFO_R_OK)
917 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
918 if (ret != PMINFO_R_OK) {
919 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
922 printf("pkg label: %s\n", label);
923 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
928 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
931 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
932 * @brief This API gets the package description from the package ID
934 * @par This API is for package-manager client application
935 * @par Sync (or) Async : Synchronous API
937 * @param[in] handle pointer to package info handle
938 * @param[out] description pointer to hold package description
939 * @return 0 if success, error code(<0) if fail
940 * @retval PMINFO_R_OK success
941 * @retval PMINFO_R_EINVAL invalid argument
942 * @retval PMINFO_R_ERROR internal error
943 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
944 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
945 * @see pkgmgrinfo_pkginfo_get_pkgid()
946 * @see pkgmgrinfo_pkginfo_is_removable()
948 static int get_pkg_description(const char *pkgid)
951 char *description = NULL;
952 pkgmgrinfo_pkginfo_h handle;
953 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
954 if (ret != PMINFO_R_OK)
956 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
957 if (ret != PMINFO_R_OK) {
958 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
961 printf("pkg description: %s\n", description);
962 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
967 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
970 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
971 * @brief This API gets the package's author name from the package ID
973 * @par This API is for package-manager client application
974 * @par Sync (or) Async : Synchronous API
976 * @param[in] handle pointer to package info handle
977 * @param[out] author_name pointer to hold package author name
978 * @return 0 if success, error code(<0) if fail
979 * @retval PMINFO_R_OK success
980 * @retval PMINFO_R_EINVAL invalid argument
981 * @retval PMINFO_R_ERROR internal error
982 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
983 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
984 * @see pkgmgrinfo_pkginfo_get_pkgid()
985 * @see pkgmgrinfo_pkginfo_is_removable()
987 static int get_pkg_author_name(const char *pkgid)
990 char *author_name = NULL;
991 pkgmgrinfo_pkginfo_h handle;
992 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
993 if (ret != PMINFO_R_OK)
995 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
996 if (ret != PMINFO_R_OK) {
997 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1000 printf("pkg author name: %s\n", author_name);
1001 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1006 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
1009 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
1010 * @brief This API gets the package's author email from the package ID
1012 * @par This API is for package-manager client application
1013 * @par Sync (or) Async : Synchronous API
1015 * @param[in] handle pointer to package info handle
1016 * @param[out] author_email pointer to hold package author email
1017 * @return 0 if success, error code(<0) if fail
1018 * @retval PMINFO_R_OK success
1019 * @retval PMINFO_R_EINVAL invalid argument
1020 * @retval PMINFO_R_ERROR internal error
1021 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1022 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1023 * @see pkgmgrinfo_pkginfo_get_pkgid()
1024 * @see pkgmgrinfo_pkginfo_is_removable()
1026 static int get_pkg_author_email(const char *pkgid)
1029 char *author_email = NULL;
1030 pkgmgrinfo_pkginfo_h handle;
1031 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1032 if (ret != PMINFO_R_OK)
1034 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
1035 if (ret != PMINFO_R_OK) {
1036 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1039 printf("pkg author email: %s\n", author_email);
1040 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1045 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
1048 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
1049 * @brief This API gets the package's author href from the package ID
1051 * @par This API is for package-manager client application
1052 * @par Sync (or) Async : Synchronous API
1054 * @param[in] handle pointer to package info handle
1055 * @param[out] author_href pointer to hold package author href
1056 * @return 0 if success, error code(<0) if fail
1057 * @retval PMINFO_R_OK success
1058 * @retval PMINFO_R_EINVAL invalid argument
1059 * @retval PMINFO_R_ERROR internal error
1060 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1061 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1062 * @see pkgmgrinfo_pkginfo_get_pkgid()
1063 * @see pkgmgrinfo_pkginfo_is_removable()
1065 static int get_pkg_author_href(const char *pkgid)
1068 char *author_href = NULL;
1069 pkgmgrinfo_pkginfo_h handle;
1070 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1071 if (ret != PMINFO_R_OK)
1073 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
1074 if (ret != PMINFO_R_OK) {
1075 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1078 printf("pkg author href: %s\n", author_href);
1079 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1084 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
1087 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
1088 * @brief This API gets the package installed storagae value from the package ID
1090 * @par This API is for package-manager client application
1091 * @par Sync (or) Async : Synchronous API
1093 * @param[in] handle pointer to package info handle
1094 * @param[out] storage pointer to hold package installed storage
1095 * @return 0 if success, error code(<0) if fail
1096 * @retval PMINFO_R_OK success
1097 * @retval PMINFO_R_EINVAL invalid argument
1098 * @retval PMINFO_R_ERROR internal error
1099 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1100 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1101 * @see pkgmgrinfo_pkginfo_get_pkgid()
1102 * @see pkgmgrinfo_pkginfo_is_removable()
1104 static int get_pkg_installed_storage(const char *pkgid)
1107 pkgmgrinfo_installed_storage storage;
1108 pkgmgrinfo_pkginfo_h handle;
1109 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1110 if (ret != PMINFO_R_OK)
1112 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1113 if (ret != PMINFO_R_OK) {
1114 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1117 printf("pkg installed storage: %d\n", storage);
1118 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1123 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1126 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1127 * @brief This API gets the installed time of package from the package ID
1129 * @par This API is for package-manager client application
1130 * @par Sync (or) Async : Synchronous API
1132 * @param[in] handle pointer to package info handle
1133 * @param[out] installed_time pointer to hold installed time of package
1134 * @return 0 if success, error code(<0) if fail
1135 * @retval PMINFO_R_OK success
1136 * @retval PMINFO_R_EINVAL invalid argument
1137 * @retval PMINFO_R_ERROR internal error
1138 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1139 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1140 * @see pkgmgrinfo_pkginfo_get_pkgid()
1141 * @see pkgmgrinfo_pkginfo_is_removable()
1143 static int get_pkg_installed_time(const char *pkgid)
1146 int installed_time = 0;
1147 pkgmgrinfo_pkginfo_h handle;
1148 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1149 if (ret != PMINFO_R_OK)
1151 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1152 if (ret != PMINFO_R_OK) {
1153 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1156 printf("installed_time: %d\n", installed_time);
1157 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1162 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1165 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1166 * @brief This API gets the store client id of package from the package ID
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package info handle
1172 * @param[out] storeclientid pointer to hold store client id of package
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1177 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1178 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1179 * @see pkgmgrinfo_pkginfo_get_pkgid()
1180 * @see pkgmgrinfo_pkginfo_is_removable()
1182 static int get_pkg_storeclientid(const char *pkgid)
1185 char *storeclientid = 0;
1186 pkgmgrinfo_pkginfo_h handle;
1187 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1188 if (ret != PMINFO_R_OK)
1190 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1191 if (ret != PMINFO_R_OK) {
1192 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1195 printf(store client id: %s\n", storeclientid);
1196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1201 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1204 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1205 * @brief This API gets the main app id of package from the package ID
1207 * @par This API is for package-manager client application
1208 * @par Sync (or) Async : Synchronous API
1210 * @param[in] handle pointer to package info handle
1211 * @param[out] mainappid pointer to hold main app id of package
1212 * @return 0 if success, error code(<0) if fail
1213 * @retval PMINFO_R_OK success
1214 * @retval PMINFO_R_EINVAL invalid argument
1215 * @retval PMINFO_R_ERROR internal error
1216 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1217 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1218 * @see pkgmgrinfo_pkginfo_get_pkgid()
1219 * @see pkgmgrinfo_pkginfo_is_removable()
1221 static int get_pkg_mainappid(const char *pkgid)
1224 char *mainappid = 0;
1225 pkgmgrinfo_pkginfo_h handle;
1226 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1227 if (ret != PMINFO_R_OK)
1229 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1230 if (ret != PMINFO_R_OK) {
1231 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1234 printf(main app id: %s\n", mainappid);
1235 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1240 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1243 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1244 * @brief This API gets the url of package from the package ID
1246 * @par This API is for package-manager client application
1247 * @par Sync (or) Async : Synchronous API
1249 * @param[in] handle pointer to package info handle
1250 * @param[out] url pointer to hold url of package
1251 * @return 0 if success, error code(<0) if fail
1252 * @retval PMINFO_R_OK success
1253 * @retval PMINFO_R_EINVAL invalid argument
1254 * @retval PMINFO_R_ERROR internal error
1255 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1256 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1257 * @see pkgmgrinfo_pkginfo_get_pkgid()
1258 * @see pkgmgrinfo_pkginfo_is_removable()
1260 static int get_pkg_url(const char *pkgid)
1264 pkgmgrinfo_pkginfo_h handle;
1265 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1266 if (ret != PMINFO_R_OK)
1268 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1269 if (ret != PMINFO_R_OK) {
1270 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1273 printf("url : %s\n", url);
1274 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1279 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1283 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1284 * @brief This API gets the root path of package
1286 * @par Sync (or) Async : Synchronous API
1288 * @param[in] handle pointer to package info handle
1289 * @param[out] path pointer to hold root path of package
1290 * @return 0 if success, error code(<0) if fail
1291 * @retval PMINFO_R_OK success
1292 * @retval PMINFO_R_EINVAL invalid argument
1293 * @retval PMINFO_R_ERROR internal error
1295 static int get_root_path(const char *pkgid)
1299 pkgmgrinfo_pkginfo_h handle;
1300 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1301 if (ret != PMINFO_R_OK)
1304 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1305 if (ret != PMINFO_R_OK) {
1306 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1309 printf("path : %s\n", path);
1310 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1316 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1320 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1321 * @brief This API gets the csc path of package
1323 * @par Sync (or) Async : Synchronous API
1325 * @param[in] handle pointer to package info handle
1326 * @param[out] path pointer to hold csc path of package
1327 * @return 0 if success, error code(<0) if fail
1328 * @retval PMINFO_R_OK success
1329 * @retval PMINFO_R_EINVAL invalid argument
1330 * @retval PMINFO_R_ERROR internal error
1332 static int get_csc_path(const char *pkgid)
1336 pkgmgrinfo_pkginfo_h handle;
1337 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1338 if (ret != PMINFO_R_OK)
1341 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1342 if (ret != PMINFO_R_OK) {
1343 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1346 printf("path : %s\n", path);
1347 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1353 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1356 * @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)
1357 * @brief This API compare the cert information from given package id
1359 * @par This API is for package-manager client application
1360 * @par Sync (or) Async : Synchronous API
1362 * @param[in] lhs_package_id pointer to first package ID
1363 * @param[in] rhs_package_id pointer to second package ID
1364 * @param[out] compare_result pointer to the compare result.
1365 * @return 0 if success, error code(<0) if fail
1366 * @retval PMINFO_R_OK success
1367 * @retval PMINFO_R_EINVAL invalid argument
1368 * @retval PMINFO_R_ERROR internal error
1370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1371 * @see pkgmgrinfo_pkginfo_get_pkgid()
1372 * @see pkgmgrinfo_pkginfo_is_removable()
1374 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1377 pkgmgrinfo_cert_compare_result_type_e result;
1379 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1380 if (ret != PMINFO_R_OK) {
1383 printf("result: %d\n", result);
1388 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);
1389 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);
1391 * @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)
1392 * @brief This API compare the cert information from given app id
1394 * @par This API is for package-manager client application
1395 * @par Sync (or) Async : Synchronous API
1397 * @param[in] lhs_app_id pointer to first app ID
1398 * @param[in] rhs_app_id pointer to second app ID
1399 * @param[out] compare_result pointer to the compare result.
1400 * @return 0 if success, error code(<0) if fail
1401 * @retval PMINFO_R_OK success
1402 * @retval PMINFO_R_EINVAL invalid argument
1403 * @retval PMINFO_R_ERROR internal error
1405 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1406 * @see pkgmgrinfo_pkginfo_get_pkgid()
1407 * @see pkgmgrinfo_pkginfo_is_removable()
1409 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1412 pkgmgrinfo_cert_compare_result_type_e result;
1414 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1415 if (ret != PMINFO_R_OK) {
1418 printf("result: %d\n", result);
1423 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);
1424 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);
1426 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1427 * @brief This API gets the package 'removable' value from the package ID
1429 * @par This API is for package-manager client application
1430 * @par Sync (or) Async : Synchronous API
1432 * @param[in] handle pointer to package info handle
1433 * @param[out] removable pointer to hold package removable value
1434 * @return 0 if success, error code(<0) if fail
1435 * @retval PMINFO_R_OK success
1436 * @retval PMINFO_R_EINVAL invalid argument
1437 * @retval PMINFO_R_ERROR internal error
1438 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1439 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1440 * @see pkgmgrinfo_pkginfo_get_pkgid()
1441 * @see pkgmgrinfo_pkginfo_is_readonly()
1443 static int get_pkg_removable(const char *pkgid)
1447 pkgmgrinfo_pkginfo_h handle;
1448 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1449 if (ret != PMINFO_R_OK)
1451 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1452 if (ret != PMINFO_R_OK) {
1453 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1456 printf("pkg removable: %d\n", removable);
1457 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1462 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1465 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1466 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1468 * @par This API is for package-manager client application
1469 * @par Sync (or) Async : Synchronous API
1471 * @param[in] handle pointer to package info handle
1472 * @param[out] movable pointer to hold package movable state
1473 * @return 0 if success, error code(<0) if fail
1474 * @retval PMINFO_R_OK success
1475 * @retval PMINFO_R_EINVAL invalid argument
1476 * @retval PMINFO_R_ERROR internal error
1477 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1478 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1479 * @see pkgmgrinfo_pkginfo_get_pkgid()
1481 static int get_pkg_movable(const char *pkgid)
1485 pkgmgrinfo_pkginfo_h handle;
1486 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1487 if (ret != PMINFO_R_OK)
1489 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1490 if (ret != PMINFO_R_OK) {
1491 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1494 printf("pkg movable: %d\n", movable);
1495 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1500 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1503 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1504 * @brief This API gets the package 'preload' value from the package ID
1506 * @par This API is for package-manager client application
1507 * @par Sync (or) Async : Synchronous API
1509 * @param[in] handle pointer to package info handle
1510 * @param[out] preload pointer to hold package preload value
1511 * @return 0 if success, error code(<0) if fail
1512 * @retval PMINFO_R_OK success
1513 * @retval PMINFO_R_EINVAL invalid argument
1514 * @retval PMINFO_R_ERROR internal error
1515 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1516 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1517 * @see pkgmgrinfo_pkginfo_get_pkgid()
1518 * @see pkgmgrinfo_pkginfo_is_readonly()
1520 static int get_pkg_preload(const char *pkgid)
1524 pkgmgrinfo_pkginfo_h handle;
1525 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1526 if (ret != PMINFO_R_OK)
1528 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1529 if (ret != PMINFO_R_OK) {
1530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1533 printf("pkg preload: %d\n", preload);
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1542 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1543 * @brief This API gets the value for given handle is system or not
1545 * @par This API is for package-manager client application
1546 * @par Sync (or) Async : Synchronous API
1548 * @param[in] handle pointer to package info handle
1549 * @param[out] system pointer to hold system is or not
1550 * @return 0 if success, error code(<0) if fail
1551 * @retval PMINFO_R_OK success
1552 * @retval PMINFO_R_EINVAL invalid argument
1553 * @retval PMINFO_R_ERROR internal error
1554 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1555 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1556 * @see pkgmgrinfo_pkginfo_get_pkgid()
1557 * @see pkgmgrinfo_pkginfo_is_readonly()
1559 static int get_pkg_system(const char *pkgid)
1562 bool system = false;
1563 pkgmgrinfo_pkginfo_h handle = NULL;
1564 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1565 if (ret != PMINFO_R_OK)
1567 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1568 if (ret != PMINFO_R_OK) {
1569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1572 printf("pkg system: %d\n", system);
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1578 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1581 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1582 * @brief This API gets the package 'readonly' value from the package ID
1584 * @par This API is for package-manager client application
1585 * @par Sync (or) Async : Synchronous API
1587 * @param[in] handle pointer to package info handle
1588 * @param[out] readonly pointer to hold package readonly value
1589 * @return 0 if success, error code(<0) if fail
1590 * @retval PMINFO_R_OK success
1591 * @retval PMINFO_R_EINVAL invalid argument
1592 * @retval PMINFO_R_ERROR internal error
1593 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1594 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1595 * @see pkgmgrinfo_pkginfo_get_pkgid()
1596 * @see pkgmgrinfo_pkginfo_is_removable()
1598 static int get_pkg_readonly(const char *pkgid)
1602 pkgmgrinfo_pkginfo_h handle;
1603 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1604 if (ret != PMINFO_R_OK)
1606 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1607 if (ret != PMINFO_R_OK) {
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 printf("pkg readonly: %d\n", readonly);
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1617 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1621 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1622 * @brief This API gets the package 'upate' value from the package ID
1624 * @par This API is for package-manager client application
1625 * @par Sync (or) Async : Synchronous API
1627 * @param[in] handle pointer to package info handle
1628 * @param[out] update pointer to hold package update value
1629 * @return 0 if success, error code(<0) if fail
1630 * @retval PMINFO_R_OK success
1631 * @retval PMINFO_R_EINVAL invalid argument
1632 * @retval PMINFO_R_ERROR internal error
1633 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1634 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1635 * @see pkgmgrinfo_pkginfo_get_pkgid()
1637 static int get_pkg_update(const char *pkgid)
1641 pkgmgrinfo_pkginfo_h handle;
1642 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1643 if (ret != PMINFO_R_OK)
1645 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1646 if (ret != PMINFO_R_OK) {
1647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 printf("pkg update: %d\n", update);
1651 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1656 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1660 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1661 * @brief This API gets the package 'uid' value from the view table of user database
1663 * @par This API is for package-manager client application
1664 * @par Sync (or) Async : Synchronous API
1666 * @param[in] uid uid of the user to determine the database
1667 * @param[in] pkgid id of the current package
1668 * @return 1 if it a global package, 0 else
1671 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1675 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1676 * @brief This API gets the package 'accessible' value from the package ID
1678 * @par This API is for package-manager client application
1679 * @par Sync (or) Async : Synchronous API
1681 * @param[in] handle pointer to package info handle
1682 * @param[out] accessible pointer to hold package accessible value
1683 * @return 0 if success, error code(<0) if fail
1684 * @retval PMINFO_R_OK success
1685 * @retval PMINFO_R_EINVAL invalid argument
1686 * @retval PMINFO_R_ERROR internal error
1687 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1688 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1689 * @see pkgmgrinfo_pkginfo_get_pkgid()
1690 * @see pkgmgrinfo_pkginfo_is_readonly()
1692 static int get_pkg_accessible(const char *pkgid)
1696 pkgmgrinfo_pkginfo_h handle;
1697 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1698 if (ret != PMINFO_R_OK)
1700 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1701 if (ret != PMINFO_R_OK) {
1702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1705 printf("pkg accessible: %d\n", accessible);
1706 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1711 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1714 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1715 * @brief This API destroys the package information handle freeing up all the resources
1717 * @par This API is for package-manager client application
1718 * @par Sync (or) Async : Synchronous API
1720 * @param[in] handle pointer to the package info handle
1721 * @return 0 if success, error code(<0) if fail
1722 * @retval PMINFO_R_OK success
1723 * @retval PMINFO_R_EINVAL invalid argument
1724 * @retval PMINFO_R_ERROR internal error
1725 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1727 * @see pkgmgrinfo_pkginfo_get_pkgid()
1728 * @see pkgmgrinfo_pkginfo_is_removable()
1730 static int get_pkg_type(const char *pkgid)
1734 pkgmgrinfo_pkginfo_h handle;
1735 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1736 if (ret != PMINFO_R_OK)
1738 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1739 if (ret != PMINFO_R_OK) {
1740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1743 printf("pkgtype: %s\n", type);
1744 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1749 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1752 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1753 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1754 The query will search the entire package information collected from the manifest file of all the installed packages
1756 * @par This API is for package-manager client application
1757 * @par Sync (or) Async : Synchronous API
1759 * @param[out] handle pointer to the package info filter handle.
1760 * @return 0 if success, error code(<0) if fail
1761 * @retval PMINFO_R_OK success
1762 * @retval PMINFO_R_EINVAL invalid argument
1763 * @retval PMINFO_R_ERROR internal error
1765 * @post pkgmgrinfo_pkginfo_filter_destroy()
1766 * @see pkgmgrinfo_pkginfo_filter_count()
1767 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1769 static int get_rpm_pkg_count()
1773 pkgmgrinfo_pkginfo_filter_h handle;
1774 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1775 if (ret != PMINFO_R_OK)
1777 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1778 if (ret != PMINFO_R_OK) {
1779 pkgmgrinfo_pkginfo_filter_destroy(handle);
1782 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_filter_destroy(handle);
1787 printf("No of rpm pkgs: %d\n", count);
1788 pkgmgrinfo_pkginfo_filter_destroy(handle);
1793 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1796 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1797 * @brief This API destroys the package information filter handle freeing up all the resources
1799 * @par This API is for package-manager client application
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] handle pointer to the package info filter handle.
1803 * @return 0 if success, error code(<0) if fail
1804 * @retval PMINFO_R_OK success
1805 * @retval PMINFO_R_EINVAL invalid argument
1806 * @retval PMINFO_R_ERROR internal error
1807 * @pre pkgmgrinfo_pkginfo_filter_create()
1809 * @see pkgmgrinfo_pkginfo_filter_count()
1810 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1812 static int get_rpm_pkg_count()
1816 pkgmgrinfo_pkginfo_filter_h handle;
1817 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1818 if (ret != PMINFO_R_OK)
1820 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1821 if (ret != PMINFO_R_OK) {
1822 pkgmgrinfo_pkginfo_filter_destroy(handle);
1825 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1826 if (ret != PMINFO_R_OK) {
1827 pkgmgrinfo_pkginfo_filter_destroy(handle);
1830 printf("No of rpm pkgs: %d\n", count);
1831 pkgmgrinfo_pkginfo_filter_destroy(handle);
1836 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1839 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1840 * @brief This API adds a boolean filter property to the filter handle
1842 * @par This API is for package-manager client application
1843 * @par Sync (or) Async : Synchronous API
1845 * @param[in] handle pointer to the package info filter handle.
1846 * @param[in] property boolean property name.
1847 * @param[in] value value corresponding to the property.
1848 * @return 0 if success, error code(<0) if fail
1849 * @retval PMINFO_R_OK success
1850 * @retval PMINFO_R_EINVAL invalid argument
1851 * @retval PMINFO_R_ERROR internal error
1852 * @pre pkgmgrinfo_pkginfo_filter_create()
1853 * @post pkgmgrinfo_pkginfo_filter_destroy()
1854 * @see pkgmgrinfo_pkginfo_filter_count()
1855 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1857 static int get_preload_pkg_count()
1861 pkgmgrinfo_pkginfo_filter_h handle;
1862 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1863 if (ret != PMINFO_R_OK)
1865 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1866 if (ret != PMINFO_R_OK) {
1867 pkgmgrinfo_pkginfo_filter_destroy(handle);
1870 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1871 if (ret != PMINFO_R_OK) {
1872 pkgmgrinfo_pkginfo_filter_destroy(handle);
1875 printf("No of preload pkgs: %d\n", count);
1876 pkgmgrinfo_pkginfo_filter_destroy(handle);
1881 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1882 const char *property, const bool value);
1885 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1886 * @brief This API adds an integer filter property to the filter handle
1888 * @par This API is for package-manager client application
1889 * @par Sync (or) Async : Synchronous API
1891 * @param[in] handle pointer to the package info filter handle.
1892 * @param[in] property integer property name.
1893 * @param[in] value value corresponding to the property.
1894 * @return 0 if success, error code(<0) if fail
1895 * @retval PMINFO_R_OK success
1896 * @retval PMINFO_R_EINVAL invalid argument
1897 * @retval PMINFO_R_ERROR internal error
1898 * @pre pkgmgrinfo_pkginfo_filter_create()
1899 * @post pkgmgrinfo_pkginfo_filter_destroy()
1900 * @see pkgmgrinfo_pkginfo_filter_count()
1901 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1903 static int get_pkg_count()
1907 pkgmgrinfo_pkginfo_filter_h handle;
1908 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1909 if (ret != PMINFO_R_OK)
1911 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1912 if (ret != PMINFO_R_OK) {
1913 pkgmgrinfo_pkginfo_filter_destroy(handle);
1916 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1917 if (ret != PMINFO_R_OK) {
1918 pkgmgrinfo_pkginfo_filter_destroy(handle);
1921 printf("No of preload pkgs: %d\n", count);
1922 pkgmgrinfo_pkginfo_filter_destroy(handle);
1927 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1928 const char *property, const int value);
1931 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1932 * @brief This API adds a string filter property to the filter handle
1934 * @par This API is for package-manager client application
1935 * @par Sync (or) Async : Synchronous API
1937 * @param[in] handle pointer to the package info filter handle.
1938 * @param[in] property string property name.
1939 * @param[in] value value corresponding to the property.
1940 * @return 0 if success, error code(<0) if fail
1941 * @retval PMINFO_R_OK success
1942 * @retval PMINFO_R_EINVAL invalid argument
1943 * @retval PMINFO_R_ERROR internal error
1944 * @pre pkgmgrinfo_pkginfo_filter_create()
1945 * @post pkgmgrinfo_pkginfo_filter_destroy()
1946 * @see pkgmgrinfo_pkginfo_filter_count()
1947 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1949 static int get_rpm_pkg_count()
1953 pkgmgrinfo_pkginfo_filter_h handle;
1954 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1955 if (ret != PMINFO_R_OK)
1957 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1958 if (ret != PMINFO_R_OK) {
1959 pkgmgrinfo_pkginfo_filter_destroy(handle);
1962 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1963 if (ret != PMINFO_R_OK) {
1964 pkgmgrinfo_pkginfo_filter_destroy(handle);
1967 printf("No of rpm pkgs: %d\n", count);
1968 pkgmgrinfo_pkginfo_filter_destroy(handle);
1973 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1974 const char *property, const char *value);
1977 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1978 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1980 * @par This API is for package-manager client application
1981 * @par Sync (or) Async : Synchronous API
1983 * @param[in] handle pointer to the package info filter handle.
1984 * @param[in] pkg_cb callback function.
1985 * @param[in] user_data user data to be passed to the callback function
1986 * @return 0 if success, error code(<0) if fail
1987 * @retval PMINFO_R_OK success
1988 * @retval PMINFO_R_EINVAL invalid argument
1989 * @retval PMINFO_R_ERROR internal error
1990 * @pre pkgmgrinfo_pkginfo_filter_create()
1991 * @post pkgmgrinfo_pkginfo_filter_destroy()
1992 * @see pkgmgrinfo_pkginfo_filter_count()
1994 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1997 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1998 printf("pkg id : %s\n", pkgid);
2002 static int get_rpm_pkg_list()
2005 pkgmgrinfo_pkginfo_filter_h handle;
2006 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2007 if (ret != PMINFO_R_OK)
2009 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2010 if (ret != PMINFO_R_OK) {
2011 pkgmgrinfo_pkginfo_filter_destroy(handle);
2014 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2015 if (ret != PMINFO_R_OK) {
2016 pkgmgrinfo_pkginfo_filter_destroy(handle);
2019 pkgmgrinfo_pkginfo_filter_destroy(handle);
2024 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2025 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2026 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2027 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2030 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2031 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2032 * @brief This API counts the package that satisfy the filter conditions
2034 * @par This API is for package-manager client application
2035 * @par Sync (or) Async : Synchronous API
2037 * @param[in] handle pointer to the package info filter handle.
2038 * @param[in] count pointer to store the count value.
2039 * @param[in] uid the addressee user id of the instruction
2040 * @return 0 if success, error code(<0) if fail
2041 * @retval PMINFO_R_OK success
2042 * @retval PMINFO_R_EINVAL invalid argument
2043 * @retval PMINFO_R_ERROR internal error
2044 * @pre pkgmgrinfo_pkginfo_filter_create()
2045 * @post pkgmgrinfo_pkginfo_filter_destroy()
2046 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2048 static int get_rpm_pkg_count()
2052 pkgmgrinfo_pkginfo_filter_h handle;
2053 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2054 if (ret != PMINFO_R_OK)
2056 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2057 if (ret != PMINFO_R_OK) {
2058 pkgmgrinfo_pkginfo_filter_destroy(handle);
2061 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2062 if (ret != PMINFO_R_OK) {
2063 pkgmgrinfo_pkginfo_filter_destroy(handle);
2066 printf("No of rpm pkgs: %d\n", count);
2067 pkgmgrinfo_pkginfo_filter_destroy(handle);
2072 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2073 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2075 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2076 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2077 * @brief This API gets the list of privilege for a particular package
2079 * @par This API is for package-manager client application
2080 * @par Sync (or) Async : Synchronous API
2081 * @param[in] handle pointer to the package info handle.
2082 * @param[in] privilege_func callback function for list
2083 * @param[in] user_data user data to be passed to callback function
2084 * @return 0 if success, error code(<0) if fail
2085 * @retval PMINFO_R_OK success
2086 * @retval PMINFO_R_EINVAL invalid argument
2087 * @retval PMINFO_R_ERROR internal error
2088 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2089 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2091 int privilege_func(const char *name, void *user_data)
2093 if (strcmp(name, (char *)user_data) == 0)
2099 static int list_privilege(const char *package, char *privilege)
2102 pkgmgrinfo_pkginfo_h handle;
2103 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2104 if (ret != PMINFO_R_OK)
2106 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2107 if (ret != PMINFO_R_OK) {
2108 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2111 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2116 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2117 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2119 /* TODO: add doxygen comment here */
2120 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2121 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2122 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2123 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2124 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2125 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2126 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2129 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2130 pkgmgrinfo_app_list_cb app_func, void *user_data)
2131 * @brief This API gets list of installed applications for a particular package
2133 * @par This API is for package-manager client application
2134 * @par Sync (or) Async : Synchronous API
2135 * @param[in] handle package info handle
2136 * @param[in] component application component
2137 * @param[in] app_func iteration function for list
2138 * @param[in] user_data user data to be passed to callback function
2139 * @return 0 if success, error code(<0) if fail
2140 * @retval PMINFO_R_OK success
2141 * @retval PMINFO_R_EINVAL invalid argument
2142 * @retval PMINFO_R_ERROR internal error
2143 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2144 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2146 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2149 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2150 printf("appid : %s\n", appid);
2154 static int list_apps(const char *pkgid)
2157 pkgmgrinfo_pkginfo_h handle;
2158 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2159 if (ret != PMINFO_R_OK)
2161 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2162 if (ret != PMINFO_R_OK) {
2163 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2166 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2171 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2172 pkgmgrinfo_app_list_cb app_func, void *user_data);
2173 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2174 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2176 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2177 * @brief This API gets list of installed applications from all packages with minimum informaion.
2179 * @par This API is for package-manager client application
2180 * @par Sync (or) Async : Synchronous API
2181 * @param[in] app_func iteration function for list
2182 * @param[in] user_data user data to be passed to callback function
2183 * @return 0 if success, error code(<0) if fail
2184 * @retval PMINFO_R_OK success
2185 * @retval PMINFO_R_EINVAL invalid argument
2186 * @retval PMINFO_R_ERROR internal error
2190 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2192 char *pkgid1 = NULL;
2193 char *pkgid2 = NULL;
2194 pkgid1 = (char *)user_data;
2195 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2196 if (strcmp(pkgid1, pkgid2) == 0) {
2203 static int list_apps()
2206 char *name = "helloworld";
2207 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2208 if (ret != PMINFO_R_OK) {
2215 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2216 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2218 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2219 * @brief This API gets list of installed applications from all packages.
2221 * @par This API is for package-manager client application
2222 * @par Sync (or) Async : Synchronous API
2223 * @param[in] app_func iteration function for list
2224 * @param[in] user_data user data to be passed to callback function
2225 * @return 0 if success, error code(<0) if fail
2226 * @retval PMINFO_R_OK success
2227 * @retval PMINFO_R_EINVAL invalid argument
2228 * @retval PMINFO_R_ERROR internal error
2232 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2234 char *pkgid1 = NULL;
2235 char *pkgid2 = NULL;
2236 pkgid1 = (char *)user_data;
2237 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2238 if (strcmp(pkgid1, pkgid2) == 0) {
2245 static int list_apps()
2248 char *name = "helloworld";
2249 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2250 if (ret != PMINFO_R_OK) {
2257 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2258 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2261 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2262 * @brief This API creates the application information handle from db
2264 * @par This API is for package-manager client application
2265 * @par Sync (or) Async : Synchronous API
2267 * @param[in] appid pointer to appid
2268 * @param[out] handle pointer to the application info handle.
2269 * @return 0 if success, error code(<0) if fail
2270 * @retval PMINFO_R_OK success
2271 * @retval PMINFO_R_EINVAL invalid argument
2272 * @retval PMINFO_R_ERROR internal error
2274 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2275 * @see pkgmgrinfo_appinfo_get_pkgid()
2276 * @see pkgmgrinfo_appinfo_is_multiple()
2278 static int get_app_type(const char *appid)
2282 pkgmgrinfo_appinfo_h handle;
2283 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2284 if (ret != PMINFO_R_OK)
2286 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2287 if (ret != PMINFO_R_OK) {
2288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2291 printf("apptype: %s\n", type);
2292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2297 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2298 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2300 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2301 * @brief This API gets the application ID
2303 * @par This API is for package-manager client application
2304 * @par Sync (or) Async : Synchronous API
2306 * @param[in] handle pointer to the application info handle.
2307 * @param[out] appid pointer to hold appid
2308 * @return 0 if success, error code(<0) if fail
2309 * @retval PMINFO_R_OK success
2310 * @retval PMINFO_R_EINVAL invalid argument
2311 * @retval PMINFO_R_ERROR internal error
2312 * @pre pkgmgrinfo_appinfo_get_appinfo()
2313 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2314 * @see pkgmgrinfo_appinfo_get_pkgid()
2315 * @see pkgmgrinfo_appinfo_is_multiple()
2317 static int get_app_id(const char *appid)
2320 char *app_id = NULL;
2321 pkgmgrinfo_appinfo_h handle;
2322 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2323 if (ret != PMINFO_R_OK)
2325 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2326 if (ret != PMINFO_R_OK) {
2327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2330 printf("app id: %s\n", app_id);
2331 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2336 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2339 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2340 * @brief This API gets the package name of the application
2342 * @par This API is for package-manager client application
2343 * @par Sync (or) Async : Synchronous API
2345 * @param[in] handle pointer to the application info handle.
2346 * @param[out] pkg_name pointer to hold package name
2347 * @return 0 if success, error code(<0) if fail
2348 * @retval PMINFO_R_OK success
2349 * @retval PMINFO_R_EINVAL invalid argument
2350 * @retval PMINFO_R_ERROR internal error
2351 * @pre pkgmgrinfo_appinfo_get_appinfo()
2352 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2353 * @see pkgmgrinfo_appinfo_get_appid()
2354 * @see pkgmgrinfo_appinfo_is_multiple()
2356 static int get_app_pkgname(const char *appid)
2359 char *pkgname = NULL;
2360 pkgmgrinfo_appinfo_h handle;
2361 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2362 if (ret != PMINFO_R_OK)
2364 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2365 if (ret != PMINFO_R_OK) {
2366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2369 printf("pkg name: %s\n", pkgname);
2370 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2375 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2378 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2379 * @brief This API gets the package id of the application
2381 * @par This API is for package-manager client application
2382 * @par Sync (or) Async : Synchronous API
2384 * @param[in] handle pointer to the application info handle.
2385 * @param[out] pkgid pointer to hold package id
2386 * @return 0 if success, error code(<0) if fail
2387 * @retval PMINFO_R_OK success
2388 * @retval PMINFO_R_EINVAL invalid argument
2389 * @retval PMINFO_R_ERROR internal error
2390 * @pre pkgmgrinfo_appinfo_get_appinfo()
2391 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2392 * @see pkgmgrinfo_appinfo_get_appid()
2393 * @see pkgmgrinfo_appinfo_is_multiple()
2395 static int get_app_pkgid(const char *appid)
2399 pkgmgrinfo_appinfo_h handle;
2400 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2401 if (ret != PMINFO_R_OK)
2403 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2404 if (ret != PMINFO_R_OK) {
2405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2408 printf("pkg id: %s\n", pkgid);
2409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2414 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2417 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2418 * @brief This API gets the executable name of the application
2420 * @par This API is for package-manager client application
2421 * @par Sync (or) Async : Synchronous API
2423 * @param[in] handle pointer to the application info handle.
2424 * @param[out] exec pointer to hold app exec name
2425 * @return 0 if success, error code(<0) if fail
2426 * @retval PMINFO_R_OK success
2427 * @retval PMINFO_R_EINVAL invalid argument
2428 * @retval PMINFO_R_ERROR internal error
2429 * @pre pkgmgrinfo_appinfo_get_appinfo()
2430 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2431 * @see pkgmgrinfo_appinfo_get_appid()
2432 * @see pkgmgrinfo_appinfo_is_multiple()
2434 static int get_app_exec(const char *appid)
2438 pkgmgrinfo_appinfo_h handle;
2439 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2440 if (ret != PMINFO_R_OK)
2442 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2443 if (ret != PMINFO_R_OK) {
2444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2447 printf("exec name: %s\n", exec);
2448 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2453 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2456 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2457 * @brief This API gets the icon name of the application
2459 * @par This API is for package-manager client application
2460 * @par Sync (or) Async : Synchronous API
2462 * @param[in] handle pointer to the application info handle.
2463 * @param[out] icon pointer to hold app icon name
2464 * @return 0 if success, error code(<0) if fail
2465 * @retval PMINFO_R_OK success
2466 * @retval PMINFO_R_EINVAL invalid argument
2467 * @retval PMINFO_R_ERROR internal error
2468 * @pre pkgmgrinfo_appinfo_get_appinfo()
2469 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2470 * @see pkgmgrinfo_appinfo_get_appid()
2471 * @see pkgmgrinfo_appinfo_is_multiple()
2473 static int get_app_icon(const char *appid)
2477 pkgmgrinfo_appinfo_h handle;
2478 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2479 if (ret != PMINFO_R_OK)
2481 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2482 if (ret != PMINFO_R_OK) {
2483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2486 printf("icon name: %s\n", icon);
2487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2495 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2496 * @brief This API gets the label of the application
2498 * @par This API is for package-manager client application
2499 * @par Sync (or) Async : Synchronous API
2501 * @param[in] handle pointer to the application info handle.
2502 * @param[out] label pointer to hold app label
2503 * @return 0 if success, error code(<0) if fail
2504 * @retval PMINFO_R_OK success
2505 * @retval PMINFO_R_EINVAL invalid argument
2506 * @retval PMINFO_R_ERROR internal error
2507 * @pre pkgmgrinfo_appinfo_get_appinfo()
2508 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2509 * @see pkgmgrinfo_appinfo_get_appid()
2510 * @see pkgmgrinfo_appinfo_is_multiple()
2512 static int get_app_label(const char *appid)
2516 pkgmgrinfo_appinfo_h handle;
2517 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2518 if (ret != PMINFO_R_OK)
2520 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2521 if (ret != PMINFO_R_OK) {
2522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2525 printf("label : %s\n", label);
2526 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2531 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2534 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2535 * @brief This API gets exactly matched label by given appid and locale
2537 * @par This API is for package-manager client application
2538 * @par Sync (or) Async : Synchronous API
2540 * @param[in] appid pointer to appid
2541 * @param[in] locale pointer to locale
2542 * @param[out] label pointer to hold app label
2543 * @return 0 if success, error code(<0) if fail
2544 * @retval PMINFO_R_OK success
2545 * @retval PMINFO_R_EINVAL invalid argument
2546 * @retval PMINFO_R_ERROR internal error
2548 static int get_localed_label(const char *appid, const char *locale)
2553 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2554 if (ret != PMINFO_R_OK)
2557 printf("localed label: %s\n", label);
2565 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2566 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2569 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2570 * @brief This API gets the component of the application
2572 * @par This API is for package-manager client application
2573 * @par Sync (or) Async : Synchronous API
2575 * @param[in] handle pointer to the application info handle.
2576 * @param[out] component pointer to hold app component
2577 * @return 0 if success, error code(<0) if fail
2578 * @retval PMINFO_R_OK success
2579 * @retval PMINFO_R_EINVAL invalid argument
2580 * @retval PMINFO_R_ERROR internal error
2581 * @pre pkgmgrinfo_appinfo_get_appinfo()
2582 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2583 * @see pkgmgrinfo_appinfo_get_appid()
2584 * @see pkgmgrinfo_appinfo_is_multiple()
2586 static int get_app_component(const char *appid)
2589 pkgmgrinfo_app_component component;
2590 pkgmgrinfo_appinfo_h handle;
2591 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2592 if (ret != PMINFO_R_OK)
2594 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2595 if (ret != PMINFO_R_OK) {
2596 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2599 printf("component : %s\n", component);
2600 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2605 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2608 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2609 * @brief This API gets the apptype of the application
2611 * @par This API is for package-manager client application
2612 * @par Sync (or) Async : Synchronous API
2614 * @param[in] handle pointer to the application info handle.
2615 * @param[out] app_type pointer to hold apptype
2616 * @return 0 if success, error code(<0) if fail
2617 * @retval PMINFO_R_OK success
2618 * @retval PMINFO_R_EINVAL invalid argument
2619 * @retval PMINFO_R_ERROR internal error
2620 * @pre pkgmgrinfo_appinfo_get_appinfo()
2621 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2622 * @see pkgmgrinfo_appinfo_get_appid()
2623 * @see pkgmgrinfo_appinfo_is_multiple()
2625 static int get_app_type(const char *appid)
2628 char *apptype = NULL;
2629 pkgmgrinfo_appinfo_h handle;
2630 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2631 if (ret != PMINFO_R_OK)
2633 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2634 if (ret != PMINFO_R_OK) {
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2638 printf("apptype : %s\n", apptype);
2639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2644 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2647 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2648 int *operation_count, char ***operation)
2649 * @brief This API gets the list of operation of the application
2651 * @par This API is for package-manager client application
2652 * @par Sync (or) Async : Synchronous API
2654 * @param[in] handle pointer to the appcontrol handle.
2655 * @param[out] operation_count pointer to hold number of operations
2656 * @param[out] operation pointer to hold list of operations
2657 * @return 0 if success, error code(<0) if fail
2658 * @retval PMINFO_R_OK success
2659 * @retval PMINFO_R_EINVAL invalid argument
2660 * @retval PMINFO_R_ERROR internal error
2661 * @pre pkgmgrinfo_appinfo_get_appinfo()
2662 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2663 * @see pkgmgrinfo_appinfo_get_uri()
2664 * @see pkgmgrinfo_appinfo_get_mime()
2666 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2671 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2672 for (i = 0; i < oc; i++) {
2673 if (strcmp(operation[i], (char *)user_data) == 0)
2680 static int check_operation(const char *appid, char *operation)
2683 pkgmgrinfo_appinfo_h handle;
2684 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2685 if (ret != PMINFO_R_OK)
2687 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2688 if (ret != PMINFO_R_OK) {
2689 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2697 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2698 int *operation_count, char ***operation);
2701 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2702 int *uri_count, char ***uri)
2703 * @brief This API gets the list of uri of the application
2705 * @par This API is for package-manager client application
2706 * @par Sync (or) Async : Synchronous API
2708 * @param[in] handle pointer to the appcontrol handle.
2709 * @param[out] uri_count pointer to hold number of uris
2710 * @param[out] uri pointer to hold list of uris
2711 * @return 0 if success, error code(<0) if fail
2712 * @retval PMINFO_R_OK success
2713 * @retval PMINFO_R_EINVAL invalid argument
2714 * @retval PMINFO_R_ERROR internal error
2715 * @pre pkgmgrinfo_appinfo_get_appinfo()
2716 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2717 * @see pkgmgrinfo_appinfo_get_operation()
2718 * @see pkgmgrinfo_appinfo_get_mime()
2720 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2725 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2726 for (i = 0; i < uc; i++) {
2727 if (strcmp(uri[i], (char *)user_data) == 0)
2734 static int check_uri(const char *appid, char *uri)
2737 pkgmgrinfo_appinfo_h handle;
2738 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2739 if (ret != PMINFO_R_OK)
2741 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2742 if (ret != PMINFO_R_OK) {
2743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2746 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2751 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2752 int *uri_count, char ***uri);
2755 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2756 int *mime_count, char ***mime)
2757 * @brief This API gets the list of mime of the application
2759 * @par This API is for package-manager client application
2760 * @par Sync (or) Async : Synchronous API
2762 * @param[in] handle pointer to the appcontrol handle.
2763 * @param[out] mime_count pointer to hold number of mimes
2764 * @param[out] mime pointer to hold list of mimes
2765 * @return 0 if success, error code(<0) if fail
2766 * @retval PMINFO_R_OK success
2767 * @retval PMINFO_R_EINVAL invalid argument
2768 * @retval PMINFO_R_ERROR internal error
2769 * @pre pkgmgrinfo_appinfo_get_appinfo()
2770 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2771 * @see pkgmgrinfo_appinfo_get_uri()
2772 * @see pkgmgrinfo_appinfo_get_operation()
2774 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2779 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2780 for (i = 0; i < mc; i++) {
2781 if (strcmp(mime[i], (char *)user_data) == 0)
2788 static int check_mime(const char *appid, char *mime)
2791 pkgmgrinfo_appinfo_h handle;
2792 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2793 if (ret != PMINFO_R_OK)
2795 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2796 if (ret != PMINFO_R_OK) {
2797 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2800 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2805 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2806 int *mime_count, char ***mime);
2809 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2810 int *subapp_count, char ***subapp)
2811 * @brief This API gets the list of subapp of the application
2813 * @par This API is for package-manager client application
2814 * @par Sync (or) Async : Synchronous API
2816 * @param[in] handle pointer to the appcontrol handle.
2817 * @param[out] subapp_count pointer to hold number of subapp
2818 * @param[out] subapp pointer to hold list of subapp
2819 * @return 0 if success, error code(<0) if fail
2820 * @retval PMINFO_R_OK success
2821 * @retval PMINFO_R_EINVAL invalid argument
2822 * @retval PMINFO_R_ERROR internal error
2823 * @pre pkgmgrinfo_appinfo_get_appinfo()
2824 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2825 * @see pkgmgrinfo_appinfo_get_uri()
2826 * @see pkgmgrinfo_appinfo_get_operation()
2828 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2832 char **subapp = NULL;
2833 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2834 for (i = 0; i < sc; i++) {
2835 if (strcmp(subapp[i], (char *)user_data) == 0)
2842 static int check_subapp(const char *appid, char *subapp)
2845 pkgmgrinfo_appinfo_h handle = NULL;
2846 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2847 if (ret != PMINFO_R_OK)
2849 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2850 if (ret != PMINFO_R_OK) {
2851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2854 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2859 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2860 int *subapp_count, char ***subapp);
2863 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2864 * @brief This API gets the notification icon of the application
2866 * @par This API is for package-manager client application
2867 * @par Sync (or) Async : Synchronous API
2869 * @param[in] handle pointer to the application info handle.
2870 * @param[out] path pointer to hold notification icon
2871 * @return 0 if success, error code(<0) if fail
2872 * @retval PMINFO_R_OK success
2873 * @retval PMINFO_R_EINVAL invalid argument
2874 * @retval PMINFO_R_ERROR internal error
2875 * @pre pkgmgrinfo_appinfo_get_appinfo()
2876 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2877 * @see pkgmgrinfo_appinfo_get_appid()
2878 * @see pkgmgrinfo_appinfo_is_multiple()
2880 static int get_app_notification_icon(const char *appid)
2883 char *notification_icon = NULL;
2884 pkgmgrinfo_appinfo_h handle;
2885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2886 if (ret != PMINFO_R_OK)
2888 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2889 if (ret != PMINFO_R_OK) {
2890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2893 printf("notification icon : %s\n", notification_icon);
2894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2899 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2902 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2903 * @brief This API gets the setting icon of the application
2905 * @par This API is for package-manager client application
2906 * @par Sync (or) Async : Synchronous API
2908 * @param[in] handle pointer to the application info handle.
2909 * @param[out] path pointer to hold setting icon
2910 * @return 0 if success, error code(<0) if fail
2911 * @retval PMINFO_R_OK success
2912 * @retval PMINFO_R_EINVAL invalid argument
2913 * @retval PMINFO_R_ERROR internal error
2914 * @pre pkgmgrinfo_appinfo_get_appinfo()
2915 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2916 * @see pkgmgrinfo_appinfo_get_appid()
2917 * @see pkgmgrinfo_appinfo_is_multiple()
2919 static int get_app_setting_icon(const char *appid)
2922 char *setting_icon = NULL;
2923 pkgmgrinfo_appinfo_h handle;
2924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2925 if (ret != PMINFO_R_OK)
2927 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2928 if (ret != PMINFO_R_OK) {
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2932 printf("setting icon : %s\n", setting_icon);
2933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2938 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2941 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2942 * @brief This API gets the type of recent image on app-tray
2944 * @par This API is for package-manager client application
2945 * @par Sync (or) Async : Synchronous API
2947 * @param[in] handle pointer to the application info handle.
2948 * @param[out] type pointer to hold image type
2949 * @return 0 if success, error code(<0) if fail
2950 * @retval PMINFO_R_OK success
2951 * @retval PMINFO_R_EINVAL invalid argument
2952 * @retval PMINFO_R_ERROR internal error
2953 * @pre pkgmgrinfo_appinfo_get_appinfo()
2954 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2955 * @see pkgmgrinfo_appinfo_get_appid()
2956 * @see pkgmgrinfo_appinfo_is_multiple()
2958 static int get_app_recent_image_type(const char *appid)
2961 pkgmgrinfo_app_recentimage type;
2962 pkgmgrinfo_appinfo_h handle;
2963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2964 if (ret != PMINFO_R_OK)
2966 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2967 if (ret != PMINFO_R_OK) {
2968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2971 printf("recent image type: %d\n", type);
2972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2977 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2981 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2982 * @brief This API gets the preview image of application
2984 * @par Sync (or) Async : Synchronous API
2986 * @param[in] handle pointer to the application info handle.
2987 * @param[out] preview_img pointer to hold preview image path
2988 * @return 0 if success, error code(<0) if fail
2989 * @retval PMINFO_R_OK success
2990 * @retval PMINFO_R_EINVAL invalid argument
2991 * @retval PMINFO_R_ERROR internal error
2992 * @pre pkgmgrinfo_appinfo_get_appinfo()
2993 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2994 * @see pkgmgrinfo_appinfo_get_appid()
2996 static int get_app_previewimage(const char *appid)
2999 char *preview = NULL;
3000 pkgmgrinfo_appinfo_h handle = NULL;
3001 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3002 if (ret != PMINFO_R_OK)
3004 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3005 if (ret != PMINFO_R_OK) {
3006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3009 printf("preview image path : %s\n", preview);
3010 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3015 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3019 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3020 * @brief This API gets the package permission type of the application
3022 * @par This API is for package-manager client application
3023 * @par Sync (or) Async : Synchronous API
3025 * @param[in] handle pointer to the application info handle.
3026 * @param[out] permission pointer to hold package permission
3027 * @return 0 if success, error code(<0) if fail
3028 * @retval PMINFO_R_OK success
3029 * @retval PMINFO_R_EINVAL invalid argument
3030 * @retval PMINFO_R_ERROR internal error
3031 * @pre pkgmgrinfo_appinfo_get_appinfo()
3032 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3033 * @see pkgmgrinfo_appinfo_get_appid()
3035 static int get_app_permission(const char *appid)
3038 pkgmgrinfo_permission_type permission = 0;
3039 pkgmgrinfo_appinfo_h handle;
3041 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3042 if (ret != PMINFO_R_OK)
3044 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3045 if (ret != PMINFO_R_OK) {
3046 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3049 printf("permission type: %d\n", permission);
3050 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3055 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3058 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3059 * @brief This API gets the component_type
3061 * @par This API is for package-manager client application
3062 * @par Sync (or) Async : Synchronous API
3064 * @param[in] handle pointer to the application info handle.
3065 * @param[out] component_type pointer to hold component_type
3066 * @return 0 if success, error code(<0) if fail
3067 * @retval PMINFO_R_OK success
3068 * @retval PMINFO_R_EINVAL invalid argument
3069 * @retval PMINFO_R_ERROR internal error
3070 * @pre pkgmgrinfo_appinfo_get_appinfo()
3071 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3072 * @see pkgmgrinfo_appinfo_get_pkgid()
3073 * @see pkgmgrinfo_appinfo_is_multiple()
3075 static int get_component_type(const char *appid)
3078 char *component_type = NULL;
3079 pkgmgrinfo_appinfo_h handle;
3080 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3081 if (ret != PMINFO_R_OK)
3083 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3084 if (ret != PMINFO_R_OK) {
3085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3088 printf("component_type: %s\n", component_type);
3089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3094 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3097 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3098 * @brief This API gets the application 'hwacceleration' value from the app ID
3100 * @par This API is for package-manager client application
3101 * @par Sync (or) Async : Synchronous API
3103 * @param[in] handle pointer to application info handle
3104 * @param[out] hwacceleration pointer to hold package hwacceleration value
3105 * @return 0 if success, error code(<0) if fail
3106 * @retval PMINFO_R_OK success
3107 * @retval PMINFO_R_EINVAL invalid argument
3108 * @retval PMINFO_R_ERROR internal error
3109 * @pre pkgmgrinfo_appinfo_get_appinfo()
3110 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3111 * @see pkgmgrinfo_appinfo_get_appid()
3112 * @see pkgmgrinfo_appinfo_is_multiple()
3114 static int get_app_hwacceleration(const char *appid)
3117 pkgmgrinfo_app_hwacceleration hwacceleration;
3118 pkgmgrinfo_appinfo_h handle;
3119 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3120 if (ret != PMINFO_R_OK)
3122 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3123 if (ret != PMINFO_R_OK) {
3124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3127 printf("app hwacceleration: %d\n", hwacceleration);
3128 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3133 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3136 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3137 * @brief This API gets the application 'screenreader' value from the app ID
3139 * @par This API is for package-manager client application
3140 * @par Sync (or) Async : Synchronous API
3142 * @param[in] handle pointer to application info handle
3143 * @param[out] screenreader pointer to hold package accessibility value
3144 * @return 0 if success, error code(<0) if fail
3145 * @retval PMINFO_R_OK success
3146 * @retval PMINFO_R_EINVAL invalid argument
3147 * @retval PMINFO_R_ERROR internal error
3148 * @pre pkgmgrinfo_appinfo_get_appinfo()
3149 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3150 * @see pkgmgrinfo_appinfo_get_appid()
3151 * @see pkgmgrinfo_appinfo_is_multiple()
3153 static int get_app_screenreader(const char *appid)
3156 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3157 pkgmgrinfo_appinfo_h handle = NULL;
3158 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3159 if (ret != PMINFO_R_OK)
3161 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3162 if (ret != PMINFO_R_OK) {
3163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3166 printf("app screenreader: %d\n", screenreader);
3167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3172 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3175 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3176 * @brief This API gets the application's landscape & portrait effect images
3178 * @par This API is for package-manager client application
3179 * @par Sync (or) Async : Synchronous API
3181 * @param[in] handle pointer to application info handle
3182 * @param[out] portrait_img contains portrait mode effect image
3183 * @param[out] landscape_img contains landscape mode effect image
3184 * @return 0 if success, error code(<0) if fail
3185 * @retval PMINFO_R_OK success
3186 * @retval PMINFO_R_EINVAL invalid argument
3187 * @retval PMINFO_R_ERROR internal error
3188 * @pre pkgmgrinfo_appinfo_get_appinfo()
3189 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3190 * @see pkgmgrinfo_appinfo_get_appid()
3191 * @see pkgmgrinfo_appinfo_is_nodisplay()
3193 static int get_app_effectimages(const char *appid)
3196 char *portraitimg = NULL;
3197 char *landscapeimg = NULL;
3198 pkgmgrinfo_appinfo_h handle;
3199 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3200 if (ret != PMINFO_R_OK)
3202 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3203 if (ret != PMINFO_R_OK) {
3204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3207 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3213 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3216 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3217 * @brief This API gets the submode_mainid of the application
3219 * @par This API is for package-manager client application
3220 * @par Sync (or) Async : Synchronous API
3222 * @param[in] handle pointer to the application info handle.
3223 * @param[out] submode_mainid pointer to hold package name
3224 * @return 0 if success, error code(<0) if fail
3225 * @retval PMINFO_R_OK success
3226 * @retval PMINFO_R_EINVAL invalid argument
3227 * @retval PMINFO_R_ERROR internal error
3228 * @pre pkgmgrinfo_appinfo_get_appinfo()
3229 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3230 * @see pkgmgrinfo_appinfo_get_appid()
3231 * @see pkgmgrinfo_appinfo_is_multiple()
3233 static int get_app_submode_mainid(const char *appid)
3236 char *submode_mainid = NULL;
3237 pkgmgrinfo_appinfo_h handle = NULL;
3238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3239 if (ret != PMINFO_R_OK)
3241 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3242 if (ret != PMINFO_R_OK) {
3243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3246 printf("submode_mainid: %s\n", submode_mainid);
3247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3252 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3255 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3256 * @brief This API gets the datacontrol info
3258 * @par This API is for package-manager client application
3259 * @par Sync (or) Async : Synchronous API
3261 * @param[in] providerid pointer to the providerid of dataconltrol.
3262 * @param[in] type pointer to the type of dataconltrol.
3263 * @param[out] appid pointer to hold appid, need to free after using
3264 * @param[out] access pointer to hold access, need to free after using
3265 * @return 0 if success, error code(<0) if fail
3266 * @retval PMINFO_R_OK success
3267 * @retval PMINFO_R_EINVAL invalid argument
3268 * @retval PMINFO_R_ERROR internal error
3271 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3274 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3275 * @brief This API gets the appid of datacontrol
3277 * @par This API is for package-manager client application
3278 * @par Sync (or) Async : Synchronous API
3280 * @param[in] providerid pointer to the providerid of dataconltrol.
3281 * @param[out] appid pointer to hold appid, need to free after using
3282 * @return 0 if success, error code(<0) if fail
3283 * @retval PMINFO_R_OK success
3284 * @retval PMINFO_R_EINVAL invalid argument
3285 * @retval PMINFO_R_ERROR internal error
3288 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3291 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3292 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3293 * @brief This API gets the list of permission for a particular application
3295 * @par This API is for package-manager client application
3296 * @par Sync (or) Async : Synchronous API
3297 * @param[in] handle pointer to the application info handle.
3298 * @param[in] permission_func callback function for list
3299 * @param[in] user_data user data to be passed to callback function
3300 * @return 0 if success, error code(<0) if fail
3301 * @retval PMINFO_R_OK success
3302 * @retval PMINFO_R_EINVAL invalid argument
3303 * @retval PMINFO_R_ERROR internal error
3304 * @pre pkgmgrinfo_appinfo_get_appinfo()
3305 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3307 int permission_func(const char *name, void *user_data)
3309 if (strcmp(name, (char *)user_data) == 0)
3315 static int list_permission(const char *appid, char *permission)
3318 pkgmgrinfo_appinfo_h handle;
3319 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3320 if (ret != PMINFO_R_OK)
3322 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3323 if (ret != PMINFO_R_OK) {
3324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3332 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3333 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3336 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3337 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3338 * @brief This API gets the list of category for a particular application
3340 * @par This API is for package-manager client application
3341 * @par Sync (or) Async : Synchronous API
3342 * @param[in] handle pointer to the application info handle.
3343 * @param[in] category_func callback function for list
3344 * @param[in] user_data user data to be passed to callback function
3345 * @return 0 if success, error code(<0) if fail
3346 * @retval PMINFO_R_OK success
3347 * @retval PMINFO_R_EINVAL invalid argument
3348 * @retval PMINFO_R_ERROR internal error
3349 * @pre pkgmgrinfo_appinfo_get_appinfo()
3350 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3352 int category_func(const char *name, void *user_data)
3354 if (strcmp(name, (char *)user_data) == 0)
3360 static int list_category(const char *appid, char *category)
3363 pkgmgrinfo_appinfo_h handle;
3364 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3365 if (ret != PMINFO_R_OK)
3367 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3368 if (ret != PMINFO_R_OK) {
3369 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3372 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3377 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3378 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3381 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3382 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3383 * @brief This API gets the list of metadata for a particular application
3385 * @par This API is for package-manager client application
3386 * @par Sync (or) Async : Synchronous API
3387 * @param[in] handle pointer to the application info handle.
3388 * @param[in] metadata_func callback function for list
3389 * @param[in] user_data user data to be passed to callback function
3390 * @return 0 if success, error code(<0) if fail
3391 * @retval PMINFO_R_OK success
3392 * @retval PMINFO_R_EINVAL invalid argument
3393 * @retval PMINFO_R_ERROR internal error
3394 * @pre pkgmgrinfo_appinfo_get_appinfo()
3395 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3397 int metadata_func(const char *key, const char *value, void *user_data)
3399 if (strcmp(key, (char *)user_data) == 0) {
3400 printf("Value is %s\n", value);
3407 static int list_metadata(const char *appid, char *key)
3410 pkgmgrinfo_appinfo_h handle;
3411 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3412 if (ret != PMINFO_R_OK)
3414 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3415 if (ret != PMINFO_R_OK) {
3416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3424 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3425 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3429 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3430 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3431 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3432 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3433 * @brief This API gets the list of app-control for a particular application
3435 * @par This API is for package-manager client application
3436 * @par Sync (or) Async : Synchronous API
3437 * @param[in] handle pointer to the application info handle.
3438 * @param[in] appcontrol_func callback function for list
3439 * @param[in] user_data user data to be passed to callback function
3440 * @param[in] uid the addressee user id of the instruction
3441 * @return 0 if success, error code(<0) if fail
3442 * @retval PMINFO_R_OK success
3443 * @retval PMINFO_R_EINVAL invalid argument
3444 * @retval PMINFO_R_ERROR internal error
3445 * @pre pkgmgrinfo_appinfo_get_appinfo()
3446 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3448 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3453 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3454 for (i = 0; i < oc; i++) {
3455 if (strcmp(operation[i], (char *)user_data) == 0)
3462 static int check_operation(const char *appid, char *operation)
3465 pkgmgrinfo_appinfo_h handle;
3466 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3467 if (ret != PMINFO_R_OK)
3469 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3470 if (ret != PMINFO_R_OK) {
3471 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3474 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3479 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3480 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3481 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3482 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3485 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3486 * @brief This API gets the application 'nodisplay' value from the app ID
3488 * @par This API is for package-manager client application
3489 * @par Sync (or) Async : Synchronous API
3491 * @param[in] handle pointer to application info handle
3492 * @param[out] nodisplay pointer to hold package nodisplay value
3493 * @return 0 if success, error code(<0) if fail
3494 * @retval PMINFO_R_OK success
3495 * @retval PMINFO_R_EINVAL invalid argument
3496 * @retval PMINFO_R_ERROR internal error
3497 * @pre pkgmgrinfo_appinfo_get_appinfo()
3498 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3499 * @see pkgmgrinfo_appinfo_get_appid()
3500 * @see pkgmgrinfo_appinfo_is_multiple()
3502 static int get_app_nodisplay(const char *appid)
3506 pkgmgrinfo_appinfo_h handle;
3507 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3508 if (ret != PMINFO_R_OK)
3510 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3511 if (ret != PMINFO_R_OK) {
3512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3515 printf("app nodisplay: %d\n", nodisplay);
3516 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3521 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3524 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3525 * @brief This API gets the application 'multiple' value from the app ID
3527 * @par This API is for package-manager client application
3528 * @par Sync (or) Async : Synchronous API
3530 * @param[in] handle pointer to application info handle
3531 * @param[out] multiple pointer to hold package multiple value
3532 * @return 0 if success, error code(<0) if fail
3533 * @retval PMINFO_R_OK success
3534 * @retval PMINFO_R_EINVAL invalid argument
3535 * @retval PMINFO_R_ERROR internal error
3536 * @pre pkgmgrinfo_appinfo_get_appinfo()
3537 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3538 * @see pkgmgrinfo_appinfo_get_appid()
3539 * @see pkgmgrinfo_appinfo_is_nodisplay()
3541 static int get_app_multiple(const char *appid)
3545 pkgmgrinfo_appinfo_h handle;
3546 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3547 if (ret != PMINFO_R_OK)
3549 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3550 if (ret != PMINFO_R_OK) {
3551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3554 printf("app multiple: %d\n", multiple);
3555 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3560 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3563 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3564 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3565 * application launching effect. If fales, indicator will be hidden during application launching effect
3567 * @par This API is for package-manager client application
3568 * @par Sync (or) Async : Synchronous API
3570 * @param[in] handle pointer to application info handle
3571 * @param[out] indicator_disp contains indicator display status for application launching effect
3572 * @return 0 if success, error code(<0) if fail
3573 * @retval PMINFO_R_OK success
3574 * @retval PMINFO_R_EINVAL invalid argument
3575 * @retval PMINFO_R_ERROR internal error
3576 * @pre pkgmgrinfo_appinfo_get_appinfo()
3577 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3578 * @see pkgmgrinfo_appinfo_get_appid()
3579 * @see pkgmgrinfo_appinfo_is_nodisplay()
3581 static int get_app_indicator_display(const char *appid)
3584 bool indicator_disp;
3585 pkgmgrinfo_appinfo_h handle;
3586 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3587 if (ret != PMINFO_R_OK)
3589 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3590 if (ret != PMINFO_R_OK){
3591 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3594 printf("app indicator disp : %d\n", indicator_disp);
3595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3600 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3603 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3604 * @brief This API gets the application 'taskmanage' value from the app ID
3606 * @par This API is for package-manager client application
3607 * @par Sync (or) Async : Synchronous API
3609 * @param[in] handle pointer to application info handle
3610 * @param[out] taskmanage pointer to hold package taskmanage value
3611 * @return 0 if success, error code(<0) if fail
3612 * @retval PMINFO_R_OK success
3613 * @retval PMINFO_R_EINVAL invalid argument
3614 * @retval PMINFO_R_ERROR internal error
3615 * @pre pkgmgrinfo_appinfo_get_appinfo()
3616 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3617 * @see pkgmgrinfo_appinfo_get_appid()
3618 * @see pkgmgrinfo_appinfo_is_multiple()
3620 static int get_app_taskmanage(const char *appid)
3624 pkgmgrinfo_appinfo_h handle;
3625 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3626 if (ret != PMINFO_R_OK)
3628 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3629 if (ret != PMINFO_R_OK) {
3630 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3633 printf("app taskmanage: %d\n", taskmanage);
3634 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3639 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3642 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3643 * @brief This API gets the application 'taskmanage' value from the app ID
3645 * @par This API is for package-manager client application
3646 * @par Sync (or) Async : Synchronous API
3648 * @param[in] handle pointer to application info handle
3649 * @param[out] enabled pointer to hold package enabled value
3650 * @return 0 if success, error code(<0) if fail
3651 * @retval PMINFO_R_OK success
3652 * @retval PMINFO_R_EINVAL invalid argument
3653 * @retval PMINFO_R_ERROR internal error
3654 * @pre pkgmgrinfo_appinfo_get_appinfo()
3655 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3656 * @see pkgmgrinfo_appinfo_get_appid()
3657 * @see pkgmgrinfo_appinfo_is_multiple()
3659 static int get_app_enabled(const char *appid)
3663 pkgmgrinfo_appinfo_h handle;
3664 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3665 if (ret != PMINFO_R_OK)
3667 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3668 if (ret != PMINFO_R_OK) {
3669 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3672 printf("app enabled: %d\n", enabled);
3673 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3678 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3681 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3682 * @brief This API gets the application 'onboot' value from the app ID
3684 * @par This API is for package-manager client application
3685 * @par Sync (or) Async : Synchronous API
3687 * @param[in] handle pointer to application info handle
3688 * @param[out] onboot pointer to hold package onboot value
3689 * @return 0 if success, error code(<0) if fail
3690 * @retval PMINFO_R_OK success
3691 * @retval PMINFO_R_EINVAL invalid argument
3692 * @retval PMINFO_R_ERROR internal error
3693 * @pre pkgmgrinfo_appinfo_get_appinfo()
3694 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3695 * @see pkgmgrinfo_appinfo_get_appid()
3696 * @see pkgmgrinfo_appinfo_is_multiple()
3698 static int get_app_onboot(const char *appid)
3702 pkgmgrinfo_appinfo_h handle;
3703 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3704 if (ret != PMINFO_R_OK)
3706 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3707 if (ret != PMINFO_R_OK) {
3708 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3711 printf("app onboot: %d\n", onboot);
3712 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3717 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3720 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3721 * @brief This API gets the application 'autorestart' value from the app ID
3723 * @par This API is for package-manager client application
3724 * @par Sync (or) Async : Synchronous API
3726 * @param[in] handle pointer to application info handle
3727 * @param[out] autorestart pointer to hold package autorestart value
3728 * @return 0 if success, error code(<0) if fail
3729 * @retval PMINFO_R_OK success
3730 * @retval PMINFO_R_EINVAL invalid argument
3731 * @retval PMINFO_R_ERROR internal error
3732 * @pre pkgmgrinfo_appinfo_get_appinfo()
3733 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3734 * @see pkgmgrinfo_appinfo_get_appid()
3735 * @see pkgmgrinfo_appinfo_is_multiple()
3737 static int get_app_autorestart(const char *appid)
3741 pkgmgrinfo_appinfo_h handle;
3742 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3743 if (ret != PMINFO_R_OK)
3745 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3746 if (ret != PMINFO_R_OK) {
3747 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3750 printf("app autorestart: %d\n", autorestart);
3751 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3756 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3759 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3760 * @brief This API gets the value for given application is main app or not from handle
3762 * @par This API is for package-manager client application
3763 * @par Sync (or) Async : Synchronous API
3765 * @param[in] handle pointer to application info handle
3766 * @param[out] mainapp pointer to hold package mainapp is or not
3767 * @return 0 if success, error code(<0) if fail
3768 * @retval PMINFO_R_OK success
3769 * @retval PMINFO_R_EINVAL invalid argument
3770 * @retval PMINFO_R_ERROR internal error
3771 * @pre pkgmgrinfo_appinfo_get_appinfo()
3772 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3773 * @see pkgmgrinfo_appinfo_get_appid()
3774 * @see pkgmgrinfo_appinfo_is_multiple()
3776 static int get_app_mainapp(const char *appid)
3780 pkgmgrinfo_appinfo_h handle;
3781 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3782 if (ret != PMINFO_R_OK)
3784 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3785 if (ret != PMINFO_R_OK) {
3786 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3789 printf("mainapp: %d\n", mainapp);
3790 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3795 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3799 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3800 * @brief This API gets the value for given application is preload or not from handle
3802 * @par This API is for package-manager client application
3803 * @par Sync (or) Async : Synchronous API
3805 * @param[in] handle pointer to application info handle
3806 * @param[out] preload pointer to hold preload is or not
3807 * @return 0 if success, error code(<0) if fail
3808 * @retval PMINFO_R_OK success
3809 * @retval PMINFO_R_EINVAL invalid argument
3810 * @retval PMINFO_R_ERROR internal error
3811 * @pre pkgmgrinfo_appinfo_get_appinfo()
3812 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3813 * @see pkgmgrinfo_appinfo_get_appid()
3814 * @see pkgmgrinfo_appinfo_is_multiple()
3816 static int get_app_preload(const char *appid)
3820 pkgmgrinfo_appinfo_h handle = NULL;
3821 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3822 if (ret != PMINFO_R_OK)
3824 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3825 if (ret != PMINFO_R_OK) {
3826 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3829 printf("preload: %d\n", preload);
3830 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3835 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3838 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3839 * @brief This API gets the value for given application is submode or not from handle
3841 * @par This API is for package-manager client application
3842 * @par Sync (or) Async : Synchronous API
3844 * @param[in] handle pointer to application info handle
3845 * @param[out] submode pointer to hold submode is or not
3846 * @return 0 if success, error code(<0) if fail
3847 * @retval PMINFO_R_OK success
3848 * @retval PMINFO_R_EINVAL invalid argument
3849 * @retval PMINFO_R_ERROR internal error
3850 * @pre pkgmgrinfo_appinfo_get_appinfo()
3851 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3852 * @see pkgmgrinfo_appinfo_get_appid()
3853 * @see pkgmgrinfo_appinfo_is_multiple()
3855 static int get_app_submode(const char *appid)
3859 pkgmgrinfo_appinfo_h handle = NULL;
3860 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3861 if (ret != PMINFO_R_OK)
3863 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3864 if (ret != PMINFO_R_OK) {
3865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3868 printf("submode: %d\n", submode);
3869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3874 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3877 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3878 * @brief This API checks if the application has the given category
3880 * @par This API is for package-manager client application
3881 * @par Sync (or) Async : Synchronous API
3883 * @param[in] handle pointer to the application info handle
3884 * @param[in] category category
3885 * @param[out] exist value Gets whether the application has the given category
3886 * @return 0 if success, error code(<0) if fail
3887 * @retval PMINFO_R_OK success
3888 * @retval PMINFO_R_EINVAL invalid argument
3889 * @retval PMINFO_R_ERROR internal error
3891 static int is_category_exist(const char *appid, const char *category)
3894 pkgmgrinfo_appinfo_h handle;
3897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3898 if (ret != PMINFO_R_OK)
3901 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3902 if (ret != PMINFO_R_OK) {
3903 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3907 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3912 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3915 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3916 * @brief This API destroys the application information handle freeing up all the resources
3918 * @par This API is for package-manager client application
3919 * @par Sync (or) Async : Synchronous API
3921 * @param[in] handle pointer to the application info handle.
3922 * @return 0 if success, error code(<0) if fail
3923 * @retval PMINFO_R_OK success
3924 * @retval PMINFO_R_EINVAL invalid argument
3925 * @retval PMINFO_R_ERROR internal error
3926 * @pre pkgmgrinfo_appinfo_get_appinfo()
3928 * @see pkgmgrinfo_appinfo_get_pkgid()
3929 * @see pkgmgrinfo_appinfo_is_multiple()
3931 static int get_app_type(const char *appid)
3935 pkgmgrinfo_appinfo_h handle;
3936 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3937 if (ret != PMINFO_R_OK)
3939 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3940 if (ret != PMINFO_R_OK) {
3941 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3944 printf("apptype: %s\n", type);
3945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3950 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3953 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3954 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3955 The query will search the entire application information collected from the manifest file of all the installed packages
3957 * @par This API is for package-manager client application
3958 * @par Sync (or) Async : Synchronous API
3960 * @param[out] handle pointer to the application info filter handle.
3961 * @return 0 if success, error code(<0) if fail
3962 * @retval PMINFO_R_OK success
3963 * @retval PMINFO_R_EINVAL invalid argument
3964 * @retval PMINFO_R_ERROR internal error
3966 * @post pkgmgrinfo_appinfo_filter_destroy()
3967 * @see pkgmgrinfo_appinfo_filter_count()
3968 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3970 static int get_capp_count()
3974 pkgmgrinfo_appinfo_filter_h handle;
3975 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3976 if (ret != PMINFO_R_OK)
3978 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3979 if (ret != PMINFO_R_OK) {
3980 pkgmgrinfo_appinfo_filter_destroy(handle);
3983 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3984 if (ret != PMINFO_R_OK) {
3985 pkgmgrinfo_appinfo_filter_destroy(handle);
3988 printf("No of capp: %d\n", count);
3989 pkgmgrinfo_appinfo_filter_destroy(handle);
3994 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3997 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3998 * @brief This API destroys the application information filter handle freeing up all the resources
4000 * @par This API is for package-manager client application
4001 * @par Sync (or) Async : Synchronous API
4003 * @param[in] handle pointer to the application info filter handle.
4004 * @return 0 if success, error code(<0) if fail
4005 * @retval PMINFO_R_OK success
4006 * @retval PMINFO_R_EINVAL invalid argument
4007 * @retval PMINFO_R_ERROR internal error
4008 * @pre pkgmgrinfo_appinfo_filter_create()
4010 * @see pkgmgrinfo_appinfo_filter_count()
4011 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4013 static int get_capp_count()
4017 pkgmgrinfo_appinfo_filter_h handle;
4018 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4019 if (ret != PMINFO_R_OK)
4021 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4022 if (ret != PMINFO_R_OK) {
4023 pkgmgrinfo_appinfo_filter_destroy(handle);
4026 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4027 if (ret != PMINFO_R_OK) {
4028 pkgmgrinfo_appinfo_filter_destroy(handle);
4031 printf("No of capp: %d\n", count);
4032 pkgmgrinfo_appinfo_filter_destroy(handle);
4037 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4040 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4041 * @brief This API adds a boolean filter property to the filter handle
4043 * @par This API is for package-manager client application
4044 * @par Sync (or) Async : Synchronous API
4046 * @param[in] handle pointer to the application info filter handle.
4047 * @param[in] property boolean property name.
4048 * @param[in] value value corresponding to the property.
4049 * @return 0 if success, error code(<0) if fail
4050 * @retval PMINFO_R_OK success
4051 * @retval PMINFO_R_EINVAL invalid argument
4052 * @retval PMINFO_R_ERROR internal error
4053 * @pre pkgmgrinfo_appinfo_filter_create()
4054 * @post pkgmgrinfo_appinfo_filter_destroy()
4055 * @see pkgmgrinfo_appinfo_filter_count()
4056 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4058 static int get_taskmanageable_app_count()
4062 pkgmgrinfo_appinfo_filter_h handle;
4063 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4064 if (ret != PMINFO_R_OK)
4066 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4067 if (ret != PMINFO_R_OK) {
4068 pkgmgrinfo_appinfo_filter_destroy(handle);
4071 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4072 if (ret != PMINFO_R_OK) {
4073 pkgmgrinfo_appinfo_filter_destroy(handle);
4076 printf("No of taskmanageable apps: %d\n", count);
4077 pkgmgrinfo_appinfo_filter_destroy(handle);
4082 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4083 const char *property, const bool value);
4086 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4087 * @brief This API adds an integer filter property to the filter handle
4089 * @par This API is for package-manager client application
4090 * @par Sync (or) Async : Synchronous API
4092 * @param[in] handle pointer to the application info filter handle.
4093 * @param[in] property integer property name.
4094 * @param[in] value value corresponding to the property.
4095 * @return 0 if success, error code(<0) if fail
4096 * @retval PMINFO_R_OK success
4097 * @retval PMINFO_R_EINVAL invalid argument
4098 * @retval PMINFO_R_ERROR internal error
4099 * @pre pkgmgrinfo_appinfo_filter_create()
4100 * @post pkgmgrinfo_appinfo_filter_destroy()
4101 * @see pkgmgrinfo_appinfo_filter_count()
4102 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4104 static int get_taskmanageable_app_count()
4108 pkgmgrinfo_appinfo_filter_h handle;
4109 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4110 if (ret != PMINFO_R_OK)
4112 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4113 if (ret != PMINFO_R_OK) {
4114 pkgmgrinfo_appinfo_filter_destroy(handle);
4117 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4118 if (ret != PMINFO_R_OK) {
4119 pkgmgrinfo_appinfo_filter_destroy(handle);
4122 printf("No of apps: %d\n", count);
4123 pkgmgrinfo_appinfo_filter_destroy(handle);
4128 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4129 const char *property, const int value);
4132 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4133 * @brief This API adds a string filter property to the filter handle
4135 * @par This API is for package-manager client application
4136 * @par Sync (or) Async : Synchronous API
4138 * @param[in] handle pointer to the application info filter handle.
4139 * @param[in] property string property name.
4140 * @param[in] value value corresponding to the property.
4141 * @return 0 if success, error code(<0) if fail
4142 * @retval PMINFO_R_OK success
4143 * @retval PMINFO_R_EINVAL invalid argument
4144 * @retval PMINFO_R_ERROR internal error
4145 * @pre pkgmgrinfo_appinfo_filter_create()
4146 * @post pkgmgrinfo_appinfo_filter_destroy()
4147 * @see pkgmgrinfo_appinfo_filter_count()
4148 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4150 static int get_capp_count()
4154 pkgmgrinfo_appinfo_filter_h handle;
4155 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4156 if (ret != PMINFO_R_OK)
4158 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4159 if (ret != PMINFO_R_OK) {
4160 pkgmgrinfo_appinfo_filter_destroy(handle);
4163 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4164 if (ret != PMINFO_R_OK) {
4165 pkgmgrinfo_appinfo_filter_destroy(handle);
4168 printf("No of capp: %d\n", count);
4169 pkgmgrinfo_appinfo_filter_destroy(handle);
4174 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4175 const char *property, const char *value);
4178 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4179 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4181 * @par This API is for package-manager client application
4182 * @par Sync (or) Async : Synchronous API
4184 * @param[in] handle pointer to the application info filter handle.
4185 * @param[in] app_cb callback function.
4186 * @param[in] user_data user data to be passed to the callback function
4187 * @return 0 if success, error code(<0) if fail
4188 * @retval PMINFO_R_OK success
4189 * @retval PMINFO_R_EINVAL invalid argument
4190 * @retval PMINFO_R_ERROR internal error
4191 * @pre pkgmgrinfo_appinfo_filter_create()
4192 * @post pkgmgrinfo_appinfo_filter_destroy()
4193 * @see pkgmgrinfo_appinfo_filter_count()
4195 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4198 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4199 printf("appid : %s\n", appid);
4203 static int get_capp_list()
4206 pkgmgrinfo_appinfo_filter_h handle;
4207 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4208 if (ret != PMINFO_R_OK)
4210 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4211 if (ret != PMINFO_R_OK) {
4212 pkgmgrinfo_appinfo_filter_destroy(handle);
4215 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4216 if (ret != PMINFO_R_OK) {
4217 pkgmgrinfo_appinfo_filter_destroy(handle);
4220 pkgmgrinfo_appinfo_filter_destroy(handle);
4225 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4226 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4227 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4228 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4231 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4232 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4233 * @brief This API counts the application that satisfy the filter conditions
4235 * @par This API is for package-manager client application
4236 * @par Sync (or) Async : Synchronous API
4238 * @param[in] handle pointer to the application info filter handle.
4239 * @param[in] count pointer to store count value
4240 * @param[in] uid the addressee user id of the instruction
4241 * @return 0 if success, error code(<0) if fail
4242 * @retval PMINFO_R_OK success
4243 * @retval PMINFO_R_EINVAL invalid argument
4244 * @retval PMINFO_R_ERROR internal error
4245 * @pre pkgmgrinfo_appinfo_filter_create()
4246 * @post pkgmgrinfo_appinfo_filter_destroy()
4247 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4249 static int get_capp_count()
4253 pkgmgrinfo_appinfo_filter_h handle;
4254 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4255 if (ret != PMINFO_R_OK)
4257 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4258 if (ret != PMINFO_R_OK) {
4259 pkgmgrinfo_appinfo_filter_destroy(handle);
4262 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4263 if (ret != PMINFO_R_OK) {
4264 pkgmgrinfo_appinfo_filter_destroy(handle);
4267 printf("No of capp: %d\n", count);
4268 pkgmgrinfo_appinfo_filter_destroy(handle);
4273 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4274 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4276 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4277 * @brief This API creates the application's metadata information filter handle from db.
4279 * @par This API is for package-manager client application
4280 * @par Sync (or) Async : Synchronous API
4282 * @param[out] handle pointer to the application metadata info filter handle.
4283 * @return 0 if success, error code(<0) if fail
4284 * @retval PMINFO_R_OK success
4285 * @retval PMINFO_R_EINVAL invalid argument
4286 * @retval PMINFO_R_ERROR internal error
4288 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4289 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4291 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4294 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4295 printf("appid : %s\n", appid);
4299 static int get_app_list(const char *mkey, const char *mvalue)
4302 pkgmgrinfo_appinfo_metadata_filter_h handle;
4303 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4304 if (ret != PMINFO_R_OK)
4306 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4307 if (ret != PMINFO_R_OK) {
4308 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4311 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4312 if (ret != PMINFO_R_OK) {
4313 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4316 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4321 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4324 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4325 * @brief This API destroys the application's metadata information filter handle.
4327 * @par This API is for package-manager client application
4328 * @par Sync (or) Async : Synchronous API
4330 * @param[in] handle pointer to the application metadata info filter handle.
4331 * @return 0 if success, error code(<0) if fail
4332 * @retval PMINFO_R_OK success
4333 * @retval PMINFO_R_EINVAL invalid argument
4334 * @retval PMINFO_R_ERROR internal error
4335 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4337 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4339 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4342 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4343 printf("appid : %s\n", appid);
4347 static int get_app_list(const char *mkey, const char *mvalue)
4350 pkgmgrinfo_appinfo_metadata_filter_h handle;
4351 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4352 if (ret != PMINFO_R_OK)
4354 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4355 if (ret != PMINFO_R_OK) {
4356 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4359 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4360 if (ret != PMINFO_R_OK) {
4361 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4364 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4369 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4372 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4373 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4374 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4376 * @par This API is for package-manager client application
4377 * @par Sync (or) Async : Synchronous API
4379 * @param[in] handle pointer to the application metadata info filter handle.
4380 * @param[in] key pointer to metadata key
4381 * @param[in] value pointer to metadata value
4382 * @return 0 if success, error code(<0) if fail
4383 * @retval PMINFO_R_OK success
4384 * @retval PMINFO_R_EINVAL invalid argument
4385 * @retval PMINFO_R_ERROR internal error
4386 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4387 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4388 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4390 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4393 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4394 printf("appid : %s\n", appid);
4398 static int get_app_list(const char *mkey, const char *mvalue)
4401 pkgmgrinfo_appinfo_metadata_filter_h handle;
4402 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4403 if (ret != PMINFO_R_OK)
4405 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4406 if (ret != PMINFO_R_OK) {
4407 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4410 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4411 if (ret != PMINFO_R_OK) {
4412 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4415 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4420 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4421 const char *key, const char *value);
4424 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4425 * @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)
4426 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4427 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4428 * negative value, no more callbacks will be called and API will return.
4430 * @par This API is for package-manager client application
4431 * @par Sync (or) Async : Synchronous API
4433 * @param[in] handle pointer to the application metadata info filter handle.
4434 * @param[in] app_cb function pointer to callback
4435 * @param[in] user_data pointer to user data
4436 * @param[in] uid the addressee user id of the instruction
4437 * @return 0 if success, error code(<0) if fail
4438 * @retval PMINFO_R_OK success
4439 * @retval PMINFO_R_EINVAL invalid argument
4440 * @retval PMINFO_R_ERROR internal error
4441 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4442 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4444 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4447 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4448 printf("appid : %s\n", appid);
4452 static int get_app_list(const char *mkey, const char *mvalue)
4455 pkgmgrinfo_appinfo_metadata_filter_h handle;
4456 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4457 if (ret != PMINFO_R_OK)
4459 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4460 if (ret != PMINFO_R_OK) {
4461 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4464 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4465 if (ret != PMINFO_R_OK) {
4466 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4469 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4474 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4475 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4476 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4477 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4479 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4480 * @brief This API creates the package cert information handle to get data from db.
4482 * @par This API is for package-manager client application
4483 * @par Sync (or) Async : Synchronous API
4485 * @param[out] handle pointer to the package cert handle.
4486 * @return 0 if success, error code(<0) if fail
4487 * @retval PMINFO_R_OK success
4488 * @retval PMINFO_R_EINVAL invalid argument
4489 * @retval PMINFO_R_ERROR internal error
4491 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4492 * @see pkgmgrinfo_pkginfo_get_cert_value()
4493 * @see pkgmgrinfo_pkginfo_load_certinfo()
4495 static int get_cert_info(const char *pkgid)
4498 pkgmgrinfo_certinfo_h handle;
4499 char *auth_cert = NULL;
4500 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4501 if (ret != PMINFO_R_OK)
4503 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4504 if (ret != PMINFO_R_OK) {
4505 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4508 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4509 if (ret != PMINFO_R_OK) {
4510 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4513 printf("Author root certificate: %s\n", auth_root);
4514 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4519 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4522 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4523 * @brief This API loads the package cert information handle with data from db.
4525 * @par This API is for package-manager client application
4526 * @par Sync (or) Async : Synchronous API
4528 * @param[in] pkgid pointer to the package ID.
4529 * @param[in] handle pointer to the package cert handle.
4530 * @return 0 if success, error code(<0) if fail
4531 * @retval PMINFO_R_OK success
4532 * @retval PMINFO_R_EINVAL invalid argument
4533 * @retval PMINFO_R_ERROR internal error
4534 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4535 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4536 * @see pkgmgrinfo_pkginfo_get_cert_value()
4538 static int get_cert_info(const char *pkgid)
4541 pkgmgrinfo_certinfo_h handle;
4542 char *auth_cert = NULL;
4543 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4544 if (ret != PMINFO_R_OK)
4546 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4547 if (ret != PMINFO_R_OK) {
4548 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4551 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4552 if (ret != PMINFO_R_OK) {
4553 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4556 printf("Author root certificate: %s\n", auth_root);
4557 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4562 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4565 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4566 * @brief This API gets the package cert information from the handle
4568 * @par This API is for package-manager client application
4569 * @par Sync (or) Async : Synchronous API
4571 * @param[in] handle pointer to the package cert handle.
4572 * @param[in] cert_type certificate type
4573 * @param[out] cert_value pointer to hold certificate value
4574 * @return 0 if success, error code(<0) if fail
4575 * @retval PMINFO_R_OK success
4576 * @retval PMINFO_R_EINVAL invalid argument
4577 * @retval PMINFO_R_ERROR internal error
4578 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4579 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4580 * @see pkgmgrinfo_pkginfo_load_certinfo()
4582 static int get_cert_info(const char *pkgid)
4585 pkgmgrinfo_certinfo_h handle;
4586 char *auth_cert = NULL;
4587 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4588 if (ret != PMINFO_R_OK)
4590 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4591 if (ret != PMINFO_R_OK) {
4592 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4595 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4596 if (ret != PMINFO_R_OK) {
4597 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4600 printf("Author root certificate: %s\n", auth_root);
4601 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4606 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4609 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4610 * @brief This API destroys the package cert information handle freeing up all the resources
4612 * @par This API is for package-manager client application
4613 * @par Sync (or) Async : Synchronous API
4615 * @param[in] handle pointer to the package cert handle.
4616 * @return 0 if success, error code(<0) if fail
4617 * @retval PMINFO_R_OK success
4618 * @retval PMINFO_R_EINVAL invalid argument
4619 * @retval PMINFO_R_ERROR internal error
4620 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4622 * @see pkgmgrinfo_pkginfo_load_certinfo()
4624 static int get_cert_info(const char *pkgid)
4627 pkgmgrinfo_certinfo_h handle;
4628 char *auth_cert = NULL;
4629 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4630 if (ret != PMINFO_R_OK)
4632 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4633 if (ret != PMINFO_R_OK) {
4634 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4637 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4638 if (ret != PMINFO_R_OK) {
4639 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4642 printf("Author root certificate: %s\n", auth_root);
4643 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4648 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4651 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4652 * @brief This API deletes the package cert information from DB
4654 * @par This API is for package-manager client application
4655 * @par Sync (or) Async : Synchronous API
4657 * @param[in] pkgid pointer to the package ID.
4658 * @return 0 if success, error code(<0) if fail
4659 * @retval PMINFO_R_OK success
4660 * @retval PMINFO_R_EINVAL invalid argument
4661 * @retval PMINFO_R_ERROR internal error
4665 static int delete_cert_info(const char *pkgid)
4668 ret = pkgmgrinfo_delete_certinfo(pkgid);
4669 if (ret != PMINFO_R_OK)
4675 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4676 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4678 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4679 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4680 * @brief This API creates the package db information handle to set data in db.
4682 * @par This API is for package-manager client application
4683 * @par Sync (or) Async : Synchronous API
4685 * @param[in] pkgid pointer to the package ID.
4686 * @param[in] uid the addressee user id of the instruction
4687 * @param[out] handle pointer to the package db info handle.
4688 * @return 0 if success, error code(<0) if fail
4689 * @retval PMINFO_R_OK success
4690 * @retval PMINFO_R_EINVAL invalid argument
4691 * @retval PMINFO_R_ERROR internal error
4693 * @post pkgmgrinfo_destroy_pkgdbinfo()
4694 * @see pkgmgrinfo_save_pkgdbinfo()
4695 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4697 static int set_pkg_in_db(const char *pkgid)
4700 pkgmgrinfo_pkgdbinfo_h handle;
4701 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4702 if (ret != PMINFO_R_OK)
4704 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4705 if (ret != PMINFO_R_OK) {
4706 pkgmgrinfo_destroy_pkgdbinfo(handle);
4709 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4710 if (ret != PMINFO_R_OK) {
4711 pkgmgrinfo_destroy_pkgdbinfo(handle);
4714 pkgmgrinfo_destroy_pkgdbinfo(handle);
4719 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4720 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4723 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4724 * @brief This API sets the package type in db handle
4726 * @par This API is for package-manager client application
4727 * @par Sync (or) Async : Synchronous API
4729 * @param[in] handle pointer to the pkgdbinfo handle.
4730 * @param[in] type pointer to the package type.
4731 * @return 0 if success, error code(<0) if fail
4732 * @retval PMINFO_R_OK success
4733 * @retval PMINFO_R_EINVAL invalid argument
4734 * @retval PMINFO_R_ERROR internal error
4735 * @pre pkgmgrinfo_create_pkgdbinfo()
4736 * @post pkgmgrinfo_destroy_pkgdbinfo()
4737 * @see pkgmgrinfo_save_pkgdbinfo()
4738 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4740 static int set_pkg_type_in_db(const char *pkgid)
4743 pkgmgrinfo_pkgdbinfo_h handle;
4744 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4745 if (ret != PMINFO_R_OK)
4747 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4748 if (ret != PMINFO_R_OK) {
4749 pkgmgrinfo_destroy_pkgdbinfo(handle);
4752 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4753 if (ret != PMINFO_R_OK) {
4754 pkgmgrinfo_destroy_pkgdbinfo(handle);
4757 pkgmgrinfo_destroy_pkgdbinfo(handle);
4762 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4765 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4766 * @brief This API sets the package version in db handle
4768 * @par This API is for package-manager client application
4769 * @par Sync (or) Async : Synchronous API
4771 * @param[in] handle pointer to the pkgdbinfo handle.
4772 * @param[in] version pointer to the package version
4773 * @return 0 if success, error code(<0) if fail
4774 * @retval PMINFO_R_OK success
4775 * @retval PMINFO_R_EINVAL invalid argument
4776 * @retval PMINFO_R_ERROR internal error
4777 * @pre pkgmgrinfo_create_pkgdbinfo()
4778 * @post pkgmgrinfo_destroy_pkgdbinfo()
4779 * @see pkgmgrinfo_save_pkgdbinfo()
4780 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4782 static int set_pkg_version_in_db(const char *pkgid)
4785 pkgmgrinfo_pkgdbinfo_h handle;
4786 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4787 if (ret != PMINFO_R_OK)
4789 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4790 if (ret != PMINFO_R_OK) {
4791 pkgmgrinfo_destroy_pkgdbinfo(handle);
4794 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4795 if (ret != PMINFO_R_OK) {
4796 pkgmgrinfo_destroy_pkgdbinfo(handle);
4799 pkgmgrinfo_destroy_pkgdbinfo(handle);
4804 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4807 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4808 * @brief This API sets the package install location in db handle
4810 * @par This API is for package-manager client application
4811 * @par Sync (or) Async : Synchronous API
4813 * @param[in] handle pointer to the pkgdbinfo handle.
4814 * @param[in] location package install location
4815 * @return 0 if success, error code(<0) if fail
4816 * @retval PMINFO_R_OK success
4817 * @retval PMINFO_R_EINVAL invalid argument
4818 * @retval PMINFO_R_ERROR internal error
4819 * @pre pkgmgrinfo_create_pkgdbinfo()
4820 * @post pkgmgrinfo_destroy_pkgdbinfo()
4821 * @see pkgmgrinfo_save_pkgdbinfo()
4822 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4824 static int set_pkg_install_location_in_db(const char *pkgid)
4827 pkgmgrinfo_pkgdbinfo_h handle;
4828 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4829 if (ret != PMINFO_R_OK)
4831 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4832 if (ret != PMINFO_R_OK) {
4833 pkgmgrinfo_destroy_pkgdbinfo(handle);
4836 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4837 if (ret != PMINFO_R_OK) {
4838 pkgmgrinfo_destroy_pkgdbinfo(handle);
4841 pkgmgrinfo_destroy_pkgdbinfo(handle);
4846 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4849 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4850 * @brief This API sets the package size in db handle
4852 * @par This API is for package-manager client application
4853 * @par Sync (or) Async : Synchronous API
4855 * @param[in] handle pointer to the pkgdbinfo handle.
4856 * @param[in] size pointer to the package size
4857 * @return 0 if success, error code(<0) if fail
4858 * @retval PMINFO_R_OK success
4859 * @retval PMINFO_R_EINVAL invalid argument
4860 * @retval PMINFO_R_ERROR internal error
4861 * @pre pkgmgrinfo_create_pkgdbinfo()
4862 * @post pkgmgrinfo_destroy_pkgdbinfo()
4863 * @see pkgmgrinfo_save_pkgdbinfo()
4864 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4866 static int set_pkg_size_in_db(const char *pkgid)
4869 pkgmgrinfo_pkgdbinfo_h handle;
4870 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4871 if (ret != PMINFO_R_OK)
4873 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4874 if (ret != PMINFO_R_OK) {
4875 pkgmgrinfo_destroy_pkgdbinfo(handle);
4878 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4879 if (ret != PMINFO_R_OK) {
4880 pkgmgrinfo_destroy_pkgdbinfo(handle);
4883 pkgmgrinfo_destroy_pkgdbinfo(handle);
4888 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4891 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4892 * @brief This API sets the package label in db handle
4894 * @par This API is for package-manager client application
4895 * @par Sync (or) Async : Synchronous API
4897 * @param[in] handle pointer to the pkgdbinfo handle.
4898 * @param[in] label pointer to the package label
4899 * @param[in] locale pointer to the locale
4900 * @return 0 if success, error code(<0) if fail
4901 * @retval PMINFO_R_OK success
4902 * @retval PMINFO_R_EINVAL invalid argument
4903 * @retval PMINFO_R_ERROR internal error
4904 * @pre pkgmgrinfo_create_pkgdbinfo()
4905 * @post pkgmgrinfo_destroy_pkgdbinfo()
4906 * @see pkgmgrinfo_save_pkgdbinfo()
4907 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4909 static int set_pkg_label_in_db(const char *pkgid)
4912 pkgmgrinfo_pkgdbinfo_h handle;
4913 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4914 if (ret != PMINFO_R_OK)
4916 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4917 if (ret != PMINFO_R_OK) {
4918 pkgmgrinfo_destroy_pkgdbinfo(handle);
4921 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4922 if (ret != PMINFO_R_OK) {
4923 pkgmgrinfo_destroy_pkgdbinfo(handle);
4926 pkgmgrinfo_destroy_pkgdbinfo(handle);
4931 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4934 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4935 * @brief This API sets the package icon in db handle
4937 * @par This API is for package-manager client application
4938 * @par Sync (or) Async : Synchronous API
4940 * @param[in] handle pointer to the pkgdbinfo handle.
4941 * @param[in] icon pointer to the package icon
4942 * @param[in] locale pointer to the locale
4943 * @return 0 if success, error code(<0) if fail
4944 * @retval PMINFO_R_OK success
4945 * @retval PMINFO_R_EINVAL invalid argument
4946 * @retval PMINFO_R_ERROR internal error
4947 * @pre pkgmgrinfo_create_pkgdbinfo()
4948 * @post pkgmgrinfo_destroy_pkgdbinfo()
4949 * @see pkgmgrinfo_save_pkgdbinfo()
4950 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4952 static int set_pkg_icon_in_db(const char *pkgid)
4955 pkgmgrinfo_pkgdbinfo_h handle;
4956 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4957 if (ret != PMINFO_R_OK)
4959 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4960 if (ret != PMINFO_R_OK) {
4961 pkgmgrinfo_destroy_pkgdbinfo(handle);
4964 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4965 if (ret != PMINFO_R_OK) {
4966 pkgmgrinfo_destroy_pkgdbinfo(handle);
4969 pkgmgrinfo_destroy_pkgdbinfo(handle);
4974 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4977 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4978 * @brief This API sets the package description in db handle
4980 * @par This API is for package-manager client application
4981 * @par Sync (or) Async : Synchronous API
4983 * @param[in] handle pointer to the pkgdbinfo handle.
4984 * @param[in] description pointer to the package description
4985 * @param[in] locale pointer to the locale
4986 * @return 0 if success, error code(<0) if fail
4987 * @retval PMINFO_R_OK success
4988 * @retval PMINFO_R_EINVAL invalid argument
4989 * @retval PMINFO_R_ERROR internal error
4990 * @pre pkgmgrinfo_create_pkgdbinfo()
4991 * @post pkgmgrinfo_destroy_pkgdbinfo()
4992 * @see pkgmgrinfo_save_pkgdbinfo()
4993 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4995 static int set_pkg_description_in_db(const char *pkgid)
4998 pkgmgrinfo_pkgdbinfo_h handle;
4999 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5000 if (ret != PMINFO_R_OK)
5002 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5003 if (ret != PMINFO_R_OK) {
5004 pkgmgrinfo_destroy_pkgdbinfo(handle);
5007 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5008 if (ret != PMINFO_R_OK) {
5009 pkgmgrinfo_destroy_pkgdbinfo(handle);
5012 pkgmgrinfo_destroy_pkgdbinfo(handle);
5017 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5020 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5021 const char *author_email, const char *author_href, const char *locale)
5022 * @brief This API sets the package author info in db handle
5024 * @par This API is for package-manager client application
5025 * @par Sync (or) Async : Synchronous API
5027 * @param[in] handle pointer to the pkgdbinfo handle.
5028 * @param[in] author_name pointer to the package author name
5029 * @param[in] author_email pointer to the package author email
5030 * @param[in] author_href pointer to the package author href
5031 * @param[in] locale pointer to the locale
5032 * @return 0 if success, error code(<0) if fail
5033 * @retval PMINFO_R_OK success
5034 * @retval PMINFO_R_EINVAL invalid argument
5035 * @retval PMINFO_R_ERROR internal error
5036 * @pre pkgmgrinfo_create_pkgdbinfo()
5037 * @post pkgmgrinfo_destroy_pkgdbinfo()
5038 * @see pkgmgrinfo_save_pkgdbinfo()
5039 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5041 static int set_pkg_author_in_db(const char *pkgid)
5044 pkgmgrinfo_pkgdbinfo_h handle;
5045 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5046 if (ret != PMINFO_R_OK)
5048 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5049 if (ret != PMINFO_R_OK) {
5050 pkgmgrinfo_destroy_pkgdbinfo(handle);
5053 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5054 if (ret != PMINFO_R_OK) {
5055 pkgmgrinfo_destroy_pkgdbinfo(handle);
5058 pkgmgrinfo_destroy_pkgdbinfo(handle);
5063 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5064 const char *author_email, const char *author_href, const char *locale);
5067 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5068 * @brief This API sets the package 'removable' value in db handle
5070 * @par This API is for package-manager client application
5071 * @par Sync (or) Async : Synchronous API
5073 * @param[in] handle pointer to the pkgdbinfo handle.
5074 * @param[in] removable package removable value
5075 * @return 0 if success, error code(<0) if fail
5076 * @retval PMINFO_R_OK success
5077 * @retval PMINFO_R_EINVAL invalid argument
5078 * @retval PMINFO_R_ERROR internal error
5079 * @pre pkgmgrinfo_create_pkgdbinfo()
5080 * @post pkgmgrinfo_destroy_pkgdbinfo()
5081 * @see pkgmgrinfo_save_pkgdbinfo()
5082 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5084 static int set_pkg_removable_in_db(const char *pkgid)
5087 pkgmgrinfo_pkgdbinfo_h handle;
5088 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5089 if (ret != PMINFO_R_OK)
5091 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5092 if (ret != PMINFO_R_OK) {
5093 pkgmgrinfo_destroy_pkgdbinfo(handle);
5096 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5097 if (ret != PMINFO_R_OK) {
5098 pkgmgrinfo_destroy_pkgdbinfo(handle);
5101 pkgmgrinfo_destroy_pkgdbinfo(handle);
5106 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5109 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5110 * @brief This API sets the package 'preload' value in db handle
5112 * @par This API is for package-manager client application
5113 * @par Sync (or) Async : Synchronous API
5115 * @param[in] handle pointer to the pkgdbinfo handle.
5116 * @param[in] preload package preload value
5117 * @return 0 if success, error code(<0) if fail
5118 * @retval PMINFO_R_OK success
5119 * @retval PMINFO_R_EINVAL invalid argument
5120 * @retval PMINFO_R_ERROR internal error
5121 * @pre pkgmgrinfo_create_pkgdbinfo()
5122 * @post pkgmgrinfo_destroy_pkgdbinfo()
5123 * @see pkgmgrinfo_save_pkgdbinfo()
5124 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5126 static int set_pkg_preload_in_db(const char *pkgid)
5129 pkgmgrinfo_pkgdbinfo_h handle;
5130 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5131 if (ret != PMINFO_R_OK)
5133 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5134 if (ret != PMINFO_R_OK) {
5135 pkgmgrinfo_destroy_pkgdbinfo(handle);
5138 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5139 if (ret != PMINFO_R_OK) {
5140 pkgmgrinfo_destroy_pkgdbinfo(handle);
5143 pkgmgrinfo_destroy_pkgdbinfo(handle);
5148 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5151 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5152 * @brief This API sets the package 'installed_storage' value in db handle
5154 * @par This API is for package-manager client application
5155 * @par Sync (or) Async : Synchronous API
5157 * @param[in] handle pointer to the pkgdbinfo handle.
5158 * @param[in] location installed_storage value
5159 * @return 0 if success, error code(<0) if fail
5160 * @retval PMINFO_R_OK success
5161 * @retval PMINFO_R_EINVAL invalid argument
5162 * @retval PMINFO_R_ERROR internal error
5163 * @pre pkgmgrinfo_create_pkgdbinfo()
5164 * @post pkgmgrinfo_destroy_pkgdbinfo()
5165 * @see pkgmgrinfo_save_pkgdbinfo()
5167 static int set_pkg_installed_storage_in_db(const char *pkgid)
5170 pkgmgrinfo_pkgdbinfo_h handle;
5171 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5172 if (ret != PMINFO_R_OK)
5174 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5175 if (ret != PMINFO_R_OK) {
5176 pkgmgrinfo_destroy_pkgdbinfo(handle);
5179 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5180 if (ret != PMINFO_R_OK) {
5181 pkgmgrinfo_destroy_pkgdbinfo(handle);
5184 pkgmgrinfo_destroy_pkgdbinfo(handle);
5189 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5192 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5193 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5194 * @brief This API saves all the information from the handle to the DB.
5196 * @par This API is for package-manager client application
5197 * @par Sync (or) Async : Synchronous API
5199 * @param[in] handle pointer to the package db info handle.
5200 * @param[in] uid the addressee user id of the instruction
5201 * @return 0 if success, error code(<0) if fail
5202 * @retval PMINFO_R_OK success
5203 * @retval PMINFO_R_EINVAL invalid argument
5204 * @retval PMINFO_R_ERROR internal error
5205 * @pre pkgmgrinfo_create_pkgdbinfo()
5206 * @post pkgmgrinfo_destroy_pkgdbinfo()
5207 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5209 static int set_pkg_in_db(const char *pkgid)
5212 pkgmgrinfo_pkgdbinfo_h handle;
5213 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5214 if (ret != PMINFO_R_OK)
5216 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5217 if (ret != PMINFO_R_OK) {
5218 pkgmgrinfo_destroy_pkgdbinfo(handle);
5221 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5222 if (ret != PMINFO_R_OK) {
5223 pkgmgrinfo_destroy_pkgdbinfo(handle);
5226 pkgmgrinfo_destroy_pkgdbinfo(handle);
5231 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5232 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5234 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5235 * @brief This API destroys the package db information handle freeing up all the resources
5237 * @par This API is for package-manager client application
5238 * @par Sync (or) Async : Synchronous API
5240 * @param[in] handle pointer to the package db info handle.
5241 * @return 0 if success, error code(<0) if fail
5242 * @retval PMINFO_R_OK success
5243 * @retval PMINFO_R_EINVAL invalid argument
5244 * @retval PMINFO_R_ERROR internal error
5245 * @pre pkgmgrinfo_create_pkgdbinfo()
5247 * @see pkgmgrinfo_save_pkgdbinfo()
5248 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5250 static int set_pkg_in_db(const char *pkgid)
5253 pkgmgrinfo_pkgdbinfo_h handle;
5254 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5255 if (ret != PMINFO_R_OK)
5257 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5258 if (ret != PMINFO_R_OK) {
5259 pkgmgrinfo_destroy_pkgdbinfo(handle);
5262 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5263 if (ret != PMINFO_R_OK) {
5264 pkgmgrinfo_destroy_pkgdbinfo(handle);
5267 pkgmgrinfo_destroy_pkgdbinfo(handle);
5272 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5276 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5277 * @brief This API creates the package cert information handle to set data in db.
5279 * @par This API is for package-manager client application
5280 * @par Sync (or) Async : Synchronous API
5282 * @param[out] handle pointer to the package cert handle.
5283 * @return 0 if success, error code(<0) if fail
5284 * @retval PMINFO_R_OK success
5285 * @retval PMINFO_R_EINVAL invalid argument
5286 * @retval PMINFO_R_ERROR internal error
5288 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5289 * @see pkgmgrinfo_set_cert_value()
5290 * @see pkgmgrinfo_save_certinfo()
5292 static int set_cert_in_db(const char *pkgid)
5295 pkgmgrinfo_instcertinfo_h handle;
5296 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5297 if (ret != PMINFO_R_OK)
5299 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5300 if (ret != PMINFO_R_OK) {
5301 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5304 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5305 if (ret != PMINFO_R_OK) {
5306 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5309 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5314 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5317 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5318 * @brief This API sets the package cert information in the handle.
5320 * @par This API is for package-manager client application
5321 * @par Sync (or) Async : Synchronous API
5323 * @param[in] handle pointer to the package cert handle.
5324 * @param[in] cert_type certificate type.
5325 * @param[in] cert_value certificate value.
5326 * @return 0 if success, error code(<0) if fail
5327 * @retval PMINFO_R_OK success
5328 * @retval PMINFO_R_EINVAL invalid argument
5329 * @retval PMINFO_R_ERROR internal error
5330 * @pre pkgmgrinfo_create_certinfo_set_handle()
5331 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5332 * @see pkgmgrinfo_save_certinfo()
5334 static int set_cert_in_db(const char *pkgid)
5337 pkgmgrinfo_instcertinfo_h handle;
5338 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5339 if (ret != PMINFO_R_OK)
5341 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5342 if (ret != PMINFO_R_OK) {
5343 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5346 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5347 if (ret != PMINFO_R_OK) {
5348 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5351 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5356 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5359 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5360 * @brief This API saves the package cert information in the DB.
5362 * @par This API is for package-manager client application
5363 * @par Sync (or) Async : Synchronous API
5365 * @param[in] pkgid pointer to the package ID.
5366 * @param[in] handle pointer to the package cert handle.
5367 * @return 0 if success, error code(<0) if fail
5368 * @retval PMINFO_R_OK success
5369 * @retval PMINFO_R_EINVAL invalid argument
5370 * @retval PMINFO_R_ERROR internal error
5371 * @pre pkgmgrinfo_create_certinfo_set_handle()
5372 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5373 * @see pkgmgrinfo_save_certinfo()
5375 static int set_cert_in_db(const char *pkgid)
5378 pkgmgrinfo_instcertinfo_h handle;
5379 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5380 if (ret != PMINFO_R_OK)
5382 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5383 if (ret != PMINFO_R_OK) {
5384 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5387 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5388 if (ret != PMINFO_R_OK) {
5389 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5392 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5397 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5400 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5401 * @brief This API destroys the package cert information handle freeing up all the resources.
5403 * @par This API is for package-manager client application
5404 * @par Sync (or) Async : Synchronous API
5406 * @param[in] handle pointer to the package cert handle.
5407 * @return 0 if success, error code(<0) if fail
5408 * @retval PMINFO_R_OK success
5409 * @retval PMINFO_R_EINVAL invalid argument
5410 * @retval PMINFO_R_ERROR internal error
5411 * @pre pkgmgrinfo_create_certinfo_set_handle()
5413 * @see pkgmgrinfo_save_certinfo()
5415 static int set_cert_in_db(const char *pkgid)
5418 pkgmgrinfo_instcertinfo_h handle;
5419 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5420 if (ret != PMINFO_R_OK)
5422 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5423 if (ret != PMINFO_R_OK) {
5424 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5427 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5428 if (ret != PMINFO_R_OK) {
5429 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5432 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5437 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5440 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5441 * @brief This API gets the datacontrol info
5443 * @par This API is for package-manager client application
5444 * @par Sync (or) Async : Synchronous API
5446 * @param[in] providerid pointer to the providerid of dataconltrol.
5447 * @param[in] type pointer to the type of dataconltrol.
5448 * @param[out] appid pointer to hold appid, need to free after using
5449 * @param[out] access pointer to hold access, need to free after using
5450 * @return 0 if success, error code(<0) if fail
5451 * @retval PMINFO_R_OK success
5452 * @retval PMINFO_R_EINVAL invalid argument
5453 * @retval PMINFO_R_ERROR internal error
5456 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5459 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5460 * @brief This API gets the application 'guest mode visibility' value from the DB
5462 * @par This API is for package-manager client application
5463 * @par Sync (or) Async : Synchronous API
5465 * @param[in] handle pointer to application info handle
5466 * @param[out] status pointer to hold app guest mode visibility value
5467 * @return 0 if success, error code(<0) if fail
5468 * @retval PMINFO_R_OK success
5469 * @retval PMINFO_R_EINVAL invalid argument
5470 * @retval PMINFO_R_ERROR internal error
5471 * @pre pkgmgrinfo_appinfo_get_appinfo()
5472 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5473 * @see pkgmgrinfo_appinfo_get_appid()
5474 * @see pkgmgrinfo_appinfo_is_multiple()
5476 static int get_app_guestmode_visibility(const char *appid)
5480 pkgmgrinfo_appinfo_h handle;
5481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5482 if (ret != PMINFO_R_OK)
5484 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5485 if (ret != PMINFO_R_OK) {
5486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5489 printf("app guest mode visibility: %d\n", status);
5490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5495 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5498 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5499 * @brief This API sets the application 'guest mode visibility' value in the DB
5501 * @par This API is for package-manager client application
5502 * @par Sync (or) Async : Synchronous API
5504 * @param[in] handle pointer to application info handle
5505 * @param[out] status app guest mode visibility value
5506 * @return 0 if success, error code(<0) if fail
5507 * @retval PMINFO_R_OK success
5508 * @retval PMINFO_R_EINVAL invalid argument
5509 * @retval PMINFO_R_ERROR internal error
5510 * @pre pkgmgrinfo_appinfo_get_appinfo()
5511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5512 * @see pkgmgrinfo_appinfo_get_appid()
5513 * @see pkgmgrinfo_appinfo_is_multiple()
5515 static int set_app_guestmode_visibility(const char *appid, bool value)
5518 pkgmgrinfo_appinfo_h handle;
5519 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5520 if (ret != PMINFO_R_OK)
5522 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5523 if (ret != PMINFO_R_OK) {
5524 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5532 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5533 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5535 * @pkgmgrinfo client API
5539 * @brief listening status type in pkgmgrinfo.
5541 #define PMINFO_CLIENT_STATUS_ALL 0x00
5542 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5543 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5544 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5545 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5546 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5547 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5550 * @brief type definition.
5552 typedef void pkgmgrinfo_client;
5553 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5554 const char *pkgid, const char *key,
5555 const char *val, const void *pmsg, void *data);
5561 }pkgmgrinfo_client_type;
5564 * @brief This APIs provides pkgmgrinfo client listener
5566 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5567 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5568 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5569 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5570 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5573 int pkgmgrinfo_appinfo_get_event_launch_list(GList **es_info);
5574 int pkgmgrinfo_appinfo_get_usr_event_launch_list(GList **es_info, uid_t uid);
5575 int pkgmgrinfo_appinfo_get_event_launch_list_by_appid(const char *appid, GList **es_info);
5576 int pkgmgrinfo_appinfo_get_usr_event_launch_list_by_appid(const char *appid, GList **es_info, uid_t uid);
5580 * @pkgmgrinfo client API end
5588 #endif /* __PKG_INFO_H__ */