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_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3655 * @brief This API destroys the application information handle freeing up all the resources
3657 * @par This API is for package-manager client application
3658 * @par Sync (or) Async : Synchronous API
3660 * @param[in] handle pointer to the application info handle.
3661 * @return 0 if success, error code(<0) if fail
3662 * @retval PMINFO_R_OK success
3663 * @retval PMINFO_R_EINVAL invalid argument
3664 * @retval PMINFO_R_ERROR internal error
3665 * @pre pkgmgrinfo_appinfo_get_appinfo()
3667 * @see pkgmgrinfo_appinfo_get_pkgid()
3668 * @see pkgmgrinfo_appinfo_is_multiple()
3670 static int get_app_type(const char *appid)
3674 pkgmgrinfo_appinfo_h handle;
3675 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3676 if (ret != PMINFO_R_OK)
3678 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3679 if (ret != PMINFO_R_OK) {
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3683 printf("apptype: %s\n", type);
3684 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3689 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3692 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3693 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3694 The query will search the entire application information collected from the manifest file of all the installed packages
3696 * @par This API is for package-manager client application
3697 * @par Sync (or) Async : Synchronous API
3699 * @param[out] handle pointer to the application info filter handle.
3700 * @return 0 if success, error code(<0) if fail
3701 * @retval PMINFO_R_OK success
3702 * @retval PMINFO_R_EINVAL invalid argument
3703 * @retval PMINFO_R_ERROR internal error
3705 * @post pkgmgrinfo_appinfo_filter_destroy()
3706 * @see pkgmgrinfo_appinfo_filter_count()
3707 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3709 static int get_capp_count()
3713 pkgmgrinfo_appinfo_filter_h handle;
3714 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3715 if (ret != PMINFO_R_OK)
3717 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3718 if (ret != PMINFO_R_OK) {
3719 pkgmgrinfo_appinfo_filter_destroy(handle);
3722 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3723 if (ret != PMINFO_R_OK) {
3724 pkgmgrinfo_appinfo_filter_destroy(handle);
3727 printf("No of capp: %d\n", count);
3728 pkgmgrinfo_appinfo_filter_destroy(handle);
3733 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3736 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3737 * @brief This API destroys the application information filter handle freeing up all the resources
3739 * @par This API is for package-manager client application
3740 * @par Sync (or) Async : Synchronous API
3742 * @param[in] handle pointer to the application info filter handle.
3743 * @return 0 if success, error code(<0) if fail
3744 * @retval PMINFO_R_OK success
3745 * @retval PMINFO_R_EINVAL invalid argument
3746 * @retval PMINFO_R_ERROR internal error
3747 * @pre pkgmgrinfo_appinfo_filter_create()
3749 * @see pkgmgrinfo_appinfo_filter_count()
3750 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3752 static int get_capp_count()
3756 pkgmgrinfo_appinfo_filter_h handle;
3757 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3758 if (ret != PMINFO_R_OK)
3760 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3761 if (ret != PMINFO_R_OK) {
3762 pkgmgrinfo_appinfo_filter_destroy(handle);
3765 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3766 if (ret != PMINFO_R_OK) {
3767 pkgmgrinfo_appinfo_filter_destroy(handle);
3770 printf("No of capp: %d\n", count);
3771 pkgmgrinfo_appinfo_filter_destroy(handle);
3776 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3779 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3780 * @brief This API adds a boolean filter property to the filter handle
3782 * @par This API is for package-manager client application
3783 * @par Sync (or) Async : Synchronous API
3785 * @param[in] handle pointer to the application info filter handle.
3786 * @param[in] property boolean property name.
3787 * @param[in] value value corresponding to the property.
3788 * @return 0 if success, error code(<0) if fail
3789 * @retval PMINFO_R_OK success
3790 * @retval PMINFO_R_EINVAL invalid argument
3791 * @retval PMINFO_R_ERROR internal error
3792 * @pre pkgmgrinfo_appinfo_filter_create()
3793 * @post pkgmgrinfo_appinfo_filter_destroy()
3794 * @see pkgmgrinfo_appinfo_filter_count()
3795 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3797 static int get_taskmanageable_app_count()
3801 pkgmgrinfo_appinfo_filter_h handle;
3802 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3803 if (ret != PMINFO_R_OK)
3805 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3806 if (ret != PMINFO_R_OK) {
3807 pkgmgrinfo_appinfo_filter_destroy(handle);
3810 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_filter_destroy(handle);
3815 printf("No of taskmanageable apps: %d\n", count);
3816 pkgmgrinfo_appinfo_filter_destroy(handle);
3821 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3822 const char *property, const bool value);
3825 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3826 * @brief This API adds an integer filter property to the filter handle
3828 * @par This API is for package-manager client application
3829 * @par Sync (or) Async : Synchronous API
3831 * @param[in] handle pointer to the application info filter handle.
3832 * @param[in] property integer property name.
3833 * @param[in] value value corresponding to the property.
3834 * @return 0 if success, error code(<0) if fail
3835 * @retval PMINFO_R_OK success
3836 * @retval PMINFO_R_EINVAL invalid argument
3837 * @retval PMINFO_R_ERROR internal error
3838 * @pre pkgmgrinfo_appinfo_filter_create()
3839 * @post pkgmgrinfo_appinfo_filter_destroy()
3840 * @see pkgmgrinfo_appinfo_filter_count()
3841 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3843 static int get_taskmanageable_app_count()
3847 pkgmgrinfo_appinfo_filter_h handle;
3848 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3849 if (ret != PMINFO_R_OK)
3851 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3852 if (ret != PMINFO_R_OK) {
3853 pkgmgrinfo_appinfo_filter_destroy(handle);
3856 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3857 if (ret != PMINFO_R_OK) {
3858 pkgmgrinfo_appinfo_filter_destroy(handle);
3861 printf("No of apps: %d\n", count);
3862 pkgmgrinfo_appinfo_filter_destroy(handle);
3867 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3868 const char *property, const int value);
3871 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3872 * @brief This API adds a string filter property to the filter handle
3874 * @par This API is for package-manager client application
3875 * @par Sync (or) Async : Synchronous API
3877 * @param[in] handle pointer to the application info filter handle.
3878 * @param[in] property string property name.
3879 * @param[in] value value corresponding to the property.
3880 * @return 0 if success, error code(<0) if fail
3881 * @retval PMINFO_R_OK success
3882 * @retval PMINFO_R_EINVAL invalid argument
3883 * @retval PMINFO_R_ERROR internal error
3884 * @pre pkgmgrinfo_appinfo_filter_create()
3885 * @post pkgmgrinfo_appinfo_filter_destroy()
3886 * @see pkgmgrinfo_appinfo_filter_count()
3887 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3889 static int get_capp_count()
3893 pkgmgrinfo_appinfo_filter_h handle;
3894 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3895 if (ret != PMINFO_R_OK)
3897 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3898 if (ret != PMINFO_R_OK) {
3899 pkgmgrinfo_appinfo_filter_destroy(handle);
3902 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3903 if (ret != PMINFO_R_OK) {
3904 pkgmgrinfo_appinfo_filter_destroy(handle);
3907 printf("No of capp: %d\n", count);
3908 pkgmgrinfo_appinfo_filter_destroy(handle);
3913 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
3914 const char *property, const char *value);
3917 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
3918 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
3920 * @par This API is for package-manager client application
3921 * @par Sync (or) Async : Synchronous API
3923 * @param[in] handle pointer to the application info filter handle.
3924 * @param[in] app_cb callback function.
3925 * @param[in] user_data user data to be passed to the callback function
3926 * @return 0 if success, error code(<0) if fail
3927 * @retval PMINFO_R_OK success
3928 * @retval PMINFO_R_EINVAL invalid argument
3929 * @retval PMINFO_R_ERROR internal error
3930 * @pre pkgmgrinfo_appinfo_filter_create()
3931 * @post pkgmgrinfo_appinfo_filter_destroy()
3932 * @see pkgmgrinfo_appinfo_filter_count()
3934 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3937 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3938 printf("appid : %s\n", appid);
3942 static int get_capp_list()
3945 pkgmgrinfo_appinfo_filter_h handle;
3946 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3947 if (ret != PMINFO_R_OK)
3949 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3950 if (ret != PMINFO_R_OK) {
3951 pkgmgrinfo_appinfo_filter_destroy(handle);
3954 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
3955 if (ret != PMINFO_R_OK) {
3956 pkgmgrinfo_appinfo_filter_destroy(handle);
3959 pkgmgrinfo_appinfo_filter_destroy(handle);
3964 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3965 pkgmgrinfo_app_list_cb app_cb, void *user_data);
3966 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
3967 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
3970 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
3971 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
3972 * @brief This API counts the application that satisfy the filter conditions
3974 * @par This API is for package-manager client application
3975 * @par Sync (or) Async : Synchronous API
3977 * @param[in] handle pointer to the application info filter handle.
3978 * @param[in] count pointer to store count value
3979 * @param[in] uid the addressee user id of the instruction
3980 * @return 0 if success, error code(<0) if fail
3981 * @retval PMINFO_R_OK success
3982 * @retval PMINFO_R_EINVAL invalid argument
3983 * @retval PMINFO_R_ERROR internal error
3984 * @pre pkgmgrinfo_appinfo_filter_create()
3985 * @post pkgmgrinfo_appinfo_filter_destroy()
3986 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3988 static int get_capp_count()
3992 pkgmgrinfo_appinfo_filter_h handle;
3993 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3994 if (ret != PMINFO_R_OK)
3996 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3997 if (ret != PMINFO_R_OK) {
3998 pkgmgrinfo_appinfo_filter_destroy(handle);
4001 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4002 if (ret != PMINFO_R_OK) {
4003 pkgmgrinfo_appinfo_filter_destroy(handle);
4006 printf("No of capp: %d\n", count);
4007 pkgmgrinfo_appinfo_filter_destroy(handle);
4012 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4013 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4015 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4016 * @brief This API creates the application's metadata information filter handle from db.
4018 * @par This API is for package-manager client application
4019 * @par Sync (or) Async : Synchronous API
4021 * @param[out] handle pointer to the application metadata info filter handle.
4022 * @return 0 if success, error code(<0) if fail
4023 * @retval PMINFO_R_OK success
4024 * @retval PMINFO_R_EINVAL invalid argument
4025 * @retval PMINFO_R_ERROR internal error
4027 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4028 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4030 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4033 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4034 printf("appid : %s\n", appid);
4038 static int get_app_list(const char *mkey, const char *mvalue)
4041 pkgmgrinfo_appinfo_metadata_filter_h handle;
4042 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4043 if (ret != PMINFO_R_OK)
4045 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4046 if (ret != PMINFO_R_OK) {
4047 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4050 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4051 if (ret != PMINFO_R_OK) {
4052 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4055 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4060 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4063 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4064 * @brief This API destroys the application's metadata information filter handle.
4066 * @par This API is for package-manager client application
4067 * @par Sync (or) Async : Synchronous API
4069 * @param[in] handle pointer to the application metadata info filter handle.
4070 * @return 0 if success, error code(<0) if fail
4071 * @retval PMINFO_R_OK success
4072 * @retval PMINFO_R_EINVAL invalid argument
4073 * @retval PMINFO_R_ERROR internal error
4074 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4076 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4078 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4081 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4082 printf("appid : %s\n", appid);
4086 static int get_app_list(const char *mkey, const char *mvalue)
4089 pkgmgrinfo_appinfo_metadata_filter_h handle;
4090 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4091 if (ret != PMINFO_R_OK)
4093 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4094 if (ret != PMINFO_R_OK) {
4095 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4098 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4099 if (ret != PMINFO_R_OK) {
4100 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4103 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4108 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4111 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4112 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4113 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4115 * @par This API is for package-manager client application
4116 * @par Sync (or) Async : Synchronous API
4118 * @param[in] handle pointer to the application metadata info filter handle.
4119 * @param[in] key pointer to metadata key
4120 * @param[in] value pointer to metadata value
4121 * @return 0 if success, error code(<0) if fail
4122 * @retval PMINFO_R_OK success
4123 * @retval PMINFO_R_EINVAL invalid argument
4124 * @retval PMINFO_R_ERROR internal error
4125 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4126 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4127 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4129 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4132 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4133 printf("appid : %s\n", appid);
4137 static int get_app_list(const char *mkey, const char *mvalue)
4140 pkgmgrinfo_appinfo_metadata_filter_h handle;
4141 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4142 if (ret != PMINFO_R_OK)
4144 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4145 if (ret != PMINFO_R_OK) {
4146 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4149 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4150 if (ret != PMINFO_R_OK) {
4151 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4154 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4159 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4160 const char *key, const char *value);
4163 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4164 * @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)
4165 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4166 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4167 * negative value, no more callbacks will be called and API will return.
4169 * @par This API is for package-manager client application
4170 * @par Sync (or) Async : Synchronous API
4172 * @param[in] handle pointer to the application metadata info filter handle.
4173 * @param[in] app_cb function pointer to callback
4174 * @param[in] user_data pointer to user data
4175 * @param[in] uid the addressee user id of the instruction
4176 * @return 0 if success, error code(<0) if fail
4177 * @retval PMINFO_R_OK success
4178 * @retval PMINFO_R_EINVAL invalid argument
4179 * @retval PMINFO_R_ERROR internal error
4180 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4181 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4183 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4186 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4187 printf("appid : %s\n", appid);
4191 static int get_app_list(const char *mkey, const char *mvalue)
4194 pkgmgrinfo_appinfo_metadata_filter_h handle;
4195 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4196 if (ret != PMINFO_R_OK)
4198 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4199 if (ret != PMINFO_R_OK) {
4200 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4203 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4204 if (ret != PMINFO_R_OK) {
4205 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4208 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4213 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4214 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4215 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4216 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4218 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4219 * @brief This API creates the package cert information handle to get data from db.
4221 * @par This API is for package-manager client application
4222 * @par Sync (or) Async : Synchronous API
4224 * @param[out] handle pointer to the package cert handle.
4225 * @return 0 if success, error code(<0) if fail
4226 * @retval PMINFO_R_OK success
4227 * @retval PMINFO_R_EINVAL invalid argument
4228 * @retval PMINFO_R_ERROR internal error
4230 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4231 * @see pkgmgrinfo_pkginfo_get_cert_value()
4232 * @see pkgmgrinfo_pkginfo_load_certinfo()
4234 static int get_cert_info(const char *pkgid)
4237 pkgmgrinfo_certinfo_h handle;
4238 char *auth_cert = NULL;
4239 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4240 if (ret != PMINFO_R_OK)
4242 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4243 if (ret != PMINFO_R_OK) {
4244 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4247 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4252 printf("Author root certificate: %s\n", auth_root);
4253 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4258 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4261 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4262 * @brief This API loads the package cert information handle with data from db.
4264 * @par This API is for package-manager client application
4265 * @par Sync (or) Async : Synchronous API
4267 * @param[in] pkgid pointer to the package ID.
4268 * @param[in] handle pointer to the package cert handle.
4269 * @return 0 if success, error code(<0) if fail
4270 * @retval PMINFO_R_OK success
4271 * @retval PMINFO_R_EINVAL invalid argument
4272 * @retval PMINFO_R_ERROR internal error
4273 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4274 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4275 * @see pkgmgrinfo_pkginfo_get_cert_value()
4277 static int get_cert_info(const char *pkgid)
4280 pkgmgrinfo_certinfo_h handle;
4281 char *auth_cert = NULL;
4282 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4283 if (ret != PMINFO_R_OK)
4285 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4286 if (ret != PMINFO_R_OK) {
4287 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4290 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4291 if (ret != PMINFO_R_OK) {
4292 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4295 printf("Author root certificate: %s\n", auth_root);
4296 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4301 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4304 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4305 * @brief This API gets the package cert information from the handle
4307 * @par This API is for package-manager client application
4308 * @par Sync (or) Async : Synchronous API
4310 * @param[in] handle pointer to the package cert handle.
4311 * @param[in] cert_type certificate type
4312 * @param[out] cert_value pointer to hold certificate value
4313 * @return 0 if success, error code(<0) if fail
4314 * @retval PMINFO_R_OK success
4315 * @retval PMINFO_R_EINVAL invalid argument
4316 * @retval PMINFO_R_ERROR internal error
4317 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4318 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4319 * @see pkgmgrinfo_pkginfo_load_certinfo()
4321 static int get_cert_info(const char *pkgid)
4324 pkgmgrinfo_certinfo_h handle;
4325 char *auth_cert = NULL;
4326 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4327 if (ret != PMINFO_R_OK)
4329 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4330 if (ret != PMINFO_R_OK) {
4331 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4334 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4335 if (ret != PMINFO_R_OK) {
4336 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4339 printf("Author root certificate: %s\n", auth_root);
4340 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4345 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4348 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4349 * @brief This API destroys the package cert information handle freeing up all the resources
4351 * @par This API is for package-manager client application
4352 * @par Sync (or) Async : Synchronous API
4354 * @param[in] handle pointer to the package cert handle.
4355 * @return 0 if success, error code(<0) if fail
4356 * @retval PMINFO_R_OK success
4357 * @retval PMINFO_R_EINVAL invalid argument
4358 * @retval PMINFO_R_ERROR internal error
4359 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4361 * @see pkgmgrinfo_pkginfo_load_certinfo()
4363 static int get_cert_info(const char *pkgid)
4366 pkgmgrinfo_certinfo_h handle;
4367 char *auth_cert = NULL;
4368 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4369 if (ret != PMINFO_R_OK)
4371 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4372 if (ret != PMINFO_R_OK) {
4373 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4376 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4377 if (ret != PMINFO_R_OK) {
4378 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4381 printf("Author root certificate: %s\n", auth_root);
4382 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4387 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4390 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4391 * @brief This API deletes the package cert information from DB
4393 * @par This API is for package-manager client application
4394 * @par Sync (or) Async : Synchronous API
4396 * @param[in] pkgid pointer to the package ID.
4397 * @return 0 if success, error code(<0) if fail
4398 * @retval PMINFO_R_OK success
4399 * @retval PMINFO_R_EINVAL invalid argument
4400 * @retval PMINFO_R_ERROR internal error
4404 static int delete_cert_info(const char *pkgid)
4407 ret = pkgmgrinfo_delete_certinfo(pkgid);
4408 if (ret != PMINFO_R_OK)
4414 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4415 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4417 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4418 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4419 * @brief This API creates the package db information handle to set data in db.
4421 * @par This API is for package-manager client application
4422 * @par Sync (or) Async : Synchronous API
4424 * @param[in] pkgid pointer to the package ID.
4425 * @param[in] uid the addressee user id of the instruction
4426 * @param[out] handle pointer to the package db info handle.
4427 * @return 0 if success, error code(<0) if fail
4428 * @retval PMINFO_R_OK success
4429 * @retval PMINFO_R_EINVAL invalid argument
4430 * @retval PMINFO_R_ERROR internal error
4432 * @post pkgmgrinfo_destroy_pkgdbinfo()
4433 * @see pkgmgrinfo_save_pkgdbinfo()
4434 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4436 static int set_pkg_in_db(const char *pkgid)
4439 pkgmgrinfo_pkgdbinfo_h handle;
4440 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4441 if (ret != PMINFO_R_OK)
4443 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4444 if (ret != PMINFO_R_OK) {
4445 pkgmgrinfo_destroy_pkgdbinfo(handle);
4448 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4449 if (ret != PMINFO_R_OK) {
4450 pkgmgrinfo_destroy_pkgdbinfo(handle);
4453 pkgmgrinfo_destroy_pkgdbinfo(handle);
4458 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4459 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4462 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4463 * @brief This API sets the package type in db handle
4465 * @par This API is for package-manager client application
4466 * @par Sync (or) Async : Synchronous API
4468 * @param[in] handle pointer to the pkgdbinfo handle.
4469 * @param[in] type pointer to the package type.
4470 * @return 0 if success, error code(<0) if fail
4471 * @retval PMINFO_R_OK success
4472 * @retval PMINFO_R_EINVAL invalid argument
4473 * @retval PMINFO_R_ERROR internal error
4474 * @pre pkgmgrinfo_create_pkgdbinfo()
4475 * @post pkgmgrinfo_destroy_pkgdbinfo()
4476 * @see pkgmgrinfo_save_pkgdbinfo()
4477 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4479 static int set_pkg_type_in_db(const char *pkgid)
4482 pkgmgrinfo_pkgdbinfo_h handle;
4483 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4484 if (ret != PMINFO_R_OK)
4486 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4487 if (ret != PMINFO_R_OK) {
4488 pkgmgrinfo_destroy_pkgdbinfo(handle);
4491 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4492 if (ret != PMINFO_R_OK) {
4493 pkgmgrinfo_destroy_pkgdbinfo(handle);
4496 pkgmgrinfo_destroy_pkgdbinfo(handle);
4501 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4504 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4505 * @brief This API sets the package version in db handle
4507 * @par This API is for package-manager client application
4508 * @par Sync (or) Async : Synchronous API
4510 * @param[in] handle pointer to the pkgdbinfo handle.
4511 * @param[in] version pointer to the package version
4512 * @return 0 if success, error code(<0) if fail
4513 * @retval PMINFO_R_OK success
4514 * @retval PMINFO_R_EINVAL invalid argument
4515 * @retval PMINFO_R_ERROR internal error
4516 * @pre pkgmgrinfo_create_pkgdbinfo()
4517 * @post pkgmgrinfo_destroy_pkgdbinfo()
4518 * @see pkgmgrinfo_save_pkgdbinfo()
4519 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4521 static int set_pkg_version_in_db(const char *pkgid)
4524 pkgmgrinfo_pkgdbinfo_h handle;
4525 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4526 if (ret != PMINFO_R_OK)
4528 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4529 if (ret != PMINFO_R_OK) {
4530 pkgmgrinfo_destroy_pkgdbinfo(handle);
4533 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4534 if (ret != PMINFO_R_OK) {
4535 pkgmgrinfo_destroy_pkgdbinfo(handle);
4538 pkgmgrinfo_destroy_pkgdbinfo(handle);
4543 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4546 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4547 * @brief This API sets the package install location in db handle
4549 * @par This API is for package-manager client application
4550 * @par Sync (or) Async : Synchronous API
4552 * @param[in] handle pointer to the pkgdbinfo handle.
4553 * @param[in] location package install location
4554 * @return 0 if success, error code(<0) if fail
4555 * @retval PMINFO_R_OK success
4556 * @retval PMINFO_R_EINVAL invalid argument
4557 * @retval PMINFO_R_ERROR internal error
4558 * @pre pkgmgrinfo_create_pkgdbinfo()
4559 * @post pkgmgrinfo_destroy_pkgdbinfo()
4560 * @see pkgmgrinfo_save_pkgdbinfo()
4561 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4563 static int set_pkg_install_location_in_db(const char *pkgid)
4566 pkgmgrinfo_pkgdbinfo_h handle;
4567 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4568 if (ret != PMINFO_R_OK)
4570 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4571 if (ret != PMINFO_R_OK) {
4572 pkgmgrinfo_destroy_pkgdbinfo(handle);
4575 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4576 if (ret != PMINFO_R_OK) {
4577 pkgmgrinfo_destroy_pkgdbinfo(handle);
4580 pkgmgrinfo_destroy_pkgdbinfo(handle);
4585 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4588 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4589 * @brief This API sets the package size in db handle
4591 * @par This API is for package-manager client application
4592 * @par Sync (or) Async : Synchronous API
4594 * @param[in] handle pointer to the pkgdbinfo handle.
4595 * @param[in] size pointer to the package size
4596 * @return 0 if success, error code(<0) if fail
4597 * @retval PMINFO_R_OK success
4598 * @retval PMINFO_R_EINVAL invalid argument
4599 * @retval PMINFO_R_ERROR internal error
4600 * @pre pkgmgrinfo_create_pkgdbinfo()
4601 * @post pkgmgrinfo_destroy_pkgdbinfo()
4602 * @see pkgmgrinfo_save_pkgdbinfo()
4603 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4605 static int set_pkg_size_in_db(const char *pkgid)
4608 pkgmgrinfo_pkgdbinfo_h handle;
4609 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4610 if (ret != PMINFO_R_OK)
4612 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4613 if (ret != PMINFO_R_OK) {
4614 pkgmgrinfo_destroy_pkgdbinfo(handle);
4617 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4618 if (ret != PMINFO_R_OK) {
4619 pkgmgrinfo_destroy_pkgdbinfo(handle);
4622 pkgmgrinfo_destroy_pkgdbinfo(handle);
4627 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4630 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4631 * @brief This API sets the package label in db handle
4633 * @par This API is for package-manager client application
4634 * @par Sync (or) Async : Synchronous API
4636 * @param[in] handle pointer to the pkgdbinfo handle.
4637 * @param[in] label pointer to the package label
4638 * @param[in] locale pointer to the locale
4639 * @return 0 if success, error code(<0) if fail
4640 * @retval PMINFO_R_OK success
4641 * @retval PMINFO_R_EINVAL invalid argument
4642 * @retval PMINFO_R_ERROR internal error
4643 * @pre pkgmgrinfo_create_pkgdbinfo()
4644 * @post pkgmgrinfo_destroy_pkgdbinfo()
4645 * @see pkgmgrinfo_save_pkgdbinfo()
4646 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4648 static int set_pkg_label_in_db(const char *pkgid)
4651 pkgmgrinfo_pkgdbinfo_h handle;
4652 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4653 if (ret != PMINFO_R_OK)
4655 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4656 if (ret != PMINFO_R_OK) {
4657 pkgmgrinfo_destroy_pkgdbinfo(handle);
4660 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4661 if (ret != PMINFO_R_OK) {
4662 pkgmgrinfo_destroy_pkgdbinfo(handle);
4665 pkgmgrinfo_destroy_pkgdbinfo(handle);
4670 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4673 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4674 * @brief This API sets the package icon in db handle
4676 * @par This API is for package-manager client application
4677 * @par Sync (or) Async : Synchronous API
4679 * @param[in] handle pointer to the pkgdbinfo handle.
4680 * @param[in] icon pointer to the package icon
4681 * @param[in] locale pointer to the locale
4682 * @return 0 if success, error code(<0) if fail
4683 * @retval PMINFO_R_OK success
4684 * @retval PMINFO_R_EINVAL invalid argument
4685 * @retval PMINFO_R_ERROR internal error
4686 * @pre pkgmgrinfo_create_pkgdbinfo()
4687 * @post pkgmgrinfo_destroy_pkgdbinfo()
4688 * @see pkgmgrinfo_save_pkgdbinfo()
4689 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4691 static int set_pkg_icon_in_db(const char *pkgid)
4694 pkgmgrinfo_pkgdbinfo_h handle;
4695 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4696 if (ret != PMINFO_R_OK)
4698 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4699 if (ret != PMINFO_R_OK) {
4700 pkgmgrinfo_destroy_pkgdbinfo(handle);
4703 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4704 if (ret != PMINFO_R_OK) {
4705 pkgmgrinfo_destroy_pkgdbinfo(handle);
4708 pkgmgrinfo_destroy_pkgdbinfo(handle);
4713 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4716 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4717 * @brief This API sets the package description in db handle
4719 * @par This API is for package-manager client application
4720 * @par Sync (or) Async : Synchronous API
4722 * @param[in] handle pointer to the pkgdbinfo handle.
4723 * @param[in] description pointer to the package description
4724 * @param[in] locale pointer to the locale
4725 * @return 0 if success, error code(<0) if fail
4726 * @retval PMINFO_R_OK success
4727 * @retval PMINFO_R_EINVAL invalid argument
4728 * @retval PMINFO_R_ERROR internal error
4729 * @pre pkgmgrinfo_create_pkgdbinfo()
4730 * @post pkgmgrinfo_destroy_pkgdbinfo()
4731 * @see pkgmgrinfo_save_pkgdbinfo()
4732 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4734 static int set_pkg_description_in_db(const char *pkgid)
4737 pkgmgrinfo_pkgdbinfo_h handle;
4738 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4739 if (ret != PMINFO_R_OK)
4741 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4742 if (ret != PMINFO_R_OK) {
4743 pkgmgrinfo_destroy_pkgdbinfo(handle);
4746 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4747 if (ret != PMINFO_R_OK) {
4748 pkgmgrinfo_destroy_pkgdbinfo(handle);
4751 pkgmgrinfo_destroy_pkgdbinfo(handle);
4756 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4759 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4760 const char *author_email, const char *author_href, const char *locale)
4761 * @brief This API sets the package author info in db handle
4763 * @par This API is for package-manager client application
4764 * @par Sync (or) Async : Synchronous API
4766 * @param[in] handle pointer to the pkgdbinfo handle.
4767 * @param[in] author_name pointer to the package author name
4768 * @param[in] author_email pointer to the package author email
4769 * @param[in] author_href pointer to the package author href
4770 * @param[in] locale pointer to the locale
4771 * @return 0 if success, error code(<0) if fail
4772 * @retval PMINFO_R_OK success
4773 * @retval PMINFO_R_EINVAL invalid argument
4774 * @retval PMINFO_R_ERROR internal error
4775 * @pre pkgmgrinfo_create_pkgdbinfo()
4776 * @post pkgmgrinfo_destroy_pkgdbinfo()
4777 * @see pkgmgrinfo_save_pkgdbinfo()
4778 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4780 static int set_pkg_author_in_db(const char *pkgid)
4783 pkgmgrinfo_pkgdbinfo_h handle;
4784 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4785 if (ret != PMINFO_R_OK)
4787 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4788 if (ret != PMINFO_R_OK) {
4789 pkgmgrinfo_destroy_pkgdbinfo(handle);
4792 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4793 if (ret != PMINFO_R_OK) {
4794 pkgmgrinfo_destroy_pkgdbinfo(handle);
4797 pkgmgrinfo_destroy_pkgdbinfo(handle);
4802 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4803 const char *author_email, const char *author_href, const char *locale);
4806 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4807 * @brief This API sets the package 'removable' value in db handle
4809 * @par This API is for package-manager client application
4810 * @par Sync (or) Async : Synchronous API
4812 * @param[in] handle pointer to the pkgdbinfo handle.
4813 * @param[in] removable package removable value
4814 * @return 0 if success, error code(<0) if fail
4815 * @retval PMINFO_R_OK success
4816 * @retval PMINFO_R_EINVAL invalid argument
4817 * @retval PMINFO_R_ERROR internal error
4818 * @pre pkgmgrinfo_create_pkgdbinfo()
4819 * @post pkgmgrinfo_destroy_pkgdbinfo()
4820 * @see pkgmgrinfo_save_pkgdbinfo()
4821 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4823 static int set_pkg_removable_in_db(const char *pkgid)
4826 pkgmgrinfo_pkgdbinfo_h handle;
4827 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4828 if (ret != PMINFO_R_OK)
4830 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4831 if (ret != PMINFO_R_OK) {
4832 pkgmgrinfo_destroy_pkgdbinfo(handle);
4835 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4836 if (ret != PMINFO_R_OK) {
4837 pkgmgrinfo_destroy_pkgdbinfo(handle);
4840 pkgmgrinfo_destroy_pkgdbinfo(handle);
4845 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4848 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4849 * @brief This API sets the package 'preload' value in db handle
4851 * @par This API is for package-manager client application
4852 * @par Sync (or) Async : Synchronous API
4854 * @param[in] handle pointer to the pkgdbinfo handle.
4855 * @param[in] preload package preload value
4856 * @return 0 if success, error code(<0) if fail
4857 * @retval PMINFO_R_OK success
4858 * @retval PMINFO_R_EINVAL invalid argument
4859 * @retval PMINFO_R_ERROR internal error
4860 * @pre pkgmgrinfo_create_pkgdbinfo()
4861 * @post pkgmgrinfo_destroy_pkgdbinfo()
4862 * @see pkgmgrinfo_save_pkgdbinfo()
4863 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4865 static int set_pkg_preload_in_db(const char *pkgid)
4868 pkgmgrinfo_pkgdbinfo_h handle;
4869 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4870 if (ret != PMINFO_R_OK)
4872 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4873 if (ret != PMINFO_R_OK) {
4874 pkgmgrinfo_destroy_pkgdbinfo(handle);
4877 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4878 if (ret != PMINFO_R_OK) {
4879 pkgmgrinfo_destroy_pkgdbinfo(handle);
4882 pkgmgrinfo_destroy_pkgdbinfo(handle);
4887 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
4890 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4891 * @brief This API sets the package 'installed_storage' value in db handle
4893 * @par This API is for package-manager client application
4894 * @par Sync (or) Async : Synchronous API
4896 * @param[in] handle pointer to the pkgdbinfo handle.
4897 * @param[in] location installed_storage value
4898 * @return 0 if success, error code(<0) if fail
4899 * @retval PMINFO_R_OK success
4900 * @retval PMINFO_R_EINVAL invalid argument
4901 * @retval PMINFO_R_ERROR internal error
4902 * @pre pkgmgrinfo_create_pkgdbinfo()
4903 * @post pkgmgrinfo_destroy_pkgdbinfo()
4904 * @see pkgmgrinfo_save_pkgdbinfo()
4906 static int set_pkg_installed_storage_in_db(const char *pkgid)
4909 pkgmgrinfo_pkgdbinfo_h handle;
4910 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4911 if (ret != PMINFO_R_OK)
4913 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4914 if (ret != PMINFO_R_OK) {
4915 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4919 if (ret != PMINFO_R_OK) {
4920 pkgmgrinfo_destroy_pkgdbinfo(handle);
4923 pkgmgrinfo_destroy_pkgdbinfo(handle);
4928 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4931 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4932 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
4933 * @brief This API saves all the information from the handle to the DB.
4935 * @par This API is for package-manager client application
4936 * @par Sync (or) Async : Synchronous API
4938 * @param[in] handle pointer to the package db info handle.
4939 * @param[in] uid the addressee user id of the instruction
4940 * @return 0 if success, error code(<0) if fail
4941 * @retval PMINFO_R_OK success
4942 * @retval PMINFO_R_EINVAL invalid argument
4943 * @retval PMINFO_R_ERROR internal error
4944 * @pre pkgmgrinfo_create_pkgdbinfo()
4945 * @post pkgmgrinfo_destroy_pkgdbinfo()
4946 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4948 static int set_pkg_in_db(const char *pkgid)
4951 pkgmgrinfo_pkgdbinfo_h handle;
4952 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4953 if (ret != PMINFO_R_OK)
4955 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4956 if (ret != PMINFO_R_OK) {
4957 pkgmgrinfo_destroy_pkgdbinfo(handle);
4960 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4961 if (ret != PMINFO_R_OK) {
4962 pkgmgrinfo_destroy_pkgdbinfo(handle);
4965 pkgmgrinfo_destroy_pkgdbinfo(handle);
4970 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
4971 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
4973 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
4974 * @brief This API destroys the package db information handle freeing up all the resources
4976 * @par This API is for package-manager client application
4977 * @par Sync (or) Async : Synchronous API
4979 * @param[in] handle pointer to the package db info handle.
4980 * @return 0 if success, error code(<0) if fail
4981 * @retval PMINFO_R_OK success
4982 * @retval PMINFO_R_EINVAL invalid argument
4983 * @retval PMINFO_R_ERROR internal error
4984 * @pre pkgmgrinfo_create_pkgdbinfo()
4986 * @see pkgmgrinfo_save_pkgdbinfo()
4987 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4989 static int set_pkg_in_db(const char *pkgid)
4992 pkgmgrinfo_pkgdbinfo_h handle;
4993 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4994 if (ret != PMINFO_R_OK)
4996 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4997 if (ret != PMINFO_R_OK) {
4998 pkgmgrinfo_destroy_pkgdbinfo(handle);
5001 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5002 if (ret != PMINFO_R_OK) {
5003 pkgmgrinfo_destroy_pkgdbinfo(handle);
5006 pkgmgrinfo_destroy_pkgdbinfo(handle);
5011 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5015 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5016 * @brief This API creates the package cert information handle to set data in db.
5018 * @par This API is for package-manager client application
5019 * @par Sync (or) Async : Synchronous API
5021 * @param[out] handle pointer to the package cert handle.
5022 * @return 0 if success, error code(<0) if fail
5023 * @retval PMINFO_R_OK success
5024 * @retval PMINFO_R_EINVAL invalid argument
5025 * @retval PMINFO_R_ERROR internal error
5027 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5028 * @see pkgmgrinfo_set_cert_value()
5029 * @see pkgmgrinfo_save_certinfo()
5031 static int set_cert_in_db(const char *pkgid)
5034 pkgmgrinfo_instcertinfo_h handle;
5035 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5036 if (ret != PMINFO_R_OK)
5038 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5039 if (ret != PMINFO_R_OK) {
5040 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5043 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5044 if (ret != PMINFO_R_OK) {
5045 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5048 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5053 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5056 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5057 * @brief This API sets the package cert information in the handle.
5059 * @par This API is for package-manager client application
5060 * @par Sync (or) Async : Synchronous API
5062 * @param[in] handle pointer to the package cert handle.
5063 * @param[in] cert_type certificate type.
5064 * @param[in] cert_value certificate value.
5065 * @return 0 if success, error code(<0) if fail
5066 * @retval PMINFO_R_OK success
5067 * @retval PMINFO_R_EINVAL invalid argument
5068 * @retval PMINFO_R_ERROR internal error
5069 * @pre pkgmgrinfo_create_certinfo_set_handle()
5070 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5071 * @see pkgmgrinfo_save_certinfo()
5073 static int set_cert_in_db(const char *pkgid)
5076 pkgmgrinfo_instcertinfo_h handle;
5077 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5078 if (ret != PMINFO_R_OK)
5080 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5081 if (ret != PMINFO_R_OK) {
5082 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5085 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5086 if (ret != PMINFO_R_OK) {
5087 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5090 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5095 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5098 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5099 * @brief This API saves the package cert information in the DB.
5101 * @par This API is for package-manager client application
5102 * @par Sync (or) Async : Synchronous API
5104 * @param[in] pkgid pointer to the package ID.
5105 * @param[in] handle pointer to the package cert handle.
5106 * @return 0 if success, error code(<0) if fail
5107 * @retval PMINFO_R_OK success
5108 * @retval PMINFO_R_EINVAL invalid argument
5109 * @retval PMINFO_R_ERROR internal error
5110 * @pre pkgmgrinfo_create_certinfo_set_handle()
5111 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5112 * @see pkgmgrinfo_save_certinfo()
5114 static int set_cert_in_db(const char *pkgid)
5117 pkgmgrinfo_instcertinfo_h handle;
5118 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5119 if (ret != PMINFO_R_OK)
5121 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5122 if (ret != PMINFO_R_OK) {
5123 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5126 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5127 if (ret != PMINFO_R_OK) {
5128 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5131 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5136 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5139 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5140 * @brief This API destroys the package cert information handle freeing up all the resources.
5142 * @par This API is for package-manager client application
5143 * @par Sync (or) Async : Synchronous API
5145 * @param[in] handle pointer to the package cert handle.
5146 * @return 0 if success, error code(<0) if fail
5147 * @retval PMINFO_R_OK success
5148 * @retval PMINFO_R_EINVAL invalid argument
5149 * @retval PMINFO_R_ERROR internal error
5150 * @pre pkgmgrinfo_create_certinfo_set_handle()
5152 * @see pkgmgrinfo_save_certinfo()
5154 static int set_cert_in_db(const char *pkgid)
5157 pkgmgrinfo_instcertinfo_h handle;
5158 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5159 if (ret != PMINFO_R_OK)
5161 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5162 if (ret != PMINFO_R_OK) {
5163 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5166 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5167 if (ret != PMINFO_R_OK) {
5168 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5171 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5176 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5179 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5180 * @brief This API gets the datacontrol info
5182 * @par This API is for package-manager client application
5183 * @par Sync (or) Async : Synchronous API
5185 * @param[in] providerid pointer to the providerid of dataconltrol.
5186 * @param[in] type pointer to the type of dataconltrol.
5187 * @param[out] appid pointer to hold appid, need to free after using
5188 * @param[out] access pointer to hold access, need to free after using
5189 * @return 0 if success, error code(<0) if fail
5190 * @retval PMINFO_R_OK success
5191 * @retval PMINFO_R_EINVAL invalid argument
5192 * @retval PMINFO_R_ERROR internal error
5195 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5198 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5199 * @brief This API gets the application 'guest mode visibility' value from the DB
5201 * @par This API is for package-manager client application
5202 * @par Sync (or) Async : Synchronous API
5204 * @param[in] handle pointer to application info handle
5205 * @param[out] status pointer to hold app guest mode visibility value
5206 * @return 0 if success, error code(<0) if fail
5207 * @retval PMINFO_R_OK success
5208 * @retval PMINFO_R_EINVAL invalid argument
5209 * @retval PMINFO_R_ERROR internal error
5210 * @pre pkgmgrinfo_appinfo_get_appinfo()
5211 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5212 * @see pkgmgrinfo_appinfo_get_appid()
5213 * @see pkgmgrinfo_appinfo_is_multiple()
5215 static int get_app_guestmode_visibility(const char *appid)
5219 pkgmgrinfo_appinfo_h handle;
5220 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5221 if (ret != PMINFO_R_OK)
5223 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5224 if (ret != PMINFO_R_OK) {
5225 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5228 printf("app guest mode visibility: %d\n", status);
5229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5234 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5237 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5238 * @brief This API sets the application 'guest mode visibility' value in the DB
5240 * @par This API is for package-manager client application
5241 * @par Sync (or) Async : Synchronous API
5243 * @param[in] handle pointer to application info handle
5244 * @param[out] status app guest mode visibility value
5245 * @return 0 if success, error code(<0) if fail
5246 * @retval PMINFO_R_OK success
5247 * @retval PMINFO_R_EINVAL invalid argument
5248 * @retval PMINFO_R_ERROR internal error
5249 * @pre pkgmgrinfo_appinfo_get_appinfo()
5250 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5251 * @see pkgmgrinfo_appinfo_get_appid()
5252 * @see pkgmgrinfo_appinfo_is_multiple()
5254 static int set_app_guestmode_visibility(const char *appid, bool value)
5257 pkgmgrinfo_appinfo_h handle;
5258 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5259 if (ret != PMINFO_R_OK)
5261 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5262 if (ret != PMINFO_R_OK) {
5263 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5266 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5271 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5272 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5274 * @pkgmgrinfo client API
5278 * @brief listening status type in pkgmgrinfo.
5280 #define PMINFO_CLIENT_STATUS_ALL 0x00
5281 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5282 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5283 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5284 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5285 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5286 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5289 * @brief This APIs provides pkgmgrinfo client listener
5291 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5292 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5293 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5294 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5295 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5299 * @pkgmgrinfo client API end
5307 #endif /* __PKG_INFO_H__ */