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_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1166 * @brief This API gets the launch mode 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] mode pointer to hold launch mode 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_launch_mode(const char *pkgid)
1185 char *launch_mode = NULL;
1186 pkgmgrinfo_pkginfo_h handle;
1187 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1188 if (ret != PMINFO_R_OK)
1190 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1191 if (ret != PMINFO_R_OK) {
1192 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1195 printf("launch mode: %s\n", mode);
1196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1201 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1204 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1205 * @brief This API gets the store client 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] storeclientid pointer to hold store client 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_storeclientid(const char *pkgid)
1224 char *storeclientid = 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_storeclientid(handle, &storeclientid);
1230 if (ret != PMINFO_R_OK) {
1231 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1234 printf(store client id: %s\n", storeclientid);
1235 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1240 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1243 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1244 * @brief This API gets the main app id 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] mainappid pointer to hold main app id 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_mainappid(const char *pkgid)
1263 char *mainappid = 0;
1264 pkgmgrinfo_pkginfo_h handle;
1265 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1266 if (ret != PMINFO_R_OK)
1268 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1269 if (ret != PMINFO_R_OK) {
1270 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1273 printf(main app id: %s\n", mainappid);
1274 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1279 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1282 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1283 * @brief This API gets the url of package from the package ID
1285 * @par This API is for package-manager client application
1286 * @par Sync (or) Async : Synchronous API
1288 * @param[in] handle pointer to package info handle
1289 * @param[out] url pointer to hold url 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
1294 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1295 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1296 * @see pkgmgrinfo_pkginfo_get_pkgid()
1297 * @see pkgmgrinfo_pkginfo_is_removable()
1299 static int get_pkg_url(const char *pkgid)
1303 pkgmgrinfo_pkginfo_h handle;
1304 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1305 if (ret != PMINFO_R_OK)
1307 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1308 if (ret != PMINFO_R_OK) {
1309 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1312 printf("url : %s\n", url);
1313 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1318 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1322 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1323 * @brief This API gets the root path of package
1325 * @par Sync (or) Async : Synchronous API
1327 * @param[in] handle pointer to package info handle
1328 * @param[out] path pointer to hold root path of package
1329 * @return 0 if success, error code(<0) if fail
1330 * @retval PMINFO_R_OK success
1331 * @retval PMINFO_R_EINVAL invalid argument
1332 * @retval PMINFO_R_ERROR internal error
1334 static int get_root_path(const char *pkgid)
1338 pkgmgrinfo_pkginfo_h handle;
1339 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1340 if (ret != PMINFO_R_OK)
1343 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1344 if (ret != PMINFO_R_OK) {
1345 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1348 printf("path : %s\n", path);
1349 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1355 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1359 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1360 * @brief This API gets the csc path of package
1362 * @par Sync (or) Async : Synchronous API
1364 * @param[in] handle pointer to package info handle
1365 * @param[out] path pointer to hold csc path of package
1366 * @return 0 if success, error code(<0) if fail
1367 * @retval PMINFO_R_OK success
1368 * @retval PMINFO_R_EINVAL invalid argument
1369 * @retval PMINFO_R_ERROR internal error
1371 static int get_csc_path(const char *pkgid)
1375 pkgmgrinfo_pkginfo_h handle;
1376 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1377 if (ret != PMINFO_R_OK)
1380 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1381 if (ret != PMINFO_R_OK) {
1382 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1385 printf("path : %s\n", path);
1386 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1392 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1395 * @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)
1396 * @brief This API compare the cert information from given package id
1398 * @par This API is for package-manager client application
1399 * @par Sync (or) Async : Synchronous API
1401 * @param[in] lhs_package_id pointer to first package ID
1402 * @param[in] rhs_package_id pointer to second package ID
1403 * @param[out] compare_result pointer to the compare result.
1404 * @return 0 if success, error code(<0) if fail
1405 * @retval PMINFO_R_OK success
1406 * @retval PMINFO_R_EINVAL invalid argument
1407 * @retval PMINFO_R_ERROR internal error
1409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1410 * @see pkgmgrinfo_pkginfo_get_pkgid()
1411 * @see pkgmgrinfo_pkginfo_is_removable()
1413 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1416 pkgmgrinfo_cert_compare_result_type_e result;
1418 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1419 if (ret != PMINFO_R_OK) {
1422 printf("result: %d\n", result);
1427 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);
1428 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);
1430 * @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)
1431 * @brief This API compare the cert information from given app id
1433 * @par This API is for package-manager client application
1434 * @par Sync (or) Async : Synchronous API
1436 * @param[in] lhs_app_id pointer to first app ID
1437 * @param[in] rhs_app_id pointer to second app ID
1438 * @param[out] compare_result pointer to the compare result.
1439 * @return 0 if success, error code(<0) if fail
1440 * @retval PMINFO_R_OK success
1441 * @retval PMINFO_R_EINVAL invalid argument
1442 * @retval PMINFO_R_ERROR internal error
1444 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1445 * @see pkgmgrinfo_pkginfo_get_pkgid()
1446 * @see pkgmgrinfo_pkginfo_is_removable()
1448 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1451 pkgmgrinfo_cert_compare_result_type_e result;
1453 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1454 if (ret != PMINFO_R_OK) {
1457 printf("result: %d\n", result);
1462 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);
1463 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);
1465 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1466 * @brief This API gets the package 'removable' value 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] removable pointer to hold package removable value
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()
1480 * @see pkgmgrinfo_pkginfo_is_readonly()
1482 static int get_pkg_removable(const char *pkgid)
1486 pkgmgrinfo_pkginfo_h handle;
1487 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1488 if (ret != PMINFO_R_OK)
1490 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1491 if (ret != PMINFO_R_OK) {
1492 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1495 printf("pkg removable: %d\n", removable);
1496 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1501 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1504 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1505 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1507 * @par This API is for package-manager client application
1508 * @par Sync (or) Async : Synchronous API
1510 * @param[in] handle pointer to package info handle
1511 * @param[out] movable pointer to hold package movable state
1512 * @return 0 if success, error code(<0) if fail
1513 * @retval PMINFO_R_OK success
1514 * @retval PMINFO_R_EINVAL invalid argument
1515 * @retval PMINFO_R_ERROR internal error
1516 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1517 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1518 * @see pkgmgrinfo_pkginfo_get_pkgid()
1520 static int get_pkg_movable(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_movable(handle, &movable);
1529 if (ret != PMINFO_R_OK) {
1530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1533 printf("pkg movable: %d\n", movable);
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1542 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1543 * @brief This API gets the package 'preload' value from the package ID
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] preload pointer to hold package preload value
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_preload(const char *pkgid)
1563 pkgmgrinfo_pkginfo_h handle;
1564 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1565 if (ret != PMINFO_R_OK)
1567 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1568 if (ret != PMINFO_R_OK) {
1569 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1572 printf("pkg preload: %d\n", preload);
1573 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1578 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1581 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1582 * @brief This API gets the value for given handle is system or not
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] system pointer to hold system is or not
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_readonly()
1598 static int get_pkg_system(const char *pkgid)
1601 bool system = false;
1602 pkgmgrinfo_pkginfo_h handle = NULL;
1603 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1604 if (ret != PMINFO_R_OK)
1606 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1607 if (ret != PMINFO_R_OK) {
1608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1611 printf("pkg system: %d\n", system);
1612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1617 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1620 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1621 * @brief This API gets the package 'readonly' value from the package ID
1623 * @par This API is for package-manager client application
1624 * @par Sync (or) Async : Synchronous API
1626 * @param[in] handle pointer to package info handle
1627 * @param[out] readonly pointer to hold package readonly value
1628 * @return 0 if success, error code(<0) if fail
1629 * @retval PMINFO_R_OK success
1630 * @retval PMINFO_R_EINVAL invalid argument
1631 * @retval PMINFO_R_ERROR internal error
1632 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1633 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1634 * @see pkgmgrinfo_pkginfo_get_pkgid()
1635 * @see pkgmgrinfo_pkginfo_is_removable()
1637 static int get_pkg_readonly(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_readonly(handle, &readonly);
1646 if (ret != PMINFO_R_OK) {
1647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 printf("pkg readonly: %d\n", readonly);
1651 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1656 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1660 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1661 * @brief This API gets the package 'upate' value from the package ID
1663 * @par This API is for package-manager client application
1664 * @par Sync (or) Async : Synchronous API
1666 * @param[in] handle pointer to package info handle
1667 * @param[out] update pointer to hold package update value
1668 * @return 0 if success, error code(<0) if fail
1669 * @retval PMINFO_R_OK success
1670 * @retval PMINFO_R_EINVAL invalid argument
1671 * @retval PMINFO_R_ERROR internal error
1672 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1673 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1674 * @see pkgmgrinfo_pkginfo_get_pkgid()
1676 static int get_pkg_update(const char *pkgid)
1680 pkgmgrinfo_pkginfo_h handle;
1681 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1682 if (ret != PMINFO_R_OK)
1684 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1685 if (ret != PMINFO_R_OK) {
1686 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1689 printf("pkg update: %d\n", update);
1690 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1695 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1699 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1700 * @brief This API gets the package 'uid' value from the view table of user database
1702 * @par This API is for package-manager client application
1703 * @par Sync (or) Async : Synchronous API
1705 * @param[in] uid uid of the user to determine the database
1706 * @param[in] pkgid id of the current package
1707 * @return 1 if it a global package, 0 else
1710 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1714 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1715 * @brief This API gets the package 'accessible' value from the package ID
1717 * @par This API is for package-manager client application
1718 * @par Sync (or) Async : Synchronous API
1720 * @param[in] handle pointer to package info handle
1721 * @param[out] accessible pointer to hold package accessible value
1722 * @return 0 if success, error code(<0) if fail
1723 * @retval PMINFO_R_OK success
1724 * @retval PMINFO_R_EINVAL invalid argument
1725 * @retval PMINFO_R_ERROR internal error
1726 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1727 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1728 * @see pkgmgrinfo_pkginfo_get_pkgid()
1729 * @see pkgmgrinfo_pkginfo_is_readonly()
1731 static int get_pkg_accessible(const char *pkgid)
1735 pkgmgrinfo_pkginfo_h handle;
1736 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1737 if (ret != PMINFO_R_OK)
1739 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1740 if (ret != PMINFO_R_OK) {
1741 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1744 printf("pkg accessible: %d\n", accessible);
1745 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1750 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1753 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1754 * @brief This API destroys the package information handle freeing up all the resources
1756 * @par This API is for package-manager client application
1757 * @par Sync (or) Async : Synchronous API
1759 * @param[in] handle pointer to the package info 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
1764 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1766 * @see pkgmgrinfo_pkginfo_get_pkgid()
1767 * @see pkgmgrinfo_pkginfo_is_removable()
1769 static int get_pkg_type(const char *pkgid)
1773 pkgmgrinfo_pkginfo_h handle;
1774 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1775 if (ret != PMINFO_R_OK)
1777 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1778 if (ret != PMINFO_R_OK) {
1779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1782 printf("pkgtype: %s\n", type);
1783 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1788 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1791 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1792 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1793 The query will search the entire package information collected from the manifest file of all the installed packages
1795 * @par This API is for package-manager client application
1796 * @par Sync (or) Async : Synchronous API
1798 * @param[out] handle pointer to the package info filter handle.
1799 * @return 0 if success, error code(<0) if fail
1800 * @retval PMINFO_R_OK success
1801 * @retval PMINFO_R_EINVAL invalid argument
1802 * @retval PMINFO_R_ERROR internal error
1804 * @post pkgmgrinfo_pkginfo_filter_destroy()
1805 * @see pkgmgrinfo_pkginfo_filter_count()
1806 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1808 static int get_rpm_pkg_count()
1812 pkgmgrinfo_pkginfo_filter_h handle;
1813 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1814 if (ret != PMINFO_R_OK)
1816 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1817 if (ret != PMINFO_R_OK) {
1818 pkgmgrinfo_pkginfo_filter_destroy(handle);
1821 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1822 if (ret != PMINFO_R_OK) {
1823 pkgmgrinfo_pkginfo_filter_destroy(handle);
1826 printf("No of rpm pkgs: %d\n", count);
1827 pkgmgrinfo_pkginfo_filter_destroy(handle);
1832 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1835 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1836 * @brief This API destroys the package information filter handle freeing up all the resources
1838 * @par This API is for package-manager client application
1839 * @par Sync (or) Async : Synchronous API
1841 * @param[in] handle pointer to the package info filter handle.
1842 * @return 0 if success, error code(<0) if fail
1843 * @retval PMINFO_R_OK success
1844 * @retval PMINFO_R_EINVAL invalid argument
1845 * @retval PMINFO_R_ERROR internal error
1846 * @pre pkgmgrinfo_pkginfo_filter_create()
1848 * @see pkgmgrinfo_pkginfo_filter_count()
1849 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1851 static int get_rpm_pkg_count()
1855 pkgmgrinfo_pkginfo_filter_h handle;
1856 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1857 if (ret != PMINFO_R_OK)
1859 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1860 if (ret != PMINFO_R_OK) {
1861 pkgmgrinfo_pkginfo_filter_destroy(handle);
1864 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1865 if (ret != PMINFO_R_OK) {
1866 pkgmgrinfo_pkginfo_filter_destroy(handle);
1869 printf("No of rpm pkgs: %d\n", count);
1870 pkgmgrinfo_pkginfo_filter_destroy(handle);
1875 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1878 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1879 * @brief This API adds a boolean filter property to the filter handle
1881 * @par This API is for package-manager client application
1882 * @par Sync (or) Async : Synchronous API
1884 * @param[in] handle pointer to the package info filter handle.
1885 * @param[in] property boolean property name.
1886 * @param[in] value value corresponding to the property.
1887 * @return 0 if success, error code(<0) if fail
1888 * @retval PMINFO_R_OK success
1889 * @retval PMINFO_R_EINVAL invalid argument
1890 * @retval PMINFO_R_ERROR internal error
1891 * @pre pkgmgrinfo_pkginfo_filter_create()
1892 * @post pkgmgrinfo_pkginfo_filter_destroy()
1893 * @see pkgmgrinfo_pkginfo_filter_count()
1894 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1896 static int get_preload_pkg_count()
1900 pkgmgrinfo_pkginfo_filter_h handle;
1901 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1902 if (ret != PMINFO_R_OK)
1904 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1905 if (ret != PMINFO_R_OK) {
1906 pkgmgrinfo_pkginfo_filter_destroy(handle);
1909 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1910 if (ret != PMINFO_R_OK) {
1911 pkgmgrinfo_pkginfo_filter_destroy(handle);
1914 printf("No of preload pkgs: %d\n", count);
1915 pkgmgrinfo_pkginfo_filter_destroy(handle);
1920 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1921 const char *property, const bool value);
1924 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1925 * @brief This API adds an integer filter property to the filter handle
1927 * @par This API is for package-manager client application
1928 * @par Sync (or) Async : Synchronous API
1930 * @param[in] handle pointer to the package info filter handle.
1931 * @param[in] property integer property name.
1932 * @param[in] value value corresponding to the property.
1933 * @return 0 if success, error code(<0) if fail
1934 * @retval PMINFO_R_OK success
1935 * @retval PMINFO_R_EINVAL invalid argument
1936 * @retval PMINFO_R_ERROR internal error
1937 * @pre pkgmgrinfo_pkginfo_filter_create()
1938 * @post pkgmgrinfo_pkginfo_filter_destroy()
1939 * @see pkgmgrinfo_pkginfo_filter_count()
1940 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1942 static int get_pkg_count()
1946 pkgmgrinfo_pkginfo_filter_h handle;
1947 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1948 if (ret != PMINFO_R_OK)
1950 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1951 if (ret != PMINFO_R_OK) {
1952 pkgmgrinfo_pkginfo_filter_destroy(handle);
1955 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1956 if (ret != PMINFO_R_OK) {
1957 pkgmgrinfo_pkginfo_filter_destroy(handle);
1960 printf("No of preload pkgs: %d\n", count);
1961 pkgmgrinfo_pkginfo_filter_destroy(handle);
1966 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1967 const char *property, const int value);
1970 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1971 * @brief This API adds a string filter property to the filter handle
1973 * @par This API is for package-manager client application
1974 * @par Sync (or) Async : Synchronous API
1976 * @param[in] handle pointer to the package info filter handle.
1977 * @param[in] property string property name.
1978 * @param[in] value value corresponding to the property.
1979 * @return 0 if success, error code(<0) if fail
1980 * @retval PMINFO_R_OK success
1981 * @retval PMINFO_R_EINVAL invalid argument
1982 * @retval PMINFO_R_ERROR internal error
1983 * @pre pkgmgrinfo_pkginfo_filter_create()
1984 * @post pkgmgrinfo_pkginfo_filter_destroy()
1985 * @see pkgmgrinfo_pkginfo_filter_count()
1986 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1988 static int get_rpm_pkg_count()
1992 pkgmgrinfo_pkginfo_filter_h handle;
1993 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1994 if (ret != PMINFO_R_OK)
1996 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1997 if (ret != PMINFO_R_OK) {
1998 pkgmgrinfo_pkginfo_filter_destroy(handle);
2001 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2002 if (ret != PMINFO_R_OK) {
2003 pkgmgrinfo_pkginfo_filter_destroy(handle);
2006 printf("No of rpm pkgs: %d\n", count);
2007 pkgmgrinfo_pkginfo_filter_destroy(handle);
2012 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2013 const char *property, const char *value);
2016 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2017 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2019 * @par This API is for package-manager client application
2020 * @par Sync (or) Async : Synchronous API
2022 * @param[in] handle pointer to the package info filter handle.
2023 * @param[in] pkg_cb callback function.
2024 * @param[in] user_data user data to be passed to the callback function
2025 * @return 0 if success, error code(<0) if fail
2026 * @retval PMINFO_R_OK success
2027 * @retval PMINFO_R_EINVAL invalid argument
2028 * @retval PMINFO_R_ERROR internal error
2029 * @pre pkgmgrinfo_pkginfo_filter_create()
2030 * @post pkgmgrinfo_pkginfo_filter_destroy()
2031 * @see pkgmgrinfo_pkginfo_filter_count()
2033 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2036 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2037 printf("pkg id : %s\n", pkgid);
2041 static int get_rpm_pkg_list()
2044 pkgmgrinfo_pkginfo_filter_h handle;
2045 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2046 if (ret != PMINFO_R_OK)
2048 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2049 if (ret != PMINFO_R_OK) {
2050 pkgmgrinfo_pkginfo_filter_destroy(handle);
2053 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2054 if (ret != PMINFO_R_OK) {
2055 pkgmgrinfo_pkginfo_filter_destroy(handle);
2058 pkgmgrinfo_pkginfo_filter_destroy(handle);
2063 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2064 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2065 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2066 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2069 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2070 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2071 * @brief This API counts the package that satisfy the filter conditions
2073 * @par This API is for package-manager client application
2074 * @par Sync (or) Async : Synchronous API
2076 * @param[in] handle pointer to the package info filter handle.
2077 * @param[in] count pointer to store the count value.
2078 * @param[in] uid the addressee user id of the instruction
2079 * @return 0 if success, error code(<0) if fail
2080 * @retval PMINFO_R_OK success
2081 * @retval PMINFO_R_EINVAL invalid argument
2082 * @retval PMINFO_R_ERROR internal error
2083 * @pre pkgmgrinfo_pkginfo_filter_create()
2084 * @post pkgmgrinfo_pkginfo_filter_destroy()
2085 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2087 static int get_rpm_pkg_count()
2091 pkgmgrinfo_pkginfo_filter_h handle;
2092 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2093 if (ret != PMINFO_R_OK)
2095 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
2096 if (ret != PMINFO_R_OK) {
2097 pkgmgrinfo_pkginfo_filter_destroy(handle);
2100 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2101 if (ret != PMINFO_R_OK) {
2102 pkgmgrinfo_pkginfo_filter_destroy(handle);
2105 printf("No of rpm pkgs: %d\n", count);
2106 pkgmgrinfo_pkginfo_filter_destroy(handle);
2111 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2112 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2114 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2115 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2116 * @brief This API gets the list of privilege for a particular package
2118 * @par This API is for package-manager client application
2119 * @par Sync (or) Async : Synchronous API
2120 * @param[in] handle pointer to the package info handle.
2121 * @param[in] privilege_func callback function for list
2122 * @param[in] user_data user data to be passed to callback function
2123 * @return 0 if success, error code(<0) if fail
2124 * @retval PMINFO_R_OK success
2125 * @retval PMINFO_R_EINVAL invalid argument
2126 * @retval PMINFO_R_ERROR internal error
2127 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2128 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2130 int privilege_func(const char *name, void *user_data)
2132 if (strcmp(name, (char *)user_data) == 0)
2138 static int list_privilege(const char *package, char *privilege)
2141 pkgmgrinfo_pkginfo_h handle;
2142 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2143 if (ret != PMINFO_R_OK)
2145 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2146 if (ret != PMINFO_R_OK) {
2147 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2150 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2155 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2156 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2158 /* TODO: add doxygen comment here */
2159 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2160 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2161 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2162 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2163 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2164 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2165 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2168 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2169 pkgmgrinfo_app_list_cb app_func, void *user_data)
2170 * @brief This API gets list of installed applications for a particular package
2172 * @par This API is for package-manager client application
2173 * @par Sync (or) Async : Synchronous API
2174 * @param[in] handle package info handle
2175 * @param[in] component application component
2176 * @param[in] app_func iteration function for list
2177 * @param[in] user_data user data to be passed to callback function
2178 * @return 0 if success, error code(<0) if fail
2179 * @retval PMINFO_R_OK success
2180 * @retval PMINFO_R_EINVAL invalid argument
2181 * @retval PMINFO_R_ERROR internal error
2182 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2183 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2185 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2188 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2189 printf("appid : %s\n", appid);
2193 static int list_apps(const char *pkgid)
2196 pkgmgrinfo_pkginfo_h handle;
2197 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2198 if (ret != PMINFO_R_OK)
2200 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2201 if (ret != PMINFO_R_OK) {
2202 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2205 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2210 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2211 pkgmgrinfo_app_list_cb app_func, void *user_data);
2212 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2213 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2215 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2216 * @brief This API gets list of installed applications from all packages with minimum informaion.
2218 * @par This API is for package-manager client application
2219 * @par Sync (or) Async : Synchronous API
2220 * @param[in] app_func iteration function for list
2221 * @param[in] user_data user data to be passed to callback function
2222 * @return 0 if success, error code(<0) if fail
2223 * @retval PMINFO_R_OK success
2224 * @retval PMINFO_R_EINVAL invalid argument
2225 * @retval PMINFO_R_ERROR internal error
2229 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2231 char *pkgid1 = NULL;
2232 char *pkgid2 = NULL;
2233 pkgid1 = (char *)user_data;
2234 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2235 if (strcmp(pkgid1, pkgid2) == 0) {
2242 static int list_apps()
2245 char *name = "helloworld";
2246 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2247 if (ret != PMINFO_R_OK) {
2254 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2255 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2257 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2258 * @brief This API gets list of installed applications from all packages.
2260 * @par This API is for package-manager client application
2261 * @par Sync (or) Async : Synchronous API
2262 * @param[in] app_func iteration function for list
2263 * @param[in] user_data user data to be passed to callback function
2264 * @return 0 if success, error code(<0) if fail
2265 * @retval PMINFO_R_OK success
2266 * @retval PMINFO_R_EINVAL invalid argument
2267 * @retval PMINFO_R_ERROR internal error
2271 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2273 char *pkgid1 = NULL;
2274 char *pkgid2 = NULL;
2275 pkgid1 = (char *)user_data;
2276 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2277 if (strcmp(pkgid1, pkgid2) == 0) {
2284 static int list_apps()
2287 char *name = "helloworld";
2288 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2289 if (ret != PMINFO_R_OK) {
2296 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2297 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2300 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2301 * @brief This API creates the application information handle from db
2303 * @par This API is for package-manager client application
2304 * @par Sync (or) Async : Synchronous API
2306 * @param[in] appid pointer to appid
2307 * @param[out] handle pointer to the application info handle.
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
2313 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2314 * @see pkgmgrinfo_appinfo_get_pkgid()
2315 * @see pkgmgrinfo_appinfo_is_multiple()
2317 static int get_app_type(const char *appid)
2321 pkgmgrinfo_appinfo_h handle;
2322 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2323 if (ret != PMINFO_R_OK)
2325 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2326 if (ret != PMINFO_R_OK) {
2327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2330 printf("apptype: %s\n", type);
2331 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2336 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2337 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2339 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2340 * @brief This API gets the application ID
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] appid pointer to hold appid
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_pkgid()
2354 * @see pkgmgrinfo_appinfo_is_multiple()
2356 static int get_app_id(const char *appid)
2359 char *app_id = 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_appid(handle, &app_id);
2365 if (ret != PMINFO_R_OK) {
2366 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2369 printf("app id: %s\n", app_id);
2370 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2375 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2378 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2379 * @brief This API gets the package name 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] pkg_name pointer to hold package name
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_pkgname(const char *appid)
2398 char *pkgname = NULL;
2399 pkgmgrinfo_appinfo_h handle;
2400 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2401 if (ret != PMINFO_R_OK)
2403 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2404 if (ret != PMINFO_R_OK) {
2405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2408 printf("pkg name: %s\n", pkgname);
2409 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2414 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2417 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2418 * @brief This API gets the package id 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] pkgid pointer to hold package id
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_pkgid(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_pkgid(handle, &pkgid);
2443 if (ret != PMINFO_R_OK) {
2444 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2447 printf("pkg id: %s\n", pkgid);
2448 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2453 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2456 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2457 * @brief This API gets the executable 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] exec pointer to hold app exec 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_exec(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_exec(handle, &exec);
2482 if (ret != PMINFO_R_OK) {
2483 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2486 printf("exec name: %s\n", exec);
2487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2495 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2496 * @brief This API gets the icon name 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] icon pointer to hold app icon name
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_icon(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_icon(handle, &icon);
2521 if (ret != PMINFO_R_OK) {
2522 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2525 printf("icon name: %s\n", icon);
2526 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2531 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2534 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2535 * @brief This API gets the label of the application
2537 * @par This API is for package-manager client application
2538 * @par Sync (or) Async : Synchronous API
2540 * @param[in] handle pointer to the application info handle.
2541 * @param[out] label pointer to hold app label
2542 * @return 0 if success, error code(<0) if fail
2543 * @retval PMINFO_R_OK success
2544 * @retval PMINFO_R_EINVAL invalid argument
2545 * @retval PMINFO_R_ERROR internal error
2546 * @pre pkgmgrinfo_appinfo_get_appinfo()
2547 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2548 * @see pkgmgrinfo_appinfo_get_appid()
2549 * @see pkgmgrinfo_appinfo_is_multiple()
2551 static int get_app_label(const char *appid)
2555 pkgmgrinfo_appinfo_h handle;
2556 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2557 if (ret != PMINFO_R_OK)
2559 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2560 if (ret != PMINFO_R_OK) {
2561 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2564 printf("label : %s\n", label);
2565 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2570 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2573 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2574 * @brief This API gets exactly matched label by given appid and locale
2576 * @par This API is for package-manager client application
2577 * @par Sync (or) Async : Synchronous API
2579 * @param[in] appid pointer to appid
2580 * @param[in] locale pointer to locale
2581 * @param[out] label pointer to hold app label
2582 * @return 0 if success, error code(<0) if fail
2583 * @retval PMINFO_R_OK success
2584 * @retval PMINFO_R_EINVAL invalid argument
2585 * @retval PMINFO_R_ERROR internal error
2587 static int get_localed_label(const char *appid, const char *locale)
2592 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2593 if (ret != PMINFO_R_OK)
2596 printf("localed label: %s\n", label);
2604 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2605 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2608 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2609 * @brief This API gets the component 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] component pointer to hold app component
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_component(const char *appid)
2628 pkgmgrinfo_app_component component;
2629 pkgmgrinfo_appinfo_h handle;
2630 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2631 if (ret != PMINFO_R_OK)
2633 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2634 if (ret != PMINFO_R_OK) {
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2638 printf("component : %s\n", component);
2639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2644 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2647 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2648 * @brief This API gets the apptype of the application
2650 * @par This API is for package-manager client application
2651 * @par Sync (or) Async : Synchronous API
2653 * @param[in] handle pointer to the application info handle.
2654 * @param[out] app_type pointer to hold apptype
2655 * @return 0 if success, error code(<0) if fail
2656 * @retval PMINFO_R_OK success
2657 * @retval PMINFO_R_EINVAL invalid argument
2658 * @retval PMINFO_R_ERROR internal error
2659 * @pre pkgmgrinfo_appinfo_get_appinfo()
2660 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2661 * @see pkgmgrinfo_appinfo_get_appid()
2662 * @see pkgmgrinfo_appinfo_is_multiple()
2664 static int get_app_type(const char *appid)
2667 char *apptype = NULL;
2668 pkgmgrinfo_appinfo_h handle;
2669 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2670 if (ret != PMINFO_R_OK)
2672 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2673 if (ret != PMINFO_R_OK) {
2674 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2677 printf("apptype : %s\n", apptype);
2678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2683 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2686 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2687 int *operation_count, char ***operation)
2688 * @brief This API gets the list of operation of the application
2690 * @par This API is for package-manager client application
2691 * @par Sync (or) Async : Synchronous API
2693 * @param[in] handle pointer to the appcontrol handle.
2694 * @param[out] operation_count pointer to hold number of operations
2695 * @param[out] operation pointer to hold list of operations
2696 * @return 0 if success, error code(<0) if fail
2697 * @retval PMINFO_R_OK success
2698 * @retval PMINFO_R_EINVAL invalid argument
2699 * @retval PMINFO_R_ERROR internal error
2700 * @pre pkgmgrinfo_appinfo_get_appinfo()
2701 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2702 * @see pkgmgrinfo_appinfo_get_uri()
2703 * @see pkgmgrinfo_appinfo_get_mime()
2705 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2710 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2711 for (i = 0; i < oc; i++) {
2712 if (strcmp(operation[i], (char *)user_data) == 0)
2719 static int check_operation(const char *appid, char *operation)
2722 pkgmgrinfo_appinfo_h handle;
2723 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2724 if (ret != PMINFO_R_OK)
2726 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2727 if (ret != PMINFO_R_OK) {
2728 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2731 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2736 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2737 int *operation_count, char ***operation);
2740 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2741 int *uri_count, char ***uri)
2742 * @brief This API gets the list of uri of the application
2744 * @par This API is for package-manager client application
2745 * @par Sync (or) Async : Synchronous API
2747 * @param[in] handle pointer to the appcontrol handle.
2748 * @param[out] uri_count pointer to hold number of uris
2749 * @param[out] uri pointer to hold list of uris
2750 * @return 0 if success, error code(<0) if fail
2751 * @retval PMINFO_R_OK success
2752 * @retval PMINFO_R_EINVAL invalid argument
2753 * @retval PMINFO_R_ERROR internal error
2754 * @pre pkgmgrinfo_appinfo_get_appinfo()
2755 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2756 * @see pkgmgrinfo_appinfo_get_operation()
2757 * @see pkgmgrinfo_appinfo_get_mime()
2759 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2764 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2765 for (i = 0; i < uc; i++) {
2766 if (strcmp(uri[i], (char *)user_data) == 0)
2773 static int check_uri(const char *appid, char *uri)
2776 pkgmgrinfo_appinfo_h handle;
2777 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2778 if (ret != PMINFO_R_OK)
2780 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2781 if (ret != PMINFO_R_OK) {
2782 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2790 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2791 int *uri_count, char ***uri);
2794 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2795 int *mime_count, char ***mime)
2796 * @brief This API gets the list of mime of the application
2798 * @par This API is for package-manager client application
2799 * @par Sync (or) Async : Synchronous API
2801 * @param[in] handle pointer to the appcontrol handle.
2802 * @param[out] mime_count pointer to hold number of mimes
2803 * @param[out] mime pointer to hold list of mimes
2804 * @return 0 if success, error code(<0) if fail
2805 * @retval PMINFO_R_OK success
2806 * @retval PMINFO_R_EINVAL invalid argument
2807 * @retval PMINFO_R_ERROR internal error
2808 * @pre pkgmgrinfo_appinfo_get_appinfo()
2809 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2810 * @see pkgmgrinfo_appinfo_get_uri()
2811 * @see pkgmgrinfo_appinfo_get_operation()
2813 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2818 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2819 for (i = 0; i < mc; i++) {
2820 if (strcmp(mime[i], (char *)user_data) == 0)
2827 static int check_mime(const char *appid, char *mime)
2830 pkgmgrinfo_appinfo_h handle;
2831 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2832 if (ret != PMINFO_R_OK)
2834 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2835 if (ret != PMINFO_R_OK) {
2836 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2839 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2844 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2845 int *mime_count, char ***mime);
2848 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2849 int *subapp_count, char ***subapp)
2850 * @brief This API gets the list of subapp of the application
2852 * @par This API is for package-manager client application
2853 * @par Sync (or) Async : Synchronous API
2855 * @param[in] handle pointer to the appcontrol handle.
2856 * @param[out] subapp_count pointer to hold number of subapp
2857 * @param[out] subapp pointer to hold list of subapp
2858 * @return 0 if success, error code(<0) if fail
2859 * @retval PMINFO_R_OK success
2860 * @retval PMINFO_R_EINVAL invalid argument
2861 * @retval PMINFO_R_ERROR internal error
2862 * @pre pkgmgrinfo_appinfo_get_appinfo()
2863 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2864 * @see pkgmgrinfo_appinfo_get_uri()
2865 * @see pkgmgrinfo_appinfo_get_operation()
2867 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2871 char **subapp = NULL;
2872 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2873 for (i = 0; i < sc; i++) {
2874 if (strcmp(subapp[i], (char *)user_data) == 0)
2881 static int check_subapp(const char *appid, char *subapp)
2884 pkgmgrinfo_appinfo_h handle = NULL;
2885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2886 if (ret != PMINFO_R_OK)
2888 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2889 if (ret != PMINFO_R_OK) {
2890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2893 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2898 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2899 int *subapp_count, char ***subapp);
2902 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2903 * @brief This API gets the notification 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 notification 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_notification_icon(const char *appid)
2922 char *notification_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_notification_icon(handle, ¬ification_icon);
2928 if (ret != PMINFO_R_OK) {
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2932 printf("notification icon : %s\n", notification_icon);
2933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2938 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2941 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2942 * @brief This API gets the setting icon of the application
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] path pointer to hold setting icon
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_setting_icon(const char *appid)
2961 char *setting_icon = NULL;
2962 pkgmgrinfo_appinfo_h handle;
2963 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2964 if (ret != PMINFO_R_OK)
2966 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2967 if (ret != PMINFO_R_OK) {
2968 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2971 printf("setting icon : %s\n", setting_icon);
2972 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2977 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2980 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2981 * @brief This API gets the type of recent image on app-tray
2983 * @par This API is for package-manager client application
2984 * @par Sync (or) Async : Synchronous API
2986 * @param[in] handle pointer to the application info handle.
2987 * @param[out] type pointer to hold image type
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()
2995 * @see pkgmgrinfo_appinfo_is_multiple()
2997 static int get_app_recent_image_type(const char *appid)
3000 pkgmgrinfo_app_recentimage type;
3001 pkgmgrinfo_appinfo_h handle;
3002 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3003 if (ret != PMINFO_R_OK)
3005 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3006 if (ret != PMINFO_R_OK) {
3007 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3010 printf("recent image type: %d\n", type);
3011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3016 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3020 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3021 * @brief This API gets the preview image of application
3023 * @par Sync (or) Async : Synchronous API
3025 * @param[in] handle pointer to the application info handle.
3026 * @param[out] preview_img pointer to hold preview image path
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_previewimage(const char *appid)
3038 char *preview = NULL;
3039 pkgmgrinfo_appinfo_h handle = NULL;
3040 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3041 if (ret != PMINFO_R_OK)
3043 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3044 if (ret != PMINFO_R_OK) {
3045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3048 printf("preview image path : %s\n", preview);
3049 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3054 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3058 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3059 * @brief This API gets the package permission type of the application
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] permission pointer to hold package permission
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_appid()
3074 static int get_app_permission(const char *appid)
3077 pkgmgrinfo_permission_type permission = 0;
3078 pkgmgrinfo_appinfo_h handle;
3080 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3081 if (ret != PMINFO_R_OK)
3083 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3084 if (ret != PMINFO_R_OK) {
3085 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3088 printf("permission type: %d\n", permission);
3089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3094 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3097 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3098 * @brief This API gets the component_type
3100 * @par This API is for package-manager client application
3101 * @par Sync (or) Async : Synchronous API
3103 * @param[in] handle pointer to the application info handle.
3104 * @param[out] component_type pointer to hold component_type
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_pkgid()
3112 * @see pkgmgrinfo_appinfo_is_multiple()
3114 static int get_component_type(const char *appid)
3117 char *component_type = NULL;
3118 pkgmgrinfo_appinfo_h handle;
3119 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3120 if (ret != PMINFO_R_OK)
3122 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3123 if (ret != PMINFO_R_OK) {
3124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3127 printf("component_type: %s\n", component_type);
3128 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3133 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3136 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3137 * @brief This API gets the application 'hwacceleration' 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] hwacceleration pointer to hold package hwacceleration 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_hwacceleration(const char *appid)
3156 pkgmgrinfo_app_hwacceleration hwacceleration;
3157 pkgmgrinfo_appinfo_h handle;
3158 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3159 if (ret != PMINFO_R_OK)
3161 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3162 if (ret != PMINFO_R_OK) {
3163 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3166 printf("app hwacceleration: %d\n", hwacceleration);
3167 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3172 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3175 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3176 * @brief This API gets the application 'screenreader' value from the app ID
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] screenreader pointer to hold package accessibility value
3183 * @return 0 if success, error code(<0) if fail
3184 * @retval PMINFO_R_OK success
3185 * @retval PMINFO_R_EINVAL invalid argument
3186 * @retval PMINFO_R_ERROR internal error
3187 * @pre pkgmgrinfo_appinfo_get_appinfo()
3188 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3189 * @see pkgmgrinfo_appinfo_get_appid()
3190 * @see pkgmgrinfo_appinfo_is_multiple()
3192 static int get_app_screenreader(const char *appid)
3195 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3196 pkgmgrinfo_appinfo_h handle = NULL;
3197 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3198 if (ret != PMINFO_R_OK)
3200 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3201 if (ret != PMINFO_R_OK) {
3202 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3205 printf("app screenreader: %d\n", screenreader);
3206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3211 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3214 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3215 * @brief This API gets the application's landscape & portrait effect images
3217 * @par This API is for package-manager client application
3218 * @par Sync (or) Async : Synchronous API
3220 * @param[in] handle pointer to application info handle
3221 * @param[out] portrait_img contains portrait mode effect image
3222 * @param[out] landscape_img contains landscape mode effect image
3223 * @return 0 if success, error code(<0) if fail
3224 * @retval PMINFO_R_OK success
3225 * @retval PMINFO_R_EINVAL invalid argument
3226 * @retval PMINFO_R_ERROR internal error
3227 * @pre pkgmgrinfo_appinfo_get_appinfo()
3228 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3229 * @see pkgmgrinfo_appinfo_get_appid()
3230 * @see pkgmgrinfo_appinfo_is_nodisplay()
3232 static int get_app_effectimages(const char *appid)
3235 char *portraitimg = NULL;
3236 char *landscapeimg = NULL;
3237 pkgmgrinfo_appinfo_h handle;
3238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3239 if (ret != PMINFO_R_OK)
3241 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3242 if (ret != PMINFO_R_OK) {
3243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3246 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3252 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3255 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3256 * @brief This API gets the submode_mainid of the application
3258 * @par This API is for package-manager client application
3259 * @par Sync (or) Async : Synchronous API
3261 * @param[in] handle pointer to the application info handle.
3262 * @param[out] submode_mainid pointer to hold package name
3263 * @return 0 if success, error code(<0) if fail
3264 * @retval PMINFO_R_OK success
3265 * @retval PMINFO_R_EINVAL invalid argument
3266 * @retval PMINFO_R_ERROR internal error
3267 * @pre pkgmgrinfo_appinfo_get_appinfo()
3268 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3269 * @see pkgmgrinfo_appinfo_get_appid()
3270 * @see pkgmgrinfo_appinfo_is_multiple()
3272 static int get_app_submode_mainid(const char *appid)
3275 char *submode_mainid = NULL;
3276 pkgmgrinfo_appinfo_h handle = NULL;
3277 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3278 if (ret != PMINFO_R_OK)
3280 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3281 if (ret != PMINFO_R_OK) {
3282 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3285 printf("submode_mainid: %s\n", submode_mainid);
3286 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3291 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3294 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3295 * @brief This API gets the datacontrol info
3297 * @par This API is for package-manager client application
3298 * @par Sync (or) Async : Synchronous API
3300 * @param[in] providerid pointer to the providerid of dataconltrol.
3301 * @param[in] type pointer to the type of dataconltrol.
3302 * @param[out] appid pointer to hold appid, need to free after using
3303 * @param[out] access pointer to hold access, need to free after using
3304 * @return 0 if success, error code(<0) if fail
3305 * @retval PMINFO_R_OK success
3306 * @retval PMINFO_R_EINVAL invalid argument
3307 * @retval PMINFO_R_ERROR internal error
3310 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3311 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3314 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3315 * @brief This API gets the appid of datacontrol
3317 * @par This API is for package-manager client application
3318 * @par Sync (or) Async : Synchronous API
3320 * @param[in] providerid pointer to the providerid of dataconltrol.
3321 * @param[out] appid pointer to hold appid, need to free after using
3322 * @return 0 if success, error code(<0) if fail
3323 * @retval PMINFO_R_OK success
3324 * @retval PMINFO_R_EINVAL invalid argument
3325 * @retval PMINFO_R_ERROR internal error
3328 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3329 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3332 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3333 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3334 * @brief This API gets the list of permission for a particular application
3336 * @par This API is for package-manager client application
3337 * @par Sync (or) Async : Synchronous API
3338 * @param[in] handle pointer to the application info handle.
3339 * @param[in] permission_func callback function for list
3340 * @param[in] user_data user data to be passed to callback function
3341 * @return 0 if success, error code(<0) if fail
3342 * @retval PMINFO_R_OK success
3343 * @retval PMINFO_R_EINVAL invalid argument
3344 * @retval PMINFO_R_ERROR internal error
3345 * @pre pkgmgrinfo_appinfo_get_appinfo()
3346 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3348 int permission_func(const char *name, void *user_data)
3350 if (strcmp(name, (char *)user_data) == 0)
3356 static int list_permission(const char *appid, char *permission)
3359 pkgmgrinfo_appinfo_h handle;
3360 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3361 if (ret != PMINFO_R_OK)
3363 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3364 if (ret != PMINFO_R_OK) {
3365 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3368 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3373 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3374 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3377 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3378 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3379 * @brief This API gets the list of category for a particular application
3381 * @par This API is for package-manager client application
3382 * @par Sync (or) Async : Synchronous API
3383 * @param[in] handle pointer to the application info handle.
3384 * @param[in] category_func callback function for list
3385 * @param[in] user_data user data to be passed to callback function
3386 * @return 0 if success, error code(<0) if fail
3387 * @retval PMINFO_R_OK success
3388 * @retval PMINFO_R_EINVAL invalid argument
3389 * @retval PMINFO_R_ERROR internal error
3390 * @pre pkgmgrinfo_appinfo_get_appinfo()
3391 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3393 int category_func(const char *name, void *user_data)
3395 if (strcmp(name, (char *)user_data) == 0)
3401 static int list_category(const char *appid, char *category)
3404 pkgmgrinfo_appinfo_h handle;
3405 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3406 if (ret != PMINFO_R_OK)
3408 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3409 if (ret != PMINFO_R_OK) {
3410 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3418 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3419 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3422 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3423 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3424 * @brief This API gets the list of metadata for a particular application
3426 * @par This API is for package-manager client application
3427 * @par Sync (or) Async : Synchronous API
3428 * @param[in] handle pointer to the application info handle.
3429 * @param[in] metadata_func callback function for list
3430 * @param[in] user_data user data to be passed to callback function
3431 * @return 0 if success, error code(<0) if fail
3432 * @retval PMINFO_R_OK success
3433 * @retval PMINFO_R_EINVAL invalid argument
3434 * @retval PMINFO_R_ERROR internal error
3435 * @pre pkgmgrinfo_appinfo_get_appinfo()
3436 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3438 int metadata_func(const char *key, const char *value, void *user_data)
3440 if (strcmp(key, (char *)user_data) == 0) {
3441 printf("Value is %s\n", value);
3448 static int list_metadata(const char *appid, char *key)
3451 pkgmgrinfo_appinfo_h handle;
3452 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3453 if (ret != PMINFO_R_OK)
3455 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3456 if (ret != PMINFO_R_OK) {
3457 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3460 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3465 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3466 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3470 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3471 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3472 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3473 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3474 * @brief This API gets the list of app-control for a particular application
3476 * @par This API is for package-manager client application
3477 * @par Sync (or) Async : Synchronous API
3478 * @param[in] handle pointer to the application info handle.
3479 * @param[in] appcontrol_func callback function for list
3480 * @param[in] user_data user data to be passed to callback function
3481 * @param[in] uid the addressee user id of the instruction
3482 * @return 0 if success, error code(<0) if fail
3483 * @retval PMINFO_R_OK success
3484 * @retval PMINFO_R_EINVAL invalid argument
3485 * @retval PMINFO_R_ERROR internal error
3486 * @pre pkgmgrinfo_appinfo_get_appinfo()
3487 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3489 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3494 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3495 for (i = 0; i < oc; i++) {
3496 if (strcmp(operation[i], (char *)user_data) == 0)
3503 static int check_operation(const char *appid, char *operation)
3506 pkgmgrinfo_appinfo_h handle;
3507 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3508 if (ret != PMINFO_R_OK)
3510 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3511 if (ret != PMINFO_R_OK) {
3512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3515 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3520 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3521 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3522 int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3523 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3526 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3527 * @brief This API gets the application 'nodisplay' value from the app ID
3529 * @par This API is for package-manager client application
3530 * @par Sync (or) Async : Synchronous API
3532 * @param[in] handle pointer to application info handle
3533 * @param[out] nodisplay pointer to hold package nodisplay value
3534 * @return 0 if success, error code(<0) if fail
3535 * @retval PMINFO_R_OK success
3536 * @retval PMINFO_R_EINVAL invalid argument
3537 * @retval PMINFO_R_ERROR internal error
3538 * @pre pkgmgrinfo_appinfo_get_appinfo()
3539 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3540 * @see pkgmgrinfo_appinfo_get_appid()
3541 * @see pkgmgrinfo_appinfo_is_multiple()
3543 static int get_app_nodisplay(const char *appid)
3547 pkgmgrinfo_appinfo_h handle;
3548 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3549 if (ret != PMINFO_R_OK)
3551 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3552 if (ret != PMINFO_R_OK) {
3553 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3556 printf("app nodisplay: %d\n", nodisplay);
3557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3562 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3565 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3566 * @brief This API gets the application 'multiple' value from the app ID
3568 * @par This API is for package-manager client application
3569 * @par Sync (or) Async : Synchronous API
3571 * @param[in] handle pointer to application info handle
3572 * @param[out] multiple pointer to hold package multiple value
3573 * @return 0 if success, error code(<0) if fail
3574 * @retval PMINFO_R_OK success
3575 * @retval PMINFO_R_EINVAL invalid argument
3576 * @retval PMINFO_R_ERROR internal error
3577 * @pre pkgmgrinfo_appinfo_get_appinfo()
3578 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3579 * @see pkgmgrinfo_appinfo_get_appid()
3580 * @see pkgmgrinfo_appinfo_is_nodisplay()
3582 static int get_app_multiple(const char *appid)
3586 pkgmgrinfo_appinfo_h handle;
3587 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3588 if (ret != PMINFO_R_OK)
3590 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3591 if (ret != PMINFO_R_OK) {
3592 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3595 printf("app multiple: %d\n", multiple);
3596 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3601 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3604 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3605 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3606 * application launching effect. If fales, indicator will be hidden during application launching effect
3608 * @par This API is for package-manager client application
3609 * @par Sync (or) Async : Synchronous API
3611 * @param[in] handle pointer to application info handle
3612 * @param[out] indicator_disp contains indicator display status for application launching effect
3613 * @return 0 if success, error code(<0) if fail
3614 * @retval PMINFO_R_OK success
3615 * @retval PMINFO_R_EINVAL invalid argument
3616 * @retval PMINFO_R_ERROR internal error
3617 * @pre pkgmgrinfo_appinfo_get_appinfo()
3618 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3619 * @see pkgmgrinfo_appinfo_get_appid()
3620 * @see pkgmgrinfo_appinfo_is_nodisplay()
3622 static int get_app_indicator_display(const char *appid)
3625 bool indicator_disp;
3626 pkgmgrinfo_appinfo_h handle;
3627 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3628 if (ret != PMINFO_R_OK)
3630 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3631 if (ret != PMINFO_R_OK){
3632 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3635 printf("app indicator disp : %d\n", indicator_disp);
3636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3641 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3644 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3645 * @brief This API gets the application 'taskmanage' value from the app ID
3647 * @par This API is for package-manager client application
3648 * @par Sync (or) Async : Synchronous API
3650 * @param[in] handle pointer to application info handle
3651 * @param[out] taskmanage pointer to hold package taskmanage value
3652 * @return 0 if success, error code(<0) if fail
3653 * @retval PMINFO_R_OK success
3654 * @retval PMINFO_R_EINVAL invalid argument
3655 * @retval PMINFO_R_ERROR internal error
3656 * @pre pkgmgrinfo_appinfo_get_appinfo()
3657 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3658 * @see pkgmgrinfo_appinfo_get_appid()
3659 * @see pkgmgrinfo_appinfo_is_multiple()
3661 static int get_app_taskmanage(const char *appid)
3665 pkgmgrinfo_appinfo_h handle;
3666 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3667 if (ret != PMINFO_R_OK)
3669 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3670 if (ret != PMINFO_R_OK) {
3671 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3674 printf("app taskmanage: %d\n", taskmanage);
3675 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3680 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3683 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3684 * @brief This API gets the application 'taskmanage' value from the app ID
3686 * @par This API is for package-manager client application
3687 * @par Sync (or) Async : Synchronous API
3689 * @param[in] handle pointer to application info handle
3690 * @param[out] enabled pointer to hold package enabled value
3691 * @return 0 if success, error code(<0) if fail
3692 * @retval PMINFO_R_OK success
3693 * @retval PMINFO_R_EINVAL invalid argument
3694 * @retval PMINFO_R_ERROR internal error
3695 * @pre pkgmgrinfo_appinfo_get_appinfo()
3696 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3697 * @see pkgmgrinfo_appinfo_get_appid()
3698 * @see pkgmgrinfo_appinfo_is_multiple()
3700 static int get_app_enabled(const char *appid)
3704 pkgmgrinfo_appinfo_h handle;
3705 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3706 if (ret != PMINFO_R_OK)
3708 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3709 if (ret != PMINFO_R_OK) {
3710 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3713 printf("app enabled: %d\n", enabled);
3714 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3719 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3722 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3723 * @brief This API gets the application 'onboot' value from the app ID
3725 * @par This API is for package-manager client application
3726 * @par Sync (or) Async : Synchronous API
3728 * @param[in] handle pointer to application info handle
3729 * @param[out] onboot pointer to hold package onboot value
3730 * @return 0 if success, error code(<0) if fail
3731 * @retval PMINFO_R_OK success
3732 * @retval PMINFO_R_EINVAL invalid argument
3733 * @retval PMINFO_R_ERROR internal error
3734 * @pre pkgmgrinfo_appinfo_get_appinfo()
3735 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3736 * @see pkgmgrinfo_appinfo_get_appid()
3737 * @see pkgmgrinfo_appinfo_is_multiple()
3739 static int get_app_onboot(const char *appid)
3743 pkgmgrinfo_appinfo_h handle;
3744 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3745 if (ret != PMINFO_R_OK)
3747 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3748 if (ret != PMINFO_R_OK) {
3749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3752 printf("app onboot: %d\n", onboot);
3753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3758 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3761 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3762 * @brief This API gets the application 'autorestart' value from the app ID
3764 * @par This API is for package-manager client application
3765 * @par Sync (or) Async : Synchronous API
3767 * @param[in] handle pointer to application info handle
3768 * @param[out] autorestart pointer to hold package autorestart value
3769 * @return 0 if success, error code(<0) if fail
3770 * @retval PMINFO_R_OK success
3771 * @retval PMINFO_R_EINVAL invalid argument
3772 * @retval PMINFO_R_ERROR internal error
3773 * @pre pkgmgrinfo_appinfo_get_appinfo()
3774 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3775 * @see pkgmgrinfo_appinfo_get_appid()
3776 * @see pkgmgrinfo_appinfo_is_multiple()
3778 static int get_app_autorestart(const char *appid)
3782 pkgmgrinfo_appinfo_h handle;
3783 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3784 if (ret != PMINFO_R_OK)
3786 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3787 if (ret != PMINFO_R_OK) {
3788 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3791 printf("app autorestart: %d\n", autorestart);
3792 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3797 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3800 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3801 * @brief This API gets the value for given application is main app or not from handle
3803 * @par This API is for package-manager client application
3804 * @par Sync (or) Async : Synchronous API
3806 * @param[in] handle pointer to application info handle
3807 * @param[out] mainapp pointer to hold package mainapp is or not
3808 * @return 0 if success, error code(<0) if fail
3809 * @retval PMINFO_R_OK success
3810 * @retval PMINFO_R_EINVAL invalid argument
3811 * @retval PMINFO_R_ERROR internal error
3812 * @pre pkgmgrinfo_appinfo_get_appinfo()
3813 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3814 * @see pkgmgrinfo_appinfo_get_appid()
3815 * @see pkgmgrinfo_appinfo_is_multiple()
3817 static int get_app_mainapp(const char *appid)
3821 pkgmgrinfo_appinfo_h handle;
3822 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3823 if (ret != PMINFO_R_OK)
3825 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3826 if (ret != PMINFO_R_OK) {
3827 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3830 printf("mainapp: %d\n", mainapp);
3831 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3836 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3840 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3841 * @brief This API gets the value for given application is preload or not from handle
3843 * @par This API is for package-manager client application
3844 * @par Sync (or) Async : Synchronous API
3846 * @param[in] handle pointer to application info handle
3847 * @param[out] preload pointer to hold preload is or not
3848 * @return 0 if success, error code(<0) if fail
3849 * @retval PMINFO_R_OK success
3850 * @retval PMINFO_R_EINVAL invalid argument
3851 * @retval PMINFO_R_ERROR internal error
3852 * @pre pkgmgrinfo_appinfo_get_appinfo()
3853 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3854 * @see pkgmgrinfo_appinfo_get_appid()
3855 * @see pkgmgrinfo_appinfo_is_multiple()
3857 static int get_app_preload(const char *appid)
3861 pkgmgrinfo_appinfo_h handle = NULL;
3862 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3863 if (ret != PMINFO_R_OK)
3865 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3866 if (ret != PMINFO_R_OK) {
3867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3870 printf("preload: %d\n", preload);
3871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3876 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3879 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3880 * @brief This API gets the value for given application is submode or not from handle
3882 * @par This API is for package-manager client application
3883 * @par Sync (or) Async : Synchronous API
3885 * @param[in] handle pointer to application info handle
3886 * @param[out] submode pointer to hold submode is or not
3887 * @return 0 if success, error code(<0) if fail
3888 * @retval PMINFO_R_OK success
3889 * @retval PMINFO_R_EINVAL invalid argument
3890 * @retval PMINFO_R_ERROR internal error
3891 * @pre pkgmgrinfo_appinfo_get_appinfo()
3892 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3893 * @see pkgmgrinfo_appinfo_get_appid()
3894 * @see pkgmgrinfo_appinfo_is_multiple()
3896 static int get_app_submode(const char *appid)
3900 pkgmgrinfo_appinfo_h handle = NULL;
3901 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3902 if (ret != PMINFO_R_OK)
3904 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3905 if (ret != PMINFO_R_OK) {
3906 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3909 printf("submode: %d\n", submode);
3910 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3915 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3918 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3919 * @brief This API checks if the application has the given category
3921 * @par This API is for package-manager client application
3922 * @par Sync (or) Async : Synchronous API
3924 * @param[in] handle pointer to the application info handle
3925 * @param[in] category category
3926 * @param[out] exist value Gets whether the application has the given category
3927 * @return 0 if success, error code(<0) if fail
3928 * @retval PMINFO_R_OK success
3929 * @retval PMINFO_R_EINVAL invalid argument
3930 * @retval PMINFO_R_ERROR internal error
3932 static int is_category_exist(const char *appid, const char *category)
3935 pkgmgrinfo_appinfo_h handle;
3938 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3939 if (ret != PMINFO_R_OK)
3942 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3943 if (ret != PMINFO_R_OK) {
3944 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3948 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3953 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3956 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3957 * @brief This API destroys the application information handle freeing up all the resources
3959 * @par This API is for package-manager client application
3960 * @par Sync (or) Async : Synchronous API
3962 * @param[in] handle pointer to the application info handle.
3963 * @return 0 if success, error code(<0) if fail
3964 * @retval PMINFO_R_OK success
3965 * @retval PMINFO_R_EINVAL invalid argument
3966 * @retval PMINFO_R_ERROR internal error
3967 * @pre pkgmgrinfo_appinfo_get_appinfo()
3969 * @see pkgmgrinfo_appinfo_get_pkgid()
3970 * @see pkgmgrinfo_appinfo_is_multiple()
3972 static int get_app_type(const char *appid)
3976 pkgmgrinfo_appinfo_h handle;
3977 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3978 if (ret != PMINFO_R_OK)
3980 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3981 if (ret != PMINFO_R_OK) {
3982 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3985 printf("apptype: %s\n", type);
3986 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3991 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3994 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3995 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3996 The query will search the entire application information collected from the manifest file of all the installed packages
3998 * @par This API is for package-manager client application
3999 * @par Sync (or) Async : Synchronous API
4001 * @param[out] handle pointer to the application info filter handle.
4002 * @return 0 if success, error code(<0) if fail
4003 * @retval PMINFO_R_OK success
4004 * @retval PMINFO_R_EINVAL invalid argument
4005 * @retval PMINFO_R_ERROR internal error
4007 * @post pkgmgrinfo_appinfo_filter_destroy()
4008 * @see pkgmgrinfo_appinfo_filter_count()
4009 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4011 static int get_capp_count()
4015 pkgmgrinfo_appinfo_filter_h handle;
4016 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4017 if (ret != PMINFO_R_OK)
4019 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4020 if (ret != PMINFO_R_OK) {
4021 pkgmgrinfo_appinfo_filter_destroy(handle);
4024 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4025 if (ret != PMINFO_R_OK) {
4026 pkgmgrinfo_appinfo_filter_destroy(handle);
4029 printf("No of capp: %d\n", count);
4030 pkgmgrinfo_appinfo_filter_destroy(handle);
4035 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4038 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4039 * @brief This API destroys the application information filter handle freeing up all the resources
4041 * @par This API is for package-manager client application
4042 * @par Sync (or) Async : Synchronous API
4044 * @param[in] handle pointer to the application info filter handle.
4045 * @return 0 if success, error code(<0) if fail
4046 * @retval PMINFO_R_OK success
4047 * @retval PMINFO_R_EINVAL invalid argument
4048 * @retval PMINFO_R_ERROR internal error
4049 * @pre pkgmgrinfo_appinfo_filter_create()
4051 * @see pkgmgrinfo_appinfo_filter_count()
4052 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4054 static int get_capp_count()
4058 pkgmgrinfo_appinfo_filter_h handle;
4059 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4060 if (ret != PMINFO_R_OK)
4062 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4063 if (ret != PMINFO_R_OK) {
4064 pkgmgrinfo_appinfo_filter_destroy(handle);
4067 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4068 if (ret != PMINFO_R_OK) {
4069 pkgmgrinfo_appinfo_filter_destroy(handle);
4072 printf("No of capp: %d\n", count);
4073 pkgmgrinfo_appinfo_filter_destroy(handle);
4078 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4081 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4082 * @brief This API adds a boolean filter property to the filter handle
4084 * @par This API is for package-manager client application
4085 * @par Sync (or) Async : Synchronous API
4087 * @param[in] handle pointer to the application info filter handle.
4088 * @param[in] property boolean property name.
4089 * @param[in] value value corresponding to the property.
4090 * @return 0 if success, error code(<0) if fail
4091 * @retval PMINFO_R_OK success
4092 * @retval PMINFO_R_EINVAL invalid argument
4093 * @retval PMINFO_R_ERROR internal error
4094 * @pre pkgmgrinfo_appinfo_filter_create()
4095 * @post pkgmgrinfo_appinfo_filter_destroy()
4096 * @see pkgmgrinfo_appinfo_filter_count()
4097 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4099 static int get_taskmanageable_app_count()
4103 pkgmgrinfo_appinfo_filter_h handle;
4104 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4105 if (ret != PMINFO_R_OK)
4107 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4108 if (ret != PMINFO_R_OK) {
4109 pkgmgrinfo_appinfo_filter_destroy(handle);
4112 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4113 if (ret != PMINFO_R_OK) {
4114 pkgmgrinfo_appinfo_filter_destroy(handle);
4117 printf("No of taskmanageable apps: %d\n", count);
4118 pkgmgrinfo_appinfo_filter_destroy(handle);
4123 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4124 const char *property, const bool value);
4127 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4128 * @brief This API adds an integer filter property to the filter handle
4130 * @par This API is for package-manager client application
4131 * @par Sync (or) Async : Synchronous API
4133 * @param[in] handle pointer to the application info filter handle.
4134 * @param[in] property integer property name.
4135 * @param[in] value value corresponding to the property.
4136 * @return 0 if success, error code(<0) if fail
4137 * @retval PMINFO_R_OK success
4138 * @retval PMINFO_R_EINVAL invalid argument
4139 * @retval PMINFO_R_ERROR internal error
4140 * @pre pkgmgrinfo_appinfo_filter_create()
4141 * @post pkgmgrinfo_appinfo_filter_destroy()
4142 * @see pkgmgrinfo_appinfo_filter_count()
4143 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4145 static int get_taskmanageable_app_count()
4149 pkgmgrinfo_appinfo_filter_h handle;
4150 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4151 if (ret != PMINFO_R_OK)
4153 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4154 if (ret != PMINFO_R_OK) {
4155 pkgmgrinfo_appinfo_filter_destroy(handle);
4158 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4159 if (ret != PMINFO_R_OK) {
4160 pkgmgrinfo_appinfo_filter_destroy(handle);
4163 printf("No of apps: %d\n", count);
4164 pkgmgrinfo_appinfo_filter_destroy(handle);
4169 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4170 const char *property, const int value);
4173 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4174 * @brief This API adds a string filter property to the filter handle
4176 * @par This API is for package-manager client application
4177 * @par Sync (or) Async : Synchronous API
4179 * @param[in] handle pointer to the application info filter handle.
4180 * @param[in] property string property name.
4181 * @param[in] value value corresponding to the property.
4182 * @return 0 if success, error code(<0) if fail
4183 * @retval PMINFO_R_OK success
4184 * @retval PMINFO_R_EINVAL invalid argument
4185 * @retval PMINFO_R_ERROR internal error
4186 * @pre pkgmgrinfo_appinfo_filter_create()
4187 * @post pkgmgrinfo_appinfo_filter_destroy()
4188 * @see pkgmgrinfo_appinfo_filter_count()
4189 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4191 static int get_capp_count()
4195 pkgmgrinfo_appinfo_filter_h handle;
4196 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4197 if (ret != PMINFO_R_OK)
4199 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4200 if (ret != PMINFO_R_OK) {
4201 pkgmgrinfo_appinfo_filter_destroy(handle);
4204 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4205 if (ret != PMINFO_R_OK) {
4206 pkgmgrinfo_appinfo_filter_destroy(handle);
4209 printf("No of capp: %d\n", count);
4210 pkgmgrinfo_appinfo_filter_destroy(handle);
4215 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4216 const char *property, const char *value);
4219 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4220 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4222 * @par This API is for package-manager client application
4223 * @par Sync (or) Async : Synchronous API
4225 * @param[in] handle pointer to the application info filter handle.
4226 * @param[in] app_cb callback function.
4227 * @param[in] user_data user data to be passed to the callback function
4228 * @return 0 if success, error code(<0) if fail
4229 * @retval PMINFO_R_OK success
4230 * @retval PMINFO_R_EINVAL invalid argument
4231 * @retval PMINFO_R_ERROR internal error
4232 * @pre pkgmgrinfo_appinfo_filter_create()
4233 * @post pkgmgrinfo_appinfo_filter_destroy()
4234 * @see pkgmgrinfo_appinfo_filter_count()
4236 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4239 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4240 printf("appid : %s\n", appid);
4244 static int get_capp_list()
4247 pkgmgrinfo_appinfo_filter_h handle;
4248 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4249 if (ret != PMINFO_R_OK)
4251 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4252 if (ret != PMINFO_R_OK) {
4253 pkgmgrinfo_appinfo_filter_destroy(handle);
4256 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4257 if (ret != PMINFO_R_OK) {
4258 pkgmgrinfo_appinfo_filter_destroy(handle);
4261 pkgmgrinfo_appinfo_filter_destroy(handle);
4266 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4267 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4268 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4269 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4272 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4273 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4274 * @brief This API counts the application that satisfy the filter conditions
4276 * @par This API is for package-manager client application
4277 * @par Sync (or) Async : Synchronous API
4279 * @param[in] handle pointer to the application info filter handle.
4280 * @param[in] count pointer to store count value
4281 * @param[in] uid the addressee user id of the instruction
4282 * @return 0 if success, error code(<0) if fail
4283 * @retval PMINFO_R_OK success
4284 * @retval PMINFO_R_EINVAL invalid argument
4285 * @retval PMINFO_R_ERROR internal error
4286 * @pre pkgmgrinfo_appinfo_filter_create()
4287 * @post pkgmgrinfo_appinfo_filter_destroy()
4288 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4290 static int get_capp_count()
4294 pkgmgrinfo_appinfo_filter_h handle;
4295 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4296 if (ret != PMINFO_R_OK)
4298 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4299 if (ret != PMINFO_R_OK) {
4300 pkgmgrinfo_appinfo_filter_destroy(handle);
4303 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4304 if (ret != PMINFO_R_OK) {
4305 pkgmgrinfo_appinfo_filter_destroy(handle);
4308 printf("No of capp: %d\n", count);
4309 pkgmgrinfo_appinfo_filter_destroy(handle);
4314 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4315 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4317 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4318 * @brief This API creates the application's metadata information filter handle from db.
4320 * @par This API is for package-manager client application
4321 * @par Sync (or) Async : Synchronous API
4323 * @param[out] handle pointer to the application metadata info filter handle.
4324 * @return 0 if success, error code(<0) if fail
4325 * @retval PMINFO_R_OK success
4326 * @retval PMINFO_R_EINVAL invalid argument
4327 * @retval PMINFO_R_ERROR internal error
4329 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4330 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4332 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4335 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4336 printf("appid : %s\n", appid);
4340 static int get_app_list(const char *mkey, const char *mvalue)
4343 pkgmgrinfo_appinfo_metadata_filter_h handle;
4344 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4345 if (ret != PMINFO_R_OK)
4347 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4348 if (ret != PMINFO_R_OK) {
4349 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4352 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4353 if (ret != PMINFO_R_OK) {
4354 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4357 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4362 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4365 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4366 * @brief This API destroys the application's metadata information filter handle.
4368 * @par This API is for package-manager client application
4369 * @par Sync (or) Async : Synchronous API
4371 * @param[in] handle pointer to the application metadata info filter handle.
4372 * @return 0 if success, error code(<0) if fail
4373 * @retval PMINFO_R_OK success
4374 * @retval PMINFO_R_EINVAL invalid argument
4375 * @retval PMINFO_R_ERROR internal error
4376 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4378 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4380 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4383 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4384 printf("appid : %s\n", appid);
4388 static int get_app_list(const char *mkey, const char *mvalue)
4391 pkgmgrinfo_appinfo_metadata_filter_h handle;
4392 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4393 if (ret != PMINFO_R_OK)
4395 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4396 if (ret != PMINFO_R_OK) {
4397 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4400 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4401 if (ret != PMINFO_R_OK) {
4402 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4405 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4410 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4413 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4414 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4415 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4417 * @par This API is for package-manager client application
4418 * @par Sync (or) Async : Synchronous API
4420 * @param[in] handle pointer to the application metadata info filter handle.
4421 * @param[in] key pointer to metadata key
4422 * @param[in] value pointer to metadata value
4423 * @return 0 if success, error code(<0) if fail
4424 * @retval PMINFO_R_OK success
4425 * @retval PMINFO_R_EINVAL invalid argument
4426 * @retval PMINFO_R_ERROR internal error
4427 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4428 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4429 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4431 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4434 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4435 printf("appid : %s\n", appid);
4439 static int get_app_list(const char *mkey, const char *mvalue)
4442 pkgmgrinfo_appinfo_metadata_filter_h handle;
4443 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4444 if (ret != PMINFO_R_OK)
4446 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4447 if (ret != PMINFO_R_OK) {
4448 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4451 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4452 if (ret != PMINFO_R_OK) {
4453 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4456 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4461 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4462 const char *key, const char *value);
4465 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4466 * @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)
4467 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4468 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4469 * negative value, no more callbacks will be called and API will return.
4471 * @par This API is for package-manager client application
4472 * @par Sync (or) Async : Synchronous API
4474 * @param[in] handle pointer to the application metadata info filter handle.
4475 * @param[in] app_cb function pointer to callback
4476 * @param[in] user_data pointer to user data
4477 * @param[in] uid the addressee user id of the instruction
4478 * @return 0 if success, error code(<0) if fail
4479 * @retval PMINFO_R_OK success
4480 * @retval PMINFO_R_EINVAL invalid argument
4481 * @retval PMINFO_R_ERROR internal error
4482 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4483 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4485 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4488 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4489 printf("appid : %s\n", appid);
4493 static int get_app_list(const char *mkey, const char *mvalue)
4496 pkgmgrinfo_appinfo_metadata_filter_h handle;
4497 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4498 if (ret != PMINFO_R_OK)
4500 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4501 if (ret != PMINFO_R_OK) {
4502 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4505 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4506 if (ret != PMINFO_R_OK) {
4507 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4510 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4515 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4516 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4517 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4518 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4520 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4521 * @brief This API creates the package cert information handle to get data from db.
4523 * @par This API is for package-manager client application
4524 * @par Sync (or) Async : Synchronous API
4526 * @param[out] handle pointer to the package cert handle.
4527 * @return 0 if success, error code(<0) if fail
4528 * @retval PMINFO_R_OK success
4529 * @retval PMINFO_R_EINVAL invalid argument
4530 * @retval PMINFO_R_ERROR internal error
4532 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4533 * @see pkgmgrinfo_pkginfo_get_cert_value()
4534 * @see pkgmgrinfo_pkginfo_load_certinfo()
4536 static int get_cert_info(const char *pkgid)
4539 pkgmgrinfo_certinfo_h handle;
4540 char *auth_cert = NULL;
4541 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4542 if (ret != PMINFO_R_OK)
4544 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4545 if (ret != PMINFO_R_OK) {
4546 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4549 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4550 if (ret != PMINFO_R_OK) {
4551 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4554 printf("Author root certificate: %s\n", auth_root);
4555 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4560 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4563 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4564 * @brief This API loads the package cert information handle with data from db.
4566 * @par This API is for package-manager client application
4567 * @par Sync (or) Async : Synchronous API
4569 * @param[in] pkgid pointer to the package ID.
4570 * @param[in] handle pointer to the package cert handle.
4571 * @return 0 if success, error code(<0) if fail
4572 * @retval PMINFO_R_OK success
4573 * @retval PMINFO_R_EINVAL invalid argument
4574 * @retval PMINFO_R_ERROR internal error
4575 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4576 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4577 * @see pkgmgrinfo_pkginfo_get_cert_value()
4579 static int get_cert_info(const char *pkgid)
4582 pkgmgrinfo_certinfo_h handle;
4583 char *auth_cert = NULL;
4584 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4585 if (ret != PMINFO_R_OK)
4587 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4588 if (ret != PMINFO_R_OK) {
4589 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4592 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4593 if (ret != PMINFO_R_OK) {
4594 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4597 printf("Author root certificate: %s\n", auth_root);
4598 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4603 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4606 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4607 * @brief This API gets the package cert information from the handle
4609 * @par This API is for package-manager client application
4610 * @par Sync (or) Async : Synchronous API
4612 * @param[in] handle pointer to the package cert handle.
4613 * @param[in] cert_type certificate type
4614 * @param[out] cert_value pointer to hold certificate value
4615 * @return 0 if success, error code(<0) if fail
4616 * @retval PMINFO_R_OK success
4617 * @retval PMINFO_R_EINVAL invalid argument
4618 * @retval PMINFO_R_ERROR internal error
4619 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4620 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4621 * @see pkgmgrinfo_pkginfo_load_certinfo()
4623 static int get_cert_info(const char *pkgid)
4626 pkgmgrinfo_certinfo_h handle;
4627 char *auth_cert = NULL;
4628 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4629 if (ret != PMINFO_R_OK)
4631 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4632 if (ret != PMINFO_R_OK) {
4633 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4636 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4637 if (ret != PMINFO_R_OK) {
4638 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4641 printf("Author root certificate: %s\n", auth_root);
4642 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4647 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4650 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4651 * @brief This API destroys the package cert information handle freeing up all the resources
4653 * @par This API is for package-manager client application
4654 * @par Sync (or) Async : Synchronous API
4656 * @param[in] handle pointer to the package cert handle.
4657 * @return 0 if success, error code(<0) if fail
4658 * @retval PMINFO_R_OK success
4659 * @retval PMINFO_R_EINVAL invalid argument
4660 * @retval PMINFO_R_ERROR internal error
4661 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4663 * @see pkgmgrinfo_pkginfo_load_certinfo()
4665 static int get_cert_info(const char *pkgid)
4668 pkgmgrinfo_certinfo_h handle;
4669 char *auth_cert = NULL;
4670 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4671 if (ret != PMINFO_R_OK)
4673 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4674 if (ret != PMINFO_R_OK) {
4675 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4678 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4679 if (ret != PMINFO_R_OK) {
4680 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4683 printf("Author root certificate: %s\n", auth_root);
4684 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4689 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4692 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4693 * @brief This API deletes the package cert information from DB
4695 * @par This API is for package-manager client application
4696 * @par Sync (or) Async : Synchronous API
4698 * @param[in] pkgid pointer to the package ID.
4699 * @return 0 if success, error code(<0) if fail
4700 * @retval PMINFO_R_OK success
4701 * @retval PMINFO_R_EINVAL invalid argument
4702 * @retval PMINFO_R_ERROR internal error
4706 static int delete_cert_info(const char *pkgid)
4709 ret = pkgmgrinfo_delete_certinfo(pkgid);
4710 if (ret != PMINFO_R_OK)
4716 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4717 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4719 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4720 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4721 * @brief This API creates the package db information handle to set data in db.
4723 * @par This API is for package-manager client application
4724 * @par Sync (or) Async : Synchronous API
4726 * @param[in] pkgid pointer to the package ID.
4727 * @param[in] uid the addressee user id of the instruction
4728 * @param[out] handle pointer to the package db info handle.
4729 * @return 0 if success, error code(<0) if fail
4730 * @retval PMINFO_R_OK success
4731 * @retval PMINFO_R_EINVAL invalid argument
4732 * @retval PMINFO_R_ERROR internal error
4734 * @post pkgmgrinfo_destroy_pkgdbinfo()
4735 * @see pkgmgrinfo_save_pkgdbinfo()
4736 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4738 static int set_pkg_in_db(const char *pkgid)
4741 pkgmgrinfo_pkgdbinfo_h handle;
4742 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4743 if (ret != PMINFO_R_OK)
4745 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4746 if (ret != PMINFO_R_OK) {
4747 pkgmgrinfo_destroy_pkgdbinfo(handle);
4750 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4751 if (ret != PMINFO_R_OK) {
4752 pkgmgrinfo_destroy_pkgdbinfo(handle);
4755 pkgmgrinfo_destroy_pkgdbinfo(handle);
4760 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4761 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4764 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4765 * @brief This API sets the package type in db handle
4767 * @par This API is for package-manager client application
4768 * @par Sync (or) Async : Synchronous API
4770 * @param[in] handle pointer to the pkgdbinfo handle.
4771 * @param[in] type pointer to the package type.
4772 * @return 0 if success, error code(<0) if fail
4773 * @retval PMINFO_R_OK success
4774 * @retval PMINFO_R_EINVAL invalid argument
4775 * @retval PMINFO_R_ERROR internal error
4776 * @pre pkgmgrinfo_create_pkgdbinfo()
4777 * @post pkgmgrinfo_destroy_pkgdbinfo()
4778 * @see pkgmgrinfo_save_pkgdbinfo()
4779 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4781 static int set_pkg_type_in_db(const char *pkgid)
4784 pkgmgrinfo_pkgdbinfo_h handle;
4785 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4786 if (ret != PMINFO_R_OK)
4788 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4789 if (ret != PMINFO_R_OK) {
4790 pkgmgrinfo_destroy_pkgdbinfo(handle);
4793 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4794 if (ret != PMINFO_R_OK) {
4795 pkgmgrinfo_destroy_pkgdbinfo(handle);
4798 pkgmgrinfo_destroy_pkgdbinfo(handle);
4803 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4806 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4807 * @brief This API sets the package version in db handle
4809 * @par This API is for package-manager client application
4810 * @par Sync (or) Async : Synchronous API
4812 * @param[in] handle pointer to the pkgdbinfo handle.
4813 * @param[in] version pointer to the package version
4814 * @return 0 if success, error code(<0) if fail
4815 * @retval PMINFO_R_OK success
4816 * @retval PMINFO_R_EINVAL invalid argument
4817 * @retval PMINFO_R_ERROR internal error
4818 * @pre pkgmgrinfo_create_pkgdbinfo()
4819 * @post pkgmgrinfo_destroy_pkgdbinfo()
4820 * @see pkgmgrinfo_save_pkgdbinfo()
4821 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4823 static int set_pkg_version_in_db(const char *pkgid)
4826 pkgmgrinfo_pkgdbinfo_h handle;
4827 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4828 if (ret != PMINFO_R_OK)
4830 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4831 if (ret != PMINFO_R_OK) {
4832 pkgmgrinfo_destroy_pkgdbinfo(handle);
4835 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4836 if (ret != PMINFO_R_OK) {
4837 pkgmgrinfo_destroy_pkgdbinfo(handle);
4840 pkgmgrinfo_destroy_pkgdbinfo(handle);
4845 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4848 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4849 * @brief This API sets the package install location in db handle
4851 * @par This API is for package-manager client application
4852 * @par Sync (or) Async : Synchronous API
4854 * @param[in] handle pointer to the pkgdbinfo handle.
4855 * @param[in] location package install location
4856 * @return 0 if success, error code(<0) if fail
4857 * @retval PMINFO_R_OK success
4858 * @retval PMINFO_R_EINVAL invalid argument
4859 * @retval PMINFO_R_ERROR internal error
4860 * @pre pkgmgrinfo_create_pkgdbinfo()
4861 * @post pkgmgrinfo_destroy_pkgdbinfo()
4862 * @see pkgmgrinfo_save_pkgdbinfo()
4863 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4865 static int set_pkg_install_location_in_db(const char *pkgid)
4868 pkgmgrinfo_pkgdbinfo_h handle;
4869 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4870 if (ret != PMINFO_R_OK)
4872 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4873 if (ret != PMINFO_R_OK) {
4874 pkgmgrinfo_destroy_pkgdbinfo(handle);
4877 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4878 if (ret != PMINFO_R_OK) {
4879 pkgmgrinfo_destroy_pkgdbinfo(handle);
4882 pkgmgrinfo_destroy_pkgdbinfo(handle);
4887 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4890 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4891 * @brief This API sets the package size in db handle
4893 * @par This API is for package-manager client application
4894 * @par Sync (or) Async : Synchronous API
4896 * @param[in] handle pointer to the pkgdbinfo handle.
4897 * @param[in] size pointer to the package size
4898 * @return 0 if success, error code(<0) if fail
4899 * @retval PMINFO_R_OK success
4900 * @retval PMINFO_R_EINVAL invalid argument
4901 * @retval PMINFO_R_ERROR internal error
4902 * @pre pkgmgrinfo_create_pkgdbinfo()
4903 * @post pkgmgrinfo_destroy_pkgdbinfo()
4904 * @see pkgmgrinfo_save_pkgdbinfo()
4905 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4907 static int set_pkg_size_in_db(const char *pkgid)
4910 pkgmgrinfo_pkgdbinfo_h handle;
4911 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4912 if (ret != PMINFO_R_OK)
4914 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4915 if (ret != PMINFO_R_OK) {
4916 pkgmgrinfo_destroy_pkgdbinfo(handle);
4919 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4920 if (ret != PMINFO_R_OK) {
4921 pkgmgrinfo_destroy_pkgdbinfo(handle);
4924 pkgmgrinfo_destroy_pkgdbinfo(handle);
4929 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4932 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4933 * @brief This API sets the package label in db handle
4935 * @par This API is for package-manager client application
4936 * @par Sync (or) Async : Synchronous API
4938 * @param[in] handle pointer to the pkgdbinfo handle.
4939 * @param[in] label pointer to the package label
4940 * @param[in] locale pointer to the locale
4941 * @return 0 if success, error code(<0) if fail
4942 * @retval PMINFO_R_OK success
4943 * @retval PMINFO_R_EINVAL invalid argument
4944 * @retval PMINFO_R_ERROR internal error
4945 * @pre pkgmgrinfo_create_pkgdbinfo()
4946 * @post pkgmgrinfo_destroy_pkgdbinfo()
4947 * @see pkgmgrinfo_save_pkgdbinfo()
4948 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4950 static int set_pkg_label_in_db(const char *pkgid)
4953 pkgmgrinfo_pkgdbinfo_h handle;
4954 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4955 if (ret != PMINFO_R_OK)
4957 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4958 if (ret != PMINFO_R_OK) {
4959 pkgmgrinfo_destroy_pkgdbinfo(handle);
4962 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4963 if (ret != PMINFO_R_OK) {
4964 pkgmgrinfo_destroy_pkgdbinfo(handle);
4967 pkgmgrinfo_destroy_pkgdbinfo(handle);
4972 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4975 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4976 * @brief This API sets the package icon in db handle
4978 * @par This API is for package-manager client application
4979 * @par Sync (or) Async : Synchronous API
4981 * @param[in] handle pointer to the pkgdbinfo handle.
4982 * @param[in] icon pointer to the package icon
4983 * @param[in] locale pointer to the locale
4984 * @return 0 if success, error code(<0) if fail
4985 * @retval PMINFO_R_OK success
4986 * @retval PMINFO_R_EINVAL invalid argument
4987 * @retval PMINFO_R_ERROR internal error
4988 * @pre pkgmgrinfo_create_pkgdbinfo()
4989 * @post pkgmgrinfo_destroy_pkgdbinfo()
4990 * @see pkgmgrinfo_save_pkgdbinfo()
4991 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4993 static int set_pkg_icon_in_db(const char *pkgid)
4996 pkgmgrinfo_pkgdbinfo_h handle;
4997 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4998 if (ret != PMINFO_R_OK)
5000 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5001 if (ret != PMINFO_R_OK) {
5002 pkgmgrinfo_destroy_pkgdbinfo(handle);
5005 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5006 if (ret != PMINFO_R_OK) {
5007 pkgmgrinfo_destroy_pkgdbinfo(handle);
5010 pkgmgrinfo_destroy_pkgdbinfo(handle);
5015 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5018 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5019 * @brief This API sets the package description in db handle
5021 * @par This API is for package-manager client application
5022 * @par Sync (or) Async : Synchronous API
5024 * @param[in] handle pointer to the pkgdbinfo handle.
5025 * @param[in] description pointer to the package description
5026 * @param[in] locale pointer to the locale
5027 * @return 0 if success, error code(<0) if fail
5028 * @retval PMINFO_R_OK success
5029 * @retval PMINFO_R_EINVAL invalid argument
5030 * @retval PMINFO_R_ERROR internal error
5031 * @pre pkgmgrinfo_create_pkgdbinfo()
5032 * @post pkgmgrinfo_destroy_pkgdbinfo()
5033 * @see pkgmgrinfo_save_pkgdbinfo()
5034 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5036 static int set_pkg_description_in_db(const char *pkgid)
5039 pkgmgrinfo_pkgdbinfo_h handle;
5040 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5041 if (ret != PMINFO_R_OK)
5043 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5044 if (ret != PMINFO_R_OK) {
5045 pkgmgrinfo_destroy_pkgdbinfo(handle);
5048 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5049 if (ret != PMINFO_R_OK) {
5050 pkgmgrinfo_destroy_pkgdbinfo(handle);
5053 pkgmgrinfo_destroy_pkgdbinfo(handle);
5058 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5061 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5062 const char *author_email, const char *author_href, const char *locale)
5063 * @brief This API sets the package author info in db handle
5065 * @par This API is for package-manager client application
5066 * @par Sync (or) Async : Synchronous API
5068 * @param[in] handle pointer to the pkgdbinfo handle.
5069 * @param[in] author_name pointer to the package author name
5070 * @param[in] author_email pointer to the package author email
5071 * @param[in] author_href pointer to the package author href
5072 * @param[in] locale pointer to the locale
5073 * @return 0 if success, error code(<0) if fail
5074 * @retval PMINFO_R_OK success
5075 * @retval PMINFO_R_EINVAL invalid argument
5076 * @retval PMINFO_R_ERROR internal error
5077 * @pre pkgmgrinfo_create_pkgdbinfo()
5078 * @post pkgmgrinfo_destroy_pkgdbinfo()
5079 * @see pkgmgrinfo_save_pkgdbinfo()
5080 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5082 static int set_pkg_author_in_db(const char *pkgid)
5085 pkgmgrinfo_pkgdbinfo_h handle;
5086 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5087 if (ret != PMINFO_R_OK)
5089 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5090 if (ret != PMINFO_R_OK) {
5091 pkgmgrinfo_destroy_pkgdbinfo(handle);
5094 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5095 if (ret != PMINFO_R_OK) {
5096 pkgmgrinfo_destroy_pkgdbinfo(handle);
5099 pkgmgrinfo_destroy_pkgdbinfo(handle);
5104 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5105 const char *author_email, const char *author_href, const char *locale);
5108 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5109 * @brief This API sets the package 'removable' value in db handle
5111 * @par This API is for package-manager client application
5112 * @par Sync (or) Async : Synchronous API
5114 * @param[in] handle pointer to the pkgdbinfo handle.
5115 * @param[in] removable package removable value
5116 * @return 0 if success, error code(<0) if fail
5117 * @retval PMINFO_R_OK success
5118 * @retval PMINFO_R_EINVAL invalid argument
5119 * @retval PMINFO_R_ERROR internal error
5120 * @pre pkgmgrinfo_create_pkgdbinfo()
5121 * @post pkgmgrinfo_destroy_pkgdbinfo()
5122 * @see pkgmgrinfo_save_pkgdbinfo()
5123 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5125 static int set_pkg_removable_in_db(const char *pkgid)
5128 pkgmgrinfo_pkgdbinfo_h handle;
5129 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5130 if (ret != PMINFO_R_OK)
5132 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5133 if (ret != PMINFO_R_OK) {
5134 pkgmgrinfo_destroy_pkgdbinfo(handle);
5137 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5138 if (ret != PMINFO_R_OK) {
5139 pkgmgrinfo_destroy_pkgdbinfo(handle);
5142 pkgmgrinfo_destroy_pkgdbinfo(handle);
5147 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5150 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5151 * @brief This API sets the package 'preload' value in db handle
5153 * @par This API is for package-manager client application
5154 * @par Sync (or) Async : Synchronous API
5156 * @param[in] handle pointer to the pkgdbinfo handle.
5157 * @param[in] preload package preload value
5158 * @return 0 if success, error code(<0) if fail
5159 * @retval PMINFO_R_OK success
5160 * @retval PMINFO_R_EINVAL invalid argument
5161 * @retval PMINFO_R_ERROR internal error
5162 * @pre pkgmgrinfo_create_pkgdbinfo()
5163 * @post pkgmgrinfo_destroy_pkgdbinfo()
5164 * @see pkgmgrinfo_save_pkgdbinfo()
5165 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5167 static int set_pkg_preload_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_preload_to_pkgdbinfo(handle, 1);
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_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5192 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5193 * @brief This API sets the package 'installed_storage' value in db handle
5195 * @par This API is for package-manager client application
5196 * @par Sync (or) Async : Synchronous API
5198 * @param[in] handle pointer to the pkgdbinfo handle.
5199 * @param[in] location installed_storage value
5200 * @return 0 if success, error code(<0) if fail
5201 * @retval PMINFO_R_OK success
5202 * @retval PMINFO_R_EINVAL invalid argument
5203 * @retval PMINFO_R_ERROR internal error
5204 * @pre pkgmgrinfo_create_pkgdbinfo()
5205 * @post pkgmgrinfo_destroy_pkgdbinfo()
5206 * @see pkgmgrinfo_save_pkgdbinfo()
5208 static int set_pkg_installed_storage_in_db(const char *pkgid)
5211 pkgmgrinfo_pkgdbinfo_h handle;
5212 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5213 if (ret != PMINFO_R_OK)
5215 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5216 if (ret != PMINFO_R_OK) {
5217 pkgmgrinfo_destroy_pkgdbinfo(handle);
5220 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5221 if (ret != PMINFO_R_OK) {
5222 pkgmgrinfo_destroy_pkgdbinfo(handle);
5225 pkgmgrinfo_destroy_pkgdbinfo(handle);
5230 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5233 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5234 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5235 * @brief This API saves all the information from the handle to the DB.
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 * @param[in] uid the addressee user id of the instruction
5242 * @return 0 if success, error code(<0) if fail
5243 * @retval PMINFO_R_OK success
5244 * @retval PMINFO_R_EINVAL invalid argument
5245 * @retval PMINFO_R_ERROR internal error
5246 * @pre pkgmgrinfo_create_pkgdbinfo()
5247 * @post pkgmgrinfo_destroy_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_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5273 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5275 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5276 * @brief This API destroys the package db information handle freeing up all the resources
5278 * @par This API is for package-manager client application
5279 * @par Sync (or) Async : Synchronous API
5281 * @param[in] handle pointer to the package db info handle.
5282 * @return 0 if success, error code(<0) if fail
5283 * @retval PMINFO_R_OK success
5284 * @retval PMINFO_R_EINVAL invalid argument
5285 * @retval PMINFO_R_ERROR internal error
5286 * @pre pkgmgrinfo_create_pkgdbinfo()
5288 * @see pkgmgrinfo_save_pkgdbinfo()
5289 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5291 static int set_pkg_in_db(const char *pkgid)
5294 pkgmgrinfo_pkgdbinfo_h handle;
5295 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5296 if (ret != PMINFO_R_OK)
5298 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5299 if (ret != PMINFO_R_OK) {
5300 pkgmgrinfo_destroy_pkgdbinfo(handle);
5303 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5304 if (ret != PMINFO_R_OK) {
5305 pkgmgrinfo_destroy_pkgdbinfo(handle);
5308 pkgmgrinfo_destroy_pkgdbinfo(handle);
5313 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5317 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5318 * @brief This API creates the package cert information handle to set data in db.
5320 * @par This API is for package-manager client application
5321 * @par Sync (or) Async : Synchronous API
5323 * @param[out] handle pointer to the package cert handle.
5324 * @return 0 if success, error code(<0) if fail
5325 * @retval PMINFO_R_OK success
5326 * @retval PMINFO_R_EINVAL invalid argument
5327 * @retval PMINFO_R_ERROR internal error
5329 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5330 * @see pkgmgrinfo_set_cert_value()
5331 * @see pkgmgrinfo_save_certinfo()
5333 static int set_cert_in_db(const char *pkgid)
5336 pkgmgrinfo_instcertinfo_h handle;
5337 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5338 if (ret != PMINFO_R_OK)
5340 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5341 if (ret != PMINFO_R_OK) {
5342 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5345 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5346 if (ret != PMINFO_R_OK) {
5347 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5350 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5355 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5358 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5359 * @brief This API sets the package cert information in the handle.
5361 * @par This API is for package-manager client application
5362 * @par Sync (or) Async : Synchronous API
5364 * @param[in] handle pointer to the package cert handle.
5365 * @param[in] cert_type certificate type.
5366 * @param[in] cert_value certificate value.
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_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5400 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5401 * @brief This API saves the package cert information in the DB.
5403 * @par This API is for package-manager client application
5404 * @par Sync (or) Async : Synchronous API
5406 * @param[in] pkgid pointer to the package ID.
5407 * @param[in] handle pointer to the package cert handle.
5408 * @return 0 if success, error code(<0) if fail
5409 * @retval PMINFO_R_OK success
5410 * @retval PMINFO_R_EINVAL invalid argument
5411 * @retval PMINFO_R_ERROR internal error
5412 * @pre pkgmgrinfo_create_certinfo_set_handle()
5413 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5414 * @see pkgmgrinfo_save_certinfo()
5416 static int set_cert_in_db(const char *pkgid)
5419 pkgmgrinfo_instcertinfo_h handle;
5420 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5421 if (ret != PMINFO_R_OK)
5423 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5424 if (ret != PMINFO_R_OK) {
5425 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5428 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5429 if (ret != PMINFO_R_OK) {
5430 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5433 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5438 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5441 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5442 * @brief This API destroys the package cert information handle freeing up all the resources.
5444 * @par This API is for package-manager client application
5445 * @par Sync (or) Async : Synchronous API
5447 * @param[in] handle pointer to the package cert handle.
5448 * @return 0 if success, error code(<0) if fail
5449 * @retval PMINFO_R_OK success
5450 * @retval PMINFO_R_EINVAL invalid argument
5451 * @retval PMINFO_R_ERROR internal error
5452 * @pre pkgmgrinfo_create_certinfo_set_handle()
5454 * @see pkgmgrinfo_save_certinfo()
5456 static int set_cert_in_db(const char *pkgid)
5459 pkgmgrinfo_instcertinfo_h handle;
5460 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5461 if (ret != PMINFO_R_OK)
5463 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5464 if (ret != PMINFO_R_OK) {
5465 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5468 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5469 if (ret != PMINFO_R_OK) {
5470 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5473 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5478 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5481 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5482 * @brief This API gets the datacontrol info
5484 * @par This API is for package-manager client application
5485 * @par Sync (or) Async : Synchronous API
5487 * @param[in] providerid pointer to the providerid of dataconltrol.
5488 * @param[in] type pointer to the type of dataconltrol.
5489 * @param[out] appid pointer to hold appid, need to free after using
5490 * @param[out] access pointer to hold access, need to free after using
5491 * @return 0 if success, error code(<0) if fail
5492 * @retval PMINFO_R_OK success
5493 * @retval PMINFO_R_EINVAL invalid argument
5494 * @retval PMINFO_R_ERROR internal error
5497 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5500 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5501 * @brief This API gets the application 'guest mode visibility' value from the DB
5503 * @par This API is for package-manager client application
5504 * @par Sync (or) Async : Synchronous API
5506 * @param[in] handle pointer to application info handle
5507 * @param[out] status pointer to hold app guest mode visibility value
5508 * @return 0 if success, error code(<0) if fail
5509 * @retval PMINFO_R_OK success
5510 * @retval PMINFO_R_EINVAL invalid argument
5511 * @retval PMINFO_R_ERROR internal error
5512 * @pre pkgmgrinfo_appinfo_get_appinfo()
5513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5514 * @see pkgmgrinfo_appinfo_get_appid()
5515 * @see pkgmgrinfo_appinfo_is_multiple()
5517 static int get_app_guestmode_visibility(const char *appid)
5521 pkgmgrinfo_appinfo_h handle;
5522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5523 if (ret != PMINFO_R_OK)
5525 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5526 if (ret != PMINFO_R_OK) {
5527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5530 printf("app guest mode visibility: %d\n", status);
5531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5536 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5539 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5540 * @brief This API sets the application 'guest mode visibility' value in the DB
5542 * @par This API is for package-manager client application
5543 * @par Sync (or) Async : Synchronous API
5545 * @param[in] handle pointer to application info handle
5546 * @param[out] status app guest mode visibility value
5547 * @return 0 if success, error code(<0) if fail
5548 * @retval PMINFO_R_OK success
5549 * @retval PMINFO_R_EINVAL invalid argument
5550 * @retval PMINFO_R_ERROR internal error
5551 * @pre pkgmgrinfo_appinfo_get_appinfo()
5552 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5553 * @see pkgmgrinfo_appinfo_get_appid()
5554 * @see pkgmgrinfo_appinfo_is_multiple()
5556 static int set_app_guestmode_visibility(const char *appid, bool value)
5559 pkgmgrinfo_appinfo_h handle;
5560 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5561 if (ret != PMINFO_R_OK)
5563 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5564 if (ret != PMINFO_R_OK) {
5565 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5573 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5574 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5576 * @pkgmgrinfo client API
5580 * @brief listening status type in pkgmgrinfo.
5582 #define PMINFO_CLIENT_STATUS_ALL 0x00
5583 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5584 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5585 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5586 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5587 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5588 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5591 * @brief type definition.
5593 typedef void pkgmgrinfo_client;
5594 typedef int (*pkgmgrinfo_handler)(int req_id, const char *pkg_type,
5595 const char *pkgid, const char *key,
5596 const char *val, const void *pmsg, void *data);
5602 }pkgmgrinfo_client_type;
5605 * @brief This APIs provides pkgmgrinfo client listener
5607 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5608 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5609 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5610 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5611 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5614 int pkgmgrinfo_appinfo_get_event_launch_list(GList **es_info);
5615 int pkgmgrinfo_appinfo_get_usr_event_launch_list(GList **es_info, uid_t uid);
5616 int pkgmgrinfo_appinfo_get_event_launch_list_by_appid(const char *appid, GList **es_info);
5617 int pkgmgrinfo_appinfo_get_usr_event_launch_list_by_appid(const char *appid, GList **es_info, uid_t uid);
5621 * @pkgmgrinfo client API end
5629 #endif /* __PKG_INFO_H__ */