4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
94 /** Boolean property for filtering based on package info*/
95 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
107 /** Integer property for filtering based on package info*/
108 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
110 /** String property for filtering based on app info*/
111 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
112 /** String property for filtering based on app info*/
113 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
114 /** String property for filtering based on app info*/
115 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
135 /** Boolean property for filtering based on app info*/
136 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
137 /** Boolean property for filtering based on app info*/
138 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
139 /** Boolean property for filtering based on app info*/
140 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
141 /** Boolean property for filtering based on app info*/
142 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
143 /** Boolean property for filtering based on app info*/
144 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
145 /** Boolean property for filtering based on app info*/
146 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
148 /** will be updated*/
149 /** string property for filtering based on pkg info*/
150 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
152 /* For multiuser support */
153 const char *getIconPath(uid_t uid);
154 const char *getUserPkgParserDBPath(void);
155 const char *getUserPkgParserDBPathUID(uid_t uid);
156 const char *getUserPkgCertDBPath(void);
157 const char *getUserPkgCertDBPathUID(uid_t uid);
158 const char *getUserDesktopPath(uid_t uid);
159 const char *getUserManifestPath(uid_t uid);
162 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
163 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
164 * @brief This API gets list of installed packages
166 * @par This API is for package-manager client application
167 * @par Sync (or) Async : Synchronous API
168 * @param[in] pkg_list_cb iteration function for list
169 * @param[in] user_data user data to be passed to callback function
170 * @param[in] uid the addressee user id of the instruction
171 * @return 0 if success, error code(<0) if fail
172 * @retval PMINFO_R_OK success
173 * @retval PMINFO_R_EINVAL invalid argument
174 * @retval PMINFO_R_ERROR internal error
178 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
182 pkgid1 = (char *)user_data;
183 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
184 if (strcmp(pkgid1, pkgid2) == 0) {
191 static int list_pkgs()
194 char *name = "helloworld";
195 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
196 if (ret != PMINFO_R_OK) {
203 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
204 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
206 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
207 * @brief This API creates the package information handle from db
209 * @par This API is for package-manager client application
210 * @par Sync (or) Async : Synchronous API
212 * @param[in] pkgid pointer to package ID
213 * @param[in] uid the addressee user id of the instruction
214 * @param[out] handle pointer to the package info handle.
215 * @return 0 if success, error code(<0) if fail
216 * @retval PMINFO_R_OK success
217 * @retval PMINFO_R_EINVAL invalid argument
218 * @retval PMINFO_R_ERROR internal error
220 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
221 * @see pkgmgrinfo_pkginfo_get_pkgid()
222 * @see pkgmgrinfo_pkginfo_is_removable()
224 static int get_pkg_type(const char *pkgid)
228 pkgmgrinfo_pkginfo_h handle;
229 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
230 if (ret != PMINFO_R_OK)
232 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
233 if (ret != PMINFO_R_OK) {
234 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
237 printf("pkgtype: %s\n", type);
238 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
243 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
244 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
247 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
248 * @brief This API gets the package name from the package ID
250 * @par This API is for package-manager client application
251 * @par Sync (or) Async : Synchronous API
253 * @param[in] handle pointer to package info handle
254 * @param[out] pkg_name pointer to hold package name
255 * @return 0 if success, error code(<0) if fail
256 * @retval PMINFO_R_OK success
257 * @retval PMINFO_R_EINVAL invalid argument
258 * @retval PMINFO_R_ERROR internal error
259 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
260 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
261 * @see pkgmgrinfo_pkginfo_get_type()
262 * @see pkgmgrinfo_pkginfo_is_removable()
264 static int get_pkg_name(const char *pkgid)
267 char *pkgname = NULL;
268 pkgmgrinfo_pkginfo_h handle;
269 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
270 if (ret != PMINFO_R_OK)
272 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
273 if (ret != PMINFO_R_OK) {
274 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
277 printf("pkgname: %s\n", pkgname);
278 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
283 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
286 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
287 * @brief This API gets the package id from the package ID
289 * @par This API is for package-manager client application
290 * @par Sync (or) Async : Synchronous API
292 * @param[in] handle pointer to package info handle
293 * @param[out] pkgid pointer to hold package id
294 * @return 0 if success, error code(<0) if fail
295 * @retval PMINFO_R_OK success
296 * @retval PMINFO_R_EINVAL invalid argument
297 * @retval PMINFO_R_ERROR internal error
298 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
299 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
300 * @see pkgmgrinfo_pkginfo_get_type()
301 * @see pkgmgrinfo_pkginfo_is_removable()
303 static int get_pkgid(const char *pkgid)
307 pkgmgrinfo_pkginfo_h handle;
308 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
309 if (ret != PMINFO_R_OK)
311 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
312 if (ret != PMINFO_R_OK) {
313 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
316 printf("pkg id: %s\n", pkg_id);
317 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
322 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
325 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
326 * @brief This API gets the package type from the package ID
328 * @par This API is for package-manager client application
329 * @par Sync (or) Async : Synchronous API
331 * @param[in] handle pointer to package info handle
332 * @param[out] type pointer to hold package type
333 * @return 0 if success, error code(<0) if fail
334 * @retval PMINFO_R_OK success
335 * @retval PMINFO_R_EINVAL invalid argument
336 * @retval PMINFO_R_ERROR internal error
337 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
338 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
339 * @see pkgmgrinfo_pkginfo_get_pkgid()
340 * @see pkgmgrinfo_pkginfo_is_removable()
342 static int get_pkg_type(const char *pkgid)
346 pkgmgrinfo_pkginfo_h handle;
347 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
348 if (ret != PMINFO_R_OK)
350 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
351 if (ret != PMINFO_R_OK) {
352 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
355 printf("pkgtype: %s\n", type);
356 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
361 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
364 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
365 * @brief This API gets the package version from the package ID
367 * @par This API is for package-manager client application
368 * @par Sync (or) Async : Synchronous API
370 * @param[in] handle pointer to package info handle
371 * @param[out] version pointer to hold package version
372 * @return 0 if success, error code(<0) if fail
373 * @retval PMINFO_R_OK success
374 * @retval PMINFO_R_EINVAL invalid argument
375 * @retval PMINFO_R_ERROR internal error
376 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
377 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
378 * @see pkgmgrinfo_pkginfo_get_pkgid()
379 * @see pkgmgrinfo_pkginfo_is_removable()
381 static int get_pkg_version(const char *pkgid)
384 char *version = NULL;
385 pkgmgrinfo_pkginfo_h handle;
386 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
387 if (ret != PMINFO_R_OK)
389 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
390 if (ret != PMINFO_R_OK) {
391 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
394 printf("pkg version: %s\n", version);
395 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
400 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
403 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
404 * @brief This API gets the package install location from the package ID
406 * @par This API is for package-manager client application
407 * @par Sync (or) Async : Synchronous API
409 * @param[in] handle pointer to package info handle
410 * @param[out] location pointer to hold package install location
411 * @return 0 if success, error code(<0) if fail
412 * @retval PMINFO_R_OK success
413 * @retval PMINFO_R_EINVAL invalid argument
414 * @retval PMINFO_R_ERROR internal error
415 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
416 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
417 * @see pkgmgrinfo_pkginfo_get_pkgid()
418 * @see pkgmgrinfo_pkginfo_is_removable()
420 static int get_pkg_install_location(const char *pkgid)
423 pkgmgrinfo_install_location location;
424 pkgmgrinfo_pkginfo_h handle;
425 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
426 if (ret != PMINFO_R_OK)
428 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
429 if (ret != PMINFO_R_OK) {
430 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
433 printf("pkg install location: %d\n", location);
434 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
439 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
442 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
443 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
444 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
445 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
447 * @par This API is for package-manager client application
448 * @par Sync (or) Async : Synchronous API
450 * @param[in] handle pointer to package info handle
451 * @param[out] size pointer to hold package size
452 * @return 0 if success, error code(<0) if fail
453 * @retval PMINFO_R_OK success
454 * @retval PMINFO_R_EINVAL invalid argument
455 * @retval PMINFO_R_ERROR internal error
456 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
457 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
458 * @see pkgmgrinfo_pkginfo_get_pkgid()
459 * @see pkgmgrinfo_pkginfo_is_removable()
461 static int get_pkg_size(const char *pkgid)
465 pkgmgrinfo_pkginfo_h handle;
466 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
467 if (ret != PMINFO_R_OK)
469 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
470 if (ret != PMINFO_R_OK) {
471 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
474 printf("pkgsize: %d\n", size);
475 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
480 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
483 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
484 * @brief This API gets the installed package total size on the target.
486 * @par This API is for package-manager client application
487 * @par Sync (or) Async : Synchronous API
489 * @param[in] handle pointer to package info handle
490 * @param[out] size pointer to hold package total size
491 * @return 0 if success, error code(<0) if fail
492 * @retval PMINFO_R_OK success
493 * @retval PMINFO_R_EINVAL invalid argument
494 * @retval PMINFO_R_ERROR internal error
496 static int get_pkg_total_size(const char *pkgid)
500 pkgmgrinfo_pkginfo_h handle;
501 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
502 if (ret != PMINFO_R_OK)
504 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
505 if (ret != PMINFO_R_OK) {
506 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
509 printf("pkg total size: %d\n", size);
510 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
515 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
518 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
519 * @brief This API gets the installed package data size on the target.
521 * @par This API is for package-manager client application
522 * @par Sync (or) Async : Synchronous API
524 * @param[in] handle pointer to package info handle
525 * @param[out] size pointer to hold package data size
526 * @return 0 if success, error code(<0) if fail
527 * @retval PMINFO_R_OK success
528 * @retval PMINFO_R_EINVAL invalid argument
529 * @retval PMINFO_R_ERROR internal error
531 static int get_pkg_data_size(const char *pkgid)
535 pkgmgrinfo_pkginfo_h handle;
536 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
537 if (ret != PMINFO_R_OK)
539 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
540 if (ret != PMINFO_R_OK) {
541 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
544 printf("pkg data size: %d\n", size);
545 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
550 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
553 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
554 * @brief This API gets the package icon from the package ID
556 * @par This API is for package-manager client application
557 * @par Sync (or) Async : Synchronous API
559 * @param[in] handle pointer to package info handle
560 * @param[out] icon pointer to hold package icon
561 * @return 0 if success, error code(<0) if fail
562 * @retval PMINFO_R_OK success
563 * @retval PMINFO_R_EINVAL invalid argument
564 * @retval PMINFO_R_ERROR internal error
565 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
566 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
567 * @see pkgmgrinfo_pkginfo_get_pkgid()
568 * @see pkgmgrinfo_pkginfo_is_removable()
570 static int get_pkg_icon(const char *pkgid)
574 pkgmgrinfo_pkginfo_h handle;
575 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
576 if (ret != PMINFO_R_OK)
578 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
579 if (ret != PMINFO_R_OK) {
580 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
583 printf("pkg icon: %s\n", icon);
584 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
589 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
592 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
593 * @brief This API gets the package label from the package ID
595 * @par This API is for package-manager client application
596 * @par Sync (or) Async : Synchronous API
598 * @param[in] handle pointer to package info handle
599 * @param[out] label pointer to hold package label
600 * @return 0 if success, error code(<0) if fail
601 * @retval PMINFO_R_OK success
602 * @retval PMINFO_R_EINVAL invalid argument
603 * @retval PMINFO_R_ERROR internal error
604 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
605 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
606 * @see pkgmgrinfo_pkginfo_get_pkgid()
607 * @see pkgmgrinfo_pkginfo_is_removable()
609 static int get_pkg_label(const char *pkgid)
613 pkgmgrinfo_pkginfo_h handle;
614 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
615 if (ret != PMINFO_R_OK)
617 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
618 if (ret != PMINFO_R_OK) {
619 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
622 printf("pkg label: %s\n", label);
623 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
628 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
631 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
632 * @brief This API gets the package description from the package ID
634 * @par This API is for package-manager client application
635 * @par Sync (or) Async : Synchronous API
637 * @param[in] handle pointer to package info handle
638 * @param[out] description pointer to hold package description
639 * @return 0 if success, error code(<0) if fail
640 * @retval PMINFO_R_OK success
641 * @retval PMINFO_R_EINVAL invalid argument
642 * @retval PMINFO_R_ERROR internal error
643 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
644 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
645 * @see pkgmgrinfo_pkginfo_get_pkgid()
646 * @see pkgmgrinfo_pkginfo_is_removable()
648 static int get_pkg_description(const char *pkgid)
651 char *description = NULL;
652 pkgmgrinfo_pkginfo_h handle;
653 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
654 if (ret != PMINFO_R_OK)
656 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
657 if (ret != PMINFO_R_OK) {
658 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
661 printf("pkg description: %s\n", description);
662 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
667 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
670 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
671 * @brief This API gets the package's author name from the package ID
673 * @par This API is for package-manager client application
674 * @par Sync (or) Async : Synchronous API
676 * @param[in] handle pointer to package info handle
677 * @param[out] author_name pointer to hold package author name
678 * @return 0 if success, error code(<0) if fail
679 * @retval PMINFO_R_OK success
680 * @retval PMINFO_R_EINVAL invalid argument
681 * @retval PMINFO_R_ERROR internal error
682 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
683 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
684 * @see pkgmgrinfo_pkginfo_get_pkgid()
685 * @see pkgmgrinfo_pkginfo_is_removable()
687 static int get_pkg_author_name(const char *pkgid)
690 char *author_name = NULL;
691 pkgmgrinfo_pkginfo_h handle;
692 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
693 if (ret != PMINFO_R_OK)
695 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
696 if (ret != PMINFO_R_OK) {
697 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
700 printf("pkg author name: %s\n", author_name);
701 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
706 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
709 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
710 * @brief This API gets the package's author email from the package ID
712 * @par This API is for package-manager client application
713 * @par Sync (or) Async : Synchronous API
715 * @param[in] handle pointer to package info handle
716 * @param[out] author_email pointer to hold package author email
717 * @return 0 if success, error code(<0) if fail
718 * @retval PMINFO_R_OK success
719 * @retval PMINFO_R_EINVAL invalid argument
720 * @retval PMINFO_R_ERROR internal error
721 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
722 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
723 * @see pkgmgrinfo_pkginfo_get_pkgid()
724 * @see pkgmgrinfo_pkginfo_is_removable()
726 static int get_pkg_author_email(const char *pkgid)
729 char *author_email = NULL;
730 pkgmgrinfo_pkginfo_h handle;
731 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
732 if (ret != PMINFO_R_OK)
734 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
735 if (ret != PMINFO_R_OK) {
736 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
739 printf("pkg author email: %s\n", author_email);
740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
745 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
748 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
749 * @brief This API gets the package's author href from the package ID
751 * @par This API is for package-manager client application
752 * @par Sync (or) Async : Synchronous API
754 * @param[in] handle pointer to package info handle
755 * @param[out] author_href pointer to hold package author href
756 * @return 0 if success, error code(<0) if fail
757 * @retval PMINFO_R_OK success
758 * @retval PMINFO_R_EINVAL invalid argument
759 * @retval PMINFO_R_ERROR internal error
760 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
761 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
762 * @see pkgmgrinfo_pkginfo_get_pkgid()
763 * @see pkgmgrinfo_pkginfo_is_removable()
765 static int get_pkg_author_href(const char *pkgid)
768 char *author_href = NULL;
769 pkgmgrinfo_pkginfo_h handle;
770 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
771 if (ret != PMINFO_R_OK)
773 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
774 if (ret != PMINFO_R_OK) {
775 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
778 printf("pkg author href: %s\n", author_href);
779 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
784 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
787 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
788 * @brief This API gets the package installed storagae value from the package ID
790 * @par This API is for package-manager client application
791 * @par Sync (or) Async : Synchronous API
793 * @param[in] handle pointer to package info handle
794 * @param[out] storage pointer to hold package installed storage
795 * @return 0 if success, error code(<0) if fail
796 * @retval PMINFO_R_OK success
797 * @retval PMINFO_R_EINVAL invalid argument
798 * @retval PMINFO_R_ERROR internal error
799 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
800 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
801 * @see pkgmgrinfo_pkginfo_get_pkgid()
802 * @see pkgmgrinfo_pkginfo_is_removable()
804 static int get_pkg_installed_storage(const char *pkgid)
807 pkgmgrinfo_installed_storage storage;
808 pkgmgrinfo_pkginfo_h handle;
809 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
810 if (ret != PMINFO_R_OK)
812 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
813 if (ret != PMINFO_R_OK) {
814 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
817 printf("pkg installed storage: %d\n", storage);
818 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
823 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
826 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
827 * @brief This API gets the installed time of package from the package ID
829 * @par This API is for package-manager client application
830 * @par Sync (or) Async : Synchronous API
832 * @param[in] handle pointer to package info handle
833 * @param[out] installed_time pointer to hold installed time of package
834 * @return 0 if success, error code(<0) if fail
835 * @retval PMINFO_R_OK success
836 * @retval PMINFO_R_EINVAL invalid argument
837 * @retval PMINFO_R_ERROR internal error
838 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
839 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
840 * @see pkgmgrinfo_pkginfo_get_pkgid()
841 * @see pkgmgrinfo_pkginfo_is_removable()
843 static int get_pkg_installed_time(const char *pkgid)
846 int installed_time = 0;
847 pkgmgrinfo_pkginfo_h handle;
848 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
849 if (ret != PMINFO_R_OK)
851 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
852 if (ret != PMINFO_R_OK) {
853 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
856 printf("installed_time: %d\n", installed_time);
857 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
862 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
865 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
866 * @brief This API gets the launch mode of package from the package ID
868 * @par This API is for package-manager client application
869 * @par Sync (or) Async : Synchronous API
871 * @param[in] handle pointer to package info handle
872 * @param[out] mode pointer to hold launch mode of package
873 * @return 0 if success, error code(<0) if fail
874 * @retval PMINFO_R_OK success
875 * @retval PMINFO_R_EINVAL invalid argument
876 * @retval PMINFO_R_ERROR internal error
877 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
878 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
879 * @see pkgmgrinfo_pkginfo_get_pkgid()
880 * @see pkgmgrinfo_pkginfo_is_removable()
882 static int get_pkg_launch_mode(const char *pkgid)
885 char *launch_mode = NULL;
886 pkgmgrinfo_pkginfo_h handle;
887 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
888 if (ret != PMINFO_R_OK)
890 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
891 if (ret != PMINFO_R_OK) {
892 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
895 printf("launch mode: %s\n", mode);
896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
901 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
904 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
905 * @brief This API gets the store client id of package from the package ID
907 * @par This API is for package-manager client application
908 * @par Sync (or) Async : Synchronous API
910 * @param[in] handle pointer to package info handle
911 * @param[out] storeclientid pointer to hold store client id of package
912 * @return 0 if success, error code(<0) if fail
913 * @retval PMINFO_R_OK success
914 * @retval PMINFO_R_EINVAL invalid argument
915 * @retval PMINFO_R_ERROR internal error
916 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
917 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
918 * @see pkgmgrinfo_pkginfo_get_pkgid()
919 * @see pkgmgrinfo_pkginfo_is_removable()
921 static int get_pkg_storeclientid(const char *pkgid)
924 char *storeclientid = 0;
925 pkgmgrinfo_pkginfo_h handle;
926 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
927 if (ret != PMINFO_R_OK)
929 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
930 if (ret != PMINFO_R_OK) {
931 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
934 printf(store client id: %s\n", storeclientid);
935 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
940 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
943 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
944 * @brief This API gets the main app id of package from the package ID
946 * @par This API is for package-manager client application
947 * @par Sync (or) Async : Synchronous API
949 * @param[in] handle pointer to package info handle
950 * @param[out] mainappid pointer to hold main app id of package
951 * @return 0 if success, error code(<0) if fail
952 * @retval PMINFO_R_OK success
953 * @retval PMINFO_R_EINVAL invalid argument
954 * @retval PMINFO_R_ERROR internal error
955 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
956 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
957 * @see pkgmgrinfo_pkginfo_get_pkgid()
958 * @see pkgmgrinfo_pkginfo_is_removable()
960 static int get_pkg_mainappid(const char *pkgid)
964 pkgmgrinfo_pkginfo_h handle;
965 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
966 if (ret != PMINFO_R_OK)
968 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
969 if (ret != PMINFO_R_OK) {
970 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
973 printf(main app id: %s\n", mainappid);
974 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
979 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
982 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
983 * @brief This API gets the url of package from the package ID
985 * @par This API is for package-manager client application
986 * @par Sync (or) Async : Synchronous API
988 * @param[in] handle pointer to package info handle
989 * @param[out] url pointer to hold url of package
990 * @return 0 if success, error code(<0) if fail
991 * @retval PMINFO_R_OK success
992 * @retval PMINFO_R_EINVAL invalid argument
993 * @retval PMINFO_R_ERROR internal error
994 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
995 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
996 * @see pkgmgrinfo_pkginfo_get_pkgid()
997 * @see pkgmgrinfo_pkginfo_is_removable()
999 static int get_pkg_url(const char *pkgid)
1003 pkgmgrinfo_pkginfo_h handle;
1004 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1005 if (ret != PMINFO_R_OK)
1007 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1008 if (ret != PMINFO_R_OK) {
1009 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1012 printf("url : %s\n", url);
1013 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1018 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1022 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1023 * @brief This API gets the root path of package
1025 * @par Sync (or) Async : Synchronous API
1027 * @param[in] handle pointer to package info handle
1028 * @param[out] path pointer to hold root path of package
1029 * @return 0 if success, error code(<0) if fail
1030 * @retval PMINFO_R_OK success
1031 * @retval PMINFO_R_EINVAL invalid argument
1032 * @retval PMINFO_R_ERROR internal error
1034 static int get_root_path(const char *pkgid)
1038 pkgmgrinfo_pkginfo_h handle;
1039 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1040 if (ret != PMINFO_R_OK)
1043 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1044 if (ret != PMINFO_R_OK) {
1045 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1048 printf("path : %s\n", path);
1049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1055 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1059 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1060 * @brief This API gets the csc path of package
1062 * @par Sync (or) Async : Synchronous API
1064 * @param[in] handle pointer to package info handle
1065 * @param[out] path pointer to hold csc path of package
1066 * @return 0 if success, error code(<0) if fail
1067 * @retval PMINFO_R_OK success
1068 * @retval PMINFO_R_EINVAL invalid argument
1069 * @retval PMINFO_R_ERROR internal error
1071 static int get_csc_path(const char *pkgid)
1075 pkgmgrinfo_pkginfo_h handle;
1076 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1077 if (ret != PMINFO_R_OK)
1080 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1081 if (ret != PMINFO_R_OK) {
1082 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1085 printf("path : %s\n", path);
1086 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1092 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1095 * @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)
1096 * @brief This API compare the cert information from given package id
1098 * @par This API is for package-manager client application
1099 * @par Sync (or) Async : Synchronous API
1101 * @param[in] lhs_package_id pointer to first package ID
1102 * @param[in] rhs_package_id pointer to second package ID
1103 * @param[out] compare_result pointer to the compare result.
1104 * @return 0 if success, error code(<0) if fail
1105 * @retval PMINFO_R_OK success
1106 * @retval PMINFO_R_EINVAL invalid argument
1107 * @retval PMINFO_R_ERROR internal error
1109 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1110 * @see pkgmgrinfo_pkginfo_get_pkgid()
1111 * @see pkgmgrinfo_pkginfo_is_removable()
1113 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1116 pkgmgrinfo_cert_compare_result_type_e result;
1118 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1119 if (ret != PMINFO_R_OK) {
1122 printf("result: %d\n", result);
1127 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);
1128 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);
1130 * @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)
1131 * @brief This API compare the cert information from given app id
1133 * @par This API is for package-manager client application
1134 * @par Sync (or) Async : Synchronous API
1136 * @param[in] lhs_app_id pointer to first app ID
1137 * @param[in] rhs_app_id pointer to second app ID
1138 * @param[out] compare_result pointer to the compare result.
1139 * @return 0 if success, error code(<0) if fail
1140 * @retval PMINFO_R_OK success
1141 * @retval PMINFO_R_EINVAL invalid argument
1142 * @retval PMINFO_R_ERROR internal error
1144 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1145 * @see pkgmgrinfo_pkginfo_get_pkgid()
1146 * @see pkgmgrinfo_pkginfo_is_removable()
1148 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1151 pkgmgrinfo_cert_compare_result_type_e result;
1153 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1154 if (ret != PMINFO_R_OK) {
1157 printf("result: %d\n", result);
1162 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);
1163 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);
1165 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1166 * @brief This API gets the package 'removable' value from the package ID
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package info handle
1172 * @param[out] removable pointer to hold package removable value
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1177 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1178 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1179 * @see pkgmgrinfo_pkginfo_get_pkgid()
1180 * @see pkgmgrinfo_pkginfo_is_readonly()
1182 static int get_pkg_removable(const char *pkgid)
1186 pkgmgrinfo_pkginfo_h handle;
1187 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1188 if (ret != PMINFO_R_OK)
1190 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1191 if (ret != PMINFO_R_OK) {
1192 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1195 printf("pkg removable: %d\n", removable);
1196 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1201 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1204 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1205 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1207 * @par This API is for package-manager client application
1208 * @par Sync (or) Async : Synchronous API
1210 * @param[in] handle pointer to package info handle
1211 * @param[out] movable pointer to hold package movable state
1212 * @return 0 if success, error code(<0) if fail
1213 * @retval PMINFO_R_OK success
1214 * @retval PMINFO_R_EINVAL invalid argument
1215 * @retval PMINFO_R_ERROR internal error
1216 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1217 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1218 * @see pkgmgrinfo_pkginfo_get_pkgid()
1220 static int get_pkg_movable(const char *pkgid)
1224 pkgmgrinfo_pkginfo_h handle;
1225 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1226 if (ret != PMINFO_R_OK)
1228 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1229 if (ret != PMINFO_R_OK) {
1230 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1233 printf("pkg movable: %d\n", movable);
1234 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1239 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1242 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1243 * @brief This API gets the package 'preload' value from the package ID
1245 * @par This API is for package-manager client application
1246 * @par Sync (or) Async : Synchronous API
1248 * @param[in] handle pointer to package info handle
1249 * @param[out] preload pointer to hold package preload value
1250 * @return 0 if success, error code(<0) if fail
1251 * @retval PMINFO_R_OK success
1252 * @retval PMINFO_R_EINVAL invalid argument
1253 * @retval PMINFO_R_ERROR internal error
1254 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1255 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1256 * @see pkgmgrinfo_pkginfo_get_pkgid()
1257 * @see pkgmgrinfo_pkginfo_is_readonly()
1259 static int get_pkg_preload(const char *pkgid)
1263 pkgmgrinfo_pkginfo_h handle;
1264 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1265 if (ret != PMINFO_R_OK)
1267 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1268 if (ret != PMINFO_R_OK) {
1269 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1272 printf("pkg preload: %d\n", preload);
1273 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1278 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1281 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1282 * @brief This API gets the value for given handle is system or not
1284 * @par This API is for package-manager client application
1285 * @par Sync (or) Async : Synchronous API
1287 * @param[in] handle pointer to package info handle
1288 * @param[out] system pointer to hold system is or not
1289 * @return 0 if success, error code(<0) if fail
1290 * @retval PMINFO_R_OK success
1291 * @retval PMINFO_R_EINVAL invalid argument
1292 * @retval PMINFO_R_ERROR internal error
1293 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1294 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1295 * @see pkgmgrinfo_pkginfo_get_pkgid()
1296 * @see pkgmgrinfo_pkginfo_is_readonly()
1298 static int get_pkg_system(const char *pkgid)
1301 bool system = false;
1302 pkgmgrinfo_pkginfo_h handle = NULL;
1303 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1304 if (ret != PMINFO_R_OK)
1306 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1307 if (ret != PMINFO_R_OK) {
1308 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1311 printf("pkg system: %d\n", system);
1312 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1317 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1320 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1321 * @brief This API gets the package 'readonly' value from the package ID
1323 * @par This API is for package-manager client application
1324 * @par Sync (or) Async : Synchronous API
1326 * @param[in] handle pointer to package info handle
1327 * @param[out] readonly pointer to hold package readonly value
1328 * @return 0 if success, error code(<0) if fail
1329 * @retval PMINFO_R_OK success
1330 * @retval PMINFO_R_EINVAL invalid argument
1331 * @retval PMINFO_R_ERROR internal error
1332 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1333 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1334 * @see pkgmgrinfo_pkginfo_get_pkgid()
1335 * @see pkgmgrinfo_pkginfo_is_removable()
1337 static int get_pkg_readonly(const char *pkgid)
1341 pkgmgrinfo_pkginfo_h handle;
1342 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1343 if (ret != PMINFO_R_OK)
1345 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1346 if (ret != PMINFO_R_OK) {
1347 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1350 printf("pkg readonly: %d\n", readonly);
1351 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1356 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1360 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1361 * @brief This API gets the package 'upate' value from the package ID
1363 * @par This API is for package-manager client application
1364 * @par Sync (or) Async : Synchronous API
1366 * @param[in] handle pointer to package info handle
1367 * @param[out] update pointer to hold package update value
1368 * @return 0 if success, error code(<0) if fail
1369 * @retval PMINFO_R_OK success
1370 * @retval PMINFO_R_EINVAL invalid argument
1371 * @retval PMINFO_R_ERROR internal error
1372 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1373 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1374 * @see pkgmgrinfo_pkginfo_get_pkgid()
1376 static int get_pkg_update(const char *pkgid)
1380 pkgmgrinfo_pkginfo_h handle;
1381 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1382 if (ret != PMINFO_R_OK)
1384 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1385 if (ret != PMINFO_R_OK) {
1386 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1389 printf("pkg update: %d\n", update);
1390 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1395 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1399 * @fn int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid)
1400 * @brief This API gets the package 'uid' value from the view table of user database
1402 * @par This API is for package-manager client application
1403 * @par Sync (or) Async : Synchronous API
1405 * @param[in] uid uid of the user to determine the database
1406 * @param[in] pkgid id of the current package
1407 * @return 1 if it a global package, 0 else
1410 int pkgmgrinfo_pkginfo_is_global(uid_t uid, const char *pkgid);
1414 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1415 * @brief This API gets the package 'accessible' value from the package ID
1417 * @par This API is for package-manager client application
1418 * @par Sync (or) Async : Synchronous API
1420 * @param[in] handle pointer to package info handle
1421 * @param[out] accessible pointer to hold package accessible value
1422 * @return 0 if success, error code(<0) if fail
1423 * @retval PMINFO_R_OK success
1424 * @retval PMINFO_R_EINVAL invalid argument
1425 * @retval PMINFO_R_ERROR internal error
1426 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1427 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1428 * @see pkgmgrinfo_pkginfo_get_pkgid()
1429 * @see pkgmgrinfo_pkginfo_is_readonly()
1431 static int get_pkg_accessible(const char *pkgid)
1435 pkgmgrinfo_pkginfo_h handle;
1436 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1437 if (ret != PMINFO_R_OK)
1439 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1440 if (ret != PMINFO_R_OK) {
1441 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1444 printf("pkg accessible: %d\n", accessible);
1445 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1450 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1453 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1454 * @brief This API destroys the package information handle freeing up all the resources
1456 * @par This API is for package-manager client application
1457 * @par Sync (or) Async : Synchronous API
1459 * @param[in] handle pointer to the package info handle
1460 * @return 0 if success, error code(<0) if fail
1461 * @retval PMINFO_R_OK success
1462 * @retval PMINFO_R_EINVAL invalid argument
1463 * @retval PMINFO_R_ERROR internal error
1464 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1466 * @see pkgmgrinfo_pkginfo_get_pkgid()
1467 * @see pkgmgrinfo_pkginfo_is_removable()
1469 static int get_pkg_type(const char *pkgid)
1473 pkgmgrinfo_pkginfo_h handle;
1474 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1475 if (ret != PMINFO_R_OK)
1477 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1478 if (ret != PMINFO_R_OK) {
1479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1482 printf("pkgtype: %s\n", type);
1483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1488 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1491 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1492 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1493 The query will search the entire package information collected from the manifest file of all the installed packages
1495 * @par This API is for package-manager client application
1496 * @par Sync (or) Async : Synchronous API
1498 * @param[out] handle pointer to the package info filter handle.
1499 * @return 0 if success, error code(<0) if fail
1500 * @retval PMINFO_R_OK success
1501 * @retval PMINFO_R_EINVAL invalid argument
1502 * @retval PMINFO_R_ERROR internal error
1504 * @post pkgmgrinfo_pkginfo_filter_destroy()
1505 * @see pkgmgrinfo_pkginfo_filter_count()
1506 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1508 static int get_rpm_pkg_count()
1512 pkgmgrinfo_pkginfo_filter_h handle;
1513 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1514 if (ret != PMINFO_R_OK)
1516 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1517 if (ret != PMINFO_R_OK) {
1518 pkgmgrinfo_pkginfo_filter_destroy(handle);
1521 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1522 if (ret != PMINFO_R_OK) {
1523 pkgmgrinfo_pkginfo_filter_destroy(handle);
1526 printf("No of rpm pkgs: %d\n", count);
1527 pkgmgrinfo_pkginfo_filter_destroy(handle);
1532 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1535 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1536 * @brief This API destroys the package information filter handle freeing up all the resources
1538 * @par This API is for package-manager client application
1539 * @par Sync (or) Async : Synchronous API
1541 * @param[in] handle pointer to the package info filter handle.
1542 * @return 0 if success, error code(<0) if fail
1543 * @retval PMINFO_R_OK success
1544 * @retval PMINFO_R_EINVAL invalid argument
1545 * @retval PMINFO_R_ERROR internal error
1546 * @pre pkgmgrinfo_pkginfo_filter_create()
1548 * @see pkgmgrinfo_pkginfo_filter_count()
1549 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1551 static int get_rpm_pkg_count()
1555 pkgmgrinfo_pkginfo_filter_h handle;
1556 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1557 if (ret != PMINFO_R_OK)
1559 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1560 if (ret != PMINFO_R_OK) {
1561 pkgmgrinfo_pkginfo_filter_destroy(handle);
1564 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1565 if (ret != PMINFO_R_OK) {
1566 pkgmgrinfo_pkginfo_filter_destroy(handle);
1569 printf("No of rpm pkgs: %d\n", count);
1570 pkgmgrinfo_pkginfo_filter_destroy(handle);
1575 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1578 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1579 * @brief This API adds a boolean filter property to the filter handle
1581 * @par This API is for package-manager client application
1582 * @par Sync (or) Async : Synchronous API
1584 * @param[in] handle pointer to the package info filter handle.
1585 * @param[in] property boolean property name.
1586 * @param[in] value value corresponding to the property.
1587 * @return 0 if success, error code(<0) if fail
1588 * @retval PMINFO_R_OK success
1589 * @retval PMINFO_R_EINVAL invalid argument
1590 * @retval PMINFO_R_ERROR internal error
1591 * @pre pkgmgrinfo_pkginfo_filter_create()
1592 * @post pkgmgrinfo_pkginfo_filter_destroy()
1593 * @see pkgmgrinfo_pkginfo_filter_count()
1594 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1596 static int get_preload_pkg_count()
1600 pkgmgrinfo_pkginfo_filter_h handle;
1601 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1602 if (ret != PMINFO_R_OK)
1604 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1605 if (ret != PMINFO_R_OK) {
1606 pkgmgrinfo_pkginfo_filter_destroy(handle);
1609 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1610 if (ret != PMINFO_R_OK) {
1611 pkgmgrinfo_pkginfo_filter_destroy(handle);
1614 printf("No of preload pkgs: %d\n", count);
1615 pkgmgrinfo_pkginfo_filter_destroy(handle);
1620 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1621 const char *property, const bool value);
1624 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1625 * @brief This API adds an integer filter property to the filter handle
1627 * @par This API is for package-manager client application
1628 * @par Sync (or) Async : Synchronous API
1630 * @param[in] handle pointer to the package info filter handle.
1631 * @param[in] property integer property name.
1632 * @param[in] value value corresponding to the property.
1633 * @return 0 if success, error code(<0) if fail
1634 * @retval PMINFO_R_OK success
1635 * @retval PMINFO_R_EINVAL invalid argument
1636 * @retval PMINFO_R_ERROR internal error
1637 * @pre pkgmgrinfo_pkginfo_filter_create()
1638 * @post pkgmgrinfo_pkginfo_filter_destroy()
1639 * @see pkgmgrinfo_pkginfo_filter_count()
1640 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1642 static int get_pkg_count()
1646 pkgmgrinfo_pkginfo_filter_h handle;
1647 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1648 if (ret != PMINFO_R_OK)
1650 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1651 if (ret != PMINFO_R_OK) {
1652 pkgmgrinfo_pkginfo_filter_destroy(handle);
1655 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1656 if (ret != PMINFO_R_OK) {
1657 pkgmgrinfo_pkginfo_filter_destroy(handle);
1660 printf("No of preload pkgs: %d\n", count);
1661 pkgmgrinfo_pkginfo_filter_destroy(handle);
1666 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1667 const char *property, const int value);
1670 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1671 * @brief This API adds a string filter property to the filter handle
1673 * @par This API is for package-manager client application
1674 * @par Sync (or) Async : Synchronous API
1676 * @param[in] handle pointer to the package info filter handle.
1677 * @param[in] property string property name.
1678 * @param[in] value value corresponding to the property.
1679 * @return 0 if success, error code(<0) if fail
1680 * @retval PMINFO_R_OK success
1681 * @retval PMINFO_R_EINVAL invalid argument
1682 * @retval PMINFO_R_ERROR internal error
1683 * @pre pkgmgrinfo_pkginfo_filter_create()
1684 * @post pkgmgrinfo_pkginfo_filter_destroy()
1685 * @see pkgmgrinfo_pkginfo_filter_count()
1686 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1688 static int get_rpm_pkg_count()
1692 pkgmgrinfo_pkginfo_filter_h handle;
1693 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1694 if (ret != PMINFO_R_OK)
1696 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1697 if (ret != PMINFO_R_OK) {
1698 pkgmgrinfo_pkginfo_filter_destroy(handle);
1701 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1702 if (ret != PMINFO_R_OK) {
1703 pkgmgrinfo_pkginfo_filter_destroy(handle);
1706 printf("No of rpm pkgs: %d\n", count);
1707 pkgmgrinfo_pkginfo_filter_destroy(handle);
1712 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1713 const char *property, const char *value);
1716 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1717 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1719 * @par This API is for package-manager client application
1720 * @par Sync (or) Async : Synchronous API
1722 * @param[in] handle pointer to the package info filter handle.
1723 * @param[in] pkg_cb callback function.
1724 * @param[in] user_data user data to be passed to the callback function
1725 * @return 0 if success, error code(<0) if fail
1726 * @retval PMINFO_R_OK success
1727 * @retval PMINFO_R_EINVAL invalid argument
1728 * @retval PMINFO_R_ERROR internal error
1729 * @pre pkgmgrinfo_pkginfo_filter_create()
1730 * @post pkgmgrinfo_pkginfo_filter_destroy()
1731 * @see pkgmgrinfo_pkginfo_filter_count()
1733 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1736 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1737 printf("pkg id : %s\n", pkgid);
1741 static int get_rpm_pkg_list()
1744 pkgmgrinfo_pkginfo_filter_h handle;
1745 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1746 if (ret != PMINFO_R_OK)
1748 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1749 if (ret != PMINFO_R_OK) {
1750 pkgmgrinfo_pkginfo_filter_destroy(handle);
1753 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1754 if (ret != PMINFO_R_OK) {
1755 pkgmgrinfo_pkginfo_filter_destroy(handle);
1758 pkgmgrinfo_pkginfo_filter_destroy(handle);
1763 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1764 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1765 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1766 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1769 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1770 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1771 * @brief This API counts the package that satisfy the filter conditions
1773 * @par This API is for package-manager client application
1774 * @par Sync (or) Async : Synchronous API
1776 * @param[in] handle pointer to the package info filter handle.
1777 * @param[in] count pointer to store the count value.
1778 * @param[in] uid the addressee user id of the instruction
1779 * @return 0 if success, error code(<0) if fail
1780 * @retval PMINFO_R_OK success
1781 * @retval PMINFO_R_EINVAL invalid argument
1782 * @retval PMINFO_R_ERROR internal error
1783 * @pre pkgmgrinfo_pkginfo_filter_create()
1784 * @post pkgmgrinfo_pkginfo_filter_destroy()
1785 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1787 static int get_rpm_pkg_count()
1791 pkgmgrinfo_pkginfo_filter_h handle;
1792 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1793 if (ret != PMINFO_R_OK)
1795 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1796 if (ret != PMINFO_R_OK) {
1797 pkgmgrinfo_pkginfo_filter_destroy(handle);
1800 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1801 if (ret != PMINFO_R_OK) {
1802 pkgmgrinfo_pkginfo_filter_destroy(handle);
1805 printf("No of rpm pkgs: %d\n", count);
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1812 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1814 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1815 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1816 * @brief This API gets the list of privilege for a particular package
1818 * @par This API is for package-manager client application
1819 * @par Sync (or) Async : Synchronous API
1820 * @param[in] handle pointer to the package info handle.
1821 * @param[in] privilege_func callback function for list
1822 * @param[in] user_data user data to be passed to callback function
1823 * @return 0 if success, error code(<0) if fail
1824 * @retval PMINFO_R_OK success
1825 * @retval PMINFO_R_EINVAL invalid argument
1826 * @retval PMINFO_R_ERROR internal error
1827 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1828 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1830 int privilege_func(const char *name, void *user_data)
1832 if (strcmp(name, (char *)user_data) == 0)
1838 static int list_privilege(const char *package, char *privilege)
1841 pkgmgrinfo_pkginfo_h handle;
1842 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1843 if (ret != PMINFO_R_OK)
1845 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1846 if (ret != PMINFO_R_OK) {
1847 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1850 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1855 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1856 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1858 /* TODO: add doxygen comment here */
1859 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1860 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1861 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1862 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1863 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1864 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1865 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1868 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1869 pkgmgrinfo_app_list_cb app_func, void *user_data)
1870 * @brief This API gets list of installed applications for a particular package
1872 * @par This API is for package-manager client application
1873 * @par Sync (or) Async : Synchronous API
1874 * @param[in] handle package info handle
1875 * @param[in] component application component
1876 * @param[in] app_func iteration function for list
1877 * @param[in] user_data user data to be passed to callback function
1878 * @return 0 if success, error code(<0) if fail
1879 * @retval PMINFO_R_OK success
1880 * @retval PMINFO_R_EINVAL invalid argument
1881 * @retval PMINFO_R_ERROR internal error
1882 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1883 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1885 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1888 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1889 printf("appid : %s\n", appid);
1893 static int list_apps(const char *pkgid)
1896 pkgmgrinfo_pkginfo_h handle;
1897 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1898 if (ret != PMINFO_R_OK)
1900 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1901 if (ret != PMINFO_R_OK) {
1902 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1905 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1910 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1911 pkgmgrinfo_app_list_cb app_func, void *user_data);
1912 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1913 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
1915 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1916 * @brief This API gets list of installed applications from all packages with minimum informaion.
1918 * @par This API is for package-manager client application
1919 * @par Sync (or) Async : Synchronous API
1920 * @param[in] app_func iteration function for list
1921 * @param[in] user_data user data to be passed to callback function
1922 * @return 0 if success, error code(<0) if fail
1923 * @retval PMINFO_R_OK success
1924 * @retval PMINFO_R_EINVAL invalid argument
1925 * @retval PMINFO_R_ERROR internal error
1929 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1931 char *pkgid1 = NULL;
1932 char *pkgid2 = NULL;
1933 pkgid1 = (char *)user_data;
1934 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1935 if (strcmp(pkgid1, pkgid2) == 0) {
1942 static int list_apps()
1945 char *name = "helloworld";
1946 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
1947 if (ret != PMINFO_R_OK) {
1954 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1955 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
1957 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1958 * @brief This API gets list of installed applications from all packages.
1960 * @par This API is for package-manager client application
1961 * @par Sync (or) Async : Synchronous API
1962 * @param[in] app_func iteration function for list
1963 * @param[in] user_data user data to be passed to callback function
1964 * @return 0 if success, error code(<0) if fail
1965 * @retval PMINFO_R_OK success
1966 * @retval PMINFO_R_EINVAL invalid argument
1967 * @retval PMINFO_R_ERROR internal error
1971 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1973 char *pkgid1 = NULL;
1974 char *pkgid2 = NULL;
1975 pkgid1 = (char *)user_data;
1976 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1977 if (strcmp(pkgid1, pkgid2) == 0) {
1984 static int list_apps()
1987 char *name = "helloworld";
1988 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
1989 if (ret != PMINFO_R_OK) {
1996 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1997 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2000 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2001 * @brief This API creates the application information handle from db
2003 * @par This API is for package-manager client application
2004 * @par Sync (or) Async : Synchronous API
2006 * @param[in] appid pointer to appid
2007 * @param[out] handle pointer to the application info handle.
2008 * @return 0 if success, error code(<0) if fail
2009 * @retval PMINFO_R_OK success
2010 * @retval PMINFO_R_EINVAL invalid argument
2011 * @retval PMINFO_R_ERROR internal error
2013 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2014 * @see pkgmgrinfo_appinfo_get_pkgid()
2015 * @see pkgmgrinfo_appinfo_is_multiple()
2017 static int get_app_type(const char *appid)
2021 pkgmgrinfo_appinfo_h handle;
2022 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2023 if (ret != PMINFO_R_OK)
2025 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2026 if (ret != PMINFO_R_OK) {
2027 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2030 printf("apptype: %s\n", type);
2031 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2036 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2037 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2039 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2040 * @brief This API gets the application ID
2042 * @par This API is for package-manager client application
2043 * @par Sync (or) Async : Synchronous API
2045 * @param[in] handle pointer to the application info handle.
2046 * @param[out] appid pointer to hold appid
2047 * @return 0 if success, error code(<0) if fail
2048 * @retval PMINFO_R_OK success
2049 * @retval PMINFO_R_EINVAL invalid argument
2050 * @retval PMINFO_R_ERROR internal error
2051 * @pre pkgmgrinfo_appinfo_get_appinfo()
2052 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2053 * @see pkgmgrinfo_appinfo_get_pkgid()
2054 * @see pkgmgrinfo_appinfo_is_multiple()
2056 static int get_app_id(const char *appid)
2059 char *app_id = NULL;
2060 pkgmgrinfo_appinfo_h handle;
2061 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2062 if (ret != PMINFO_R_OK)
2064 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2065 if (ret != PMINFO_R_OK) {
2066 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2069 printf("app id: %s\n", app_id);
2070 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2075 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2078 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2079 * @brief This API gets the package name of the application
2081 * @par This API is for package-manager client application
2082 * @par Sync (or) Async : Synchronous API
2084 * @param[in] handle pointer to the application info handle.
2085 * @param[out] pkg_name pointer to hold package name
2086 * @return 0 if success, error code(<0) if fail
2087 * @retval PMINFO_R_OK success
2088 * @retval PMINFO_R_EINVAL invalid argument
2089 * @retval PMINFO_R_ERROR internal error
2090 * @pre pkgmgrinfo_appinfo_get_appinfo()
2091 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2092 * @see pkgmgrinfo_appinfo_get_appid()
2093 * @see pkgmgrinfo_appinfo_is_multiple()
2095 static int get_app_pkgname(const char *appid)
2098 char *pkgname = NULL;
2099 pkgmgrinfo_appinfo_h handle;
2100 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2101 if (ret != PMINFO_R_OK)
2103 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2104 if (ret != PMINFO_R_OK) {
2105 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2108 printf("pkg name: %s\n", pkgname);
2109 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2114 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2117 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2118 * @brief This API gets the package id of the application
2120 * @par This API is for package-manager client application
2121 * @par Sync (or) Async : Synchronous API
2123 * @param[in] handle pointer to the application info handle.
2124 * @param[out] pkgid pointer to hold package id
2125 * @return 0 if success, error code(<0) if fail
2126 * @retval PMINFO_R_OK success
2127 * @retval PMINFO_R_EINVAL invalid argument
2128 * @retval PMINFO_R_ERROR internal error
2129 * @pre pkgmgrinfo_appinfo_get_appinfo()
2130 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2131 * @see pkgmgrinfo_appinfo_get_appid()
2132 * @see pkgmgrinfo_appinfo_is_multiple()
2134 static int get_app_pkgid(const char *appid)
2138 pkgmgrinfo_appinfo_h handle;
2139 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2140 if (ret != PMINFO_R_OK)
2142 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2143 if (ret != PMINFO_R_OK) {
2144 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2147 printf("pkg id: %s\n", pkgid);
2148 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2153 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2156 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2157 * @brief This API gets the executable name of the application
2159 * @par This API is for package-manager client application
2160 * @par Sync (or) Async : Synchronous API
2162 * @param[in] handle pointer to the application info handle.
2163 * @param[out] exec pointer to hold app exec name
2164 * @return 0 if success, error code(<0) if fail
2165 * @retval PMINFO_R_OK success
2166 * @retval PMINFO_R_EINVAL invalid argument
2167 * @retval PMINFO_R_ERROR internal error
2168 * @pre pkgmgrinfo_appinfo_get_appinfo()
2169 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2170 * @see pkgmgrinfo_appinfo_get_appid()
2171 * @see pkgmgrinfo_appinfo_is_multiple()
2173 static int get_app_exec(const char *appid)
2177 pkgmgrinfo_appinfo_h handle;
2178 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2179 if (ret != PMINFO_R_OK)
2181 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2182 if (ret != PMINFO_R_OK) {
2183 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2186 printf("exec name: %s\n", exec);
2187 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2192 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2195 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2196 * @brief This API gets the icon name of the application
2198 * @par This API is for package-manager client application
2199 * @par Sync (or) Async : Synchronous API
2201 * @param[in] handle pointer to the application info handle.
2202 * @param[out] icon pointer to hold app icon name
2203 * @return 0 if success, error code(<0) if fail
2204 * @retval PMINFO_R_OK success
2205 * @retval PMINFO_R_EINVAL invalid argument
2206 * @retval PMINFO_R_ERROR internal error
2207 * @pre pkgmgrinfo_appinfo_get_appinfo()
2208 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2209 * @see pkgmgrinfo_appinfo_get_appid()
2210 * @see pkgmgrinfo_appinfo_is_multiple()
2212 static int get_app_icon(const char *appid)
2216 pkgmgrinfo_appinfo_h handle;
2217 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2218 if (ret != PMINFO_R_OK)
2220 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2221 if (ret != PMINFO_R_OK) {
2222 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2225 printf("icon name: %s\n", icon);
2226 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2231 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2234 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2235 * @brief This API gets the label of the application
2237 * @par This API is for package-manager client application
2238 * @par Sync (or) Async : Synchronous API
2240 * @param[in] handle pointer to the application info handle.
2241 * @param[out] label pointer to hold app label
2242 * @return 0 if success, error code(<0) if fail
2243 * @retval PMINFO_R_OK success
2244 * @retval PMINFO_R_EINVAL invalid argument
2245 * @retval PMINFO_R_ERROR internal error
2246 * @pre pkgmgrinfo_appinfo_get_appinfo()
2247 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2248 * @see pkgmgrinfo_appinfo_get_appid()
2249 * @see pkgmgrinfo_appinfo_is_multiple()
2251 static int get_app_label(const char *appid)
2255 pkgmgrinfo_appinfo_h handle;
2256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2257 if (ret != PMINFO_R_OK)
2259 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2260 if (ret != PMINFO_R_OK) {
2261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2264 printf("label : %s\n", label);
2265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2270 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2273 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2274 * @brief This API gets exactly matched label by given appid and locale
2276 * @par This API is for package-manager client application
2277 * @par Sync (or) Async : Synchronous API
2279 * @param[in] appid pointer to appid
2280 * @param[in] locale pointer to locale
2281 * @param[out] label pointer to hold app label
2282 * @return 0 if success, error code(<0) if fail
2283 * @retval PMINFO_R_OK success
2284 * @retval PMINFO_R_EINVAL invalid argument
2285 * @retval PMINFO_R_ERROR internal error
2287 static int get_localed_label(const char *appid, const char *locale)
2292 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2293 if (ret != PMINFO_R_OK)
2296 printf("localed label: %s\n", label);
2304 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2305 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2308 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2309 * @brief This API gets the component of the application
2311 * @par This API is for package-manager client application
2312 * @par Sync (or) Async : Synchronous API
2314 * @param[in] handle pointer to the application info handle.
2315 * @param[out] component pointer to hold app component
2316 * @return 0 if success, error code(<0) if fail
2317 * @retval PMINFO_R_OK success
2318 * @retval PMINFO_R_EINVAL invalid argument
2319 * @retval PMINFO_R_ERROR internal error
2320 * @pre pkgmgrinfo_appinfo_get_appinfo()
2321 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2322 * @see pkgmgrinfo_appinfo_get_appid()
2323 * @see pkgmgrinfo_appinfo_is_multiple()
2325 static int get_app_component(const char *appid)
2328 pkgmgrinfo_app_component component;
2329 pkgmgrinfo_appinfo_h handle;
2330 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2331 if (ret != PMINFO_R_OK)
2333 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2334 if (ret != PMINFO_R_OK) {
2335 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2338 printf("component : %s\n", component);
2339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2344 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2347 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2348 * @brief This API gets the apptype of the application
2350 * @par This API is for package-manager client application
2351 * @par Sync (or) Async : Synchronous API
2353 * @param[in] handle pointer to the application info handle.
2354 * @param[out] app_type pointer to hold apptype
2355 * @return 0 if success, error code(<0) if fail
2356 * @retval PMINFO_R_OK success
2357 * @retval PMINFO_R_EINVAL invalid argument
2358 * @retval PMINFO_R_ERROR internal error
2359 * @pre pkgmgrinfo_appinfo_get_appinfo()
2360 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2361 * @see pkgmgrinfo_appinfo_get_appid()
2362 * @see pkgmgrinfo_appinfo_is_multiple()
2364 static int get_app_type(const char *appid)
2367 char *apptype = NULL;
2368 pkgmgrinfo_appinfo_h handle;
2369 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2370 if (ret != PMINFO_R_OK)
2372 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2373 if (ret != PMINFO_R_OK) {
2374 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2377 printf("apptype : %s\n", apptype);
2378 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2383 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2386 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2387 int *operation_count, char ***operation)
2388 * @brief This API gets the list of operation of the application
2390 * @par This API is for package-manager client application
2391 * @par Sync (or) Async : Synchronous API
2393 * @param[in] handle pointer to the appcontrol handle.
2394 * @param[out] operation_count pointer to hold number of operations
2395 * @param[out] operation pointer to hold list of operations
2396 * @return 0 if success, error code(<0) if fail
2397 * @retval PMINFO_R_OK success
2398 * @retval PMINFO_R_EINVAL invalid argument
2399 * @retval PMINFO_R_ERROR internal error
2400 * @pre pkgmgrinfo_appinfo_get_appinfo()
2401 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2402 * @see pkgmgrinfo_appinfo_get_uri()
2403 * @see pkgmgrinfo_appinfo_get_mime()
2405 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2410 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2411 for (i = 0; i < oc; i++) {
2412 if (strcmp(operation[i], (char *)user_data) == 0)
2419 static int check_operation(const char *appid, char *operation)
2422 pkgmgrinfo_appinfo_h handle;
2423 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2424 if (ret != PMINFO_R_OK)
2426 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2427 if (ret != PMINFO_R_OK) {
2428 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2431 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2436 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2437 int *operation_count, char ***operation);
2440 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2441 int *uri_count, char ***uri)
2442 * @brief This API gets the list of uri of the application
2444 * @par This API is for package-manager client application
2445 * @par Sync (or) Async : Synchronous API
2447 * @param[in] handle pointer to the appcontrol handle.
2448 * @param[out] uri_count pointer to hold number of uris
2449 * @param[out] uri pointer to hold list of uris
2450 * @return 0 if success, error code(<0) if fail
2451 * @retval PMINFO_R_OK success
2452 * @retval PMINFO_R_EINVAL invalid argument
2453 * @retval PMINFO_R_ERROR internal error
2454 * @pre pkgmgrinfo_appinfo_get_appinfo()
2455 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2456 * @see pkgmgrinfo_appinfo_get_operation()
2457 * @see pkgmgrinfo_appinfo_get_mime()
2459 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2464 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2465 for (i = 0; i < uc; i++) {
2466 if (strcmp(uri[i], (char *)user_data) == 0)
2473 static int check_uri(const char *appid, char *uri)
2476 pkgmgrinfo_appinfo_h handle;
2477 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2478 if (ret != PMINFO_R_OK)
2480 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2481 if (ret != PMINFO_R_OK) {
2482 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2485 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2490 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2491 int *uri_count, char ***uri);
2494 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2495 int *mime_count, char ***mime)
2496 * @brief This API gets the list of mime of the application
2498 * @par This API is for package-manager client application
2499 * @par Sync (or) Async : Synchronous API
2501 * @param[in] handle pointer to the appcontrol handle.
2502 * @param[out] mime_count pointer to hold number of mimes
2503 * @param[out] mime pointer to hold list of mimes
2504 * @return 0 if success, error code(<0) if fail
2505 * @retval PMINFO_R_OK success
2506 * @retval PMINFO_R_EINVAL invalid argument
2507 * @retval PMINFO_R_ERROR internal error
2508 * @pre pkgmgrinfo_appinfo_get_appinfo()
2509 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2510 * @see pkgmgrinfo_appinfo_get_uri()
2511 * @see pkgmgrinfo_appinfo_get_operation()
2513 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2518 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2519 for (i = 0; i < mc; i++) {
2520 if (strcmp(mime[i], (char *)user_data) == 0)
2527 static int check_mime(const char *appid, char *mime)
2530 pkgmgrinfo_appinfo_h handle;
2531 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2532 if (ret != PMINFO_R_OK)
2534 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2535 if (ret != PMINFO_R_OK) {
2536 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2539 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2544 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2545 int *mime_count, char ***mime);
2548 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2549 int *subapp_count, char ***subapp)
2550 * @brief This API gets the list of subapp of the application
2552 * @par This API is for package-manager client application
2553 * @par Sync (or) Async : Synchronous API
2555 * @param[in] handle pointer to the appcontrol handle.
2556 * @param[out] subapp_count pointer to hold number of subapp
2557 * @param[out] subapp pointer to hold list of subapp
2558 * @return 0 if success, error code(<0) if fail
2559 * @retval PMINFO_R_OK success
2560 * @retval PMINFO_R_EINVAL invalid argument
2561 * @retval PMINFO_R_ERROR internal error
2562 * @pre pkgmgrinfo_appinfo_get_appinfo()
2563 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2564 * @see pkgmgrinfo_appinfo_get_uri()
2565 * @see pkgmgrinfo_appinfo_get_operation()
2567 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2571 char **subapp = NULL;
2572 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2573 for (i = 0; i < sc; i++) {
2574 if (strcmp(subapp[i], (char *)user_data) == 0)
2581 static int check_subapp(const char *appid, char *subapp)
2584 pkgmgrinfo_appinfo_h handle = NULL;
2585 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2586 if (ret != PMINFO_R_OK)
2588 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2589 if (ret != PMINFO_R_OK) {
2590 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2593 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2598 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2599 int *subapp_count, char ***subapp);
2602 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2603 * @brief This API gets the notification icon of the application
2605 * @par This API is for package-manager client application
2606 * @par Sync (or) Async : Synchronous API
2608 * @param[in] handle pointer to the application info handle.
2609 * @param[out] path pointer to hold notification icon
2610 * @return 0 if success, error code(<0) if fail
2611 * @retval PMINFO_R_OK success
2612 * @retval PMINFO_R_EINVAL invalid argument
2613 * @retval PMINFO_R_ERROR internal error
2614 * @pre pkgmgrinfo_appinfo_get_appinfo()
2615 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2616 * @see pkgmgrinfo_appinfo_get_appid()
2617 * @see pkgmgrinfo_appinfo_is_multiple()
2619 static int get_app_notification_icon(const char *appid)
2622 char *notification_icon = NULL;
2623 pkgmgrinfo_appinfo_h handle;
2624 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2625 if (ret != PMINFO_R_OK)
2627 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2628 if (ret != PMINFO_R_OK) {
2629 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2632 printf("notification icon : %s\n", notification_icon);
2633 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2638 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2641 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2642 * @brief This API gets the setting icon of the application
2644 * @par This API is for package-manager client application
2645 * @par Sync (or) Async : Synchronous API
2647 * @param[in] handle pointer to the application info handle.
2648 * @param[out] path pointer to hold setting icon
2649 * @return 0 if success, error code(<0) if fail
2650 * @retval PMINFO_R_OK success
2651 * @retval PMINFO_R_EINVAL invalid argument
2652 * @retval PMINFO_R_ERROR internal error
2653 * @pre pkgmgrinfo_appinfo_get_appinfo()
2654 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2655 * @see pkgmgrinfo_appinfo_get_appid()
2656 * @see pkgmgrinfo_appinfo_is_multiple()
2658 static int get_app_setting_icon(const char *appid)
2661 char *setting_icon = NULL;
2662 pkgmgrinfo_appinfo_h handle;
2663 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2664 if (ret != PMINFO_R_OK)
2666 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2667 if (ret != PMINFO_R_OK) {
2668 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2671 printf("setting icon : %s\n", setting_icon);
2672 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2677 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2680 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2681 * @brief This API gets the type of recent image on app-tray
2683 * @par This API is for package-manager client application
2684 * @par Sync (or) Async : Synchronous API
2686 * @param[in] handle pointer to the application info handle.
2687 * @param[out] type pointer to hold image type
2688 * @return 0 if success, error code(<0) if fail
2689 * @retval PMINFO_R_OK success
2690 * @retval PMINFO_R_EINVAL invalid argument
2691 * @retval PMINFO_R_ERROR internal error
2692 * @pre pkgmgrinfo_appinfo_get_appinfo()
2693 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2694 * @see pkgmgrinfo_appinfo_get_appid()
2695 * @see pkgmgrinfo_appinfo_is_multiple()
2697 static int get_app_recent_image_type(const char *appid)
2700 pkgmgrinfo_app_recentimage type;
2701 pkgmgrinfo_appinfo_h handle;
2702 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2703 if (ret != PMINFO_R_OK)
2705 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2706 if (ret != PMINFO_R_OK) {
2707 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2710 printf("recent image type: %d\n", type);
2711 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2716 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2720 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2721 * @brief This API gets the preview image of application
2723 * @par Sync (or) Async : Synchronous API
2725 * @param[in] handle pointer to the application info handle.
2726 * @param[out] preview_img pointer to hold preview image path
2727 * @return 0 if success, error code(<0) if fail
2728 * @retval PMINFO_R_OK success
2729 * @retval PMINFO_R_EINVAL invalid argument
2730 * @retval PMINFO_R_ERROR internal error
2731 * @pre pkgmgrinfo_appinfo_get_appinfo()
2732 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2733 * @see pkgmgrinfo_appinfo_get_appid()
2735 static int get_app_previewimage(const char *appid)
2738 char *preview = NULL;
2739 pkgmgrinfo_appinfo_h handle = NULL;
2740 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2741 if (ret != PMINFO_R_OK)
2743 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2744 if (ret != PMINFO_R_OK) {
2745 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2748 printf("preview image path : %s\n", preview);
2749 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2754 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2758 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2759 * @brief This API gets the package permission type of the application
2761 * @par This API is for package-manager client application
2762 * @par Sync (or) Async : Synchronous API
2764 * @param[in] handle pointer to the application info handle.
2765 * @param[out] permission pointer to hold package permission
2766 * @return 0 if success, error code(<0) if fail
2767 * @retval PMINFO_R_OK success
2768 * @retval PMINFO_R_EINVAL invalid argument
2769 * @retval PMINFO_R_ERROR internal error
2770 * @pre pkgmgrinfo_appinfo_get_appinfo()
2771 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2772 * @see pkgmgrinfo_appinfo_get_appid()
2774 static int get_app_permission(const char *appid)
2777 pkgmgrinfo_permission_type permission = 0;
2778 pkgmgrinfo_appinfo_h handle;
2780 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2781 if (ret != PMINFO_R_OK)
2783 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2784 if (ret != PMINFO_R_OK) {
2785 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2788 printf("permission type: %d\n", permission);
2789 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2794 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2797 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2798 * @brief This API gets the component_type
2800 * @par This API is for package-manager client application
2801 * @par Sync (or) Async : Synchronous API
2803 * @param[in] handle pointer to the application info handle.
2804 * @param[out] component_type pointer to hold component_type
2805 * @return 0 if success, error code(<0) if fail
2806 * @retval PMINFO_R_OK success
2807 * @retval PMINFO_R_EINVAL invalid argument
2808 * @retval PMINFO_R_ERROR internal error
2809 * @pre pkgmgrinfo_appinfo_get_appinfo()
2810 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2811 * @see pkgmgrinfo_appinfo_get_pkgid()
2812 * @see pkgmgrinfo_appinfo_is_multiple()
2814 static int get_component_type(const char *appid)
2817 char *component_type = NULL;
2818 pkgmgrinfo_appinfo_h handle;
2819 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2820 if (ret != PMINFO_R_OK)
2822 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2823 if (ret != PMINFO_R_OK) {
2824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2827 printf("component_type: %s\n", component_type);
2828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2833 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2836 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2837 * @brief This API gets the application 'hwacceleration' value from the app ID
2839 * @par This API is for package-manager client application
2840 * @par Sync (or) Async : Synchronous API
2842 * @param[in] handle pointer to application info handle
2843 * @param[out] hwacceleration pointer to hold package hwacceleration value
2844 * @return 0 if success, error code(<0) if fail
2845 * @retval PMINFO_R_OK success
2846 * @retval PMINFO_R_EINVAL invalid argument
2847 * @retval PMINFO_R_ERROR internal error
2848 * @pre pkgmgrinfo_appinfo_get_appinfo()
2849 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2850 * @see pkgmgrinfo_appinfo_get_appid()
2851 * @see pkgmgrinfo_appinfo_is_multiple()
2853 static int get_app_hwacceleration(const char *appid)
2856 pkgmgrinfo_app_hwacceleration hwacceleration;
2857 pkgmgrinfo_appinfo_h handle;
2858 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2859 if (ret != PMINFO_R_OK)
2861 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2862 if (ret != PMINFO_R_OK) {
2863 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2866 printf("app hwacceleration: %d\n", hwacceleration);
2867 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2872 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2875 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
2876 * @brief This API gets the application 'screenreader' value from the app ID
2878 * @par This API is for package-manager client application
2879 * @par Sync (or) Async : Synchronous API
2881 * @param[in] handle pointer to application info handle
2882 * @param[out] screenreader pointer to hold package accessibility value
2883 * @return 0 if success, error code(<0) if fail
2884 * @retval PMINFO_R_OK success
2885 * @retval PMINFO_R_EINVAL invalid argument
2886 * @retval PMINFO_R_ERROR internal error
2887 * @pre pkgmgrinfo_appinfo_get_appinfo()
2888 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2889 * @see pkgmgrinfo_appinfo_get_appid()
2890 * @see pkgmgrinfo_appinfo_is_multiple()
2892 static int get_app_screenreader(const char *appid)
2895 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
2896 pkgmgrinfo_appinfo_h handle = NULL;
2897 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2898 if (ret != PMINFO_R_OK)
2900 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
2901 if (ret != PMINFO_R_OK) {
2902 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2905 printf("app screenreader: %d\n", screenreader);
2906 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2911 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
2914 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2915 * @brief This API gets the application's landscape & portrait effect images
2917 * @par This API is for package-manager client application
2918 * @par Sync (or) Async : Synchronous API
2920 * @param[in] handle pointer to application info handle
2921 * @param[out] portrait_img contains portrait mode effect image
2922 * @param[out] landscape_img contains landscape mode effect image
2923 * @return 0 if success, error code(<0) if fail
2924 * @retval PMINFO_R_OK success
2925 * @retval PMINFO_R_EINVAL invalid argument
2926 * @retval PMINFO_R_ERROR internal error
2927 * @pre pkgmgrinfo_appinfo_get_appinfo()
2928 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2929 * @see pkgmgrinfo_appinfo_get_appid()
2930 * @see pkgmgrinfo_appinfo_is_nodisplay()
2932 static int get_app_effectimages(const char *appid)
2935 char *portraitimg = NULL;
2936 char *landscapeimg = NULL;
2937 pkgmgrinfo_appinfo_h handle;
2938 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2939 if (ret != PMINFO_R_OK)
2941 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2942 if (ret != PMINFO_R_OK) {
2943 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2946 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2947 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2952 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
2955 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
2956 * @brief This API gets the submode_mainid of the application
2958 * @par This API is for package-manager client application
2959 * @par Sync (or) Async : Synchronous API
2961 * @param[in] handle pointer to the application info handle.
2962 * @param[out] submode_mainid pointer to hold package name
2963 * @return 0 if success, error code(<0) if fail
2964 * @retval PMINFO_R_OK success
2965 * @retval PMINFO_R_EINVAL invalid argument
2966 * @retval PMINFO_R_ERROR internal error
2967 * @pre pkgmgrinfo_appinfo_get_appinfo()
2968 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2969 * @see pkgmgrinfo_appinfo_get_appid()
2970 * @see pkgmgrinfo_appinfo_is_multiple()
2972 static int get_app_submode_mainid(const char *appid)
2975 char *submode_mainid = NULL;
2976 pkgmgrinfo_appinfo_h handle = NULL;
2977 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2978 if (ret != PMINFO_R_OK)
2980 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
2981 if (ret != PMINFO_R_OK) {
2982 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2985 printf("submode_mainid: %s\n", submode_mainid);
2986 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2991 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
2994 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
2995 * @brief This API gets the datacontrol info
2997 * @par This API is for package-manager client application
2998 * @par Sync (or) Async : Synchronous API
3000 * @param[in] providerid pointer to the providerid of dataconltrol.
3001 * @param[in] type pointer to the type of dataconltrol.
3002 * @param[out] appid pointer to hold appid, need to free after using
3003 * @param[out] access pointer to hold access, need to free after using
3004 * @return 0 if success, error code(<0) if fail
3005 * @retval PMINFO_R_OK success
3006 * @retval PMINFO_R_EINVAL invalid argument
3007 * @retval PMINFO_R_ERROR internal error
3010 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3011 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3014 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3015 * @brief This API gets the appid of datacontrol
3017 * @par This API is for package-manager client application
3018 * @par Sync (or) Async : Synchronous API
3020 * @param[in] providerid pointer to the providerid of dataconltrol.
3021 * @param[out] appid pointer to hold appid, need to free after using
3022 * @return 0 if success, error code(<0) if fail
3023 * @retval PMINFO_R_OK success
3024 * @retval PMINFO_R_EINVAL invalid argument
3025 * @retval PMINFO_R_ERROR internal error
3028 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3029 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3032 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3033 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3034 * @brief This API gets the list of permission for a particular application
3036 * @par This API is for package-manager client application
3037 * @par Sync (or) Async : Synchronous API
3038 * @param[in] handle pointer to the application info handle.
3039 * @param[in] permission_func callback function for list
3040 * @param[in] user_data user data to be passed to callback function
3041 * @return 0 if success, error code(<0) if fail
3042 * @retval PMINFO_R_OK success
3043 * @retval PMINFO_R_EINVAL invalid argument
3044 * @retval PMINFO_R_ERROR internal error
3045 * @pre pkgmgrinfo_appinfo_get_appinfo()
3046 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3048 int permission_func(const char *name, void *user_data)
3050 if (strcmp(name, (char *)user_data) == 0)
3056 static int list_permission(const char *appid, char *permission)
3059 pkgmgrinfo_appinfo_h handle;
3060 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3061 if (ret != PMINFO_R_OK)
3063 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3064 if (ret != PMINFO_R_OK) {
3065 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3068 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3073 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3074 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3077 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3078 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3079 * @brief This API gets the list of category for a particular application
3081 * @par This API is for package-manager client application
3082 * @par Sync (or) Async : Synchronous API
3083 * @param[in] handle pointer to the application info handle.
3084 * @param[in] category_func callback function for list
3085 * @param[in] user_data user data to be passed to callback function
3086 * @return 0 if success, error code(<0) if fail
3087 * @retval PMINFO_R_OK success
3088 * @retval PMINFO_R_EINVAL invalid argument
3089 * @retval PMINFO_R_ERROR internal error
3090 * @pre pkgmgrinfo_appinfo_get_appinfo()
3091 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3093 int category_func(const char *name, void *user_data)
3095 if (strcmp(name, (char *)user_data) == 0)
3101 static int list_category(const char *appid, char *category)
3104 pkgmgrinfo_appinfo_h handle;
3105 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3106 if (ret != PMINFO_R_OK)
3108 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3109 if (ret != PMINFO_R_OK) {
3110 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3113 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3118 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3119 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3122 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3123 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3124 * @brief This API gets the list of metadata for a particular application
3126 * @par This API is for package-manager client application
3127 * @par Sync (or) Async : Synchronous API
3128 * @param[in] handle pointer to the application info handle.
3129 * @param[in] metadata_func callback function for list
3130 * @param[in] user_data user data to be passed to callback function
3131 * @return 0 if success, error code(<0) if fail
3132 * @retval PMINFO_R_OK success
3133 * @retval PMINFO_R_EINVAL invalid argument
3134 * @retval PMINFO_R_ERROR internal error
3135 * @pre pkgmgrinfo_appinfo_get_appinfo()
3136 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3138 int metadata_func(const char *key, const char *value, void *user_data)
3140 if (strcmp(key, (char *)user_data) == 0) {
3141 printf("Value is %s\n", value);
3148 static int list_metadata(const char *appid, char *key)
3151 pkgmgrinfo_appinfo_h handle;
3152 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3153 if (ret != PMINFO_R_OK)
3155 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3156 if (ret != PMINFO_R_OK) {
3157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3165 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3166 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3170 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3171 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3172 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3173 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3174 * @brief This API gets the list of app-control for a particular application
3176 * @par This API is for package-manager client application
3177 * @par Sync (or) Async : Synchronous API
3178 * @param[in] handle pointer to the application info handle.
3179 * @param[in] appcontrol_func callback function for list
3180 * @param[in] user_data user data to be passed to callback function
3181 * @param[in] uid the addressee user id of the instruction
3182 * @return 0 if success, error code(<0) if fail
3183 * @retval PMINFO_R_OK success
3184 * @retval PMINFO_R_EINVAL invalid argument
3185 * @retval PMINFO_R_ERROR internal error
3186 * @pre pkgmgrinfo_appinfo_get_appinfo()
3187 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3189 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3194 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3195 for (i = 0; i < oc; i++) {
3196 if (strcmp(operation[i], (char *)user_data) == 0)
3203 static int check_operation(const char *appid, char *operation)
3206 pkgmgrinfo_appinfo_h handle;
3207 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3208 if (ret != PMINFO_R_OK)
3210 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3211 if (ret != PMINFO_R_OK) {
3212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3220 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3221 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3224 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3225 * @brief This API gets the application 'nodisplay' value from the app ID
3227 * @par This API is for package-manager client application
3228 * @par Sync (or) Async : Synchronous API
3230 * @param[in] handle pointer to application info handle
3231 * @param[out] nodisplay pointer to hold package nodisplay value
3232 * @return 0 if success, error code(<0) if fail
3233 * @retval PMINFO_R_OK success
3234 * @retval PMINFO_R_EINVAL invalid argument
3235 * @retval PMINFO_R_ERROR internal error
3236 * @pre pkgmgrinfo_appinfo_get_appinfo()
3237 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3238 * @see pkgmgrinfo_appinfo_get_appid()
3239 * @see pkgmgrinfo_appinfo_is_multiple()
3241 static int get_app_nodisplay(const char *appid)
3245 pkgmgrinfo_appinfo_h handle;
3246 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3247 if (ret != PMINFO_R_OK)
3249 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3250 if (ret != PMINFO_R_OK) {
3251 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3254 printf("app nodisplay: %d\n", nodisplay);
3255 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3260 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3263 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3264 * @brief This API gets the application 'multiple' value from the app ID
3266 * @par This API is for package-manager client application
3267 * @par Sync (or) Async : Synchronous API
3269 * @param[in] handle pointer to application info handle
3270 * @param[out] multiple pointer to hold package multiple value
3271 * @return 0 if success, error code(<0) if fail
3272 * @retval PMINFO_R_OK success
3273 * @retval PMINFO_R_EINVAL invalid argument
3274 * @retval PMINFO_R_ERROR internal error
3275 * @pre pkgmgrinfo_appinfo_get_appinfo()
3276 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3277 * @see pkgmgrinfo_appinfo_get_appid()
3278 * @see pkgmgrinfo_appinfo_is_nodisplay()
3280 static int get_app_multiple(const char *appid)
3284 pkgmgrinfo_appinfo_h handle;
3285 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3286 if (ret != PMINFO_R_OK)
3288 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3289 if (ret != PMINFO_R_OK) {
3290 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3293 printf("app multiple: %d\n", multiple);
3294 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3299 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3302 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3303 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3304 * application launching effect. If fales, indicator will be hidden during application launching effect
3306 * @par This API is for package-manager client application
3307 * @par Sync (or) Async : Synchronous API
3309 * @param[in] handle pointer to application info handle
3310 * @param[out] indicator_disp contains indicator display status for application launching effect
3311 * @return 0 if success, error code(<0) if fail
3312 * @retval PMINFO_R_OK success
3313 * @retval PMINFO_R_EINVAL invalid argument
3314 * @retval PMINFO_R_ERROR internal error
3315 * @pre pkgmgrinfo_appinfo_get_appinfo()
3316 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3317 * @see pkgmgrinfo_appinfo_get_appid()
3318 * @see pkgmgrinfo_appinfo_is_nodisplay()
3320 static int get_app_indicator_display(const char *appid)
3323 bool indicator_disp;
3324 pkgmgrinfo_appinfo_h handle;
3325 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3326 if (ret != PMINFO_R_OK)
3328 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3329 if (ret != PMINFO_R_OK){
3330 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3333 printf("app indicator disp : %d\n", indicator_disp);
3334 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3339 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3342 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3343 * @brief This API gets the application 'taskmanage' value from the app ID
3345 * @par This API is for package-manager client application
3346 * @par Sync (or) Async : Synchronous API
3348 * @param[in] handle pointer to application info handle
3349 * @param[out] taskmanage pointer to hold package taskmanage value
3350 * @return 0 if success, error code(<0) if fail
3351 * @retval PMINFO_R_OK success
3352 * @retval PMINFO_R_EINVAL invalid argument
3353 * @retval PMINFO_R_ERROR internal error
3354 * @pre pkgmgrinfo_appinfo_get_appinfo()
3355 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3356 * @see pkgmgrinfo_appinfo_get_appid()
3357 * @see pkgmgrinfo_appinfo_is_multiple()
3359 static int get_app_taskmanage(const char *appid)
3363 pkgmgrinfo_appinfo_h handle;
3364 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3365 if (ret != PMINFO_R_OK)
3367 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3368 if (ret != PMINFO_R_OK) {
3369 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3372 printf("app taskmanage: %d\n", taskmanage);
3373 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3378 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3381 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3382 * @brief This API gets the application 'taskmanage' value from the app ID
3384 * @par This API is for package-manager client application
3385 * @par Sync (or) Async : Synchronous API
3387 * @param[in] handle pointer to application info handle
3388 * @param[out] enabled pointer to hold package enabled value
3389 * @return 0 if success, error code(<0) if fail
3390 * @retval PMINFO_R_OK success
3391 * @retval PMINFO_R_EINVAL invalid argument
3392 * @retval PMINFO_R_ERROR internal error
3393 * @pre pkgmgrinfo_appinfo_get_appinfo()
3394 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3395 * @see pkgmgrinfo_appinfo_get_appid()
3396 * @see pkgmgrinfo_appinfo_is_multiple()
3398 static int get_app_enabled(const char *appid)
3402 pkgmgrinfo_appinfo_h handle;
3403 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3404 if (ret != PMINFO_R_OK)
3406 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3407 if (ret != PMINFO_R_OK) {
3408 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3411 printf("app enabled: %d\n", enabled);
3412 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3417 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3420 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3421 * @brief This API gets the application 'onboot' value from the app ID
3423 * @par This API is for package-manager client application
3424 * @par Sync (or) Async : Synchronous API
3426 * @param[in] handle pointer to application info handle
3427 * @param[out] onboot pointer to hold package onboot value
3428 * @return 0 if success, error code(<0) if fail
3429 * @retval PMINFO_R_OK success
3430 * @retval PMINFO_R_EINVAL invalid argument
3431 * @retval PMINFO_R_ERROR internal error
3432 * @pre pkgmgrinfo_appinfo_get_appinfo()
3433 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3434 * @see pkgmgrinfo_appinfo_get_appid()
3435 * @see pkgmgrinfo_appinfo_is_multiple()
3437 static int get_app_onboot(const char *appid)
3441 pkgmgrinfo_appinfo_h handle;
3442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3443 if (ret != PMINFO_R_OK)
3445 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3446 if (ret != PMINFO_R_OK) {
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3450 printf("app onboot: %d\n", onboot);
3451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3459 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3460 * @brief This API gets the application 'autorestart' value from the app ID
3462 * @par This API is for package-manager client application
3463 * @par Sync (or) Async : Synchronous API
3465 * @param[in] handle pointer to application info handle
3466 * @param[out] autorestart pointer to hold package autorestart value
3467 * @return 0 if success, error code(<0) if fail
3468 * @retval PMINFO_R_OK success
3469 * @retval PMINFO_R_EINVAL invalid argument
3470 * @retval PMINFO_R_ERROR internal error
3471 * @pre pkgmgrinfo_appinfo_get_appinfo()
3472 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3473 * @see pkgmgrinfo_appinfo_get_appid()
3474 * @see pkgmgrinfo_appinfo_is_multiple()
3476 static int get_app_autorestart(const char *appid)
3480 pkgmgrinfo_appinfo_h handle;
3481 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3482 if (ret != PMINFO_R_OK)
3484 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3485 if (ret != PMINFO_R_OK) {
3486 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3489 printf("app autorestart: %d\n", autorestart);
3490 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3495 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3498 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3499 * @brief This API gets the value for given application is main app or not from handle
3501 * @par This API is for package-manager client application
3502 * @par Sync (or) Async : Synchronous API
3504 * @param[in] handle pointer to application info handle
3505 * @param[out] mainapp pointer to hold package mainapp is or not
3506 * @return 0 if success, error code(<0) if fail
3507 * @retval PMINFO_R_OK success
3508 * @retval PMINFO_R_EINVAL invalid argument
3509 * @retval PMINFO_R_ERROR internal error
3510 * @pre pkgmgrinfo_appinfo_get_appinfo()
3511 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3512 * @see pkgmgrinfo_appinfo_get_appid()
3513 * @see pkgmgrinfo_appinfo_is_multiple()
3515 static int get_app_mainapp(const char *appid)
3519 pkgmgrinfo_appinfo_h handle;
3520 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3521 if (ret != PMINFO_R_OK)
3523 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3524 if (ret != PMINFO_R_OK) {
3525 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3528 printf("mainapp: %d\n", mainapp);
3529 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3534 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3538 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3539 * @brief This API gets the value for given application is preload or not from handle
3541 * @par This API is for package-manager client application
3542 * @par Sync (or) Async : Synchronous API
3544 * @param[in] handle pointer to application info handle
3545 * @param[out] preload pointer to hold preload is or not
3546 * @return 0 if success, error code(<0) if fail
3547 * @retval PMINFO_R_OK success
3548 * @retval PMINFO_R_EINVAL invalid argument
3549 * @retval PMINFO_R_ERROR internal error
3550 * @pre pkgmgrinfo_appinfo_get_appinfo()
3551 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3552 * @see pkgmgrinfo_appinfo_get_appid()
3553 * @see pkgmgrinfo_appinfo_is_multiple()
3555 static int get_app_preload(const char *appid)
3559 pkgmgrinfo_appinfo_h handle = NULL;
3560 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3561 if (ret != PMINFO_R_OK)
3563 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3564 if (ret != PMINFO_R_OK) {
3565 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3568 printf("preload: %d\n", preload);
3569 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3574 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3577 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3578 * @brief This API gets the value for given application is submode or not from handle
3580 * @par This API is for package-manager client application
3581 * @par Sync (or) Async : Synchronous API
3583 * @param[in] handle pointer to application info handle
3584 * @param[out] submode pointer to hold submode is or not
3585 * @return 0 if success, error code(<0) if fail
3586 * @retval PMINFO_R_OK success
3587 * @retval PMINFO_R_EINVAL invalid argument
3588 * @retval PMINFO_R_ERROR internal error
3589 * @pre pkgmgrinfo_appinfo_get_appinfo()
3590 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3591 * @see pkgmgrinfo_appinfo_get_appid()
3592 * @see pkgmgrinfo_appinfo_is_multiple()
3594 static int get_app_submode(const char *appid)
3598 pkgmgrinfo_appinfo_h handle = NULL;
3599 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3600 if (ret != PMINFO_R_OK)
3602 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3603 if (ret != PMINFO_R_OK) {
3604 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3607 printf("submode: %d\n", submode);
3608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3613 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3616 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3617 * @brief This API checks if the application has the given category
3619 * @par This API is for package-manager client application
3620 * @par Sync (or) Async : Synchronous API
3622 * @param[in] handle pointer to the application info handle
3623 * @param[in] category category
3624 * @param[out] exist value Gets whether the application has the given category
3625 * @return 0 if success, error code(<0) if fail
3626 * @retval PMINFO_R_OK success
3627 * @retval PMINFO_R_EINVAL invalid argument
3628 * @retval PMINFO_R_ERROR internal error
3630 static int is_category_exist(const char *appid, const char *category)
3633 pkgmgrinfo_appinfo_h handle;
3636 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3637 if (ret != PMINFO_R_OK)
3640 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3641 if (ret != PMINFO_R_OK) {
3642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3651 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3654 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3655 * @brief This API gets the application 'ui_gadget' value from the app ID
3657 * @par This API is for package-manager client application
3658 * @par Sync (or) Async : Synchronous API
3660 * @param[in] handle pointer to application info handle
3661 * @param[out] ui_gadget pointer to hold package ui_gadget value
3662 * @return 0 if success, error code(<0) if fail
3663 * @retval PMINFO_R_OK success
3664 * @retval PMINFO_R_EINVAL invalid argument
3665 * @pre pkgmgrinfo_appinfo_get_appinfo()
3666 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3668 static int get_app_ui_gadget(const char *appid)
3672 pkgmgrinfo_appinfo_h handle = NULL;
3673 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3674 if (ret != PMINFO_R_OK)
3676 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
3677 if (ret != PMINFO_R_OK) {
3678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3681 printf("app ui_gadget: %d\n", ui_gadget);
3682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3687 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
3690 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3691 * @brief This API destroys the application information handle freeing up all the resources
3693 * @par This API is for package-manager client application
3694 * @par Sync (or) Async : Synchronous API
3696 * @param[in] handle pointer to the application info handle.
3697 * @return 0 if success, error code(<0) if fail
3698 * @retval PMINFO_R_OK success
3699 * @retval PMINFO_R_EINVAL invalid argument
3700 * @retval PMINFO_R_ERROR internal error
3701 * @pre pkgmgrinfo_appinfo_get_appinfo()
3703 * @see pkgmgrinfo_appinfo_get_pkgid()
3704 * @see pkgmgrinfo_appinfo_is_multiple()
3706 static int get_app_type(const char *appid)
3710 pkgmgrinfo_appinfo_h handle;
3711 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3712 if (ret != PMINFO_R_OK)
3714 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3715 if (ret != PMINFO_R_OK) {
3716 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3719 printf("apptype: %s\n", type);
3720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3725 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3728 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3729 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3730 The query will search the entire application information collected from the manifest file of all the installed packages
3732 * @par This API is for package-manager client application
3733 * @par Sync (or) Async : Synchronous API
3735 * @param[out] handle pointer to the application info filter handle.
3736 * @return 0 if success, error code(<0) if fail
3737 * @retval PMINFO_R_OK success
3738 * @retval PMINFO_R_EINVAL invalid argument
3739 * @retval PMINFO_R_ERROR internal error
3741 * @post pkgmgrinfo_appinfo_filter_destroy()
3742 * @see pkgmgrinfo_appinfo_filter_count()
3743 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3745 static int get_capp_count()
3749 pkgmgrinfo_appinfo_filter_h handle;
3750 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3751 if (ret != PMINFO_R_OK)
3753 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3754 if (ret != PMINFO_R_OK) {
3755 pkgmgrinfo_appinfo_filter_destroy(handle);
3758 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3759 if (ret != PMINFO_R_OK) {
3760 pkgmgrinfo_appinfo_filter_destroy(handle);
3763 printf("No of capp: %d\n", count);
3764 pkgmgrinfo_appinfo_filter_destroy(handle);
3769 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3772 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3773 * @brief This API destroys the application information filter handle freeing up all the resources
3775 * @par This API is for package-manager client application
3776 * @par Sync (or) Async : Synchronous API
3778 * @param[in] handle pointer to the application info filter handle.
3779 * @return 0 if success, error code(<0) if fail
3780 * @retval PMINFO_R_OK success
3781 * @retval PMINFO_R_EINVAL invalid argument
3782 * @retval PMINFO_R_ERROR internal error
3783 * @pre pkgmgrinfo_appinfo_filter_create()
3785 * @see pkgmgrinfo_appinfo_filter_count()
3786 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3788 static int get_capp_count()
3792 pkgmgrinfo_appinfo_filter_h handle;
3793 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3794 if (ret != PMINFO_R_OK)
3796 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3797 if (ret != PMINFO_R_OK) {
3798 pkgmgrinfo_appinfo_filter_destroy(handle);
3801 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3802 if (ret != PMINFO_R_OK) {
3803 pkgmgrinfo_appinfo_filter_destroy(handle);
3806 printf("No of capp: %d\n", count);
3807 pkgmgrinfo_appinfo_filter_destroy(handle);
3812 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3815 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3816 * @brief This API adds a boolean filter property to the filter handle
3818 * @par This API is for package-manager client application
3819 * @par Sync (or) Async : Synchronous API
3821 * @param[in] handle pointer to the application info filter handle.
3822 * @param[in] property boolean property name.
3823 * @param[in] value value corresponding to the property.
3824 * @return 0 if success, error code(<0) if fail
3825 * @retval PMINFO_R_OK success
3826 * @retval PMINFO_R_EINVAL invalid argument
3827 * @retval PMINFO_R_ERROR internal error
3828 * @pre pkgmgrinfo_appinfo_filter_create()
3829 * @post pkgmgrinfo_appinfo_filter_destroy()
3830 * @see pkgmgrinfo_appinfo_filter_count()
3831 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3833 static int get_taskmanageable_app_count()
3837 pkgmgrinfo_appinfo_filter_h handle;
3838 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3839 if (ret != PMINFO_R_OK)
3841 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3842 if (ret != PMINFO_R_OK) {
3843 pkgmgrinfo_appinfo_filter_destroy(handle);
3846 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3847 if (ret != PMINFO_R_OK) {
3848 pkgmgrinfo_appinfo_filter_destroy(handle);
3851 printf("No of taskmanageable apps: %d\n", count);
3852 pkgmgrinfo_appinfo_filter_destroy(handle);
3857 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3858 const char *property, const bool value);
3861 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3862 * @brief This API adds an integer filter property to the filter handle
3864 * @par This API is for package-manager client application
3865 * @par Sync (or) Async : Synchronous API
3867 * @param[in] handle pointer to the application info filter handle.
3868 * @param[in] property integer property name.
3869 * @param[in] value value corresponding to the property.
3870 * @return 0 if success, error code(<0) if fail
3871 * @retval PMINFO_R_OK success
3872 * @retval PMINFO_R_EINVAL invalid argument
3873 * @retval PMINFO_R_ERROR internal error
3874 * @pre pkgmgrinfo_appinfo_filter_create()
3875 * @post pkgmgrinfo_appinfo_filter_destroy()
3876 * @see pkgmgrinfo_appinfo_filter_count()
3877 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3879 static int get_taskmanageable_app_count()
3883 pkgmgrinfo_appinfo_filter_h handle;
3884 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3885 if (ret != PMINFO_R_OK)
3887 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3888 if (ret != PMINFO_R_OK) {
3889 pkgmgrinfo_appinfo_filter_destroy(handle);
3892 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3893 if (ret != PMINFO_R_OK) {
3894 pkgmgrinfo_appinfo_filter_destroy(handle);
3897 printf("No of apps: %d\n", count);
3898 pkgmgrinfo_appinfo_filter_destroy(handle);
3903 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3904 const char *property, const int value);
3907 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3908 * @brief This API adds a string filter property to the filter handle
3910 * @par This API is for package-manager client application
3911 * @par Sync (or) Async : Synchronous API
3913 * @param[in] handle pointer to the application info filter handle.
3914 * @param[in] property string property name.
3915 * @param[in] value value corresponding to the property.
3916 * @return 0 if success, error code(<0) if fail
3917 * @retval PMINFO_R_OK success
3918 * @retval PMINFO_R_EINVAL invalid argument
3919 * @retval PMINFO_R_ERROR internal error
3920 * @pre pkgmgrinfo_appinfo_filter_create()
3921 * @post pkgmgrinfo_appinfo_filter_destroy()
3922 * @see pkgmgrinfo_appinfo_filter_count()
3923 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3925 static int get_capp_count()
3929 pkgmgrinfo_appinfo_filter_h handle;
3930 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3931 if (ret != PMINFO_R_OK)
3933 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3934 if (ret != PMINFO_R_OK) {
3935 pkgmgrinfo_appinfo_filter_destroy(handle);
3938 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3939 if (ret != PMINFO_R_OK) {
3940 pkgmgrinfo_appinfo_filter_destroy(handle);
3943 printf("No of capp: %d\n", count);
3944 pkgmgrinfo_appinfo_filter_destroy(handle);
3949 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3950 const char *property, const char *value);
3953 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3954 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3956 * @par This API is for package-manager client application
3957 * @par Sync (or) Async : Synchronous API
3959 * @param[in] handle pointer to the application info filter handle.
3960 * @param[in] app_cb callback function.
3961 * @param[in] user_data user data to be passed to the callback function
3962 * @return 0 if success, error code(<0) if fail
3963 * @retval PMINFO_R_OK success
3964 * @retval PMINFO_R_EINVAL invalid argument
3965 * @retval PMINFO_R_ERROR internal error
3966 * @pre pkgmgrinfo_appinfo_filter_create()
3967 * @post pkgmgrinfo_appinfo_filter_destroy()
3968 * @see pkgmgrinfo_appinfo_filter_count()
3970 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3973 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3974 printf("appid : %s\n", appid);
3978 static int get_capp_list()
3981 pkgmgrinfo_appinfo_filter_h handle;
3982 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3983 if (ret != PMINFO_R_OK)
3985 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3986 if (ret != PMINFO_R_OK) {
3987 pkgmgrinfo_appinfo_filter_destroy(handle);
3990 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3991 if (ret != PMINFO_R_OK) {
3992 pkgmgrinfo_appinfo_filter_destroy(handle);
3995 pkgmgrinfo_appinfo_filter_destroy(handle);
4000 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4001 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4002 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4003 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4006 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4007 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4008 * @brief This API counts the application that satisfy the filter conditions
4010 * @par This API is for package-manager client application
4011 * @par Sync (or) Async : Synchronous API
4013 * @param[in] handle pointer to the application info filter handle.
4014 * @param[in] count pointer to store count value
4015 * @param[in] uid the addressee user id of the instruction
4016 * @return 0 if success, error code(<0) if fail
4017 * @retval PMINFO_R_OK success
4018 * @retval PMINFO_R_EINVAL invalid argument
4019 * @retval PMINFO_R_ERROR internal error
4020 * @pre pkgmgrinfo_appinfo_filter_create()
4021 * @post pkgmgrinfo_appinfo_filter_destroy()
4022 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4024 static int get_capp_count()
4028 pkgmgrinfo_appinfo_filter_h handle;
4029 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4030 if (ret != PMINFO_R_OK)
4032 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4033 if (ret != PMINFO_R_OK) {
4034 pkgmgrinfo_appinfo_filter_destroy(handle);
4037 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4038 if (ret != PMINFO_R_OK) {
4039 pkgmgrinfo_appinfo_filter_destroy(handle);
4042 printf("No of capp: %d\n", count);
4043 pkgmgrinfo_appinfo_filter_destroy(handle);
4048 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4049 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4051 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4052 * @brief This API creates the application's metadata information filter handle from db.
4054 * @par This API is for package-manager client application
4055 * @par Sync (or) Async : Synchronous API
4057 * @param[out] handle pointer to the application metadata info filter handle.
4058 * @return 0 if success, error code(<0) if fail
4059 * @retval PMINFO_R_OK success
4060 * @retval PMINFO_R_EINVAL invalid argument
4061 * @retval PMINFO_R_ERROR internal error
4063 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4064 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4066 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4069 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4070 printf("appid : %s\n", appid);
4074 static int get_app_list(const char *mkey, const char *mvalue)
4077 pkgmgrinfo_appinfo_metadata_filter_h handle;
4078 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4079 if (ret != PMINFO_R_OK)
4081 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4082 if (ret != PMINFO_R_OK) {
4083 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4086 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4087 if (ret != PMINFO_R_OK) {
4088 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4091 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4096 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4099 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4100 * @brief This API destroys the application's metadata information filter handle.
4102 * @par This API is for package-manager client application
4103 * @par Sync (or) Async : Synchronous API
4105 * @param[in] handle pointer to the application metadata info filter handle.
4106 * @return 0 if success, error code(<0) if fail
4107 * @retval PMINFO_R_OK success
4108 * @retval PMINFO_R_EINVAL invalid argument
4109 * @retval PMINFO_R_ERROR internal error
4110 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4112 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4114 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4117 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4118 printf("appid : %s\n", appid);
4122 static int get_app_list(const char *mkey, const char *mvalue)
4125 pkgmgrinfo_appinfo_metadata_filter_h handle;
4126 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4127 if (ret != PMINFO_R_OK)
4129 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4130 if (ret != PMINFO_R_OK) {
4131 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4134 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4135 if (ret != PMINFO_R_OK) {
4136 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4139 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4144 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4147 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4148 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4149 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4151 * @par This API is for package-manager client application
4152 * @par Sync (or) Async : Synchronous API
4154 * @param[in] handle pointer to the application metadata info filter handle.
4155 * @param[in] key pointer to metadata key
4156 * @param[in] value pointer to metadata value
4157 * @return 0 if success, error code(<0) if fail
4158 * @retval PMINFO_R_OK success
4159 * @retval PMINFO_R_EINVAL invalid argument
4160 * @retval PMINFO_R_ERROR internal error
4161 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4162 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4163 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4165 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4168 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4169 printf("appid : %s\n", appid);
4173 static int get_app_list(const char *mkey, const char *mvalue)
4176 pkgmgrinfo_appinfo_metadata_filter_h handle;
4177 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4178 if (ret != PMINFO_R_OK)
4180 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4181 if (ret != PMINFO_R_OK) {
4182 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4185 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4186 if (ret != PMINFO_R_OK) {
4187 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4190 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4195 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4196 const char *key, const char *value);
4199 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4200 * @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)
4201 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4202 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4203 * negative value, no more callbacks will be called and API will return.
4205 * @par This API is for package-manager client application
4206 * @par Sync (or) Async : Synchronous API
4208 * @param[in] handle pointer to the application metadata info filter handle.
4209 * @param[in] app_cb function pointer to callback
4210 * @param[in] user_data pointer to user data
4211 * @param[in] uid the addressee user id of the instruction
4212 * @return 0 if success, error code(<0) if fail
4213 * @retval PMINFO_R_OK success
4214 * @retval PMINFO_R_EINVAL invalid argument
4215 * @retval PMINFO_R_ERROR internal error
4216 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4217 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4219 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4222 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4223 printf("appid : %s\n", appid);
4227 static int get_app_list(const char *mkey, const char *mvalue)
4230 pkgmgrinfo_appinfo_metadata_filter_h handle;
4231 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4232 if (ret != PMINFO_R_OK)
4234 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4235 if (ret != PMINFO_R_OK) {
4236 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4239 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4240 if (ret != PMINFO_R_OK) {
4241 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4244 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4249 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4250 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4251 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4252 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4254 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4255 * @brief This API creates the package cert information handle to get data from db.
4257 * @par This API is for package-manager client application
4258 * @par Sync (or) Async : Synchronous API
4260 * @param[out] handle pointer to the package cert handle.
4261 * @return 0 if success, error code(<0) if fail
4262 * @retval PMINFO_R_OK success
4263 * @retval PMINFO_R_EINVAL invalid argument
4264 * @retval PMINFO_R_ERROR internal error
4266 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4267 * @see pkgmgrinfo_pkginfo_get_cert_value()
4268 * @see pkgmgrinfo_pkginfo_load_certinfo()
4270 static int get_cert_info(const char *pkgid)
4273 pkgmgrinfo_certinfo_h handle;
4274 char *auth_cert = NULL;
4275 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4276 if (ret != PMINFO_R_OK)
4278 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4279 if (ret != PMINFO_R_OK) {
4280 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4283 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4284 if (ret != PMINFO_R_OK) {
4285 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4288 printf("Author root certificate: %s\n", auth_root);
4289 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4294 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4297 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4298 * @brief This API loads the package cert information handle with data from db.
4300 * @par This API is for package-manager client application
4301 * @par Sync (or) Async : Synchronous API
4303 * @param[in] pkgid pointer to the package ID.
4304 * @param[in] handle pointer to the package cert handle.
4305 * @return 0 if success, error code(<0) if fail
4306 * @retval PMINFO_R_OK success
4307 * @retval PMINFO_R_EINVAL invalid argument
4308 * @retval PMINFO_R_ERROR internal error
4309 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4310 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4311 * @see pkgmgrinfo_pkginfo_get_cert_value()
4313 static int get_cert_info(const char *pkgid)
4316 pkgmgrinfo_certinfo_h handle;
4317 char *auth_cert = NULL;
4318 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4319 if (ret != PMINFO_R_OK)
4321 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4322 if (ret != PMINFO_R_OK) {
4323 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4326 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4327 if (ret != PMINFO_R_OK) {
4328 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4331 printf("Author root certificate: %s\n", auth_root);
4332 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4337 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4340 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4341 * @brief This API gets the package cert information from the handle
4343 * @par This API is for package-manager client application
4344 * @par Sync (or) Async : Synchronous API
4346 * @param[in] handle pointer to the package cert handle.
4347 * @param[in] cert_type certificate type
4348 * @param[out] cert_value pointer to hold certificate value
4349 * @return 0 if success, error code(<0) if fail
4350 * @retval PMINFO_R_OK success
4351 * @retval PMINFO_R_EINVAL invalid argument
4352 * @retval PMINFO_R_ERROR internal error
4353 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4354 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4355 * @see pkgmgrinfo_pkginfo_load_certinfo()
4357 static int get_cert_info(const char *pkgid)
4360 pkgmgrinfo_certinfo_h handle;
4361 char *auth_cert = NULL;
4362 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4363 if (ret != PMINFO_R_OK)
4365 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4366 if (ret != PMINFO_R_OK) {
4367 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4370 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4371 if (ret != PMINFO_R_OK) {
4372 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4375 printf("Author root certificate: %s\n", auth_root);
4376 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4381 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4384 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4385 * @brief This API destroys the package cert information handle freeing up all the resources
4387 * @par This API is for package-manager client application
4388 * @par Sync (or) Async : Synchronous API
4390 * @param[in] handle pointer to the package cert handle.
4391 * @return 0 if success, error code(<0) if fail
4392 * @retval PMINFO_R_OK success
4393 * @retval PMINFO_R_EINVAL invalid argument
4394 * @retval PMINFO_R_ERROR internal error
4395 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4397 * @see pkgmgrinfo_pkginfo_load_certinfo()
4399 static int get_cert_info(const char *pkgid)
4402 pkgmgrinfo_certinfo_h handle;
4403 char *auth_cert = NULL;
4404 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4405 if (ret != PMINFO_R_OK)
4407 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4408 if (ret != PMINFO_R_OK) {
4409 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4412 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4413 if (ret != PMINFO_R_OK) {
4414 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4417 printf("Author root certificate: %s\n", auth_root);
4418 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4423 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4426 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4427 * @brief This API deletes the package cert information from DB
4429 * @par This API is for package-manager client application
4430 * @par Sync (or) Async : Synchronous API
4432 * @param[in] pkgid pointer to the package ID.
4433 * @return 0 if success, error code(<0) if fail
4434 * @retval PMINFO_R_OK success
4435 * @retval PMINFO_R_EINVAL invalid argument
4436 * @retval PMINFO_R_ERROR internal error
4440 static int delete_cert_info(const char *pkgid)
4443 ret = pkgmgrinfo_delete_certinfo(pkgid);
4444 if (ret != PMINFO_R_OK)
4450 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4451 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4453 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4454 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4455 * @brief This API creates the package db information handle to set data in db.
4457 * @par This API is for package-manager client application
4458 * @par Sync (or) Async : Synchronous API
4460 * @param[in] pkgid pointer to the package ID.
4461 * @param[in] uid the addressee user id of the instruction
4462 * @param[out] handle pointer to the package db info handle.
4463 * @return 0 if success, error code(<0) if fail
4464 * @retval PMINFO_R_OK success
4465 * @retval PMINFO_R_EINVAL invalid argument
4466 * @retval PMINFO_R_ERROR internal error
4468 * @post pkgmgrinfo_destroy_pkgdbinfo()
4469 * @see pkgmgrinfo_save_pkgdbinfo()
4470 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4472 static int set_pkg_in_db(const char *pkgid)
4475 pkgmgrinfo_pkgdbinfo_h handle;
4476 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4477 if (ret != PMINFO_R_OK)
4479 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4480 if (ret != PMINFO_R_OK) {
4481 pkgmgrinfo_destroy_pkgdbinfo(handle);
4484 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4485 if (ret != PMINFO_R_OK) {
4486 pkgmgrinfo_destroy_pkgdbinfo(handle);
4489 pkgmgrinfo_destroy_pkgdbinfo(handle);
4494 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4495 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4498 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4499 * @brief This API sets the package type in db handle
4501 * @par This API is for package-manager client application
4502 * @par Sync (or) Async : Synchronous API
4504 * @param[in] handle pointer to the pkgdbinfo handle.
4505 * @param[in] type pointer to the package type.
4506 * @return 0 if success, error code(<0) if fail
4507 * @retval PMINFO_R_OK success
4508 * @retval PMINFO_R_EINVAL invalid argument
4509 * @retval PMINFO_R_ERROR internal error
4510 * @pre pkgmgrinfo_create_pkgdbinfo()
4511 * @post pkgmgrinfo_destroy_pkgdbinfo()
4512 * @see pkgmgrinfo_save_pkgdbinfo()
4513 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4515 static int set_pkg_type_in_db(const char *pkgid)
4518 pkgmgrinfo_pkgdbinfo_h handle;
4519 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4520 if (ret != PMINFO_R_OK)
4522 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4523 if (ret != PMINFO_R_OK) {
4524 pkgmgrinfo_destroy_pkgdbinfo(handle);
4527 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4528 if (ret != PMINFO_R_OK) {
4529 pkgmgrinfo_destroy_pkgdbinfo(handle);
4532 pkgmgrinfo_destroy_pkgdbinfo(handle);
4537 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4540 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4541 * @brief This API sets the package version in db handle
4543 * @par This API is for package-manager client application
4544 * @par Sync (or) Async : Synchronous API
4546 * @param[in] handle pointer to the pkgdbinfo handle.
4547 * @param[in] version pointer to the package version
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @retval PMINFO_R_ERROR internal error
4552 * @pre pkgmgrinfo_create_pkgdbinfo()
4553 * @post pkgmgrinfo_destroy_pkgdbinfo()
4554 * @see pkgmgrinfo_save_pkgdbinfo()
4555 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4557 static int set_pkg_version_in_db(const char *pkgid)
4560 pkgmgrinfo_pkgdbinfo_h handle;
4561 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4562 if (ret != PMINFO_R_OK)
4564 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4565 if (ret != PMINFO_R_OK) {
4566 pkgmgrinfo_destroy_pkgdbinfo(handle);
4569 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4570 if (ret != PMINFO_R_OK) {
4571 pkgmgrinfo_destroy_pkgdbinfo(handle);
4574 pkgmgrinfo_destroy_pkgdbinfo(handle);
4579 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4582 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4583 * @brief This API sets the package install location in db handle
4585 * @par This API is for package-manager client application
4586 * @par Sync (or) Async : Synchronous API
4588 * @param[in] handle pointer to the pkgdbinfo handle.
4589 * @param[in] location package install location
4590 * @return 0 if success, error code(<0) if fail
4591 * @retval PMINFO_R_OK success
4592 * @retval PMINFO_R_EINVAL invalid argument
4593 * @retval PMINFO_R_ERROR internal error
4594 * @pre pkgmgrinfo_create_pkgdbinfo()
4595 * @post pkgmgrinfo_destroy_pkgdbinfo()
4596 * @see pkgmgrinfo_save_pkgdbinfo()
4597 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4599 static int set_pkg_install_location_in_db(const char *pkgid)
4602 pkgmgrinfo_pkgdbinfo_h handle;
4603 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4604 if (ret != PMINFO_R_OK)
4606 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4607 if (ret != PMINFO_R_OK) {
4608 pkgmgrinfo_destroy_pkgdbinfo(handle);
4611 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4612 if (ret != PMINFO_R_OK) {
4613 pkgmgrinfo_destroy_pkgdbinfo(handle);
4616 pkgmgrinfo_destroy_pkgdbinfo(handle);
4621 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4624 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4625 * @brief This API sets the package size in db handle
4627 * @par This API is for package-manager client application
4628 * @par Sync (or) Async : Synchronous API
4630 * @param[in] handle pointer to the pkgdbinfo handle.
4631 * @param[in] size pointer to the package size
4632 * @return 0 if success, error code(<0) if fail
4633 * @retval PMINFO_R_OK success
4634 * @retval PMINFO_R_EINVAL invalid argument
4635 * @retval PMINFO_R_ERROR internal error
4636 * @pre pkgmgrinfo_create_pkgdbinfo()
4637 * @post pkgmgrinfo_destroy_pkgdbinfo()
4638 * @see pkgmgrinfo_save_pkgdbinfo()
4639 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4641 static int set_pkg_size_in_db(const char *pkgid)
4644 pkgmgrinfo_pkgdbinfo_h handle;
4645 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4646 if (ret != PMINFO_R_OK)
4648 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4649 if (ret != PMINFO_R_OK) {
4650 pkgmgrinfo_destroy_pkgdbinfo(handle);
4653 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4654 if (ret != PMINFO_R_OK) {
4655 pkgmgrinfo_destroy_pkgdbinfo(handle);
4658 pkgmgrinfo_destroy_pkgdbinfo(handle);
4663 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4666 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4667 * @brief This API sets the package label in db handle
4669 * @par This API is for package-manager client application
4670 * @par Sync (or) Async : Synchronous API
4672 * @param[in] handle pointer to the pkgdbinfo handle.
4673 * @param[in] label pointer to the package label
4674 * @param[in] locale pointer to the locale
4675 * @return 0 if success, error code(<0) if fail
4676 * @retval PMINFO_R_OK success
4677 * @retval PMINFO_R_EINVAL invalid argument
4678 * @retval PMINFO_R_ERROR internal error
4679 * @pre pkgmgrinfo_create_pkgdbinfo()
4680 * @post pkgmgrinfo_destroy_pkgdbinfo()
4681 * @see pkgmgrinfo_save_pkgdbinfo()
4682 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4684 static int set_pkg_label_in_db(const char *pkgid)
4687 pkgmgrinfo_pkgdbinfo_h handle;
4688 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4689 if (ret != PMINFO_R_OK)
4691 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4692 if (ret != PMINFO_R_OK) {
4693 pkgmgrinfo_destroy_pkgdbinfo(handle);
4696 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4697 if (ret != PMINFO_R_OK) {
4698 pkgmgrinfo_destroy_pkgdbinfo(handle);
4701 pkgmgrinfo_destroy_pkgdbinfo(handle);
4706 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4709 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4710 * @brief This API sets the package icon in db handle
4712 * @par This API is for package-manager client application
4713 * @par Sync (or) Async : Synchronous API
4715 * @param[in] handle pointer to the pkgdbinfo handle.
4716 * @param[in] icon pointer to the package icon
4717 * @param[in] locale pointer to the locale
4718 * @return 0 if success, error code(<0) if fail
4719 * @retval PMINFO_R_OK success
4720 * @retval PMINFO_R_EINVAL invalid argument
4721 * @retval PMINFO_R_ERROR internal error
4722 * @pre pkgmgrinfo_create_pkgdbinfo()
4723 * @post pkgmgrinfo_destroy_pkgdbinfo()
4724 * @see pkgmgrinfo_save_pkgdbinfo()
4725 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4727 static int set_pkg_icon_in_db(const char *pkgid)
4730 pkgmgrinfo_pkgdbinfo_h handle;
4731 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4732 if (ret != PMINFO_R_OK)
4734 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4735 if (ret != PMINFO_R_OK) {
4736 pkgmgrinfo_destroy_pkgdbinfo(handle);
4739 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4740 if (ret != PMINFO_R_OK) {
4741 pkgmgrinfo_destroy_pkgdbinfo(handle);
4744 pkgmgrinfo_destroy_pkgdbinfo(handle);
4749 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4752 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4753 * @brief This API sets the package description in db handle
4755 * @par This API is for package-manager client application
4756 * @par Sync (or) Async : Synchronous API
4758 * @param[in] handle pointer to the pkgdbinfo handle.
4759 * @param[in] description pointer to the package description
4760 * @param[in] locale pointer to the locale
4761 * @return 0 if success, error code(<0) if fail
4762 * @retval PMINFO_R_OK success
4763 * @retval PMINFO_R_EINVAL invalid argument
4764 * @retval PMINFO_R_ERROR internal error
4765 * @pre pkgmgrinfo_create_pkgdbinfo()
4766 * @post pkgmgrinfo_destroy_pkgdbinfo()
4767 * @see pkgmgrinfo_save_pkgdbinfo()
4768 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4770 static int set_pkg_description_in_db(const char *pkgid)
4773 pkgmgrinfo_pkgdbinfo_h handle;
4774 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4775 if (ret != PMINFO_R_OK)
4777 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4778 if (ret != PMINFO_R_OK) {
4779 pkgmgrinfo_destroy_pkgdbinfo(handle);
4782 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4783 if (ret != PMINFO_R_OK) {
4784 pkgmgrinfo_destroy_pkgdbinfo(handle);
4787 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4795 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4796 const char *author_email, const char *author_href, const char *locale)
4797 * @brief This API sets the package author info in db handle
4799 * @par This API is for package-manager client application
4800 * @par Sync (or) Async : Synchronous API
4802 * @param[in] handle pointer to the pkgdbinfo handle.
4803 * @param[in] author_name pointer to the package author name
4804 * @param[in] author_email pointer to the package author email
4805 * @param[in] author_href pointer to the package author href
4806 * @param[in] locale pointer to the locale
4807 * @return 0 if success, error code(<0) if fail
4808 * @retval PMINFO_R_OK success
4809 * @retval PMINFO_R_EINVAL invalid argument
4810 * @retval PMINFO_R_ERROR internal error
4811 * @pre pkgmgrinfo_create_pkgdbinfo()
4812 * @post pkgmgrinfo_destroy_pkgdbinfo()
4813 * @see pkgmgrinfo_save_pkgdbinfo()
4814 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4816 static int set_pkg_author_in_db(const char *pkgid)
4819 pkgmgrinfo_pkgdbinfo_h handle;
4820 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4821 if (ret != PMINFO_R_OK)
4823 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4824 if (ret != PMINFO_R_OK) {
4825 pkgmgrinfo_destroy_pkgdbinfo(handle);
4828 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4829 if (ret != PMINFO_R_OK) {
4830 pkgmgrinfo_destroy_pkgdbinfo(handle);
4833 pkgmgrinfo_destroy_pkgdbinfo(handle);
4838 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4839 const char *author_email, const char *author_href, const char *locale);
4842 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4843 * @brief This API sets the package 'removable' value in db handle
4845 * @par This API is for package-manager client application
4846 * @par Sync (or) Async : Synchronous API
4848 * @param[in] handle pointer to the pkgdbinfo handle.
4849 * @param[in] removable package removable value
4850 * @return 0 if success, error code(<0) if fail
4851 * @retval PMINFO_R_OK success
4852 * @retval PMINFO_R_EINVAL invalid argument
4853 * @retval PMINFO_R_ERROR internal error
4854 * @pre pkgmgrinfo_create_pkgdbinfo()
4855 * @post pkgmgrinfo_destroy_pkgdbinfo()
4856 * @see pkgmgrinfo_save_pkgdbinfo()
4857 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4859 static int set_pkg_removable_in_db(const char *pkgid)
4862 pkgmgrinfo_pkgdbinfo_h handle;
4863 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4864 if (ret != PMINFO_R_OK)
4866 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4867 if (ret != PMINFO_R_OK) {
4868 pkgmgrinfo_destroy_pkgdbinfo(handle);
4871 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4872 if (ret != PMINFO_R_OK) {
4873 pkgmgrinfo_destroy_pkgdbinfo(handle);
4876 pkgmgrinfo_destroy_pkgdbinfo(handle);
4881 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4884 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4885 * @brief This API sets the package 'preload' value in db handle
4887 * @par This API is for package-manager client application
4888 * @par Sync (or) Async : Synchronous API
4890 * @param[in] handle pointer to the pkgdbinfo handle.
4891 * @param[in] preload package preload value
4892 * @return 0 if success, error code(<0) if fail
4893 * @retval PMINFO_R_OK success
4894 * @retval PMINFO_R_EINVAL invalid argument
4895 * @retval PMINFO_R_ERROR internal error
4896 * @pre pkgmgrinfo_create_pkgdbinfo()
4897 * @post pkgmgrinfo_destroy_pkgdbinfo()
4898 * @see pkgmgrinfo_save_pkgdbinfo()
4899 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4901 static int set_pkg_preload_in_db(const char *pkgid)
4904 pkgmgrinfo_pkgdbinfo_h handle;
4905 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4906 if (ret != PMINFO_R_OK)
4908 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4909 if (ret != PMINFO_R_OK) {
4910 pkgmgrinfo_destroy_pkgdbinfo(handle);
4913 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4914 if (ret != PMINFO_R_OK) {
4915 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 pkgmgrinfo_destroy_pkgdbinfo(handle);
4923 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4926 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4927 * @brief This API sets the package 'installed_storage' value in db handle
4929 * @par This API is for package-manager client application
4930 * @par Sync (or) Async : Synchronous API
4932 * @param[in] handle pointer to the pkgdbinfo handle.
4933 * @param[in] location installed_storage value
4934 * @return 0 if success, error code(<0) if fail
4935 * @retval PMINFO_R_OK success
4936 * @retval PMINFO_R_EINVAL invalid argument
4937 * @retval PMINFO_R_ERROR internal error
4938 * @pre pkgmgrinfo_create_pkgdbinfo()
4939 * @post pkgmgrinfo_destroy_pkgdbinfo()
4940 * @see pkgmgrinfo_save_pkgdbinfo()
4942 static int set_pkg_installed_storage_in_db(const char *pkgid)
4945 pkgmgrinfo_pkgdbinfo_h handle;
4946 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4947 if (ret != PMINFO_R_OK)
4949 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4950 if (ret != PMINFO_R_OK) {
4951 pkgmgrinfo_destroy_pkgdbinfo(handle);
4954 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4955 if (ret != PMINFO_R_OK) {
4956 pkgmgrinfo_destroy_pkgdbinfo(handle);
4959 pkgmgrinfo_destroy_pkgdbinfo(handle);
4964 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4967 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4968 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
4969 * @brief This API saves all the information from the handle to the DB.
4971 * @par This API is for package-manager client application
4972 * @par Sync (or) Async : Synchronous API
4974 * @param[in] handle pointer to the package db info handle.
4975 * @param[in] uid the addressee user id of the instruction
4976 * @return 0 if success, error code(<0) if fail
4977 * @retval PMINFO_R_OK success
4978 * @retval PMINFO_R_EINVAL invalid argument
4979 * @retval PMINFO_R_ERROR internal error
4980 * @pre pkgmgrinfo_create_pkgdbinfo()
4981 * @post pkgmgrinfo_destroy_pkgdbinfo()
4982 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4984 static int set_pkg_in_db(const char *pkgid)
4987 pkgmgrinfo_pkgdbinfo_h handle;
4988 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4989 if (ret != PMINFO_R_OK)
4991 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4992 if (ret != PMINFO_R_OK) {
4993 pkgmgrinfo_destroy_pkgdbinfo(handle);
4996 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4997 if (ret != PMINFO_R_OK) {
4998 pkgmgrinfo_destroy_pkgdbinfo(handle);
5001 pkgmgrinfo_destroy_pkgdbinfo(handle);
5006 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5007 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5009 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5010 * @brief This API destroys the package db information handle freeing up all the resources
5012 * @par This API is for package-manager client application
5013 * @par Sync (or) Async : Synchronous API
5015 * @param[in] handle pointer to the package db info handle.
5016 * @return 0 if success, error code(<0) if fail
5017 * @retval PMINFO_R_OK success
5018 * @retval PMINFO_R_EINVAL invalid argument
5019 * @retval PMINFO_R_ERROR internal error
5020 * @pre pkgmgrinfo_create_pkgdbinfo()
5022 * @see pkgmgrinfo_save_pkgdbinfo()
5023 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5025 static int set_pkg_in_db(const char *pkgid)
5028 pkgmgrinfo_pkgdbinfo_h handle;
5029 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5030 if (ret != PMINFO_R_OK)
5032 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5033 if (ret != PMINFO_R_OK) {
5034 pkgmgrinfo_destroy_pkgdbinfo(handle);
5037 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5038 if (ret != PMINFO_R_OK) {
5039 pkgmgrinfo_destroy_pkgdbinfo(handle);
5042 pkgmgrinfo_destroy_pkgdbinfo(handle);
5047 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5051 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5052 * @brief This API creates the package cert information handle to set data in db.
5054 * @par This API is for package-manager client application
5055 * @par Sync (or) Async : Synchronous API
5057 * @param[out] handle pointer to the package cert handle.
5058 * @return 0 if success, error code(<0) if fail
5059 * @retval PMINFO_R_OK success
5060 * @retval PMINFO_R_EINVAL invalid argument
5061 * @retval PMINFO_R_ERROR internal error
5063 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5064 * @see pkgmgrinfo_set_cert_value()
5065 * @see pkgmgrinfo_save_certinfo()
5067 static int set_cert_in_db(const char *pkgid)
5070 pkgmgrinfo_instcertinfo_h handle;
5071 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5072 if (ret != PMINFO_R_OK)
5074 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5075 if (ret != PMINFO_R_OK) {
5076 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5079 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5080 if (ret != PMINFO_R_OK) {
5081 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5084 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5089 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5092 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5093 * @brief This API sets the package cert information in the handle.
5095 * @par This API is for package-manager client application
5096 * @par Sync (or) Async : Synchronous API
5098 * @param[in] handle pointer to the package cert handle.
5099 * @param[in] cert_type certificate type.
5100 * @param[in] cert_value certificate value.
5101 * @return 0 if success, error code(<0) if fail
5102 * @retval PMINFO_R_OK success
5103 * @retval PMINFO_R_EINVAL invalid argument
5104 * @retval PMINFO_R_ERROR internal error
5105 * @pre pkgmgrinfo_create_certinfo_set_handle()
5106 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5107 * @see pkgmgrinfo_save_certinfo()
5109 static int set_cert_in_db(const char *pkgid)
5112 pkgmgrinfo_instcertinfo_h handle;
5113 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5114 if (ret != PMINFO_R_OK)
5116 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5117 if (ret != PMINFO_R_OK) {
5118 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5121 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5122 if (ret != PMINFO_R_OK) {
5123 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5126 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5131 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5134 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5135 * @brief This API saves the package cert information in the DB.
5137 * @par This API is for package-manager client application
5138 * @par Sync (or) Async : Synchronous API
5140 * @param[in] pkgid pointer to the package ID.
5141 * @param[in] handle pointer to the package cert handle.
5142 * @return 0 if success, error code(<0) if fail
5143 * @retval PMINFO_R_OK success
5144 * @retval PMINFO_R_EINVAL invalid argument
5145 * @retval PMINFO_R_ERROR internal error
5146 * @pre pkgmgrinfo_create_certinfo_set_handle()
5147 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5148 * @see pkgmgrinfo_save_certinfo()
5150 static int set_cert_in_db(const char *pkgid)
5153 pkgmgrinfo_instcertinfo_h handle;
5154 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5155 if (ret != PMINFO_R_OK)
5157 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5158 if (ret != PMINFO_R_OK) {
5159 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5162 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5163 if (ret != PMINFO_R_OK) {
5164 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5167 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5172 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5175 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5176 * @brief This API destroys the package cert information handle freeing up all the resources.
5178 * @par This API is for package-manager client application
5179 * @par Sync (or) Async : Synchronous API
5181 * @param[in] handle pointer to the package cert handle.
5182 * @return 0 if success, error code(<0) if fail
5183 * @retval PMINFO_R_OK success
5184 * @retval PMINFO_R_EINVAL invalid argument
5185 * @retval PMINFO_R_ERROR internal error
5186 * @pre pkgmgrinfo_create_certinfo_set_handle()
5188 * @see pkgmgrinfo_save_certinfo()
5190 static int set_cert_in_db(const char *pkgid)
5193 pkgmgrinfo_instcertinfo_h handle;
5194 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5195 if (ret != PMINFO_R_OK)
5197 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5198 if (ret != PMINFO_R_OK) {
5199 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5202 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5203 if (ret != PMINFO_R_OK) {
5204 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5207 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5212 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5215 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5216 * @brief This API gets the datacontrol info
5218 * @par This API is for package-manager client application
5219 * @par Sync (or) Async : Synchronous API
5221 * @param[in] providerid pointer to the providerid of dataconltrol.
5222 * @param[in] type pointer to the type of dataconltrol.
5223 * @param[out] appid pointer to hold appid, need to free after using
5224 * @param[out] access pointer to hold access, need to free after using
5225 * @return 0 if success, error code(<0) if fail
5226 * @retval PMINFO_R_OK success
5227 * @retval PMINFO_R_EINVAL invalid argument
5228 * @retval PMINFO_R_ERROR internal error
5231 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5234 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5235 * @brief This API gets the application 'guest mode visibility' value from the DB
5237 * @par This API is for package-manager client application
5238 * @par Sync (or) Async : Synchronous API
5240 * @param[in] handle pointer to application info handle
5241 * @param[out] status pointer to hold app guest mode visibility value
5242 * @return 0 if success, error code(<0) if fail
5243 * @retval PMINFO_R_OK success
5244 * @retval PMINFO_R_EINVAL invalid argument
5245 * @retval PMINFO_R_ERROR internal error
5246 * @pre pkgmgrinfo_appinfo_get_appinfo()
5247 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5248 * @see pkgmgrinfo_appinfo_get_appid()
5249 * @see pkgmgrinfo_appinfo_is_multiple()
5251 static int get_app_guestmode_visibility(const char *appid)
5255 pkgmgrinfo_appinfo_h handle;
5256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5257 if (ret != PMINFO_R_OK)
5259 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5260 if (ret != PMINFO_R_OK) {
5261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5264 printf("app guest mode visibility: %d\n", status);
5265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5270 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5273 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5274 * @brief This API sets the application 'guest mode visibility' value in the DB
5276 * @par This API is for package-manager client application
5277 * @par Sync (or) Async : Synchronous API
5279 * @param[in] handle pointer to application info handle
5280 * @param[out] status app guest mode visibility value
5281 * @return 0 if success, error code(<0) if fail
5282 * @retval PMINFO_R_OK success
5283 * @retval PMINFO_R_EINVAL invalid argument
5284 * @retval PMINFO_R_ERROR internal error
5285 * @pre pkgmgrinfo_appinfo_get_appinfo()
5286 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5287 * @see pkgmgrinfo_appinfo_get_appid()
5288 * @see pkgmgrinfo_appinfo_is_multiple()
5290 static int set_app_guestmode_visibility(const char *appid, bool value)
5293 pkgmgrinfo_appinfo_h handle;
5294 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5295 if (ret != PMINFO_R_OK)
5297 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5298 if (ret != PMINFO_R_OK) {
5299 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5302 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5307 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5308 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5310 * @pkgmgrinfo client API
5314 * @brief listening status type in pkgmgrinfo.
5316 #define PMINFO_CLIENT_STATUS_ALL 0x00
5317 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5318 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5319 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5320 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5321 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5322 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5325 * @brief This APIs provides pkgmgrinfo client listener
5327 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5328 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5329 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5330 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5331 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5335 * @pkgmgrinfo client API end
5343 #endif /* __PKG_INFO_H__ */