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.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
94 /** Boolean property for filtering based on package info*/
95 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
107 /** Integer property for filtering based on package info*/
108 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
110 /** String property for filtering based on app info*/
111 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
112 /** String property for filtering based on app info*/
113 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
114 /** String property for filtering based on app info*/
115 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
135 /** Boolean property for filtering based on app info*/
136 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
137 /** Boolean property for filtering based on app info*/
138 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
139 /** Boolean property for filtering based on app info*/
140 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
141 /** Boolean property for filtering based on app info*/
142 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
143 /** Boolean property for filtering based on app info*/
144 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
145 /** Boolean property for filtering based on app info*/
146 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
147 /** Boolean property for filtering based on app info*/
148 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
150 /** will be updated*/
151 /** string property for filtering based on pkg info*/
152 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
154 /* For multiuser support */
155 const char *getIconPath(uid_t uid);
156 const char *getUserPkgParserDBPath(void);
157 const char *getUserPkgParserDBPathUID(uid_t uid);
158 const char *getUserPkgCertDBPath(void);
159 const char *getUserPkgCertDBPathUID(uid_t uid);
160 const char *getUserDesktopPath(uid_t uid);
161 const char *getUserManifestPath(uid_t uid);
164 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
165 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
166 * @brief This API gets list of installed packages
168 * @par This API is for package-manager client application
169 * @par Sync (or) Async : Synchronous API
170 * @param[in] pkg_list_cb iteration function for list
171 * @param[in] user_data user data to be passed to callback function
172 * @param[in] uid the addressee user id of the instruction
173 * @return 0 if success, error code(<0) if fail
174 * @retval PMINFO_R_OK success
175 * @retval PMINFO_R_EINVAL invalid argument
176 * @retval PMINFO_R_ERROR internal error
180 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
184 pkgid1 = (char *)user_data;
185 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
186 if (strcmp(pkgid1, pkgid2) == 0) {
193 static int list_pkgs()
196 char *name = "helloworld";
197 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
198 if (ret != PMINFO_R_OK) {
205 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
206 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
208 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
209 * @brief This API creates the package information handle from db
211 * @par This API is for package-manager client application
212 * @par Sync (or) Async : Synchronous API
214 * @param[in] pkgid pointer to package ID
215 * @param[in] uid the addressee user id of the instruction
216 * @param[out] handle pointer to the package info handle.
217 * @return 0 if success, error code(<0) if fail
218 * @retval PMINFO_R_OK success
219 * @retval PMINFO_R_EINVAL invalid argument
220 * @retval PMINFO_R_ERROR internal error
222 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
223 * @see pkgmgrinfo_pkginfo_get_pkgid()
224 * @see pkgmgrinfo_pkginfo_is_removable()
226 static int get_pkg_type(const char *pkgid)
230 pkgmgrinfo_pkginfo_h handle;
231 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
232 if (ret != PMINFO_R_OK)
234 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
235 if (ret != PMINFO_R_OK) {
236 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
239 printf("pkgtype: %s\n", type);
240 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
245 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
246 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
249 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
250 * @brief This API gets the package name from the package ID
252 * @par This API is for package-manager client application
253 * @par Sync (or) Async : Synchronous API
255 * @param[in] handle pointer to package info handle
256 * @param[out] pkg_name pointer to hold package name
257 * @return 0 if success, error code(<0) if fail
258 * @retval PMINFO_R_OK success
259 * @retval PMINFO_R_EINVAL invalid argument
260 * @retval PMINFO_R_ERROR internal error
261 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
262 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
263 * @see pkgmgrinfo_pkginfo_get_type()
264 * @see pkgmgrinfo_pkginfo_is_removable()
266 static int get_pkg_name(const char *pkgid)
269 char *pkgname = NULL;
270 pkgmgrinfo_pkginfo_h handle;
271 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
272 if (ret != PMINFO_R_OK)
274 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
275 if (ret != PMINFO_R_OK) {
276 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
279 printf("pkgname: %s\n", pkgname);
280 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
288 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
289 * @brief This API gets the package id from the package ID
291 * @par This API is for package-manager client application
292 * @par Sync (or) Async : Synchronous API
294 * @param[in] handle pointer to package info handle
295 * @param[out] pkgid pointer to hold package id
296 * @return 0 if success, error code(<0) if fail
297 * @retval PMINFO_R_OK success
298 * @retval PMINFO_R_EINVAL invalid argument
299 * @retval PMINFO_R_ERROR internal error
300 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
301 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
302 * @see pkgmgrinfo_pkginfo_get_type()
303 * @see pkgmgrinfo_pkginfo_is_removable()
305 static int get_pkgid(const char *pkgid)
309 pkgmgrinfo_pkginfo_h handle;
310 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
311 if (ret != PMINFO_R_OK)
313 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
314 if (ret != PMINFO_R_OK) {
315 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
318 printf("pkg id: %s\n", pkg_id);
319 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
324 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
327 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
328 * @brief This API gets the package type from the package ID
330 * @par This API is for package-manager client application
331 * @par Sync (or) Async : Synchronous API
333 * @param[in] handle pointer to package info handle
334 * @param[out] type pointer to hold package type
335 * @return 0 if success, error code(<0) if fail
336 * @retval PMINFO_R_OK success
337 * @retval PMINFO_R_EINVAL invalid argument
338 * @retval PMINFO_R_ERROR internal error
339 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
340 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
341 * @see pkgmgrinfo_pkginfo_get_pkgid()
342 * @see pkgmgrinfo_pkginfo_is_removable()
344 static int get_pkg_type(const char *pkgid)
348 pkgmgrinfo_pkginfo_h handle;
349 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
350 if (ret != PMINFO_R_OK)
352 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
353 if (ret != PMINFO_R_OK) {
354 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
357 printf("pkgtype: %s\n", type);
358 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
363 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
366 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
367 * @brief This API gets the package version from the package ID
369 * @par This API is for package-manager client application
370 * @par Sync (or) Async : Synchronous API
372 * @param[in] handle pointer to package info handle
373 * @param[out] version pointer to hold package version
374 * @return 0 if success, error code(<0) if fail
375 * @retval PMINFO_R_OK success
376 * @retval PMINFO_R_EINVAL invalid argument
377 * @retval PMINFO_R_ERROR internal error
378 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
379 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
380 * @see pkgmgrinfo_pkginfo_get_pkgid()
381 * @see pkgmgrinfo_pkginfo_is_removable()
383 static int get_pkg_version(const char *pkgid)
386 char *version = NULL;
387 pkgmgrinfo_pkginfo_h handle;
388 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
389 if (ret != PMINFO_R_OK)
391 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
392 if (ret != PMINFO_R_OK) {
393 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
396 printf("pkg version: %s\n", version);
397 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
402 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
405 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
406 * @brief This API gets the package install location from the package ID
408 * @par This API is for package-manager client application
409 * @par Sync (or) Async : Synchronous API
411 * @param[in] handle pointer to package info handle
412 * @param[out] location pointer to hold package install location
413 * @return 0 if success, error code(<0) if fail
414 * @retval PMINFO_R_OK success
415 * @retval PMINFO_R_EINVAL invalid argument
416 * @retval PMINFO_R_ERROR internal error
417 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
418 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
419 * @see pkgmgrinfo_pkginfo_get_pkgid()
420 * @see pkgmgrinfo_pkginfo_is_removable()
422 static int get_pkg_install_location(const char *pkgid)
425 pkgmgrinfo_install_location location;
426 pkgmgrinfo_pkginfo_h handle;
427 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
428 if (ret != PMINFO_R_OK)
430 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
431 if (ret != PMINFO_R_OK) {
432 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
435 printf("pkg install location: %d\n", location);
436 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
441 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
444 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
445 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
446 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
447 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
449 * @par This API is for package-manager client application
450 * @par Sync (or) Async : Synchronous API
452 * @param[in] handle pointer to package info handle
453 * @param[out] size pointer to hold package size
454 * @return 0 if success, error code(<0) if fail
455 * @retval PMINFO_R_OK success
456 * @retval PMINFO_R_EINVAL invalid argument
457 * @retval PMINFO_R_ERROR internal error
458 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
459 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
460 * @see pkgmgrinfo_pkginfo_get_pkgid()
461 * @see pkgmgrinfo_pkginfo_is_removable()
463 static int get_pkg_size(const char *pkgid)
467 pkgmgrinfo_pkginfo_h handle;
468 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
469 if (ret != PMINFO_R_OK)
471 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
472 if (ret != PMINFO_R_OK) {
473 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
476 printf("pkgsize: %d\n", size);
477 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
482 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
485 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
486 * @brief This API gets the installed package total size on the target.
488 * @par This API is for package-manager client application
489 * @par Sync (or) Async : Synchronous API
491 * @param[in] handle pointer to package info handle
492 * @param[out] size pointer to hold package total size
493 * @return 0 if success, error code(<0) if fail
494 * @retval PMINFO_R_OK success
495 * @retval PMINFO_R_EINVAL invalid argument
496 * @retval PMINFO_R_ERROR internal error
498 static int get_pkg_total_size(const char *pkgid)
502 pkgmgrinfo_pkginfo_h handle;
503 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
504 if (ret != PMINFO_R_OK)
506 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
507 if (ret != PMINFO_R_OK) {
508 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
511 printf("pkg total size: %d\n", size);
512 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
517 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
520 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
521 * @brief This API gets the installed package data size on the target.
523 * @par This API is for package-manager client application
524 * @par Sync (or) Async : Synchronous API
526 * @param[in] handle pointer to package info handle
527 * @param[out] size pointer to hold package data size
528 * @return 0 if success, error code(<0) if fail
529 * @retval PMINFO_R_OK success
530 * @retval PMINFO_R_EINVAL invalid argument
531 * @retval PMINFO_R_ERROR internal error
533 static int get_pkg_data_size(const char *pkgid)
537 pkgmgrinfo_pkginfo_h handle;
538 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
539 if (ret != PMINFO_R_OK)
541 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
542 if (ret != PMINFO_R_OK) {
543 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
546 printf("pkg data size: %d\n", size);
547 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
552 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
555 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
556 * @brief This API gets the package icon from the package ID
558 * @par This API is for package-manager client application
559 * @par Sync (or) Async : Synchronous API
561 * @param[in] handle pointer to package info handle
562 * @param[out] icon pointer to hold package icon
563 * @return 0 if success, error code(<0) if fail
564 * @retval PMINFO_R_OK success
565 * @retval PMINFO_R_EINVAL invalid argument
566 * @retval PMINFO_R_ERROR internal error
567 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
568 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
569 * @see pkgmgrinfo_pkginfo_get_pkgid()
570 * @see pkgmgrinfo_pkginfo_is_removable()
572 static int get_pkg_icon(const char *pkgid)
576 pkgmgrinfo_pkginfo_h handle;
577 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
578 if (ret != PMINFO_R_OK)
580 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
581 if (ret != PMINFO_R_OK) {
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
585 printf("pkg icon: %s\n", icon);
586 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
591 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
594 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
595 * @brief This API gets the package label from the package ID
597 * @par This API is for package-manager client application
598 * @par Sync (or) Async : Synchronous API
600 * @param[in] handle pointer to package info handle
601 * @param[out] label pointer to hold package label
602 * @return 0 if success, error code(<0) if fail
603 * @retval PMINFO_R_OK success
604 * @retval PMINFO_R_EINVAL invalid argument
605 * @retval PMINFO_R_ERROR internal error
606 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
607 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
608 * @see pkgmgrinfo_pkginfo_get_pkgid()
609 * @see pkgmgrinfo_pkginfo_is_removable()
611 static int get_pkg_label(const char *pkgid)
615 pkgmgrinfo_pkginfo_h handle;
616 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
617 if (ret != PMINFO_R_OK)
619 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
620 if (ret != PMINFO_R_OK) {
621 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
624 printf("pkg label: %s\n", label);
625 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
630 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
633 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
634 * @brief This API gets the package description from the package ID
636 * @par This API is for package-manager client application
637 * @par Sync (or) Async : Synchronous API
639 * @param[in] handle pointer to package info handle
640 * @param[out] description pointer to hold package description
641 * @return 0 if success, error code(<0) if fail
642 * @retval PMINFO_R_OK success
643 * @retval PMINFO_R_EINVAL invalid argument
644 * @retval PMINFO_R_ERROR internal error
645 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
646 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
647 * @see pkgmgrinfo_pkginfo_get_pkgid()
648 * @see pkgmgrinfo_pkginfo_is_removable()
650 static int get_pkg_description(const char *pkgid)
653 char *description = NULL;
654 pkgmgrinfo_pkginfo_h handle;
655 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
656 if (ret != PMINFO_R_OK)
658 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
659 if (ret != PMINFO_R_OK) {
660 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
663 printf("pkg description: %s\n", description);
664 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
669 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
672 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
673 * @brief This API gets the package's author name from the package ID
675 * @par This API is for package-manager client application
676 * @par Sync (or) Async : Synchronous API
678 * @param[in] handle pointer to package info handle
679 * @param[out] author_name pointer to hold package author name
680 * @return 0 if success, error code(<0) if fail
681 * @retval PMINFO_R_OK success
682 * @retval PMINFO_R_EINVAL invalid argument
683 * @retval PMINFO_R_ERROR internal error
684 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
685 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
686 * @see pkgmgrinfo_pkginfo_get_pkgid()
687 * @see pkgmgrinfo_pkginfo_is_removable()
689 static int get_pkg_author_name(const char *pkgid)
692 char *author_name = NULL;
693 pkgmgrinfo_pkginfo_h handle;
694 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
695 if (ret != PMINFO_R_OK)
697 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
698 if (ret != PMINFO_R_OK) {
699 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
702 printf("pkg author name: %s\n", author_name);
703 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
708 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
711 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
712 * @brief This API gets the package's author email from the package ID
714 * @par This API is for package-manager client application
715 * @par Sync (or) Async : Synchronous API
717 * @param[in] handle pointer to package info handle
718 * @param[out] author_email pointer to hold package author email
719 * @return 0 if success, error code(<0) if fail
720 * @retval PMINFO_R_OK success
721 * @retval PMINFO_R_EINVAL invalid argument
722 * @retval PMINFO_R_ERROR internal error
723 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
724 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
725 * @see pkgmgrinfo_pkginfo_get_pkgid()
726 * @see pkgmgrinfo_pkginfo_is_removable()
728 static int get_pkg_author_email(const char *pkgid)
731 char *author_email = NULL;
732 pkgmgrinfo_pkginfo_h handle;
733 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
734 if (ret != PMINFO_R_OK)
736 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
737 if (ret != PMINFO_R_OK) {
738 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
741 printf("pkg author email: %s\n", author_email);
742 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
747 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
750 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
751 * @brief This API gets the package's author href from the package ID
753 * @par This API is for package-manager client application
754 * @par Sync (or) Async : Synchronous API
756 * @param[in] handle pointer to package info handle
757 * @param[out] author_href pointer to hold package author href
758 * @return 0 if success, error code(<0) if fail
759 * @retval PMINFO_R_OK success
760 * @retval PMINFO_R_EINVAL invalid argument
761 * @retval PMINFO_R_ERROR internal error
762 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
763 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
764 * @see pkgmgrinfo_pkginfo_get_pkgid()
765 * @see pkgmgrinfo_pkginfo_is_removable()
767 static int get_pkg_author_href(const char *pkgid)
770 char *author_href = NULL;
771 pkgmgrinfo_pkginfo_h handle;
772 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
773 if (ret != PMINFO_R_OK)
775 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
776 if (ret != PMINFO_R_OK) {
777 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
780 printf("pkg author href: %s\n", author_href);
781 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
786 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
789 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
790 * @brief This API gets the package installed storagae value from the package ID
792 * @par This API is for package-manager client application
793 * @par Sync (or) Async : Synchronous API
795 * @param[in] handle pointer to package info handle
796 * @param[out] storage pointer to hold package installed storage
797 * @return 0 if success, error code(<0) if fail
798 * @retval PMINFO_R_OK success
799 * @retval PMINFO_R_EINVAL invalid argument
800 * @retval PMINFO_R_ERROR internal error
801 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
802 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
803 * @see pkgmgrinfo_pkginfo_get_pkgid()
804 * @see pkgmgrinfo_pkginfo_is_removable()
806 static int get_pkg_installed_storage(const char *pkgid)
809 pkgmgrinfo_installed_storage storage;
810 pkgmgrinfo_pkginfo_h handle;
811 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
812 if (ret != PMINFO_R_OK)
814 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
815 if (ret != PMINFO_R_OK) {
816 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
819 printf("pkg installed storage: %d\n", storage);
820 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
825 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
828 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
829 * @brief This API gets the installed time of package from the package ID
831 * @par This API is for package-manager client application
832 * @par Sync (or) Async : Synchronous API
834 * @param[in] handle pointer to package info handle
835 * @param[out] installed_time pointer to hold installed time of package
836 * @return 0 if success, error code(<0) if fail
837 * @retval PMINFO_R_OK success
838 * @retval PMINFO_R_EINVAL invalid argument
839 * @retval PMINFO_R_ERROR internal error
840 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
841 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
842 * @see pkgmgrinfo_pkginfo_get_pkgid()
843 * @see pkgmgrinfo_pkginfo_is_removable()
845 static int get_pkg_installed_time(const char *pkgid)
848 int installed_time = 0;
849 pkgmgrinfo_pkginfo_h handle;
850 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
851 if (ret != PMINFO_R_OK)
853 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
854 if (ret != PMINFO_R_OK) {
855 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
858 printf("installed_time: %d\n", installed_time);
859 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
864 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
867 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
868 * @brief This API gets the launch mode of package from the package ID
870 * @par This API is for package-manager client application
871 * @par Sync (or) Async : Synchronous API
873 * @param[in] handle pointer to package info handle
874 * @param[out] mode pointer to hold launch mode of package
875 * @return 0 if success, error code(<0) if fail
876 * @retval PMINFO_R_OK success
877 * @retval PMINFO_R_EINVAL invalid argument
878 * @retval PMINFO_R_ERROR internal error
879 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
880 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
881 * @see pkgmgrinfo_pkginfo_get_pkgid()
882 * @see pkgmgrinfo_pkginfo_is_removable()
884 static int get_pkg_launch_mode(const char *pkgid)
887 char *launch_mode = NULL;
888 pkgmgrinfo_pkginfo_h handle;
889 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
890 if (ret != PMINFO_R_OK)
892 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
893 if (ret != PMINFO_R_OK) {
894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
897 printf("launch mode: %s\n", mode);
898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
903 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
906 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
907 * @brief This API gets the store client id of package from the package ID
909 * @par This API is for package-manager client application
910 * @par Sync (or) Async : Synchronous API
912 * @param[in] handle pointer to package info handle
913 * @param[out] storeclientid pointer to hold store client id of package
914 * @return 0 if success, error code(<0) if fail
915 * @retval PMINFO_R_OK success
916 * @retval PMINFO_R_EINVAL invalid argument
917 * @retval PMINFO_R_ERROR internal error
918 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
919 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
920 * @see pkgmgrinfo_pkginfo_get_pkgid()
921 * @see pkgmgrinfo_pkginfo_is_removable()
923 static int get_pkg_storeclientid(const char *pkgid)
926 char *storeclientid = 0;
927 pkgmgrinfo_pkginfo_h handle;
928 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
929 if (ret != PMINFO_R_OK)
931 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
932 if (ret != PMINFO_R_OK) {
933 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
936 printf(store client id: %s\n", storeclientid);
937 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
942 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
945 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
946 * @brief This API gets the main app id of package from the package ID
948 * @par This API is for package-manager client application
949 * @par Sync (or) Async : Synchronous API
951 * @param[in] handle pointer to package info handle
952 * @param[out] mainappid pointer to hold main app id of package
953 * @return 0 if success, error code(<0) if fail
954 * @retval PMINFO_R_OK success
955 * @retval PMINFO_R_EINVAL invalid argument
956 * @retval PMINFO_R_ERROR internal error
957 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
958 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
959 * @see pkgmgrinfo_pkginfo_get_pkgid()
960 * @see pkgmgrinfo_pkginfo_is_removable()
962 static int get_pkg_mainappid(const char *pkgid)
966 pkgmgrinfo_pkginfo_h handle;
967 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
968 if (ret != PMINFO_R_OK)
970 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
971 if (ret != PMINFO_R_OK) {
972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
975 printf(main app id: %s\n", mainappid);
976 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
981 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
984 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
985 * @brief This API gets the url of package from the package ID
987 * @par This API is for package-manager client application
988 * @par Sync (or) Async : Synchronous API
990 * @param[in] handle pointer to package info handle
991 * @param[out] url pointer to hold url of package
992 * @return 0 if success, error code(<0) if fail
993 * @retval PMINFO_R_OK success
994 * @retval PMINFO_R_EINVAL invalid argument
995 * @retval PMINFO_R_ERROR internal error
996 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
997 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
998 * @see pkgmgrinfo_pkginfo_get_pkgid()
999 * @see pkgmgrinfo_pkginfo_is_removable()
1001 static int get_pkg_url(const char *pkgid)
1005 pkgmgrinfo_pkginfo_h handle;
1006 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1007 if (ret != PMINFO_R_OK)
1009 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1010 if (ret != PMINFO_R_OK) {
1011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1014 printf("url : %s\n", url);
1015 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1020 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1024 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1025 * @brief This API gets the root path of package
1027 * @par Sync (or) Async : Synchronous API
1029 * @param[in] handle pointer to package info handle
1030 * @param[out] path pointer to hold root path of package
1031 * @return 0 if success, error code(<0) if fail
1032 * @retval PMINFO_R_OK success
1033 * @retval PMINFO_R_EINVAL invalid argument
1034 * @retval PMINFO_R_ERROR internal error
1036 static int get_root_path(const char *pkgid)
1040 pkgmgrinfo_pkginfo_h handle;
1041 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1042 if (ret != PMINFO_R_OK)
1045 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1046 if (ret != PMINFO_R_OK) {
1047 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1050 printf("path : %s\n", path);
1051 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1057 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1061 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1062 * @brief This API gets the csc path of package
1064 * @par Sync (or) Async : Synchronous API
1066 * @param[in] handle pointer to package info handle
1067 * @param[out] path pointer to hold csc path of package
1068 * @return 0 if success, error code(<0) if fail
1069 * @retval PMINFO_R_OK success
1070 * @retval PMINFO_R_EINVAL invalid argument
1071 * @retval PMINFO_R_ERROR internal error
1073 static int get_csc_path(const char *pkgid)
1077 pkgmgrinfo_pkginfo_h handle;
1078 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1079 if (ret != PMINFO_R_OK)
1082 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1083 if (ret != PMINFO_R_OK) {
1084 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1087 printf("path : %s\n", path);
1088 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1094 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1097 * @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)
1098 * @brief This API compare the cert information from given package id
1100 * @par This API is for package-manager client application
1101 * @par Sync (or) Async : Synchronous API
1103 * @param[in] lhs_package_id pointer to first package ID
1104 * @param[in] rhs_package_id pointer to second package ID
1105 * @param[out] compare_result pointer to the compare result.
1106 * @return 0 if success, error code(<0) if fail
1107 * @retval PMINFO_R_OK success
1108 * @retval PMINFO_R_EINVAL invalid argument
1109 * @retval PMINFO_R_ERROR internal error
1111 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1112 * @see pkgmgrinfo_pkginfo_get_pkgid()
1113 * @see pkgmgrinfo_pkginfo_is_removable()
1115 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1118 pkgmgrinfo_cert_compare_result_type_e result;
1120 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1121 if (ret != PMINFO_R_OK) {
1124 printf("result: %d\n", result);
1129 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);
1130 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1132 * @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)
1133 * @brief This API compare the cert information from given app id
1135 * @par This API is for package-manager client application
1136 * @par Sync (or) Async : Synchronous API
1138 * @param[in] lhs_app_id pointer to first app ID
1139 * @param[in] rhs_app_id pointer to second app ID
1140 * @param[out] compare_result pointer to the compare result.
1141 * @return 0 if success, error code(<0) if fail
1142 * @retval PMINFO_R_OK success
1143 * @retval PMINFO_R_EINVAL invalid argument
1144 * @retval PMINFO_R_ERROR internal error
1146 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1147 * @see pkgmgrinfo_pkginfo_get_pkgid()
1148 * @see pkgmgrinfo_pkginfo_is_removable()
1150 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1153 pkgmgrinfo_cert_compare_result_type_e result;
1155 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1156 if (ret != PMINFO_R_OK) {
1159 printf("result: %d\n", result);
1164 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);
1165 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1167 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1168 * @brief This API gets the package 'removable' value from the package ID
1170 * @par This API is for package-manager client application
1171 * @par Sync (or) Async : Synchronous API
1173 * @param[in] handle pointer to package info handle
1174 * @param[out] removable pointer to hold package removable value
1175 * @return 0 if success, error code(<0) if fail
1176 * @retval PMINFO_R_OK success
1177 * @retval PMINFO_R_EINVAL invalid argument
1178 * @retval PMINFO_R_ERROR internal error
1179 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1180 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1181 * @see pkgmgrinfo_pkginfo_get_pkgid()
1182 * @see pkgmgrinfo_pkginfo_is_readonly()
1184 static int get_pkg_removable(const char *pkgid)
1188 pkgmgrinfo_pkginfo_h handle;
1189 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1190 if (ret != PMINFO_R_OK)
1192 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1193 if (ret != PMINFO_R_OK) {
1194 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1197 printf("pkg removable: %d\n", removable);
1198 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1203 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1206 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1207 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1209 * @par This API is for package-manager client application
1210 * @par Sync (or) Async : Synchronous API
1212 * @param[in] handle pointer to package info handle
1213 * @param[out] movable pointer to hold package movable state
1214 * @return 0 if success, error code(<0) if fail
1215 * @retval PMINFO_R_OK success
1216 * @retval PMINFO_R_EINVAL invalid argument
1217 * @retval PMINFO_R_ERROR internal error
1218 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1219 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1220 * @see pkgmgrinfo_pkginfo_get_pkgid()
1222 static int get_pkg_movable(const char *pkgid)
1226 pkgmgrinfo_pkginfo_h handle;
1227 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1228 if (ret != PMINFO_R_OK)
1230 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1231 if (ret != PMINFO_R_OK) {
1232 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1235 printf("pkg movable: %d\n", movable);
1236 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1241 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1244 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1245 * @brief This API gets the package 'preload' value from the package ID
1247 * @par This API is for package-manager client application
1248 * @par Sync (or) Async : Synchronous API
1250 * @param[in] handle pointer to package info handle
1251 * @param[out] preload pointer to hold package preload value
1252 * @return 0 if success, error code(<0) if fail
1253 * @retval PMINFO_R_OK success
1254 * @retval PMINFO_R_EINVAL invalid argument
1255 * @retval PMINFO_R_ERROR internal error
1256 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1257 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1258 * @see pkgmgrinfo_pkginfo_get_pkgid()
1259 * @see pkgmgrinfo_pkginfo_is_readonly()
1261 static int get_pkg_preload(const char *pkgid)
1265 pkgmgrinfo_pkginfo_h handle;
1266 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1267 if (ret != PMINFO_R_OK)
1269 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1270 if (ret != PMINFO_R_OK) {
1271 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1274 printf("pkg preload: %d\n", preload);
1275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1280 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1283 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1284 * @brief This API gets the value for given handle is system or not
1286 * @par This API is for package-manager client application
1287 * @par Sync (or) Async : Synchronous API
1289 * @param[in] handle pointer to package info handle
1290 * @param[out] system pointer to hold system is or not
1291 * @return 0 if success, error code(<0) if fail
1292 * @retval PMINFO_R_OK success
1293 * @retval PMINFO_R_EINVAL invalid argument
1294 * @retval PMINFO_R_ERROR internal error
1295 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1296 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1297 * @see pkgmgrinfo_pkginfo_get_pkgid()
1298 * @see pkgmgrinfo_pkginfo_is_readonly()
1300 static int get_pkg_system(const char *pkgid)
1303 bool system = false;
1304 pkgmgrinfo_pkginfo_h handle = NULL;
1305 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1306 if (ret != PMINFO_R_OK)
1308 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1309 if (ret != PMINFO_R_OK) {
1310 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1313 printf("pkg system: %d\n", system);
1314 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1319 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1322 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1323 * @brief This API gets the package 'readonly' value from the package ID
1325 * @par This API is for package-manager client application
1326 * @par Sync (or) Async : Synchronous API
1328 * @param[in] handle pointer to package info handle
1329 * @param[out] readonly pointer to hold package readonly value
1330 * @return 0 if success, error code(<0) if fail
1331 * @retval PMINFO_R_OK success
1332 * @retval PMINFO_R_EINVAL invalid argument
1333 * @retval PMINFO_R_ERROR internal error
1334 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1335 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1336 * @see pkgmgrinfo_pkginfo_get_pkgid()
1337 * @see pkgmgrinfo_pkginfo_is_removable()
1339 static int get_pkg_readonly(const char *pkgid)
1343 pkgmgrinfo_pkginfo_h handle;
1344 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1345 if (ret != PMINFO_R_OK)
1347 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1348 if (ret != PMINFO_R_OK) {
1349 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1352 printf("pkg readonly: %d\n", readonly);
1353 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1358 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1362 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1363 * @brief This API gets the package 'upate' value from the package ID
1365 * @par This API is for package-manager client application
1366 * @par Sync (or) Async : Synchronous API
1368 * @param[in] handle pointer to package info handle
1369 * @param[out] update pointer to hold package update value
1370 * @return 0 if success, error code(<0) if fail
1371 * @retval PMINFO_R_OK success
1372 * @retval PMINFO_R_EINVAL invalid argument
1373 * @retval PMINFO_R_ERROR internal error
1374 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1375 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1376 * @see pkgmgrinfo_pkginfo_get_pkgid()
1378 static int get_pkg_update(const char *pkgid)
1382 pkgmgrinfo_pkginfo_h handle;
1383 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1384 if (ret != PMINFO_R_OK)
1386 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1387 if (ret != PMINFO_R_OK) {
1388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1391 printf("pkg update: %d\n", update);
1392 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1397 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1401 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1402 * @brief This API gets the package 'uid' value from the view table of user database
1404 * @par This API is for package-manager client application
1405 * @par Sync (or) Async : Synchronous API
1407 * @param[in] uid uid of the user to determine the database
1408 * @param[in] pkgid id of the current package
1409 * @return 1 if it a global package, 0 else
1412 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1416 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1417 * @brief This API gets the package 'accessible' value from the package ID
1419 * @par This API is for package-manager client application
1420 * @par Sync (or) Async : Synchronous API
1422 * @param[in] handle pointer to package info handle
1423 * @param[out] accessible pointer to hold package accessible value
1424 * @return 0 if success, error code(<0) if fail
1425 * @retval PMINFO_R_OK success
1426 * @retval PMINFO_R_EINVAL invalid argument
1427 * @retval PMINFO_R_ERROR internal error
1428 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1429 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1430 * @see pkgmgrinfo_pkginfo_get_pkgid()
1431 * @see pkgmgrinfo_pkginfo_is_readonly()
1433 static int get_pkg_accessible(const char *pkgid)
1437 pkgmgrinfo_pkginfo_h handle;
1438 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1439 if (ret != PMINFO_R_OK)
1441 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1442 if (ret != PMINFO_R_OK) {
1443 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1446 printf("pkg accessible: %d\n", accessible);
1447 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1452 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1455 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1456 * @brief This API destroys the package information handle freeing up all the resources
1458 * @par This API is for package-manager client application
1459 * @par Sync (or) Async : Synchronous API
1461 * @param[in] handle pointer to the package info handle
1462 * @return 0 if success, error code(<0) if fail
1463 * @retval PMINFO_R_OK success
1464 * @retval PMINFO_R_EINVAL invalid argument
1465 * @retval PMINFO_R_ERROR internal error
1466 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1468 * @see pkgmgrinfo_pkginfo_get_pkgid()
1469 * @see pkgmgrinfo_pkginfo_is_removable()
1471 static int get_pkg_type(const char *pkgid)
1475 pkgmgrinfo_pkginfo_h handle;
1476 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1477 if (ret != PMINFO_R_OK)
1479 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1480 if (ret != PMINFO_R_OK) {
1481 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1484 printf("pkgtype: %s\n", type);
1485 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1490 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1493 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1494 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1495 The query will search the entire package information collected from the manifest file of all the installed packages
1497 * @par This API is for package-manager client application
1498 * @par Sync (or) Async : Synchronous API
1500 * @param[out] handle pointer to the package info filter handle.
1501 * @return 0 if success, error code(<0) if fail
1502 * @retval PMINFO_R_OK success
1503 * @retval PMINFO_R_EINVAL invalid argument
1504 * @retval PMINFO_R_ERROR internal error
1506 * @post pkgmgrinfo_pkginfo_filter_destroy()
1507 * @see pkgmgrinfo_pkginfo_filter_count()
1508 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1510 static int get_rpm_pkg_count()
1514 pkgmgrinfo_pkginfo_filter_h handle;
1515 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1516 if (ret != PMINFO_R_OK)
1518 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1519 if (ret != PMINFO_R_OK) {
1520 pkgmgrinfo_pkginfo_filter_destroy(handle);
1523 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1524 if (ret != PMINFO_R_OK) {
1525 pkgmgrinfo_pkginfo_filter_destroy(handle);
1528 printf("No of rpm pkgs: %d\n", count);
1529 pkgmgrinfo_pkginfo_filter_destroy(handle);
1534 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1537 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1538 * @brief This API destroys the package information filter handle freeing up all the resources
1540 * @par This API is for package-manager client application
1541 * @par Sync (or) Async : Synchronous API
1543 * @param[in] handle pointer to the package info filter handle.
1544 * @return 0 if success, error code(<0) if fail
1545 * @retval PMINFO_R_OK success
1546 * @retval PMINFO_R_EINVAL invalid argument
1547 * @retval PMINFO_R_ERROR internal error
1548 * @pre pkgmgrinfo_pkginfo_filter_create()
1550 * @see pkgmgrinfo_pkginfo_filter_count()
1551 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1553 static int get_rpm_pkg_count()
1557 pkgmgrinfo_pkginfo_filter_h handle;
1558 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1559 if (ret != PMINFO_R_OK)
1561 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1562 if (ret != PMINFO_R_OK) {
1563 pkgmgrinfo_pkginfo_filter_destroy(handle);
1566 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_filter_destroy(handle);
1571 printf("No of rpm pkgs: %d\n", count);
1572 pkgmgrinfo_pkginfo_filter_destroy(handle);
1577 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1580 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1581 * @brief This API adds a boolean filter property to the filter handle
1583 * @par This API is for package-manager client application
1584 * @par Sync (or) Async : Synchronous API
1586 * @param[in] handle pointer to the package info filter handle.
1587 * @param[in] property boolean property name.
1588 * @param[in] value value corresponding to the property.
1589 * @return 0 if success, error code(<0) if fail
1590 * @retval PMINFO_R_OK success
1591 * @retval PMINFO_R_EINVAL invalid argument
1592 * @retval PMINFO_R_ERROR internal error
1593 * @pre pkgmgrinfo_pkginfo_filter_create()
1594 * @post pkgmgrinfo_pkginfo_filter_destroy()
1595 * @see pkgmgrinfo_pkginfo_filter_count()
1596 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1598 static int get_preload_pkg_count()
1602 pkgmgrinfo_pkginfo_filter_h handle;
1603 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1604 if (ret != PMINFO_R_OK)
1606 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1607 if (ret != PMINFO_R_OK) {
1608 pkgmgrinfo_pkginfo_filter_destroy(handle);
1611 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1612 if (ret != PMINFO_R_OK) {
1613 pkgmgrinfo_pkginfo_filter_destroy(handle);
1616 printf("No of preload pkgs: %d\n", count);
1617 pkgmgrinfo_pkginfo_filter_destroy(handle);
1622 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1623 const char *property, const bool value);
1626 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1627 * @brief This API adds an integer filter property to the filter handle
1629 * @par This API is for package-manager client application
1630 * @par Sync (or) Async : Synchronous API
1632 * @param[in] handle pointer to the package info filter handle.
1633 * @param[in] property integer property name.
1634 * @param[in] value value corresponding to the property.
1635 * @return 0 if success, error code(<0) if fail
1636 * @retval PMINFO_R_OK success
1637 * @retval PMINFO_R_EINVAL invalid argument
1638 * @retval PMINFO_R_ERROR internal error
1639 * @pre pkgmgrinfo_pkginfo_filter_create()
1640 * @post pkgmgrinfo_pkginfo_filter_destroy()
1641 * @see pkgmgrinfo_pkginfo_filter_count()
1642 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1644 static int get_pkg_count()
1648 pkgmgrinfo_pkginfo_filter_h handle;
1649 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1650 if (ret != PMINFO_R_OK)
1652 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1653 if (ret != PMINFO_R_OK) {
1654 pkgmgrinfo_pkginfo_filter_destroy(handle);
1657 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1658 if (ret != PMINFO_R_OK) {
1659 pkgmgrinfo_pkginfo_filter_destroy(handle);
1662 printf("No of preload pkgs: %d\n", count);
1663 pkgmgrinfo_pkginfo_filter_destroy(handle);
1668 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1669 const char *property, const int value);
1672 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1673 * @brief This API adds a string filter property to the filter handle
1675 * @par This API is for package-manager client application
1676 * @par Sync (or) Async : Synchronous API
1678 * @param[in] handle pointer to the package info filter handle.
1679 * @param[in] property string property name.
1680 * @param[in] value value corresponding to the property.
1681 * @return 0 if success, error code(<0) if fail
1682 * @retval PMINFO_R_OK success
1683 * @retval PMINFO_R_EINVAL invalid argument
1684 * @retval PMINFO_R_ERROR internal error
1685 * @pre pkgmgrinfo_pkginfo_filter_create()
1686 * @post pkgmgrinfo_pkginfo_filter_destroy()
1687 * @see pkgmgrinfo_pkginfo_filter_count()
1688 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1690 static int get_rpm_pkg_count()
1694 pkgmgrinfo_pkginfo_filter_h handle;
1695 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1696 if (ret != PMINFO_R_OK)
1698 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1699 if (ret != PMINFO_R_OK) {
1700 pkgmgrinfo_pkginfo_filter_destroy(handle);
1703 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1704 if (ret != PMINFO_R_OK) {
1705 pkgmgrinfo_pkginfo_filter_destroy(handle);
1708 printf("No of rpm pkgs: %d\n", count);
1709 pkgmgrinfo_pkginfo_filter_destroy(handle);
1714 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1715 const char *property, const char *value);
1718 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1719 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1721 * @par This API is for package-manager client application
1722 * @par Sync (or) Async : Synchronous API
1724 * @param[in] handle pointer to the package info filter handle.
1725 * @param[in] pkg_cb callback function.
1726 * @param[in] user_data user data to be passed to the callback function
1727 * @return 0 if success, error code(<0) if fail
1728 * @retval PMINFO_R_OK success
1729 * @retval PMINFO_R_EINVAL invalid argument
1730 * @retval PMINFO_R_ERROR internal error
1731 * @pre pkgmgrinfo_pkginfo_filter_create()
1732 * @post pkgmgrinfo_pkginfo_filter_destroy()
1733 * @see pkgmgrinfo_pkginfo_filter_count()
1735 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1738 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1739 printf("pkg id : %s\n", pkgid);
1743 static int get_rpm_pkg_list()
1746 pkgmgrinfo_pkginfo_filter_h handle;
1747 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1748 if (ret != PMINFO_R_OK)
1750 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1751 if (ret != PMINFO_R_OK) {
1752 pkgmgrinfo_pkginfo_filter_destroy(handle);
1755 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1756 if (ret != PMINFO_R_OK) {
1757 pkgmgrinfo_pkginfo_filter_destroy(handle);
1760 pkgmgrinfo_pkginfo_filter_destroy(handle);
1765 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1766 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1767 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1768 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1771 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1772 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1773 * @brief This API counts the package that satisfy the filter conditions
1775 * @par This API is for package-manager client application
1776 * @par Sync (or) Async : Synchronous API
1778 * @param[in] handle pointer to the package info filter handle.
1779 * @param[in] count pointer to store the count value.
1780 * @param[in] uid the addressee user id of the instruction
1781 * @return 0 if success, error code(<0) if fail
1782 * @retval PMINFO_R_OK success
1783 * @retval PMINFO_R_EINVAL invalid argument
1784 * @retval PMINFO_R_ERROR internal error
1785 * @pre pkgmgrinfo_pkginfo_filter_create()
1786 * @post pkgmgrinfo_pkginfo_filter_destroy()
1787 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1789 static int get_rpm_pkg_count()
1793 pkgmgrinfo_pkginfo_filter_h handle;
1794 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1795 if (ret != PMINFO_R_OK)
1797 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1803 if (ret != PMINFO_R_OK) {
1804 pkgmgrinfo_pkginfo_filter_destroy(handle);
1807 printf("No of rpm pkgs: %d\n", count);
1808 pkgmgrinfo_pkginfo_filter_destroy(handle);
1813 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1814 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1816 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1817 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1818 * @brief This API gets the list of privilege for a particular package
1820 * @par This API is for package-manager client application
1821 * @par Sync (or) Async : Synchronous API
1822 * @param[in] handle pointer to the package info handle.
1823 * @param[in] privilege_func callback function for list
1824 * @param[in] user_data user data to be passed to callback function
1825 * @return 0 if success, error code(<0) if fail
1826 * @retval PMINFO_R_OK success
1827 * @retval PMINFO_R_EINVAL invalid argument
1828 * @retval PMINFO_R_ERROR internal error
1829 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1830 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1832 int privilege_func(const char *name, void *user_data)
1834 if (strcmp(name, (char *)user_data) == 0)
1840 static int list_privilege(const char *package, char *privilege)
1843 pkgmgrinfo_pkginfo_h handle;
1844 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1845 if (ret != PMINFO_R_OK)
1847 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1848 if (ret != PMINFO_R_OK) {
1849 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1852 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1857 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1858 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1860 /* TODO: add doxygen comment here */
1861 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1862 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1863 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1864 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1865 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1866 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1867 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1870 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1871 pkgmgrinfo_app_list_cb app_func, void *user_data)
1872 * @brief This API gets list of installed applications for a particular package
1874 * @par This API is for package-manager client application
1875 * @par Sync (or) Async : Synchronous API
1876 * @param[in] handle package info handle
1877 * @param[in] component application component
1878 * @param[in] app_func iteration function for list
1879 * @param[in] user_data user data to be passed to callback function
1880 * @return 0 if success, error code(<0) if fail
1881 * @retval PMINFO_R_OK success
1882 * @retval PMINFO_R_EINVAL invalid argument
1883 * @retval PMINFO_R_ERROR internal error
1884 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1885 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1887 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1890 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1891 printf("appid : %s\n", appid);
1895 static int list_apps(const char *pkgid)
1898 pkgmgrinfo_pkginfo_h handle;
1899 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1900 if (ret != PMINFO_R_OK)
1902 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1903 if (ret != PMINFO_R_OK) {
1904 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1907 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1912 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1913 pkgmgrinfo_app_list_cb app_func, void *user_data);
1914 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1915 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
1917 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1918 * @brief This API gets list of installed applications from all packages with minimum informaion.
1920 * @par This API is for package-manager client application
1921 * @par Sync (or) Async : Synchronous API
1922 * @param[in] app_func iteration function for list
1923 * @param[in] user_data user data to be passed to callback function
1924 * @return 0 if success, error code(<0) if fail
1925 * @retval PMINFO_R_OK success
1926 * @retval PMINFO_R_EINVAL invalid argument
1927 * @retval PMINFO_R_ERROR internal error
1931 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1933 char *pkgid1 = NULL;
1934 char *pkgid2 = NULL;
1935 pkgid1 = (char *)user_data;
1936 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1937 if (strcmp(pkgid1, pkgid2) == 0) {
1944 static int list_apps()
1947 char *name = "helloworld";
1948 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
1949 if (ret != PMINFO_R_OK) {
1956 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1957 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
1959 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1960 * @brief This API gets list of installed applications from all packages.
1962 * @par This API is for package-manager client application
1963 * @par Sync (or) Async : Synchronous API
1964 * @param[in] app_func iteration function for list
1965 * @param[in] user_data user data to be passed to callback function
1966 * @return 0 if success, error code(<0) if fail
1967 * @retval PMINFO_R_OK success
1968 * @retval PMINFO_R_EINVAL invalid argument
1969 * @retval PMINFO_R_ERROR internal error
1973 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1975 char *pkgid1 = NULL;
1976 char *pkgid2 = NULL;
1977 pkgid1 = (char *)user_data;
1978 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1979 if (strcmp(pkgid1, pkgid2) == 0) {
1986 static int list_apps()
1989 char *name = "helloworld";
1990 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1991 if (ret != PMINFO_R_OK) {
1998 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1999 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2002 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2003 * @brief This API creates the application information handle from db
2005 * @par This API is for package-manager client application
2006 * @par Sync (or) Async : Synchronous API
2008 * @param[in] appid pointer to appid
2009 * @param[out] handle pointer to the application info handle.
2010 * @return 0 if success, error code(<0) if fail
2011 * @retval PMINFO_R_OK success
2012 * @retval PMINFO_R_EINVAL invalid argument
2013 * @retval PMINFO_R_ERROR internal error
2015 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2016 * @see pkgmgrinfo_appinfo_get_pkgid()
2017 * @see pkgmgrinfo_appinfo_is_multiple()
2019 static int get_app_type(const char *appid)
2023 pkgmgrinfo_appinfo_h handle;
2024 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2025 if (ret != PMINFO_R_OK)
2027 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2028 if (ret != PMINFO_R_OK) {
2029 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2032 printf("apptype: %s\n", type);
2033 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2038 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2039 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2041 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2042 * @brief This API gets the application ID
2044 * @par This API is for package-manager client application
2045 * @par Sync (or) Async : Synchronous API
2047 * @param[in] handle pointer to the application info handle.
2048 * @param[out] appid pointer to hold appid
2049 * @return 0 if success, error code(<0) if fail
2050 * @retval PMINFO_R_OK success
2051 * @retval PMINFO_R_EINVAL invalid argument
2052 * @retval PMINFO_R_ERROR internal error
2053 * @pre pkgmgrinfo_appinfo_get_appinfo()
2054 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2055 * @see pkgmgrinfo_appinfo_get_pkgid()
2056 * @see pkgmgrinfo_appinfo_is_multiple()
2058 static int get_app_id(const char *appid)
2061 char *app_id = NULL;
2062 pkgmgrinfo_appinfo_h handle;
2063 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2064 if (ret != PMINFO_R_OK)
2066 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2067 if (ret != PMINFO_R_OK) {
2068 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2071 printf("app id: %s\n", app_id);
2072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2077 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2080 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2081 * @brief This API gets the package name of the application
2083 * @par This API is for package-manager client application
2084 * @par Sync (or) Async : Synchronous API
2086 * @param[in] handle pointer to the application info handle.
2087 * @param[out] pkg_name pointer to hold package name
2088 * @return 0 if success, error code(<0) if fail
2089 * @retval PMINFO_R_OK success
2090 * @retval PMINFO_R_EINVAL invalid argument
2091 * @retval PMINFO_R_ERROR internal error
2092 * @pre pkgmgrinfo_appinfo_get_appinfo()
2093 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2094 * @see pkgmgrinfo_appinfo_get_appid()
2095 * @see pkgmgrinfo_appinfo_is_multiple()
2097 static int get_app_pkgname(const char *appid)
2100 char *pkgname = NULL;
2101 pkgmgrinfo_appinfo_h handle;
2102 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2103 if (ret != PMINFO_R_OK)
2105 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2106 if (ret != PMINFO_R_OK) {
2107 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2110 printf("pkg name: %s\n", pkgname);
2111 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2116 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2119 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2120 * @brief This API gets the package id of the application
2122 * @par This API is for package-manager client application
2123 * @par Sync (or) Async : Synchronous API
2125 * @param[in] handle pointer to the application info handle.
2126 * @param[out] pkgid pointer to hold package id
2127 * @return 0 if success, error code(<0) if fail
2128 * @retval PMINFO_R_OK success
2129 * @retval PMINFO_R_EINVAL invalid argument
2130 * @retval PMINFO_R_ERROR internal error
2131 * @pre pkgmgrinfo_appinfo_get_appinfo()
2132 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2133 * @see pkgmgrinfo_appinfo_get_appid()
2134 * @see pkgmgrinfo_appinfo_is_multiple()
2136 static int get_app_pkgid(const char *appid)
2140 pkgmgrinfo_appinfo_h handle;
2141 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2142 if (ret != PMINFO_R_OK)
2144 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2145 if (ret != PMINFO_R_OK) {
2146 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2149 printf("pkg id: %s\n", pkgid);
2150 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2155 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2158 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2159 * @brief This API gets the executable name of the application
2161 * @par This API is for package-manager client application
2162 * @par Sync (or) Async : Synchronous API
2164 * @param[in] handle pointer to the application info handle.
2165 * @param[out] exec pointer to hold app exec name
2166 * @return 0 if success, error code(<0) if fail
2167 * @retval PMINFO_R_OK success
2168 * @retval PMINFO_R_EINVAL invalid argument
2169 * @retval PMINFO_R_ERROR internal error
2170 * @pre pkgmgrinfo_appinfo_get_appinfo()
2171 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2172 * @see pkgmgrinfo_appinfo_get_appid()
2173 * @see pkgmgrinfo_appinfo_is_multiple()
2175 static int get_app_exec(const char *appid)
2179 pkgmgrinfo_appinfo_h handle;
2180 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2181 if (ret != PMINFO_R_OK)
2183 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2184 if (ret != PMINFO_R_OK) {
2185 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2188 printf("exec name: %s\n", exec);
2189 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2194 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2197 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2198 * @brief This API gets the icon name of the application
2200 * @par This API is for package-manager client application
2201 * @par Sync (or) Async : Synchronous API
2203 * @param[in] handle pointer to the application info handle.
2204 * @param[out] icon pointer to hold app icon name
2205 * @return 0 if success, error code(<0) if fail
2206 * @retval PMINFO_R_OK success
2207 * @retval PMINFO_R_EINVAL invalid argument
2208 * @retval PMINFO_R_ERROR internal error
2209 * @pre pkgmgrinfo_appinfo_get_appinfo()
2210 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2211 * @see pkgmgrinfo_appinfo_get_appid()
2212 * @see pkgmgrinfo_appinfo_is_multiple()
2214 static int get_app_icon(const char *appid)
2218 pkgmgrinfo_appinfo_h handle;
2219 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2220 if (ret != PMINFO_R_OK)
2222 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2223 if (ret != PMINFO_R_OK) {
2224 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2227 printf("icon name: %s\n", icon);
2228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2233 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2236 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2237 * @brief This API gets the label of the application
2239 * @par This API is for package-manager client application
2240 * @par Sync (or) Async : Synchronous API
2242 * @param[in] handle pointer to the application info handle.
2243 * @param[out] label pointer to hold app label
2244 * @return 0 if success, error code(<0) if fail
2245 * @retval PMINFO_R_OK success
2246 * @retval PMINFO_R_EINVAL invalid argument
2247 * @retval PMINFO_R_ERROR internal error
2248 * @pre pkgmgrinfo_appinfo_get_appinfo()
2249 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2250 * @see pkgmgrinfo_appinfo_get_appid()
2251 * @see pkgmgrinfo_appinfo_is_multiple()
2253 static int get_app_label(const char *appid)
2257 pkgmgrinfo_appinfo_h handle;
2258 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2259 if (ret != PMINFO_R_OK)
2261 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2262 if (ret != PMINFO_R_OK) {
2263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2266 printf("label : %s\n", label);
2267 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2272 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2275 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2276 * @brief This API gets exactly matched label by given appid and locale
2278 * @par This API is for package-manager client application
2279 * @par Sync (or) Async : Synchronous API
2281 * @param[in] appid pointer to appid
2282 * @param[in] locale pointer to locale
2283 * @param[out] label pointer to hold app label
2284 * @return 0 if success, error code(<0) if fail
2285 * @retval PMINFO_R_OK success
2286 * @retval PMINFO_R_EINVAL invalid argument
2287 * @retval PMINFO_R_ERROR internal error
2289 static int get_localed_label(const char *appid, const char *locale)
2294 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2295 if (ret != PMINFO_R_OK)
2298 printf("localed label: %s\n", label);
2306 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2307 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2310 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2311 * @brief This API gets the component of the application
2313 * @par This API is for package-manager client application
2314 * @par Sync (or) Async : Synchronous API
2316 * @param[in] handle pointer to the application info handle.
2317 * @param[out] component pointer to hold app component
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
2322 * @pre pkgmgrinfo_appinfo_get_appinfo()
2323 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2324 * @see pkgmgrinfo_appinfo_get_appid()
2325 * @see pkgmgrinfo_appinfo_is_multiple()
2327 static int get_app_component(const char *appid)
2330 pkgmgrinfo_app_component component;
2331 pkgmgrinfo_appinfo_h handle;
2332 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2333 if (ret != PMINFO_R_OK)
2335 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2336 if (ret != PMINFO_R_OK) {
2337 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2340 printf("component : %s\n", component);
2341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2346 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2349 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2350 * @brief This API gets the apptype of the application
2352 * @par This API is for package-manager client application
2353 * @par Sync (or) Async : Synchronous API
2355 * @param[in] handle pointer to the application info handle.
2356 * @param[out] app_type pointer to hold apptype
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
2361 * @pre pkgmgrinfo_appinfo_get_appinfo()
2362 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2363 * @see pkgmgrinfo_appinfo_get_appid()
2364 * @see pkgmgrinfo_appinfo_is_multiple()
2366 static int get_app_type(const char *appid)
2369 char *apptype = NULL;
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, &apptype);
2375 if (ret != PMINFO_R_OK) {
2376 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2379 printf("apptype : %s\n", apptype);
2380 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2385 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2388 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2389 int *operation_count, char ***operation)
2390 * @brief This API gets the list of operation of the application
2392 * @par This API is for package-manager client application
2393 * @par Sync (or) Async : Synchronous API
2395 * @param[in] handle pointer to the appcontrol handle.
2396 * @param[out] operation_count pointer to hold number of operations
2397 * @param[out] operation pointer to hold list of operations
2398 * @return 0 if success, error code(<0) if fail
2399 * @retval PMINFO_R_OK success
2400 * @retval PMINFO_R_EINVAL invalid argument
2401 * @retval PMINFO_R_ERROR internal error
2402 * @pre pkgmgrinfo_appinfo_get_appinfo()
2403 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2404 * @see pkgmgrinfo_appinfo_get_uri()
2405 * @see pkgmgrinfo_appinfo_get_mime()
2407 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2412 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2413 for (i = 0; i < oc; i++) {
2414 if (strcmp(operation[i], (char *)user_data) == 0)
2421 static int check_operation(const char *appid, char *operation)
2424 pkgmgrinfo_appinfo_h handle;
2425 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2426 if (ret != PMINFO_R_OK)
2428 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2429 if (ret != PMINFO_R_OK) {
2430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2438 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2439 int *operation_count, char ***operation);
2442 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2443 int *uri_count, char ***uri)
2444 * @brief This API gets the list of uri of the application
2446 * @par This API is for package-manager client application
2447 * @par Sync (or) Async : Synchronous API
2449 * @param[in] handle pointer to the appcontrol handle.
2450 * @param[out] uri_count pointer to hold number of uris
2451 * @param[out] uri pointer to hold list of uris
2452 * @return 0 if success, error code(<0) if fail
2453 * @retval PMINFO_R_OK success
2454 * @retval PMINFO_R_EINVAL invalid argument
2455 * @retval PMINFO_R_ERROR internal error
2456 * @pre pkgmgrinfo_appinfo_get_appinfo()
2457 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2458 * @see pkgmgrinfo_appinfo_get_operation()
2459 * @see pkgmgrinfo_appinfo_get_mime()
2461 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2466 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2467 for (i = 0; i < uc; i++) {
2468 if (strcmp(uri[i], (char *)user_data) == 0)
2475 static int check_uri(const char *appid, char *uri)
2478 pkgmgrinfo_appinfo_h handle;
2479 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2480 if (ret != PMINFO_R_OK)
2482 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2483 if (ret != PMINFO_R_OK) {
2484 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2492 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2493 int *uri_count, char ***uri);
2496 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2497 int *mime_count, char ***mime)
2498 * @brief This API gets the list of mime of the application
2500 * @par This API is for package-manager client application
2501 * @par Sync (or) Async : Synchronous API
2503 * @param[in] handle pointer to the appcontrol handle.
2504 * @param[out] mime_count pointer to hold number of mimes
2505 * @param[out] mime pointer to hold list of mimes
2506 * @return 0 if success, error code(<0) if fail
2507 * @retval PMINFO_R_OK success
2508 * @retval PMINFO_R_EINVAL invalid argument
2509 * @retval PMINFO_R_ERROR internal error
2510 * @pre pkgmgrinfo_appinfo_get_appinfo()
2511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2512 * @see pkgmgrinfo_appinfo_get_uri()
2513 * @see pkgmgrinfo_appinfo_get_operation()
2515 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2520 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2521 for (i = 0; i < mc; i++) {
2522 if (strcmp(mime[i], (char *)user_data) == 0)
2529 static int check_mime(const char *appid, char *mime)
2532 pkgmgrinfo_appinfo_h handle;
2533 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2534 if (ret != PMINFO_R_OK)
2536 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2537 if (ret != PMINFO_R_OK) {
2538 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2541 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2546 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2547 int *mime_count, char ***mime);
2550 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2551 int *subapp_count, char ***subapp)
2552 * @brief This API gets the list of subapp of the application
2554 * @par This API is for package-manager client application
2555 * @par Sync (or) Async : Synchronous API
2557 * @param[in] handle pointer to the appcontrol handle.
2558 * @param[out] subapp_count pointer to hold number of subapp
2559 * @param[out] subapp pointer to hold list of subapp
2560 * @return 0 if success, error code(<0) if fail
2561 * @retval PMINFO_R_OK success
2562 * @retval PMINFO_R_EINVAL invalid argument
2563 * @retval PMINFO_R_ERROR internal error
2564 * @pre pkgmgrinfo_appinfo_get_appinfo()
2565 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2566 * @see pkgmgrinfo_appinfo_get_uri()
2567 * @see pkgmgrinfo_appinfo_get_operation()
2569 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2573 char **subapp = NULL;
2574 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2575 for (i = 0; i < sc; i++) {
2576 if (strcmp(subapp[i], (char *)user_data) == 0)
2583 static int check_subapp(const char *appid, char *subapp)
2586 pkgmgrinfo_appinfo_h handle = NULL;
2587 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2588 if (ret != PMINFO_R_OK)
2590 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2591 if (ret != PMINFO_R_OK) {
2592 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2595 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2600 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2601 int *subapp_count, char ***subapp);
2604 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2605 * @brief This API gets the notification icon of the application
2607 * @par This API is for package-manager client application
2608 * @par Sync (or) Async : Synchronous API
2610 * @param[in] handle pointer to the application info handle.
2611 * @param[out] path pointer to hold notification icon
2612 * @return 0 if success, error code(<0) if fail
2613 * @retval PMINFO_R_OK success
2614 * @retval PMINFO_R_EINVAL invalid argument
2615 * @retval PMINFO_R_ERROR internal error
2616 * @pre pkgmgrinfo_appinfo_get_appinfo()
2617 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2618 * @see pkgmgrinfo_appinfo_get_appid()
2619 * @see pkgmgrinfo_appinfo_is_multiple()
2621 static int get_app_notification_icon(const char *appid)
2624 char *notification_icon = NULL;
2625 pkgmgrinfo_appinfo_h handle;
2626 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2627 if (ret != PMINFO_R_OK)
2629 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2630 if (ret != PMINFO_R_OK) {
2631 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2634 printf("notification icon : %s\n", notification_icon);
2635 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2640 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2643 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2644 * @brief This API gets the setting icon of the application
2646 * @par This API is for package-manager client application
2647 * @par Sync (or) Async : Synchronous API
2649 * @param[in] handle pointer to the application info handle.
2650 * @param[out] path pointer to hold setting icon
2651 * @return 0 if success, error code(<0) if fail
2652 * @retval PMINFO_R_OK success
2653 * @retval PMINFO_R_EINVAL invalid argument
2654 * @retval PMINFO_R_ERROR internal error
2655 * @pre pkgmgrinfo_appinfo_get_appinfo()
2656 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2657 * @see pkgmgrinfo_appinfo_get_appid()
2658 * @see pkgmgrinfo_appinfo_is_multiple()
2660 static int get_app_setting_icon(const char *appid)
2663 char *setting_icon = NULL;
2664 pkgmgrinfo_appinfo_h handle;
2665 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2666 if (ret != PMINFO_R_OK)
2668 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2669 if (ret != PMINFO_R_OK) {
2670 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2673 printf("setting icon : %s\n", setting_icon);
2674 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2679 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2682 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2683 * @brief This API gets the type of recent image on app-tray
2685 * @par This API is for package-manager client application
2686 * @par Sync (or) Async : Synchronous API
2688 * @param[in] handle pointer to the application info handle.
2689 * @param[out] type pointer to hold image type
2690 * @return 0 if success, error code(<0) if fail
2691 * @retval PMINFO_R_OK success
2692 * @retval PMINFO_R_EINVAL invalid argument
2693 * @retval PMINFO_R_ERROR internal error
2694 * @pre pkgmgrinfo_appinfo_get_appinfo()
2695 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2696 * @see pkgmgrinfo_appinfo_get_appid()
2697 * @see pkgmgrinfo_appinfo_is_multiple()
2699 static int get_app_recent_image_type(const char *appid)
2702 pkgmgrinfo_app_recentimage type;
2703 pkgmgrinfo_appinfo_h handle;
2704 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2705 if (ret != PMINFO_R_OK)
2707 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2708 if (ret != PMINFO_R_OK) {
2709 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2712 printf("recent image type: %d\n", type);
2713 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2718 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2722 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2723 * @brief This API gets the preview image of application
2725 * @par Sync (or) Async : Synchronous API
2727 * @param[in] handle pointer to the application info handle.
2728 * @param[out] preview_img pointer to hold preview image path
2729 * @return 0 if success, error code(<0) if fail
2730 * @retval PMINFO_R_OK success
2731 * @retval PMINFO_R_EINVAL invalid argument
2732 * @retval PMINFO_R_ERROR internal error
2733 * @pre pkgmgrinfo_appinfo_get_appinfo()
2734 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2735 * @see pkgmgrinfo_appinfo_get_appid()
2737 static int get_app_previewimage(const char *appid)
2740 char *preview = NULL;
2741 pkgmgrinfo_appinfo_h handle = NULL;
2742 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2743 if (ret != PMINFO_R_OK)
2745 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2746 if (ret != PMINFO_R_OK) {
2747 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2750 printf("preview image path : %s\n", preview);
2751 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2756 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2760 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2761 * @brief This API gets the package permission type of the application
2763 * @par This API is for package-manager client application
2764 * @par Sync (or) Async : Synchronous API
2766 * @param[in] handle pointer to the application info handle.
2767 * @param[out] permission pointer to hold package permission
2768 * @return 0 if success, error code(<0) if fail
2769 * @retval PMINFO_R_OK success
2770 * @retval PMINFO_R_EINVAL invalid argument
2771 * @retval PMINFO_R_ERROR internal error
2772 * @pre pkgmgrinfo_appinfo_get_appinfo()
2773 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2774 * @see pkgmgrinfo_appinfo_get_appid()
2776 static int get_app_permission(const char *appid)
2779 pkgmgrinfo_permission_type permission = 0;
2780 pkgmgrinfo_appinfo_h handle;
2782 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2783 if (ret != PMINFO_R_OK)
2785 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2786 if (ret != PMINFO_R_OK) {
2787 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2790 printf("permission type: %d\n", permission);
2791 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2796 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2799 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2800 * @brief This API gets the component_type
2802 * @par This API is for package-manager client application
2803 * @par Sync (or) Async : Synchronous API
2805 * @param[in] handle pointer to the application info handle.
2806 * @param[out] component_type pointer to hold component_type
2807 * @return 0 if success, error code(<0) if fail
2808 * @retval PMINFO_R_OK success
2809 * @retval PMINFO_R_EINVAL invalid argument
2810 * @retval PMINFO_R_ERROR internal error
2811 * @pre pkgmgrinfo_appinfo_get_appinfo()
2812 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2813 * @see pkgmgrinfo_appinfo_get_pkgid()
2814 * @see pkgmgrinfo_appinfo_is_multiple()
2816 static int get_component_type(const char *appid)
2819 char *component_type = NULL;
2820 pkgmgrinfo_appinfo_h handle;
2821 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2822 if (ret != PMINFO_R_OK)
2824 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2825 if (ret != PMINFO_R_OK) {
2826 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2829 printf("component_type: %s\n", component_type);
2830 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2835 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2838 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2839 * @brief This API gets the application 'hwacceleration' value from the app ID
2841 * @par This API is for package-manager client application
2842 * @par Sync (or) Async : Synchronous API
2844 * @param[in] handle pointer to application info handle
2845 * @param[out] hwacceleration pointer to hold package hwacceleration value
2846 * @return 0 if success, error code(<0) if fail
2847 * @retval PMINFO_R_OK success
2848 * @retval PMINFO_R_EINVAL invalid argument
2849 * @retval PMINFO_R_ERROR internal error
2850 * @pre pkgmgrinfo_appinfo_get_appinfo()
2851 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2852 * @see pkgmgrinfo_appinfo_get_appid()
2853 * @see pkgmgrinfo_appinfo_is_multiple()
2855 static int get_app_hwacceleration(const char *appid)
2858 pkgmgrinfo_app_hwacceleration hwacceleration;
2859 pkgmgrinfo_appinfo_h handle;
2860 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2861 if (ret != PMINFO_R_OK)
2863 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2864 if (ret != PMINFO_R_OK) {
2865 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2868 printf("app hwacceleration: %d\n", hwacceleration);
2869 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2874 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2877 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
2878 * @brief This API gets the application 'screenreader' value from the app ID
2880 * @par This API is for package-manager client application
2881 * @par Sync (or) Async : Synchronous API
2883 * @param[in] handle pointer to application info handle
2884 * @param[out] screenreader pointer to hold package accessibility value
2885 * @return 0 if success, error code(<0) if fail
2886 * @retval PMINFO_R_OK success
2887 * @retval PMINFO_R_EINVAL invalid argument
2888 * @retval PMINFO_R_ERROR internal error
2889 * @pre pkgmgrinfo_appinfo_get_appinfo()
2890 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2891 * @see pkgmgrinfo_appinfo_get_appid()
2892 * @see pkgmgrinfo_appinfo_is_multiple()
2894 static int get_app_screenreader(const char *appid)
2897 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
2898 pkgmgrinfo_appinfo_h handle = NULL;
2899 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2900 if (ret != PMINFO_R_OK)
2902 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
2903 if (ret != PMINFO_R_OK) {
2904 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2907 printf("app screenreader: %d\n", screenreader);
2908 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2913 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
2916 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2917 * @brief This API gets the application's landscape & portrait effect images
2919 * @par This API is for package-manager client application
2920 * @par Sync (or) Async : Synchronous API
2922 * @param[in] handle pointer to application info handle
2923 * @param[out] portrait_img contains portrait mode effect image
2924 * @param[out] landscape_img contains landscape mode effect image
2925 * @return 0 if success, error code(<0) if fail
2926 * @retval PMINFO_R_OK success
2927 * @retval PMINFO_R_EINVAL invalid argument
2928 * @retval PMINFO_R_ERROR internal error
2929 * @pre pkgmgrinfo_appinfo_get_appinfo()
2930 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2931 * @see pkgmgrinfo_appinfo_get_appid()
2932 * @see pkgmgrinfo_appinfo_is_nodisplay()
2934 static int get_app_effectimages(const char *appid)
2937 char *portraitimg = NULL;
2938 char *landscapeimg = NULL;
2939 pkgmgrinfo_appinfo_h handle;
2940 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2941 if (ret != PMINFO_R_OK)
2943 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2944 if (ret != PMINFO_R_OK) {
2945 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2948 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2949 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2954 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
2957 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
2958 * @brief This API gets the submode_mainid of the application
2960 * @par This API is for package-manager client application
2961 * @par Sync (or) Async : Synchronous API
2963 * @param[in] handle pointer to the application info handle.
2964 * @param[out] submode_mainid pointer to hold package name
2965 * @return 0 if success, error code(<0) if fail
2966 * @retval PMINFO_R_OK success
2967 * @retval PMINFO_R_EINVAL invalid argument
2968 * @retval PMINFO_R_ERROR internal error
2969 * @pre pkgmgrinfo_appinfo_get_appinfo()
2970 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2971 * @see pkgmgrinfo_appinfo_get_appid()
2972 * @see pkgmgrinfo_appinfo_is_multiple()
2974 static int get_app_submode_mainid(const char *appid)
2977 char *submode_mainid = NULL;
2978 pkgmgrinfo_appinfo_h handle = NULL;
2979 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2980 if (ret != PMINFO_R_OK)
2982 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
2983 if (ret != PMINFO_R_OK) {
2984 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2987 printf("submode_mainid: %s\n", submode_mainid);
2988 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2993 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
2996 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
2997 * @brief This API gets the datacontrol info
2999 * @par This API is for package-manager client application
3000 * @par Sync (or) Async : Synchronous API
3002 * @param[in] providerid pointer to the providerid of dataconltrol.
3003 * @param[in] type pointer to the type of dataconltrol.
3004 * @param[out] appid pointer to hold appid, need to free after using
3005 * @param[out] access pointer to hold access, need to free after using
3006 * @return 0 if success, error code(<0) if fail
3007 * @retval PMINFO_R_OK success
3008 * @retval PMINFO_R_EINVAL invalid argument
3009 * @retval PMINFO_R_ERROR internal error
3012 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3013 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3016 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3017 * @brief This API gets the appid of datacontrol
3019 * @par This API is for package-manager client application
3020 * @par Sync (or) Async : Synchronous API
3022 * @param[in] providerid pointer to the providerid of dataconltrol.
3023 * @param[out] appid pointer to hold appid, need to free after using
3024 * @return 0 if success, error code(<0) if fail
3025 * @retval PMINFO_R_OK success
3026 * @retval PMINFO_R_EINVAL invalid argument
3027 * @retval PMINFO_R_ERROR internal error
3030 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3031 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3034 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3035 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3036 * @brief This API gets the list of permission for a particular application
3038 * @par This API is for package-manager client application
3039 * @par Sync (or) Async : Synchronous API
3040 * @param[in] handle pointer to the application info handle.
3041 * @param[in] permission_func callback function for list
3042 * @param[in] user_data user data to be passed to callback function
3043 * @return 0 if success, error code(<0) if fail
3044 * @retval PMINFO_R_OK success
3045 * @retval PMINFO_R_EINVAL invalid argument
3046 * @retval PMINFO_R_ERROR internal error
3047 * @pre pkgmgrinfo_appinfo_get_appinfo()
3048 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3050 int permission_func(const char *name, void *user_data)
3052 if (strcmp(name, (char *)user_data) == 0)
3058 static int list_permission(const char *appid, char *permission)
3061 pkgmgrinfo_appinfo_h handle;
3062 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3063 if (ret != PMINFO_R_OK)
3065 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3066 if (ret != PMINFO_R_OK) {
3067 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3075 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3076 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3079 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3080 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3081 * @brief This API gets the list of category for a particular application
3083 * @par This API is for package-manager client application
3084 * @par Sync (or) Async : Synchronous API
3085 * @param[in] handle pointer to the application info handle.
3086 * @param[in] category_func callback function for list
3087 * @param[in] user_data user data to be passed to callback function
3088 * @return 0 if success, error code(<0) if fail
3089 * @retval PMINFO_R_OK success
3090 * @retval PMINFO_R_EINVAL invalid argument
3091 * @retval PMINFO_R_ERROR internal error
3092 * @pre pkgmgrinfo_appinfo_get_appinfo()
3093 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3095 int category_func(const char *name, void *user_data)
3097 if (strcmp(name, (char *)user_data) == 0)
3103 static int list_category(const char *appid, char *category)
3106 pkgmgrinfo_appinfo_h handle;
3107 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3108 if (ret != PMINFO_R_OK)
3110 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3111 if (ret != PMINFO_R_OK) {
3112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3115 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3120 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3121 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3124 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3125 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3126 * @brief This API gets the list of metadata for a particular application
3128 * @par This API is for package-manager client application
3129 * @par Sync (or) Async : Synchronous API
3130 * @param[in] handle pointer to the application info handle.
3131 * @param[in] metadata_func callback function for list
3132 * @param[in] user_data user data to be passed to callback function
3133 * @return 0 if success, error code(<0) if fail
3134 * @retval PMINFO_R_OK success
3135 * @retval PMINFO_R_EINVAL invalid argument
3136 * @retval PMINFO_R_ERROR internal error
3137 * @pre pkgmgrinfo_appinfo_get_appinfo()
3138 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3140 int metadata_func(const char *key, const char *value, void *user_data)
3142 if (strcmp(key, (char *)user_data) == 0) {
3143 printf("Value is %s\n", value);
3150 static int list_metadata(const char *appid, char *key)
3153 pkgmgrinfo_appinfo_h handle;
3154 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3155 if (ret != PMINFO_R_OK)
3157 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3158 if (ret != PMINFO_R_OK) {
3159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3162 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3167 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3168 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3172 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3173 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3174 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3175 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3176 * @brief This API gets the list of app-control for a particular application
3178 * @par This API is for package-manager client application
3179 * @par Sync (or) Async : Synchronous API
3180 * @param[in] handle pointer to the application info handle.
3181 * @param[in] appcontrol_func callback function for list
3182 * @param[in] user_data user data to be passed to callback function
3183 * @param[in] uid the addressee user id of the instruction
3184 * @return 0 if success, error code(<0) if fail
3185 * @retval PMINFO_R_OK success
3186 * @retval PMINFO_R_EINVAL invalid argument
3187 * @retval PMINFO_R_ERROR internal error
3188 * @pre pkgmgrinfo_appinfo_get_appinfo()
3189 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3191 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3196 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3197 for (i = 0; i < oc; i++) {
3198 if (strcmp(operation[i], (char *)user_data) == 0)
3205 static int check_operation(const char *appid, char *operation)
3208 pkgmgrinfo_appinfo_h handle;
3209 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3210 if (ret != PMINFO_R_OK)
3212 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3213 if (ret != PMINFO_R_OK) {
3214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3217 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3222 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3223 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3226 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3227 * @brief This API gets the application 'nodisplay' value from the app ID
3229 * @par This API is for package-manager client application
3230 * @par Sync (or) Async : Synchronous API
3232 * @param[in] handle pointer to application info handle
3233 * @param[out] nodisplay pointer to hold package nodisplay value
3234 * @return 0 if success, error code(<0) if fail
3235 * @retval PMINFO_R_OK success
3236 * @retval PMINFO_R_EINVAL invalid argument
3237 * @retval PMINFO_R_ERROR internal error
3238 * @pre pkgmgrinfo_appinfo_get_appinfo()
3239 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3240 * @see pkgmgrinfo_appinfo_get_appid()
3241 * @see pkgmgrinfo_appinfo_is_multiple()
3243 static int get_app_nodisplay(const char *appid)
3247 pkgmgrinfo_appinfo_h handle;
3248 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3249 if (ret != PMINFO_R_OK)
3251 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3252 if (ret != PMINFO_R_OK) {
3253 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3256 printf("app nodisplay: %d\n", nodisplay);
3257 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3262 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3265 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3266 * @brief This API gets the application 'multiple' value from the app ID
3268 * @par This API is for package-manager client application
3269 * @par Sync (or) Async : Synchronous API
3271 * @param[in] handle pointer to application info handle
3272 * @param[out] multiple pointer to hold package multiple value
3273 * @return 0 if success, error code(<0) if fail
3274 * @retval PMINFO_R_OK success
3275 * @retval PMINFO_R_EINVAL invalid argument
3276 * @retval PMINFO_R_ERROR internal error
3277 * @pre pkgmgrinfo_appinfo_get_appinfo()
3278 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3279 * @see pkgmgrinfo_appinfo_get_appid()
3280 * @see pkgmgrinfo_appinfo_is_nodisplay()
3282 static int get_app_multiple(const char *appid)
3286 pkgmgrinfo_appinfo_h handle;
3287 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3288 if (ret != PMINFO_R_OK)
3290 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3291 if (ret != PMINFO_R_OK) {
3292 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3295 printf("app multiple: %d\n", multiple);
3296 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3301 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3304 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3305 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3306 * application launching effect. If fales, indicator will be hidden during application launching effect
3308 * @par This API is for package-manager client application
3309 * @par Sync (or) Async : Synchronous API
3311 * @param[in] handle pointer to application info handle
3312 * @param[out] indicator_disp contains indicator display status for application launching effect
3313 * @return 0 if success, error code(<0) if fail
3314 * @retval PMINFO_R_OK success
3315 * @retval PMINFO_R_EINVAL invalid argument
3316 * @retval PMINFO_R_ERROR internal error
3317 * @pre pkgmgrinfo_appinfo_get_appinfo()
3318 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3319 * @see pkgmgrinfo_appinfo_get_appid()
3320 * @see pkgmgrinfo_appinfo_is_nodisplay()
3322 static int get_app_indicator_display(const char *appid)
3325 bool indicator_disp;
3326 pkgmgrinfo_appinfo_h handle;
3327 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3328 if (ret != PMINFO_R_OK)
3330 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3331 if (ret != PMINFO_R_OK){
3332 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3335 printf("app indicator disp : %d\n", indicator_disp);
3336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3341 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3344 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3345 * @brief This API gets the application 'taskmanage' value from the app ID
3347 * @par This API is for package-manager client application
3348 * @par Sync (or) Async : Synchronous API
3350 * @param[in] handle pointer to application info handle
3351 * @param[out] taskmanage pointer to hold package taskmanage value
3352 * @return 0 if success, error code(<0) if fail
3353 * @retval PMINFO_R_OK success
3354 * @retval PMINFO_R_EINVAL invalid argument
3355 * @retval PMINFO_R_ERROR internal error
3356 * @pre pkgmgrinfo_appinfo_get_appinfo()
3357 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3358 * @see pkgmgrinfo_appinfo_get_appid()
3359 * @see pkgmgrinfo_appinfo_is_multiple()
3361 static int get_app_taskmanage(const char *appid)
3365 pkgmgrinfo_appinfo_h handle;
3366 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3367 if (ret != PMINFO_R_OK)
3369 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3370 if (ret != PMINFO_R_OK) {
3371 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3374 printf("app taskmanage: %d\n", taskmanage);
3375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3380 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3383 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3384 * @brief This API gets the application 'taskmanage' value from the app ID
3386 * @par This API is for package-manager client application
3387 * @par Sync (or) Async : Synchronous API
3389 * @param[in] handle pointer to application info handle
3390 * @param[out] enabled pointer to hold package enabled value
3391 * @return 0 if success, error code(<0) if fail
3392 * @retval PMINFO_R_OK success
3393 * @retval PMINFO_R_EINVAL invalid argument
3394 * @retval PMINFO_R_ERROR internal error
3395 * @pre pkgmgrinfo_appinfo_get_appinfo()
3396 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3397 * @see pkgmgrinfo_appinfo_get_appid()
3398 * @see pkgmgrinfo_appinfo_is_multiple()
3400 static int get_app_enabled(const char *appid)
3404 pkgmgrinfo_appinfo_h handle;
3405 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3406 if (ret != PMINFO_R_OK)
3408 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3409 if (ret != PMINFO_R_OK) {
3410 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3413 printf("app enabled: %d\n", enabled);
3414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3419 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3422 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3423 * @brief This API gets the application 'onboot' value from the app ID
3425 * @par This API is for package-manager client application
3426 * @par Sync (or) Async : Synchronous API
3428 * @param[in] handle pointer to application info handle
3429 * @param[out] onboot pointer to hold package onboot value
3430 * @return 0 if success, error code(<0) if fail
3431 * @retval PMINFO_R_OK success
3432 * @retval PMINFO_R_EINVAL invalid argument
3433 * @retval PMINFO_R_ERROR internal error
3434 * @pre pkgmgrinfo_appinfo_get_appinfo()
3435 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3436 * @see pkgmgrinfo_appinfo_get_appid()
3437 * @see pkgmgrinfo_appinfo_is_multiple()
3439 static int get_app_onboot(const char *appid)
3443 pkgmgrinfo_appinfo_h handle;
3444 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3445 if (ret != PMINFO_R_OK)
3447 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3448 if (ret != PMINFO_R_OK) {
3449 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452 printf("app onboot: %d\n", onboot);
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3458 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3461 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3462 * @brief This API gets the application 'autorestart' value from the app ID
3464 * @par This API is for package-manager client application
3465 * @par Sync (or) Async : Synchronous API
3467 * @param[in] handle pointer to application info handle
3468 * @param[out] autorestart pointer to hold package autorestart value
3469 * @return 0 if success, error code(<0) if fail
3470 * @retval PMINFO_R_OK success
3471 * @retval PMINFO_R_EINVAL invalid argument
3472 * @retval PMINFO_R_ERROR internal error
3473 * @pre pkgmgrinfo_appinfo_get_appinfo()
3474 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3475 * @see pkgmgrinfo_appinfo_get_appid()
3476 * @see pkgmgrinfo_appinfo_is_multiple()
3478 static int get_app_autorestart(const char *appid)
3482 pkgmgrinfo_appinfo_h handle;
3483 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3484 if (ret != PMINFO_R_OK)
3486 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3487 if (ret != PMINFO_R_OK) {
3488 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3491 printf("app autorestart: %d\n", autorestart);
3492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3497 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3500 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3501 * @brief This API gets the value for given application is main app or not from handle
3503 * @par This API is for package-manager client application
3504 * @par Sync (or) Async : Synchronous API
3506 * @param[in] handle pointer to application info handle
3507 * @param[out] mainapp pointer to hold package mainapp is or not
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
3512 * @pre pkgmgrinfo_appinfo_get_appinfo()
3513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3514 * @see pkgmgrinfo_appinfo_get_appid()
3515 * @see pkgmgrinfo_appinfo_is_multiple()
3517 static int get_app_mainapp(const char *appid)
3521 pkgmgrinfo_appinfo_h handle;
3522 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3523 if (ret != PMINFO_R_OK)
3525 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3526 if (ret != PMINFO_R_OK) {
3527 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3530 printf("mainapp: %d\n", mainapp);
3531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3536 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3540 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3541 * @brief This API gets the value for given application is preload or not from handle
3543 * @par This API is for package-manager client application
3544 * @par Sync (or) Async : Synchronous API
3546 * @param[in] handle pointer to application info handle
3547 * @param[out] preload pointer to hold preload is or not
3548 * @return 0 if success, error code(<0) if fail
3549 * @retval PMINFO_R_OK success
3550 * @retval PMINFO_R_EINVAL invalid argument
3551 * @retval PMINFO_R_ERROR internal error
3552 * @pre pkgmgrinfo_appinfo_get_appinfo()
3553 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3554 * @see pkgmgrinfo_appinfo_get_appid()
3555 * @see pkgmgrinfo_appinfo_is_multiple()
3557 static int get_app_preload(const char *appid)
3561 pkgmgrinfo_appinfo_h handle = NULL;
3562 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3563 if (ret != PMINFO_R_OK)
3565 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3566 if (ret != PMINFO_R_OK) {
3567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3570 printf("preload: %d\n", preload);
3571 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3576 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3579 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3580 * @brief This API gets the value for given application is submode or not from handle
3582 * @par This API is for package-manager client application
3583 * @par Sync (or) Async : Synchronous API
3585 * @param[in] handle pointer to application info handle
3586 * @param[out] submode pointer to hold submode is or not
3587 * @return 0 if success, error code(<0) if fail
3588 * @retval PMINFO_R_OK success
3589 * @retval PMINFO_R_EINVAL invalid argument
3590 * @retval PMINFO_R_ERROR internal error
3591 * @pre pkgmgrinfo_appinfo_get_appinfo()
3592 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3593 * @see pkgmgrinfo_appinfo_get_appid()
3594 * @see pkgmgrinfo_appinfo_is_multiple()
3596 static int get_app_submode(const char *appid)
3600 pkgmgrinfo_appinfo_h handle = NULL;
3601 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3602 if (ret != PMINFO_R_OK)
3604 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3605 if (ret != PMINFO_R_OK) {
3606 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3609 printf("submode: %d\n", submode);
3610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3615 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3618 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3619 * @brief This API checks if the application has the given category
3621 * @par This API is for package-manager client application
3622 * @par Sync (or) Async : Synchronous API
3624 * @param[in] handle pointer to the application info handle
3625 * @param[in] category category
3626 * @param[out] exist value Gets whether the application has the given category
3627 * @return 0 if success, error code(<0) if fail
3628 * @retval PMINFO_R_OK success
3629 * @retval PMINFO_R_EINVAL invalid argument
3630 * @retval PMINFO_R_ERROR internal error
3632 static int is_category_exist(const char *appid, const char *category)
3635 pkgmgrinfo_appinfo_h handle;
3638 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3639 if (ret != PMINFO_R_OK)
3642 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3643 if (ret != PMINFO_R_OK) {
3644 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3653 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3656 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3657 * @brief This API gets the application 'ui_gadget' value from the app ID
3659 * @par This API is for package-manager client application
3660 * @par Sync (or) Async : Synchronous API
3662 * @param[in] handle pointer to application info handle
3663 * @param[out] ui_gadget pointer to hold package ui_gadget value
3664 * @return 0 if success, error code(<0) if fail
3665 * @retval PMINFO_R_OK success
3666 * @retval PMINFO_R_EINVAL invalid argument
3667 * @pre pkgmgrinfo_appinfo_get_appinfo()
3668 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3670 static int get_app_ui_gadget(const char *appid)
3674 pkgmgrinfo_appinfo_h handle = NULL;
3675 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3676 if (ret != PMINFO_R_OK)
3678 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
3679 if (ret != PMINFO_R_OK) {
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3683 printf("app ui_gadget: %d\n", ui_gadget);
3684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3689 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
3692 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3693 * @brief This API destroys the application information handle freeing up all the resources
3695 * @par This API is for package-manager client application
3696 * @par Sync (or) Async : Synchronous API
3698 * @param[in] handle pointer to the application info handle.
3699 * @return 0 if success, error code(<0) if fail
3700 * @retval PMINFO_R_OK success
3701 * @retval PMINFO_R_EINVAL invalid argument
3702 * @retval PMINFO_R_ERROR internal error
3703 * @pre pkgmgrinfo_appinfo_get_appinfo()
3705 * @see pkgmgrinfo_appinfo_get_pkgid()
3706 * @see pkgmgrinfo_appinfo_is_multiple()
3708 static int get_app_type(const char *appid)
3712 pkgmgrinfo_appinfo_h handle;
3713 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3714 if (ret != PMINFO_R_OK)
3716 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3717 if (ret != PMINFO_R_OK) {
3718 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3721 printf("apptype: %s\n", type);
3722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3727 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3730 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3731 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3732 The query will search the entire application information collected from the manifest file of all the installed packages
3734 * @par This API is for package-manager client application
3735 * @par Sync (or) Async : Synchronous API
3737 * @param[out] handle pointer to the application info filter handle.
3738 * @return 0 if success, error code(<0) if fail
3739 * @retval PMINFO_R_OK success
3740 * @retval PMINFO_R_EINVAL invalid argument
3741 * @retval PMINFO_R_ERROR internal error
3743 * @post pkgmgrinfo_appinfo_filter_destroy()
3744 * @see pkgmgrinfo_appinfo_filter_count()
3745 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3747 static int get_capp_count()
3751 pkgmgrinfo_appinfo_filter_h handle;
3752 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3753 if (ret != PMINFO_R_OK)
3755 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3756 if (ret != PMINFO_R_OK) {
3757 pkgmgrinfo_appinfo_filter_destroy(handle);
3760 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3761 if (ret != PMINFO_R_OK) {
3762 pkgmgrinfo_appinfo_filter_destroy(handle);
3765 printf("No of capp: %d\n", count);
3766 pkgmgrinfo_appinfo_filter_destroy(handle);
3771 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3774 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3775 * @brief This API destroys the application information filter handle freeing up all the resources
3777 * @par This API is for package-manager client application
3778 * @par Sync (or) Async : Synchronous API
3780 * @param[in] handle pointer to the application info filter handle.
3781 * @return 0 if success, error code(<0) if fail
3782 * @retval PMINFO_R_OK success
3783 * @retval PMINFO_R_EINVAL invalid argument
3784 * @retval PMINFO_R_ERROR internal error
3785 * @pre pkgmgrinfo_appinfo_filter_create()
3787 * @see pkgmgrinfo_appinfo_filter_count()
3788 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3790 static int get_capp_count()
3794 pkgmgrinfo_appinfo_filter_h handle;
3795 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3796 if (ret != PMINFO_R_OK)
3798 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3799 if (ret != PMINFO_R_OK) {
3800 pkgmgrinfo_appinfo_filter_destroy(handle);
3803 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3804 if (ret != PMINFO_R_OK) {
3805 pkgmgrinfo_appinfo_filter_destroy(handle);
3808 printf("No of capp: %d\n", count);
3809 pkgmgrinfo_appinfo_filter_destroy(handle);
3814 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3817 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3818 * @brief This API adds a boolean filter property to the filter handle
3820 * @par This API is for package-manager client application
3821 * @par Sync (or) Async : Synchronous API
3823 * @param[in] handle pointer to the application info filter handle.
3824 * @param[in] property boolean property name.
3825 * @param[in] value value corresponding to the property.
3826 * @return 0 if success, error code(<0) if fail
3827 * @retval PMINFO_R_OK success
3828 * @retval PMINFO_R_EINVAL invalid argument
3829 * @retval PMINFO_R_ERROR internal error
3830 * @pre pkgmgrinfo_appinfo_filter_create()
3831 * @post pkgmgrinfo_appinfo_filter_destroy()
3832 * @see pkgmgrinfo_appinfo_filter_count()
3833 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3835 static int get_taskmanageable_app_count()
3839 pkgmgrinfo_appinfo_filter_h handle;
3840 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3841 if (ret != PMINFO_R_OK)
3843 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3844 if (ret != PMINFO_R_OK) {
3845 pkgmgrinfo_appinfo_filter_destroy(handle);
3848 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3849 if (ret != PMINFO_R_OK) {
3850 pkgmgrinfo_appinfo_filter_destroy(handle);
3853 printf("No of taskmanageable apps: %d\n", count);
3854 pkgmgrinfo_appinfo_filter_destroy(handle);
3859 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3860 const char *property, const bool value);
3863 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3864 * @brief This API adds an integer filter property to the filter handle
3866 * @par This API is for package-manager client application
3867 * @par Sync (or) Async : Synchronous API
3869 * @param[in] handle pointer to the application info filter handle.
3870 * @param[in] property integer property name.
3871 * @param[in] value value corresponding to the property.
3872 * @return 0 if success, error code(<0) if fail
3873 * @retval PMINFO_R_OK success
3874 * @retval PMINFO_R_EINVAL invalid argument
3875 * @retval PMINFO_R_ERROR internal error
3876 * @pre pkgmgrinfo_appinfo_filter_create()
3877 * @post pkgmgrinfo_appinfo_filter_destroy()
3878 * @see pkgmgrinfo_appinfo_filter_count()
3879 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3881 static int get_taskmanageable_app_count()
3885 pkgmgrinfo_appinfo_filter_h handle;
3886 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3887 if (ret != PMINFO_R_OK)
3889 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3890 if (ret != PMINFO_R_OK) {
3891 pkgmgrinfo_appinfo_filter_destroy(handle);
3894 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3895 if (ret != PMINFO_R_OK) {
3896 pkgmgrinfo_appinfo_filter_destroy(handle);
3899 printf("No of apps: %d\n", count);
3900 pkgmgrinfo_appinfo_filter_destroy(handle);
3905 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3906 const char *property, const int value);
3909 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3910 * @brief This API adds a string filter property to the filter handle
3912 * @par This API is for package-manager client application
3913 * @par Sync (or) Async : Synchronous API
3915 * @param[in] handle pointer to the application info filter handle.
3916 * @param[in] property string property name.
3917 * @param[in] value value corresponding to the property.
3918 * @return 0 if success, error code(<0) if fail
3919 * @retval PMINFO_R_OK success
3920 * @retval PMINFO_R_EINVAL invalid argument
3921 * @retval PMINFO_R_ERROR internal error
3922 * @pre pkgmgrinfo_appinfo_filter_create()
3923 * @post pkgmgrinfo_appinfo_filter_destroy()
3924 * @see pkgmgrinfo_appinfo_filter_count()
3925 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3927 static int get_capp_count()
3931 pkgmgrinfo_appinfo_filter_h handle;
3932 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3933 if (ret != PMINFO_R_OK)
3935 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3936 if (ret != PMINFO_R_OK) {
3937 pkgmgrinfo_appinfo_filter_destroy(handle);
3940 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3941 if (ret != PMINFO_R_OK) {
3942 pkgmgrinfo_appinfo_filter_destroy(handle);
3945 printf("No of capp: %d\n", count);
3946 pkgmgrinfo_appinfo_filter_destroy(handle);
3951 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3952 const char *property, const char *value);
3955 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3956 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3958 * @par This API is for package-manager client application
3959 * @par Sync (or) Async : Synchronous API
3961 * @param[in] handle pointer to the application info filter handle.
3962 * @param[in] app_cb callback function.
3963 * @param[in] user_data user data to be passed to the callback function
3964 * @return 0 if success, error code(<0) if fail
3965 * @retval PMINFO_R_OK success
3966 * @retval PMINFO_R_EINVAL invalid argument
3967 * @retval PMINFO_R_ERROR internal error
3968 * @pre pkgmgrinfo_appinfo_filter_create()
3969 * @post pkgmgrinfo_appinfo_filter_destroy()
3970 * @see pkgmgrinfo_appinfo_filter_count()
3972 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3975 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3976 printf("appid : %s\n", appid);
3980 static int get_capp_list()
3983 pkgmgrinfo_appinfo_filter_h handle;
3984 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3985 if (ret != PMINFO_R_OK)
3987 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3988 if (ret != PMINFO_R_OK) {
3989 pkgmgrinfo_appinfo_filter_destroy(handle);
3992 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3993 if (ret != PMINFO_R_OK) {
3994 pkgmgrinfo_appinfo_filter_destroy(handle);
3997 pkgmgrinfo_appinfo_filter_destroy(handle);
4002 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4003 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4004 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4005 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4008 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4009 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4010 * @brief This API counts the application that satisfy the filter conditions
4012 * @par This API is for package-manager client application
4013 * @par Sync (or) Async : Synchronous API
4015 * @param[in] handle pointer to the application info filter handle.
4016 * @param[in] count pointer to store count value
4017 * @param[in] uid the addressee user id of the instruction
4018 * @return 0 if success, error code(<0) if fail
4019 * @retval PMINFO_R_OK success
4020 * @retval PMINFO_R_EINVAL invalid argument
4021 * @retval PMINFO_R_ERROR internal error
4022 * @pre pkgmgrinfo_appinfo_filter_create()
4023 * @post pkgmgrinfo_appinfo_filter_destroy()
4024 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4026 static int get_capp_count()
4030 pkgmgrinfo_appinfo_filter_h handle;
4031 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4032 if (ret != PMINFO_R_OK)
4034 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4035 if (ret != PMINFO_R_OK) {
4036 pkgmgrinfo_appinfo_filter_destroy(handle);
4039 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4040 if (ret != PMINFO_R_OK) {
4041 pkgmgrinfo_appinfo_filter_destroy(handle);
4044 printf("No of capp: %d\n", count);
4045 pkgmgrinfo_appinfo_filter_destroy(handle);
4050 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4051 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4053 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4054 * @brief This API creates the application's metadata information filter handle from db.
4056 * @par This API is for package-manager client application
4057 * @par Sync (or) Async : Synchronous API
4059 * @param[out] handle pointer to the application metadata info filter handle.
4060 * @return 0 if success, error code(<0) if fail
4061 * @retval PMINFO_R_OK success
4062 * @retval PMINFO_R_EINVAL invalid argument
4063 * @retval PMINFO_R_ERROR internal error
4065 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4066 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4068 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4071 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4072 printf("appid : %s\n", appid);
4076 static int get_app_list(const char *mkey, const char *mvalue)
4079 pkgmgrinfo_appinfo_metadata_filter_h handle;
4080 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4081 if (ret != PMINFO_R_OK)
4083 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4084 if (ret != PMINFO_R_OK) {
4085 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4088 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4089 if (ret != PMINFO_R_OK) {
4090 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4093 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4098 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4101 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4102 * @brief This API destroys the application's metadata information filter handle.
4104 * @par This API is for package-manager client application
4105 * @par Sync (or) Async : Synchronous API
4107 * @param[in] handle pointer to the application metadata info filter handle.
4108 * @return 0 if success, error code(<0) if fail
4109 * @retval PMINFO_R_OK success
4110 * @retval PMINFO_R_EINVAL invalid argument
4111 * @retval PMINFO_R_ERROR internal error
4112 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4114 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4116 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4119 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4120 printf("appid : %s\n", appid);
4124 static int get_app_list(const char *mkey, const char *mvalue)
4127 pkgmgrinfo_appinfo_metadata_filter_h handle;
4128 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4129 if (ret != PMINFO_R_OK)
4131 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4132 if (ret != PMINFO_R_OK) {
4133 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4136 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4137 if (ret != PMINFO_R_OK) {
4138 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4141 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4146 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4149 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4150 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4151 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4153 * @par This API is for package-manager client application
4154 * @par Sync (or) Async : Synchronous API
4156 * @param[in] handle pointer to the application metadata info filter handle.
4157 * @param[in] key pointer to metadata key
4158 * @param[in] value pointer to metadata value
4159 * @return 0 if success, error code(<0) if fail
4160 * @retval PMINFO_R_OK success
4161 * @retval PMINFO_R_EINVAL invalid argument
4162 * @retval PMINFO_R_ERROR internal error
4163 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4164 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4165 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4167 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4170 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4171 printf("appid : %s\n", appid);
4175 static int get_app_list(const char *mkey, const char *mvalue)
4178 pkgmgrinfo_appinfo_metadata_filter_h handle;
4179 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4180 if (ret != PMINFO_R_OK)
4182 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4183 if (ret != PMINFO_R_OK) {
4184 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4187 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4188 if (ret != PMINFO_R_OK) {
4189 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4192 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4197 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4198 const char *key, const char *value);
4201 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4202 * @fn int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid)
4203 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4204 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4205 * negative value, no more callbacks will be called and API will return.
4207 * @par This API is for package-manager client application
4208 * @par Sync (or) Async : Synchronous API
4210 * @param[in] handle pointer to the application metadata info filter handle.
4211 * @param[in] app_cb function pointer to callback
4212 * @param[in] user_data pointer to user data
4213 * @param[in] uid the addressee user id of the instruction
4214 * @return 0 if success, error code(<0) if fail
4215 * @retval PMINFO_R_OK success
4216 * @retval PMINFO_R_EINVAL invalid argument
4217 * @retval PMINFO_R_ERROR internal error
4218 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4219 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4221 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4224 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4225 printf("appid : %s\n", appid);
4229 static int get_app_list(const char *mkey, const char *mvalue)
4232 pkgmgrinfo_appinfo_metadata_filter_h handle;
4233 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4234 if (ret != PMINFO_R_OK)
4236 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4237 if (ret != PMINFO_R_OK) {
4238 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4241 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4242 if (ret != PMINFO_R_OK) {
4243 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4246 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4251 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4252 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4253 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4254 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4256 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4257 * @brief This API creates the package cert information handle to get data from db.
4259 * @par This API is for package-manager client application
4260 * @par Sync (or) Async : Synchronous API
4262 * @param[out] handle pointer to the package cert handle.
4263 * @return 0 if success, error code(<0) if fail
4264 * @retval PMINFO_R_OK success
4265 * @retval PMINFO_R_EINVAL invalid argument
4266 * @retval PMINFO_R_ERROR internal error
4268 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4269 * @see pkgmgrinfo_pkginfo_get_cert_value()
4270 * @see pkgmgrinfo_pkginfo_load_certinfo()
4272 static int get_cert_info(const char *pkgid)
4275 pkgmgrinfo_certinfo_h handle;
4276 char *auth_cert = NULL;
4277 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4278 if (ret != PMINFO_R_OK)
4280 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4281 if (ret != PMINFO_R_OK) {
4282 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4285 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4286 if (ret != PMINFO_R_OK) {
4287 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4290 printf("Author root certificate: %s\n", auth_root);
4291 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4296 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4299 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4300 * @brief This API loads the package cert information handle with data from db.
4302 * @par This API is for package-manager client application
4303 * @par Sync (or) Async : Synchronous API
4305 * @param[in] pkgid pointer to the package ID.
4306 * @param[in] handle pointer to the package cert handle.
4307 * @return 0 if success, error code(<0) if fail
4308 * @retval PMINFO_R_OK success
4309 * @retval PMINFO_R_EINVAL invalid argument
4310 * @retval PMINFO_R_ERROR internal error
4311 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4312 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4313 * @see pkgmgrinfo_pkginfo_get_cert_value()
4315 static int get_cert_info(const char *pkgid)
4318 pkgmgrinfo_certinfo_h handle;
4319 char *auth_cert = NULL;
4320 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4321 if (ret != PMINFO_R_OK)
4323 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4324 if (ret != PMINFO_R_OK) {
4325 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4328 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4329 if (ret != PMINFO_R_OK) {
4330 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4333 printf("Author root certificate: %s\n", auth_root);
4334 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4339 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4342 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4343 * @brief This API gets the package cert information from the handle
4345 * @par This API is for package-manager client application
4346 * @par Sync (or) Async : Synchronous API
4348 * @param[in] handle pointer to the package cert handle.
4349 * @param[in] cert_type certificate type
4350 * @param[out] cert_value pointer to hold certificate value
4351 * @return 0 if success, error code(<0) if fail
4352 * @retval PMINFO_R_OK success
4353 * @retval PMINFO_R_EINVAL invalid argument
4354 * @retval PMINFO_R_ERROR internal error
4355 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4356 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4357 * @see pkgmgrinfo_pkginfo_load_certinfo()
4359 static int get_cert_info(const char *pkgid)
4362 pkgmgrinfo_certinfo_h handle;
4363 char *auth_cert = NULL;
4364 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4365 if (ret != PMINFO_R_OK)
4367 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4368 if (ret != PMINFO_R_OK) {
4369 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4372 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4373 if (ret != PMINFO_R_OK) {
4374 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4377 printf("Author root certificate: %s\n", auth_root);
4378 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4383 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4386 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4387 * @brief This API destroys the package cert information handle freeing up all the resources
4389 * @par This API is for package-manager client application
4390 * @par Sync (or) Async : Synchronous API
4392 * @param[in] handle pointer to the package cert handle.
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_pkginfo_create_certinfo()
4399 * @see pkgmgrinfo_pkginfo_load_certinfo()
4401 static int get_cert_info(const char *pkgid)
4404 pkgmgrinfo_certinfo_h handle;
4405 char *auth_cert = NULL;
4406 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4407 if (ret != PMINFO_R_OK)
4409 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4410 if (ret != PMINFO_R_OK) {
4411 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4414 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4415 if (ret != PMINFO_R_OK) {
4416 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4419 printf("Author root certificate: %s\n", auth_root);
4420 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4425 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4428 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4429 * @brief This API deletes the package cert information from DB
4431 * @par This API is for package-manager client application
4432 * @par Sync (or) Async : Synchronous API
4434 * @param[in] pkgid pointer to the package ID.
4435 * @return 0 if success, error code(<0) if fail
4436 * @retval PMINFO_R_OK success
4437 * @retval PMINFO_R_EINVAL invalid argument
4438 * @retval PMINFO_R_ERROR internal error
4442 static int delete_cert_info(const char *pkgid)
4445 ret = pkgmgrinfo_delete_certinfo(pkgid);
4446 if (ret != PMINFO_R_OK)
4452 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4453 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4455 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4456 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4457 * @brief This API creates the package db information handle to set data in db.
4459 * @par This API is for package-manager client application
4460 * @par Sync (or) Async : Synchronous API
4462 * @param[in] pkgid pointer to the package ID.
4463 * @param[in] uid the addressee user id of the instruction
4464 * @param[out] handle pointer to the package db info handle.
4465 * @return 0 if success, error code(<0) if fail
4466 * @retval PMINFO_R_OK success
4467 * @retval PMINFO_R_EINVAL invalid argument
4468 * @retval PMINFO_R_ERROR internal error
4470 * @post pkgmgrinfo_destroy_pkgdbinfo()
4471 * @see pkgmgrinfo_save_pkgdbinfo()
4472 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4474 static int set_pkg_in_db(const char *pkgid)
4477 pkgmgrinfo_pkgdbinfo_h handle;
4478 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4479 if (ret != PMINFO_R_OK)
4481 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4482 if (ret != PMINFO_R_OK) {
4483 pkgmgrinfo_destroy_pkgdbinfo(handle);
4486 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4487 if (ret != PMINFO_R_OK) {
4488 pkgmgrinfo_destroy_pkgdbinfo(handle);
4491 pkgmgrinfo_destroy_pkgdbinfo(handle);
4496 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4497 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4500 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4501 * @brief This API sets the package type in db handle
4503 * @par This API is for package-manager client application
4504 * @par Sync (or) Async : Synchronous API
4506 * @param[in] handle pointer to the pkgdbinfo handle.
4507 * @param[in] type pointer to the package type.
4508 * @return 0 if success, error code(<0) if fail
4509 * @retval PMINFO_R_OK success
4510 * @retval PMINFO_R_EINVAL invalid argument
4511 * @retval PMINFO_R_ERROR internal error
4512 * @pre pkgmgrinfo_create_pkgdbinfo()
4513 * @post pkgmgrinfo_destroy_pkgdbinfo()
4514 * @see pkgmgrinfo_save_pkgdbinfo()
4515 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4517 static int set_pkg_type_in_db(const char *pkgid)
4520 pkgmgrinfo_pkgdbinfo_h handle;
4521 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4522 if (ret != PMINFO_R_OK)
4524 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4525 if (ret != PMINFO_R_OK) {
4526 pkgmgrinfo_destroy_pkgdbinfo(handle);
4529 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4530 if (ret != PMINFO_R_OK) {
4531 pkgmgrinfo_destroy_pkgdbinfo(handle);
4534 pkgmgrinfo_destroy_pkgdbinfo(handle);
4539 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4542 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4543 * @brief This API sets the package version in db handle
4545 * @par This API is for package-manager client application
4546 * @par Sync (or) Async : Synchronous API
4548 * @param[in] handle pointer to the pkgdbinfo handle.
4549 * @param[in] version pointer to the package version
4550 * @return 0 if success, error code(<0) if fail
4551 * @retval PMINFO_R_OK success
4552 * @retval PMINFO_R_EINVAL invalid argument
4553 * @retval PMINFO_R_ERROR internal error
4554 * @pre pkgmgrinfo_create_pkgdbinfo()
4555 * @post pkgmgrinfo_destroy_pkgdbinfo()
4556 * @see pkgmgrinfo_save_pkgdbinfo()
4557 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4559 static int set_pkg_version_in_db(const char *pkgid)
4562 pkgmgrinfo_pkgdbinfo_h handle;
4563 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4564 if (ret != PMINFO_R_OK)
4566 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4567 if (ret != PMINFO_R_OK) {
4568 pkgmgrinfo_destroy_pkgdbinfo(handle);
4571 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4572 if (ret != PMINFO_R_OK) {
4573 pkgmgrinfo_destroy_pkgdbinfo(handle);
4576 pkgmgrinfo_destroy_pkgdbinfo(handle);
4581 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4584 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4585 * @brief This API sets the package install location in db handle
4587 * @par This API is for package-manager client application
4588 * @par Sync (or) Async : Synchronous API
4590 * @param[in] handle pointer to the pkgdbinfo handle.
4591 * @param[in] location package install location
4592 * @return 0 if success, error code(<0) if fail
4593 * @retval PMINFO_R_OK success
4594 * @retval PMINFO_R_EINVAL invalid argument
4595 * @retval PMINFO_R_ERROR internal error
4596 * @pre pkgmgrinfo_create_pkgdbinfo()
4597 * @post pkgmgrinfo_destroy_pkgdbinfo()
4598 * @see pkgmgrinfo_save_pkgdbinfo()
4599 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4601 static int set_pkg_install_location_in_db(const char *pkgid)
4604 pkgmgrinfo_pkgdbinfo_h handle;
4605 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4606 if (ret != PMINFO_R_OK)
4608 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4609 if (ret != PMINFO_R_OK) {
4610 pkgmgrinfo_destroy_pkgdbinfo(handle);
4613 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4614 if (ret != PMINFO_R_OK) {
4615 pkgmgrinfo_destroy_pkgdbinfo(handle);
4618 pkgmgrinfo_destroy_pkgdbinfo(handle);
4623 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4626 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4627 * @brief This API sets the package size in db handle
4629 * @par This API is for package-manager client application
4630 * @par Sync (or) Async : Synchronous API
4632 * @param[in] handle pointer to the pkgdbinfo handle.
4633 * @param[in] size pointer to the package size
4634 * @return 0 if success, error code(<0) if fail
4635 * @retval PMINFO_R_OK success
4636 * @retval PMINFO_R_EINVAL invalid argument
4637 * @retval PMINFO_R_ERROR internal error
4638 * @pre pkgmgrinfo_create_pkgdbinfo()
4639 * @post pkgmgrinfo_destroy_pkgdbinfo()
4640 * @see pkgmgrinfo_save_pkgdbinfo()
4641 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4643 static int set_pkg_size_in_db(const char *pkgid)
4646 pkgmgrinfo_pkgdbinfo_h handle;
4647 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4648 if (ret != PMINFO_R_OK)
4650 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4651 if (ret != PMINFO_R_OK) {
4652 pkgmgrinfo_destroy_pkgdbinfo(handle);
4655 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4656 if (ret != PMINFO_R_OK) {
4657 pkgmgrinfo_destroy_pkgdbinfo(handle);
4660 pkgmgrinfo_destroy_pkgdbinfo(handle);
4665 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4668 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4669 * @brief This API sets the package label in db handle
4671 * @par This API is for package-manager client application
4672 * @par Sync (or) Async : Synchronous API
4674 * @param[in] handle pointer to the pkgdbinfo handle.
4675 * @param[in] label pointer to the package label
4676 * @param[in] locale pointer to the locale
4677 * @return 0 if success, error code(<0) if fail
4678 * @retval PMINFO_R_OK success
4679 * @retval PMINFO_R_EINVAL invalid argument
4680 * @retval PMINFO_R_ERROR internal error
4681 * @pre pkgmgrinfo_create_pkgdbinfo()
4682 * @post pkgmgrinfo_destroy_pkgdbinfo()
4683 * @see pkgmgrinfo_save_pkgdbinfo()
4684 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4686 static int set_pkg_label_in_db(const char *pkgid)
4689 pkgmgrinfo_pkgdbinfo_h handle;
4690 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4691 if (ret != PMINFO_R_OK)
4693 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4694 if (ret != PMINFO_R_OK) {
4695 pkgmgrinfo_destroy_pkgdbinfo(handle);
4698 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4699 if (ret != PMINFO_R_OK) {
4700 pkgmgrinfo_destroy_pkgdbinfo(handle);
4703 pkgmgrinfo_destroy_pkgdbinfo(handle);
4708 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4711 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4712 * @brief This API sets the package icon in db handle
4714 * @par This API is for package-manager client application
4715 * @par Sync (or) Async : Synchronous API
4717 * @param[in] handle pointer to the pkgdbinfo handle.
4718 * @param[in] icon pointer to the package icon
4719 * @param[in] locale pointer to the locale
4720 * @return 0 if success, error code(<0) if fail
4721 * @retval PMINFO_R_OK success
4722 * @retval PMINFO_R_EINVAL invalid argument
4723 * @retval PMINFO_R_ERROR internal error
4724 * @pre pkgmgrinfo_create_pkgdbinfo()
4725 * @post pkgmgrinfo_destroy_pkgdbinfo()
4726 * @see pkgmgrinfo_save_pkgdbinfo()
4727 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4729 static int set_pkg_icon_in_db(const char *pkgid)
4732 pkgmgrinfo_pkgdbinfo_h handle;
4733 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4734 if (ret != PMINFO_R_OK)
4736 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4737 if (ret != PMINFO_R_OK) {
4738 pkgmgrinfo_destroy_pkgdbinfo(handle);
4741 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4742 if (ret != PMINFO_R_OK) {
4743 pkgmgrinfo_destroy_pkgdbinfo(handle);
4746 pkgmgrinfo_destroy_pkgdbinfo(handle);
4751 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4754 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4755 * @brief This API sets the package description in db handle
4757 * @par This API is for package-manager client application
4758 * @par Sync (or) Async : Synchronous API
4760 * @param[in] handle pointer to the pkgdbinfo handle.
4761 * @param[in] description pointer to the package description
4762 * @param[in] locale pointer to the locale
4763 * @return 0 if success, error code(<0) if fail
4764 * @retval PMINFO_R_OK success
4765 * @retval PMINFO_R_EINVAL invalid argument
4766 * @retval PMINFO_R_ERROR internal error
4767 * @pre pkgmgrinfo_create_pkgdbinfo()
4768 * @post pkgmgrinfo_destroy_pkgdbinfo()
4769 * @see pkgmgrinfo_save_pkgdbinfo()
4770 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4772 static int set_pkg_description_in_db(const char *pkgid)
4775 pkgmgrinfo_pkgdbinfo_h handle;
4776 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4777 if (ret != PMINFO_R_OK)
4779 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4780 if (ret != PMINFO_R_OK) {
4781 pkgmgrinfo_destroy_pkgdbinfo(handle);
4784 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4785 if (ret != PMINFO_R_OK) {
4786 pkgmgrinfo_destroy_pkgdbinfo(handle);
4789 pkgmgrinfo_destroy_pkgdbinfo(handle);
4794 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4797 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4798 const char *author_email, const char *author_href, const char *locale)
4799 * @brief This API sets the package author info in db handle
4801 * @par This API is for package-manager client application
4802 * @par Sync (or) Async : Synchronous API
4804 * @param[in] handle pointer to the pkgdbinfo handle.
4805 * @param[in] author_name pointer to the package author name
4806 * @param[in] author_email pointer to the package author email
4807 * @param[in] author_href pointer to the package author href
4808 * @param[in] locale pointer to the locale
4809 * @return 0 if success, error code(<0) if fail
4810 * @retval PMINFO_R_OK success
4811 * @retval PMINFO_R_EINVAL invalid argument
4812 * @retval PMINFO_R_ERROR internal error
4813 * @pre pkgmgrinfo_create_pkgdbinfo()
4814 * @post pkgmgrinfo_destroy_pkgdbinfo()
4815 * @see pkgmgrinfo_save_pkgdbinfo()
4816 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4818 static int set_pkg_author_in_db(const char *pkgid)
4821 pkgmgrinfo_pkgdbinfo_h handle;
4822 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4823 if (ret != PMINFO_R_OK)
4825 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4826 if (ret != PMINFO_R_OK) {
4827 pkgmgrinfo_destroy_pkgdbinfo(handle);
4830 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4831 if (ret != PMINFO_R_OK) {
4832 pkgmgrinfo_destroy_pkgdbinfo(handle);
4835 pkgmgrinfo_destroy_pkgdbinfo(handle);
4840 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4841 const char *author_email, const char *author_href, const char *locale);
4844 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4845 * @brief This API sets the package 'removable' value in db handle
4847 * @par This API is for package-manager client application
4848 * @par Sync (or) Async : Synchronous API
4850 * @param[in] handle pointer to the pkgdbinfo handle.
4851 * @param[in] removable package removable value
4852 * @return 0 if success, error code(<0) if fail
4853 * @retval PMINFO_R_OK success
4854 * @retval PMINFO_R_EINVAL invalid argument
4855 * @retval PMINFO_R_ERROR internal error
4856 * @pre pkgmgrinfo_create_pkgdbinfo()
4857 * @post pkgmgrinfo_destroy_pkgdbinfo()
4858 * @see pkgmgrinfo_save_pkgdbinfo()
4859 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4861 static int set_pkg_removable_in_db(const char *pkgid)
4864 pkgmgrinfo_pkgdbinfo_h handle;
4865 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4866 if (ret != PMINFO_R_OK)
4868 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4869 if (ret != PMINFO_R_OK) {
4870 pkgmgrinfo_destroy_pkgdbinfo(handle);
4873 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4874 if (ret != PMINFO_R_OK) {
4875 pkgmgrinfo_destroy_pkgdbinfo(handle);
4878 pkgmgrinfo_destroy_pkgdbinfo(handle);
4883 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4886 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4887 * @brief This API sets the package 'preload' value in db handle
4889 * @par This API is for package-manager client application
4890 * @par Sync (or) Async : Synchronous API
4892 * @param[in] handle pointer to the pkgdbinfo handle.
4893 * @param[in] preload package preload value
4894 * @return 0 if success, error code(<0) if fail
4895 * @retval PMINFO_R_OK success
4896 * @retval PMINFO_R_EINVAL invalid argument
4897 * @retval PMINFO_R_ERROR internal error
4898 * @pre pkgmgrinfo_create_pkgdbinfo()
4899 * @post pkgmgrinfo_destroy_pkgdbinfo()
4900 * @see pkgmgrinfo_save_pkgdbinfo()
4901 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4903 static int set_pkg_preload_in_db(const char *pkgid)
4906 pkgmgrinfo_pkgdbinfo_h handle;
4907 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4908 if (ret != PMINFO_R_OK)
4910 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4911 if (ret != PMINFO_R_OK) {
4912 pkgmgrinfo_destroy_pkgdbinfo(handle);
4915 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4916 if (ret != PMINFO_R_OK) {
4917 pkgmgrinfo_destroy_pkgdbinfo(handle);
4920 pkgmgrinfo_destroy_pkgdbinfo(handle);
4925 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4928 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4929 * @brief This API sets the package 'installed_storage' value in db handle
4931 * @par This API is for package-manager client application
4932 * @par Sync (or) Async : Synchronous API
4934 * @param[in] handle pointer to the pkgdbinfo handle.
4935 * @param[in] location installed_storage value
4936 * @return 0 if success, error code(<0) if fail
4937 * @retval PMINFO_R_OK success
4938 * @retval PMINFO_R_EINVAL invalid argument
4939 * @retval PMINFO_R_ERROR internal error
4940 * @pre pkgmgrinfo_create_pkgdbinfo()
4941 * @post pkgmgrinfo_destroy_pkgdbinfo()
4942 * @see pkgmgrinfo_save_pkgdbinfo()
4944 static int set_pkg_installed_storage_in_db(const char *pkgid)
4947 pkgmgrinfo_pkgdbinfo_h handle;
4948 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_destroy_pkgdbinfo(handle);
4956 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_destroy_pkgdbinfo(handle);
4961 pkgmgrinfo_destroy_pkgdbinfo(handle);
4966 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4969 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4970 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
4971 * @brief This API saves all the information from the handle to the DB.
4973 * @par This API is for package-manager client application
4974 * @par Sync (or) Async : Synchronous API
4976 * @param[in] handle pointer to the package db info handle.
4977 * @param[in] uid the addressee user id of the instruction
4978 * @return 0 if success, error code(<0) if fail
4979 * @retval PMINFO_R_OK success
4980 * @retval PMINFO_R_EINVAL invalid argument
4981 * @retval PMINFO_R_ERROR internal error
4982 * @pre pkgmgrinfo_create_pkgdbinfo()
4983 * @post pkgmgrinfo_destroy_pkgdbinfo()
4984 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4986 static int set_pkg_in_db(const char *pkgid)
4989 pkgmgrinfo_pkgdbinfo_h handle;
4990 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4991 if (ret != PMINFO_R_OK)
4993 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4994 if (ret != PMINFO_R_OK) {
4995 pkgmgrinfo_destroy_pkgdbinfo(handle);
4998 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4999 if (ret != PMINFO_R_OK) {
5000 pkgmgrinfo_destroy_pkgdbinfo(handle);
5003 pkgmgrinfo_destroy_pkgdbinfo(handle);
5008 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5009 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5011 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5012 * @brief This API destroys the package db information handle freeing up all the resources
5014 * @par This API is for package-manager client application
5015 * @par Sync (or) Async : Synchronous API
5017 * @param[in] handle pointer to the package db info handle.
5018 * @return 0 if success, error code(<0) if fail
5019 * @retval PMINFO_R_OK success
5020 * @retval PMINFO_R_EINVAL invalid argument
5021 * @retval PMINFO_R_ERROR internal error
5022 * @pre pkgmgrinfo_create_pkgdbinfo()
5024 * @see pkgmgrinfo_save_pkgdbinfo()
5025 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5027 static int set_pkg_in_db(const char *pkgid)
5030 pkgmgrinfo_pkgdbinfo_h handle;
5031 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5032 if (ret != PMINFO_R_OK)
5034 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5035 if (ret != PMINFO_R_OK) {
5036 pkgmgrinfo_destroy_pkgdbinfo(handle);
5039 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5040 if (ret != PMINFO_R_OK) {
5041 pkgmgrinfo_destroy_pkgdbinfo(handle);
5044 pkgmgrinfo_destroy_pkgdbinfo(handle);
5049 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5053 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5054 * @brief This API creates the package cert information handle to set data in db.
5056 * @par This API is for package-manager client application
5057 * @par Sync (or) Async : Synchronous API
5059 * @param[out] handle pointer to the package cert handle.
5060 * @return 0 if success, error code(<0) if fail
5061 * @retval PMINFO_R_OK success
5062 * @retval PMINFO_R_EINVAL invalid argument
5063 * @retval PMINFO_R_ERROR internal error
5065 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5066 * @see pkgmgrinfo_set_cert_value()
5067 * @see pkgmgrinfo_save_certinfo()
5069 static int set_cert_in_db(const char *pkgid)
5072 pkgmgrinfo_instcertinfo_h handle;
5073 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5074 if (ret != PMINFO_R_OK)
5076 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5077 if (ret != PMINFO_R_OK) {
5078 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5081 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5086 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5091 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5094 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5095 * @brief This API sets the package cert information in the handle.
5097 * @par This API is for package-manager client application
5098 * @par Sync (or) Async : Synchronous API
5100 * @param[in] handle pointer to the package cert handle.
5101 * @param[in] cert_type certificate type.
5102 * @param[in] cert_value certificate value.
5103 * @return 0 if success, error code(<0) if fail
5104 * @retval PMINFO_R_OK success
5105 * @retval PMINFO_R_EINVAL invalid argument
5106 * @retval PMINFO_R_ERROR internal error
5107 * @pre pkgmgrinfo_create_certinfo_set_handle()
5108 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5109 * @see pkgmgrinfo_save_certinfo()
5111 static int set_cert_in_db(const char *pkgid)
5114 pkgmgrinfo_instcertinfo_h handle;
5115 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5116 if (ret != PMINFO_R_OK)
5118 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5119 if (ret != PMINFO_R_OK) {
5120 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5123 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5124 if (ret != PMINFO_R_OK) {
5125 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5128 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5133 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5136 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5137 * @brief This API saves the package cert information in the DB.
5139 * @par This API is for package-manager client application
5140 * @par Sync (or) Async : Synchronous API
5142 * @param[in] pkgid pointer to the package ID.
5143 * @param[in] handle pointer to the package cert handle.
5144 * @return 0 if success, error code(<0) if fail
5145 * @retval PMINFO_R_OK success
5146 * @retval PMINFO_R_EINVAL invalid argument
5147 * @retval PMINFO_R_ERROR internal error
5148 * @pre pkgmgrinfo_create_certinfo_set_handle()
5149 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5150 * @see pkgmgrinfo_save_certinfo()
5152 static int set_cert_in_db(const char *pkgid)
5155 pkgmgrinfo_instcertinfo_h handle;
5156 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5157 if (ret != PMINFO_R_OK)
5159 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5160 if (ret != PMINFO_R_OK) {
5161 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5164 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5165 if (ret != PMINFO_R_OK) {
5166 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5169 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5174 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5177 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5178 * @brief This API destroys the package cert information handle freeing up all the resources.
5180 * @par This API is for package-manager client application
5181 * @par Sync (or) Async : Synchronous API
5183 * @param[in] handle pointer to the package cert handle.
5184 * @return 0 if success, error code(<0) if fail
5185 * @retval PMINFO_R_OK success
5186 * @retval PMINFO_R_EINVAL invalid argument
5187 * @retval PMINFO_R_ERROR internal error
5188 * @pre pkgmgrinfo_create_certinfo_set_handle()
5190 * @see pkgmgrinfo_save_certinfo()
5192 static int set_cert_in_db(const char *pkgid)
5195 pkgmgrinfo_instcertinfo_h handle;
5196 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5197 if (ret != PMINFO_R_OK)
5199 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5200 if (ret != PMINFO_R_OK) {
5201 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5204 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5205 if (ret != PMINFO_R_OK) {
5206 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5209 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5214 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5217 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5218 * @brief This API gets the datacontrol info
5220 * @par This API is for package-manager client application
5221 * @par Sync (or) Async : Synchronous API
5223 * @param[in] providerid pointer to the providerid of dataconltrol.
5224 * @param[in] type pointer to the type of dataconltrol.
5225 * @param[out] appid pointer to hold appid, need to free after using
5226 * @param[out] access pointer to hold access, need to free after using
5227 * @return 0 if success, error code(<0) if fail
5228 * @retval PMINFO_R_OK success
5229 * @retval PMINFO_R_EINVAL invalid argument
5230 * @retval PMINFO_R_ERROR internal error
5233 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5236 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5237 * @brief This API gets the application 'guest mode visibility' value from the DB
5239 * @par This API is for package-manager client application
5240 * @par Sync (or) Async : Synchronous API
5242 * @param[in] handle pointer to application info handle
5243 * @param[out] status pointer to hold app guest mode visibility value
5244 * @return 0 if success, error code(<0) if fail
5245 * @retval PMINFO_R_OK success
5246 * @retval PMINFO_R_EINVAL invalid argument
5247 * @retval PMINFO_R_ERROR internal error
5248 * @pre pkgmgrinfo_appinfo_get_appinfo()
5249 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5250 * @see pkgmgrinfo_appinfo_get_appid()
5251 * @see pkgmgrinfo_appinfo_is_multiple()
5253 static int get_app_guestmode_visibility(const char *appid)
5257 pkgmgrinfo_appinfo_h handle;
5258 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5259 if (ret != PMINFO_R_OK)
5261 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5262 if (ret != PMINFO_R_OK) {
5263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5266 printf("app guest mode visibility: %d\n", status);
5267 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5272 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5275 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5276 * @brief This API sets the application 'guest mode visibility' value in the DB
5278 * @par This API is for package-manager client application
5279 * @par Sync (or) Async : Synchronous API
5281 * @param[in] handle pointer to application info handle
5282 * @param[out] status app guest mode visibility value
5283 * @return 0 if success, error code(<0) if fail
5284 * @retval PMINFO_R_OK success
5285 * @retval PMINFO_R_EINVAL invalid argument
5286 * @retval PMINFO_R_ERROR internal error
5287 * @pre pkgmgrinfo_appinfo_get_appinfo()
5288 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5289 * @see pkgmgrinfo_appinfo_get_appid()
5290 * @see pkgmgrinfo_appinfo_is_multiple()
5292 static int set_app_guestmode_visibility(const char *appid, bool value)
5295 pkgmgrinfo_appinfo_h handle;
5296 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5297 if (ret != PMINFO_R_OK)
5299 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5300 if (ret != PMINFO_R_OK) {
5301 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5309 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5310 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5312 * @pkgmgrinfo client API
5316 * @brief listening status type in pkgmgrinfo.
5318 #define PMINFO_CLIENT_STATUS_ALL 0x00
5319 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5320 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5321 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5322 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5323 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5324 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5327 * @brief This APIs provides pkgmgrinfo client listener
5329 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5330 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5331 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5332 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5333 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5337 * @pkgmgrinfo client API end
5345 #endif /* __PKG_INFO_H__ */