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"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
109 /** Integer property for filtering based on package info*/
110 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
112 /** String property for filtering based on app info*/
113 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
114 /** String property for filtering based on app info*/
115 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
137 /** Boolean property for filtering based on app info*/
138 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
139 /** Boolean property for filtering based on app info*/
140 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
141 /** Boolean property for filtering based on app info*/
142 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
143 /** Boolean property for filtering based on app info*/
144 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
145 /** Boolean property for filtering based on app info*/
146 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
147 /** Boolean property for filtering based on app info*/
148 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
149 /** Boolean property for filtering based on app info*/
150 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
152 /** will be updated*/
153 /** string property for filtering based on pkg info*/
154 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
156 /* For multiuser support */
157 const char *getIconPath(uid_t uid);
158 const char *getUserPkgParserDBPath(void);
159 const char *getUserPkgParserDBPathUID(uid_t uid);
160 const char *getUserPkgCertDBPath(void);
161 const char *getUserPkgCertDBPathUID(uid_t uid);
162 const char *getUserDesktopPath(uid_t uid);
163 const char *getUserManifestPath(uid_t uid);
166 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
167 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
168 * @brief This API gets list of installed packages
170 * @par This API is for package-manager client application
171 * @par Sync (or) Async : Synchronous API
172 * @param[in] pkg_list_cb iteration function for list
173 * @param[in] user_data user data to be passed to callback function
174 * @param[in] uid the addressee user id of the instruction
175 * @return 0 if success, error code(<0) if fail
176 * @retval PMINFO_R_OK success
177 * @retval PMINFO_R_EINVAL invalid argument
178 * @retval PMINFO_R_ERROR internal error
182 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
186 pkgid1 = (char *)user_data;
187 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
188 if (strcmp(pkgid1, pkgid2) == 0) {
195 static int list_pkgs()
198 char *name = "helloworld";
199 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
200 if (ret != PMINFO_R_OK) {
207 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
208 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
210 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
211 * @brief This API creates the package information handle from db
213 * @par This API is for package-manager client application
214 * @par Sync (or) Async : Synchronous API
216 * @param[in] pkgid pointer to package ID
217 * @param[in] uid the addressee user id of the instruction
218 * @param[out] handle pointer to the package info handle.
219 * @return 0 if success, error code(<0) if fail
220 * @retval PMINFO_R_OK success
221 * @retval PMINFO_R_EINVAL invalid argument
222 * @retval PMINFO_R_ERROR internal error
224 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
225 * @see pkgmgrinfo_pkginfo_get_pkgid()
226 * @see pkgmgrinfo_pkginfo_is_removable()
228 static int get_pkg_type(const char *pkgid)
232 pkgmgrinfo_pkginfo_h handle;
233 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
234 if (ret != PMINFO_R_OK)
236 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
237 if (ret != PMINFO_R_OK) {
238 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
241 printf("pkgtype: %s\n", type);
242 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
247 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
248 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
251 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
252 * @brief This API gets the package name from the package ID
254 * @par This API is for package-manager client application
255 * @par Sync (or) Async : Synchronous API
257 * @param[in] handle pointer to package info handle
258 * @param[out] pkg_name pointer to hold package name
259 * @return 0 if success, error code(<0) if fail
260 * @retval PMINFO_R_OK success
261 * @retval PMINFO_R_EINVAL invalid argument
262 * @retval PMINFO_R_ERROR internal error
263 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
264 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
265 * @see pkgmgrinfo_pkginfo_get_type()
266 * @see pkgmgrinfo_pkginfo_is_removable()
268 static int get_pkg_name(const char *pkgid)
271 char *pkgname = NULL;
272 pkgmgrinfo_pkginfo_h handle;
273 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
274 if (ret != PMINFO_R_OK)
276 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
277 if (ret != PMINFO_R_OK) {
278 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
281 printf("pkgname: %s\n", pkgname);
282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
287 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
290 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
291 * @brief This API gets the package id from the package ID
293 * @par This API is for package-manager client application
294 * @par Sync (or) Async : Synchronous API
296 * @param[in] handle pointer to package info handle
297 * @param[out] pkgid pointer to hold package id
298 * @return 0 if success, error code(<0) if fail
299 * @retval PMINFO_R_OK success
300 * @retval PMINFO_R_EINVAL invalid argument
301 * @retval PMINFO_R_ERROR internal error
302 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
303 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
304 * @see pkgmgrinfo_pkginfo_get_type()
305 * @see pkgmgrinfo_pkginfo_is_removable()
307 static int get_pkgid(const char *pkgid)
311 pkgmgrinfo_pkginfo_h handle;
312 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
313 if (ret != PMINFO_R_OK)
315 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
316 if (ret != PMINFO_R_OK) {
317 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
320 printf("pkg id: %s\n", pkg_id);
321 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
326 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
329 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
330 * @brief This API gets the package type from the package ID
332 * @par This API is for package-manager client application
333 * @par Sync (or) Async : Synchronous API
335 * @param[in] handle pointer to package info handle
336 * @param[out] type pointer to hold package type
337 * @return 0 if success, error code(<0) if fail
338 * @retval PMINFO_R_OK success
339 * @retval PMINFO_R_EINVAL invalid argument
340 * @retval PMINFO_R_ERROR internal error
341 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
342 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
343 * @see pkgmgrinfo_pkginfo_get_pkgid()
344 * @see pkgmgrinfo_pkginfo_is_removable()
346 static int get_pkg_type(const char *pkgid)
350 pkgmgrinfo_pkginfo_h handle;
351 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
352 if (ret != PMINFO_R_OK)
354 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
355 if (ret != PMINFO_R_OK) {
356 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
359 printf("pkgtype: %s\n", type);
360 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
365 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
368 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
369 * @brief This API gets the package version from the package ID
371 * @par This API is for package-manager client application
372 * @par Sync (or) Async : Synchronous API
374 * @param[in] handle pointer to package info handle
375 * @param[out] version pointer to hold package version
376 * @return 0 if success, error code(<0) if fail
377 * @retval PMINFO_R_OK success
378 * @retval PMINFO_R_EINVAL invalid argument
379 * @retval PMINFO_R_ERROR internal error
380 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
381 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
382 * @see pkgmgrinfo_pkginfo_get_pkgid()
383 * @see pkgmgrinfo_pkginfo_is_removable()
385 static int get_pkg_version(const char *pkgid)
388 char *version = NULL;
389 pkgmgrinfo_pkginfo_h handle;
390 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
391 if (ret != PMINFO_R_OK)
393 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
394 if (ret != PMINFO_R_OK) {
395 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
398 printf("pkg version: %s\n", version);
399 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
404 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
407 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
408 * @brief This API gets the package install location from the package ID
410 * @par This API is for package-manager client application
411 * @par Sync (or) Async : Synchronous API
413 * @param[in] handle pointer to package info handle
414 * @param[out] location pointer to hold package install location
415 * @return 0 if success, error code(<0) if fail
416 * @retval PMINFO_R_OK success
417 * @retval PMINFO_R_EINVAL invalid argument
418 * @retval PMINFO_R_ERROR internal error
419 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
420 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
421 * @see pkgmgrinfo_pkginfo_get_pkgid()
422 * @see pkgmgrinfo_pkginfo_is_removable()
424 static int get_pkg_install_location(const char *pkgid)
427 pkgmgrinfo_install_location location;
428 pkgmgrinfo_pkginfo_h handle;
429 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
430 if (ret != PMINFO_R_OK)
432 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
433 if (ret != PMINFO_R_OK) {
434 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
437 printf("pkg install location: %d\n", location);
438 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
443 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
446 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
447 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
448 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
449 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
451 * @par This API is for package-manager client application
452 * @par Sync (or) Async : Synchronous API
454 * @param[in] handle pointer to package info handle
455 * @param[out] size pointer to hold package size
456 * @return 0 if success, error code(<0) if fail
457 * @retval PMINFO_R_OK success
458 * @retval PMINFO_R_EINVAL invalid argument
459 * @retval PMINFO_R_ERROR internal error
460 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
461 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
462 * @see pkgmgrinfo_pkginfo_get_pkgid()
463 * @see pkgmgrinfo_pkginfo_is_removable()
465 static int get_pkg_size(const char *pkgid)
469 pkgmgrinfo_pkginfo_h handle;
470 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
471 if (ret != PMINFO_R_OK)
473 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
474 if (ret != PMINFO_R_OK) {
475 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
478 printf("pkgsize: %d\n", size);
479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
484 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
487 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
488 * @brief This API gets the installed package total size on the target.
490 * @par This API is for package-manager client application
491 * @par Sync (or) Async : Synchronous API
493 * @param[in] handle pointer to package info handle
494 * @param[out] size pointer to hold package total size
495 * @return 0 if success, error code(<0) if fail
496 * @retval PMINFO_R_OK success
497 * @retval PMINFO_R_EINVAL invalid argument
498 * @retval PMINFO_R_ERROR internal error
500 static int get_pkg_total_size(const char *pkgid)
504 pkgmgrinfo_pkginfo_h handle;
505 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
506 if (ret != PMINFO_R_OK)
508 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
509 if (ret != PMINFO_R_OK) {
510 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
513 printf("pkg total size: %d\n", size);
514 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
519 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
522 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
523 * @brief This API gets the installed package data size on the target.
525 * @par This API is for package-manager client application
526 * @par Sync (or) Async : Synchronous API
528 * @param[in] handle pointer to package info handle
529 * @param[out] size pointer to hold package data size
530 * @return 0 if success, error code(<0) if fail
531 * @retval PMINFO_R_OK success
532 * @retval PMINFO_R_EINVAL invalid argument
533 * @retval PMINFO_R_ERROR internal error
535 static int get_pkg_data_size(const char *pkgid)
539 pkgmgrinfo_pkginfo_h handle;
540 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
541 if (ret != PMINFO_R_OK)
543 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
544 if (ret != PMINFO_R_OK) {
545 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
548 printf("pkg data size: %d\n", size);
549 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
554 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
557 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
558 * @brief This API gets the package icon from the package ID
560 * @par This API is for package-manager client application
561 * @par Sync (or) Async : Synchronous API
563 * @param[in] handle pointer to package info handle
564 * @param[out] icon pointer to hold package icon
565 * @return 0 if success, error code(<0) if fail
566 * @retval PMINFO_R_OK success
567 * @retval PMINFO_R_EINVAL invalid argument
568 * @retval PMINFO_R_ERROR internal error
569 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
570 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
571 * @see pkgmgrinfo_pkginfo_get_pkgid()
572 * @see pkgmgrinfo_pkginfo_is_removable()
574 static int get_pkg_icon(const char *pkgid)
578 pkgmgrinfo_pkginfo_h handle;
579 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
580 if (ret != PMINFO_R_OK)
582 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
583 if (ret != PMINFO_R_OK) {
584 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 printf("pkg icon: %s\n", icon);
588 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
593 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
596 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
597 * @brief This API gets the package label from the package ID
599 * @par This API is for package-manager client application
600 * @par Sync (or) Async : Synchronous API
602 * @param[in] handle pointer to package info handle
603 * @param[out] label pointer to hold package label
604 * @return 0 if success, error code(<0) if fail
605 * @retval PMINFO_R_OK success
606 * @retval PMINFO_R_EINVAL invalid argument
607 * @retval PMINFO_R_ERROR internal error
608 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
609 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
610 * @see pkgmgrinfo_pkginfo_get_pkgid()
611 * @see pkgmgrinfo_pkginfo_is_removable()
613 static int get_pkg_label(const char *pkgid)
617 pkgmgrinfo_pkginfo_h handle;
618 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
619 if (ret != PMINFO_R_OK)
621 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
622 if (ret != PMINFO_R_OK) {
623 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
626 printf("pkg label: %s\n", label);
627 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
632 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
635 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
636 * @brief This API gets the package description from the package ID
638 * @par This API is for package-manager client application
639 * @par Sync (or) Async : Synchronous API
641 * @param[in] handle pointer to package info handle
642 * @param[out] description pointer to hold package description
643 * @return 0 if success, error code(<0) if fail
644 * @retval PMINFO_R_OK success
645 * @retval PMINFO_R_EINVAL invalid argument
646 * @retval PMINFO_R_ERROR internal error
647 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
648 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
649 * @see pkgmgrinfo_pkginfo_get_pkgid()
650 * @see pkgmgrinfo_pkginfo_is_removable()
652 static int get_pkg_description(const char *pkgid)
655 char *description = NULL;
656 pkgmgrinfo_pkginfo_h handle;
657 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
658 if (ret != PMINFO_R_OK)
660 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
661 if (ret != PMINFO_R_OK) {
662 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
665 printf("pkg description: %s\n", description);
666 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
671 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
674 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
675 * @brief This API gets the package's author name from the package ID
677 * @par This API is for package-manager client application
678 * @par Sync (or) Async : Synchronous API
680 * @param[in] handle pointer to package info handle
681 * @param[out] author_name pointer to hold package author name
682 * @return 0 if success, error code(<0) if fail
683 * @retval PMINFO_R_OK success
684 * @retval PMINFO_R_EINVAL invalid argument
685 * @retval PMINFO_R_ERROR internal error
686 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
687 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
688 * @see pkgmgrinfo_pkginfo_get_pkgid()
689 * @see pkgmgrinfo_pkginfo_is_removable()
691 static int get_pkg_author_name(const char *pkgid)
694 char *author_name = NULL;
695 pkgmgrinfo_pkginfo_h handle;
696 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
697 if (ret != PMINFO_R_OK)
699 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
700 if (ret != PMINFO_R_OK) {
701 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
704 printf("pkg author name: %s\n", author_name);
705 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
710 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
713 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
714 * @brief This API gets the package's author email from the package ID
716 * @par This API is for package-manager client application
717 * @par Sync (or) Async : Synchronous API
719 * @param[in] handle pointer to package info handle
720 * @param[out] author_email pointer to hold package author email
721 * @return 0 if success, error code(<0) if fail
722 * @retval PMINFO_R_OK success
723 * @retval PMINFO_R_EINVAL invalid argument
724 * @retval PMINFO_R_ERROR internal error
725 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
726 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
727 * @see pkgmgrinfo_pkginfo_get_pkgid()
728 * @see pkgmgrinfo_pkginfo_is_removable()
730 static int get_pkg_author_email(const char *pkgid)
733 char *author_email = NULL;
734 pkgmgrinfo_pkginfo_h handle;
735 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
736 if (ret != PMINFO_R_OK)
738 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
739 if (ret != PMINFO_R_OK) {
740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
743 printf("pkg author email: %s\n", author_email);
744 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
749 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
752 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
753 * @brief This API gets the package's author href from the package ID
755 * @par This API is for package-manager client application
756 * @par Sync (or) Async : Synchronous API
758 * @param[in] handle pointer to package info handle
759 * @param[out] author_href pointer to hold package author href
760 * @return 0 if success, error code(<0) if fail
761 * @retval PMINFO_R_OK success
762 * @retval PMINFO_R_EINVAL invalid argument
763 * @retval PMINFO_R_ERROR internal error
764 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
765 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
766 * @see pkgmgrinfo_pkginfo_get_pkgid()
767 * @see pkgmgrinfo_pkginfo_is_removable()
769 static int get_pkg_author_href(const char *pkgid)
772 char *author_href = NULL;
773 pkgmgrinfo_pkginfo_h handle;
774 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
775 if (ret != PMINFO_R_OK)
777 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
778 if (ret != PMINFO_R_OK) {
779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
782 printf("pkg author href: %s\n", author_href);
783 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
788 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
791 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
792 * @brief This API gets the package installed storagae value from the package ID
794 * @par This API is for package-manager client application
795 * @par Sync (or) Async : Synchronous API
797 * @param[in] handle pointer to package info handle
798 * @param[out] storage pointer to hold package installed storage
799 * @return 0 if success, error code(<0) if fail
800 * @retval PMINFO_R_OK success
801 * @retval PMINFO_R_EINVAL invalid argument
802 * @retval PMINFO_R_ERROR internal error
803 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
804 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
805 * @see pkgmgrinfo_pkginfo_get_pkgid()
806 * @see pkgmgrinfo_pkginfo_is_removable()
808 static int get_pkg_installed_storage(const char *pkgid)
811 pkgmgrinfo_installed_storage storage;
812 pkgmgrinfo_pkginfo_h handle;
813 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
814 if (ret != PMINFO_R_OK)
816 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
817 if (ret != PMINFO_R_OK) {
818 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
821 printf("pkg installed storage: %d\n", storage);
822 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
827 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
830 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
831 * @brief This API gets the installed time of package from the package ID
833 * @par This API is for package-manager client application
834 * @par Sync (or) Async : Synchronous API
836 * @param[in] handle pointer to package info handle
837 * @param[out] installed_time pointer to hold installed time of package
838 * @return 0 if success, error code(<0) if fail
839 * @retval PMINFO_R_OK success
840 * @retval PMINFO_R_EINVAL invalid argument
841 * @retval PMINFO_R_ERROR internal error
842 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
843 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
844 * @see pkgmgrinfo_pkginfo_get_pkgid()
845 * @see pkgmgrinfo_pkginfo_is_removable()
847 static int get_pkg_installed_time(const char *pkgid)
850 int installed_time = 0;
851 pkgmgrinfo_pkginfo_h handle;
852 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
853 if (ret != PMINFO_R_OK)
855 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
856 if (ret != PMINFO_R_OK) {
857 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
860 printf("installed_time: %d\n", installed_time);
861 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
866 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
869 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
870 * @brief This API gets the launch mode of package from the package ID
872 * @par This API is for package-manager client application
873 * @par Sync (or) Async : Synchronous API
875 * @param[in] handle pointer to package info handle
876 * @param[out] mode pointer to hold launch mode of package
877 * @return 0 if success, error code(<0) if fail
878 * @retval PMINFO_R_OK success
879 * @retval PMINFO_R_EINVAL invalid argument
880 * @retval PMINFO_R_ERROR internal error
881 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
882 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
883 * @see pkgmgrinfo_pkginfo_get_pkgid()
884 * @see pkgmgrinfo_pkginfo_is_removable()
886 static int get_pkg_launch_mode(const char *pkgid)
889 char *launch_mode = NULL;
890 pkgmgrinfo_pkginfo_h handle;
891 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
892 if (ret != PMINFO_R_OK)
894 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
895 if (ret != PMINFO_R_OK) {
896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
899 printf("launch mode: %s\n", mode);
900 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
905 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
908 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
909 * @brief This API gets the store client id of package from the package ID
911 * @par This API is for package-manager client application
912 * @par Sync (or) Async : Synchronous API
914 * @param[in] handle pointer to package info handle
915 * @param[out] storeclientid pointer to hold store client id of package
916 * @return 0 if success, error code(<0) if fail
917 * @retval PMINFO_R_OK success
918 * @retval PMINFO_R_EINVAL invalid argument
919 * @retval PMINFO_R_ERROR internal error
920 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
921 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
922 * @see pkgmgrinfo_pkginfo_get_pkgid()
923 * @see pkgmgrinfo_pkginfo_is_removable()
925 static int get_pkg_storeclientid(const char *pkgid)
928 char *storeclientid = 0;
929 pkgmgrinfo_pkginfo_h handle;
930 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
931 if (ret != PMINFO_R_OK)
933 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
934 if (ret != PMINFO_R_OK) {
935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
938 printf(store client id: %s\n", storeclientid);
939 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
944 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
947 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
948 * @brief This API gets the main app id of package from the package ID
950 * @par This API is for package-manager client application
951 * @par Sync (or) Async : Synchronous API
953 * @param[in] handle pointer to package info handle
954 * @param[out] mainappid pointer to hold main app id of package
955 * @return 0 if success, error code(<0) if fail
956 * @retval PMINFO_R_OK success
957 * @retval PMINFO_R_EINVAL invalid argument
958 * @retval PMINFO_R_ERROR internal error
959 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
960 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
961 * @see pkgmgrinfo_pkginfo_get_pkgid()
962 * @see pkgmgrinfo_pkginfo_is_removable()
964 static int get_pkg_mainappid(const char *pkgid)
968 pkgmgrinfo_pkginfo_h handle;
969 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
970 if (ret != PMINFO_R_OK)
972 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
973 if (ret != PMINFO_R_OK) {
974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
977 printf(main app id: %s\n", mainappid);
978 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
983 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
986 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
987 * @brief This API gets the url of package from the package ID
989 * @par This API is for package-manager client application
990 * @par Sync (or) Async : Synchronous API
992 * @param[in] handle pointer to package info handle
993 * @param[out] url pointer to hold url of package
994 * @return 0 if success, error code(<0) if fail
995 * @retval PMINFO_R_OK success
996 * @retval PMINFO_R_EINVAL invalid argument
997 * @retval PMINFO_R_ERROR internal error
998 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
999 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1000 * @see pkgmgrinfo_pkginfo_get_pkgid()
1001 * @see pkgmgrinfo_pkginfo_is_removable()
1003 static int get_pkg_url(const char *pkgid)
1007 pkgmgrinfo_pkginfo_h handle;
1008 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1009 if (ret != PMINFO_R_OK)
1011 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1012 if (ret != PMINFO_R_OK) {
1013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1016 printf("url : %s\n", url);
1017 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1022 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1026 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1027 * @brief This API gets the root path of package
1029 * @par Sync (or) Async : Synchronous API
1031 * @param[in] handle pointer to package info handle
1032 * @param[out] path pointer to hold root path of package
1033 * @return 0 if success, error code(<0) if fail
1034 * @retval PMINFO_R_OK success
1035 * @retval PMINFO_R_EINVAL invalid argument
1036 * @retval PMINFO_R_ERROR internal error
1038 static int get_root_path(const char *pkgid)
1042 pkgmgrinfo_pkginfo_h handle;
1043 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1044 if (ret != PMINFO_R_OK)
1047 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1048 if (ret != PMINFO_R_OK) {
1049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1052 printf("path : %s\n", path);
1053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1059 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1063 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1064 * @brief This API gets the csc path of package
1066 * @par Sync (or) Async : Synchronous API
1068 * @param[in] handle pointer to package info handle
1069 * @param[out] path pointer to hold csc path of package
1070 * @return 0 if success, error code(<0) if fail
1071 * @retval PMINFO_R_OK success
1072 * @retval PMINFO_R_EINVAL invalid argument
1073 * @retval PMINFO_R_ERROR internal error
1075 static int get_csc_path(const char *pkgid)
1079 pkgmgrinfo_pkginfo_h handle;
1080 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1081 if (ret != PMINFO_R_OK)
1084 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1085 if (ret != PMINFO_R_OK) {
1086 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1089 printf("path : %s\n", path);
1090 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1096 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1099 * @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)
1100 * @brief This API compare the cert information from given package id
1102 * @par This API is for package-manager client application
1103 * @par Sync (or) Async : Synchronous API
1105 * @param[in] lhs_package_id pointer to first package ID
1106 * @param[in] rhs_package_id pointer to second package ID
1107 * @param[out] compare_result pointer to the compare result.
1108 * @return 0 if success, error code(<0) if fail
1109 * @retval PMINFO_R_OK success
1110 * @retval PMINFO_R_EINVAL invalid argument
1111 * @retval PMINFO_R_ERROR internal error
1113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1114 * @see pkgmgrinfo_pkginfo_get_pkgid()
1115 * @see pkgmgrinfo_pkginfo_is_removable()
1117 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1120 pkgmgrinfo_cert_compare_result_type_e result;
1122 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1123 if (ret != PMINFO_R_OK) {
1126 printf("result: %d\n", result);
1131 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);
1132 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);
1134 * @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)
1135 * @brief This API compare the cert information from given app id
1137 * @par This API is for package-manager client application
1138 * @par Sync (or) Async : Synchronous API
1140 * @param[in] lhs_app_id pointer to first app ID
1141 * @param[in] rhs_app_id pointer to second app ID
1142 * @param[out] compare_result pointer to the compare result.
1143 * @return 0 if success, error code(<0) if fail
1144 * @retval PMINFO_R_OK success
1145 * @retval PMINFO_R_EINVAL invalid argument
1146 * @retval PMINFO_R_ERROR internal error
1148 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1149 * @see pkgmgrinfo_pkginfo_get_pkgid()
1150 * @see pkgmgrinfo_pkginfo_is_removable()
1152 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1155 pkgmgrinfo_cert_compare_result_type_e result;
1157 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1158 if (ret != PMINFO_R_OK) {
1161 printf("result: %d\n", result);
1166 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);
1167 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);
1169 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1170 * @brief This API gets the package 'removable' value from the package ID
1172 * @par This API is for package-manager client application
1173 * @par Sync (or) Async : Synchronous API
1175 * @param[in] handle pointer to package info handle
1176 * @param[out] removable pointer to hold package removable value
1177 * @return 0 if success, error code(<0) if fail
1178 * @retval PMINFO_R_OK success
1179 * @retval PMINFO_R_EINVAL invalid argument
1180 * @retval PMINFO_R_ERROR internal error
1181 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1182 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1183 * @see pkgmgrinfo_pkginfo_get_pkgid()
1184 * @see pkgmgrinfo_pkginfo_is_readonly()
1186 static int get_pkg_removable(const char *pkgid)
1190 pkgmgrinfo_pkginfo_h handle;
1191 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1192 if (ret != PMINFO_R_OK)
1194 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1195 if (ret != PMINFO_R_OK) {
1196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1199 printf("pkg removable: %d\n", removable);
1200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1205 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1208 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1209 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1211 * @par This API is for package-manager client application
1212 * @par Sync (or) Async : Synchronous API
1214 * @param[in] handle pointer to package info handle
1215 * @param[out] movable pointer to hold package movable state
1216 * @return 0 if success, error code(<0) if fail
1217 * @retval PMINFO_R_OK success
1218 * @retval PMINFO_R_EINVAL invalid argument
1219 * @retval PMINFO_R_ERROR internal error
1220 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1221 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1222 * @see pkgmgrinfo_pkginfo_get_pkgid()
1224 static int get_pkg_movable(const char *pkgid)
1228 pkgmgrinfo_pkginfo_h handle;
1229 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1230 if (ret != PMINFO_R_OK)
1232 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1233 if (ret != PMINFO_R_OK) {
1234 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1237 printf("pkg movable: %d\n", movable);
1238 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1243 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1246 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1247 * @brief This API gets the package 'preload' value from the package ID
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] handle pointer to package info handle
1253 * @param[out] preload pointer to hold package preload value
1254 * @return 0 if success, error code(<0) if fail
1255 * @retval PMINFO_R_OK success
1256 * @retval PMINFO_R_EINVAL invalid argument
1257 * @retval PMINFO_R_ERROR internal error
1258 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1259 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1260 * @see pkgmgrinfo_pkginfo_get_pkgid()
1261 * @see pkgmgrinfo_pkginfo_is_readonly()
1263 static int get_pkg_preload(const char *pkgid)
1267 pkgmgrinfo_pkginfo_h handle;
1268 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1269 if (ret != PMINFO_R_OK)
1271 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1272 if (ret != PMINFO_R_OK) {
1273 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1276 printf("pkg preload: %d\n", preload);
1277 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1282 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1285 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1286 * @brief This API gets the value for given handle is system or not
1288 * @par This API is for package-manager client application
1289 * @par Sync (or) Async : Synchronous API
1291 * @param[in] handle pointer to package info handle
1292 * @param[out] system pointer to hold system is or not
1293 * @return 0 if success, error code(<0) if fail
1294 * @retval PMINFO_R_OK success
1295 * @retval PMINFO_R_EINVAL invalid argument
1296 * @retval PMINFO_R_ERROR internal error
1297 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1298 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1299 * @see pkgmgrinfo_pkginfo_get_pkgid()
1300 * @see pkgmgrinfo_pkginfo_is_readonly()
1302 static int get_pkg_system(const char *pkgid)
1305 bool system = false;
1306 pkgmgrinfo_pkginfo_h handle = NULL;
1307 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1308 if (ret != PMINFO_R_OK)
1310 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1311 if (ret != PMINFO_R_OK) {
1312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1315 printf("pkg system: %d\n", system);
1316 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1321 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1324 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1325 * @brief This API gets the package 'readonly' value from the package ID
1327 * @par This API is for package-manager client application
1328 * @par Sync (or) Async : Synchronous API
1330 * @param[in] handle pointer to package info handle
1331 * @param[out] readonly pointer to hold package readonly value
1332 * @return 0 if success, error code(<0) if fail
1333 * @retval PMINFO_R_OK success
1334 * @retval PMINFO_R_EINVAL invalid argument
1335 * @retval PMINFO_R_ERROR internal error
1336 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1337 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1338 * @see pkgmgrinfo_pkginfo_get_pkgid()
1339 * @see pkgmgrinfo_pkginfo_is_removable()
1341 static int get_pkg_readonly(const char *pkgid)
1345 pkgmgrinfo_pkginfo_h handle;
1346 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1347 if (ret != PMINFO_R_OK)
1349 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1350 if (ret != PMINFO_R_OK) {
1351 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1354 printf("pkg readonly: %d\n", readonly);
1355 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1360 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1364 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1365 * @brief This API gets the package 'upate' value from the package ID
1367 * @par This API is for package-manager client application
1368 * @par Sync (or) Async : Synchronous API
1370 * @param[in] handle pointer to package info handle
1371 * @param[out] update pointer to hold package update value
1372 * @return 0 if success, error code(<0) if fail
1373 * @retval PMINFO_R_OK success
1374 * @retval PMINFO_R_EINVAL invalid argument
1375 * @retval PMINFO_R_ERROR internal error
1376 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1377 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1378 * @see pkgmgrinfo_pkginfo_get_pkgid()
1380 static int get_pkg_update(const char *pkgid)
1384 pkgmgrinfo_pkginfo_h handle;
1385 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1386 if (ret != PMINFO_R_OK)
1388 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1389 if (ret != PMINFO_R_OK) {
1390 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1393 printf("pkg update: %d\n", update);
1394 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1399 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1403 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1404 * @brief This API gets the package 'uid' value from the view table of user database
1406 * @par This API is for package-manager client application
1407 * @par Sync (or) Async : Synchronous API
1409 * @param[in] uid uid of the user to determine the database
1410 * @param[in] pkgid id of the current package
1411 * @return 1 if it a global package, 0 else
1414 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1418 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1419 * @brief This API gets the package 'accessible' value from the package ID
1421 * @par This API is for package-manager client application
1422 * @par Sync (or) Async : Synchronous API
1424 * @param[in] handle pointer to package info handle
1425 * @param[out] accessible pointer to hold package accessible value
1426 * @return 0 if success, error code(<0) if fail
1427 * @retval PMINFO_R_OK success
1428 * @retval PMINFO_R_EINVAL invalid argument
1429 * @retval PMINFO_R_ERROR internal error
1430 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1431 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1432 * @see pkgmgrinfo_pkginfo_get_pkgid()
1433 * @see pkgmgrinfo_pkginfo_is_readonly()
1435 static int get_pkg_accessible(const char *pkgid)
1439 pkgmgrinfo_pkginfo_h handle;
1440 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1441 if (ret != PMINFO_R_OK)
1443 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1444 if (ret != PMINFO_R_OK) {
1445 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1448 printf("pkg accessible: %d\n", accessible);
1449 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1457 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1458 * @brief This API destroys the package information handle freeing up all the resources
1460 * @par This API is for package-manager client application
1461 * @par Sync (or) Async : Synchronous API
1463 * @param[in] handle pointer to the package info handle
1464 * @return 0 if success, error code(<0) if fail
1465 * @retval PMINFO_R_OK success
1466 * @retval PMINFO_R_EINVAL invalid argument
1467 * @retval PMINFO_R_ERROR internal error
1468 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1470 * @see pkgmgrinfo_pkginfo_get_pkgid()
1471 * @see pkgmgrinfo_pkginfo_is_removable()
1473 static int get_pkg_type(const char *pkgid)
1477 pkgmgrinfo_pkginfo_h handle;
1478 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1479 if (ret != PMINFO_R_OK)
1481 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1482 if (ret != PMINFO_R_OK) {
1483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1486 printf("pkgtype: %s\n", type);
1487 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1492 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1495 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1496 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1497 The query will search the entire package information collected from the manifest file of all the installed packages
1499 * @par This API is for package-manager client application
1500 * @par Sync (or) Async : Synchronous API
1502 * @param[out] handle pointer to the package info filter handle.
1503 * @return 0 if success, error code(<0) if fail
1504 * @retval PMINFO_R_OK success
1505 * @retval PMINFO_R_EINVAL invalid argument
1506 * @retval PMINFO_R_ERROR internal error
1508 * @post pkgmgrinfo_pkginfo_filter_destroy()
1509 * @see pkgmgrinfo_pkginfo_filter_count()
1510 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1512 static int get_rpm_pkg_count()
1516 pkgmgrinfo_pkginfo_filter_h handle;
1517 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1518 if (ret != PMINFO_R_OK)
1520 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1521 if (ret != PMINFO_R_OK) {
1522 pkgmgrinfo_pkginfo_filter_destroy(handle);
1525 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1526 if (ret != PMINFO_R_OK) {
1527 pkgmgrinfo_pkginfo_filter_destroy(handle);
1530 printf("No of rpm pkgs: %d\n", count);
1531 pkgmgrinfo_pkginfo_filter_destroy(handle);
1536 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1539 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1540 * @brief This API destroys the package information filter handle freeing up all the resources
1542 * @par This API is for package-manager client application
1543 * @par Sync (or) Async : Synchronous API
1545 * @param[in] handle pointer to the package info filter handle.
1546 * @return 0 if success, error code(<0) if fail
1547 * @retval PMINFO_R_OK success
1548 * @retval PMINFO_R_EINVAL invalid argument
1549 * @retval PMINFO_R_ERROR internal error
1550 * @pre pkgmgrinfo_pkginfo_filter_create()
1552 * @see pkgmgrinfo_pkginfo_filter_count()
1553 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1555 static int get_rpm_pkg_count()
1559 pkgmgrinfo_pkginfo_filter_h handle;
1560 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1561 if (ret != PMINFO_R_OK)
1563 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1564 if (ret != PMINFO_R_OK) {
1565 pkgmgrinfo_pkginfo_filter_destroy(handle);
1568 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1569 if (ret != PMINFO_R_OK) {
1570 pkgmgrinfo_pkginfo_filter_destroy(handle);
1573 printf("No of rpm pkgs: %d\n", count);
1574 pkgmgrinfo_pkginfo_filter_destroy(handle);
1579 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1582 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1583 * @brief This API adds a boolean filter property to the filter handle
1585 * @par This API is for package-manager client application
1586 * @par Sync (or) Async : Synchronous API
1588 * @param[in] handle pointer to the package info filter handle.
1589 * @param[in] property boolean property name.
1590 * @param[in] value value corresponding to the property.
1591 * @return 0 if success, error code(<0) if fail
1592 * @retval PMINFO_R_OK success
1593 * @retval PMINFO_R_EINVAL invalid argument
1594 * @retval PMINFO_R_ERROR internal error
1595 * @pre pkgmgrinfo_pkginfo_filter_create()
1596 * @post pkgmgrinfo_pkginfo_filter_destroy()
1597 * @see pkgmgrinfo_pkginfo_filter_count()
1598 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1600 static int get_preload_pkg_count()
1604 pkgmgrinfo_pkginfo_filter_h handle;
1605 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1606 if (ret != PMINFO_R_OK)
1608 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1609 if (ret != PMINFO_R_OK) {
1610 pkgmgrinfo_pkginfo_filter_destroy(handle);
1613 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1614 if (ret != PMINFO_R_OK) {
1615 pkgmgrinfo_pkginfo_filter_destroy(handle);
1618 printf("No of preload pkgs: %d\n", count);
1619 pkgmgrinfo_pkginfo_filter_destroy(handle);
1624 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1625 const char *property, const bool value);
1628 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1629 * @brief This API adds an integer filter property to the filter handle
1631 * @par This API is for package-manager client application
1632 * @par Sync (or) Async : Synchronous API
1634 * @param[in] handle pointer to the package info filter handle.
1635 * @param[in] property integer property name.
1636 * @param[in] value value corresponding to the property.
1637 * @return 0 if success, error code(<0) if fail
1638 * @retval PMINFO_R_OK success
1639 * @retval PMINFO_R_EINVAL invalid argument
1640 * @retval PMINFO_R_ERROR internal error
1641 * @pre pkgmgrinfo_pkginfo_filter_create()
1642 * @post pkgmgrinfo_pkginfo_filter_destroy()
1643 * @see pkgmgrinfo_pkginfo_filter_count()
1644 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1646 static int get_pkg_count()
1650 pkgmgrinfo_pkginfo_filter_h handle;
1651 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1652 if (ret != PMINFO_R_OK)
1654 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1655 if (ret != PMINFO_R_OK) {
1656 pkgmgrinfo_pkginfo_filter_destroy(handle);
1659 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1660 if (ret != PMINFO_R_OK) {
1661 pkgmgrinfo_pkginfo_filter_destroy(handle);
1664 printf("No of preload pkgs: %d\n", count);
1665 pkgmgrinfo_pkginfo_filter_destroy(handle);
1670 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1671 const char *property, const int value);
1674 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1675 * @brief This API adds a string filter property to the filter handle
1677 * @par This API is for package-manager client application
1678 * @par Sync (or) Async : Synchronous API
1680 * @param[in] handle pointer to the package info filter handle.
1681 * @param[in] property string property name.
1682 * @param[in] value value corresponding to the property.
1683 * @return 0 if success, error code(<0) if fail
1684 * @retval PMINFO_R_OK success
1685 * @retval PMINFO_R_EINVAL invalid argument
1686 * @retval PMINFO_R_ERROR internal error
1687 * @pre pkgmgrinfo_pkginfo_filter_create()
1688 * @post pkgmgrinfo_pkginfo_filter_destroy()
1689 * @see pkgmgrinfo_pkginfo_filter_count()
1690 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1692 static int get_rpm_pkg_count()
1696 pkgmgrinfo_pkginfo_filter_h handle;
1697 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1698 if (ret != PMINFO_R_OK)
1700 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1701 if (ret != PMINFO_R_OK) {
1702 pkgmgrinfo_pkginfo_filter_destroy(handle);
1705 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1706 if (ret != PMINFO_R_OK) {
1707 pkgmgrinfo_pkginfo_filter_destroy(handle);
1710 printf("No of rpm pkgs: %d\n", count);
1711 pkgmgrinfo_pkginfo_filter_destroy(handle);
1716 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1717 const char *property, const char *value);
1720 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1721 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1723 * @par This API is for package-manager client application
1724 * @par Sync (or) Async : Synchronous API
1726 * @param[in] handle pointer to the package info filter handle.
1727 * @param[in] pkg_cb callback function.
1728 * @param[in] user_data user data to be passed to the callback function
1729 * @return 0 if success, error code(<0) if fail
1730 * @retval PMINFO_R_OK success
1731 * @retval PMINFO_R_EINVAL invalid argument
1732 * @retval PMINFO_R_ERROR internal error
1733 * @pre pkgmgrinfo_pkginfo_filter_create()
1734 * @post pkgmgrinfo_pkginfo_filter_destroy()
1735 * @see pkgmgrinfo_pkginfo_filter_count()
1737 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1740 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1741 printf("pkg id : %s\n", pkgid);
1745 static int get_rpm_pkg_list()
1748 pkgmgrinfo_pkginfo_filter_h handle;
1749 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1750 if (ret != PMINFO_R_OK)
1752 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1753 if (ret != PMINFO_R_OK) {
1754 pkgmgrinfo_pkginfo_filter_destroy(handle);
1757 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1758 if (ret != PMINFO_R_OK) {
1759 pkgmgrinfo_pkginfo_filter_destroy(handle);
1762 pkgmgrinfo_pkginfo_filter_destroy(handle);
1767 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1768 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1769 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1770 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1773 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1774 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1775 * @brief This API counts the package that satisfy the filter conditions
1777 * @par This API is for package-manager client application
1778 * @par Sync (or) Async : Synchronous API
1780 * @param[in] handle pointer to the package info filter handle.
1781 * @param[in] count pointer to store the count value.
1782 * @param[in] uid the addressee user id of the instruction
1783 * @return 0 if success, error code(<0) if fail
1784 * @retval PMINFO_R_OK success
1785 * @retval PMINFO_R_EINVAL invalid argument
1786 * @retval PMINFO_R_ERROR internal error
1787 * @pre pkgmgrinfo_pkginfo_filter_create()
1788 * @post pkgmgrinfo_pkginfo_filter_destroy()
1789 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1791 static int get_rpm_pkg_count()
1795 pkgmgrinfo_pkginfo_filter_h handle;
1796 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1797 if (ret != PMINFO_R_OK)
1799 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1800 if (ret != PMINFO_R_OK) {
1801 pkgmgrinfo_pkginfo_filter_destroy(handle);
1804 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1805 if (ret != PMINFO_R_OK) {
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1809 printf("No of rpm pkgs: %d\n", count);
1810 pkgmgrinfo_pkginfo_filter_destroy(handle);
1815 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1816 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1818 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1819 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1820 * @brief This API gets the list of privilege for a particular package
1822 * @par This API is for package-manager client application
1823 * @par Sync (or) Async : Synchronous API
1824 * @param[in] handle pointer to the package info handle.
1825 * @param[in] privilege_func callback function for list
1826 * @param[in] user_data user data to be passed to callback function
1827 * @return 0 if success, error code(<0) if fail
1828 * @retval PMINFO_R_OK success
1829 * @retval PMINFO_R_EINVAL invalid argument
1830 * @retval PMINFO_R_ERROR internal error
1831 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1832 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1834 int privilege_func(const char *name, void *user_data)
1836 if (strcmp(name, (char *)user_data) == 0)
1842 static int list_privilege(const char *package, char *privilege)
1845 pkgmgrinfo_pkginfo_h handle;
1846 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1847 if (ret != PMINFO_R_OK)
1849 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1850 if (ret != PMINFO_R_OK) {
1851 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1854 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1859 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1860 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1862 /* TODO: add doxygen comment here */
1863 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1864 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1865 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1866 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1867 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1868 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1869 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1872 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1873 pkgmgrinfo_app_list_cb app_func, void *user_data)
1874 * @brief This API gets list of installed applications for a particular package
1876 * @par This API is for package-manager client application
1877 * @par Sync (or) Async : Synchronous API
1878 * @param[in] handle package info handle
1879 * @param[in] component application component
1880 * @param[in] app_func iteration function for list
1881 * @param[in] user_data user data to be passed to callback function
1882 * @return 0 if success, error code(<0) if fail
1883 * @retval PMINFO_R_OK success
1884 * @retval PMINFO_R_EINVAL invalid argument
1885 * @retval PMINFO_R_ERROR internal error
1886 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1887 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1889 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1892 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1893 printf("appid : %s\n", appid);
1897 static int list_apps(const char *pkgid)
1900 pkgmgrinfo_pkginfo_h handle;
1901 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1902 if (ret != PMINFO_R_OK)
1904 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1905 if (ret != PMINFO_R_OK) {
1906 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1909 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1914 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1915 pkgmgrinfo_app_list_cb app_func, void *user_data);
1916 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1917 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
1919 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1920 * @brief This API gets list of installed applications from all packages with minimum informaion.
1922 * @par This API is for package-manager client application
1923 * @par Sync (or) Async : Synchronous API
1924 * @param[in] app_func iteration function for list
1925 * @param[in] user_data user data to be passed to callback function
1926 * @return 0 if success, error code(<0) if fail
1927 * @retval PMINFO_R_OK success
1928 * @retval PMINFO_R_EINVAL invalid argument
1929 * @retval PMINFO_R_ERROR internal error
1933 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1935 char *pkgid1 = NULL;
1936 char *pkgid2 = NULL;
1937 pkgid1 = (char *)user_data;
1938 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1939 if (strcmp(pkgid1, pkgid2) == 0) {
1946 static int list_apps()
1949 char *name = "helloworld";
1950 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
1951 if (ret != PMINFO_R_OK) {
1958 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1959 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
1961 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1962 * @brief This API gets list of installed applications from all packages.
1964 * @par This API is for package-manager client application
1965 * @par Sync (or) Async : Synchronous API
1966 * @param[in] app_func iteration function for list
1967 * @param[in] user_data user data to be passed to callback function
1968 * @return 0 if success, error code(<0) if fail
1969 * @retval PMINFO_R_OK success
1970 * @retval PMINFO_R_EINVAL invalid argument
1971 * @retval PMINFO_R_ERROR internal error
1975 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1977 char *pkgid1 = NULL;
1978 char *pkgid2 = NULL;
1979 pkgid1 = (char *)user_data;
1980 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1981 if (strcmp(pkgid1, pkgid2) == 0) {
1988 static int list_apps()
1991 char *name = "helloworld";
1992 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1993 if (ret != PMINFO_R_OK) {
2000 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2001 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2004 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2005 * @brief This API creates the application information handle from db
2007 * @par This API is for package-manager client application
2008 * @par Sync (or) Async : Synchronous API
2010 * @param[in] appid pointer to appid
2011 * @param[out] handle pointer to the application info handle.
2012 * @return 0 if success, error code(<0) if fail
2013 * @retval PMINFO_R_OK success
2014 * @retval PMINFO_R_EINVAL invalid argument
2015 * @retval PMINFO_R_ERROR internal error
2017 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2018 * @see pkgmgrinfo_appinfo_get_pkgid()
2019 * @see pkgmgrinfo_appinfo_is_multiple()
2021 static int get_app_type(const char *appid)
2025 pkgmgrinfo_appinfo_h handle;
2026 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2027 if (ret != PMINFO_R_OK)
2029 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2030 if (ret != PMINFO_R_OK) {
2031 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2034 printf("apptype: %s\n", type);
2035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2040 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2041 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2043 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2044 * @brief This API gets the application ID
2046 * @par This API is for package-manager client application
2047 * @par Sync (or) Async : Synchronous API
2049 * @param[in] handle pointer to the application info handle.
2050 * @param[out] appid pointer to hold appid
2051 * @return 0 if success, error code(<0) if fail
2052 * @retval PMINFO_R_OK success
2053 * @retval PMINFO_R_EINVAL invalid argument
2054 * @retval PMINFO_R_ERROR internal error
2055 * @pre pkgmgrinfo_appinfo_get_appinfo()
2056 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2057 * @see pkgmgrinfo_appinfo_get_pkgid()
2058 * @see pkgmgrinfo_appinfo_is_multiple()
2060 static int get_app_id(const char *appid)
2063 char *app_id = NULL;
2064 pkgmgrinfo_appinfo_h handle;
2065 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2066 if (ret != PMINFO_R_OK)
2068 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2069 if (ret != PMINFO_R_OK) {
2070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2073 printf("app id: %s\n", app_id);
2074 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2079 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2082 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2083 * @brief This API gets the package name of the application
2085 * @par This API is for package-manager client application
2086 * @par Sync (or) Async : Synchronous API
2088 * @param[in] handle pointer to the application info handle.
2089 * @param[out] pkg_name pointer to hold package name
2090 * @return 0 if success, error code(<0) if fail
2091 * @retval PMINFO_R_OK success
2092 * @retval PMINFO_R_EINVAL invalid argument
2093 * @retval PMINFO_R_ERROR internal error
2094 * @pre pkgmgrinfo_appinfo_get_appinfo()
2095 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2096 * @see pkgmgrinfo_appinfo_get_appid()
2097 * @see pkgmgrinfo_appinfo_is_multiple()
2099 static int get_app_pkgname(const char *appid)
2102 char *pkgname = NULL;
2103 pkgmgrinfo_appinfo_h handle;
2104 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2105 if (ret != PMINFO_R_OK)
2107 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2108 if (ret != PMINFO_R_OK) {
2109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2112 printf("pkg name: %s\n", pkgname);
2113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2118 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2121 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2122 * @brief This API gets the package id of the application
2124 * @par This API is for package-manager client application
2125 * @par Sync (or) Async : Synchronous API
2127 * @param[in] handle pointer to the application info handle.
2128 * @param[out] pkgid pointer to hold package id
2129 * @return 0 if success, error code(<0) if fail
2130 * @retval PMINFO_R_OK success
2131 * @retval PMINFO_R_EINVAL invalid argument
2132 * @retval PMINFO_R_ERROR internal error
2133 * @pre pkgmgrinfo_appinfo_get_appinfo()
2134 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2135 * @see pkgmgrinfo_appinfo_get_appid()
2136 * @see pkgmgrinfo_appinfo_is_multiple()
2138 static int get_app_pkgid(const char *appid)
2142 pkgmgrinfo_appinfo_h handle;
2143 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2144 if (ret != PMINFO_R_OK)
2146 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2147 if (ret != PMINFO_R_OK) {
2148 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2151 printf("pkg id: %s\n", pkgid);
2152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2157 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2160 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2161 * @brief This API gets the executable name of the application
2163 * @par This API is for package-manager client application
2164 * @par Sync (or) Async : Synchronous API
2166 * @param[in] handle pointer to the application info handle.
2167 * @param[out] exec pointer to hold app exec name
2168 * @return 0 if success, error code(<0) if fail
2169 * @retval PMINFO_R_OK success
2170 * @retval PMINFO_R_EINVAL invalid argument
2171 * @retval PMINFO_R_ERROR internal error
2172 * @pre pkgmgrinfo_appinfo_get_appinfo()
2173 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2174 * @see pkgmgrinfo_appinfo_get_appid()
2175 * @see pkgmgrinfo_appinfo_is_multiple()
2177 static int get_app_exec(const char *appid)
2181 pkgmgrinfo_appinfo_h handle;
2182 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2183 if (ret != PMINFO_R_OK)
2185 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2186 if (ret != PMINFO_R_OK) {
2187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2190 printf("exec name: %s\n", exec);
2191 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2196 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2199 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2200 * @brief This API gets the icon name of the application
2202 * @par This API is for package-manager client application
2203 * @par Sync (or) Async : Synchronous API
2205 * @param[in] handle pointer to the application info handle.
2206 * @param[out] icon pointer to hold app icon name
2207 * @return 0 if success, error code(<0) if fail
2208 * @retval PMINFO_R_OK success
2209 * @retval PMINFO_R_EINVAL invalid argument
2210 * @retval PMINFO_R_ERROR internal error
2211 * @pre pkgmgrinfo_appinfo_get_appinfo()
2212 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2213 * @see pkgmgrinfo_appinfo_get_appid()
2214 * @see pkgmgrinfo_appinfo_is_multiple()
2216 static int get_app_icon(const char *appid)
2220 pkgmgrinfo_appinfo_h handle;
2221 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2222 if (ret != PMINFO_R_OK)
2224 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2225 if (ret != PMINFO_R_OK) {
2226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2229 printf("icon name: %s\n", icon);
2230 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2235 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2238 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2239 * @brief This API gets the label of the application
2241 * @par This API is for package-manager client application
2242 * @par Sync (or) Async : Synchronous API
2244 * @param[in] handle pointer to the application info handle.
2245 * @param[out] label pointer to hold app label
2246 * @return 0 if success, error code(<0) if fail
2247 * @retval PMINFO_R_OK success
2248 * @retval PMINFO_R_EINVAL invalid argument
2249 * @retval PMINFO_R_ERROR internal error
2250 * @pre pkgmgrinfo_appinfo_get_appinfo()
2251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2252 * @see pkgmgrinfo_appinfo_get_appid()
2253 * @see pkgmgrinfo_appinfo_is_multiple()
2255 static int get_app_label(const char *appid)
2259 pkgmgrinfo_appinfo_h handle;
2260 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2261 if (ret != PMINFO_R_OK)
2263 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2264 if (ret != PMINFO_R_OK) {
2265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2268 printf("label : %s\n", label);
2269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2274 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2277 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2278 * @brief This API gets exactly matched label by given appid and locale
2280 * @par This API is for package-manager client application
2281 * @par Sync (or) Async : Synchronous API
2283 * @param[in] appid pointer to appid
2284 * @param[in] locale pointer to locale
2285 * @param[out] label pointer to hold app label
2286 * @return 0 if success, error code(<0) if fail
2287 * @retval PMINFO_R_OK success
2288 * @retval PMINFO_R_EINVAL invalid argument
2289 * @retval PMINFO_R_ERROR internal error
2291 static int get_localed_label(const char *appid, const char *locale)
2296 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2297 if (ret != PMINFO_R_OK)
2300 printf("localed label: %s\n", label);
2308 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2309 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2312 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2313 * @brief This API gets the component of the application
2315 * @par This API is for package-manager client application
2316 * @par Sync (or) Async : Synchronous API
2318 * @param[in] handle pointer to the application info handle.
2319 * @param[out] component pointer to hold app component
2320 * @return 0 if success, error code(<0) if fail
2321 * @retval PMINFO_R_OK success
2322 * @retval PMINFO_R_EINVAL invalid argument
2323 * @retval PMINFO_R_ERROR internal error
2324 * @pre pkgmgrinfo_appinfo_get_appinfo()
2325 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2326 * @see pkgmgrinfo_appinfo_get_appid()
2327 * @see pkgmgrinfo_appinfo_is_multiple()
2329 static int get_app_component(const char *appid)
2332 pkgmgrinfo_app_component component;
2333 pkgmgrinfo_appinfo_h handle;
2334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2335 if (ret != PMINFO_R_OK)
2337 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2338 if (ret != PMINFO_R_OK) {
2339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2342 printf("component : %s\n", component);
2343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2348 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2351 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2352 * @brief This API gets the apptype of the application
2354 * @par This API is for package-manager client application
2355 * @par Sync (or) Async : Synchronous API
2357 * @param[in] handle pointer to the application info handle.
2358 * @param[out] app_type pointer to hold apptype
2359 * @return 0 if success, error code(<0) if fail
2360 * @retval PMINFO_R_OK success
2361 * @retval PMINFO_R_EINVAL invalid argument
2362 * @retval PMINFO_R_ERROR internal error
2363 * @pre pkgmgrinfo_appinfo_get_appinfo()
2364 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2365 * @see pkgmgrinfo_appinfo_get_appid()
2366 * @see pkgmgrinfo_appinfo_is_multiple()
2368 static int get_app_type(const char *appid)
2371 char *apptype = NULL;
2372 pkgmgrinfo_appinfo_h handle;
2373 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2374 if (ret != PMINFO_R_OK)
2376 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2377 if (ret != PMINFO_R_OK) {
2378 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2381 printf("apptype : %s\n", apptype);
2382 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2387 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2390 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2391 int *operation_count, char ***operation)
2392 * @brief This API gets the list of operation of the application
2394 * @par This API is for package-manager client application
2395 * @par Sync (or) Async : Synchronous API
2397 * @param[in] handle pointer to the appcontrol handle.
2398 * @param[out] operation_count pointer to hold number of operations
2399 * @param[out] operation pointer to hold list of operations
2400 * @return 0 if success, error code(<0) if fail
2401 * @retval PMINFO_R_OK success
2402 * @retval PMINFO_R_EINVAL invalid argument
2403 * @retval PMINFO_R_ERROR internal error
2404 * @pre pkgmgrinfo_appinfo_get_appinfo()
2405 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2406 * @see pkgmgrinfo_appinfo_get_uri()
2407 * @see pkgmgrinfo_appinfo_get_mime()
2409 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2414 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2415 for (i = 0; i < oc; i++) {
2416 if (strcmp(operation[i], (char *)user_data) == 0)
2423 static int check_operation(const char *appid, char *operation)
2426 pkgmgrinfo_appinfo_h handle;
2427 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2428 if (ret != PMINFO_R_OK)
2430 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2431 if (ret != PMINFO_R_OK) {
2432 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2440 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2441 int *operation_count, char ***operation);
2444 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2445 int *uri_count, char ***uri)
2446 * @brief This API gets the list of uri of the application
2448 * @par This API is for package-manager client application
2449 * @par Sync (or) Async : Synchronous API
2451 * @param[in] handle pointer to the appcontrol handle.
2452 * @param[out] uri_count pointer to hold number of uris
2453 * @param[out] uri pointer to hold list of uris
2454 * @return 0 if success, error code(<0) if fail
2455 * @retval PMINFO_R_OK success
2456 * @retval PMINFO_R_EINVAL invalid argument
2457 * @retval PMINFO_R_ERROR internal error
2458 * @pre pkgmgrinfo_appinfo_get_appinfo()
2459 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2460 * @see pkgmgrinfo_appinfo_get_operation()
2461 * @see pkgmgrinfo_appinfo_get_mime()
2463 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2468 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2469 for (i = 0; i < uc; i++) {
2470 if (strcmp(uri[i], (char *)user_data) == 0)
2477 static int check_uri(const char *appid, char *uri)
2480 pkgmgrinfo_appinfo_h handle;
2481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2482 if (ret != PMINFO_R_OK)
2484 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2485 if (ret != PMINFO_R_OK) {
2486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2489 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2494 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2495 int *uri_count, char ***uri);
2498 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2499 int *mime_count, char ***mime)
2500 * @brief This API gets the list of mime of the application
2502 * @par This API is for package-manager client application
2503 * @par Sync (or) Async : Synchronous API
2505 * @param[in] handle pointer to the appcontrol handle.
2506 * @param[out] mime_count pointer to hold number of mimes
2507 * @param[out] mime pointer to hold list of mimes
2508 * @return 0 if success, error code(<0) if fail
2509 * @retval PMINFO_R_OK success
2510 * @retval PMINFO_R_EINVAL invalid argument
2511 * @retval PMINFO_R_ERROR internal error
2512 * @pre pkgmgrinfo_appinfo_get_appinfo()
2513 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2514 * @see pkgmgrinfo_appinfo_get_uri()
2515 * @see pkgmgrinfo_appinfo_get_operation()
2517 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2522 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2523 for (i = 0; i < mc; i++) {
2524 if (strcmp(mime[i], (char *)user_data) == 0)
2531 static int check_mime(const char *appid, char *mime)
2534 pkgmgrinfo_appinfo_h handle;
2535 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2536 if (ret != PMINFO_R_OK)
2538 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2539 if (ret != PMINFO_R_OK) {
2540 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2548 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2549 int *mime_count, char ***mime);
2552 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2553 int *subapp_count, char ***subapp)
2554 * @brief This API gets the list of subapp of the application
2556 * @par This API is for package-manager client application
2557 * @par Sync (or) Async : Synchronous API
2559 * @param[in] handle pointer to the appcontrol handle.
2560 * @param[out] subapp_count pointer to hold number of subapp
2561 * @param[out] subapp pointer to hold list of subapp
2562 * @return 0 if success, error code(<0) if fail
2563 * @retval PMINFO_R_OK success
2564 * @retval PMINFO_R_EINVAL invalid argument
2565 * @retval PMINFO_R_ERROR internal error
2566 * @pre pkgmgrinfo_appinfo_get_appinfo()
2567 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2568 * @see pkgmgrinfo_appinfo_get_uri()
2569 * @see pkgmgrinfo_appinfo_get_operation()
2571 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2575 char **subapp = NULL;
2576 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2577 for (i = 0; i < sc; i++) {
2578 if (strcmp(subapp[i], (char *)user_data) == 0)
2585 static int check_subapp(const char *appid, char *subapp)
2588 pkgmgrinfo_appinfo_h handle = NULL;
2589 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2590 if (ret != PMINFO_R_OK)
2592 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2593 if (ret != PMINFO_R_OK) {
2594 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2602 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2603 int *subapp_count, char ***subapp);
2606 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2607 * @brief This API gets the notification icon of the application
2609 * @par This API is for package-manager client application
2610 * @par Sync (or) Async : Synchronous API
2612 * @param[in] handle pointer to the application info handle.
2613 * @param[out] path pointer to hold notification icon
2614 * @return 0 if success, error code(<0) if fail
2615 * @retval PMINFO_R_OK success
2616 * @retval PMINFO_R_EINVAL invalid argument
2617 * @retval PMINFO_R_ERROR internal error
2618 * @pre pkgmgrinfo_appinfo_get_appinfo()
2619 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2620 * @see pkgmgrinfo_appinfo_get_appid()
2621 * @see pkgmgrinfo_appinfo_is_multiple()
2623 static int get_app_notification_icon(const char *appid)
2626 char *notification_icon = NULL;
2627 pkgmgrinfo_appinfo_h handle;
2628 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2629 if (ret != PMINFO_R_OK)
2631 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2632 if (ret != PMINFO_R_OK) {
2633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2636 printf("notification icon : %s\n", notification_icon);
2637 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2642 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2645 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2646 * @brief This API gets the setting icon of the application
2648 * @par This API is for package-manager client application
2649 * @par Sync (or) Async : Synchronous API
2651 * @param[in] handle pointer to the application info handle.
2652 * @param[out] path pointer to hold setting icon
2653 * @return 0 if success, error code(<0) if fail
2654 * @retval PMINFO_R_OK success
2655 * @retval PMINFO_R_EINVAL invalid argument
2656 * @retval PMINFO_R_ERROR internal error
2657 * @pre pkgmgrinfo_appinfo_get_appinfo()
2658 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2659 * @see pkgmgrinfo_appinfo_get_appid()
2660 * @see pkgmgrinfo_appinfo_is_multiple()
2662 static int get_app_setting_icon(const char *appid)
2665 char *setting_icon = NULL;
2666 pkgmgrinfo_appinfo_h handle;
2667 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2668 if (ret != PMINFO_R_OK)
2670 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2671 if (ret != PMINFO_R_OK) {
2672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2675 printf("setting icon : %s\n", setting_icon);
2676 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2681 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2684 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2685 * @brief This API gets the type of recent image on app-tray
2687 * @par This API is for package-manager client application
2688 * @par Sync (or) Async : Synchronous API
2690 * @param[in] handle pointer to the application info handle.
2691 * @param[out] type pointer to hold image type
2692 * @return 0 if success, error code(<0) if fail
2693 * @retval PMINFO_R_OK success
2694 * @retval PMINFO_R_EINVAL invalid argument
2695 * @retval PMINFO_R_ERROR internal error
2696 * @pre pkgmgrinfo_appinfo_get_appinfo()
2697 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2698 * @see pkgmgrinfo_appinfo_get_appid()
2699 * @see pkgmgrinfo_appinfo_is_multiple()
2701 static int get_app_recent_image_type(const char *appid)
2704 pkgmgrinfo_app_recentimage type;
2705 pkgmgrinfo_appinfo_h handle;
2706 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2707 if (ret != PMINFO_R_OK)
2709 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2710 if (ret != PMINFO_R_OK) {
2711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2714 printf("recent image type: %d\n", type);
2715 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2720 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2724 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2725 * @brief This API gets the preview image of application
2727 * @par Sync (or) Async : Synchronous API
2729 * @param[in] handle pointer to the application info handle.
2730 * @param[out] preview_img pointer to hold preview image path
2731 * @return 0 if success, error code(<0) if fail
2732 * @retval PMINFO_R_OK success
2733 * @retval PMINFO_R_EINVAL invalid argument
2734 * @retval PMINFO_R_ERROR internal error
2735 * @pre pkgmgrinfo_appinfo_get_appinfo()
2736 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2737 * @see pkgmgrinfo_appinfo_get_appid()
2739 static int get_app_previewimage(const char *appid)
2742 char *preview = NULL;
2743 pkgmgrinfo_appinfo_h handle = NULL;
2744 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2745 if (ret != PMINFO_R_OK)
2747 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2748 if (ret != PMINFO_R_OK) {
2749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2752 printf("preview image path : %s\n", preview);
2753 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2758 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2762 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2763 * @brief This API gets the package permission type of the application
2765 * @par This API is for package-manager client application
2766 * @par Sync (or) Async : Synchronous API
2768 * @param[in] handle pointer to the application info handle.
2769 * @param[out] permission pointer to hold package permission
2770 * @return 0 if success, error code(<0) if fail
2771 * @retval PMINFO_R_OK success
2772 * @retval PMINFO_R_EINVAL invalid argument
2773 * @retval PMINFO_R_ERROR internal error
2774 * @pre pkgmgrinfo_appinfo_get_appinfo()
2775 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2776 * @see pkgmgrinfo_appinfo_get_appid()
2778 static int get_app_permission(const char *appid)
2781 pkgmgrinfo_permission_type permission = 0;
2782 pkgmgrinfo_appinfo_h handle;
2784 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2785 if (ret != PMINFO_R_OK)
2787 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2788 if (ret != PMINFO_R_OK) {
2789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2792 printf("permission type: %d\n", permission);
2793 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2798 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2801 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2802 * @brief This API gets the component_type
2804 * @par This API is for package-manager client application
2805 * @par Sync (or) Async : Synchronous API
2807 * @param[in] handle pointer to the application info handle.
2808 * @param[out] component_type pointer to hold component_type
2809 * @return 0 if success, error code(<0) if fail
2810 * @retval PMINFO_R_OK success
2811 * @retval PMINFO_R_EINVAL invalid argument
2812 * @retval PMINFO_R_ERROR internal error
2813 * @pre pkgmgrinfo_appinfo_get_appinfo()
2814 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2815 * @see pkgmgrinfo_appinfo_get_pkgid()
2816 * @see pkgmgrinfo_appinfo_is_multiple()
2818 static int get_component_type(const char *appid)
2821 char *component_type = NULL;
2822 pkgmgrinfo_appinfo_h handle;
2823 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2824 if (ret != PMINFO_R_OK)
2826 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2827 if (ret != PMINFO_R_OK) {
2828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2831 printf("component_type: %s\n", component_type);
2832 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2840 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2841 * @brief This API gets the application 'hwacceleration' value from the app ID
2843 * @par This API is for package-manager client application
2844 * @par Sync (or) Async : Synchronous API
2846 * @param[in] handle pointer to application info handle
2847 * @param[out] hwacceleration pointer to hold package hwacceleration value
2848 * @return 0 if success, error code(<0) if fail
2849 * @retval PMINFO_R_OK success
2850 * @retval PMINFO_R_EINVAL invalid argument
2851 * @retval PMINFO_R_ERROR internal error
2852 * @pre pkgmgrinfo_appinfo_get_appinfo()
2853 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2854 * @see pkgmgrinfo_appinfo_get_appid()
2855 * @see pkgmgrinfo_appinfo_is_multiple()
2857 static int get_app_hwacceleration(const char *appid)
2860 pkgmgrinfo_app_hwacceleration hwacceleration;
2861 pkgmgrinfo_appinfo_h handle;
2862 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2863 if (ret != PMINFO_R_OK)
2865 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2866 if (ret != PMINFO_R_OK) {
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2870 printf("app hwacceleration: %d\n", hwacceleration);
2871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2879 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
2880 * @brief This API gets the application 'screenreader' value from the app ID
2882 * @par This API is for package-manager client application
2883 * @par Sync (or) Async : Synchronous API
2885 * @param[in] handle pointer to application info handle
2886 * @param[out] screenreader pointer to hold package accessibility value
2887 * @return 0 if success, error code(<0) if fail
2888 * @retval PMINFO_R_OK success
2889 * @retval PMINFO_R_EINVAL invalid argument
2890 * @retval PMINFO_R_ERROR internal error
2891 * @pre pkgmgrinfo_appinfo_get_appinfo()
2892 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2893 * @see pkgmgrinfo_appinfo_get_appid()
2894 * @see pkgmgrinfo_appinfo_is_multiple()
2896 static int get_app_screenreader(const char *appid)
2899 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
2900 pkgmgrinfo_appinfo_h handle = NULL;
2901 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2902 if (ret != PMINFO_R_OK)
2904 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
2905 if (ret != PMINFO_R_OK) {
2906 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2909 printf("app screenreader: %d\n", screenreader);
2910 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2915 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
2918 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2919 * @brief This API gets the application's landscape & portrait effect images
2921 * @par This API is for package-manager client application
2922 * @par Sync (or) Async : Synchronous API
2924 * @param[in] handle pointer to application info handle
2925 * @param[out] portrait_img contains portrait mode effect image
2926 * @param[out] landscape_img contains landscape mode effect image
2927 * @return 0 if success, error code(<0) if fail
2928 * @retval PMINFO_R_OK success
2929 * @retval PMINFO_R_EINVAL invalid argument
2930 * @retval PMINFO_R_ERROR internal error
2931 * @pre pkgmgrinfo_appinfo_get_appinfo()
2932 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2933 * @see pkgmgrinfo_appinfo_get_appid()
2934 * @see pkgmgrinfo_appinfo_is_nodisplay()
2936 static int get_app_effectimages(const char *appid)
2939 char *portraitimg = NULL;
2940 char *landscapeimg = NULL;
2941 pkgmgrinfo_appinfo_h handle;
2942 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2943 if (ret != PMINFO_R_OK)
2945 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2946 if (ret != PMINFO_R_OK) {
2947 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2950 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2951 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2956 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
2959 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
2960 * @brief This API gets the submode_mainid of the application
2962 * @par This API is for package-manager client application
2963 * @par Sync (or) Async : Synchronous API
2965 * @param[in] handle pointer to the application info handle.
2966 * @param[out] submode_mainid pointer to hold package name
2967 * @return 0 if success, error code(<0) if fail
2968 * @retval PMINFO_R_OK success
2969 * @retval PMINFO_R_EINVAL invalid argument
2970 * @retval PMINFO_R_ERROR internal error
2971 * @pre pkgmgrinfo_appinfo_get_appinfo()
2972 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2973 * @see pkgmgrinfo_appinfo_get_appid()
2974 * @see pkgmgrinfo_appinfo_is_multiple()
2976 static int get_app_submode_mainid(const char *appid)
2979 char *submode_mainid = NULL;
2980 pkgmgrinfo_appinfo_h handle = NULL;
2981 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2982 if (ret != PMINFO_R_OK)
2984 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
2985 if (ret != PMINFO_R_OK) {
2986 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2989 printf("submode_mainid: %s\n", submode_mainid);
2990 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2995 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
2998 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
2999 * @brief This API gets the datacontrol info
3001 * @par This API is for package-manager client application
3002 * @par Sync (or) Async : Synchronous API
3004 * @param[in] providerid pointer to the providerid of dataconltrol.
3005 * @param[in] type pointer to the type of dataconltrol.
3006 * @param[out] appid pointer to hold appid, need to free after using
3007 * @param[out] access pointer to hold access, need to free after using
3008 * @return 0 if success, error code(<0) if fail
3009 * @retval PMINFO_R_OK success
3010 * @retval PMINFO_R_EINVAL invalid argument
3011 * @retval PMINFO_R_ERROR internal error
3014 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3015 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3018 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3019 * @brief This API gets the appid of datacontrol
3021 * @par This API is for package-manager client application
3022 * @par Sync (or) Async : Synchronous API
3024 * @param[in] providerid pointer to the providerid of dataconltrol.
3025 * @param[out] appid pointer to hold appid, need to free after using
3026 * @return 0 if success, error code(<0) if fail
3027 * @retval PMINFO_R_OK success
3028 * @retval PMINFO_R_EINVAL invalid argument
3029 * @retval PMINFO_R_ERROR internal error
3032 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3033 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3036 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3037 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3038 * @brief This API gets the list of permission for a particular application
3040 * @par This API is for package-manager client application
3041 * @par Sync (or) Async : Synchronous API
3042 * @param[in] handle pointer to the application info handle.
3043 * @param[in] permission_func callback function for list
3044 * @param[in] user_data user data to be passed to callback function
3045 * @return 0 if success, error code(<0) if fail
3046 * @retval PMINFO_R_OK success
3047 * @retval PMINFO_R_EINVAL invalid argument
3048 * @retval PMINFO_R_ERROR internal error
3049 * @pre pkgmgrinfo_appinfo_get_appinfo()
3050 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3052 int permission_func(const char *name, void *user_data)
3054 if (strcmp(name, (char *)user_data) == 0)
3060 static int list_permission(const char *appid, char *permission)
3063 pkgmgrinfo_appinfo_h handle;
3064 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3065 if (ret != PMINFO_R_OK)
3067 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3068 if (ret != PMINFO_R_OK) {
3069 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3077 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3078 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3081 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3082 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3083 * @brief This API gets the list of category for a particular application
3085 * @par This API is for package-manager client application
3086 * @par Sync (or) Async : Synchronous API
3087 * @param[in] handle pointer to the application info handle.
3088 * @param[in] category_func callback function for list
3089 * @param[in] user_data user data to be passed to callback function
3090 * @return 0 if success, error code(<0) if fail
3091 * @retval PMINFO_R_OK success
3092 * @retval PMINFO_R_EINVAL invalid argument
3093 * @retval PMINFO_R_ERROR internal error
3094 * @pre pkgmgrinfo_appinfo_get_appinfo()
3095 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3097 int category_func(const char *name, void *user_data)
3099 if (strcmp(name, (char *)user_data) == 0)
3105 static int list_category(const char *appid, char *category)
3108 pkgmgrinfo_appinfo_h handle;
3109 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3110 if (ret != PMINFO_R_OK)
3112 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3113 if (ret != PMINFO_R_OK) {
3114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3122 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3123 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3126 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3127 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3128 * @brief This API gets the list of metadata for a particular application
3130 * @par This API is for package-manager client application
3131 * @par Sync (or) Async : Synchronous API
3132 * @param[in] handle pointer to the application info handle.
3133 * @param[in] metadata_func callback function for list
3134 * @param[in] user_data user data to be passed to callback function
3135 * @return 0 if success, error code(<0) if fail
3136 * @retval PMINFO_R_OK success
3137 * @retval PMINFO_R_EINVAL invalid argument
3138 * @retval PMINFO_R_ERROR internal error
3139 * @pre pkgmgrinfo_appinfo_get_appinfo()
3140 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3142 int metadata_func(const char *key, const char *value, void *user_data)
3144 if (strcmp(key, (char *)user_data) == 0) {
3145 printf("Value is %s\n", value);
3152 static int list_metadata(const char *appid, char *key)
3155 pkgmgrinfo_appinfo_h handle;
3156 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3157 if (ret != PMINFO_R_OK)
3159 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3160 if (ret != PMINFO_R_OK) {
3161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3164 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3169 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3170 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3174 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3175 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3176 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3177 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3178 * @brief This API gets the list of app-control for a particular application
3180 * @par This API is for package-manager client application
3181 * @par Sync (or) Async : Synchronous API
3182 * @param[in] handle pointer to the application info handle.
3183 * @param[in] appcontrol_func callback function for list
3184 * @param[in] user_data user data to be passed to callback function
3185 * @param[in] uid the addressee user id of the instruction
3186 * @return 0 if success, error code(<0) if fail
3187 * @retval PMINFO_R_OK success
3188 * @retval PMINFO_R_EINVAL invalid argument
3189 * @retval PMINFO_R_ERROR internal error
3190 * @pre pkgmgrinfo_appinfo_get_appinfo()
3191 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3193 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3198 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3199 for (i = 0; i < oc; i++) {
3200 if (strcmp(operation[i], (char *)user_data) == 0)
3207 static int check_operation(const char *appid, char *operation)
3210 pkgmgrinfo_appinfo_h handle;
3211 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3212 if (ret != PMINFO_R_OK)
3214 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3215 if (ret != PMINFO_R_OK) {
3216 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3219 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3224 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3225 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3228 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3229 * @brief This API gets the application 'nodisplay' value from the app ID
3231 * @par This API is for package-manager client application
3232 * @par Sync (or) Async : Synchronous API
3234 * @param[in] handle pointer to application info handle
3235 * @param[out] nodisplay pointer to hold package nodisplay value
3236 * @return 0 if success, error code(<0) if fail
3237 * @retval PMINFO_R_OK success
3238 * @retval PMINFO_R_EINVAL invalid argument
3239 * @retval PMINFO_R_ERROR internal error
3240 * @pre pkgmgrinfo_appinfo_get_appinfo()
3241 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3242 * @see pkgmgrinfo_appinfo_get_appid()
3243 * @see pkgmgrinfo_appinfo_is_multiple()
3245 static int get_app_nodisplay(const char *appid)
3249 pkgmgrinfo_appinfo_h handle;
3250 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3251 if (ret != PMINFO_R_OK)
3253 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3254 if (ret != PMINFO_R_OK) {
3255 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3258 printf("app nodisplay: %d\n", nodisplay);
3259 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3267 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3268 * @brief This API gets the application 'multiple' value from the app ID
3270 * @par This API is for package-manager client application
3271 * @par Sync (or) Async : Synchronous API
3273 * @param[in] handle pointer to application info handle
3274 * @param[out] multiple pointer to hold package multiple value
3275 * @return 0 if success, error code(<0) if fail
3276 * @retval PMINFO_R_OK success
3277 * @retval PMINFO_R_EINVAL invalid argument
3278 * @retval PMINFO_R_ERROR internal error
3279 * @pre pkgmgrinfo_appinfo_get_appinfo()
3280 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3281 * @see pkgmgrinfo_appinfo_get_appid()
3282 * @see pkgmgrinfo_appinfo_is_nodisplay()
3284 static int get_app_multiple(const char *appid)
3288 pkgmgrinfo_appinfo_h handle;
3289 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3290 if (ret != PMINFO_R_OK)
3292 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3293 if (ret != PMINFO_R_OK) {
3294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3297 printf("app multiple: %d\n", multiple);
3298 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3306 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3307 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3308 * application launching effect. If fales, indicator will be hidden during application launching effect
3310 * @par This API is for package-manager client application
3311 * @par Sync (or) Async : Synchronous API
3313 * @param[in] handle pointer to application info handle
3314 * @param[out] indicator_disp contains indicator display status for application launching effect
3315 * @return 0 if success, error code(<0) if fail
3316 * @retval PMINFO_R_OK success
3317 * @retval PMINFO_R_EINVAL invalid argument
3318 * @retval PMINFO_R_ERROR internal error
3319 * @pre pkgmgrinfo_appinfo_get_appinfo()
3320 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3321 * @see pkgmgrinfo_appinfo_get_appid()
3322 * @see pkgmgrinfo_appinfo_is_nodisplay()
3324 static int get_app_indicator_display(const char *appid)
3327 bool indicator_disp;
3328 pkgmgrinfo_appinfo_h handle;
3329 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3330 if (ret != PMINFO_R_OK)
3332 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3333 if (ret != PMINFO_R_OK){
3334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3337 printf("app indicator disp : %d\n", indicator_disp);
3338 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3343 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3346 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3347 * @brief This API gets the application 'taskmanage' value from the app ID
3349 * @par This API is for package-manager client application
3350 * @par Sync (or) Async : Synchronous API
3352 * @param[in] handle pointer to application info handle
3353 * @param[out] taskmanage pointer to hold package taskmanage value
3354 * @return 0 if success, error code(<0) if fail
3355 * @retval PMINFO_R_OK success
3356 * @retval PMINFO_R_EINVAL invalid argument
3357 * @retval PMINFO_R_ERROR internal error
3358 * @pre pkgmgrinfo_appinfo_get_appinfo()
3359 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3360 * @see pkgmgrinfo_appinfo_get_appid()
3361 * @see pkgmgrinfo_appinfo_is_multiple()
3363 static int get_app_taskmanage(const char *appid)
3367 pkgmgrinfo_appinfo_h handle;
3368 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3369 if (ret != PMINFO_R_OK)
3371 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3372 if (ret != PMINFO_R_OK) {
3373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3376 printf("app taskmanage: %d\n", taskmanage);
3377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3385 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3386 * @brief This API gets the application 'taskmanage' value from the app ID
3388 * @par This API is for package-manager client application
3389 * @par Sync (or) Async : Synchronous API
3391 * @param[in] handle pointer to application info handle
3392 * @param[out] enabled pointer to hold package enabled value
3393 * @return 0 if success, error code(<0) if fail
3394 * @retval PMINFO_R_OK success
3395 * @retval PMINFO_R_EINVAL invalid argument
3396 * @retval PMINFO_R_ERROR internal error
3397 * @pre pkgmgrinfo_appinfo_get_appinfo()
3398 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3399 * @see pkgmgrinfo_appinfo_get_appid()
3400 * @see pkgmgrinfo_appinfo_is_multiple()
3402 static int get_app_enabled(const char *appid)
3406 pkgmgrinfo_appinfo_h handle;
3407 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3408 if (ret != PMINFO_R_OK)
3410 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3411 if (ret != PMINFO_R_OK) {
3412 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3415 printf("app enabled: %d\n", enabled);
3416 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3421 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3424 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3425 * @brief This API gets the application 'onboot' value from the app ID
3427 * @par This API is for package-manager client application
3428 * @par Sync (or) Async : Synchronous API
3430 * @param[in] handle pointer to application info handle
3431 * @param[out] onboot pointer to hold package onboot value
3432 * @return 0 if success, error code(<0) if fail
3433 * @retval PMINFO_R_OK success
3434 * @retval PMINFO_R_EINVAL invalid argument
3435 * @retval PMINFO_R_ERROR internal error
3436 * @pre pkgmgrinfo_appinfo_get_appinfo()
3437 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3438 * @see pkgmgrinfo_appinfo_get_appid()
3439 * @see pkgmgrinfo_appinfo_is_multiple()
3441 static int get_app_onboot(const char *appid)
3445 pkgmgrinfo_appinfo_h handle;
3446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3447 if (ret != PMINFO_R_OK)
3449 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3450 if (ret != PMINFO_R_OK) {
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3454 printf("app onboot: %d\n", onboot);
3455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3460 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3463 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3464 * @brief This API gets the application 'autorestart' value from the app ID
3466 * @par This API is for package-manager client application
3467 * @par Sync (or) Async : Synchronous API
3469 * @param[in] handle pointer to application info handle
3470 * @param[out] autorestart pointer to hold package autorestart value
3471 * @return 0 if success, error code(<0) if fail
3472 * @retval PMINFO_R_OK success
3473 * @retval PMINFO_R_EINVAL invalid argument
3474 * @retval PMINFO_R_ERROR internal error
3475 * @pre pkgmgrinfo_appinfo_get_appinfo()
3476 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3477 * @see pkgmgrinfo_appinfo_get_appid()
3478 * @see pkgmgrinfo_appinfo_is_multiple()
3480 static int get_app_autorestart(const char *appid)
3484 pkgmgrinfo_appinfo_h handle;
3485 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3486 if (ret != PMINFO_R_OK)
3488 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3489 if (ret != PMINFO_R_OK) {
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3493 printf("app autorestart: %d\n", autorestart);
3494 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3499 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3502 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3503 * @brief This API gets the value for given application is main app or not from handle
3505 * @par This API is for package-manager client application
3506 * @par Sync (or) Async : Synchronous API
3508 * @param[in] handle pointer to application info handle
3509 * @param[out] mainapp pointer to hold package mainapp is or not
3510 * @return 0 if success, error code(<0) if fail
3511 * @retval PMINFO_R_OK success
3512 * @retval PMINFO_R_EINVAL invalid argument
3513 * @retval PMINFO_R_ERROR internal error
3514 * @pre pkgmgrinfo_appinfo_get_appinfo()
3515 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3516 * @see pkgmgrinfo_appinfo_get_appid()
3517 * @see pkgmgrinfo_appinfo_is_multiple()
3519 static int get_app_mainapp(const char *appid)
3523 pkgmgrinfo_appinfo_h handle;
3524 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3525 if (ret != PMINFO_R_OK)
3527 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3528 if (ret != PMINFO_R_OK) {
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3532 printf("mainapp: %d\n", mainapp);
3533 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3538 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3542 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3543 * @brief This API gets the value for given application is preload or not from handle
3545 * @par This API is for package-manager client application
3546 * @par Sync (or) Async : Synchronous API
3548 * @param[in] handle pointer to application info handle
3549 * @param[out] preload pointer to hold preload is or not
3550 * @return 0 if success, error code(<0) if fail
3551 * @retval PMINFO_R_OK success
3552 * @retval PMINFO_R_EINVAL invalid argument
3553 * @retval PMINFO_R_ERROR internal error
3554 * @pre pkgmgrinfo_appinfo_get_appinfo()
3555 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3556 * @see pkgmgrinfo_appinfo_get_appid()
3557 * @see pkgmgrinfo_appinfo_is_multiple()
3559 static int get_app_preload(const char *appid)
3563 pkgmgrinfo_appinfo_h handle = NULL;
3564 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3565 if (ret != PMINFO_R_OK)
3567 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3568 if (ret != PMINFO_R_OK) {
3569 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3572 printf("preload: %d\n", preload);
3573 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3578 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3581 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3582 * @brief This API gets the value for given application is submode or not from handle
3584 * @par This API is for package-manager client application
3585 * @par Sync (or) Async : Synchronous API
3587 * @param[in] handle pointer to application info handle
3588 * @param[out] submode pointer to hold submode is or not
3589 * @return 0 if success, error code(<0) if fail
3590 * @retval PMINFO_R_OK success
3591 * @retval PMINFO_R_EINVAL invalid argument
3592 * @retval PMINFO_R_ERROR internal error
3593 * @pre pkgmgrinfo_appinfo_get_appinfo()
3594 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3595 * @see pkgmgrinfo_appinfo_get_appid()
3596 * @see pkgmgrinfo_appinfo_is_multiple()
3598 static int get_app_submode(const char *appid)
3602 pkgmgrinfo_appinfo_h handle = NULL;
3603 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3604 if (ret != PMINFO_R_OK)
3606 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3607 if (ret != PMINFO_R_OK) {
3608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3611 printf("submode: %d\n", submode);
3612 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3617 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3620 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3621 * @brief This API checks if the application has the given category
3623 * @par This API is for package-manager client application
3624 * @par Sync (or) Async : Synchronous API
3626 * @param[in] handle pointer to the application info handle
3627 * @param[in] category category
3628 * @param[out] exist value Gets whether the application has the given category
3629 * @return 0 if success, error code(<0) if fail
3630 * @retval PMINFO_R_OK success
3631 * @retval PMINFO_R_EINVAL invalid argument
3632 * @retval PMINFO_R_ERROR internal error
3634 static int is_category_exist(const char *appid, const char *category)
3637 pkgmgrinfo_appinfo_h handle;
3640 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3641 if (ret != PMINFO_R_OK)
3644 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3645 if (ret != PMINFO_R_OK) {
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3650 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3655 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3658 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3659 * @brief This API gets the application 'ui_gadget' value from the app ID
3661 * @par This API is for package-manager client application
3662 * @par Sync (or) Async : Synchronous API
3664 * @param[in] handle pointer to application info handle
3665 * @param[out] ui_gadget pointer to hold package ui_gadget value
3666 * @return 0 if success, error code(<0) if fail
3667 * @retval PMINFO_R_OK success
3668 * @retval PMINFO_R_EINVAL invalid argument
3669 * @pre pkgmgrinfo_appinfo_get_appinfo()
3670 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3672 static int get_app_ui_gadget(const char *appid)
3676 pkgmgrinfo_appinfo_h handle = NULL;
3677 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3678 if (ret != PMINFO_R_OK)
3680 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
3681 if (ret != PMINFO_R_OK) {
3682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 printf("app ui_gadget: %d\n", ui_gadget);
3686 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3691 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
3694 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3695 * @brief This API destroys the application information handle freeing up all the resources
3697 * @par This API is for package-manager client application
3698 * @par Sync (or) Async : Synchronous API
3700 * @param[in] handle pointer to the application info handle.
3701 * @return 0 if success, error code(<0) if fail
3702 * @retval PMINFO_R_OK success
3703 * @retval PMINFO_R_EINVAL invalid argument
3704 * @retval PMINFO_R_ERROR internal error
3705 * @pre pkgmgrinfo_appinfo_get_appinfo()
3707 * @see pkgmgrinfo_appinfo_get_pkgid()
3708 * @see pkgmgrinfo_appinfo_is_multiple()
3710 static int get_app_type(const char *appid)
3714 pkgmgrinfo_appinfo_h handle;
3715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3716 if (ret != PMINFO_R_OK)
3718 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3719 if (ret != PMINFO_R_OK) {
3720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3723 printf("apptype: %s\n", type);
3724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3729 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3732 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3733 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3734 The query will search the entire application information collected from the manifest file of all the installed packages
3736 * @par This API is for package-manager client application
3737 * @par Sync (or) Async : Synchronous API
3739 * @param[out] handle pointer to the application info filter handle.
3740 * @return 0 if success, error code(<0) if fail
3741 * @retval PMINFO_R_OK success
3742 * @retval PMINFO_R_EINVAL invalid argument
3743 * @retval PMINFO_R_ERROR internal error
3745 * @post pkgmgrinfo_appinfo_filter_destroy()
3746 * @see pkgmgrinfo_appinfo_filter_count()
3747 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3749 static int get_capp_count()
3753 pkgmgrinfo_appinfo_filter_h handle;
3754 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3755 if (ret != PMINFO_R_OK)
3757 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3758 if (ret != PMINFO_R_OK) {
3759 pkgmgrinfo_appinfo_filter_destroy(handle);
3762 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3763 if (ret != PMINFO_R_OK) {
3764 pkgmgrinfo_appinfo_filter_destroy(handle);
3767 printf("No of capp: %d\n", count);
3768 pkgmgrinfo_appinfo_filter_destroy(handle);
3773 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3776 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3777 * @brief This API destroys the application information filter handle freeing up all the resources
3779 * @par This API is for package-manager client application
3780 * @par Sync (or) Async : Synchronous API
3782 * @param[in] handle pointer to the application info filter handle.
3783 * @return 0 if success, error code(<0) if fail
3784 * @retval PMINFO_R_OK success
3785 * @retval PMINFO_R_EINVAL invalid argument
3786 * @retval PMINFO_R_ERROR internal error
3787 * @pre pkgmgrinfo_appinfo_filter_create()
3789 * @see pkgmgrinfo_appinfo_filter_count()
3790 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3792 static int get_capp_count()
3796 pkgmgrinfo_appinfo_filter_h handle;
3797 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3798 if (ret != PMINFO_R_OK)
3800 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3801 if (ret != PMINFO_R_OK) {
3802 pkgmgrinfo_appinfo_filter_destroy(handle);
3805 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3806 if (ret != PMINFO_R_OK) {
3807 pkgmgrinfo_appinfo_filter_destroy(handle);
3810 printf("No of capp: %d\n", count);
3811 pkgmgrinfo_appinfo_filter_destroy(handle);
3816 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3819 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3820 * @brief This API adds a boolean filter property to the filter handle
3822 * @par This API is for package-manager client application
3823 * @par Sync (or) Async : Synchronous API
3825 * @param[in] handle pointer to the application info filter handle.
3826 * @param[in] property boolean property name.
3827 * @param[in] value value corresponding to the property.
3828 * @return 0 if success, error code(<0) if fail
3829 * @retval PMINFO_R_OK success
3830 * @retval PMINFO_R_EINVAL invalid argument
3831 * @retval PMINFO_R_ERROR internal error
3832 * @pre pkgmgrinfo_appinfo_filter_create()
3833 * @post pkgmgrinfo_appinfo_filter_destroy()
3834 * @see pkgmgrinfo_appinfo_filter_count()
3835 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3837 static int get_taskmanageable_app_count()
3841 pkgmgrinfo_appinfo_filter_h handle;
3842 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3843 if (ret != PMINFO_R_OK)
3845 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3846 if (ret != PMINFO_R_OK) {
3847 pkgmgrinfo_appinfo_filter_destroy(handle);
3850 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3851 if (ret != PMINFO_R_OK) {
3852 pkgmgrinfo_appinfo_filter_destroy(handle);
3855 printf("No of taskmanageable apps: %d\n", count);
3856 pkgmgrinfo_appinfo_filter_destroy(handle);
3861 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3862 const char *property, const bool value);
3865 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3866 * @brief This API adds an integer filter property to the filter handle
3868 * @par This API is for package-manager client application
3869 * @par Sync (or) Async : Synchronous API
3871 * @param[in] handle pointer to the application info filter handle.
3872 * @param[in] property integer property name.
3873 * @param[in] value value corresponding to the property.
3874 * @return 0 if success, error code(<0) if fail
3875 * @retval PMINFO_R_OK success
3876 * @retval PMINFO_R_EINVAL invalid argument
3877 * @retval PMINFO_R_ERROR internal error
3878 * @pre pkgmgrinfo_appinfo_filter_create()
3879 * @post pkgmgrinfo_appinfo_filter_destroy()
3880 * @see pkgmgrinfo_appinfo_filter_count()
3881 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3883 static int get_taskmanageable_app_count()
3887 pkgmgrinfo_appinfo_filter_h handle;
3888 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3889 if (ret != PMINFO_R_OK)
3891 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3892 if (ret != PMINFO_R_OK) {
3893 pkgmgrinfo_appinfo_filter_destroy(handle);
3896 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3897 if (ret != PMINFO_R_OK) {
3898 pkgmgrinfo_appinfo_filter_destroy(handle);
3901 printf("No of apps: %d\n", count);
3902 pkgmgrinfo_appinfo_filter_destroy(handle);
3907 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3908 const char *property, const int value);
3911 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3912 * @brief This API adds a string filter property to the filter handle
3914 * @par This API is for package-manager client application
3915 * @par Sync (or) Async : Synchronous API
3917 * @param[in] handle pointer to the application info filter handle.
3918 * @param[in] property string property name.
3919 * @param[in] value value corresponding to the property.
3920 * @return 0 if success, error code(<0) if fail
3921 * @retval PMINFO_R_OK success
3922 * @retval PMINFO_R_EINVAL invalid argument
3923 * @retval PMINFO_R_ERROR internal error
3924 * @pre pkgmgrinfo_appinfo_filter_create()
3925 * @post pkgmgrinfo_appinfo_filter_destroy()
3926 * @see pkgmgrinfo_appinfo_filter_count()
3927 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3929 static int get_capp_count()
3933 pkgmgrinfo_appinfo_filter_h handle;
3934 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3935 if (ret != PMINFO_R_OK)
3937 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3938 if (ret != PMINFO_R_OK) {
3939 pkgmgrinfo_appinfo_filter_destroy(handle);
3942 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3943 if (ret != PMINFO_R_OK) {
3944 pkgmgrinfo_appinfo_filter_destroy(handle);
3947 printf("No of capp: %d\n", count);
3948 pkgmgrinfo_appinfo_filter_destroy(handle);
3953 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3954 const char *property, const char *value);
3957 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3958 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3960 * @par This API is for package-manager client application
3961 * @par Sync (or) Async : Synchronous API
3963 * @param[in] handle pointer to the application info filter handle.
3964 * @param[in] app_cb callback function.
3965 * @param[in] user_data user data to be passed to the callback function
3966 * @return 0 if success, error code(<0) if fail
3967 * @retval PMINFO_R_OK success
3968 * @retval PMINFO_R_EINVAL invalid argument
3969 * @retval PMINFO_R_ERROR internal error
3970 * @pre pkgmgrinfo_appinfo_filter_create()
3971 * @post pkgmgrinfo_appinfo_filter_destroy()
3972 * @see pkgmgrinfo_appinfo_filter_count()
3974 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3977 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3978 printf("appid : %s\n", appid);
3982 static int get_capp_list()
3985 pkgmgrinfo_appinfo_filter_h handle;
3986 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3987 if (ret != PMINFO_R_OK)
3989 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3990 if (ret != PMINFO_R_OK) {
3991 pkgmgrinfo_appinfo_filter_destroy(handle);
3994 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3995 if (ret != PMINFO_R_OK) {
3996 pkgmgrinfo_appinfo_filter_destroy(handle);
3999 pkgmgrinfo_appinfo_filter_destroy(handle);
4004 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4005 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4006 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4007 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4010 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4011 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4012 * @brief This API counts the application that satisfy the filter conditions
4014 * @par This API is for package-manager client application
4015 * @par Sync (or) Async : Synchronous API
4017 * @param[in] handle pointer to the application info filter handle.
4018 * @param[in] count pointer to store count value
4019 * @param[in] uid the addressee user id of the instruction
4020 * @return 0 if success, error code(<0) if fail
4021 * @retval PMINFO_R_OK success
4022 * @retval PMINFO_R_EINVAL invalid argument
4023 * @retval PMINFO_R_ERROR internal error
4024 * @pre pkgmgrinfo_appinfo_filter_create()
4025 * @post pkgmgrinfo_appinfo_filter_destroy()
4026 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4028 static int get_capp_count()
4032 pkgmgrinfo_appinfo_filter_h handle;
4033 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4034 if (ret != PMINFO_R_OK)
4036 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4037 if (ret != PMINFO_R_OK) {
4038 pkgmgrinfo_appinfo_filter_destroy(handle);
4041 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4042 if (ret != PMINFO_R_OK) {
4043 pkgmgrinfo_appinfo_filter_destroy(handle);
4046 printf("No of capp: %d\n", count);
4047 pkgmgrinfo_appinfo_filter_destroy(handle);
4052 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4053 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4055 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4056 * @brief This API creates the application's metadata information filter handle from db.
4058 * @par This API is for package-manager client application
4059 * @par Sync (or) Async : Synchronous API
4061 * @param[out] handle pointer to the application metadata info filter handle.
4062 * @return 0 if success, error code(<0) if fail
4063 * @retval PMINFO_R_OK success
4064 * @retval PMINFO_R_EINVAL invalid argument
4065 * @retval PMINFO_R_ERROR internal error
4067 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4068 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4070 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4073 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4074 printf("appid : %s\n", appid);
4078 static int get_app_list(const char *mkey, const char *mvalue)
4081 pkgmgrinfo_appinfo_metadata_filter_h handle;
4082 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4083 if (ret != PMINFO_R_OK)
4085 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4086 if (ret != PMINFO_R_OK) {
4087 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4090 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4091 if (ret != PMINFO_R_OK) {
4092 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4095 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4100 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4103 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4104 * @brief This API destroys the application's metadata information filter handle.
4106 * @par This API is for package-manager client application
4107 * @par Sync (or) Async : Synchronous API
4109 * @param[in] handle pointer to the application metadata info filter handle.
4110 * @return 0 if success, error code(<0) if fail
4111 * @retval PMINFO_R_OK success
4112 * @retval PMINFO_R_EINVAL invalid argument
4113 * @retval PMINFO_R_ERROR internal error
4114 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4116 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4118 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4121 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4122 printf("appid : %s\n", appid);
4126 static int get_app_list(const char *mkey, const char *mvalue)
4129 pkgmgrinfo_appinfo_metadata_filter_h handle;
4130 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4131 if (ret != PMINFO_R_OK)
4133 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4134 if (ret != PMINFO_R_OK) {
4135 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4138 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4139 if (ret != PMINFO_R_OK) {
4140 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4143 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4148 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4151 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4152 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4153 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4155 * @par This API is for package-manager client application
4156 * @par Sync (or) Async : Synchronous API
4158 * @param[in] handle pointer to the application metadata info filter handle.
4159 * @param[in] key pointer to metadata key
4160 * @param[in] value pointer to metadata value
4161 * @return 0 if success, error code(<0) if fail
4162 * @retval PMINFO_R_OK success
4163 * @retval PMINFO_R_EINVAL invalid argument
4164 * @retval PMINFO_R_ERROR internal error
4165 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4166 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4167 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4169 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4172 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4173 printf("appid : %s\n", appid);
4177 static int get_app_list(const char *mkey, const char *mvalue)
4180 pkgmgrinfo_appinfo_metadata_filter_h handle;
4181 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4182 if (ret != PMINFO_R_OK)
4184 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4185 if (ret != PMINFO_R_OK) {
4186 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4189 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4190 if (ret != PMINFO_R_OK) {
4191 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4194 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4199 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4200 const char *key, const char *value);
4203 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4204 * @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)
4205 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4206 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4207 * negative value, no more callbacks will be called and API will return.
4209 * @par This API is for package-manager client application
4210 * @par Sync (or) Async : Synchronous API
4212 * @param[in] handle pointer to the application metadata info filter handle.
4213 * @param[in] app_cb function pointer to callback
4214 * @param[in] user_data pointer to user data
4215 * @param[in] uid the addressee user id of the instruction
4216 * @return 0 if success, error code(<0) if fail
4217 * @retval PMINFO_R_OK success
4218 * @retval PMINFO_R_EINVAL invalid argument
4219 * @retval PMINFO_R_ERROR internal error
4220 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4221 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4223 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4226 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4227 printf("appid : %s\n", appid);
4231 static int get_app_list(const char *mkey, const char *mvalue)
4234 pkgmgrinfo_appinfo_metadata_filter_h handle;
4235 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4236 if (ret != PMINFO_R_OK)
4238 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4239 if (ret != PMINFO_R_OK) {
4240 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4243 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4244 if (ret != PMINFO_R_OK) {
4245 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4248 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4253 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4254 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4255 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4256 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4258 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4259 * @brief This API creates the package cert information handle to get data from db.
4261 * @par This API is for package-manager client application
4262 * @par Sync (or) Async : Synchronous API
4264 * @param[out] handle pointer to the package cert handle.
4265 * @return 0 if success, error code(<0) if fail
4266 * @retval PMINFO_R_OK success
4267 * @retval PMINFO_R_EINVAL invalid argument
4268 * @retval PMINFO_R_ERROR internal error
4270 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4271 * @see pkgmgrinfo_pkginfo_get_cert_value()
4272 * @see pkgmgrinfo_pkginfo_load_certinfo()
4274 static int get_cert_info(const char *pkgid)
4277 pkgmgrinfo_certinfo_h handle;
4278 char *auth_cert = NULL;
4279 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4280 if (ret != PMINFO_R_OK)
4282 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4283 if (ret != PMINFO_R_OK) {
4284 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4287 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4288 if (ret != PMINFO_R_OK) {
4289 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4292 printf("Author root certificate: %s\n", auth_root);
4293 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4298 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4301 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4302 * @brief This API loads the package cert information handle with data from db.
4304 * @par This API is for package-manager client application
4305 * @par Sync (or) Async : Synchronous API
4307 * @param[in] pkgid pointer to the package ID.
4308 * @param[in] handle pointer to the package cert handle.
4309 * @return 0 if success, error code(<0) if fail
4310 * @retval PMINFO_R_OK success
4311 * @retval PMINFO_R_EINVAL invalid argument
4312 * @retval PMINFO_R_ERROR internal error
4313 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4314 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4315 * @see pkgmgrinfo_pkginfo_get_cert_value()
4317 static int get_cert_info(const char *pkgid)
4320 pkgmgrinfo_certinfo_h handle;
4321 char *auth_cert = NULL;
4322 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4323 if (ret != PMINFO_R_OK)
4325 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4326 if (ret != PMINFO_R_OK) {
4327 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4330 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4331 if (ret != PMINFO_R_OK) {
4332 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4335 printf("Author root certificate: %s\n", auth_root);
4336 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4341 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4344 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4345 * @brief This API gets the package cert information from the handle
4347 * @par This API is for package-manager client application
4348 * @par Sync (or) Async : Synchronous API
4350 * @param[in] handle pointer to the package cert handle.
4351 * @param[in] cert_type certificate type
4352 * @param[out] cert_value pointer to hold certificate value
4353 * @return 0 if success, error code(<0) if fail
4354 * @retval PMINFO_R_OK success
4355 * @retval PMINFO_R_EINVAL invalid argument
4356 * @retval PMINFO_R_ERROR internal error
4357 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4358 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4359 * @see pkgmgrinfo_pkginfo_load_certinfo()
4361 static int get_cert_info(const char *pkgid)
4364 pkgmgrinfo_certinfo_h handle;
4365 char *auth_cert = NULL;
4366 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4367 if (ret != PMINFO_R_OK)
4369 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4370 if (ret != PMINFO_R_OK) {
4371 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4374 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4375 if (ret != PMINFO_R_OK) {
4376 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4379 printf("Author root certificate: %s\n", auth_root);
4380 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4385 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4388 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4389 * @brief This API destroys the package cert information handle freeing up all the resources
4391 * @par This API is for package-manager client application
4392 * @par Sync (or) Async : Synchronous API
4394 * @param[in] handle pointer to the package cert handle.
4395 * @return 0 if success, error code(<0) if fail
4396 * @retval PMINFO_R_OK success
4397 * @retval PMINFO_R_EINVAL invalid argument
4398 * @retval PMINFO_R_ERROR internal error
4399 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4401 * @see pkgmgrinfo_pkginfo_load_certinfo()
4403 static int get_cert_info(const char *pkgid)
4406 pkgmgrinfo_certinfo_h handle;
4407 char *auth_cert = NULL;
4408 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4409 if (ret != PMINFO_R_OK)
4411 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4412 if (ret != PMINFO_R_OK) {
4413 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4416 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4417 if (ret != PMINFO_R_OK) {
4418 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4421 printf("Author root certificate: %s\n", auth_root);
4422 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4427 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4430 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4431 * @brief This API deletes the package cert information from DB
4433 * @par This API is for package-manager client application
4434 * @par Sync (or) Async : Synchronous API
4436 * @param[in] pkgid pointer to the package ID.
4437 * @return 0 if success, error code(<0) if fail
4438 * @retval PMINFO_R_OK success
4439 * @retval PMINFO_R_EINVAL invalid argument
4440 * @retval PMINFO_R_ERROR internal error
4444 static int delete_cert_info(const char *pkgid)
4447 ret = pkgmgrinfo_delete_certinfo(pkgid);
4448 if (ret != PMINFO_R_OK)
4454 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4455 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4457 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4458 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4459 * @brief This API creates the package db information handle to set data in db.
4461 * @par This API is for package-manager client application
4462 * @par Sync (or) Async : Synchronous API
4464 * @param[in] pkgid pointer to the package ID.
4465 * @param[in] uid the addressee user id of the instruction
4466 * @param[out] handle pointer to the package db info handle.
4467 * @return 0 if success, error code(<0) if fail
4468 * @retval PMINFO_R_OK success
4469 * @retval PMINFO_R_EINVAL invalid argument
4470 * @retval PMINFO_R_ERROR internal error
4472 * @post pkgmgrinfo_destroy_pkgdbinfo()
4473 * @see pkgmgrinfo_save_pkgdbinfo()
4474 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4476 static int set_pkg_in_db(const char *pkgid)
4479 pkgmgrinfo_pkgdbinfo_h handle;
4480 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4481 if (ret != PMINFO_R_OK)
4483 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4484 if (ret != PMINFO_R_OK) {
4485 pkgmgrinfo_destroy_pkgdbinfo(handle);
4488 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4489 if (ret != PMINFO_R_OK) {
4490 pkgmgrinfo_destroy_pkgdbinfo(handle);
4493 pkgmgrinfo_destroy_pkgdbinfo(handle);
4498 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4499 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4502 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4503 * @brief This API sets the package type in db handle
4505 * @par This API is for package-manager client application
4506 * @par Sync (or) Async : Synchronous API
4508 * @param[in] handle pointer to the pkgdbinfo handle.
4509 * @param[in] type pointer to the package type.
4510 * @return 0 if success, error code(<0) if fail
4511 * @retval PMINFO_R_OK success
4512 * @retval PMINFO_R_EINVAL invalid argument
4513 * @retval PMINFO_R_ERROR internal error
4514 * @pre pkgmgrinfo_create_pkgdbinfo()
4515 * @post pkgmgrinfo_destroy_pkgdbinfo()
4516 * @see pkgmgrinfo_save_pkgdbinfo()
4517 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4519 static int set_pkg_type_in_db(const char *pkgid)
4522 pkgmgrinfo_pkgdbinfo_h handle;
4523 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4524 if (ret != PMINFO_R_OK)
4526 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4527 if (ret != PMINFO_R_OK) {
4528 pkgmgrinfo_destroy_pkgdbinfo(handle);
4531 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4532 if (ret != PMINFO_R_OK) {
4533 pkgmgrinfo_destroy_pkgdbinfo(handle);
4536 pkgmgrinfo_destroy_pkgdbinfo(handle);
4541 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4544 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4545 * @brief This API sets the package version in db handle
4547 * @par This API is for package-manager client application
4548 * @par Sync (or) Async : Synchronous API
4550 * @param[in] handle pointer to the pkgdbinfo handle.
4551 * @param[in] version pointer to the package version
4552 * @return 0 if success, error code(<0) if fail
4553 * @retval PMINFO_R_OK success
4554 * @retval PMINFO_R_EINVAL invalid argument
4555 * @retval PMINFO_R_ERROR internal error
4556 * @pre pkgmgrinfo_create_pkgdbinfo()
4557 * @post pkgmgrinfo_destroy_pkgdbinfo()
4558 * @see pkgmgrinfo_save_pkgdbinfo()
4559 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4561 static int set_pkg_version_in_db(const char *pkgid)
4564 pkgmgrinfo_pkgdbinfo_h handle;
4565 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4566 if (ret != PMINFO_R_OK)
4568 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4569 if (ret != PMINFO_R_OK) {
4570 pkgmgrinfo_destroy_pkgdbinfo(handle);
4573 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4574 if (ret != PMINFO_R_OK) {
4575 pkgmgrinfo_destroy_pkgdbinfo(handle);
4578 pkgmgrinfo_destroy_pkgdbinfo(handle);
4583 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4586 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4587 * @brief This API sets the package install location in db handle
4589 * @par This API is for package-manager client application
4590 * @par Sync (or) Async : Synchronous API
4592 * @param[in] handle pointer to the pkgdbinfo handle.
4593 * @param[in] location package install location
4594 * @return 0 if success, error code(<0) if fail
4595 * @retval PMINFO_R_OK success
4596 * @retval PMINFO_R_EINVAL invalid argument
4597 * @retval PMINFO_R_ERROR internal error
4598 * @pre pkgmgrinfo_create_pkgdbinfo()
4599 * @post pkgmgrinfo_destroy_pkgdbinfo()
4600 * @see pkgmgrinfo_save_pkgdbinfo()
4601 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4603 static int set_pkg_install_location_in_db(const char *pkgid)
4606 pkgmgrinfo_pkgdbinfo_h handle;
4607 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4608 if (ret != PMINFO_R_OK)
4610 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4611 if (ret != PMINFO_R_OK) {
4612 pkgmgrinfo_destroy_pkgdbinfo(handle);
4615 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4616 if (ret != PMINFO_R_OK) {
4617 pkgmgrinfo_destroy_pkgdbinfo(handle);
4620 pkgmgrinfo_destroy_pkgdbinfo(handle);
4625 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4628 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4629 * @brief This API sets the package size in db handle
4631 * @par This API is for package-manager client application
4632 * @par Sync (or) Async : Synchronous API
4634 * @param[in] handle pointer to the pkgdbinfo handle.
4635 * @param[in] size pointer to the package size
4636 * @return 0 if success, error code(<0) if fail
4637 * @retval PMINFO_R_OK success
4638 * @retval PMINFO_R_EINVAL invalid argument
4639 * @retval PMINFO_R_ERROR internal error
4640 * @pre pkgmgrinfo_create_pkgdbinfo()
4641 * @post pkgmgrinfo_destroy_pkgdbinfo()
4642 * @see pkgmgrinfo_save_pkgdbinfo()
4643 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4645 static int set_pkg_size_in_db(const char *pkgid)
4648 pkgmgrinfo_pkgdbinfo_h handle;
4649 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4650 if (ret != PMINFO_R_OK)
4652 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4653 if (ret != PMINFO_R_OK) {
4654 pkgmgrinfo_destroy_pkgdbinfo(handle);
4657 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4658 if (ret != PMINFO_R_OK) {
4659 pkgmgrinfo_destroy_pkgdbinfo(handle);
4662 pkgmgrinfo_destroy_pkgdbinfo(handle);
4667 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4670 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4671 * @brief This API sets the package label in db handle
4673 * @par This API is for package-manager client application
4674 * @par Sync (or) Async : Synchronous API
4676 * @param[in] handle pointer to the pkgdbinfo handle.
4677 * @param[in] label pointer to the package label
4678 * @param[in] locale pointer to the locale
4679 * @return 0 if success, error code(<0) if fail
4680 * @retval PMINFO_R_OK success
4681 * @retval PMINFO_R_EINVAL invalid argument
4682 * @retval PMINFO_R_ERROR internal error
4683 * @pre pkgmgrinfo_create_pkgdbinfo()
4684 * @post pkgmgrinfo_destroy_pkgdbinfo()
4685 * @see pkgmgrinfo_save_pkgdbinfo()
4686 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4688 static int set_pkg_label_in_db(const char *pkgid)
4691 pkgmgrinfo_pkgdbinfo_h handle;
4692 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4693 if (ret != PMINFO_R_OK)
4695 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4696 if (ret != PMINFO_R_OK) {
4697 pkgmgrinfo_destroy_pkgdbinfo(handle);
4700 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4701 if (ret != PMINFO_R_OK) {
4702 pkgmgrinfo_destroy_pkgdbinfo(handle);
4705 pkgmgrinfo_destroy_pkgdbinfo(handle);
4710 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4713 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4714 * @brief This API sets the package icon in db handle
4716 * @par This API is for package-manager client application
4717 * @par Sync (or) Async : Synchronous API
4719 * @param[in] handle pointer to the pkgdbinfo handle.
4720 * @param[in] icon pointer to the package icon
4721 * @param[in] locale pointer to the locale
4722 * @return 0 if success, error code(<0) if fail
4723 * @retval PMINFO_R_OK success
4724 * @retval PMINFO_R_EINVAL invalid argument
4725 * @retval PMINFO_R_ERROR internal error
4726 * @pre pkgmgrinfo_create_pkgdbinfo()
4727 * @post pkgmgrinfo_destroy_pkgdbinfo()
4728 * @see pkgmgrinfo_save_pkgdbinfo()
4729 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4731 static int set_pkg_icon_in_db(const char *pkgid)
4734 pkgmgrinfo_pkgdbinfo_h handle;
4735 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4736 if (ret != PMINFO_R_OK)
4738 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4739 if (ret != PMINFO_R_OK) {
4740 pkgmgrinfo_destroy_pkgdbinfo(handle);
4743 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4744 if (ret != PMINFO_R_OK) {
4745 pkgmgrinfo_destroy_pkgdbinfo(handle);
4748 pkgmgrinfo_destroy_pkgdbinfo(handle);
4753 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4756 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4757 * @brief This API sets the package description in db handle
4759 * @par This API is for package-manager client application
4760 * @par Sync (or) Async : Synchronous API
4762 * @param[in] handle pointer to the pkgdbinfo handle.
4763 * @param[in] description pointer to the package description
4764 * @param[in] locale pointer to the locale
4765 * @return 0 if success, error code(<0) if fail
4766 * @retval PMINFO_R_OK success
4767 * @retval PMINFO_R_EINVAL invalid argument
4768 * @retval PMINFO_R_ERROR internal error
4769 * @pre pkgmgrinfo_create_pkgdbinfo()
4770 * @post pkgmgrinfo_destroy_pkgdbinfo()
4771 * @see pkgmgrinfo_save_pkgdbinfo()
4772 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4774 static int set_pkg_description_in_db(const char *pkgid)
4777 pkgmgrinfo_pkgdbinfo_h handle;
4778 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4779 if (ret != PMINFO_R_OK)
4781 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4782 if (ret != PMINFO_R_OK) {
4783 pkgmgrinfo_destroy_pkgdbinfo(handle);
4786 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4787 if (ret != PMINFO_R_OK) {
4788 pkgmgrinfo_destroy_pkgdbinfo(handle);
4791 pkgmgrinfo_destroy_pkgdbinfo(handle);
4796 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4799 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4800 const char *author_email, const char *author_href, const char *locale)
4801 * @brief This API sets the package author info in db handle
4803 * @par This API is for package-manager client application
4804 * @par Sync (or) Async : Synchronous API
4806 * @param[in] handle pointer to the pkgdbinfo handle.
4807 * @param[in] author_name pointer to the package author name
4808 * @param[in] author_email pointer to the package author email
4809 * @param[in] author_href pointer to the package author href
4810 * @param[in] locale pointer to the locale
4811 * @return 0 if success, error code(<0) if fail
4812 * @retval PMINFO_R_OK success
4813 * @retval PMINFO_R_EINVAL invalid argument
4814 * @retval PMINFO_R_ERROR internal error
4815 * @pre pkgmgrinfo_create_pkgdbinfo()
4816 * @post pkgmgrinfo_destroy_pkgdbinfo()
4817 * @see pkgmgrinfo_save_pkgdbinfo()
4818 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4820 static int set_pkg_author_in_db(const char *pkgid)
4823 pkgmgrinfo_pkgdbinfo_h handle;
4824 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4825 if (ret != PMINFO_R_OK)
4827 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4828 if (ret != PMINFO_R_OK) {
4829 pkgmgrinfo_destroy_pkgdbinfo(handle);
4832 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4833 if (ret != PMINFO_R_OK) {
4834 pkgmgrinfo_destroy_pkgdbinfo(handle);
4837 pkgmgrinfo_destroy_pkgdbinfo(handle);
4842 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4843 const char *author_email, const char *author_href, const char *locale);
4846 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4847 * @brief This API sets the package 'removable' value in db handle
4849 * @par This API is for package-manager client application
4850 * @par Sync (or) Async : Synchronous API
4852 * @param[in] handle pointer to the pkgdbinfo handle.
4853 * @param[in] removable package removable value
4854 * @return 0 if success, error code(<0) if fail
4855 * @retval PMINFO_R_OK success
4856 * @retval PMINFO_R_EINVAL invalid argument
4857 * @retval PMINFO_R_ERROR internal error
4858 * @pre pkgmgrinfo_create_pkgdbinfo()
4859 * @post pkgmgrinfo_destroy_pkgdbinfo()
4860 * @see pkgmgrinfo_save_pkgdbinfo()
4861 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4863 static int set_pkg_removable_in_db(const char *pkgid)
4866 pkgmgrinfo_pkgdbinfo_h handle;
4867 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4868 if (ret != PMINFO_R_OK)
4870 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4871 if (ret != PMINFO_R_OK) {
4872 pkgmgrinfo_destroy_pkgdbinfo(handle);
4875 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4876 if (ret != PMINFO_R_OK) {
4877 pkgmgrinfo_destroy_pkgdbinfo(handle);
4880 pkgmgrinfo_destroy_pkgdbinfo(handle);
4885 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4888 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4889 * @brief This API sets the package 'preload' value in db handle
4891 * @par This API is for package-manager client application
4892 * @par Sync (or) Async : Synchronous API
4894 * @param[in] handle pointer to the pkgdbinfo handle.
4895 * @param[in] preload package preload value
4896 * @return 0 if success, error code(<0) if fail
4897 * @retval PMINFO_R_OK success
4898 * @retval PMINFO_R_EINVAL invalid argument
4899 * @retval PMINFO_R_ERROR internal error
4900 * @pre pkgmgrinfo_create_pkgdbinfo()
4901 * @post pkgmgrinfo_destroy_pkgdbinfo()
4902 * @see pkgmgrinfo_save_pkgdbinfo()
4903 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4905 static int set_pkg_preload_in_db(const char *pkgid)
4908 pkgmgrinfo_pkgdbinfo_h handle;
4909 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4910 if (ret != PMINFO_R_OK)
4912 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4913 if (ret != PMINFO_R_OK) {
4914 pkgmgrinfo_destroy_pkgdbinfo(handle);
4917 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4918 if (ret != PMINFO_R_OK) {
4919 pkgmgrinfo_destroy_pkgdbinfo(handle);
4922 pkgmgrinfo_destroy_pkgdbinfo(handle);
4927 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4930 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4931 * @brief This API sets the package 'installed_storage' value in db handle
4933 * @par This API is for package-manager client application
4934 * @par Sync (or) Async : Synchronous API
4936 * @param[in] handle pointer to the pkgdbinfo handle.
4937 * @param[in] location installed_storage value
4938 * @return 0 if success, error code(<0) if fail
4939 * @retval PMINFO_R_OK success
4940 * @retval PMINFO_R_EINVAL invalid argument
4941 * @retval PMINFO_R_ERROR internal error
4942 * @pre pkgmgrinfo_create_pkgdbinfo()
4943 * @post pkgmgrinfo_destroy_pkgdbinfo()
4944 * @see pkgmgrinfo_save_pkgdbinfo()
4946 static int set_pkg_installed_storage_in_db(const char *pkgid)
4949 pkgmgrinfo_pkgdbinfo_h handle;
4950 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4951 if (ret != PMINFO_R_OK)
4953 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4954 if (ret != PMINFO_R_OK) {
4955 pkgmgrinfo_destroy_pkgdbinfo(handle);
4958 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4959 if (ret != PMINFO_R_OK) {
4960 pkgmgrinfo_destroy_pkgdbinfo(handle);
4963 pkgmgrinfo_destroy_pkgdbinfo(handle);
4968 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4971 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4972 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
4973 * @brief This API saves all the information from the handle to the DB.
4975 * @par This API is for package-manager client application
4976 * @par Sync (or) Async : Synchronous API
4978 * @param[in] handle pointer to the package db info handle.
4979 * @param[in] uid the addressee user id of the instruction
4980 * @return 0 if success, error code(<0) if fail
4981 * @retval PMINFO_R_OK success
4982 * @retval PMINFO_R_EINVAL invalid argument
4983 * @retval PMINFO_R_ERROR internal error
4984 * @pre pkgmgrinfo_create_pkgdbinfo()
4985 * @post pkgmgrinfo_destroy_pkgdbinfo()
4986 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4988 static int set_pkg_in_db(const char *pkgid)
4991 pkgmgrinfo_pkgdbinfo_h handle;
4992 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4993 if (ret != PMINFO_R_OK)
4995 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4996 if (ret != PMINFO_R_OK) {
4997 pkgmgrinfo_destroy_pkgdbinfo(handle);
5000 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5001 if (ret != PMINFO_R_OK) {
5002 pkgmgrinfo_destroy_pkgdbinfo(handle);
5005 pkgmgrinfo_destroy_pkgdbinfo(handle);
5010 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5011 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5013 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5014 * @brief This API destroys the package db information handle freeing up all the resources
5016 * @par This API is for package-manager client application
5017 * @par Sync (or) Async : Synchronous API
5019 * @param[in] handle pointer to the package db info handle.
5020 * @return 0 if success, error code(<0) if fail
5021 * @retval PMINFO_R_OK success
5022 * @retval PMINFO_R_EINVAL invalid argument
5023 * @retval PMINFO_R_ERROR internal error
5024 * @pre pkgmgrinfo_create_pkgdbinfo()
5026 * @see pkgmgrinfo_save_pkgdbinfo()
5027 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5029 static int set_pkg_in_db(const char *pkgid)
5032 pkgmgrinfo_pkgdbinfo_h handle;
5033 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5034 if (ret != PMINFO_R_OK)
5036 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5037 if (ret != PMINFO_R_OK) {
5038 pkgmgrinfo_destroy_pkgdbinfo(handle);
5041 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5042 if (ret != PMINFO_R_OK) {
5043 pkgmgrinfo_destroy_pkgdbinfo(handle);
5046 pkgmgrinfo_destroy_pkgdbinfo(handle);
5051 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5055 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5056 * @brief This API creates the package cert information handle to set data in db.
5058 * @par This API is for package-manager client application
5059 * @par Sync (or) Async : Synchronous API
5061 * @param[out] handle pointer to the package cert handle.
5062 * @return 0 if success, error code(<0) if fail
5063 * @retval PMINFO_R_OK success
5064 * @retval PMINFO_R_EINVAL invalid argument
5065 * @retval PMINFO_R_ERROR internal error
5067 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5068 * @see pkgmgrinfo_set_cert_value()
5069 * @see pkgmgrinfo_save_certinfo()
5071 static int set_cert_in_db(const char *pkgid)
5074 pkgmgrinfo_instcertinfo_h handle;
5075 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5076 if (ret != PMINFO_R_OK)
5078 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5079 if (ret != PMINFO_R_OK) {
5080 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5083 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5084 if (ret != PMINFO_R_OK) {
5085 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5088 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5093 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5096 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5097 * @brief This API sets the package cert information in the handle.
5099 * @par This API is for package-manager client application
5100 * @par Sync (or) Async : Synchronous API
5102 * @param[in] handle pointer to the package cert handle.
5103 * @param[in] cert_type certificate type.
5104 * @param[in] cert_value certificate value.
5105 * @return 0 if success, error code(<0) if fail
5106 * @retval PMINFO_R_OK success
5107 * @retval PMINFO_R_EINVAL invalid argument
5108 * @retval PMINFO_R_ERROR internal error
5109 * @pre pkgmgrinfo_create_certinfo_set_handle()
5110 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5111 * @see pkgmgrinfo_save_certinfo()
5113 static int set_cert_in_db(const char *pkgid)
5116 pkgmgrinfo_instcertinfo_h handle;
5117 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5118 if (ret != PMINFO_R_OK)
5120 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5121 if (ret != PMINFO_R_OK) {
5122 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5125 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5126 if (ret != PMINFO_R_OK) {
5127 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5130 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5135 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5138 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5139 * @brief This API saves the package cert information in the DB.
5141 * @par This API is for package-manager client application
5142 * @par Sync (or) Async : Synchronous API
5144 * @param[in] pkgid pointer to the package ID.
5145 * @param[in] handle pointer to the package cert handle.
5146 * @return 0 if success, error code(<0) if fail
5147 * @retval PMINFO_R_OK success
5148 * @retval PMINFO_R_EINVAL invalid argument
5149 * @retval PMINFO_R_ERROR internal error
5150 * @pre pkgmgrinfo_create_certinfo_set_handle()
5151 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5152 * @see pkgmgrinfo_save_certinfo()
5154 static int set_cert_in_db(const char *pkgid)
5157 pkgmgrinfo_instcertinfo_h handle;
5158 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5159 if (ret != PMINFO_R_OK)
5161 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5162 if (ret != PMINFO_R_OK) {
5163 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5166 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5167 if (ret != PMINFO_R_OK) {
5168 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5171 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5176 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5179 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5180 * @brief This API destroys the package cert information handle freeing up all the resources.
5182 * @par This API is for package-manager client application
5183 * @par Sync (or) Async : Synchronous API
5185 * @param[in] handle pointer to the package cert handle.
5186 * @return 0 if success, error code(<0) if fail
5187 * @retval PMINFO_R_OK success
5188 * @retval PMINFO_R_EINVAL invalid argument
5189 * @retval PMINFO_R_ERROR internal error
5190 * @pre pkgmgrinfo_create_certinfo_set_handle()
5192 * @see pkgmgrinfo_save_certinfo()
5194 static int set_cert_in_db(const char *pkgid)
5197 pkgmgrinfo_instcertinfo_h handle;
5198 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5199 if (ret != PMINFO_R_OK)
5201 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5202 if (ret != PMINFO_R_OK) {
5203 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5206 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5207 if (ret != PMINFO_R_OK) {
5208 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5211 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5216 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5219 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5220 * @brief This API gets the datacontrol info
5222 * @par This API is for package-manager client application
5223 * @par Sync (or) Async : Synchronous API
5225 * @param[in] providerid pointer to the providerid of dataconltrol.
5226 * @param[in] type pointer to the type of dataconltrol.
5227 * @param[out] appid pointer to hold appid, need to free after using
5228 * @param[out] access pointer to hold access, need to free after using
5229 * @return 0 if success, error code(<0) if fail
5230 * @retval PMINFO_R_OK success
5231 * @retval PMINFO_R_EINVAL invalid argument
5232 * @retval PMINFO_R_ERROR internal error
5235 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5238 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5239 * @brief This API gets the application 'guest mode visibility' value from the DB
5241 * @par This API is for package-manager client application
5242 * @par Sync (or) Async : Synchronous API
5244 * @param[in] handle pointer to application info handle
5245 * @param[out] status pointer to hold app guest mode visibility value
5246 * @return 0 if success, error code(<0) if fail
5247 * @retval PMINFO_R_OK success
5248 * @retval PMINFO_R_EINVAL invalid argument
5249 * @retval PMINFO_R_ERROR internal error
5250 * @pre pkgmgrinfo_appinfo_get_appinfo()
5251 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5252 * @see pkgmgrinfo_appinfo_get_appid()
5253 * @see pkgmgrinfo_appinfo_is_multiple()
5255 static int get_app_guestmode_visibility(const char *appid)
5259 pkgmgrinfo_appinfo_h handle;
5260 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5261 if (ret != PMINFO_R_OK)
5263 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5264 if (ret != PMINFO_R_OK) {
5265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5268 printf("app guest mode visibility: %d\n", status);
5269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5274 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5277 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5278 * @brief This API sets the application 'guest mode visibility' value in the DB
5280 * @par This API is for package-manager client application
5281 * @par Sync (or) Async : Synchronous API
5283 * @param[in] handle pointer to application info handle
5284 * @param[out] status app guest mode visibility value
5285 * @return 0 if success, error code(<0) if fail
5286 * @retval PMINFO_R_OK success
5287 * @retval PMINFO_R_EINVAL invalid argument
5288 * @retval PMINFO_R_ERROR internal error
5289 * @pre pkgmgrinfo_appinfo_get_appinfo()
5290 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5291 * @see pkgmgrinfo_appinfo_get_appid()
5292 * @see pkgmgrinfo_appinfo_is_multiple()
5294 static int set_app_guestmode_visibility(const char *appid, bool value)
5297 pkgmgrinfo_appinfo_h handle;
5298 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5299 if (ret != PMINFO_R_OK)
5301 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5302 if (ret != PMINFO_R_OK) {
5303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5311 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5312 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5314 * @pkgmgrinfo client API
5318 * @brief listening status type in pkgmgrinfo.
5320 #define PMINFO_CLIENT_STATUS_ALL 0x00
5321 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5322 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5323 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5324 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5325 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5326 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5329 * @brief This APIs provides pkgmgrinfo client listener
5331 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5332 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5333 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5334 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5335 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5339 * @pkgmgrinfo client API end
5347 #endif /* __PKG_INFO_H__ */