4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
29 * @author Sewook Park <sewook7.park@samsung.com>
30 * @author Shobhit Srivastava <shobhit.s@samsung.com>
32 * @brief This file declares API of pkgmgr-info library
34 * @addtogroup APPLICATION_FRAMEWORK
37 * @defgroup PackageManagerInfo
38 * @section Header Header file to include:
40 * #include <pkgmgr-info.h>
46 #ifndef __PKG_INFO_H__
47 #define __PKG_INFO_H__
52 #include "pkgmgrinfo_type.h"
53 #include "pkgmgrinfo_feature.h"
62 * This is package information library
64 * Package Information Library is used to get package related information.\n
65 * It uses the package manifest information database to get any package related information\n
66 * It also provides API to set information in the package info database\n
72 * @brief Package Information Library Header File
74 * Generated by Sewook Park <sewook7.park@samsung.com>
79 * @brief Value to be used when filtering based on install location
81 #define PMINFO_PKGINFO_INSTALL_LOCATION_AUTO "LOCATION_AUTO"
84 * @brief Value to be used when filtering based on install location
86 #define PMINFO_PKGINFO_INSTALL_LOCATION_INTERNAL "LOCATION_INTERNAL"
89 * @brief Value to be used when filtering based on install location
91 #define PMINFO_PKGINFO_INSTALL_LOCATION_EXTERNAL "LOCATION_EXTERNAL"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
95 /** String property for filtering based on package info*/
96 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
97 /** String property for filtering based on package info*/
98 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
99 /** String property for filtering based on package info*/
100 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
101 /** String property for filtering based on package info*/
102 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
103 /** String property for filtering based on package info*/
104 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
105 /** String property for filtering based on package info*/
106 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
107 /** String property for filtering based on package info*/
108 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
109 /** String property for filtering based on package info*/
110 #define PMINFO_PKGINFO_PROP_PACKAGE_STORECLIENT_ID "PMINFO_PKGINFO_PROP_PACKAGE_STORECLIENT_ID"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
116 /** Boolean property for filtering based on package info*/
117 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
118 /** Boolean property for filtering based on package info*/
119 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
120 /** Boolean property for filtering based on package info*/
121 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
122 /** Boolean property for filtering based on package info*/
123 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
124 /** Boolean property for filtering based on package info*/
125 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
126 /** Boolean property for filtering based on package info*/
127 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
128 /** Boolean property for filtering based on package info*/
129 #define PMINFO_PKGINFO_PROP_PACKAGE_USE_RESET "PMINFO_PKGINFO_PROP_PACKAGE_USE_RESET"
131 /** Integer property for filtering based on package info*/
132 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
133 /** Integer property for filtering based on package info*/
134 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_MODE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_MODE"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_COMPONENT_TYPE "PMINFO_APPINFO_PROP_APP_COMPONENT_TYPE"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_AMBIENT_SUPPORT "PMINFO_APPINFO_PROP_APP_AMBIENT_SUPPORT"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
148 /** String property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
150 /** String property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
152 /** String property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
154 /** String property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
156 /** String property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
158 /** String property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
160 /** String property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
163 /** Boolean property for filtering based on app info*/
164 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
165 /** Boolean property for filtering based on app info*/
166 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
167 /** Boolean property for filtering based on app info*/
168 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
169 /** Boolean property for filtering based on app info*/
170 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
171 /** Boolean property for filtering based on app info*/
172 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
173 /** Boolean property for filtering based on app info*/
174 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
175 /** Boolean property for filtering based on app info*/
176 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
177 /** Boolean property for filtering based on app info*/
178 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
179 /** Boolean property for filtering based on app info*/
180 #define PMINFO_APPINFO_PROP_APP_REMOVABLE "PMINFO_APPINFO_PROP_APP_REMOVABLE"
182 /** Integer property for filtering based on app info*/
183 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
185 /** will be updated*/
186 /** string property for filtering based on pkg info*/
187 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
189 /** Integer property for mode*/
190 #define PMINFO_MODE_PROP_ULTRA_POWER_SAVING 0x00000001
191 #define PMINFO_MODE_PROP_COOL_DOWN 0x00000002
192 #define PMINFO_MODE_PROP_SCREEN_READER 0x00000004
197 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
198 * @brief This API gets list of installed packages
200 * @par This API is for package-manager client application
201 * @par Sync (or) Async : Synchronous API
202 * @param[in] pkg_list_cb iteration function for list
203 * @param[in] user_data user data to be passed to callback function
204 * @return 0 if success, error code(<0) if fail
205 * @retval PMINFO_R_OK success
206 * @retval PMINFO_R_EINVAL invalid argument
207 * @retval PMINFO_R_ERROR internal error
211 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
215 pkgid1 = (char *)user_data;
216 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
217 if (strcmp(pkgid1, pkgid2) == 0) {
224 static int list_pkgs()
227 char *name = "helloworld";
228 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
229 if (ret != PMINFO_R_OK) {
236 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
239 * @fn int pkgmgrinfo_pkginfo_get_mounted_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
240 * @brief This API gets list of package which are installed in sd card when sd card is mounted
242 * @par This API is for package-manager client application
243 * @par Sync (or) Async : Synchronous API
244 * @param[in] pkg_list_cb iteration function for list
245 * @param[in] user_data user data to be passed to callback function
246 * @return 0 if success, error code(<0) if fail
247 * @retval PMINFO_R_OK success
248 * @retval PMINFO_R_EINVAL invalid argument
249 * @retval PMINFO_R_ERROR internal error
253 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
257 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
258 printf("appid: %s\n", pkgid2);
263 static int mounted_list_pkgs()
267 ret = pkgmgrinfo_pkginfo_get_mounted_list(pkg_list_cb, NULL);
268 if (ret != PMINFO_R_OK) {
275 int pkgmgrinfo_pkginfo_get_mounted_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
278 * @fn int pkgmgrinfo_pkginfo_get_unmounted_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
279 * @brief This API gets list of package which are installed in sd card when sd card is unmounted
281 * @par This API is for package-manager client application
282 * @par Sync (or) Async : Synchronous API
283 * @param[in] pkg_list_cb iteration function for list
284 * @param[in] user_data user data to be passed to callback function
285 * @return 0 if success, error code(<0) if fail
286 * @retval PMINFO_R_OK success
287 * @retval PMINFO_R_EINVAL invalid argument
288 * @retval PMINFO_R_ERROR internal error
292 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
296 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
297 printf("appid: %s\n", pkgid2);
302 static int unmounted_list_pkgs()
306 ret = pkgmgrinfo_pkginfo_get_unmounted_list(pkg_list_cb, NULL);
307 if (ret != PMINFO_R_OK) {
314 int pkgmgrinfo_pkginfo_get_unmounted_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
317 * @fn int pkgmgrinfo_pkginfo_get_unmounted_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
318 * @brief This API creates the package information handle from db
320 * @par This API is for package-manager client application
321 * @par Sync (or) Async : Synchronous API
323 * @param[in] pkgid pointer to package ID
324 * @param[out] handle pointer to the package info handle.
325 * @return 0 if success, error code(<0) if fail
326 * @retval PMINFO_R_OK success
327 * @retval PMINFO_R_EINVAL invalid argument
328 * @retval PMINFO_R_ERROR internal error
330 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
331 * @see pkgmgrinfo_pkginfo_get_pkgid()
332 * @see pkgmgrinfo_pkginfo_is_removable()
334 static int get_pkg_type(const char *pkgid)
338 pkgmgrinfo_pkginfo_h handle;
339 ret = pkgmgrinfo_pkginfo_get_unmounted_pkginfo(pkgid, &handle);
340 if (ret != PMINFO_R_OK)
342 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
343 if (ret != PMINFO_R_OK) {
344 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347 printf("pkgtype: %s\n", type);
348 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
353 int pkgmgrinfo_pkginfo_get_unmounted_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
356 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
357 * @brief This API creates the package information handle from db
359 * @par This API is for package-manager client application
360 * @par Sync (or) Async : Synchronous API
362 * @param[in] pkgid pointer to package ID
363 * @param[out] handle pointer to the package info handle.
364 * @return 0 if success, error code(<0) if fail
365 * @retval PMINFO_R_OK success
366 * @retval PMINFO_R_EINVAL invalid argument
367 * @retval PMINFO_R_ERROR internal error
369 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
370 * @see pkgmgrinfo_pkginfo_get_pkgid()
371 * @see pkgmgrinfo_pkginfo_is_removable()
373 static int get_pkg_type(const char *pkgid)
377 pkgmgrinfo_pkginfo_h handle;
378 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
379 if (ret != PMINFO_R_OK)
381 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
382 if (ret != PMINFO_R_OK) {
383 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
386 printf("pkgtype: %s\n", type);
387 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
392 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
395 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
396 * @brief This API gets the package name from the package ID
398 * @par This API is for package-manager client application
399 * @par Sync (or) Async : Synchronous API
401 * @param[in] handle pointer to package info handle
402 * @param[out] pkg_name pointer to hold package name
403 * @return 0 if success, error code(<0) if fail
404 * @retval PMINFO_R_OK success
405 * @retval PMINFO_R_EINVAL invalid argument
406 * @retval PMINFO_R_ERROR internal error
407 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
408 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
409 * @see pkgmgrinfo_pkginfo_get_type()
410 * @see pkgmgrinfo_pkginfo_is_removable()
412 static int get_pkg_name(const char *pkgid)
415 char *pkgname = NULL;
416 pkgmgrinfo_pkginfo_h handle;
417 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
418 if (ret != PMINFO_R_OK)
420 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
421 if (ret != PMINFO_R_OK) {
422 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
425 printf("pkgname: %s\n", pkgname);
426 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
431 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
434 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
435 * @brief This API gets the package id from the package ID
437 * @par This API is for package-manager client application
438 * @par Sync (or) Async : Synchronous API
440 * @param[in] handle pointer to package info handle
441 * @param[out] pkgid pointer to hold package id
442 * @return 0 if success, error code(<0) if fail
443 * @retval PMINFO_R_OK success
444 * @retval PMINFO_R_EINVAL invalid argument
445 * @retval PMINFO_R_ERROR internal error
446 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
447 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
448 * @see pkgmgrinfo_pkginfo_get_type()
449 * @see pkgmgrinfo_pkginfo_is_removable()
451 static int get_pkgid(const char *pkgid)
455 pkgmgrinfo_pkginfo_h handle;
456 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
457 if (ret != PMINFO_R_OK)
459 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
460 if (ret != PMINFO_R_OK) {
461 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
464 printf("pkg id: %s\n", pkg_id);
465 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
470 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
473 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
474 * @brief This API gets the package type from the package ID
476 * @par This API is for package-manager client application
477 * @par Sync (or) Async : Synchronous API
479 * @param[in] handle pointer to package info handle
480 * @param[out] type pointer to hold package type
481 * @return 0 if success, error code(<0) if fail
482 * @retval PMINFO_R_OK success
483 * @retval PMINFO_R_EINVAL invalid argument
484 * @retval PMINFO_R_ERROR internal error
485 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
486 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
487 * @see pkgmgrinfo_pkginfo_get_pkgid()
488 * @see pkgmgrinfo_pkginfo_is_removable()
490 static int get_pkg_type(const char *pkgid)
494 pkgmgrinfo_pkginfo_h handle;
495 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
496 if (ret != PMINFO_R_OK)
498 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
499 if (ret != PMINFO_R_OK) {
500 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
503 printf("pkgtype: %s\n", type);
504 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
509 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
512 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
513 * @brief This API gets the package version from the package ID
515 * @par This API is for package-manager client application
516 * @par Sync (or) Async : Synchronous API
518 * @param[in] handle pointer to package info handle
519 * @param[out] version pointer to hold package version
520 * @return 0 if success, error code(<0) if fail
521 * @retval PMINFO_R_OK success
522 * @retval PMINFO_R_EINVAL invalid argument
523 * @retval PMINFO_R_ERROR internal error
524 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
525 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
526 * @see pkgmgrinfo_pkginfo_get_pkgid()
527 * @see pkgmgrinfo_pkginfo_is_removable()
529 static int get_pkg_version(const char *pkgid)
532 char *version = NULL;
533 pkgmgrinfo_pkginfo_h handle;
534 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
535 if (ret != PMINFO_R_OK)
537 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
538 if (ret != PMINFO_R_OK) {
539 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
542 printf("pkg version: %s\n", version);
543 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
548 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
551 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
552 * @brief This API gets the package install location from the package ID
554 * @par This API is for package-manager client application
555 * @par Sync (or) Async : Synchronous API
557 * @param[in] handle pointer to package info handle
558 * @param[out] location pointer to hold package install location
559 * @return 0 if success, error code(<0) if fail
560 * @retval PMINFO_R_OK success
561 * @retval PMINFO_R_EINVAL invalid argument
562 * @retval PMINFO_R_ERROR internal error
563 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
564 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
565 * @see pkgmgrinfo_pkginfo_get_pkgid()
566 * @see pkgmgrinfo_pkginfo_is_removable()
568 static int get_pkg_install_location(const char *pkgid)
571 pkgmgrinfo_install_location location;
572 pkgmgrinfo_pkginfo_h handle;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("pkg install location: %d\n", location);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
590 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
591 * @brief This API gets the package icon from the package ID
593 * @par This API is for package-manager client application
594 * @par Sync (or) Async : Synchronous API
596 * @param[in] handle pointer to package info handle
597 * @param[out] icon pointer to hold package icon
598 * @return 0 if success, error code(<0) if fail
599 * @retval PMINFO_R_OK success
600 * @retval PMINFO_R_EINVAL invalid argument
601 * @retval PMINFO_R_ERROR internal error
602 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
603 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
604 * @see pkgmgrinfo_pkginfo_get_pkgid()
605 * @see pkgmgrinfo_pkginfo_is_removable()
607 static int get_pkg_icon(const char *pkgid)
611 pkgmgrinfo_pkginfo_h handle;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 printf("pkg icon: %s\n", icon);
621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
626 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
629 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
630 * @brief This API gets the package label from the package ID
632 * @par This API is for package-manager client application
633 * @par Sync (or) Async : Synchronous API
635 * @param[in] handle pointer to package info handle
636 * @param[out] label pointer to hold package label
637 * @return 0 if success, error code(<0) if fail
638 * @retval PMINFO_R_OK success
639 * @retval PMINFO_R_EINVAL invalid argument
640 * @retval PMINFO_R_ERROR internal error
641 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
642 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
643 * @see pkgmgrinfo_pkginfo_get_pkgid()
644 * @see pkgmgrinfo_pkginfo_is_removable()
646 static int get_pkg_label(const char *pkgid)
650 pkgmgrinfo_pkginfo_h handle;
651 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
652 if (ret != PMINFO_R_OK)
654 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
655 if (ret != PMINFO_R_OK) {
656 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
659 printf("pkg label: %s\n", label);
660 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
665 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
668 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
669 * @brief This API gets the package description from the package ID
671 * @par This API is for package-manager client application
672 * @par Sync (or) Async : Synchronous API
674 * @param[in] handle pointer to package info handle
675 * @param[out] description pointer to hold package description
676 * @return 0 if success, error code(<0) if fail
677 * @retval PMINFO_R_OK success
678 * @retval PMINFO_R_EINVAL invalid argument
679 * @retval PMINFO_R_ERROR internal error
680 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
681 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
682 * @see pkgmgrinfo_pkginfo_get_pkgid()
683 * @see pkgmgrinfo_pkginfo_is_removable()
685 static int get_pkg_description(const char *pkgid)
688 char *description = NULL;
689 pkgmgrinfo_pkginfo_h handle;
690 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
691 if (ret != PMINFO_R_OK)
693 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
694 if (ret != PMINFO_R_OK) {
695 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
698 printf("pkg description: %s\n", description);
699 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
704 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
707 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
708 * @brief This API gets the package's author name from the package ID
710 * @par This API is for package-manager client application
711 * @par Sync (or) Async : Synchronous API
713 * @param[in] handle pointer to package info handle
714 * @param[out] author_name pointer to hold package author name
715 * @return 0 if success, error code(<0) if fail
716 * @retval PMINFO_R_OK success
717 * @retval PMINFO_R_EINVAL invalid argument
718 * @retval PMINFO_R_ERROR internal error
719 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
720 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
721 * @see pkgmgrinfo_pkginfo_get_pkgid()
722 * @see pkgmgrinfo_pkginfo_is_removable()
724 static int get_pkg_author_name(const char *pkgid)
727 char *author_name = NULL;
728 pkgmgrinfo_pkginfo_h handle;
729 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
730 if (ret != PMINFO_R_OK)
732 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
733 if (ret != PMINFO_R_OK) {
734 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
737 printf("pkg author name: %s\n", author_name);
738 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
743 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
746 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
747 * @brief This API gets the package's author email from the package ID
749 * @par This API is for package-manager client application
750 * @par Sync (or) Async : Synchronous API
752 * @param[in] handle pointer to package info handle
753 * @param[out] author_email pointer to hold package author email
754 * @return 0 if success, error code(<0) if fail
755 * @retval PMINFO_R_OK success
756 * @retval PMINFO_R_EINVAL invalid argument
757 * @retval PMINFO_R_ERROR internal error
758 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
759 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
760 * @see pkgmgrinfo_pkginfo_get_pkgid()
761 * @see pkgmgrinfo_pkginfo_is_removable()
763 static int get_pkg_author_email(const char *pkgid)
766 char *author_email = NULL;
767 pkgmgrinfo_pkginfo_h handle;
768 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
769 if (ret != PMINFO_R_OK)
771 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
772 if (ret != PMINFO_R_OK) {
773 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
776 printf("pkg author email: %s\n", author_email);
777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
785 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
786 * @brief This API gets the package's author href from the package ID
788 * @par This API is for package-manager client application
789 * @par Sync (or) Async : Synchronous API
791 * @param[in] handle pointer to package info handle
792 * @param[out] author_href pointer to hold package author href
793 * @return 0 if success, error code(<0) if fail
794 * @retval PMINFO_R_OK success
795 * @retval PMINFO_R_EINVAL invalid argument
796 * @retval PMINFO_R_ERROR internal error
797 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
798 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
799 * @see pkgmgrinfo_pkginfo_get_pkgid()
800 * @see pkgmgrinfo_pkginfo_is_removable()
802 static int get_pkg_author_href(const char *pkgid)
805 char *author_href = NULL;
806 pkgmgrinfo_pkginfo_h handle;
807 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
808 if (ret != PMINFO_R_OK)
810 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
811 if (ret != PMINFO_R_OK) {
812 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
815 printf("pkg author href: %s\n", author_href);
816 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
821 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
824 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
825 * @brief This API gets the package installed storagae value from the package ID
827 * @par This API is for package-manager client application
828 * @par Sync (or) Async : Synchronous API
830 * @param[in] handle pointer to package info handle
831 * @param[out] storage pointer to hold package installed storage
832 * @return 0 if success, error code(<0) if fail
833 * @retval PMINFO_R_OK success
834 * @retval PMINFO_R_EINVAL invalid argument
835 * @retval PMINFO_R_ERROR internal error
836 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
837 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
838 * @see pkgmgrinfo_pkginfo_get_pkgid()
839 * @see pkgmgrinfo_pkginfo_is_removable()
841 static int get_pkg_installed_storage(const char *pkgid)
844 pkgmgrinfo_installed_storage storage;
845 pkgmgrinfo_pkginfo_h handle;
846 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
847 if (ret != PMINFO_R_OK)
849 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
850 if (ret != PMINFO_R_OK) {
851 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
854 printf("pkg installed storage: %d\n", storage);
855 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
860 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
863 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
864 * @brief This API gets the installed time of package from the package ID
866 * @par This API is for package-manager client application
867 * @par Sync (or) Async : Synchronous API
869 * @param[in] handle pointer to package info handle
870 * @param[out] installed_time pointer to hold installed time of package
871 * @return 0 if success, error code(<0) if fail
872 * @retval PMINFO_R_OK success
873 * @retval PMINFO_R_EINVAL invalid argument
874 * @retval PMINFO_R_ERROR internal error
875 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
876 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
877 * @see pkgmgrinfo_pkginfo_get_pkgid()
878 * @see pkgmgrinfo_pkginfo_is_removable()
880 static int get_pkg_installed_time(const char *pkgid)
883 int installed_time = 0;
884 pkgmgrinfo_pkginfo_h handle;
885 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
886 if (ret != PMINFO_R_OK)
888 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
889 if (ret != PMINFO_R_OK) {
890 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
893 printf("installed_time: %d\n", installed_time);
894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
899 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
902 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
903 * @brief This API gets the store client id of package from the package ID
905 * @par This API is for package-manager client application
906 * @par Sync (or) Async : Synchronous API
908 * @param[in] handle pointer to package info handle
909 * @param[out] storeclientid pointer to hold store client id of package
910 * @return 0 if success, error code(<0) if fail
911 * @retval PMINFO_R_OK success
912 * @retval PMINFO_R_EINVAL invalid argument
913 * @retval PMINFO_R_ERROR internal error
914 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
915 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
916 * @see pkgmgrinfo_pkginfo_get_pkgid()
917 * @see pkgmgrinfo_pkginfo_is_removable()
919 static int get_pkg_storeclientid(const char *pkgid)
922 char *storeclientid = 0;
923 pkgmgrinfo_pkginfo_h handle;
924 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
925 if (ret != PMINFO_R_OK)
927 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
928 if (ret != PMINFO_R_OK) {
929 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
932 printf(store client id: %s\n", storeclientid);
933 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
938 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
941 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
942 * @brief This API gets the main app id of package from the package ID
944 * @par This API is for package-manager client application
945 * @par Sync (or) Async : Synchronous API
947 * @param[in] handle pointer to package info handle
948 * @param[out] mainappid pointer to hold main app id of package
949 * @return 0 if success, error code(<0) if fail
950 * @retval PMINFO_R_OK success
951 * @retval PMINFO_R_EINVAL invalid argument
952 * @retval PMINFO_R_ERROR internal error
953 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
954 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
955 * @see pkgmgrinfo_pkginfo_get_pkgid()
956 * @see pkgmgrinfo_pkginfo_is_removable()
958 static int get_pkg_mainappid(const char *pkgid)
962 pkgmgrinfo_pkginfo_h handle;
963 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
964 if (ret != PMINFO_R_OK)
966 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
967 if (ret != PMINFO_R_OK) {
968 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
971 printf(main app id: %s\n", mainappid);
972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
977 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
980 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
981 * @brief This API gets the url of package from the package ID
983 * @par This API is for package-manager client application
984 * @par Sync (or) Async : Synchronous API
986 * @param[in] handle pointer to package info handle
987 * @param[out] url pointer to hold url of package
988 * @return 0 if success, error code(<0) if fail
989 * @retval PMINFO_R_OK success
990 * @retval PMINFO_R_EINVAL invalid argument
991 * @retval PMINFO_R_ERROR internal error
992 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
993 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
994 * @see pkgmgrinfo_pkginfo_get_pkgid()
995 * @see pkgmgrinfo_pkginfo_is_removable()
997 static int get_pkg_url(const char *pkgid)
1001 pkgmgrinfo_pkginfo_h handle;
1002 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1003 if (ret != PMINFO_R_OK)
1005 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1006 if (ret != PMINFO_R_OK) {
1007 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1010 printf("url : %s\n", url);
1011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1016 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1020 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1021 * @brief This API gets the root path of package
1023 * @par Sync (or) Async : Synchronous API
1025 * @param[in] handle pointer to package info handle
1026 * @param[out] path pointer to hold root path of package
1027 * @return 0 if success, error code(<0) if fail
1028 * @retval PMINFO_R_OK success
1029 * @retval PMINFO_R_EINVAL invalid argument
1030 * @retval PMINFO_R_ERROR internal error
1032 static int get_root_path(const char *pkgid)
1036 pkgmgrinfo_pkginfo_h handle;
1037 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1038 if (ret != PMINFO_R_OK)
1041 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1042 if (ret != PMINFO_R_OK) {
1043 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1046 printf("path : %s\n", path);
1047 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1053 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1057 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1058 * @brief This API gets the csc path of package
1060 * @par Sync (or) Async : Synchronous API
1062 * @param[in] handle pointer to package info handle
1063 * @param[out] path pointer to hold csc path of package
1064 * @return 0 if success, error code(<0) if fail
1065 * @retval PMINFO_R_OK success
1066 * @retval PMINFO_R_EINVAL invalid argument
1067 * @retval PMINFO_R_ERROR internal error
1069 static int get_csc_path(const char *pkgid)
1073 pkgmgrinfo_pkginfo_h handle;
1074 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1075 if (ret != PMINFO_R_OK)
1078 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1079 if (ret != PMINFO_R_OK) {
1080 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1083 printf("path : %s\n", path);
1084 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1090 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1093 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1094 * @brief This API gets the support_mode of package
1096 * @par Sync (or) Async : Synchronous API
1098 * @param[in] handle pointer to package info handle
1099 * @param[out] support_mode pointer to hold support_mode of package
1100 * @return 0 if success, error code(<0) if fail
1101 * @retval PMINFO_R_OK success
1102 * @retval PMINFO_R_EINVAL invalid argument
1103 * @retval PMINFO_R_ERROR internal error
1105 static int get_support_mode(const char *pkgid)
1108 int *support_mode = 0;
1109 pkgmgrinfo_pkginfo_h handle = NULL;
1110 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1111 if (ret != PMINFO_R_OK)
1114 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1115 if (ret != PMINFO_R_OK) {
1116 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1119 printf("support_mode : %s\n", support_mode);
1120 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1126 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1130 * @fn int pkgmgrinfo_pkginfo_get_hash(pkgmgrinfo_pkginfo_h handle, char **hash)
1131 * @brief This API gets the package_hash of package
1133 * @par Sync (or) Async : Synchronous API
1135 * @param[in] handle pointer to package info handle
1136 * @param[out] hash pointer to hold package_hash of package
1137 * @return 0 if success, error code(<0) if fail
1138 * @retval PMINFO_R_OK success
1139 * @retval PMINFO_R_EINVAL invalid argument
1140 * @retval PMINFO_R_ERROR internal error
1142 static int get_package_hash(const char *pkgid)
1146 pkgmgrinfo_pkginfo_h handle = NULL;
1147 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1148 if (ret != PMINFO_R_OK)
1151 ret = pkgmgrinfo_pkginfo_get_hash(handle, &hash);
1152 if (ret != PMINFO_R_OK) {
1153 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1156 printf("package_hash : %s\n", hash);
1157 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1164 int pkgmgrinfo_pkginfo_get_hash(pkgmgrinfo_pkginfo_h handle, char **hash);
1167 * @fn int pkgmgrinfo_pkginfo_get_support_reset(pkgmgrinfo_pkginfo_h handle, char **support_reset)
1168 * @brief This API gets the support reset of package
1170 * @par Sync (or) Async : Synchronous API
1172 * @param[in] handle pointer to package info handle
1173 * @param[out] support_reset pointer to hold support reset of package
1174 * @return 0 if success, error code(<0) if fail
1175 * @retval PMINFO_R_OK success
1176 * @retval PMINFO_R_EINVAL invalid argument
1177 * @retval PMINFO_R_ERROR internal error
1179 static int get_support_reset(const char *pkgid)
1182 char *support_reset = 0;
1183 pkgmgrinfo_pkginfo_h handle = NULL;
1184 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1185 if (ret != PMINFO_R_OK)
1188 ret = pkgmgrinfo_pkginfo_get_support_reset(handle, &support_reset);
1189 if (ret != PMINFO_R_OK) {
1190 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1193 printf("support_reset : %s\n", support_reset);
1194 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1200 int pkgmgrinfo_pkginfo_get_support_reset(pkgmgrinfo_pkginfo_h handle, char **support_reset);
1203 * @fn int pkgmgrinfo_pkginfo_get_groupid(pkgmgrinfo_pkginfo_h handle, char **groupid)
1204 * @brief This API gets the groupid of package
1206 * @par Sync (or) Async : Synchronous API
1208 * @param[in] handle pointer to package info handle
1209 * @param[out] groupid pointer to hold groupid of package
1210 * @return 0 if success, error code(<0) if fail
1211 * @retval PMINFO_R_OK success
1212 * @retval PMINFO_R_EINVAL invalid argument
1213 * @retval PMINFO_R_ERROR internal error
1215 static int get_groupid(const char *pkgid)
1219 pkgmgrinfo_pkginfo_h handle = NULL;
1220 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1221 if (ret != PMINFO_R_OK)
1224 ret = pkgmgrinfo_pkginfo_get_groupid(handle, &groupid);
1225 if (ret != PMINFO_R_OK) {
1226 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1229 printf("groupid : %s\n", groupid);
1230 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1236 int pkgmgrinfo_pkginfo_get_groupid(pkgmgrinfo_pkginfo_h handle, char **groupid);
1239 * @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)
1240 * @brief This API compare the cert information from given package id
1242 * @par This API is for package-manager client application
1243 * @par Sync (or) Async : Synchronous API
1245 * @param[in] lhs_package_id pointer to first package ID
1246 * @param[in] rhs_package_id pointer to second package ID
1247 * @param[out] compare_result pointer to the compare result.
1248 * @return 0 if success, error code(<0) if fail
1249 * @retval PMINFO_R_OK success
1250 * @retval PMINFO_R_EINVAL invalid argument
1251 * @retval PMINFO_R_ERROR internal error
1253 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1254 * @see pkgmgrinfo_pkginfo_get_pkgid()
1255 * @see pkgmgrinfo_pkginfo_is_removable()
1257 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1260 pkgmgrinfo_cert_compare_result_type_e result;
1262 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1263 if (ret != PMINFO_R_OK) {
1266 printf("result: %d\n", result);
1271 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);
1274 * @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)
1275 * @brief This API compare the cert information from given app id
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] lhs_app_id pointer to first app ID
1281 * @param[in] rhs_app_id pointer to second app ID
1282 * @param[out] compare_result pointer to the compare result.
1283 * @return 0 if success, error code(<0) if fail
1284 * @retval PMINFO_R_OK success
1285 * @retval PMINFO_R_EINVAL invalid argument
1286 * @retval PMINFO_R_ERROR internal error
1288 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1289 * @see pkgmgrinfo_pkginfo_get_pkgid()
1290 * @see pkgmgrinfo_pkginfo_is_removable()
1292 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1295 pkgmgrinfo_cert_compare_result_type_e result;
1297 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1298 if (ret != PMINFO_R_OK) {
1301 printf("result: %d\n", result);
1306 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);
1309 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1310 * @brief This API gets the package 'removable' value from the package ID
1312 * @par This API is for package-manager client application
1313 * @par Sync (or) Async : Synchronous API
1315 * @param[in] handle pointer to package info handle
1316 * @param[out] removable pointer to hold package removable value
1317 * @return 0 if success, error code(<0) if fail
1318 * @retval PMINFO_R_OK success
1319 * @retval PMINFO_R_EINVAL invalid argument
1320 * @retval PMINFO_R_ERROR internal error
1321 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1322 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1323 * @see pkgmgrinfo_pkginfo_get_pkgid()
1324 * @see pkgmgrinfo_pkginfo_is_readonly()
1326 static int get_pkg_removable(const char *pkgid)
1330 pkgmgrinfo_pkginfo_h handle;
1331 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1332 if (ret != PMINFO_R_OK)
1334 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1335 if (ret != PMINFO_R_OK) {
1336 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1339 printf("pkg removable: %d\n", removable);
1340 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1345 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1348 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1349 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1351 * @par This API is for package-manager client application
1352 * @par Sync (or) Async : Synchronous API
1354 * @param[in] handle pointer to package info handle
1355 * @param[out] movable pointer to hold package movable state
1356 * @return 0 if success, error code(<0) if fail
1357 * @retval PMINFO_R_OK success
1358 * @retval PMINFO_R_EINVAL invalid argument
1359 * @retval PMINFO_R_ERROR internal error
1360 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1361 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1362 * @see pkgmgrinfo_pkginfo_get_pkgid()
1364 static int get_pkg_movable(const char *pkgid)
1368 pkgmgrinfo_pkginfo_h handle;
1369 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1370 if (ret != PMINFO_R_OK)
1372 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1373 if (ret != PMINFO_R_OK) {
1374 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1377 printf("pkg movable: %d\n", movable);
1378 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1383 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1386 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1387 * @brief This API gets the package 'preload' value from the package ID
1389 * @par This API is for package-manager client application
1390 * @par Sync (or) Async : Synchronous API
1392 * @param[in] handle pointer to package info handle
1393 * @param[out] preload pointer to hold package preload value
1394 * @return 0 if success, error code(<0) if fail
1395 * @retval PMINFO_R_OK success
1396 * @retval PMINFO_R_EINVAL invalid argument
1397 * @retval PMINFO_R_ERROR internal error
1398 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1399 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1400 * @see pkgmgrinfo_pkginfo_get_pkgid()
1401 * @see pkgmgrinfo_pkginfo_is_readonly()
1403 static int get_pkg_preload(const char *pkgid)
1407 pkgmgrinfo_pkginfo_h handle;
1408 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1409 if (ret != PMINFO_R_OK)
1411 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1412 if (ret != PMINFO_R_OK) {
1413 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1416 printf("pkg preload: %d\n", preload);
1417 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1422 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1425 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1426 * @brief This API gets the value for given handle is system or not
1428 * @par This API is for package-manager client application
1429 * @par Sync (or) Async : Synchronous API
1431 * @param[in] handle pointer to package info handle
1432 * @param[out] system pointer to hold system is or not
1433 * @return 0 if success, error code(<0) if fail
1434 * @retval PMINFO_R_OK success
1435 * @retval PMINFO_R_EINVAL invalid argument
1436 * @retval PMINFO_R_ERROR internal error
1437 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1438 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1439 * @see pkgmgrinfo_pkginfo_get_pkgid()
1440 * @see pkgmgrinfo_pkginfo_is_readonly()
1442 static int get_pkg_system(const char *pkgid)
1445 bool system = false;
1446 pkgmgrinfo_pkginfo_h handle = NULL;
1447 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1448 if (ret != PMINFO_R_OK)
1450 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1451 if (ret != PMINFO_R_OK) {
1452 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1455 printf("pkg system: %d\n", system);
1456 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1461 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1464 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1465 * @brief This API gets the package 'readonly' value from the package ID
1467 * @par This API is for package-manager client application
1468 * @par Sync (or) Async : Synchronous API
1470 * @param[in] handle pointer to package info handle
1471 * @param[out] readonly pointer to hold package readonly value
1472 * @return 0 if success, error code(<0) if fail
1473 * @retval PMINFO_R_OK success
1474 * @retval PMINFO_R_EINVAL invalid argument
1475 * @retval PMINFO_R_ERROR internal error
1476 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1477 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1478 * @see pkgmgrinfo_pkginfo_get_pkgid()
1479 * @see pkgmgrinfo_pkginfo_is_removable()
1481 static int get_pkg_readonly(const char *pkgid)
1485 pkgmgrinfo_pkginfo_h handle;
1486 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1487 if (ret != PMINFO_R_OK)
1489 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1490 if (ret != PMINFO_R_OK) {
1491 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1494 printf("pkg readonly: %d\n", readonly);
1495 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1500 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1504 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1505 * @brief This API gets the package 'upate' value 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] update pointer to hold package update value
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_update(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_update(handle, &update);
1529 if (ret != PMINFO_R_OK) {
1530 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1533 printf("pkg update: %d\n", update);
1534 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1539 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1542 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1543 * @brief This API gets the package 'support_disable' 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] support_disable pointer to hold package support_disable 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()
1558 static int get_pkg_support_disable(const char *pkgid)
1561 bool support_disable;
1562 pkgmgrinfo_pkginfo_h handle;
1563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1564 if (ret != PMINFO_R_OK)
1566 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571 printf("pkg support_disable: %d\n", support_disable);
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1580 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1581 * @brief This API gets the package 'accessible' value from the package ID
1583 * @par This API is for package-manager client application
1584 * @par Sync (or) Async : Synchronous API
1586 * @param[in] handle pointer to package info handle
1587 * @param[out] accessible pointer to hold package accessible value
1588 * @return 0 if success, error code(<0) if fail
1589 * @retval PMINFO_R_OK success
1590 * @retval PMINFO_R_EINVAL invalid argument
1591 * @retval PMINFO_R_ERROR internal error
1592 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1593 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1594 * @see pkgmgrinfo_pkginfo_get_pkgid()
1595 * @see pkgmgrinfo_pkginfo_is_readonly()
1597 static int get_pkg_accessible(const char *pkgid)
1601 pkgmgrinfo_pkginfo_h handle;
1602 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1603 if (ret != PMINFO_R_OK)
1605 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1606 if (ret != PMINFO_R_OK) {
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1610 printf("pkg accessible: %d\n", accessible);
1611 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1616 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1620 * @fn int pkgmgrinfo_pkginfo_is_mother_package(pkgmgrinfo_pkginfo_h handle, bool *mother_package)
1621 * @brief This API gets the package 'mother_package' 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] mother_package pointer to hold package mother_package 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_readonly()
1637 static int get_pkg_mother_package(const char *pkgid)
1640 bool mother_package = false;
1641 pkgmgrinfo_pkginfo_h handle = NULL;
1642 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1643 if (ret != PMINFO_R_OK)
1645 ret = pkgmgrinfo_pkginfo_is_mother_package(handle, &mother_package);
1646 if (ret != PMINFO_R_OK) {
1647 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 printf("pkg mother_package: %d\n", mother_package);
1651 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1656 int pkgmgrinfo_pkginfo_is_mother_package(pkgmgrinfo_pkginfo_h handle, bool *mother_package);
1659 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1660 * @brief This API destroys the package information handle freeing up all the resources
1662 * @par This API is for package-manager client application
1663 * @par Sync (or) Async : Synchronous API
1665 * @param[in] handle pointer to the package info handle
1666 * @return 0 if success, error code(<0) if fail
1667 * @retval PMINFO_R_OK success
1668 * @retval PMINFO_R_EINVAL invalid argument
1669 * @retval PMINFO_R_ERROR internal error
1670 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1672 * @see pkgmgrinfo_pkginfo_get_pkgid()
1673 * @see pkgmgrinfo_pkginfo_is_removable()
1675 static int get_pkg_type(const char *pkgid)
1679 pkgmgrinfo_pkginfo_h handle;
1680 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1681 if (ret != PMINFO_R_OK)
1683 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1684 if (ret != PMINFO_R_OK) {
1685 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1688 printf("pkgtype: %s\n", type);
1689 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1694 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1697 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1698 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1699 The query will search the entire package information collected from the manifest file of all the installed packages
1701 * @par This API is for package-manager client application
1702 * @par Sync (or) Async : Synchronous API
1704 * @param[out] handle pointer to the package info filter handle.
1705 * @return 0 if success, error code(<0) if fail
1706 * @retval PMINFO_R_OK success
1707 * @retval PMINFO_R_EINVAL invalid argument
1708 * @retval PMINFO_R_ERROR internal error
1710 * @post pkgmgrinfo_pkginfo_filter_destroy()
1711 * @see pkgmgrinfo_pkginfo_filter_count()
1712 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1714 static int get_rpm_pkg_count()
1718 pkgmgrinfo_pkginfo_filter_h handle;
1719 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1720 if (ret != PMINFO_R_OK)
1722 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1723 if (ret != PMINFO_R_OK) {
1724 pkgmgrinfo_pkginfo_filter_destroy(handle);
1727 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1728 if (ret != PMINFO_R_OK) {
1729 pkgmgrinfo_pkginfo_filter_destroy(handle);
1732 printf("No of rpm pkgs: %d\n", count);
1733 pkgmgrinfo_pkginfo_filter_destroy(handle);
1738 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1741 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1742 * @brief This API destroys the package information filter handle freeing up all the resources
1744 * @par This API is for package-manager client application
1745 * @par Sync (or) Async : Synchronous API
1747 * @param[in] handle pointer to the package info filter handle.
1748 * @return 0 if success, error code(<0) if fail
1749 * @retval PMINFO_R_OK success
1750 * @retval PMINFO_R_EINVAL invalid argument
1751 * @retval PMINFO_R_ERROR internal error
1752 * @pre pkgmgrinfo_pkginfo_filter_create()
1754 * @see pkgmgrinfo_pkginfo_filter_count()
1755 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1757 static int get_rpm_pkg_count()
1761 pkgmgrinfo_pkginfo_filter_h handle;
1762 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1763 if (ret != PMINFO_R_OK)
1765 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1766 if (ret != PMINFO_R_OK) {
1767 pkgmgrinfo_pkginfo_filter_destroy(handle);
1770 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1771 if (ret != PMINFO_R_OK) {
1772 pkgmgrinfo_pkginfo_filter_destroy(handle);
1775 printf("No of rpm pkgs: %d\n", count);
1776 pkgmgrinfo_pkginfo_filter_destroy(handle);
1781 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1784 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1785 * @brief This API adds a boolean filter property to the filter handle
1787 * @par This API is for package-manager client application
1788 * @par Sync (or) Async : Synchronous API
1790 * @param[in] handle pointer to the package info filter handle.
1791 * @param[in] property boolean property name.
1792 * @param[in] value value corresponding to the property.
1793 * @return 0 if success, error code(<0) if fail
1794 * @retval PMINFO_R_OK success
1795 * @retval PMINFO_R_EINVAL invalid argument
1796 * @retval PMINFO_R_ERROR internal error
1797 * @pre pkgmgrinfo_pkginfo_filter_create()
1798 * @post pkgmgrinfo_pkginfo_filter_destroy()
1799 * @see pkgmgrinfo_pkginfo_filter_count()
1800 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1802 static int get_preload_pkg_count()
1806 pkgmgrinfo_pkginfo_filter_h handle;
1807 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1808 if (ret != PMINFO_R_OK)
1810 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1811 if (ret != PMINFO_R_OK) {
1812 pkgmgrinfo_pkginfo_filter_destroy(handle);
1815 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1816 if (ret != PMINFO_R_OK) {
1817 pkgmgrinfo_pkginfo_filter_destroy(handle);
1820 printf("No of preload pkgs: %d\n", count);
1821 pkgmgrinfo_pkginfo_filter_destroy(handle);
1826 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1827 const char *property, const bool value);
1830 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1831 * @brief This API adds an integer filter property to the filter handle
1833 * @par This API is for package-manager client application
1834 * @par Sync (or) Async : Synchronous API
1836 * @param[in] handle pointer to the package info filter handle.
1837 * @param[in] property integer property name.
1838 * @param[in] value value corresponding to the property.
1839 * @return 0 if success, error code(<0) if fail
1840 * @retval PMINFO_R_OK success
1841 * @retval PMINFO_R_EINVAL invalid argument
1842 * @retval PMINFO_R_ERROR internal error
1843 * @pre pkgmgrinfo_pkginfo_filter_create()
1844 * @post pkgmgrinfo_pkginfo_filter_destroy()
1845 * @see pkgmgrinfo_pkginfo_filter_count()
1846 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1848 static int get_pkg_count()
1852 pkgmgrinfo_pkginfo_filter_h handle;
1853 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1854 if (ret != PMINFO_R_OK)
1856 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1857 if (ret != PMINFO_R_OK) {
1858 pkgmgrinfo_pkginfo_filter_destroy(handle);
1861 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1862 if (ret != PMINFO_R_OK) {
1863 pkgmgrinfo_pkginfo_filter_destroy(handle);
1866 printf("No of preload pkgs: %d\n", count);
1867 pkgmgrinfo_pkginfo_filter_destroy(handle);
1872 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1873 const char *property, const int value);
1876 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1877 * @brief This API adds a string filter property to the filter handle
1879 * @par This API is for package-manager client application
1880 * @par Sync (or) Async : Synchronous API
1882 * @param[in] handle pointer to the package info filter handle.
1883 * @param[in] property string property name.
1884 * @param[in] value value corresponding to the property.
1885 * @return 0 if success, error code(<0) if fail
1886 * @retval PMINFO_R_OK success
1887 * @retval PMINFO_R_EINVAL invalid argument
1888 * @retval PMINFO_R_ERROR internal error
1889 * @pre pkgmgrinfo_pkginfo_filter_create()
1890 * @post pkgmgrinfo_pkginfo_filter_destroy()
1891 * @see pkgmgrinfo_pkginfo_filter_count()
1892 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1894 static int get_rpm_pkg_count()
1898 pkgmgrinfo_pkginfo_filter_h handle;
1899 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1900 if (ret != PMINFO_R_OK)
1902 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1903 if (ret != PMINFO_R_OK) {
1904 pkgmgrinfo_pkginfo_filter_destroy(handle);
1907 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1908 if (ret != PMINFO_R_OK) {
1909 pkgmgrinfo_pkginfo_filter_destroy(handle);
1912 printf("No of rpm pkgs: %d\n", count);
1913 pkgmgrinfo_pkginfo_filter_destroy(handle);
1918 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1919 const char *property, const char *value);
1922 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1923 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1925 * @par This API is for package-manager client application
1926 * @par Sync (or) Async : Synchronous API
1928 * @param[in] handle pointer to the package info filter handle.
1929 * @param[in] pkg_cb callback function.
1930 * @param[in] user_data user data to be passed to the callback function
1931 * @return 0 if success, error code(<0) if fail
1932 * @retval PMINFO_R_OK success
1933 * @retval PMINFO_R_EINVAL invalid argument
1934 * @retval PMINFO_R_ERROR internal error
1935 * @pre pkgmgrinfo_pkginfo_filter_create()
1936 * @post pkgmgrinfo_pkginfo_filter_destroy()
1937 * @see pkgmgrinfo_pkginfo_filter_count()
1939 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1942 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1943 printf("pkg id : %s\n", pkgid);
1947 static int get_rpm_pkg_list()
1950 pkgmgrinfo_pkginfo_filter_h handle;
1951 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1952 if (ret != PMINFO_R_OK)
1954 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1955 if (ret != PMINFO_R_OK) {
1956 pkgmgrinfo_pkginfo_filter_destroy(handle);
1959 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1960 if (ret != PMINFO_R_OK) {
1961 pkgmgrinfo_pkginfo_filter_destroy(handle);
1964 pkgmgrinfo_pkginfo_filter_destroy(handle);
1969 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1970 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1973 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1974 * @brief This API counts the package that satisfy the filter conditions
1976 * @par This API is for package-manager client application
1977 * @par Sync (or) Async : Synchronous API
1979 * @param[in] handle pointer to the package info filter handle.
1980 * @param[in] count pointer to store the count value.
1981 * @return 0 if success, error code(<0) if fail
1982 * @retval PMINFO_R_OK success
1983 * @retval PMINFO_R_EINVAL invalid argument
1984 * @retval PMINFO_R_ERROR internal error
1985 * @pre pkgmgrinfo_pkginfo_filter_create()
1986 * @post pkgmgrinfo_pkginfo_filter_destroy()
1987 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1989 static int get_rpm_pkg_count()
1993 pkgmgrinfo_pkginfo_filter_h handle;
1994 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1995 if (ret != PMINFO_R_OK)
1997 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1998 if (ret != PMINFO_R_OK) {
1999 pkgmgrinfo_pkginfo_filter_destroy(handle);
2002 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2003 if (ret != PMINFO_R_OK) {
2004 pkgmgrinfo_pkginfo_filter_destroy(handle);
2007 printf("No of rpm pkgs: %d\n", count);
2008 pkgmgrinfo_pkginfo_filter_destroy(handle);
2013 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2016 * @fn int pkgmgrinfo_pkginfo_privilege_filter_foreach(const char *privilege,
2017 pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
2018 * @brief This API gets the list of package id for a particular privilege
2020 * @par This API is for package-manager client application
2021 * @par Sync (or) Async : Synchronous API
2022 * @param[in] privilege privilege to find package id list.
2023 * @param[in] pkg_list_cb iteration function for list
2024 * @param[in] user_data user data to be passed to 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
2030 int pkg_list_cb(const pkgmgrinfo_pkginfo_h handle, void *user_data)
2032 int ret = PMINFO_R_OK;
2034 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2035 if (ret != PMINFO_R_OK) {
2038 printf("pkgid : %s\n", pkgid);
2044 static int list_pkgid_by_privilege(const char *privilege)
2046 int ret = PMINFO_R_OK;
2048 ret = pkgmgrinfo_pkginfo_privilege_filter_foreach(privilege, pkg_list_cb, NULL);
2054 int pkgmgrinfo_pkginfo_privilege_filter_foreach(const char *privilege,
2055 pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
2058 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2059 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2060 * @brief This API gets the list of privilege for a particular package
2062 * @par This API is for package-manager client application
2063 * @par Sync (or) Async : Synchronous API
2064 * @param[in] handle pointer to the package info handle.
2065 * @param[in] privilege_func callback function for list
2066 * @param[in] user_data user data to be passed to callback function
2067 * @return 0 if success, error code(<0) if fail
2068 * @retval PMINFO_R_OK success
2069 * @retval PMINFO_R_EINVAL invalid argument
2070 * @retval PMINFO_R_ERROR internal error
2071 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2072 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2074 int privilege_func(const char *name, void *user_data)
2076 if (strcmp(name, (char *)user_data) == 0)
2082 static int list_privilege(const char *package, char *privilege)
2085 pkgmgrinfo_pkginfo_h handle;
2086 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2087 if (ret != PMINFO_R_OK)
2089 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2090 if (ret != PMINFO_R_OK) {
2091 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2094 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2099 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2100 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2103 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2104 pkgmgrinfo_app_list_cb app_func, void *user_data)
2105 * @brief This API gets list of installed applications for a particular package
2107 * @par This API is for package-manager client application
2108 * @par Sync (or) Async : Synchronous API
2109 * @param[in] handle package info handle
2110 * @param[in] component application component
2111 * @param[in] app_func iteration function for list
2112 * @param[in] user_data user data to be passed to callback function
2113 * @return 0 if success, error code(<0) if fail
2114 * @retval PMINFO_R_OK success
2115 * @retval PMINFO_R_EINVAL invalid argument
2116 * @retval PMINFO_R_ERROR internal error
2117 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2118 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2120 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2123 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2124 printf("appid : %s\n", appid);
2128 static int list_apps(const char *pkgid)
2131 pkgmgrinfo_pkginfo_h handle;
2132 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2133 if (ret != PMINFO_R_OK)
2135 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2136 if (ret != PMINFO_R_OK) {
2137 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2140 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2145 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2146 pkgmgrinfo_app_list_cb app_func, void *user_data);
2148 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2149 * @brief This API gets list of installed applications from all packages with minimum informaion.
2151 * @par This API is for package-manager client application
2152 * @par Sync (or) Async : Synchronous API
2153 * @param[in] app_func iteration function for list
2154 * @param[in] user_data user data to be passed to callback function
2155 * @return 0 if success, error code(<0) if fail
2156 * @retval PMINFO_R_OK success
2157 * @retval PMINFO_R_EINVAL invalid argument
2158 * @retval PMINFO_R_ERROR internal error
2162 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2164 char *pkgid1 = NULL;
2165 char *pkgid2 = NULL;
2166 pkgid1 = (char *)user_data;
2167 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2168 if (strcmp(pkgid1, pkgid2) == 0) {
2175 static int list_apps()
2178 char *name = "helloworld";
2179 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2180 if (ret != PMINFO_R_OK) {
2187 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2190 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2191 * @brief This API gets list of installed applications from all packages.
2193 * @par This API is for package-manager client application
2194 * @par Sync (or) Async : Synchronous API
2195 * @param[in] app_func iteration function for list
2196 * @param[in] user_data user data to be passed to callback function
2197 * @return 0 if success, error code(<0) if fail
2198 * @retval PMINFO_R_OK success
2199 * @retval PMINFO_R_EINVAL invalid argument
2200 * @retval PMINFO_R_ERROR internal error
2204 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2206 char *pkgid1 = NULL;
2207 char *pkgid2 = NULL;
2208 pkgid1 = (char *)user_data;
2209 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2210 if (strcmp(pkgid1, pkgid2) == 0) {
2217 static int list_apps()
2220 char *name = "helloworld";
2221 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2222 if (ret != PMINFO_R_OK) {
2229 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2232 * @fn int pkgmgrinfo_appinfo_get_mounted_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2233 * @brief This API gets list of applications which are installed in sd card when sd card is mounted
2235 * @par This API is for package-manager client application
2236 * @par Sync (or) Async : Synchronous API
2237 * @param[in] app_func iteration function for list
2238 * @param[in] user_data user data to be passed to callback function
2239 * @return 0 if success, error code(<0) if fail
2240 * @retval PMINFO_R_OK success
2241 * @retval PMINFO_R_EINVAL invalid argument
2242 * @retval PMINFO_R_ERROR internal error
2246 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2250 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2251 printf("appid: %s\n", appid);
2256 static int mounted_list_apps()
2260 ret = pkgmgrinfo_appinfo_get_mounted_list(app_list_cb, NULL);
2261 if (ret != PMINFO_R_OK) {
2268 int pkgmgrinfo_appinfo_get_mounted_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2271 * @fn int pkgmgrinfo_appinfo_get_unmounted_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2272 * @brief This API gets list of applications which are installed in sd card when sd card is unmounted
2274 * @par This API is for package-manager client application
2275 * @par Sync (or) Async : Synchronous API
2276 * @param[in] app_func iteration function for list
2277 * @param[in] user_data user data to be passed to callback function
2278 * @return 0 if success, error code(<0) if fail
2279 * @retval PMINFO_R_OK success
2280 * @retval PMINFO_R_EINVAL invalid argument
2281 * @retval PMINFO_R_ERROR internal error
2285 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2289 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2290 printf("appid: %s\n", appid);
2295 static int unmounted_list_apps()
2299 ret = pkgmgrinfo_appinfo_get_unmounted_list(app_list_cb, NULL);
2300 if (ret != PMINFO_R_OK) {
2307 int pkgmgrinfo_appinfo_get_unmounted_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2310 * @fn int pkgmgrinfo_appinfo_get_unmounted_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2311 * @brief This API creates the application information handle from db
2313 * @par This API is for package-manager client application
2314 * @par Sync (or) Async : Synchronous API
2316 * @param[in] appid pointer to appid
2317 * @param[out] handle pointer to the application info handle.
2318 * @return 0 if success, error code(<0) if fail
2319 * @retval PMINFO_R_OK success
2320 * @retval PMINFO_R_EINVAL invalid argument
2321 * @retval PMINFO_R_ERROR internal error
2323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2324 * @see pkgmgrinfo_appinfo_get_pkgid()
2325 * @see pkgmgrinfo_appinfo_is_multiple()
2327 static int get_app_type(const char *appid)
2331 pkgmgrinfo_appinfo_h handle;
2332 ret = pkgmgrinfo_appinfo_get_unmounted_appinfo(appid, &handle);
2333 if (ret != PMINFO_R_OK)
2335 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2336 if (ret != PMINFO_R_OK) {
2337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2340 printf("apptype: %s\n", type);
2341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2346 int pkgmgrinfo_appinfo_get_unmounted_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2349 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2350 * @brief This API creates the application information handle from db
2352 * @par This API is for package-manager client application
2353 * @par Sync (or) Async : Synchronous API
2355 * @param[in] appid pointer to appid
2356 * @param[out] handle pointer to the application info handle.
2357 * @return 0 if success, error code(<0) if fail
2358 * @retval PMINFO_R_OK success
2359 * @retval PMINFO_R_EINVAL invalid argument
2360 * @retval PMINFO_R_ERROR internal error
2362 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2363 * @see pkgmgrinfo_appinfo_get_pkgid()
2364 * @see pkgmgrinfo_appinfo_is_multiple()
2366 static int get_app_type(const char *appid)
2370 pkgmgrinfo_appinfo_h handle;
2371 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2372 if (ret != PMINFO_R_OK)
2374 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2375 if (ret != PMINFO_R_OK) {
2376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2379 printf("apptype: %s\n", type);
2380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2385 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2388 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2389 * @brief This API gets the application ID
2391 * @par This API is for package-manager client application
2392 * @par Sync (or) Async : Synchronous API
2394 * @param[in] handle pointer to the application info handle.
2395 * @param[out] appid pointer to hold appid
2396 * @return 0 if success, error code(<0) if fail
2397 * @retval PMINFO_R_OK success
2398 * @retval PMINFO_R_EINVAL invalid argument
2399 * @retval PMINFO_R_ERROR internal error
2400 * @pre pkgmgrinfo_appinfo_get_appinfo()
2401 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2402 * @see pkgmgrinfo_appinfo_get_pkgid()
2403 * @see pkgmgrinfo_appinfo_is_multiple()
2405 static int get_app_id(const char *appid)
2408 char *app_id = NULL;
2409 pkgmgrinfo_appinfo_h handle;
2410 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2411 if (ret != PMINFO_R_OK)
2413 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2414 if (ret != PMINFO_R_OK) {
2415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2418 printf("app id: %s\n", app_id);
2419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2424 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2427 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2428 * @brief This API gets the package name of the application
2430 * @par This API is for package-manager client application
2431 * @par Sync (or) Async : Synchronous API
2433 * @param[in] handle pointer to the application info handle.
2434 * @param[out] pkg_name pointer to hold package name
2435 * @return 0 if success, error code(<0) if fail
2436 * @retval PMINFO_R_OK success
2437 * @retval PMINFO_R_EINVAL invalid argument
2438 * @retval PMINFO_R_ERROR internal error
2439 * @pre pkgmgrinfo_appinfo_get_appinfo()
2440 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2441 * @see pkgmgrinfo_appinfo_get_appid()
2442 * @see pkgmgrinfo_appinfo_is_multiple()
2444 static int get_app_pkgname(const char *appid)
2447 char *pkgname = NULL;
2448 pkgmgrinfo_appinfo_h handle;
2449 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2450 if (ret != PMINFO_R_OK)
2452 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2453 if (ret != PMINFO_R_OK) {
2454 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2457 printf("pkg name: %s\n", pkgname);
2458 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2463 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2466 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2467 * @brief This API gets the package id of the application
2469 * @par This API is for package-manager client application
2470 * @par Sync (or) Async : Synchronous API
2472 * @param[in] handle pointer to the application info handle.
2473 * @param[out] pkgid pointer to hold package id
2474 * @return 0 if success, error code(<0) if fail
2475 * @retval PMINFO_R_OK success
2476 * @retval PMINFO_R_EINVAL invalid argument
2477 * @retval PMINFO_R_ERROR internal error
2478 * @pre pkgmgrinfo_appinfo_get_appinfo()
2479 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2480 * @see pkgmgrinfo_appinfo_get_appid()
2481 * @see pkgmgrinfo_appinfo_is_multiple()
2483 static int get_app_pkgid(const char *appid)
2487 pkgmgrinfo_appinfo_h handle;
2488 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2489 if (ret != PMINFO_R_OK)
2491 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2492 if (ret != PMINFO_R_OK) {
2493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2496 printf("pkg id: %s\n", pkgid);
2497 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2502 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2505 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2506 * @brief This API gets the package type of the application
2508 * @par This API is for package-manager client application
2509 * @par Sync (or) Async : Synchronous API
2511 * @param[in] handle pointer to the application info handle.
2512 * @param[out] pkgtype pointer to hold package type
2513 * @return 0 if success, error code(<0) if fail
2514 * @retval PMINFO_R_OK success
2515 * @retval PMINFO_R_EINVAL invalid argument
2516 * @retval PMINFO_R_ERROR internal error
2517 * @pre pkgmgrinfo_appinfo_get_appinfo()
2518 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2519 * @see pkgmgrinfo_appinfo_get_appid()
2520 * @see pkgmgrinfo_appinfo_is_multiple()
2522 static int get_app_pkgtype(const char *appid)
2525 char *pkgtype = NULL;
2526 pkgmgrinfo_appinfo_h handle;
2527 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2528 if (ret != PMINFO_R_OK)
2530 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2531 if (ret != PMINFO_R_OK) {
2532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2535 printf("pkgtype: %s\n", pkgtype);
2536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2541 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2544 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2545 * @brief This API gets the executable name of the application
2547 * @par This API is for package-manager client application
2548 * @par Sync (or) Async : Synchronous API
2550 * @param[in] handle pointer to the application info handle.
2551 * @param[out] exec pointer to hold app exec name
2552 * @return 0 if success, error code(<0) if fail
2553 * @retval PMINFO_R_OK success
2554 * @retval PMINFO_R_EINVAL invalid argument
2555 * @retval PMINFO_R_ERROR internal error
2556 * @pre pkgmgrinfo_appinfo_get_appinfo()
2557 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2558 * @see pkgmgrinfo_appinfo_get_appid()
2559 * @see pkgmgrinfo_appinfo_is_multiple()
2561 static int get_app_exec(const char *appid)
2565 pkgmgrinfo_appinfo_h handle;
2566 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2567 if (ret != PMINFO_R_OK)
2569 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2570 if (ret != PMINFO_R_OK) {
2571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2574 printf("exec name: %s\n", exec);
2575 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2580 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2583 * @fn int pkgmgrinfo_appinfo_get_ambient_support(pkgmgrinfo_appinfo_h handle, bool *ambient_support)
2584 * @brief This API gets the ambient_support of the application
2586 * @par This API is for package-manager client application
2587 * @par Sync (or) Async : Synchronous API
2589 * @param[in] handle pointer to the application info handle.
2590 * @param[out] ambient_support pointer to hold app ambient_support
2591 * @return 0 if success, error code(<0) if fail
2592 * @retval PMINFO_R_OK success
2593 * @retval PMINFO_R_EINVAL invalid argument
2594 * @retval PMINFO_R_ERROR internal error
2595 * @pre pkgmgrinfo_appinfo_get_appinfo()
2596 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2597 * @see pkgmgrinfo_appinfo_get_appid()
2598 * @see pkgmgrinfo_appinfo_is_multiple()
2600 static int get_ambient_support(const char *appid)
2603 bool ambient_support;
2604 pkgmgrinfo_appinfo_h handle;
2605 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2606 if (ret != PMINFO_R_OK)
2608 ret = pkgmgrinfo_appinfo_get_ambient_support(handle, &ambient_support);
2609 if (ret != PMINFO_R_OK) {
2610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2613 printf("ambient_support? : %d\n", ambient_support);
2614 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2619 int pkgmgrinfo_appinfo_get_ambient_support(pkgmgrinfo_appinfo_h handle, bool *ambient_support);
2623 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2624 * @brief This API gets the icon name of the application
2626 * @par This API is for package-manager client application
2627 * @par Sync (or) Async : Synchronous API
2629 * @param[in] handle pointer to the application info handle.
2630 * @param[out] icon pointer to hold app icon name
2631 * @return 0 if success, error code(<0) if fail
2632 * @retval PMINFO_R_OK success
2633 * @retval PMINFO_R_EINVAL invalid argument
2634 * @retval PMINFO_R_ERROR internal error
2635 * @pre pkgmgrinfo_appinfo_get_appinfo()
2636 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2637 * @see pkgmgrinfo_appinfo_get_appid()
2638 * @see pkgmgrinfo_appinfo_is_multiple()
2640 static int get_app_icon(const char *appid)
2644 pkgmgrinfo_appinfo_h handle;
2645 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2646 if (ret != PMINFO_R_OK)
2648 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2649 if (ret != PMINFO_R_OK) {
2650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2653 printf("icon name: %s\n", icon);
2654 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2659 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2662 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2663 * @brief This API gets the label of the application
2665 * @par This API is for package-manager client application
2666 * @par Sync (or) Async : Synchronous API
2668 * @param[in] handle pointer to the application info handle.
2669 * @param[out] label pointer to hold app label
2670 * @return 0 if success, error code(<0) if fail
2671 * @retval PMINFO_R_OK success
2672 * @retval PMINFO_R_EINVAL invalid argument
2673 * @retval PMINFO_R_ERROR internal error
2674 * @pre pkgmgrinfo_appinfo_get_appinfo()
2675 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2676 * @see pkgmgrinfo_appinfo_get_appid()
2677 * @see pkgmgrinfo_appinfo_is_multiple()
2679 static int get_app_label(const char *appid)
2683 pkgmgrinfo_appinfo_h handle;
2684 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2685 if (ret != PMINFO_R_OK)
2687 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2688 if (ret != PMINFO_R_OK) {
2689 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2692 printf("label : %s\n", label);
2693 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2698 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2701 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2702 * @brief This API gets the component of the application
2704 * @par This API is for package-manager client application
2705 * @par Sync (or) Async : Synchronous API
2707 * @param[in] handle pointer to the application info handle.
2708 * @param[out] component pointer to hold app component
2709 * @return 0 if success, error code(<0) if fail
2710 * @retval PMINFO_R_OK success
2711 * @retval PMINFO_R_EINVAL invalid argument
2712 * @retval PMINFO_R_ERROR internal error
2713 * @pre pkgmgrinfo_appinfo_get_appinfo()
2714 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2715 * @see pkgmgrinfo_appinfo_get_appid()
2716 * @see pkgmgrinfo_appinfo_is_multiple()
2718 static int get_app_component(const char *appid)
2721 pkgmgrinfo_app_component component;
2722 pkgmgrinfo_appinfo_h handle;
2723 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2724 if (ret != PMINFO_R_OK)
2726 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2727 if (ret != PMINFO_R_OK) {
2728 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2731 printf("component : %s\n", component);
2732 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2737 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2740 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2741 * @brief This API gets the apptype of the application
2743 * @par This API is for package-manager client application
2744 * @par Sync (or) Async : Synchronous API
2746 * @param[in] handle pointer to the application info handle.
2747 * @param[out] app_type pointer to hold apptype
2748 * @return 0 if success, error code(<0) if fail
2749 * @retval PMINFO_R_OK success
2750 * @retval PMINFO_R_EINVAL invalid argument
2751 * @retval PMINFO_R_ERROR internal error
2752 * @pre pkgmgrinfo_appinfo_get_appinfo()
2753 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2754 * @see pkgmgrinfo_appinfo_get_appid()
2755 * @see pkgmgrinfo_appinfo_is_multiple()
2757 static int get_app_type(const char *appid)
2760 char *apptype = NULL;
2761 pkgmgrinfo_appinfo_h handle;
2762 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2763 if (ret != PMINFO_R_OK)
2765 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2766 if (ret != PMINFO_R_OK) {
2767 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2770 printf("apptype : %s\n", apptype);
2771 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2776 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2779 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2780 int *operation_count, char ***operation)
2781 * @brief This API gets the list of operation of the application
2783 * @par This API is for package-manager client application
2784 * @par Sync (or) Async : Synchronous API
2786 * @param[in] handle pointer to the appcontrol handle.
2787 * @param[out] operation_count pointer to hold number of operations
2788 * @param[out] operation pointer to hold list of operations
2789 * @return 0 if success, error code(<0) if fail
2790 * @retval PMINFO_R_OK success
2791 * @retval PMINFO_R_EINVAL invalid argument
2792 * @retval PMINFO_R_ERROR internal error
2793 * @pre pkgmgrinfo_appinfo_get_appinfo()
2794 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2795 * @see pkgmgrinfo_appinfo_get_uri()
2796 * @see pkgmgrinfo_appinfo_get_mime()
2798 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2803 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2804 for (i = 0; i < oc; i++) {
2805 if (strcmp(operation[i], (char *)user_data) == 0)
2812 static int check_operation(const char *appid, char *operation)
2815 pkgmgrinfo_appinfo_h handle;
2816 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2817 if (ret != PMINFO_R_OK)
2819 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2820 if (ret != PMINFO_R_OK) {
2821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2829 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2830 int *operation_count, char ***operation);
2833 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2834 int *uri_count, char ***uri)
2835 * @brief This API gets the list of uri of the application
2837 * @par This API is for package-manager client application
2838 * @par Sync (or) Async : Synchronous API
2840 * @param[in] handle pointer to the appcontrol handle.
2841 * @param[out] uri_count pointer to hold number of uris
2842 * @param[out] uri pointer to hold list of uris
2843 * @return 0 if success, error code(<0) if fail
2844 * @retval PMINFO_R_OK success
2845 * @retval PMINFO_R_EINVAL invalid argument
2846 * @retval PMINFO_R_ERROR internal error
2847 * @pre pkgmgrinfo_appinfo_get_appinfo()
2848 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2849 * @see pkgmgrinfo_appinfo_get_operation()
2850 * @see pkgmgrinfo_appinfo_get_mime()
2852 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2857 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2858 for (i = 0; i < uc; i++) {
2859 if (strcmp(uri[i], (char *)user_data) == 0)
2866 static int check_uri(const char *appid, char *uri)
2869 pkgmgrinfo_appinfo_h handle;
2870 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2871 if (ret != PMINFO_R_OK)
2873 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2874 if (ret != PMINFO_R_OK) {
2875 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2878 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2883 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2884 int *uri_count, char ***uri);
2887 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2888 int *mime_count, char ***mime)
2889 * @brief This API gets the list of mime of the application
2891 * @par This API is for package-manager client application
2892 * @par Sync (or) Async : Synchronous API
2894 * @param[in] handle pointer to the appcontrol handle.
2895 * @param[out] mime_count pointer to hold number of mimes
2896 * @param[out] mime pointer to hold list of mimes
2897 * @return 0 if success, error code(<0) if fail
2898 * @retval PMINFO_R_OK success
2899 * @retval PMINFO_R_EINVAL invalid argument
2900 * @retval PMINFO_R_ERROR internal error
2901 * @pre pkgmgrinfo_appinfo_get_appinfo()
2902 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2903 * @see pkgmgrinfo_appinfo_get_uri()
2904 * @see pkgmgrinfo_appinfo_get_operation()
2906 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2911 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2912 for (i = 0; i < mc; i++) {
2913 if (strcmp(mime[i], (char *)user_data) == 0)
2920 static int check_mime(const char *appid, char *mime)
2923 pkgmgrinfo_appinfo_h handle;
2924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2925 if (ret != PMINFO_R_OK)
2927 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2928 if (ret != PMINFO_R_OK) {
2929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2932 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2937 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2938 int *mime_count, char ***mime);
2941 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2942 int *subapp_count, char ***subapp)
2943 * @brief This API gets the list of subapp of the application
2945 * @par This API is for package-manager client application
2946 * @par Sync (or) Async : Synchronous API
2948 * @param[in] handle pointer to the appcontrol handle.
2949 * @param[out] subapp_count pointer to hold number of subapp
2950 * @param[out] subapp pointer to hold list of subapp
2951 * @return 0 if success, error code(<0) if fail
2952 * @retval PMINFO_R_OK success
2953 * @retval PMINFO_R_EINVAL invalid argument
2954 * @retval PMINFO_R_ERROR internal error
2955 * @pre pkgmgrinfo_appinfo_get_appinfo()
2956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2957 * @see pkgmgrinfo_appinfo_get_uri()
2958 * @see pkgmgrinfo_appinfo_get_operation()
2960 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2964 char **subapp = NULL;
2965 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2966 for (i = 0; i < sc; i++) {
2967 if (strcmp(subapp[i], (char *)user_data) == 0)
2974 static int check_subapp(const char *appid, char *subapp)
2977 pkgmgrinfo_appinfo_h handle = NULL;
2978 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2979 if (ret != PMINFO_R_OK)
2981 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2982 if (ret != PMINFO_R_OK) {
2983 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2986 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2991 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2992 int *subapp_count, char ***subapp);
2995 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2996 * @brief This API gets the notification icon of the application
2998 * @par This API is for package-manager client application
2999 * @par Sync (or) Async : Synchronous API
3001 * @param[in] handle pointer to the application info handle.
3002 * @param[out] icon pointer to hold notification icon
3003 * @return 0 if success, error code(<0) if fail
3004 * @retval PMINFO_R_OK success
3005 * @retval PMINFO_R_EINVAL invalid argument
3006 * @retval PMINFO_R_ERROR internal error
3007 * @pre pkgmgrinfo_appinfo_get_appinfo()
3008 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3009 * @see pkgmgrinfo_appinfo_get_appid()
3010 * @see pkgmgrinfo_appinfo_is_multiple()
3012 static int get_app_notification_icon(const char *appid)
3015 char *notification_icon = NULL;
3016 pkgmgrinfo_appinfo_h handle;
3017 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3018 if (ret != PMINFO_R_OK)
3020 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3021 if (ret != PMINFO_R_OK) {
3022 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3025 printf("notification icon : %s\n", notification_icon);
3026 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3031 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3034 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3035 * @brief This API gets the setting icon of the application
3037 * @par This API is for package-manager client application
3038 * @par Sync (or) Async : Synchronous API
3040 * @param[in] handle pointer to the application info handle.
3041 * @param[out] icon pointer to hold setting icon
3042 * @return 0 if success, error code(<0) if fail
3043 * @retval PMINFO_R_OK success
3044 * @retval PMINFO_R_EINVAL invalid argument
3045 * @retval PMINFO_R_ERROR internal error
3046 * @pre pkgmgrinfo_appinfo_get_appinfo()
3047 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3048 * @see pkgmgrinfo_appinfo_get_appid()
3049 * @see pkgmgrinfo_appinfo_is_multiple()
3051 static int get_app_setting_icon(const char *appid)
3054 char *setting_icon = NULL;
3055 pkgmgrinfo_appinfo_h handle;
3056 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3057 if (ret != PMINFO_R_OK)
3059 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3060 if (ret != PMINFO_R_OK) {
3061 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3064 printf("setting icon : %s\n", setting_icon);
3065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3073 * @fn int pkgmgrinfo_appinfo_get_small_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3074 * @brief This API gets the small icon of the application
3076 * @par This API is for package-manager client application
3077 * @par Sync (or) Async : Synchronous API
3079 * @param[in] handle pointer to the application info handle.
3080 * @param[out] icon pointer to hold small icon
3081 * @return 0 if success, error code(<0) if fail
3082 * @retval PMINFO_R_OK success
3083 * @retval PMINFO_R_EINVAL invalid argument
3084 * @retval PMINFO_R_ERROR internal error
3085 * @pre pkgmgrinfo_appinfo_get_appinfo()
3086 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3087 * @see pkgmgrinfo_appinfo_get_appid()
3088 * @see pkgmgrinfo_appinfo_is_multiple()
3090 static int get_app_small_icon(const char *appid)
3093 char *small_icon = NULL;
3094 pkgmgrinfo_appinfo_h handle;
3095 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3096 if (ret != PMINFO_R_OK)
3098 ret = pkgmgrinfo_appinfo_get_small_icon(handle, &small_icon);
3099 if (ret != PMINFO_R_OK) {
3100 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3103 printf("small icon : %s\n", small_icon);
3104 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3109 int pkgmgrinfo_appinfo_get_small_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3112 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3113 * @brief This API gets the type of recent image on app-tray
3115 * @par This API is for package-manager client application
3116 * @par Sync (or) Async : Synchronous API
3118 * @param[in] handle pointer to the application info handle.
3119 * @param[out] type pointer to hold image type
3120 * @return 0 if success, error code(<0) if fail
3121 * @retval PMINFO_R_OK success
3122 * @retval PMINFO_R_EINVAL invalid argument
3123 * @retval PMINFO_R_ERROR internal error
3124 * @pre pkgmgrinfo_appinfo_get_appinfo()
3125 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3126 * @see pkgmgrinfo_appinfo_get_appid()
3127 * @see pkgmgrinfo_appinfo_is_multiple()
3129 static int get_app_recent_image_type(const char *appid)
3132 pkgmgrinfo_app_recentimage type;
3133 pkgmgrinfo_appinfo_h handle;
3134 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3135 if (ret != PMINFO_R_OK)
3137 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3138 if (ret != PMINFO_R_OK) {
3139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3142 printf("recent image type: %d\n", type);
3143 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3148 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3152 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3153 * @brief This API gets the preview image of application
3155 * @par Sync (or) Async : Synchronous API
3157 * @param[in] handle pointer to the application info handle.
3158 * @param[out] preview_img pointer to hold preview image path
3159 * @return 0 if success, error code(<0) if fail
3160 * @retval PMINFO_R_OK success
3161 * @retval PMINFO_R_EINVAL invalid argument
3162 * @retval PMINFO_R_ERROR internal error
3163 * @pre pkgmgrinfo_appinfo_get_appinfo()
3164 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3165 * @see pkgmgrinfo_appinfo_get_appid()
3167 static int get_app_previewimage(const char *appid)
3170 char *preview = NULL;
3171 pkgmgrinfo_appinfo_h handle = NULL;
3172 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3173 if (ret != PMINFO_R_OK)
3175 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3176 if (ret != PMINFO_R_OK) {
3177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3180 printf("preview image path : %s\n", preview);
3181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3186 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3190 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3191 * @brief This API gets the package permission type of the application
3193 * @par This API is for package-manager client application
3194 * @par Sync (or) Async : Synchronous API
3196 * @param[in] handle pointer to the application info handle.
3197 * @param[out] permission pointer to hold package permission
3198 * @return 0 if success, error code(<0) if fail
3199 * @retval PMINFO_R_OK success
3200 * @retval PMINFO_R_EINVAL invalid argument
3201 * @retval PMINFO_R_ERROR internal error
3202 * @pre pkgmgrinfo_appinfo_get_appinfo()
3203 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3204 * @see pkgmgrinfo_appinfo_get_appid()
3206 static int get_app_permission(const char *appid)
3209 pkgmgrinfo_permission_type permission = 0;
3210 pkgmgrinfo_appinfo_h handle;
3212 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3213 if (ret != PMINFO_R_OK)
3215 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3216 if (ret != PMINFO_R_OK) {
3217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 printf("permission type: %d\n", permission);
3221 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3226 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3229 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3230 * @brief This API gets the component_type
3232 * @par This API is for package-manager client application
3233 * @par Sync (or) Async : Synchronous API
3235 * @param[in] handle pointer to the application info handle.
3236 * @param[out] component_type pointer to hold component_type
3237 * @return 0 if success, error code(<0) if fail
3238 * @retval PMINFO_R_OK success
3239 * @retval PMINFO_R_EINVAL invalid argument
3240 * @retval PMINFO_R_ERROR internal error
3241 * @pre pkgmgrinfo_appinfo_get_appinfo()
3242 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3243 * @see pkgmgrinfo_appinfo_get_pkgid()
3244 * @see pkgmgrinfo_appinfo_is_multiple()
3246 static int get_component_type(const char *appid)
3249 char *component_type = NULL;
3250 pkgmgrinfo_appinfo_h handle;
3251 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3252 if (ret != PMINFO_R_OK)
3254 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3255 if (ret != PMINFO_R_OK) {
3256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3259 printf("component_type: %s\n", component_type);
3260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3265 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3268 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3269 * @brief This API gets the application 'hwacceleration' value from the app ID
3271 * @par This API is for package-manager client application
3272 * @par Sync (or) Async : Synchronous API
3274 * @param[in] handle pointer to application info handle
3275 * @param[out] hwacceleration pointer to hold package hwacceleration value
3276 * @return 0 if success, error code(<0) if fail
3277 * @retval PMINFO_R_OK success
3278 * @retval PMINFO_R_EINVAL invalid argument
3279 * @retval PMINFO_R_ERROR internal error
3280 * @pre pkgmgrinfo_appinfo_get_appinfo()
3281 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3282 * @see pkgmgrinfo_appinfo_get_appid()
3283 * @see pkgmgrinfo_appinfo_is_multiple()
3285 static int get_app_hwacceleration(const char *appid)
3288 pkgmgrinfo_app_hwacceleration hwacceleration;
3289 pkgmgrinfo_appinfo_h handle;
3290 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3291 if (ret != PMINFO_R_OK)
3293 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3294 if (ret != PMINFO_R_OK) {
3295 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3298 printf("app hwacceleration: %d\n", hwacceleration);
3299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3304 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3307 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3308 * @brief This API gets the application 'screenreader' value from the app ID
3310 * @par This API is for package-manager client application
3311 * @par Sync (or) Async : Synchronous API
3313 * @param[in] handle pointer to application info handle
3314 * @param[out] screenreader pointer to hold package accessibility value
3315 * @return 0 if success, error code(<0) if fail
3316 * @retval PMINFO_R_OK success
3317 * @retval PMINFO_R_EINVAL invalid argument
3318 * @retval PMINFO_R_ERROR internal error
3319 * @pre pkgmgrinfo_appinfo_get_appinfo()
3320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3321 * @see pkgmgrinfo_appinfo_get_appid()
3322 * @see pkgmgrinfo_appinfo_is_multiple()
3324 static int get_app_screenreader(const char *appid)
3327 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3328 pkgmgrinfo_appinfo_h handle = NULL;
3329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3330 if (ret != PMINFO_R_OK)
3332 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3333 if (ret != PMINFO_R_OK) {
3334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3337 printf("app screenreader: %d\n", screenreader);
3338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3343 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3346 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3347 * @brief This API gets the application's landscape & portrait effect images
3349 * @par This API is for package-manager client application
3350 * @par Sync (or) Async : Synchronous API
3352 * @param[in] handle pointer to application info handle
3353 * @param[out] portrait_img contains portrait mode effect image
3354 * @param[out] landscape_img contains landscape mode effect image
3355 * @return 0 if success, error code(<0) if fail
3356 * @retval PMINFO_R_OK success
3357 * @retval PMINFO_R_EINVAL invalid argument
3358 * @retval PMINFO_R_ERROR internal error
3359 * @pre pkgmgrinfo_appinfo_get_appinfo()
3360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3361 * @see pkgmgrinfo_appinfo_get_appid()
3362 * @see pkgmgrinfo_appinfo_is_nodisplay()
3364 static int get_app_effectimages(const char *appid)
3367 char *portraitimg = NULL;
3368 char *landscapeimg = NULL;
3369 pkgmgrinfo_appinfo_h handle;
3370 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3371 if (ret != PMINFO_R_OK)
3373 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3374 if (ret != PMINFO_R_OK) {
3375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3378 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3379 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3384 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3387 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3388 * @brief This API gets the application's effect image type
3390 * @par This API is for package-manager client application
3391 * @par Sync (or) Async : Synchronous API
3393 * @param[in] handle pointer to application info handle
3394 * @param[out] effectimg_type contains effect image type
3395 * @return 0 if success, error code(<0) if fail
3396 * @retval PMINFO_R_OK success
3397 * @retval PMINFO_R_EINVAL invalid argument
3398 * @retval PMINFO_R_ERROR internal error
3399 * @pre pkgmgrinfo_appinfo_get_appinfo()
3400 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3401 * @see pkgmgrinfo_appinfo_get_appid()
3402 * @see pkgmgrinfo_appinfo_is_nodisplay()
3404 static int get_app_effectimage_type(const char *appid)
3407 char *effectimg_type = NULL;
3408 pkgmgrinfo_appinfo_h handle;
3409 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3410 if (ret != PMINFO_R_OK)
3412 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3413 if (ret != PMINFO_R_OK) {
3414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3417 printf("app effect image type: %s\n", effectimg_type);
3418 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3423 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3426 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3427 * @brief This API gets the submode_mainid of the application
3429 * @par This API is for package-manager client application
3430 * @par Sync (or) Async : Synchronous API
3432 * @param[in] handle pointer to the application info handle.
3433 * @param[out] submode_mainid pointer to hold package name
3434 * @return 0 if success, error code(<0) if fail
3435 * @retval PMINFO_R_OK success
3436 * @retval PMINFO_R_EINVAL invalid argument
3437 * @retval PMINFO_R_ERROR internal error
3438 * @pre pkgmgrinfo_appinfo_get_appinfo()
3439 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3440 * @see pkgmgrinfo_appinfo_get_appid()
3441 * @see pkgmgrinfo_appinfo_is_multiple()
3443 static int get_app_submode_mainid(const char *appid)
3446 char *submode_mainid = NULL;
3447 pkgmgrinfo_appinfo_h handle = NULL;
3448 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3449 if (ret != PMINFO_R_OK)
3451 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3452 if (ret != PMINFO_R_OK) {
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 printf("submode_mainid: %s\n", submode_mainid);
3457 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3462 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3465 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3466 * @brief This API gets exactly matched label by given appid and locale
3468 * @par This API is for package-manager client application
3469 * @par Sync (or) Async : Synchronous API
3471 * @param[in] appid pointer to appid
3472 * @param[in] locale pointer to locale
3473 * @param[out] label pointer to hold app label
3474 * @return 0 if success, error code(<0) if fail
3475 * @retval PMINFO_R_OK success
3476 * @retval PMINFO_R_EINVAL invalid argument
3477 * @retval PMINFO_R_ERROR internal error
3479 static int get_localed_label(const char *appid, const char *locale)
3484 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3485 if (ret != PMINFO_R_OK)
3488 printf("localed label: %s\n", label);
3496 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3499 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3500 * @brief This API gets metadata value by given metadata key
3502 * @par This API is for package-manager client application
3503 * @par Sync (or) Async : Synchronous API
3505 * @param[in] handle pointer to the application info handle
3506 * @param[in] metadata_key metadata key
3507 * @param[out] metadata_value pointer to hold metadata value
3508 * @return 0 if success, error code(<0) if fail
3509 * @retval PMINFO_R_OK success
3510 * @retval PMINFO_R_EINVAL invalid argument
3511 * @retval PMINFO_R_ERROR internal error
3513 static int get_metadata_value(const char *appid, const char *metadata_key)
3516 pkgmgrinfo_appinfo_h handle;
3517 char *metadata_value = NULL;
3519 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3520 if (ret != PMINFO_R_OK)
3523 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3524 if (ret != PMINFO_R_OK) {
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3537 * @fn int pkgmgrinfo_appinfo_get_multi_instance_mainid(pkgmgrinfo_appinfo_h handle, char **multi_instance_mainid)
3538 * @brief This API gets the multi_instance_mainid of the application
3540 * @par This API is for package-manager client application
3541 * @par Sync (or) Async : Synchronous API
3543 * @param[in] handle pointer to the application info handle.
3544 * @param[out] multi_instance_mainid pointer to hold app multi_instance_mainid
3545 * @return 0 if success, error code(<0) if fail
3546 * @retval PMINFO_R_OK success
3547 * @retval PMINFO_R_EINVAL invalid argument
3548 * @retval PMINFO_R_ERROR internal error
3549 * @pre pkgmgrinfo_appinfo_get_appinfo()
3550 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3551 * @see pkgmgrinfo_appinfo_get_appid()
3552 * @see pkgmgrinfo_appinfo_is_multiple()
3554 static int get_app_multi_instance_mainid(const char *appid)
3557 char *multi_instance_mainid = NULL;
3558 pkgmgrinfo_appinfo_h handle;
3559 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3560 if (ret != PMINFO_R_OK)
3562 ret = pkgmgrinfo_appinfo_get_multi_instance_mainid(handle, &multi_instance_mainid);
3563 if (ret != PMINFO_R_OK) {
3564 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3567 printf("multi_instance_mainid: %s\n", multi_instance_mainid);
3568 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3573 int pkgmgrinfo_appinfo_get_multi_instance_mainid(pkgmgrinfo_appinfo_h handle, char **multi_instance_mainid);
3576 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3577 * @brief This API gets the datacontrol info
3579 * @par This API is for package-manager client application
3580 * @par Sync (or) Async : Synchronous API
3582 * @param[in] providerid pointer to the providerid of dataconltrol.
3583 * @param[in] type pointer to the type of dataconltrol.
3584 * @param[out] appid pointer to hold appid, need to free after using
3585 * @param[out] access pointer to hold access, need to free after using
3586 * @return 0 if success, error code(<0) if fail
3587 * @retval PMINFO_R_OK success
3588 * @retval PMINFO_R_EINVAL invalid argument
3589 * @retval PMINFO_R_ERROR internal error
3592 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3595 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3596 * @brief This API gets the appid of datacontrol
3598 * @par This API is for package-manager client application
3599 * @par Sync (or) Async : Synchronous API
3601 * @param[in] providerid pointer to the providerid of dataconltrol.
3602 * @param[out] appid pointer to hold appid, need to free after using
3603 * @return 0 if success, error code(<0) if fail
3604 * @retval PMINFO_R_OK success
3605 * @retval PMINFO_R_EINVAL invalid argument
3606 * @retval PMINFO_R_ERROR internal error
3609 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3612 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
3613 * @brief This API gets the support_mode of the application
3615 * @par This API is for package-manager client application
3616 * @par Sync (or) Async : Synchronous API
3618 * @param[in] handle pointer to the application info handle.
3619 * @param[out] support_mode pointer to hold app support_mode
3620 * @return 0 if success, error code(<0) if fail
3621 * @retval PMINFO_R_OK success
3622 * @retval PMINFO_R_EINVAL invalid argument
3623 * @retval PMINFO_R_ERROR internal error
3624 * @pre pkgmgrinfo_appinfo_get_appinfo()
3625 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3626 * @see pkgmgrinfo_appinfo_get_appid()
3628 static int get_app_support_mode(const char *appid)
3631 int support_mode = 0;
3632 pkgmgrinfo_appinfo_h handle;
3633 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3634 if (ret != PMINFO_R_OK)
3636 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
3637 if (ret != PMINFO_R_OK) {
3638 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3641 printf("support_mode: %s\n", support_mode);
3642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3647 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
3651 * @fn int pkgmgrinfo_appinfo_get_support_feature(pkgmgrinfo_appinfo_h handle, int *support_feature)
3652 * @brief This API gets the support_funtion of the application
3654 * @par This API is for package-manager client application
3655 * @par Sync (or) Async : Synchronous API
3657 * @param[in] handle pointer to the application info handle.
3658 * @param[out] support_feature pointer to hold app support_feature
3659 * @return 0 if success, error code(<0) if fail
3660 * @retval PMINFO_R_OK success
3661 * @retval PMINFO_R_EINVAL invalid argument
3662 * @retval PMINFO_R_ERROR internal error
3663 * @pre pkgmgrinfo_appinfo_get_appinfo()
3664 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3665 * @see pkgmgrinfo_appinfo_get_appid()
3667 static int get_app_support_feature(const char *appid)
3670 int support_feature = 0;
3671 pkgmgrinfo_appinfo_h handle = NULL;
3672 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3673 if (ret != PMINFO_R_OK)
3675 ret = pkgmgrinfo_appinfo_get_support_feature(handle, &support_feature);
3676 if (ret != PMINFO_R_OK) {
3677 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3680 printf("support_feature: %d\n", support_feature);
3681 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3686 int pkgmgrinfo_appinfo_get_support_feature(pkgmgrinfo_appinfo_h handle, int *support_feature);
3689 * @fn int pkgmgrinfo_appinfo_get_uginfo(const char *ug_name, pkgmgrinfo_appinfo_h *handle)
3690 * @brief This API creates the application information handle from ug_name
3692 * @par This API is for package-manager client application
3693 * @par Sync (or) Async : Synchronous API
3695 * @param[in] ug_name pointer to ug_name
3696 * @param[out] handle pointer to the application info handle.
3697 * @return 0 if success, error code(<0) if fail
3698 * @retval PMINFO_R_OK success
3699 * @retval PMINFO_R_EINVAL invalid argument
3700 * @retval PMINFO_R_ERROR internal error
3702 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3704 static int get_app_uginfo(const char *ug_name)
3708 pkgmgrinfo_appinfo_h handle;
3709 ret = pkgmgrinfo_appinfo_get_uginfo(ug_name, &handle);
3710 if (ret != PMINFO_R_OK)
3712 ret = pkgmgrinfo_appinfo_get_appid(handle, &appid);
3713 if (ret != PMINFO_R_OK) {
3714 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3717 printf("appid: %s\n", appid);
3718 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3723 int pkgmgrinfo_appinfo_get_uginfo(const char *ug_name, pkgmgrinfo_appinfo_h *handle);
3727 * @fn int pkgmgrinfo_appinfo_get_aliasid(const char *app_id, char** alias_id)
3728 * @brief This API get alias_id for an appid from pkgmgr DB.
3730 * @par This API is for package-manager client application
3731 * @par Sync (or) Async : Synchronous API
3733 * @param[in] appid pointer to application id
3734 * @param[out] alias_id pointer to pointer of alias id.
3735 * @return 0 if success, error code(<0) if fail
3736 * @retval PMINFO_R_OK success
3737 * @retval PMINFO_R_EINVAL invalid argument
3738 * @retval PMINFO_R_ERROR internal error
3742 static int get_app_aliasid(const char *appid)
3745 char *alias_id = NULL;
3746 ret = pkgmgrinfo_appinfo_get_aliasid(appid, &alias_id);
3747 if (ret != PMINFO_R_OK){
3748 printf("Failed to get the aliasid for [%s]\n",appid);
3752 printf("aliasid: %s\n", alias_id);
3754 printf("No alias_id found for %s\n",appid);
3762 int pkgmgrinfo_appinfo_get_aliasid(const char* appid, char** alias_id);
3765 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3766 * @brief This API gets the installed_time of the application
3768 * @par This API is for package-manager client application
3769 * @par Sync (or) Async : Synchronous API
3771 * @param[in] handle pointer to the application info handle.
3772 * @param[out] installed_time pointer to hold installed_time
3773 * @return 0 if success, error code(<0) if fail
3774 * @retval PMINFO_R_OK success
3775 * @retval PMINFO_R_EINVAL invalid argument
3776 * @retval PMINFO_R_ERROR internal error
3777 * @pre pkgmgrinfo_appinfo_get_appinfo()
3778 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3779 * @see pkgmgrinfo_appinfo_get_appid()
3780 * @see pkgmgrinfo_appinfo_is_multiple()
3782 static int get_app_installed_time(const char *appid)
3785 int installed_time = 0;
3786 pkgmgrinfo_appinfo_h handle;
3787 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3788 if (ret != PMINFO_R_OK)
3790 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
3791 if (ret != PMINFO_R_OK) {
3792 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3795 printf("installed_time: %d\n", installed_time);
3796 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3801 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
3804 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3805 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3806 * @brief This API gets the list of permission for a particular application
3808 * @par This API is for package-manager client application
3809 * @par Sync (or) Async : Synchronous API
3810 * @param[in] handle pointer to the application info handle.
3811 * @param[in] permission_func callback function for list
3812 * @param[in] user_data user data to be passed to callback function
3813 * @return 0 if success, error code(<0) if fail
3814 * @retval PMINFO_R_OK success
3815 * @retval PMINFO_R_EINVAL invalid argument
3816 * @retval PMINFO_R_ERROR internal error
3817 * @pre pkgmgrinfo_appinfo_get_appinfo()
3818 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3820 int permission_func(const char *name, void *user_data)
3822 if (strcmp(name, (char *)user_data) == 0)
3828 static int list_permission(const char *appid, char *permission)
3831 pkgmgrinfo_appinfo_h handle;
3832 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3833 if (ret != PMINFO_R_OK)
3835 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3836 if (ret != PMINFO_R_OK) {
3837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3845 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3846 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3849 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3850 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3851 * @brief This API gets the list of category for a particular application
3853 * @par This API is for package-manager client application
3854 * @par Sync (or) Async : Synchronous API
3855 * @param[in] handle pointer to the application info handle.
3856 * @param[in] category_func callback function for list
3857 * @param[in] user_data user data to be passed to callback function
3858 * @return 0 if success, error code(<0) if fail
3859 * @retval PMINFO_R_OK success
3860 * @retval PMINFO_R_EINVAL invalid argument
3861 * @retval PMINFO_R_ERROR internal error
3862 * @pre pkgmgrinfo_appinfo_get_appinfo()
3863 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3865 int category_func(const char *name, void *user_data)
3867 if (strcmp(name, (char *)user_data) == 0)
3873 static int list_category(const char *appid, char *category)
3876 pkgmgrinfo_appinfo_h handle;
3877 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3878 if (ret != PMINFO_R_OK)
3880 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3881 if (ret != PMINFO_R_OK) {
3882 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3885 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3890 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3891 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3894 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3895 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3896 * @brief This API gets the list of metadata for a particular application
3898 * @par This API is for package-manager client application
3899 * @par Sync (or) Async : Synchronous API
3900 * @param[in] handle pointer to the application info handle.
3901 * @param[in] metadata_func callback function for list
3902 * @param[in] user_data user data to be passed to callback function
3903 * @return 0 if success, error code(<0) if fail
3904 * @retval PMINFO_R_OK success
3905 * @retval PMINFO_R_EINVAL invalid argument
3906 * @retval PMINFO_R_ERROR internal error
3907 * @pre pkgmgrinfo_appinfo_get_appinfo()
3908 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3910 int metadata_func(const char *key, const char *value, void *user_data)
3912 if (strcmp(key, (char *)user_data) == 0) {
3913 printf("Value is %s\n", value);
3920 static int list_metadata(const char *appid, char *key)
3923 pkgmgrinfo_appinfo_h handle;
3924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3925 if (ret != PMINFO_R_OK)
3927 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3928 if (ret != PMINFO_R_OK) {
3929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3932 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3937 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3938 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3942 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3943 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3944 * @brief This API gets the list of app-control for a particular application
3946 * @par This API is for package-manager client application
3947 * @par Sync (or) Async : Synchronous API
3948 * @param[in] handle pointer to the application info handle.
3949 * @param[in] appcontrol_func callback function for list
3950 * @param[in] user_data user data to be passed to callback function
3951 * @return 0 if success, error code(<0) if fail
3952 * @retval PMINFO_R_OK success
3953 * @retval PMINFO_R_EINVAL invalid argument
3954 * @retval PMINFO_R_ERROR internal error
3955 * @pre pkgmgrinfo_appinfo_get_appinfo()
3956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3958 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3963 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3964 for (i = 0; i < oc; i++) {
3965 if (strcmp(operation[i], (char *)user_data) == 0)
3972 static int check_operation(const char *appid, char *operation)
3975 pkgmgrinfo_appinfo_h handle;
3976 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3977 if (ret != PMINFO_R_OK)
3979 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3980 if (ret != PMINFO_R_OK) {
3981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3984 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3989 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3990 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3993 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3994 * @brief This API gets the application 'nodisplay' value from the app ID
3996 * @par This API is for package-manager client application
3997 * @par Sync (or) Async : Synchronous API
3999 * @param[in] handle pointer to application info handle
4000 * @param[out] nodisplay pointer to hold package nodisplay value
4001 * @return 0 if success, error code(<0) if fail
4002 * @retval PMINFO_R_OK success
4003 * @retval PMINFO_R_EINVAL invalid argument
4004 * @retval PMINFO_R_ERROR internal error
4005 * @pre pkgmgrinfo_appinfo_get_appinfo()
4006 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4007 * @see pkgmgrinfo_appinfo_get_appid()
4008 * @see pkgmgrinfo_appinfo_is_multiple()
4010 static int get_app_nodisplay(const char *appid)
4014 pkgmgrinfo_appinfo_h handle;
4015 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4016 if (ret != PMINFO_R_OK)
4018 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4019 if (ret != PMINFO_R_OK) {
4020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4023 printf("app nodisplay: %d\n", nodisplay);
4024 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4029 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4032 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4033 * @brief This API gets the application 'multiple' value from the app ID
4035 * @par This API is for package-manager client application
4036 * @par Sync (or) Async : Synchronous API
4038 * @param[in] handle pointer to application info handle
4039 * @param[out] multiple pointer to hold package multiple value
4040 * @return 0 if success, error code(<0) if fail
4041 * @retval PMINFO_R_OK success
4042 * @retval PMINFO_R_EINVAL invalid argument
4043 * @retval PMINFO_R_ERROR internal error
4044 * @pre pkgmgrinfo_appinfo_get_appinfo()
4045 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4046 * @see pkgmgrinfo_appinfo_get_appid()
4047 * @see pkgmgrinfo_appinfo_is_nodisplay()
4049 static int get_app_multiple(const char *appid)
4053 pkgmgrinfo_appinfo_h handle;
4054 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4055 if (ret != PMINFO_R_OK)
4057 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4058 if (ret != PMINFO_R_OK) {
4059 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4062 printf("app multiple: %d\n", multiple);
4063 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4068 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4071 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4072 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4073 * application launching effect. If fales, indicator will be hidden during application launching effect
4075 * @par This API is for package-manager client application
4076 * @par Sync (or) Async : Synchronous API
4078 * @param[in] handle pointer to application info handle
4079 * @param[out] indicator_disp contains indicator display status for application launching effect
4080 * @return 0 if success, error code(<0) if fail
4081 * @retval PMINFO_R_OK success
4082 * @retval PMINFO_R_EINVAL invalid argument
4083 * @retval PMINFO_R_ERROR internal error
4084 * @pre pkgmgrinfo_appinfo_get_appinfo()
4085 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4086 * @see pkgmgrinfo_appinfo_get_appid()
4087 * @see pkgmgrinfo_appinfo_is_nodisplay()
4089 static int get_app_indicator_display(const char *appid)
4092 bool indicator_disp;
4093 pkgmgrinfo_appinfo_h handle;
4094 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4095 if (ret != PMINFO_R_OK)
4097 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4098 if (ret != PMINFO_R_OK){
4099 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4102 printf("app indicator disp : %d\n", indicator_disp);
4103 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4108 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4111 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4112 * @brief This API gets the application 'taskmanage' value from the app ID
4114 * @par This API is for package-manager client application
4115 * @par Sync (or) Async : Synchronous API
4117 * @param[in] handle pointer to application info handle
4118 * @param[out] taskmanage pointer to hold package taskmanage value
4119 * @return 0 if success, error code(<0) if fail
4120 * @retval PMINFO_R_OK success
4121 * @retval PMINFO_R_EINVAL invalid argument
4122 * @retval PMINFO_R_ERROR internal error
4123 * @pre pkgmgrinfo_appinfo_get_appinfo()
4124 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4125 * @see pkgmgrinfo_appinfo_get_appid()
4126 * @see pkgmgrinfo_appinfo_is_multiple()
4128 static int get_app_taskmanage(const char *appid)
4132 pkgmgrinfo_appinfo_h handle;
4133 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4134 if (ret != PMINFO_R_OK)
4136 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4137 if (ret != PMINFO_R_OK) {
4138 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4141 printf("app taskmanage: %d\n", taskmanage);
4142 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4147 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4150 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4151 * @brief This API gets the application 'taskmanage' value from the app ID
4153 * @par This API is for package-manager client application
4154 * @par Sync (or) Async : Synchronous API
4156 * @param[in] handle pointer to application info handle
4157 * @param[out] enabled pointer to hold package enabled value
4158 * @return 0 if success, error code(<0) if fail
4159 * @retval PMINFO_R_OK success
4160 * @retval PMINFO_R_EINVAL invalid argument
4161 * @retval PMINFO_R_ERROR internal error
4162 * @pre pkgmgrinfo_appinfo_get_appinfo()
4163 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4164 * @see pkgmgrinfo_appinfo_get_appid()
4165 * @see pkgmgrinfo_appinfo_is_multiple()
4167 static int get_app_enabled(const char *appid)
4171 pkgmgrinfo_appinfo_h handle;
4172 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4173 if (ret != PMINFO_R_OK)
4175 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4176 if (ret != PMINFO_R_OK) {
4177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4180 printf("app enabled: %d\n", enabled);
4181 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4186 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4189 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4190 * @brief This API gets the application 'onboot' value from the app ID
4192 * @par This API is for package-manager client application
4193 * @par Sync (or) Async : Synchronous API
4195 * @param[in] handle pointer to application info handle
4196 * @param[out] onboot pointer to hold package onboot value
4197 * @return 0 if success, error code(<0) if fail
4198 * @retval PMINFO_R_OK success
4199 * @retval PMINFO_R_EINVAL invalid argument
4200 * @retval PMINFO_R_ERROR internal error
4201 * @pre pkgmgrinfo_appinfo_get_appinfo()
4202 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4203 * @see pkgmgrinfo_appinfo_get_appid()
4204 * @see pkgmgrinfo_appinfo_is_multiple()
4206 static int get_app_onboot(const char *appid)
4210 pkgmgrinfo_appinfo_h handle;
4211 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4212 if (ret != PMINFO_R_OK)
4214 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4215 if (ret != PMINFO_R_OK) {
4216 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4219 printf("app onboot: %d\n", onboot);
4220 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4225 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4228 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4229 * @brief This API gets the application 'autorestart' value from the app ID
4231 * @par This API is for package-manager client application
4232 * @par Sync (or) Async : Synchronous API
4234 * @param[in] handle pointer to application info handle
4235 * @param[out] autorestart pointer to hold package autorestart value
4236 * @return 0 if success, error code(<0) if fail
4237 * @retval PMINFO_R_OK success
4238 * @retval PMINFO_R_EINVAL invalid argument
4239 * @retval PMINFO_R_ERROR internal error
4240 * @pre pkgmgrinfo_appinfo_get_appinfo()
4241 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4242 * @see pkgmgrinfo_appinfo_get_appid()
4243 * @see pkgmgrinfo_appinfo_is_multiple()
4245 static int get_app_autorestart(const char *appid)
4249 pkgmgrinfo_appinfo_h handle;
4250 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4251 if (ret != PMINFO_R_OK)
4253 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4254 if (ret != PMINFO_R_OK) {
4255 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4258 printf("app autorestart: %d\n", autorestart);
4259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4264 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4267 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4268 * @brief This API gets the value for given application is main app or not from handle
4270 * @par This API is for package-manager client application
4271 * @par Sync (or) Async : Synchronous API
4273 * @param[in] handle pointer to application info handle
4274 * @param[out] mainapp pointer to hold package mainapp is or not
4275 * @return 0 if success, error code(<0) if fail
4276 * @retval PMINFO_R_OK success
4277 * @retval PMINFO_R_EINVAL invalid argument
4278 * @retval PMINFO_R_ERROR internal error
4279 * @pre pkgmgrinfo_appinfo_get_appinfo()
4280 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4281 * @see pkgmgrinfo_appinfo_get_appid()
4282 * @see pkgmgrinfo_appinfo_is_multiple()
4284 static int get_app_mainapp(const char *appid)
4288 pkgmgrinfo_appinfo_h handle;
4289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4290 if (ret != PMINFO_R_OK)
4292 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4293 if (ret != PMINFO_R_OK) {
4294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4297 printf("mainapp: %d\n", mainapp);
4298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4303 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4307 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4308 * @brief This API gets the value for given application is preload or not from handle
4310 * @par This API is for package-manager client application
4311 * @par Sync (or) Async : Synchronous API
4313 * @param[in] handle pointer to application info handle
4314 * @param[out] preload pointer to hold preload is or not
4315 * @return 0 if success, error code(<0) if fail
4316 * @retval PMINFO_R_OK success
4317 * @retval PMINFO_R_EINVAL invalid argument
4318 * @retval PMINFO_R_ERROR internal error
4319 * @pre pkgmgrinfo_appinfo_get_appinfo()
4320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4321 * @see pkgmgrinfo_appinfo_get_appid()
4322 * @see pkgmgrinfo_appinfo_is_multiple()
4324 static int get_app_preload(const char *appid)
4328 pkgmgrinfo_appinfo_h handle = NULL;
4329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4330 if (ret != PMINFO_R_OK)
4332 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4333 if (ret != PMINFO_R_OK) {
4334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4337 printf("preload: %d\n", preload);
4338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4343 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4346 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4347 * @brief This API gets the value for given application is submode or not from handle
4349 * @par This API is for package-manager client application
4350 * @par Sync (or) Async : Synchronous API
4352 * @param[in] handle pointer to application info handle
4353 * @param[out] submode pointer to hold submode is or not
4354 * @return 0 if success, error code(<0) if fail
4355 * @retval PMINFO_R_OK success
4356 * @retval PMINFO_R_EINVAL invalid argument
4357 * @retval PMINFO_R_ERROR internal error
4358 * @pre pkgmgrinfo_appinfo_get_appinfo()
4359 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4360 * @see pkgmgrinfo_appinfo_get_appid()
4361 * @see pkgmgrinfo_appinfo_is_multiple()
4363 static int get_app_submode(const char *appid)
4367 pkgmgrinfo_appinfo_h handle = NULL;
4368 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4369 if (ret != PMINFO_R_OK)
4371 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4372 if (ret != PMINFO_R_OK) {
4373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4376 printf("submode: %d\n", submode);
4377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4382 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4385 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4386 * @brief This API gets the value for given application is process_pool or not from handle
4388 * @par This API is for package-manager client application
4389 * @par Sync (or) Async : Synchronous API
4391 * @param[in] handle pointer to application info handle
4392 * @param[out] process_pool pointer to hold process_pool is or not
4393 * @return 0 if success, error code(<0) if fail
4394 * @retval PMINFO_R_OK success
4395 * @retval PMINFO_R_EINVAL invalid argument
4396 * @retval PMINFO_R_ERROR internal error
4397 * @pre pkgmgrinfo_appinfo_get_appinfo()
4398 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4399 * @see pkgmgrinfo_appinfo_get_appid()
4401 static int get_app_process_pool(const char *appid)
4404 bool process_pool = 0;
4405 pkgmgrinfo_appinfo_h handle = NULL;
4406 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4407 if (ret != PMINFO_R_OK)
4409 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4410 if (ret != PMINFO_R_OK) {
4411 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4414 printf("process_pool: %d\n", process_pool);
4415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4420 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4423 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4424 * @brief This API checks if the application has the given category
4426 * @par This API is for package-manager client application
4427 * @par Sync (or) Async : Synchronous API
4429 * @param[in] handle pointer to the application info handle
4430 * @param[in] category category
4431 * @param[out] exist value Gets whether the application has the given category
4432 * @return 0 if success, error code(<0) if fail
4433 * @retval PMINFO_R_OK success
4434 * @retval PMINFO_R_EINVAL invalid argument
4435 * @retval PMINFO_R_ERROR internal error
4437 static int is_category_exist(const char *appid, const char *category)
4440 pkgmgrinfo_appinfo_h handle;
4443 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4444 if (ret != PMINFO_R_OK)
4447 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4448 if (ret != PMINFO_R_OK) {
4449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4458 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4462 * @fn int pkgmgrinfo_appinfo_is_multi_instance(pkgmgrinfo_appinfo_h handle, bool *multi_instance)
4463 * @brief This API gets the application 'multi_instance' value from the app ID
4465 * @par This API is for package-manager client application
4466 * @par Sync (or) Async : Synchronous API
4468 * @param[in] handle pointer to application info handle
4469 * @param[out] multi_instance pointer to hold package multi_instance value
4470 * @return 0 if success, error code(<0) if fail
4471 * @retval PMINFO_R_OK success
4472 * @retval PMINFO_R_EINVAL invalid argument
4473 * @retval PMINFO_R_ERROR internal error
4474 * @pre pkgmgrinfo_appinfo_get_appinfo()
4475 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4476 * @see pkgmgrinfo_appinfo_get_appid()
4477 * @see pkgmgrinfo_appinfo_is_multiple()
4479 static int get_app_multi_instance(const char *appid)
4482 bool multi_instance;
4483 pkgmgrinfo_appinfo_h handle;
4484 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4485 if (ret != PMINFO_R_OK)
4487 ret = pkgmgrinfo_appinfo_is_multi_instance(handle, &multi_instance);
4488 if (ret != PMINFO_R_OK) {
4489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4492 printf("app multi_instance: %d\n", multi_instance);
4493 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4498 int pkgmgrinfo_appinfo_is_multi_instance(pkgmgrinfo_appinfo_h handle, bool *multi_instance);
4501 * @fn int pkgmgrinfo_appinfo_is_multi_window(pkgmgrinfo_appinfo_h handle, bool *multi_window)
4502 * @brief This API gets the application 'multi_window' value from the app ID
4504 * @par This API is for package-manager client application
4505 * @par Sync (or) Async : Synchronous API
4507 * @param[in] handle pointer to application info handle
4508 * @param[out] multi_window pointer to hold package multi_window value
4509 * @return 0 if success, error code(<0) if fail
4510 * @retval PMINFO_R_OK success
4511 * @retval PMINFO_R_EINVAL invalid argument
4512 * @retval PMINFO_R_ERROR internal error
4513 * @pre pkgmgrinfo_appinfo_get_appinfo()
4514 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4515 * @see pkgmgrinfo_appinfo_get_appid()
4516 * @see pkgmgrinfo_appinfo_is_multiple()
4518 static int get_app_multi_window(const char *appid)
4522 pkgmgrinfo_appinfo_h handle;
4523 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4524 if (ret != PMINFO_R_OK)
4526 ret = pkgmgrinfo_appinfo_is_multi_window(handle, &multi_window);
4527 if (ret != PMINFO_R_OK) {
4528 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4531 printf("app multi_window: %d\n", multi_window);
4532 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4537 int pkgmgrinfo_appinfo_is_multi_window(pkgmgrinfo_appinfo_h handle, bool *multi_window);
4540 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4541 * @brief This API gets the application 'support_disable' value from the app ID
4543 * @par This API is for package-manager client application
4544 * @par Sync (or) Async : Synchronous API
4546 * @param[in] handle pointer to application info handle
4547 * @param[out] support_disable pointer to hold package support_disable value
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @retval PMINFO_R_ERROR internal error
4552 * @pre pkgmgrinfo_appinfo_get_appinfo()
4553 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4554 * @see pkgmgrinfo_appinfo_get_appid()
4556 static int get_app_support_disable(const char *appid)
4559 bool support_disable;
4560 pkgmgrinfo_appinfo_h handle;
4561 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4562 if (ret != PMINFO_R_OK)
4564 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4565 if (ret != PMINFO_R_OK) {
4566 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4569 printf("app support_disable: %d\n", support_disable);
4570 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4575 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4578 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4579 * @brief This API gets the application 'ui_gadget' value from the app ID
4581 * @par This API is for package-manager client application
4582 * @par Sync (or) Async : Synchronous API
4584 * @param[in] handle pointer to application info handle
4585 * @param[out] ui_gadget pointer to hold package ui_gadget value
4586 * @return 0 if success, error code(<0) if fail
4587 * @retval PMINFO_R_OK success
4588 * @retval PMINFO_R_EINVAL invalid argument
4589 * @retval PMINFO_R_ERROR internal error
4590 * @pre pkgmgrinfo_appinfo_get_appinfo()
4591 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4592 * @see pkgmgrinfo_appinfo_get_appid()
4594 static int get_app_ui_gadget(const char *appid)
4598 pkgmgrinfo_appinfo_h handle = NULL;
4599 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4600 if (ret != PMINFO_R_OK)
4602 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4603 if (ret != PMINFO_R_OK) {
4604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4607 printf("app ui_gadget: %d\n", ui_gadget);
4608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4613 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4616 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4617 * @brief This API gets the application 'removable' value from the app ID
4619 * @par This API is for package-manager client application
4620 * @par Sync (or) Async : Synchronous API
4622 * @param[in] handle pointer to application info handle
4623 * @param[out] removable pointer to hold package removable value
4624 * @return 0 if success, error code(<0) if fail
4625 * @retval PMINFO_R_OK success
4626 * @retval PMINFO_R_EINVAL invalid argument
4627 * @retval PMINFO_R_ERROR internal error
4628 * @pre pkgmgrinfo_appinfo_get_appinfo()
4629 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4630 * @see pkgmgrinfo_appinfo_get_appid()
4632 static int get_app_removable(const char *appid)
4636 pkgmgrinfo_appinfo_h handle = NULL;
4637 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4638 if (ret != PMINFO_R_OK)
4640 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4641 if (ret != PMINFO_R_OK) {
4642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4645 printf("app removable: %d\n", removable);
4646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4651 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4654 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4655 * @brief This API gets the application 'system' value from the app ID
4657 * @par This API is for package-manager client application
4658 * @par Sync (or) Async : Synchronous API
4660 * @param[in] handle pointer to application info handle
4661 * @param[out] system pointer to hold package system value
4662 * @return 0 if success, error code(<0) if fail
4663 * @retval PMINFO_R_OK success
4664 * @retval PMINFO_R_EINVAL invalid argument
4665 * @retval PMINFO_R_ERROR internal error
4666 * @pre pkgmgrinfo_appinfo_get_appinfo()
4667 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4668 * @see pkgmgrinfo_appinfo_get_appid()
4670 static int get_app_system(const char *appid)
4673 bool system = false;
4674 pkgmgrinfo_appinfo_h handle = NULL;
4675 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4676 if (ret != PMINFO_R_OK)
4678 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4679 if (ret != PMINFO_R_OK) {
4680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4683 printf("app system: %d\n", system);
4684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4689 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4692 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4693 * @brief This API destroys the application information handle freeing up all the resources
4695 * @par This API is for package-manager client application
4696 * @par Sync (or) Async : Synchronous API
4698 * @param[in] handle pointer to the application info handle.
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
4703 * @pre pkgmgrinfo_appinfo_get_appinfo()
4705 * @see pkgmgrinfo_appinfo_get_pkgid()
4706 * @see pkgmgrinfo_appinfo_is_multiple()
4708 static int get_app_type(const char *appid)
4712 pkgmgrinfo_appinfo_h handle;
4713 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4714 if (ret != PMINFO_R_OK)
4716 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4717 if (ret != PMINFO_R_OK) {
4718 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4721 printf("apptype: %s\n", type);
4722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4727 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4730 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4731 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4732 The query will search the entire application information collected from the manifest file of all the installed packages
4734 * @par This API is for package-manager client application
4735 * @par Sync (or) Async : Synchronous API
4737 * @param[out] handle pointer to the application info filter handle.
4738 * @return 0 if success, error code(<0) if fail
4739 * @retval PMINFO_R_OK success
4740 * @retval PMINFO_R_EINVAL invalid argument
4741 * @retval PMINFO_R_ERROR internal error
4743 * @post pkgmgrinfo_appinfo_filter_destroy()
4744 * @see pkgmgrinfo_appinfo_filter_count()
4745 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4747 static int get_capp_count()
4751 pkgmgrinfo_appinfo_filter_h handle;
4752 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4753 if (ret != PMINFO_R_OK)
4755 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4756 if (ret != PMINFO_R_OK) {
4757 pkgmgrinfo_appinfo_filter_destroy(handle);
4760 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4761 if (ret != PMINFO_R_OK) {
4762 pkgmgrinfo_appinfo_filter_destroy(handle);
4765 printf("No of capp: %d\n", count);
4766 pkgmgrinfo_appinfo_filter_destroy(handle);
4771 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4774 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4775 * @brief This API destroys the application information filter handle freeing up all the resources
4777 * @par This API is for package-manager client application
4778 * @par Sync (or) Async : Synchronous API
4780 * @param[in] handle pointer to the application info filter handle.
4781 * @return 0 if success, error code(<0) if fail
4782 * @retval PMINFO_R_OK success
4783 * @retval PMINFO_R_EINVAL invalid argument
4784 * @retval PMINFO_R_ERROR internal error
4785 * @pre pkgmgrinfo_appinfo_filter_create()
4787 * @see pkgmgrinfo_appinfo_filter_count()
4788 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4790 static int get_capp_count()
4794 pkgmgrinfo_appinfo_filter_h handle;
4795 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4796 if (ret != PMINFO_R_OK)
4798 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4799 if (ret != PMINFO_R_OK) {
4800 pkgmgrinfo_appinfo_filter_destroy(handle);
4803 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4804 if (ret != PMINFO_R_OK) {
4805 pkgmgrinfo_appinfo_filter_destroy(handle);
4808 printf("No of capp: %d\n", count);
4809 pkgmgrinfo_appinfo_filter_destroy(handle);
4814 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4817 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4818 * @brief This API adds a boolean filter property to the filter handle
4820 * @par This API is for package-manager client application
4821 * @par Sync (or) Async : Synchronous API
4823 * @param[in] handle pointer to the application info filter handle.
4824 * @param[in] property boolean property name.
4825 * @param[in] value value corresponding to the property.
4826 * @return 0 if success, error code(<0) if fail
4827 * @retval PMINFO_R_OK success
4828 * @retval PMINFO_R_EINVAL invalid argument
4829 * @retval PMINFO_R_ERROR internal error
4830 * @pre pkgmgrinfo_appinfo_filter_create()
4831 * @post pkgmgrinfo_appinfo_filter_destroy()
4832 * @see pkgmgrinfo_appinfo_filter_count()
4833 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4835 static int get_taskmanageable_app_count()
4839 pkgmgrinfo_appinfo_filter_h handle;
4840 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4841 if (ret != PMINFO_R_OK)
4843 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4844 if (ret != PMINFO_R_OK) {
4845 pkgmgrinfo_appinfo_filter_destroy(handle);
4848 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4849 if (ret != PMINFO_R_OK) {
4850 pkgmgrinfo_appinfo_filter_destroy(handle);
4853 printf("No of taskmanageable apps: %d\n", count);
4854 pkgmgrinfo_appinfo_filter_destroy(handle);
4859 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4860 const char *property, const bool value);
4863 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4864 * @brief This API adds an integer filter property to the filter handle
4866 * @par This API is for package-manager client application
4867 * @par Sync (or) Async : Synchronous API
4869 * @param[in] handle pointer to the application info filter handle.
4870 * @param[in] property integer property name.
4871 * @param[in] value value corresponding to the property.
4872 * @return 0 if success, error code(<0) if fail
4873 * @retval PMINFO_R_OK success
4874 * @retval PMINFO_R_EINVAL invalid argument
4875 * @retval PMINFO_R_ERROR internal error
4876 * @pre pkgmgrinfo_appinfo_filter_create()
4877 * @post pkgmgrinfo_appinfo_filter_destroy()
4878 * @see pkgmgrinfo_appinfo_filter_count()
4879 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4881 static int get_taskmanageable_app_count()
4885 pkgmgrinfo_appinfo_filter_h handle;
4886 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4887 if (ret != PMINFO_R_OK)
4889 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4890 if (ret != PMINFO_R_OK) {
4891 pkgmgrinfo_appinfo_filter_destroy(handle);
4894 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4895 if (ret != PMINFO_R_OK) {
4896 pkgmgrinfo_appinfo_filter_destroy(handle);
4899 printf("No of apps: %d\n", count);
4900 pkgmgrinfo_appinfo_filter_destroy(handle);
4905 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4906 const char *property, const int value);
4909 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4910 * @brief This API adds a string filter property to the filter handle
4912 * @par This API is for package-manager client application
4913 * @par Sync (or) Async : Synchronous API
4915 * @param[in] handle pointer to the application info filter handle.
4916 * @param[in] property string property name.
4917 * @param[in] value value corresponding to the property.
4918 * @return 0 if success, error code(<0) if fail
4919 * @retval PMINFO_R_OK success
4920 * @retval PMINFO_R_EINVAL invalid argument
4921 * @retval PMINFO_R_ERROR internal error
4922 * @pre pkgmgrinfo_appinfo_filter_create()
4923 * @post pkgmgrinfo_appinfo_filter_destroy()
4924 * @see pkgmgrinfo_appinfo_filter_count()
4925 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4927 static int get_capp_count()
4931 pkgmgrinfo_appinfo_filter_h handle;
4932 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4933 if (ret != PMINFO_R_OK)
4935 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4936 if (ret != PMINFO_R_OK) {
4937 pkgmgrinfo_appinfo_filter_destroy(handle);
4940 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4941 if (ret != PMINFO_R_OK) {
4942 pkgmgrinfo_appinfo_filter_destroy(handle);
4945 printf("No of capp: %d\n", count);
4946 pkgmgrinfo_appinfo_filter_destroy(handle);
4951 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4952 const char *property, const char *value);
4955 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4956 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4958 * @par This API is for package-manager client application
4959 * @par Sync (or) Async : Synchronous API
4961 * @param[in] handle pointer to the application info filter handle.
4962 * @param[in] app_cb callback function.
4963 * @param[in] user_data user data to be passed to the callback function
4964 * @return 0 if success, error code(<0) if fail
4965 * @retval PMINFO_R_OK success
4966 * @retval PMINFO_R_EINVAL invalid argument
4967 * @retval PMINFO_R_ERROR internal error
4968 * @pre pkgmgrinfo_appinfo_filter_create()
4969 * @post pkgmgrinfo_appinfo_filter_destroy()
4970 * @see pkgmgrinfo_appinfo_filter_count()
4972 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4975 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4976 printf("appid : %s\n", appid);
4980 static int get_capp_list()
4983 pkgmgrinfo_appinfo_filter_h handle;
4984 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4985 if (ret != PMINFO_R_OK)
4987 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4988 if (ret != PMINFO_R_OK) {
4989 pkgmgrinfo_appinfo_filter_destroy(handle);
4992 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4993 if (ret != PMINFO_R_OK) {
4994 pkgmgrinfo_appinfo_filter_destroy(handle);
4997 pkgmgrinfo_appinfo_filter_destroy(handle);
5002 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5003 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5006 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5007 * @brief This API counts the application that satisfy the filter conditions
5009 * @par This API is for package-manager client application
5010 * @par Sync (or) Async : Synchronous API
5012 * @param[in] handle pointer to the application info filter handle.
5013 * @param[in] count pointer to store count value
5014 * @return 0 if success, error code(<0) if fail
5015 * @retval PMINFO_R_OK success
5016 * @retval PMINFO_R_EINVAL invalid argument
5017 * @retval PMINFO_R_ERROR internal error
5018 * @pre pkgmgrinfo_appinfo_filter_create()
5019 * @post pkgmgrinfo_appinfo_filter_destroy()
5020 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5022 static int get_capp_count()
5026 pkgmgrinfo_appinfo_filter_h handle;
5027 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5028 if (ret != PMINFO_R_OK)
5030 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5031 if (ret != PMINFO_R_OK) {
5032 pkgmgrinfo_appinfo_filter_destroy(handle);
5035 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5036 if (ret != PMINFO_R_OK) {
5037 pkgmgrinfo_appinfo_filter_destroy(handle);
5040 printf("No of capp: %d\n", count);
5041 pkgmgrinfo_appinfo_filter_destroy(handle);
5046 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5049 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5050 * @brief This API creates the application's metadata information filter handle from db.
5052 * @par This API is for package-manager client application
5053 * @par Sync (or) Async : Synchronous API
5055 * @param[out] handle pointer to the application metadata info filter handle.
5056 * @return 0 if success, error code(<0) if fail
5057 * @retval PMINFO_R_OK success
5058 * @retval PMINFO_R_EINVAL invalid argument
5059 * @retval PMINFO_R_ERROR internal error
5061 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5062 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5064 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5067 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5068 printf("appid : %s\n", appid);
5072 static int get_app_list(const char *mkey, const char *mvalue)
5075 pkgmgrinfo_appinfo_metadata_filter_h handle;
5076 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5077 if (ret != PMINFO_R_OK)
5079 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5080 if (ret != PMINFO_R_OK) {
5081 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5084 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5085 if (ret != PMINFO_R_OK) {
5086 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5089 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5094 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5097 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5098 * @brief This API destroys the application's metadata information filter handle.
5100 * @par This API is for package-manager client application
5101 * @par Sync (or) Async : Synchronous API
5103 * @param[in] handle pointer to the application metadata info filter handle.
5104 * @return 0 if success, error code(<0) if fail
5105 * @retval PMINFO_R_OK success
5106 * @retval PMINFO_R_EINVAL invalid argument
5107 * @retval PMINFO_R_ERROR internal error
5108 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5110 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5112 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5115 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5116 printf("appid : %s\n", appid);
5120 static int get_app_list(const char *mkey, const char *mvalue)
5123 pkgmgrinfo_appinfo_metadata_filter_h handle;
5124 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5125 if (ret != PMINFO_R_OK)
5127 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5128 if (ret != PMINFO_R_OK) {
5129 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5132 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5133 if (ret != PMINFO_R_OK) {
5134 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5137 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5142 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5145 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5146 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5147 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5149 * @par This API is for package-manager client application
5150 * @par Sync (or) Async : Synchronous API
5152 * @param[in] handle pointer to the application metadata info filter handle.
5153 * @param[in] key pointer to metadata key
5154 * @param[in] value pointer to metadata value
5155 * @return 0 if success, error code(<0) if fail
5156 * @retval PMINFO_R_OK success
5157 * @retval PMINFO_R_EINVAL invalid argument
5158 * @retval PMINFO_R_ERROR internal error
5159 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5160 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5161 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5163 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5166 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5167 printf("appid : %s\n", appid);
5171 static int get_app_list(const char *mkey, const char *mvalue)
5174 pkgmgrinfo_appinfo_metadata_filter_h handle;
5175 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5176 if (ret != PMINFO_R_OK)
5178 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5179 if (ret != PMINFO_R_OK) {
5180 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5183 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5184 if (ret != PMINFO_R_OK) {
5185 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5188 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5193 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5194 const char *key, const char *value);
5197 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5198 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5199 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5200 * negative value, no more callbacks will be called and API will return.
5202 * @par This API is for package-manager client application
5203 * @par Sync (or) Async : Synchronous API
5205 * @param[in] handle pointer to the application metadata info filter handle.
5206 * @param[in] app_cb function pointer to callback
5207 * @param[in] user_data pointer to user data
5208 * @return 0 if success, error code(<0) if fail
5209 * @retval PMINFO_R_OK success
5210 * @retval PMINFO_R_EINVAL invalid argument
5211 * @retval PMINFO_R_ERROR internal error
5212 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5213 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5215 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5218 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5219 printf("appid : %s\n", appid);
5223 static int get_app_list(const char *mkey, const char *mvalue)
5226 pkgmgrinfo_appinfo_metadata_filter_h handle;
5227 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5228 if (ret != PMINFO_R_OK)
5230 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5231 if (ret != PMINFO_R_OK) {
5232 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5235 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5236 if (ret != PMINFO_R_OK) {
5237 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5240 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5245 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5246 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5249 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5250 * @brief This API creates the package cert information handle to get data from db.
5252 * @par This API is for package-manager client application
5253 * @par Sync (or) Async : Synchronous API
5255 * @param[out] handle pointer to the package cert handle.
5256 * @return 0 if success, error code(<0) if fail
5257 * @retval PMINFO_R_OK success
5258 * @retval PMINFO_R_EINVAL invalid argument
5259 * @retval PMINFO_R_ERROR internal error
5261 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5262 * @see pkgmgrinfo_pkginfo_get_cert_value()
5263 * @see pkgmgrinfo_pkginfo_load_certinfo()
5265 static int get_cert_info(const char *pkgid)
5268 pkgmgrinfo_certinfo_h handle;
5269 char *auth_cert = NULL;
5270 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5271 if (ret != PMINFO_R_OK)
5273 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5274 if (ret != PMINFO_R_OK) {
5275 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5278 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5279 if (ret != PMINFO_R_OK) {
5280 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5283 printf("Author root certificate: %s\n", auth_root);
5284 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5289 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5292 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5293 * @brief This API loads the package cert information handle with data from db.
5295 * @par This API is for package-manager client application
5296 * @par Sync (or) Async : Synchronous API
5298 * @param[in] pkgid pointer to the package ID.
5299 * @param[in] handle pointer to the package cert handle.
5300 * @return 0 if success, error code(<0) if fail
5301 * @retval PMINFO_R_OK success
5302 * @retval PMINFO_R_EINVAL invalid argument
5303 * @retval PMINFO_R_ERROR internal error
5304 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5305 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5306 * @see pkgmgrinfo_pkginfo_get_cert_value()
5308 static int get_cert_info(const char *pkgid)
5311 pkgmgrinfo_certinfo_h handle;
5312 char *auth_cert = NULL;
5313 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5314 if (ret != PMINFO_R_OK)
5316 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5317 if (ret != PMINFO_R_OK) {
5318 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5321 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5322 if (ret != PMINFO_R_OK) {
5323 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5326 printf("Author root certificate: %s\n", auth_root);
5327 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5332 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle);
5335 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5336 * @brief This API gets the package cert information from the handle
5338 * @par This API is for package-manager client application
5339 * @par Sync (or) Async : Synchronous API
5341 * @param[in] handle pointer to the package cert handle.
5342 * @param[in] cert_type certificate type
5343 * @param[out] cert_value pointer to hold certificate value
5344 * @return 0 if success, error code(<0) if fail
5345 * @retval PMINFO_R_OK success
5346 * @retval PMINFO_R_EINVAL invalid argument
5347 * @retval PMINFO_R_ERROR internal error
5348 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5349 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5350 * @see pkgmgrinfo_pkginfo_load_certinfo()
5352 static int get_cert_info(const char *pkgid)
5355 pkgmgrinfo_certinfo_h handle;
5356 char *auth_cert = NULL;
5357 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5358 if (ret != PMINFO_R_OK)
5360 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5361 if (ret != PMINFO_R_OK) {
5362 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5365 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5366 if (ret != PMINFO_R_OK) {
5367 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5370 printf("Author root certificate: %s\n", auth_root);
5371 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5376 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5379 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5380 * @brief This API destroys the package cert information handle freeing up all the resources
5382 * @par This API is for package-manager client application
5383 * @par Sync (or) Async : Synchronous API
5385 * @param[in] handle pointer to the package cert handle.
5386 * @return 0 if success, error code(<0) if fail
5387 * @retval PMINFO_R_OK success
5388 * @retval PMINFO_R_EINVAL invalid argument
5389 * @retval PMINFO_R_ERROR internal error
5390 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5392 * @see pkgmgrinfo_pkginfo_load_certinfo()
5394 static int get_cert_info(const char *pkgid)
5397 pkgmgrinfo_certinfo_h handle;
5398 char *auth_cert = NULL;
5399 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5400 if (ret != PMINFO_R_OK)
5402 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5403 if (ret != PMINFO_R_OK) {
5404 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5407 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5408 if (ret != PMINFO_R_OK) {
5409 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5412 printf("Author root certificate: %s\n", auth_root);
5413 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5418 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5421 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5422 * @brief This API deletes the package cert information from DB
5424 * @par This API is for package-manager client application
5425 * @par Sync (or) Async : Synchronous API
5427 * @param[in] pkgid pointer to the package ID.
5428 * @return 0 if success, error code(<0) if fail
5429 * @retval PMINFO_R_OK success
5430 * @retval PMINFO_R_EINVAL invalid argument
5431 * @retval PMINFO_R_ERROR internal error
5435 static int delete_cert_info(const char *pkgid)
5438 ret = pkgmgrinfo_delete_certinfo(pkgid);
5439 if (ret != PMINFO_R_OK)
5445 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5449 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5450 * @brief This API creates the package cert information handle to set data in db.
5452 * @par This API is for package-manager client application
5453 * @par Sync (or) Async : Synchronous API
5455 * @param[out] handle pointer to the package cert handle.
5456 * @return 0 if success, error code(<0) if fail
5457 * @retval PMINFO_R_OK success
5458 * @retval PMINFO_R_EINVAL invalid argument
5459 * @retval PMINFO_R_ERROR internal error
5461 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5462 * @see pkgmgrinfo_set_cert_value()
5463 * @see pkgmgrinfo_save_certinfo()
5465 static int set_cert_in_db(const char *pkgid)
5468 pkgmgrinfo_instcertinfo_h handle;
5469 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5470 if (ret != PMINFO_R_OK)
5472 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5473 if (ret != PMINFO_R_OK) {
5474 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5477 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5478 if (ret != PMINFO_R_OK) {
5479 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5482 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5487 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5490 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5491 * @brief This API sets the package cert information in the handle.
5493 * @par This API is for package-manager client application
5494 * @par Sync (or) Async : Synchronous API
5496 * @param[in] handle pointer to the package cert handle.
5497 * @param[in] cert_type certificate type.
5498 * @param[in] cert_value certificate value.
5499 * @return 0 if success, error code(<0) if fail
5500 * @retval PMINFO_R_OK success
5501 * @retval PMINFO_R_EINVAL invalid argument
5502 * @retval PMINFO_R_ERROR internal error
5503 * @pre pkgmgrinfo_create_certinfo_set_handle()
5504 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5505 * @see pkgmgrinfo_save_certinfo()
5507 static int set_cert_in_db(const char *pkgid)
5510 pkgmgrinfo_instcertinfo_h handle;
5511 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5512 if (ret != PMINFO_R_OK)
5514 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5515 if (ret != PMINFO_R_OK) {
5516 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5519 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5520 if (ret != PMINFO_R_OK) {
5521 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5524 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5529 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5532 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5533 * @brief This API saves the package cert information in the DB.
5535 * @par This API is for package-manager client application
5536 * @par Sync (or) Async : Synchronous API
5538 * @param[in] pkgid pointer to the package ID.
5539 * @param[in] handle pointer to the package cert handle.
5540 * @return 0 if success, error code(<0) if fail
5541 * @retval PMINFO_R_OK success
5542 * @retval PMINFO_R_EINVAL invalid argument
5543 * @retval PMINFO_R_ERROR internal error
5544 * @pre pkgmgrinfo_create_certinfo_set_handle()
5545 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5546 * @see pkgmgrinfo_save_certinfo()
5548 static int set_cert_in_db(const char *pkgid)
5551 pkgmgrinfo_instcertinfo_h handle;
5552 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5553 if (ret != PMINFO_R_OK)
5555 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5556 if (ret != PMINFO_R_OK) {
5557 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5560 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5561 if (ret != PMINFO_R_OK) {
5562 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5565 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5570 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle);
5573 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5574 * @brief This API destroys the package cert information handle freeing up all the resources.
5576 * @par This API is for package-manager client application
5577 * @par Sync (or) Async : Synchronous API
5579 * @param[in] handle pointer to the package cert handle.
5580 * @return 0 if success, error code(<0) if fail
5581 * @retval PMINFO_R_OK success
5582 * @retval PMINFO_R_EINVAL invalid argument
5583 * @retval PMINFO_R_ERROR internal error
5584 * @pre pkgmgrinfo_create_certinfo_set_handle()
5586 * @see pkgmgrinfo_save_certinfo()
5588 static int set_cert_in_db(const char *pkgid)
5591 pkgmgrinfo_instcertinfo_h handle;
5592 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5593 if (ret != PMINFO_R_OK)
5595 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5596 if (ret != PMINFO_R_OK) {
5597 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5600 ret = pkgmgrinfo_save_pkgdbinfo(pkgid, handle);
5601 if (ret != PMINFO_R_OK) {
5602 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5605 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5610 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5613 * @fn int pkgmgrinfo_pkginfo_set_preload(const char *pkgid, int preload)
5614 * @brief This API sets the package 'preload' value in db
5616 * @par This API is for package-manager client application
5617 * @par Sync (or) Async : Synchronous API
5619 * @param[in] pkgid pointer to the package ID.
5620 * @param[in] preload package preload value
5621 * @return 0 if success, error code(<0) if fail
5622 * @retval PMINFO_R_OK success
5623 * @retval PMINFO_R_EINVAL invalid argument
5624 * @retval PMINFO_R_ERROR internal error
5626 int pkgmgrinfo_pkginfo_set_preload(const char *pkgid, int preload);
5629 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5630 * @brief This API sets the package 'installed_storage' value in db
5632 * @par This API is for package-manager client application
5633 * @par Sync (or) Async : Synchronous API
5635 * @param[in] pkgid pointer to the package ID.
5636 * @param[in] location package install location
5637 * @return 0 if success, error code(<0) if fail
5638 * @retval PMINFO_R_OK success
5639 * @retval PMINFO_R_EINVAL invalid argument
5640 * @retval PMINFO_R_ERROR internal error
5642 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5645 * @pkgmgrinfo client API
5649 * @brief listening status type in pkgmgrinfo.
5651 #define PMINFO_CLIENT_STATUS_ALL 0x00
5652 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5653 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5654 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5655 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5656 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5657 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5660 * @brief This APIs provides pkgmgrinfo client listener
5662 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5663 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5664 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5665 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5666 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5669 * @pkgmgrinfo client API end
5677 #endif /* __PKG_INFO_H__ */