4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
96 /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
111 /** Integer property for filtering based on package info*/
112 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
114 /** String property for filtering based on app info*/
115 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
116 /** String property for filtering based on app info*/
117 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
118 /** String property for filtering based on app info*/
119 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
120 /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_METADATA_KEY "PMINFO_APPINFO_PROP_APP_METADATA_KEY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_METADATA_VALUE "PMINFO_APPINFO_PROP_APP_METADATA_VALUE"
143 /** Boolean property for filtering based on app info*/
144 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
145 /** Boolean property for filtering based on app info*/
146 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
147 /** Boolean property for filtering based on app info*/
148 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
149 /** Boolean property for filtering based on app info*/
150 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
151 /** Boolean property for filtering based on app info*/
152 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
153 /** Boolean property for filtering based on app info*/
154 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
155 /** Boolean property for filtering based on app info*/
156 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
157 /** Boolean property for filtering based on app info*/
158 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
160 /** will be updated*/
161 /** string property for filtering based on pkg info*/
162 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
164 /* For multiuser support */
165 const char *getIconPath(uid_t uid);
166 const char *getUserPkgParserDBPath(void);
167 const char *getUserPkgParserDBPathUID(uid_t uid);
168 const char *getUserPkgCertDBPath(void);
169 const char *getUserPkgCertDBPathUID(uid_t uid);
170 const char *getUserDesktopPath(uid_t uid);
171 const char *getUserManifestPath(uid_t uid);
174 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
175 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
176 * @brief This API gets list of installed packages
178 * @par This API is for package-manager client application
179 * @par Sync (or) Async : Synchronous API
180 * @param[in] pkg_list_cb iteration function for list
181 * @param[in] user_data user data to be passed to callback function
182 * @param[in] uid the addressee user id of the instruction
183 * @return 0 if success, error code(<0) if fail
184 * @retval PMINFO_R_OK success
185 * @retval PMINFO_R_EINVAL invalid argument
186 * @retval PMINFO_R_ERROR internal error
190 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
194 pkgid1 = (char *)user_data;
195 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
196 if (strcmp(pkgid1, pkgid2) == 0) {
203 static int list_pkgs()
206 char *name = "helloworld";
207 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
208 if (ret != PMINFO_R_OK) {
215 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
216 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
218 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
219 * @brief This API creates the package information handle from db
221 * @par This API is for package-manager client application
222 * @par Sync (or) Async : Synchronous API
224 * @param[in] pkgid pointer to package ID
225 * @param[in] uid the addressee user id of the instruction
226 * @param[out] handle pointer to the package info handle.
227 * @return 0 if success, error code(<0) if fail
228 * @retval PMINFO_R_OK success
229 * @retval PMINFO_R_EINVAL invalid argument
230 * @retval PMINFO_R_ERROR internal error
232 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
233 * @see pkgmgrinfo_pkginfo_get_pkgid()
234 * @see pkgmgrinfo_pkginfo_is_removable()
236 static int get_pkg_type(const char *pkgid)
240 pkgmgrinfo_pkginfo_h handle;
241 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
242 if (ret != PMINFO_R_OK)
244 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
245 if (ret != PMINFO_R_OK) {
246 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
249 printf("pkgtype: %s\n", type);
250 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
255 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
256 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
259 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
260 * @brief This API gets the package name from the package ID
262 * @par This API is for package-manager client application
263 * @par Sync (or) Async : Synchronous API
265 * @param[in] handle pointer to package info handle
266 * @param[out] pkg_name pointer to hold package name
267 * @return 0 if success, error code(<0) if fail
268 * @retval PMINFO_R_OK success
269 * @retval PMINFO_R_EINVAL invalid argument
270 * @retval PMINFO_R_ERROR internal error
271 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
272 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
273 * @see pkgmgrinfo_pkginfo_get_type()
274 * @see pkgmgrinfo_pkginfo_is_removable()
276 static int get_pkg_name(const char *pkgid)
279 char *pkgname = NULL;
280 pkgmgrinfo_pkginfo_h handle;
281 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
282 if (ret != PMINFO_R_OK)
284 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
285 if (ret != PMINFO_R_OK) {
286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
289 printf("pkgname: %s\n", pkgname);
290 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
295 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
298 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
299 * @brief This API gets the package id from the package ID
301 * @par This API is for package-manager client application
302 * @par Sync (or) Async : Synchronous API
304 * @param[in] handle pointer to package info handle
305 * @param[out] pkgid pointer to hold package id
306 * @return 0 if success, error code(<0) if fail
307 * @retval PMINFO_R_OK success
308 * @retval PMINFO_R_EINVAL invalid argument
309 * @retval PMINFO_R_ERROR internal error
310 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
311 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
312 * @see pkgmgrinfo_pkginfo_get_type()
313 * @see pkgmgrinfo_pkginfo_is_removable()
315 static int get_pkgid(const char *pkgid)
319 pkgmgrinfo_pkginfo_h handle;
320 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
321 if (ret != PMINFO_R_OK)
323 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
324 if (ret != PMINFO_R_OK) {
325 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
328 printf("pkg id: %s\n", pkg_id);
329 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
334 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
337 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
338 * @brief This API gets the package type from the package ID
340 * @par This API is for package-manager client application
341 * @par Sync (or) Async : Synchronous API
343 * @param[in] handle pointer to package info handle
344 * @param[out] type pointer to hold package type
345 * @return 0 if success, error code(<0) if fail
346 * @retval PMINFO_R_OK success
347 * @retval PMINFO_R_EINVAL invalid argument
348 * @retval PMINFO_R_ERROR internal error
349 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
350 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
351 * @see pkgmgrinfo_pkginfo_get_pkgid()
352 * @see pkgmgrinfo_pkginfo_is_removable()
354 static int get_pkg_type(const char *pkgid)
358 pkgmgrinfo_pkginfo_h handle;
359 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
360 if (ret != PMINFO_R_OK)
362 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
363 if (ret != PMINFO_R_OK) {
364 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
367 printf("pkgtype: %s\n", type);
368 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
373 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
376 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
377 * @brief This API gets the package version from the package ID
379 * @par This API is for package-manager client application
380 * @par Sync (or) Async : Synchronous API
382 * @param[in] handle pointer to package info handle
383 * @param[out] version pointer to hold package version
384 * @return 0 if success, error code(<0) if fail
385 * @retval PMINFO_R_OK success
386 * @retval PMINFO_R_EINVAL invalid argument
387 * @retval PMINFO_R_ERROR internal error
388 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
389 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
390 * @see pkgmgrinfo_pkginfo_get_pkgid()
391 * @see pkgmgrinfo_pkginfo_is_removable()
393 static int get_pkg_version(const char *pkgid)
396 char *version = NULL;
397 pkgmgrinfo_pkginfo_h handle;
398 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
399 if (ret != PMINFO_R_OK)
401 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
402 if (ret != PMINFO_R_OK) {
403 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
406 printf("pkg version: %s\n", version);
407 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
412 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
415 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
416 * @brief This API gets the package install location from the package ID
418 * @par This API is for package-manager client application
419 * @par Sync (or) Async : Synchronous API
421 * @param[in] handle pointer to package info handle
422 * @param[out] location pointer to hold package install location
423 * @return 0 if success, error code(<0) if fail
424 * @retval PMINFO_R_OK success
425 * @retval PMINFO_R_EINVAL invalid argument
426 * @retval PMINFO_R_ERROR internal error
427 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
428 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
429 * @see pkgmgrinfo_pkginfo_get_pkgid()
430 * @see pkgmgrinfo_pkginfo_is_removable()
432 static int get_pkg_install_location(const char *pkgid)
435 pkgmgrinfo_install_location location;
436 pkgmgrinfo_pkginfo_h handle;
437 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
438 if (ret != PMINFO_R_OK)
440 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
441 if (ret != PMINFO_R_OK) {
442 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
445 printf("pkg install location: %d\n", location);
446 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
451 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
454 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
455 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
456 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
457 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
459 * @par This API is for package-manager client application
460 * @par Sync (or) Async : Synchronous API
462 * @param[in] handle pointer to package info handle
463 * @param[out] size pointer to hold package size
464 * @return 0 if success, error code(<0) if fail
465 * @retval PMINFO_R_OK success
466 * @retval PMINFO_R_EINVAL invalid argument
467 * @retval PMINFO_R_ERROR internal error
468 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
469 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
470 * @see pkgmgrinfo_pkginfo_get_pkgid()
471 * @see pkgmgrinfo_pkginfo_is_removable()
473 static int get_pkg_size(const char *pkgid)
477 pkgmgrinfo_pkginfo_h handle;
478 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
479 if (ret != PMINFO_R_OK)
481 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
482 if (ret != PMINFO_R_OK) {
483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
486 printf("pkgsize: %d\n", size);
487 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
492 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
495 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
496 * @brief This API gets the installed package total size on the target.
498 * @par This API is for package-manager client application
499 * @par Sync (or) Async : Synchronous API
501 * @param[in] handle pointer to package info handle
502 * @param[out] size pointer to hold package total size
503 * @return 0 if success, error code(<0) if fail
504 * @retval PMINFO_R_OK success
505 * @retval PMINFO_R_EINVAL invalid argument
506 * @retval PMINFO_R_ERROR internal error
508 static int get_pkg_total_size(const char *pkgid)
512 pkgmgrinfo_pkginfo_h handle;
513 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
514 if (ret != PMINFO_R_OK)
516 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
517 if (ret != PMINFO_R_OK) {
518 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
521 printf("pkg total size: %d\n", size);
522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
527 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
530 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
531 * @brief This API gets the installed package data size on the target.
533 * @par This API is for package-manager client application
534 * @par Sync (or) Async : Synchronous API
536 * @param[in] handle pointer to package info handle
537 * @param[out] size pointer to hold package data size
538 * @return 0 if success, error code(<0) if fail
539 * @retval PMINFO_R_OK success
540 * @retval PMINFO_R_EINVAL invalid argument
541 * @retval PMINFO_R_ERROR internal error
543 static int get_pkg_data_size(const char *pkgid)
547 pkgmgrinfo_pkginfo_h handle;
548 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
549 if (ret != PMINFO_R_OK)
551 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
552 if (ret != PMINFO_R_OK) {
553 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
556 printf("pkg data size: %d\n", size);
557 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
562 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
565 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
566 * @brief This API gets the package icon from the package ID
568 * @par This API is for package-manager client application
569 * @par Sync (or) Async : Synchronous API
571 * @param[in] handle pointer to package info handle
572 * @param[out] icon pointer to hold package icon
573 * @return 0 if success, error code(<0) if fail
574 * @retval PMINFO_R_OK success
575 * @retval PMINFO_R_EINVAL invalid argument
576 * @retval PMINFO_R_ERROR internal error
577 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
578 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
579 * @see pkgmgrinfo_pkginfo_get_pkgid()
580 * @see pkgmgrinfo_pkginfo_is_removable()
582 static int get_pkg_icon(const char *pkgid)
586 pkgmgrinfo_pkginfo_h handle;
587 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
588 if (ret != PMINFO_R_OK)
590 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
591 if (ret != PMINFO_R_OK) {
592 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
595 printf("pkg icon: %s\n", icon);
596 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
601 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
604 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
605 * @brief This API gets the package label from the package ID
607 * @par This API is for package-manager client application
608 * @par Sync (or) Async : Synchronous API
610 * @param[in] handle pointer to package info handle
611 * @param[out] label pointer to hold package label
612 * @return 0 if success, error code(<0) if fail
613 * @retval PMINFO_R_OK success
614 * @retval PMINFO_R_EINVAL invalid argument
615 * @retval PMINFO_R_ERROR internal error
616 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
617 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
618 * @see pkgmgrinfo_pkginfo_get_pkgid()
619 * @see pkgmgrinfo_pkginfo_is_removable()
621 static int get_pkg_label(const char *pkgid)
625 pkgmgrinfo_pkginfo_h handle;
626 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
627 if (ret != PMINFO_R_OK)
629 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
630 if (ret != PMINFO_R_OK) {
631 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
634 printf("pkg label: %s\n", label);
635 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
640 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
643 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
644 * @brief This API gets the package description from the package ID
646 * @par This API is for package-manager client application
647 * @par Sync (or) Async : Synchronous API
649 * @param[in] handle pointer to package info handle
650 * @param[out] description pointer to hold package description
651 * @return 0 if success, error code(<0) if fail
652 * @retval PMINFO_R_OK success
653 * @retval PMINFO_R_EINVAL invalid argument
654 * @retval PMINFO_R_ERROR internal error
655 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
656 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
657 * @see pkgmgrinfo_pkginfo_get_pkgid()
658 * @see pkgmgrinfo_pkginfo_is_removable()
660 static int get_pkg_description(const char *pkgid)
663 char *description = NULL;
664 pkgmgrinfo_pkginfo_h handle;
665 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
666 if (ret != PMINFO_R_OK)
668 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
669 if (ret != PMINFO_R_OK) {
670 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
673 printf("pkg description: %s\n", description);
674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
679 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
682 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
683 * @brief This API gets the package's author name from the package ID
685 * @par This API is for package-manager client application
686 * @par Sync (or) Async : Synchronous API
688 * @param[in] handle pointer to package info handle
689 * @param[out] author_name pointer to hold package author name
690 * @return 0 if success, error code(<0) if fail
691 * @retval PMINFO_R_OK success
692 * @retval PMINFO_R_EINVAL invalid argument
693 * @retval PMINFO_R_ERROR internal error
694 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
695 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
696 * @see pkgmgrinfo_pkginfo_get_pkgid()
697 * @see pkgmgrinfo_pkginfo_is_removable()
699 static int get_pkg_author_name(const char *pkgid)
702 char *author_name = NULL;
703 pkgmgrinfo_pkginfo_h handle;
704 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
705 if (ret != PMINFO_R_OK)
707 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
708 if (ret != PMINFO_R_OK) {
709 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
712 printf("pkg author name: %s\n", author_name);
713 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
718 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
721 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
722 * @brief This API gets the package's author email from the package ID
724 * @par This API is for package-manager client application
725 * @par Sync (or) Async : Synchronous API
727 * @param[in] handle pointer to package info handle
728 * @param[out] author_email pointer to hold package author email
729 * @return 0 if success, error code(<0) if fail
730 * @retval PMINFO_R_OK success
731 * @retval PMINFO_R_EINVAL invalid argument
732 * @retval PMINFO_R_ERROR internal error
733 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
734 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
735 * @see pkgmgrinfo_pkginfo_get_pkgid()
736 * @see pkgmgrinfo_pkginfo_is_removable()
738 static int get_pkg_author_email(const char *pkgid)
741 char *author_email = NULL;
742 pkgmgrinfo_pkginfo_h handle;
743 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
744 if (ret != PMINFO_R_OK)
746 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
747 if (ret != PMINFO_R_OK) {
748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
751 printf("pkg author email: %s\n", author_email);
752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
757 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
760 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
761 * @brief This API gets the package's author href from the package ID
763 * @par This API is for package-manager client application
764 * @par Sync (or) Async : Synchronous API
766 * @param[in] handle pointer to package info handle
767 * @param[out] author_href pointer to hold package author href
768 * @return 0 if success, error code(<0) if fail
769 * @retval PMINFO_R_OK success
770 * @retval PMINFO_R_EINVAL invalid argument
771 * @retval PMINFO_R_ERROR internal error
772 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
773 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
774 * @see pkgmgrinfo_pkginfo_get_pkgid()
775 * @see pkgmgrinfo_pkginfo_is_removable()
777 static int get_pkg_author_href(const char *pkgid)
780 char *author_href = NULL;
781 pkgmgrinfo_pkginfo_h handle;
782 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
783 if (ret != PMINFO_R_OK)
785 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
786 if (ret != PMINFO_R_OK) {
787 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
790 printf("pkg author href: %s\n", author_href);
791 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
796 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
799 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
800 * @brief This API gets the package installed storagae value from the package ID
802 * @par This API is for package-manager client application
803 * @par Sync (or) Async : Synchronous API
805 * @param[in] handle pointer to package info handle
806 * @param[out] storage pointer to hold package installed storage
807 * @return 0 if success, error code(<0) if fail
808 * @retval PMINFO_R_OK success
809 * @retval PMINFO_R_EINVAL invalid argument
810 * @retval PMINFO_R_ERROR internal error
811 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
812 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
813 * @see pkgmgrinfo_pkginfo_get_pkgid()
814 * @see pkgmgrinfo_pkginfo_is_removable()
816 static int get_pkg_installed_storage(const char *pkgid)
819 pkgmgrinfo_installed_storage storage;
820 pkgmgrinfo_pkginfo_h handle;
821 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
822 if (ret != PMINFO_R_OK)
824 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
825 if (ret != PMINFO_R_OK) {
826 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
829 printf("pkg installed storage: %d\n", storage);
830 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
835 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
838 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
839 * @brief This API gets the installed time of package from the package ID
841 * @par This API is for package-manager client application
842 * @par Sync (or) Async : Synchronous API
844 * @param[in] handle pointer to package info handle
845 * @param[out] installed_time pointer to hold installed time of package
846 * @return 0 if success, error code(<0) if fail
847 * @retval PMINFO_R_OK success
848 * @retval PMINFO_R_EINVAL invalid argument
849 * @retval PMINFO_R_ERROR internal error
850 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
851 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
852 * @see pkgmgrinfo_pkginfo_get_pkgid()
853 * @see pkgmgrinfo_pkginfo_is_removable()
855 static int get_pkg_installed_time(const char *pkgid)
858 int installed_time = 0;
859 pkgmgrinfo_pkginfo_h handle;
860 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
861 if (ret != PMINFO_R_OK)
863 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
864 if (ret != PMINFO_R_OK) {
865 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
868 printf("installed_time: %d\n", installed_time);
869 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
874 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
877 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
878 * @brief This API gets the launch mode of package from the package ID
880 * @par This API is for package-manager client application
881 * @par Sync (or) Async : Synchronous API
883 * @param[in] handle pointer to package info handle
884 * @param[out] mode pointer to hold launch mode of package
885 * @return 0 if success, error code(<0) if fail
886 * @retval PMINFO_R_OK success
887 * @retval PMINFO_R_EINVAL invalid argument
888 * @retval PMINFO_R_ERROR internal error
889 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
890 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
891 * @see pkgmgrinfo_pkginfo_get_pkgid()
892 * @see pkgmgrinfo_pkginfo_is_removable()
894 static int get_pkg_launch_mode(const char *pkgid)
897 char *launch_mode = NULL;
898 pkgmgrinfo_pkginfo_h handle;
899 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
900 if (ret != PMINFO_R_OK)
902 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
903 if (ret != PMINFO_R_OK) {
904 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
907 printf("launch mode: %s\n", mode);
908 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
913 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
916 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
917 * @brief This API gets the store client id of package from the package ID
919 * @par This API is for package-manager client application
920 * @par Sync (or) Async : Synchronous API
922 * @param[in] handle pointer to package info handle
923 * @param[out] storeclientid pointer to hold store client id of package
924 * @return 0 if success, error code(<0) if fail
925 * @retval PMINFO_R_OK success
926 * @retval PMINFO_R_EINVAL invalid argument
927 * @retval PMINFO_R_ERROR internal error
928 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
929 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
930 * @see pkgmgrinfo_pkginfo_get_pkgid()
931 * @see pkgmgrinfo_pkginfo_is_removable()
933 static int get_pkg_storeclientid(const char *pkgid)
936 char *storeclientid = 0;
937 pkgmgrinfo_pkginfo_h handle;
938 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
939 if (ret != PMINFO_R_OK)
941 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
942 if (ret != PMINFO_R_OK) {
943 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
946 printf(store client id: %s\n", storeclientid);
947 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
952 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
955 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
956 * @brief This API gets the main app id of package from the package ID
958 * @par This API is for package-manager client application
959 * @par Sync (or) Async : Synchronous API
961 * @param[in] handle pointer to package info handle
962 * @param[out] mainappid pointer to hold main app id of package
963 * @return 0 if success, error code(<0) if fail
964 * @retval PMINFO_R_OK success
965 * @retval PMINFO_R_EINVAL invalid argument
966 * @retval PMINFO_R_ERROR internal error
967 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
968 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
969 * @see pkgmgrinfo_pkginfo_get_pkgid()
970 * @see pkgmgrinfo_pkginfo_is_removable()
972 static int get_pkg_mainappid(const char *pkgid)
976 pkgmgrinfo_pkginfo_h handle;
977 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
978 if (ret != PMINFO_R_OK)
980 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
981 if (ret != PMINFO_R_OK) {
982 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
985 printf(main app id: %s\n", mainappid);
986 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
991 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
994 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
995 * @brief This API gets the url of package from the package ID
997 * @par This API is for package-manager client application
998 * @par Sync (or) Async : Synchronous API
1000 * @param[in] handle pointer to package info handle
1001 * @param[out] url pointer to hold url of package
1002 * @return 0 if success, error code(<0) if fail
1003 * @retval PMINFO_R_OK success
1004 * @retval PMINFO_R_EINVAL invalid argument
1005 * @retval PMINFO_R_ERROR internal error
1006 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1007 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1008 * @see pkgmgrinfo_pkginfo_get_pkgid()
1009 * @see pkgmgrinfo_pkginfo_is_removable()
1011 static int get_pkg_url(const char *pkgid)
1015 pkgmgrinfo_pkginfo_h handle;
1016 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1017 if (ret != PMINFO_R_OK)
1019 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1020 if (ret != PMINFO_R_OK) {
1021 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1024 printf("url : %s\n", url);
1025 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1030 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1034 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1035 * @brief This API gets the root path of package
1037 * @par Sync (or) Async : Synchronous API
1039 * @param[in] handle pointer to package info handle
1040 * @param[out] path pointer to hold root path of package
1041 * @return 0 if success, error code(<0) if fail
1042 * @retval PMINFO_R_OK success
1043 * @retval PMINFO_R_EINVAL invalid argument
1044 * @retval PMINFO_R_ERROR internal error
1046 static int get_root_path(const char *pkgid)
1050 pkgmgrinfo_pkginfo_h handle;
1051 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1052 if (ret != PMINFO_R_OK)
1055 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1056 if (ret != PMINFO_R_OK) {
1057 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1060 printf("path : %s\n", path);
1061 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1067 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1071 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1072 * @brief This API gets the csc path of package
1074 * @par Sync (or) Async : Synchronous API
1076 * @param[in] handle pointer to package info handle
1077 * @param[out] path pointer to hold csc path of package
1078 * @return 0 if success, error code(<0) if fail
1079 * @retval PMINFO_R_OK success
1080 * @retval PMINFO_R_EINVAL invalid argument
1081 * @retval PMINFO_R_ERROR internal error
1083 static int get_csc_path(const char *pkgid)
1087 pkgmgrinfo_pkginfo_h handle;
1088 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1089 if (ret != PMINFO_R_OK)
1092 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1093 if (ret != PMINFO_R_OK) {
1094 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1097 printf("path : %s\n", path);
1098 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1104 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1107 * @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)
1108 * @brief This API compare the cert information from given package id
1110 * @par This API is for package-manager client application
1111 * @par Sync (or) Async : Synchronous API
1113 * @param[in] lhs_package_id pointer to first package ID
1114 * @param[in] rhs_package_id pointer to second package ID
1115 * @param[out] compare_result pointer to the compare result.
1116 * @return 0 if success, error code(<0) if fail
1117 * @retval PMINFO_R_OK success
1118 * @retval PMINFO_R_EINVAL invalid argument
1119 * @retval PMINFO_R_ERROR internal error
1121 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1122 * @see pkgmgrinfo_pkginfo_get_pkgid()
1123 * @see pkgmgrinfo_pkginfo_is_removable()
1125 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1128 pkgmgrinfo_cert_compare_result_type_e result;
1130 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1131 if (ret != PMINFO_R_OK) {
1134 printf("result: %d\n", result);
1139 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);
1140 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);
1142 * @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)
1143 * @brief This API compare the cert information from given app id
1145 * @par This API is for package-manager client application
1146 * @par Sync (or) Async : Synchronous API
1148 * @param[in] lhs_app_id pointer to first app ID
1149 * @param[in] rhs_app_id pointer to second app ID
1150 * @param[out] compare_result pointer to the compare result.
1151 * @return 0 if success, error code(<0) if fail
1152 * @retval PMINFO_R_OK success
1153 * @retval PMINFO_R_EINVAL invalid argument
1154 * @retval PMINFO_R_ERROR internal error
1156 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1157 * @see pkgmgrinfo_pkginfo_get_pkgid()
1158 * @see pkgmgrinfo_pkginfo_is_removable()
1160 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1163 pkgmgrinfo_cert_compare_result_type_e result;
1165 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1166 if (ret != PMINFO_R_OK) {
1169 printf("result: %d\n", result);
1174 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);
1175 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);
1177 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1178 * @brief This API gets the package 'removable' value from the package ID
1180 * @par This API is for package-manager client application
1181 * @par Sync (or) Async : Synchronous API
1183 * @param[in] handle pointer to package info handle
1184 * @param[out] removable pointer to hold package removable value
1185 * @return 0 if success, error code(<0) if fail
1186 * @retval PMINFO_R_OK success
1187 * @retval PMINFO_R_EINVAL invalid argument
1188 * @retval PMINFO_R_ERROR internal error
1189 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1190 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1191 * @see pkgmgrinfo_pkginfo_get_pkgid()
1192 * @see pkgmgrinfo_pkginfo_is_readonly()
1194 static int get_pkg_removable(const char *pkgid)
1198 pkgmgrinfo_pkginfo_h handle;
1199 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1200 if (ret != PMINFO_R_OK)
1202 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1203 if (ret != PMINFO_R_OK) {
1204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1207 printf("pkg removable: %d\n", removable);
1208 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1213 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1216 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1217 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1219 * @par This API is for package-manager client application
1220 * @par Sync (or) Async : Synchronous API
1222 * @param[in] handle pointer to package info handle
1223 * @param[out] movable pointer to hold package movable state
1224 * @return 0 if success, error code(<0) if fail
1225 * @retval PMINFO_R_OK success
1226 * @retval PMINFO_R_EINVAL invalid argument
1227 * @retval PMINFO_R_ERROR internal error
1228 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1229 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1230 * @see pkgmgrinfo_pkginfo_get_pkgid()
1232 static int get_pkg_movable(const char *pkgid)
1236 pkgmgrinfo_pkginfo_h handle;
1237 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1238 if (ret != PMINFO_R_OK)
1240 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1241 if (ret != PMINFO_R_OK) {
1242 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1245 printf("pkg movable: %d\n", movable);
1246 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1251 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1254 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1255 * @brief This API gets the package 'preload' value from the package ID
1257 * @par This API is for package-manager client application
1258 * @par Sync (or) Async : Synchronous API
1260 * @param[in] handle pointer to package info handle
1261 * @param[out] preload pointer to hold package preload value
1262 * @return 0 if success, error code(<0) if fail
1263 * @retval PMINFO_R_OK success
1264 * @retval PMINFO_R_EINVAL invalid argument
1265 * @retval PMINFO_R_ERROR internal error
1266 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1267 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1268 * @see pkgmgrinfo_pkginfo_get_pkgid()
1269 * @see pkgmgrinfo_pkginfo_is_readonly()
1271 static int get_pkg_preload(const char *pkgid)
1275 pkgmgrinfo_pkginfo_h handle;
1276 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1277 if (ret != PMINFO_R_OK)
1279 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1280 if (ret != PMINFO_R_OK) {
1281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1284 printf("pkg preload: %d\n", preload);
1285 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1290 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1293 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1294 * @brief This API gets the value for given handle is system or not
1296 * @par This API is for package-manager client application
1297 * @par Sync (or) Async : Synchronous API
1299 * @param[in] handle pointer to package info handle
1300 * @param[out] system pointer to hold system is or not
1301 * @return 0 if success, error code(<0) if fail
1302 * @retval PMINFO_R_OK success
1303 * @retval PMINFO_R_EINVAL invalid argument
1304 * @retval PMINFO_R_ERROR internal error
1305 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1306 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1307 * @see pkgmgrinfo_pkginfo_get_pkgid()
1308 * @see pkgmgrinfo_pkginfo_is_readonly()
1310 static int get_pkg_system(const char *pkgid)
1313 bool system = false;
1314 pkgmgrinfo_pkginfo_h handle = NULL;
1315 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1316 if (ret != PMINFO_R_OK)
1318 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1319 if (ret != PMINFO_R_OK) {
1320 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1323 printf("pkg system: %d\n", system);
1324 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1329 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1332 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1333 * @brief This API gets the package 'readonly' value from the package ID
1335 * @par This API is for package-manager client application
1336 * @par Sync (or) Async : Synchronous API
1338 * @param[in] handle pointer to package info handle
1339 * @param[out] readonly pointer to hold package readonly value
1340 * @return 0 if success, error code(<0) if fail
1341 * @retval PMINFO_R_OK success
1342 * @retval PMINFO_R_EINVAL invalid argument
1343 * @retval PMINFO_R_ERROR internal error
1344 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1345 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1346 * @see pkgmgrinfo_pkginfo_get_pkgid()
1347 * @see pkgmgrinfo_pkginfo_is_removable()
1349 static int get_pkg_readonly(const char *pkgid)
1353 pkgmgrinfo_pkginfo_h handle;
1354 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1355 if (ret != PMINFO_R_OK)
1357 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1358 if (ret != PMINFO_R_OK) {
1359 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1362 printf("pkg readonly: %d\n", readonly);
1363 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1368 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1372 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1373 * @brief This API gets the package 'upate' value from the package ID
1375 * @par This API is for package-manager client application
1376 * @par Sync (or) Async : Synchronous API
1378 * @param[in] handle pointer to package info handle
1379 * @param[out] update pointer to hold package update value
1380 * @return 0 if success, error code(<0) if fail
1381 * @retval PMINFO_R_OK success
1382 * @retval PMINFO_R_EINVAL invalid argument
1383 * @retval PMINFO_R_ERROR internal error
1384 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1385 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1386 * @see pkgmgrinfo_pkginfo_get_pkgid()
1388 static int get_pkg_update(const char *pkgid)
1392 pkgmgrinfo_pkginfo_h handle;
1393 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1394 if (ret != PMINFO_R_OK)
1396 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1397 if (ret != PMINFO_R_OK) {
1398 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1401 printf("pkg update: %d\n", update);
1402 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1407 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1410 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1411 * @brief This API gets the package 'support_disable' value from the package ID
1413 * @par This API is for package-manager client application
1414 * @par Sync (or) Async : Synchronous API
1416 * @param[in] handle pointer to package info handle
1417 * @param[out] support_disable pointer to hold package support_disable value
1418 * @return 0 if success, error code(<0) if fail
1419 * @retval PMINFO_R_OK success
1420 * @retval PMINFO_R_EINVAL invalid argument
1421 * @retval PMINFO_R_ERROR internal error
1422 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1423 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1424 * @see pkgmgrinfo_pkginfo_get_pkgid()
1426 static int get_pkg_support_disable(const char *pkgid)
1429 bool support_disable;
1430 pkgmgrinfo_pkginfo_h handle = NULL;
1431 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1432 if (ret != PMINFO_R_OK)
1434 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1435 if (ret != PMINFO_R_OK) {
1436 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1439 printf("pkg support_disable: %d\n", support_disable);
1440 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1445 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1448 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1449 * @brief This API gets whethere the given package is global package or user package
1451 * @par This API is for package-manager client application
1452 * @par Sync (or) Async : Synchronous API
1454 * @param[in] uid uid of the user to determine the database
1455 * @param[in] pkgid id of the current package
1456 * @return 1 if it a global package, 0 else
1459 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1463 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1464 * @brief This API gets the package 'accessible' value from the package ID
1466 * @par This API is for package-manager client application
1467 * @par Sync (or) Async : Synchronous API
1469 * @param[in] handle pointer to package info handle
1470 * @param[out] accessible pointer to hold package accessible value
1471 * @return 0 if success, error code(<0) if fail
1472 * @retval PMINFO_R_OK success
1473 * @retval PMINFO_R_EINVAL invalid argument
1474 * @retval PMINFO_R_ERROR internal error
1475 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1476 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1477 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 * @see pkgmgrinfo_pkginfo_is_readonly()
1480 static int get_pkg_accessible(const char *pkgid)
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf("pkg accessible: %d\n", accessible);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1502 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1503 * @brief This API destroys the package information handle freeing up all the resources
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to the package info handle
1509 * @return 0 if success, error code(<0) if fail
1510 * @retval PMINFO_R_OK success
1511 * @retval PMINFO_R_EINVAL invalid argument
1512 * @retval PMINFO_R_ERROR internal error
1513 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @see pkgmgrinfo_pkginfo_get_pkgid()
1516 * @see pkgmgrinfo_pkginfo_is_removable()
1518 static int get_pkg_type(const char *pkgid)
1522 pkgmgrinfo_pkginfo_h handle;
1523 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1524 if (ret != PMINFO_R_OK)
1526 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1527 if (ret != PMINFO_R_OK) {
1528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1531 printf("pkgtype: %s\n", type);
1532 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1537 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1540 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1541 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1542 The query will search the entire package information collected from the manifest file of all the installed packages
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[out] handle pointer to the package info filter handle.
1548 * @return 0 if success, error code(<0) if fail
1549 * @retval PMINFO_R_OK success
1550 * @retval PMINFO_R_EINVAL invalid argument
1551 * @retval PMINFO_R_ERROR internal error
1553 * @post pkgmgrinfo_pkginfo_filter_destroy()
1554 * @see pkgmgrinfo_pkginfo_filter_count()
1555 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1557 static int get_rpm_pkg_count()
1561 pkgmgrinfo_pkginfo_filter_h handle;
1562 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1563 if (ret != PMINFO_R_OK)
1565 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1566 if (ret != PMINFO_R_OK) {
1567 pkgmgrinfo_pkginfo_filter_destroy(handle);
1570 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1571 if (ret != PMINFO_R_OK) {
1572 pkgmgrinfo_pkginfo_filter_destroy(handle);
1575 printf("No of rpm pkgs: %d\n", count);
1576 pkgmgrinfo_pkginfo_filter_destroy(handle);
1581 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1584 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1585 * @brief This API destroys the package information filter handle freeing up all the resources
1587 * @par This API is for package-manager client application
1588 * @par Sync (or) Async : Synchronous API
1590 * @param[in] handle pointer to the package info filter handle.
1591 * @return 0 if success, error code(<0) if fail
1592 * @retval PMINFO_R_OK success
1593 * @retval PMINFO_R_EINVAL invalid argument
1594 * @retval PMINFO_R_ERROR internal error
1595 * @pre pkgmgrinfo_pkginfo_filter_create()
1597 * @see pkgmgrinfo_pkginfo_filter_count()
1598 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1600 static int get_rpm_pkg_count()
1604 pkgmgrinfo_pkginfo_filter_h handle;
1605 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1606 if (ret != PMINFO_R_OK)
1608 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1609 if (ret != PMINFO_R_OK) {
1610 pkgmgrinfo_pkginfo_filter_destroy(handle);
1613 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1614 if (ret != PMINFO_R_OK) {
1615 pkgmgrinfo_pkginfo_filter_destroy(handle);
1618 printf("No of rpm pkgs: %d\n", count);
1619 pkgmgrinfo_pkginfo_filter_destroy(handle);
1624 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1627 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1628 * @brief This API adds a boolean filter property to the filter handle
1630 * @par This API is for package-manager client application
1631 * @par Sync (or) Async : Synchronous API
1633 * @param[in] handle pointer to the package info filter handle.
1634 * @param[in] property boolean property name.
1635 * @param[in] value value corresponding to the property.
1636 * @return 0 if success, error code(<0) if fail
1637 * @retval PMINFO_R_OK success
1638 * @retval PMINFO_R_EINVAL invalid argument
1639 * @retval PMINFO_R_ERROR internal error
1640 * @pre pkgmgrinfo_pkginfo_filter_create()
1641 * @post pkgmgrinfo_pkginfo_filter_destroy()
1642 * @see pkgmgrinfo_pkginfo_filter_count()
1643 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1645 static int get_preload_pkg_count()
1649 pkgmgrinfo_pkginfo_filter_h handle;
1650 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1651 if (ret != PMINFO_R_OK)
1653 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1654 if (ret != PMINFO_R_OK) {
1655 pkgmgrinfo_pkginfo_filter_destroy(handle);
1658 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1659 if (ret != PMINFO_R_OK) {
1660 pkgmgrinfo_pkginfo_filter_destroy(handle);
1663 printf("No of preload pkgs: %d\n", count);
1664 pkgmgrinfo_pkginfo_filter_destroy(handle);
1669 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1670 const char *property, const bool value);
1673 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1674 * @brief This API adds an integer filter property to the filter handle
1676 * @par This API is for package-manager client application
1677 * @par Sync (or) Async : Synchronous API
1679 * @param[in] handle pointer to the package info filter handle.
1680 * @param[in] property integer property name.
1681 * @param[in] value value corresponding to the property.
1682 * @return 0 if success, error code(<0) if fail
1683 * @retval PMINFO_R_OK success
1684 * @retval PMINFO_R_EINVAL invalid argument
1685 * @retval PMINFO_R_ERROR internal error
1686 * @pre pkgmgrinfo_pkginfo_filter_create()
1687 * @post pkgmgrinfo_pkginfo_filter_destroy()
1688 * @see pkgmgrinfo_pkginfo_filter_count()
1689 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1691 static int get_pkg_count()
1695 pkgmgrinfo_pkginfo_filter_h handle;
1696 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1697 if (ret != PMINFO_R_OK)
1699 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1700 if (ret != PMINFO_R_OK) {
1701 pkgmgrinfo_pkginfo_filter_destroy(handle);
1704 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1705 if (ret != PMINFO_R_OK) {
1706 pkgmgrinfo_pkginfo_filter_destroy(handle);
1709 printf("No of preload pkgs: %d\n", count);
1710 pkgmgrinfo_pkginfo_filter_destroy(handle);
1715 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1716 const char *property, const int value);
1719 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1720 * @brief This API adds a string filter property to the filter handle
1722 * @par This API is for package-manager client application
1723 * @par Sync (or) Async : Synchronous API
1725 * @param[in] handle pointer to the package info filter handle.
1726 * @param[in] property string property name.
1727 * @param[in] value value corresponding to the property.
1728 * @return 0 if success, error code(<0) if fail
1729 * @retval PMINFO_R_OK success
1730 * @retval PMINFO_R_EINVAL invalid argument
1731 * @retval PMINFO_R_ERROR internal error
1732 * @pre pkgmgrinfo_pkginfo_filter_create()
1733 * @post pkgmgrinfo_pkginfo_filter_destroy()
1734 * @see pkgmgrinfo_pkginfo_filter_count()
1735 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1737 static int get_rpm_pkg_count()
1741 pkgmgrinfo_pkginfo_filter_h handle;
1742 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1743 if (ret != PMINFO_R_OK)
1745 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1746 if (ret != PMINFO_R_OK) {
1747 pkgmgrinfo_pkginfo_filter_destroy(handle);
1750 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1751 if (ret != PMINFO_R_OK) {
1752 pkgmgrinfo_pkginfo_filter_destroy(handle);
1755 printf("No of rpm pkgs: %d\n", count);
1756 pkgmgrinfo_pkginfo_filter_destroy(handle);
1761 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1762 const char *property, const char *value);
1765 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1766 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1768 * @par This API is for package-manager client application
1769 * @par Sync (or) Async : Synchronous API
1771 * @param[in] handle pointer to the package info filter handle.
1772 * @param[in] pkg_cb callback function.
1773 * @param[in] user_data user data to be passed to the callback function
1774 * @return 0 if success, error code(<0) if fail
1775 * @retval PMINFO_R_OK success
1776 * @retval PMINFO_R_EINVAL invalid argument
1777 * @retval PMINFO_R_ERROR internal error
1778 * @pre pkgmgrinfo_pkginfo_filter_create()
1779 * @post pkgmgrinfo_pkginfo_filter_destroy()
1780 * @see pkgmgrinfo_pkginfo_filter_count()
1782 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1785 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1786 printf("pkg id : %s\n", pkgid);
1790 static int get_rpm_pkg_list()
1793 pkgmgrinfo_pkginfo_filter_h handle;
1794 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1795 if (ret != PMINFO_R_OK)
1797 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1798 if (ret != PMINFO_R_OK) {
1799 pkgmgrinfo_pkginfo_filter_destroy(handle);
1802 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1803 if (ret != PMINFO_R_OK) {
1804 pkgmgrinfo_pkginfo_filter_destroy(handle);
1807 pkgmgrinfo_pkginfo_filter_destroy(handle);
1812 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1813 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1814 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1815 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1818 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1819 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1820 * @brief This API counts the package that satisfy the filter conditions
1822 * @par This API is for package-manager client application
1823 * @par Sync (or) Async : Synchronous API
1825 * @param[in] handle pointer to the package info filter handle.
1826 * @param[in] count pointer to store the count value.
1827 * @param[in] uid the addressee user id of the instruction
1828 * @return 0 if success, error code(<0) if fail
1829 * @retval PMINFO_R_OK success
1830 * @retval PMINFO_R_EINVAL invalid argument
1831 * @retval PMINFO_R_ERROR internal error
1832 * @pre pkgmgrinfo_pkginfo_filter_create()
1833 * @post pkgmgrinfo_pkginfo_filter_destroy()
1834 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1836 static int get_rpm_pkg_count()
1840 pkgmgrinfo_pkginfo_filter_h handle;
1841 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1842 if (ret != PMINFO_R_OK)
1844 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1845 if (ret != PMINFO_R_OK) {
1846 pkgmgrinfo_pkginfo_filter_destroy(handle);
1849 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1850 if (ret != PMINFO_R_OK) {
1851 pkgmgrinfo_pkginfo_filter_destroy(handle);
1854 printf("No of rpm pkgs: %d\n", count);
1855 pkgmgrinfo_pkginfo_filter_destroy(handle);
1860 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1861 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1863 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1864 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1865 * @brief This API gets the list of privilege for a particular package
1867 * @par This API is for package-manager client application
1868 * @par Sync (or) Async : Synchronous API
1869 * @param[in] handle pointer to the package info handle.
1870 * @param[in] privilege_func callback function for list
1871 * @param[in] user_data user data to be passed to callback function
1872 * @return 0 if success, error code(<0) if fail
1873 * @retval PMINFO_R_OK success
1874 * @retval PMINFO_R_EINVAL invalid argument
1875 * @retval PMINFO_R_ERROR internal error
1876 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1877 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1879 int privilege_func(const char *name, void *user_data)
1881 if (strcmp(name, (char *)user_data) == 0)
1887 static int list_privilege(const char *package, char *privilege)
1890 pkgmgrinfo_pkginfo_h handle;
1891 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1892 if (ret != PMINFO_R_OK)
1894 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1895 if (ret != PMINFO_R_OK) {
1896 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1899 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1904 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1905 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1907 /* TODO: add doxygen comment here */
1908 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1909 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1910 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1911 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1912 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1913 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1914 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1917 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1918 pkgmgrinfo_app_list_cb app_func, void *user_data)
1919 * @brief This API gets list of installed applications for a particular package
1921 * @par This API is for package-manager client application
1922 * @par Sync (or) Async : Synchronous API
1923 * @param[in] handle package info handle
1924 * @param[in] component application component
1925 * @param[in] app_func iteration function for list
1926 * @param[in] user_data user data to be passed to callback function
1927 * @return 0 if success, error code(<0) if fail
1928 * @retval PMINFO_R_OK success
1929 * @retval PMINFO_R_EINVAL invalid argument
1930 * @retval PMINFO_R_ERROR internal error
1931 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1932 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1934 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
1937 pkgmgrinfo_appinfo_get_appid(handle, &appid);
1938 printf("appid : %s\n", appid);
1942 static int list_apps(const char *pkgid)
1945 pkgmgrinfo_pkginfo_h handle;
1946 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1947 if (ret != PMINFO_R_OK)
1949 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
1950 if (ret != PMINFO_R_OK) {
1951 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1954 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1959 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1960 pkgmgrinfo_app_list_cb app_func, void *user_data);
1961 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1962 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
1964 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
1965 * @brief This API gets list of installed applications from all packages with minimum informaion.
1967 * @par This API is for package-manager client application
1968 * @par Sync (or) Async : Synchronous API
1969 * @param[in] app_func iteration function for list
1970 * @param[in] user_data user data to be passed to callback function
1971 * @return 0 if success, error code(<0) if fail
1972 * @retval PMINFO_R_OK success
1973 * @retval PMINFO_R_EINVAL invalid argument
1974 * @retval PMINFO_R_ERROR internal error
1978 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
1980 char *pkgid1 = NULL;
1981 char *pkgid2 = NULL;
1982 pkgid1 = (char *)user_data;
1983 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
1984 if (strcmp(pkgid1, pkgid2) == 0) {
1991 static int list_apps()
1994 char *name = "helloworld";
1995 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
1996 if (ret != PMINFO_R_OK) {
2003 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2004 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2006 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2007 * @brief This API gets list of installed applications from all packages.
2009 * @par This API is for package-manager client application
2010 * @par Sync (or) Async : Synchronous API
2011 * @param[in] app_func iteration function for list
2012 * @param[in] user_data user data to be passed to callback function
2013 * @return 0 if success, error code(<0) if fail
2014 * @retval PMINFO_R_OK success
2015 * @retval PMINFO_R_EINVAL invalid argument
2016 * @retval PMINFO_R_ERROR internal error
2020 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2022 char *pkgid1 = NULL;
2023 char *pkgid2 = NULL;
2024 pkgid1 = (char *)user_data;
2025 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2026 if (strcmp(pkgid1, pkgid2) == 0) {
2033 static int list_apps()
2036 char *name = "helloworld";
2037 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2038 if (ret != PMINFO_R_OK) {
2045 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2046 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2049 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2050 * @brief This API creates the application information handle from db
2052 * @par This API is for package-manager client application
2053 * @par Sync (or) Async : Synchronous API
2055 * @param[in] appid pointer to appid
2056 * @param[out] handle pointer to the application info handle.
2057 * @return 0 if success, error code(<0) if fail
2058 * @retval PMINFO_R_OK success
2059 * @retval PMINFO_R_EINVAL invalid argument
2060 * @retval PMINFO_R_ERROR internal error
2062 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2063 * @see pkgmgrinfo_appinfo_get_pkgid()
2064 * @see pkgmgrinfo_appinfo_is_multiple()
2066 static int get_app_type(const char *appid)
2070 pkgmgrinfo_appinfo_h handle;
2071 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2072 if (ret != PMINFO_R_OK)
2074 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2075 if (ret != PMINFO_R_OK) {
2076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2079 printf("apptype: %s\n", type);
2080 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2085 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2086 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2088 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2089 * @brief This API gets the application ID
2091 * @par This API is for package-manager client application
2092 * @par Sync (or) Async : Synchronous API
2094 * @param[in] handle pointer to the application info handle.
2095 * @param[out] appid pointer to hold appid
2096 * @return 0 if success, error code(<0) if fail
2097 * @retval PMINFO_R_OK success
2098 * @retval PMINFO_R_EINVAL invalid argument
2099 * @retval PMINFO_R_ERROR internal error
2100 * @pre pkgmgrinfo_appinfo_get_appinfo()
2101 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2102 * @see pkgmgrinfo_appinfo_get_pkgid()
2103 * @see pkgmgrinfo_appinfo_is_multiple()
2105 static int get_app_id(const char *appid)
2108 char *app_id = NULL;
2109 pkgmgrinfo_appinfo_h handle;
2110 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2111 if (ret != PMINFO_R_OK)
2113 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2114 if (ret != PMINFO_R_OK) {
2115 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2118 printf("app id: %s\n", app_id);
2119 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2124 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2127 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2128 * @brief This API gets the package name of the application
2130 * @par This API is for package-manager client application
2131 * @par Sync (or) Async : Synchronous API
2133 * @param[in] handle pointer to the application info handle.
2134 * @param[out] pkg_name pointer to hold package name
2135 * @return 0 if success, error code(<0) if fail
2136 * @retval PMINFO_R_OK success
2137 * @retval PMINFO_R_EINVAL invalid argument
2138 * @retval PMINFO_R_ERROR internal error
2139 * @pre pkgmgrinfo_appinfo_get_appinfo()
2140 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2141 * @see pkgmgrinfo_appinfo_get_appid()
2142 * @see pkgmgrinfo_appinfo_is_multiple()
2144 static int get_app_pkgname(const char *appid)
2147 char *pkgname = NULL;
2148 pkgmgrinfo_appinfo_h handle;
2149 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2150 if (ret != PMINFO_R_OK)
2152 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2153 if (ret != PMINFO_R_OK) {
2154 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2157 printf("pkg name: %s\n", pkgname);
2158 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2163 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2166 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2167 * @brief This API gets the package id of the application
2169 * @par This API is for package-manager client application
2170 * @par Sync (or) Async : Synchronous API
2172 * @param[in] handle pointer to the application info handle.
2173 * @param[out] pkgid pointer to hold package id
2174 * @return 0 if success, error code(<0) if fail
2175 * @retval PMINFO_R_OK success
2176 * @retval PMINFO_R_EINVAL invalid argument
2177 * @retval PMINFO_R_ERROR internal error
2178 * @pre pkgmgrinfo_appinfo_get_appinfo()
2179 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2180 * @see pkgmgrinfo_appinfo_get_appid()
2181 * @see pkgmgrinfo_appinfo_is_multiple()
2183 static int get_app_pkgid(const char *appid)
2187 pkgmgrinfo_appinfo_h handle;
2188 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2189 if (ret != PMINFO_R_OK)
2191 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2192 if (ret != PMINFO_R_OK) {
2193 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2196 printf("pkg id: %s\n", pkgid);
2197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2202 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2205 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2206 * @brief This API gets the executable name of the application
2208 * @par This API is for package-manager client application
2209 * @par Sync (or) Async : Synchronous API
2211 * @param[in] handle pointer to the application info handle.
2212 * @param[out] exec pointer to hold app exec name
2213 * @return 0 if success, error code(<0) if fail
2214 * @retval PMINFO_R_OK success
2215 * @retval PMINFO_R_EINVAL invalid argument
2216 * @retval PMINFO_R_ERROR internal error
2217 * @pre pkgmgrinfo_appinfo_get_appinfo()
2218 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2219 * @see pkgmgrinfo_appinfo_get_appid()
2220 * @see pkgmgrinfo_appinfo_is_multiple()
2222 static int get_app_exec(const char *appid)
2226 pkgmgrinfo_appinfo_h handle;
2227 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2228 if (ret != PMINFO_R_OK)
2230 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2231 if (ret != PMINFO_R_OK) {
2232 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2235 printf("exec name: %s\n", exec);
2236 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2241 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2244 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2245 * @brief This API gets the icon name of the application
2247 * @par This API is for package-manager client application
2248 * @par Sync (or) Async : Synchronous API
2250 * @param[in] handle pointer to the application info handle.
2251 * @param[out] icon pointer to hold app icon name
2252 * @return 0 if success, error code(<0) if fail
2253 * @retval PMINFO_R_OK success
2254 * @retval PMINFO_R_EINVAL invalid argument
2255 * @retval PMINFO_R_ERROR internal error
2256 * @pre pkgmgrinfo_appinfo_get_appinfo()
2257 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2258 * @see pkgmgrinfo_appinfo_get_appid()
2259 * @see pkgmgrinfo_appinfo_is_multiple()
2261 static int get_app_icon(const char *appid)
2265 pkgmgrinfo_appinfo_h handle;
2266 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2267 if (ret != PMINFO_R_OK)
2269 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2270 if (ret != PMINFO_R_OK) {
2271 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2274 printf("icon name: %s\n", icon);
2275 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2280 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2283 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2284 * @brief This API gets the label of the application
2286 * @par This API is for package-manager client application
2287 * @par Sync (or) Async : Synchronous API
2289 * @param[in] handle pointer to the application info handle.
2290 * @param[out] label pointer to hold app label
2291 * @return 0 if success, error code(<0) if fail
2292 * @retval PMINFO_R_OK success
2293 * @retval PMINFO_R_EINVAL invalid argument
2294 * @retval PMINFO_R_ERROR internal error
2295 * @pre pkgmgrinfo_appinfo_get_appinfo()
2296 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2297 * @see pkgmgrinfo_appinfo_get_appid()
2298 * @see pkgmgrinfo_appinfo_is_multiple()
2300 static int get_app_label(const char *appid)
2304 pkgmgrinfo_appinfo_h handle;
2305 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2306 if (ret != PMINFO_R_OK)
2308 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2309 if (ret != PMINFO_R_OK) {
2310 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2313 printf("label : %s\n", label);
2314 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2319 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2322 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2323 * @brief This API gets exactly matched label by given appid and locale
2325 * @par This API is for package-manager client application
2326 * @par Sync (or) Async : Synchronous API
2328 * @param[in] appid pointer to appid
2329 * @param[in] locale pointer to locale
2330 * @param[out] label pointer to hold app label
2331 * @return 0 if success, error code(<0) if fail
2332 * @retval PMINFO_R_OK success
2333 * @retval PMINFO_R_EINVAL invalid argument
2334 * @retval PMINFO_R_ERROR internal error
2336 static int get_localed_label(const char *appid, const char *locale)
2341 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2342 if (ret != PMINFO_R_OK)
2345 printf("localed label: %s\n", label);
2353 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2354 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2357 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2358 * @brief This API gets the component of the application
2360 * @par This API is for package-manager client application
2361 * @par Sync (or) Async : Synchronous API
2363 * @param[in] handle pointer to the application info handle.
2364 * @param[out] component pointer to hold app component
2365 * @return 0 if success, error code(<0) if fail
2366 * @retval PMINFO_R_OK success
2367 * @retval PMINFO_R_EINVAL invalid argument
2368 * @retval PMINFO_R_ERROR internal error
2369 * @pre pkgmgrinfo_appinfo_get_appinfo()
2370 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2371 * @see pkgmgrinfo_appinfo_get_appid()
2372 * @see pkgmgrinfo_appinfo_is_multiple()
2374 static int get_app_component(const char *appid)
2377 pkgmgrinfo_app_component component;
2378 pkgmgrinfo_appinfo_h handle;
2379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2380 if (ret != PMINFO_R_OK)
2382 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2383 if (ret != PMINFO_R_OK) {
2384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2387 printf("component : %s\n", component);
2388 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2393 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2396 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2397 * @brief This API gets the apptype of the application
2399 * @par This API is for package-manager client application
2400 * @par Sync (or) Async : Synchronous API
2402 * @param[in] handle pointer to the application info handle.
2403 * @param[out] app_type pointer to hold apptype
2404 * @return 0 if success, error code(<0) if fail
2405 * @retval PMINFO_R_OK success
2406 * @retval PMINFO_R_EINVAL invalid argument
2407 * @retval PMINFO_R_ERROR internal error
2408 * @pre pkgmgrinfo_appinfo_get_appinfo()
2409 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2410 * @see pkgmgrinfo_appinfo_get_appid()
2411 * @see pkgmgrinfo_appinfo_is_multiple()
2413 static int get_app_type(const char *appid)
2416 char *apptype = NULL;
2417 pkgmgrinfo_appinfo_h handle;
2418 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2419 if (ret != PMINFO_R_OK)
2421 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2422 if (ret != PMINFO_R_OK) {
2423 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2426 printf("apptype : %s\n", apptype);
2427 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2432 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2435 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2436 int *operation_count, char ***operation)
2437 * @brief This API gets the list of operation of the application
2439 * @par This API is for package-manager client application
2440 * @par Sync (or) Async : Synchronous API
2442 * @param[in] handle pointer to the appcontrol handle.
2443 * @param[out] operation_count pointer to hold number of operations
2444 * @param[out] operation pointer to hold list of operations
2445 * @return 0 if success, error code(<0) if fail
2446 * @retval PMINFO_R_OK success
2447 * @retval PMINFO_R_EINVAL invalid argument
2448 * @retval PMINFO_R_ERROR internal error
2449 * @pre pkgmgrinfo_appinfo_get_appinfo()
2450 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2451 * @see pkgmgrinfo_appinfo_get_uri()
2452 * @see pkgmgrinfo_appinfo_get_mime()
2454 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2459 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2460 for (i = 0; i < oc; i++) {
2461 if (strcmp(operation[i], (char *)user_data) == 0)
2468 static int check_operation(const char *appid, char *operation)
2471 pkgmgrinfo_appinfo_h handle;
2472 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2473 if (ret != PMINFO_R_OK)
2475 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2476 if (ret != PMINFO_R_OK) {
2477 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2485 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2486 int *operation_count, char ***operation);
2489 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2490 int *uri_count, char ***uri)
2491 * @brief This API gets the list of uri of the application
2493 * @par This API is for package-manager client application
2494 * @par Sync (or) Async : Synchronous API
2496 * @param[in] handle pointer to the appcontrol handle.
2497 * @param[out] uri_count pointer to hold number of uris
2498 * @param[out] uri pointer to hold list of uris
2499 * @return 0 if success, error code(<0) if fail
2500 * @retval PMINFO_R_OK success
2501 * @retval PMINFO_R_EINVAL invalid argument
2502 * @retval PMINFO_R_ERROR internal error
2503 * @pre pkgmgrinfo_appinfo_get_appinfo()
2504 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2505 * @see pkgmgrinfo_appinfo_get_operation()
2506 * @see pkgmgrinfo_appinfo_get_mime()
2508 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2513 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2514 for (i = 0; i < uc; i++) {
2515 if (strcmp(uri[i], (char *)user_data) == 0)
2522 static int check_uri(const char *appid, char *uri)
2525 pkgmgrinfo_appinfo_h handle;
2526 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2527 if (ret != PMINFO_R_OK)
2529 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2530 if (ret != PMINFO_R_OK) {
2531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2539 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2540 int *uri_count, char ***uri);
2543 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2544 int *mime_count, char ***mime)
2545 * @brief This API gets the list of mime of the application
2547 * @par This API is for package-manager client application
2548 * @par Sync (or) Async : Synchronous API
2550 * @param[in] handle pointer to the appcontrol handle.
2551 * @param[out] mime_count pointer to hold number of mimes
2552 * @param[out] mime pointer to hold list of mimes
2553 * @return 0 if success, error code(<0) if fail
2554 * @retval PMINFO_R_OK success
2555 * @retval PMINFO_R_EINVAL invalid argument
2556 * @retval PMINFO_R_ERROR internal error
2557 * @pre pkgmgrinfo_appinfo_get_appinfo()
2558 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2559 * @see pkgmgrinfo_appinfo_get_uri()
2560 * @see pkgmgrinfo_appinfo_get_operation()
2562 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2567 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2568 for (i = 0; i < mc; i++) {
2569 if (strcmp(mime[i], (char *)user_data) == 0)
2576 static int check_mime(const char *appid, char *mime)
2579 pkgmgrinfo_appinfo_h handle;
2580 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2581 if (ret != PMINFO_R_OK)
2583 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2584 if (ret != PMINFO_R_OK) {
2585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2588 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2593 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2594 int *mime_count, char ***mime);
2597 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2598 int *subapp_count, char ***subapp)
2599 * @brief This API gets the list of subapp of the application
2601 * @par This API is for package-manager client application
2602 * @par Sync (or) Async : Synchronous API
2604 * @param[in] handle pointer to the appcontrol handle.
2605 * @param[out] subapp_count pointer to hold number of subapp
2606 * @param[out] subapp pointer to hold list of subapp
2607 * @return 0 if success, error code(<0) if fail
2608 * @retval PMINFO_R_OK success
2609 * @retval PMINFO_R_EINVAL invalid argument
2610 * @retval PMINFO_R_ERROR internal error
2611 * @pre pkgmgrinfo_appinfo_get_appinfo()
2612 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2613 * @see pkgmgrinfo_appinfo_get_uri()
2614 * @see pkgmgrinfo_appinfo_get_operation()
2616 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2620 char **subapp = NULL;
2621 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2622 for (i = 0; i < sc; i++) {
2623 if (strcmp(subapp[i], (char *)user_data) == 0)
2630 static int check_subapp(const char *appid, char *subapp)
2633 pkgmgrinfo_appinfo_h handle = NULL;
2634 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2635 if (ret != PMINFO_R_OK)
2637 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2638 if (ret != PMINFO_R_OK) {
2639 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2647 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2648 int *subapp_count, char ***subapp);
2651 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2652 * @brief This API gets the notification icon of the application
2654 * @par This API is for package-manager client application
2655 * @par Sync (or) Async : Synchronous API
2657 * @param[in] handle pointer to the application info handle.
2658 * @param[out] path pointer to hold notification icon
2659 * @return 0 if success, error code(<0) if fail
2660 * @retval PMINFO_R_OK success
2661 * @retval PMINFO_R_EINVAL invalid argument
2662 * @retval PMINFO_R_ERROR internal error
2663 * @pre pkgmgrinfo_appinfo_get_appinfo()
2664 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2665 * @see pkgmgrinfo_appinfo_get_appid()
2666 * @see pkgmgrinfo_appinfo_is_multiple()
2668 static int get_app_notification_icon(const char *appid)
2671 char *notification_icon = NULL;
2672 pkgmgrinfo_appinfo_h handle;
2673 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2674 if (ret != PMINFO_R_OK)
2676 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2677 if (ret != PMINFO_R_OK) {
2678 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2681 printf("notification icon : %s\n", notification_icon);
2682 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2687 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2690 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2691 * @brief This API gets the setting icon of the application
2693 * @par This API is for package-manager client application
2694 * @par Sync (or) Async : Synchronous API
2696 * @param[in] handle pointer to the application info handle.
2697 * @param[out] path pointer to hold setting icon
2698 * @return 0 if success, error code(<0) if fail
2699 * @retval PMINFO_R_OK success
2700 * @retval PMINFO_R_EINVAL invalid argument
2701 * @retval PMINFO_R_ERROR internal error
2702 * @pre pkgmgrinfo_appinfo_get_appinfo()
2703 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2704 * @see pkgmgrinfo_appinfo_get_appid()
2705 * @see pkgmgrinfo_appinfo_is_multiple()
2707 static int get_app_setting_icon(const char *appid)
2710 char *setting_icon = NULL;
2711 pkgmgrinfo_appinfo_h handle;
2712 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2713 if (ret != PMINFO_R_OK)
2715 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2716 if (ret != PMINFO_R_OK) {
2717 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2720 printf("setting icon : %s\n", setting_icon);
2721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2726 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2729 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2730 * @brief This API gets the type of recent image on app-tray
2732 * @par This API is for package-manager client application
2733 * @par Sync (or) Async : Synchronous API
2735 * @param[in] handle pointer to the application info handle.
2736 * @param[out] type pointer to hold image type
2737 * @return 0 if success, error code(<0) if fail
2738 * @retval PMINFO_R_OK success
2739 * @retval PMINFO_R_EINVAL invalid argument
2740 * @retval PMINFO_R_ERROR internal error
2741 * @pre pkgmgrinfo_appinfo_get_appinfo()
2742 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2743 * @see pkgmgrinfo_appinfo_get_appid()
2744 * @see pkgmgrinfo_appinfo_is_multiple()
2746 static int get_app_recent_image_type(const char *appid)
2749 pkgmgrinfo_app_recentimage type;
2750 pkgmgrinfo_appinfo_h handle;
2751 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2752 if (ret != PMINFO_R_OK)
2754 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2755 if (ret != PMINFO_R_OK) {
2756 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2759 printf("recent image type: %d\n", type);
2760 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2765 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2769 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2770 * @brief This API gets the preview image of application
2772 * @par Sync (or) Async : Synchronous API
2774 * @param[in] handle pointer to the application info handle.
2775 * @param[out] preview_img pointer to hold preview image path
2776 * @return 0 if success, error code(<0) if fail
2777 * @retval PMINFO_R_OK success
2778 * @retval PMINFO_R_EINVAL invalid argument
2779 * @retval PMINFO_R_ERROR internal error
2780 * @pre pkgmgrinfo_appinfo_get_appinfo()
2781 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2782 * @see pkgmgrinfo_appinfo_get_appid()
2784 static int get_app_previewimage(const char *appid)
2787 char *preview = NULL;
2788 pkgmgrinfo_appinfo_h handle = NULL;
2789 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2790 if (ret != PMINFO_R_OK)
2792 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2793 if (ret != PMINFO_R_OK) {
2794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 printf("preview image path : %s\n", preview);
2798 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2803 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2807 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2808 * @brief This API gets the package permission type of the application
2810 * @par This API is for package-manager client application
2811 * @par Sync (or) Async : Synchronous API
2813 * @param[in] handle pointer to the application info handle.
2814 * @param[out] permission pointer to hold package permission
2815 * @return 0 if success, error code(<0) if fail
2816 * @retval PMINFO_R_OK success
2817 * @retval PMINFO_R_EINVAL invalid argument
2818 * @retval PMINFO_R_ERROR internal error
2819 * @pre pkgmgrinfo_appinfo_get_appinfo()
2820 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2821 * @see pkgmgrinfo_appinfo_get_appid()
2823 static int get_app_permission(const char *appid)
2826 pkgmgrinfo_permission_type permission = 0;
2827 pkgmgrinfo_appinfo_h handle;
2829 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2830 if (ret != PMINFO_R_OK)
2832 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2833 if (ret != PMINFO_R_OK) {
2834 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2837 printf("permission type: %d\n", permission);
2838 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2843 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2846 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2847 * @brief This API gets the component_type
2849 * @par This API is for package-manager client application
2850 * @par Sync (or) Async : Synchronous API
2852 * @param[in] handle pointer to the application info handle.
2853 * @param[out] component_type pointer to hold component_type
2854 * @return 0 if success, error code(<0) if fail
2855 * @retval PMINFO_R_OK success
2856 * @retval PMINFO_R_EINVAL invalid argument
2857 * @retval PMINFO_R_ERROR internal error
2858 * @pre pkgmgrinfo_appinfo_get_appinfo()
2859 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2860 * @see pkgmgrinfo_appinfo_get_pkgid()
2861 * @see pkgmgrinfo_appinfo_is_multiple()
2863 static int get_component_type(const char *appid)
2866 char *component_type = NULL;
2867 pkgmgrinfo_appinfo_h handle;
2868 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2869 if (ret != PMINFO_R_OK)
2871 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2872 if (ret != PMINFO_R_OK) {
2873 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2876 printf("component_type: %s\n", component_type);
2877 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2882 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2885 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2886 * @brief This API gets the application 'hwacceleration' value from the app ID
2888 * @par This API is for package-manager client application
2889 * @par Sync (or) Async : Synchronous API
2891 * @param[in] handle pointer to application info handle
2892 * @param[out] hwacceleration pointer to hold package hwacceleration value
2893 * @return 0 if success, error code(<0) if fail
2894 * @retval PMINFO_R_OK success
2895 * @retval PMINFO_R_EINVAL invalid argument
2896 * @retval PMINFO_R_ERROR internal error
2897 * @pre pkgmgrinfo_appinfo_get_appinfo()
2898 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2899 * @see pkgmgrinfo_appinfo_get_appid()
2900 * @see pkgmgrinfo_appinfo_is_multiple()
2902 static int get_app_hwacceleration(const char *appid)
2905 pkgmgrinfo_app_hwacceleration hwacceleration;
2906 pkgmgrinfo_appinfo_h handle;
2907 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2908 if (ret != PMINFO_R_OK)
2910 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2911 if (ret != PMINFO_R_OK) {
2912 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2915 printf("app hwacceleration: %d\n", hwacceleration);
2916 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2921 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
2924 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
2925 * @brief This API gets the application 'screenreader' value from the app ID
2927 * @par This API is for package-manager client application
2928 * @par Sync (or) Async : Synchronous API
2930 * @param[in] handle pointer to application info handle
2931 * @param[out] screenreader pointer to hold package accessibility value
2932 * @return 0 if success, error code(<0) if fail
2933 * @retval PMINFO_R_OK success
2934 * @retval PMINFO_R_EINVAL invalid argument
2935 * @retval PMINFO_R_ERROR internal error
2936 * @pre pkgmgrinfo_appinfo_get_appinfo()
2937 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2938 * @see pkgmgrinfo_appinfo_get_appid()
2939 * @see pkgmgrinfo_appinfo_is_multiple()
2941 static int get_app_screenreader(const char *appid)
2944 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
2945 pkgmgrinfo_appinfo_h handle = NULL;
2946 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2947 if (ret != PMINFO_R_OK)
2949 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
2950 if (ret != PMINFO_R_OK) {
2951 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2954 printf("app screenreader: %d\n", screenreader);
2955 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2960 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
2963 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
2964 * @brief This API gets the application's landscape & portrait effect images
2966 * @par This API is for package-manager client application
2967 * @par Sync (or) Async : Synchronous API
2969 * @param[in] handle pointer to application info handle
2970 * @param[out] portrait_img contains portrait mode effect image
2971 * @param[out] landscape_img contains landscape mode effect image
2972 * @return 0 if success, error code(<0) if fail
2973 * @retval PMINFO_R_OK success
2974 * @retval PMINFO_R_EINVAL invalid argument
2975 * @retval PMINFO_R_ERROR internal error
2976 * @pre pkgmgrinfo_appinfo_get_appinfo()
2977 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2978 * @see pkgmgrinfo_appinfo_get_appid()
2979 * @see pkgmgrinfo_appinfo_is_nodisplay()
2981 static int get_app_effectimages(const char *appid)
2984 char *portraitimg = NULL;
2985 char *landscapeimg = NULL;
2986 pkgmgrinfo_appinfo_h handle;
2987 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2988 if (ret != PMINFO_R_OK)
2990 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
2991 if (ret != PMINFO_R_OK) {
2992 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2995 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
2996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3001 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3004 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3005 * @brief This API gets the submode_mainid of the application
3007 * @par This API is for package-manager client application
3008 * @par Sync (or) Async : Synchronous API
3010 * @param[in] handle pointer to the application info handle.
3011 * @param[out] submode_mainid pointer to hold package name
3012 * @return 0 if success, error code(<0) if fail
3013 * @retval PMINFO_R_OK success
3014 * @retval PMINFO_R_EINVAL invalid argument
3015 * @retval PMINFO_R_ERROR internal error
3016 * @pre pkgmgrinfo_appinfo_get_appinfo()
3017 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3018 * @see pkgmgrinfo_appinfo_get_appid()
3019 * @see pkgmgrinfo_appinfo_is_multiple()
3021 static int get_app_submode_mainid(const char *appid)
3024 char *submode_mainid = NULL;
3025 pkgmgrinfo_appinfo_h handle = NULL;
3026 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3027 if (ret != PMINFO_R_OK)
3029 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3030 if (ret != PMINFO_R_OK) {
3031 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3034 printf("submode_mainid: %s\n", submode_mainid);
3035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3040 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3043 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3044 * @brief This API gets the datacontrol info
3046 * @par This API is for package-manager client application
3047 * @par Sync (or) Async : Synchronous API
3049 * @param[in] providerid pointer to the providerid of dataconltrol.
3050 * @param[in] type pointer to the type of dataconltrol.
3051 * @param[out] appid pointer to hold appid, need to free after using
3052 * @param[out] access pointer to hold access, need to free after using
3053 * @return 0 if success, error code(<0) if fail
3054 * @retval PMINFO_R_OK success
3055 * @retval PMINFO_R_EINVAL invalid argument
3056 * @retval PMINFO_R_ERROR internal error
3059 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3060 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3063 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3064 * @brief This API gets the appid of datacontrol
3066 * @par This API is for package-manager client application
3067 * @par Sync (or) Async : Synchronous API
3069 * @param[in] providerid pointer to the providerid of dataconltrol.
3070 * @param[out] appid pointer to hold appid, need to free after using
3071 * @return 0 if success, error code(<0) if fail
3072 * @retval PMINFO_R_OK success
3073 * @retval PMINFO_R_EINVAL invalid argument
3074 * @retval PMINFO_R_ERROR internal error
3077 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3078 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3081 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3082 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3083 * @brief This API gets the list of permission for a particular application
3085 * @par This API is for package-manager client application
3086 * @par Sync (or) Async : Synchronous API
3087 * @param[in] handle pointer to the application info handle.
3088 * @param[in] permission_func callback function for list
3089 * @param[in] user_data user data to be passed to callback function
3090 * @return 0 if success, error code(<0) if fail
3091 * @retval PMINFO_R_OK success
3092 * @retval PMINFO_R_EINVAL invalid argument
3093 * @retval PMINFO_R_ERROR internal error
3094 * @pre pkgmgrinfo_appinfo_get_appinfo()
3095 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3097 int permission_func(const char *name, void *user_data)
3099 if (strcmp(name, (char *)user_data) == 0)
3105 static int list_permission(const char *appid, char *permission)
3108 pkgmgrinfo_appinfo_h handle;
3109 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3110 if (ret != PMINFO_R_OK)
3112 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3113 if (ret != PMINFO_R_OK) {
3114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3122 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3123 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3126 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3127 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3128 * @brief This API gets the list of category for a particular application
3130 * @par This API is for package-manager client application
3131 * @par Sync (or) Async : Synchronous API
3132 * @param[in] handle pointer to the application info handle.
3133 * @param[in] category_func callback function for list
3134 * @param[in] user_data user data to be passed to callback function
3135 * @return 0 if success, error code(<0) if fail
3136 * @retval PMINFO_R_OK success
3137 * @retval PMINFO_R_EINVAL invalid argument
3138 * @retval PMINFO_R_ERROR internal error
3139 * @pre pkgmgrinfo_appinfo_get_appinfo()
3140 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3142 int category_func(const char *name, void *user_data)
3144 if (strcmp(name, (char *)user_data) == 0)
3150 static int list_category(const char *appid, char *category)
3153 pkgmgrinfo_appinfo_h handle;
3154 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3155 if (ret != PMINFO_R_OK)
3157 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3158 if (ret != PMINFO_R_OK) {
3159 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3162 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3167 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3168 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3171 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3172 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3173 * @brief This API gets the list of metadata for a particular application
3175 * @par This API is for package-manager client application
3176 * @par Sync (or) Async : Synchronous API
3177 * @param[in] handle pointer to the application info handle.
3178 * @param[in] metadata_func callback function for list
3179 * @param[in] user_data user data to be passed to callback function
3180 * @return 0 if success, error code(<0) if fail
3181 * @retval PMINFO_R_OK success
3182 * @retval PMINFO_R_EINVAL invalid argument
3183 * @retval PMINFO_R_ERROR internal error
3184 * @pre pkgmgrinfo_appinfo_get_appinfo()
3185 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3187 int metadata_func(const char *key, const char *value, void *user_data)
3189 if (strcmp(key, (char *)user_data) == 0) {
3190 printf("Value is %s\n", value);
3197 static int list_metadata(const char *appid, char *key)
3200 pkgmgrinfo_appinfo_h handle;
3201 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3202 if (ret != PMINFO_R_OK)
3204 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3205 if (ret != PMINFO_R_OK) {
3206 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3214 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3215 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3219 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3220 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3221 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3222 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3223 * @brief This API gets the list of app-control for a particular application
3225 * @par This API is for package-manager client application
3226 * @par Sync (or) Async : Synchronous API
3227 * @param[in] handle pointer to the application info handle.
3228 * @param[in] appcontrol_func callback function for list
3229 * @param[in] user_data user data to be passed to callback function
3230 * @param[in] uid the addressee user id of the instruction
3231 * @return 0 if success, error code(<0) if fail
3232 * @retval PMINFO_R_OK success
3233 * @retval PMINFO_R_EINVAL invalid argument
3234 * @retval PMINFO_R_ERROR internal error
3235 * @pre pkgmgrinfo_appinfo_get_appinfo()
3236 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3238 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3243 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3244 for (i = 0; i < oc; i++) {
3245 if (strcmp(operation[i], (char *)user_data) == 0)
3252 static int check_operation(const char *appid, char *operation)
3255 pkgmgrinfo_appinfo_h handle;
3256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3257 if (ret != PMINFO_R_OK)
3259 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3260 if (ret != PMINFO_R_OK) {
3261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3269 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3270 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3273 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3274 * @brief This API gets the application 'nodisplay' value from the app ID
3276 * @par This API is for package-manager client application
3277 * @par Sync (or) Async : Synchronous API
3279 * @param[in] handle pointer to application info handle
3280 * @param[out] nodisplay pointer to hold package nodisplay value
3281 * @return 0 if success, error code(<0) if fail
3282 * @retval PMINFO_R_OK success
3283 * @retval PMINFO_R_EINVAL invalid argument
3284 * @retval PMINFO_R_ERROR internal error
3285 * @pre pkgmgrinfo_appinfo_get_appinfo()
3286 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3287 * @see pkgmgrinfo_appinfo_get_appid()
3288 * @see pkgmgrinfo_appinfo_is_multiple()
3290 static int get_app_nodisplay(const char *appid)
3294 pkgmgrinfo_appinfo_h handle;
3295 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3296 if (ret != PMINFO_R_OK)
3298 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3299 if (ret != PMINFO_R_OK) {
3300 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303 printf("app nodisplay: %d\n", nodisplay);
3304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3309 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3312 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3313 * @brief This API gets the application 'multiple' value from the app ID
3315 * @par This API is for package-manager client application
3316 * @par Sync (or) Async : Synchronous API
3318 * @param[in] handle pointer to application info handle
3319 * @param[out] multiple pointer to hold package multiple value
3320 * @return 0 if success, error code(<0) if fail
3321 * @retval PMINFO_R_OK success
3322 * @retval PMINFO_R_EINVAL invalid argument
3323 * @retval PMINFO_R_ERROR internal error
3324 * @pre pkgmgrinfo_appinfo_get_appinfo()
3325 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3326 * @see pkgmgrinfo_appinfo_get_appid()
3327 * @see pkgmgrinfo_appinfo_is_nodisplay()
3329 static int get_app_multiple(const char *appid)
3333 pkgmgrinfo_appinfo_h handle;
3334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3335 if (ret != PMINFO_R_OK)
3337 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3338 if (ret != PMINFO_R_OK) {
3339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342 printf("app multiple: %d\n", multiple);
3343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3348 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3351 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3352 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3353 * application launching effect. If fales, indicator will be hidden during application launching effect
3355 * @par This API is for package-manager client application
3356 * @par Sync (or) Async : Synchronous API
3358 * @param[in] handle pointer to application info handle
3359 * @param[out] indicator_disp contains indicator display status for application launching effect
3360 * @return 0 if success, error code(<0) if fail
3361 * @retval PMINFO_R_OK success
3362 * @retval PMINFO_R_EINVAL invalid argument
3363 * @retval PMINFO_R_ERROR internal error
3364 * @pre pkgmgrinfo_appinfo_get_appinfo()
3365 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3366 * @see pkgmgrinfo_appinfo_get_appid()
3367 * @see pkgmgrinfo_appinfo_is_nodisplay()
3369 static int get_app_indicator_display(const char *appid)
3372 bool indicator_disp;
3373 pkgmgrinfo_appinfo_h handle;
3374 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3375 if (ret != PMINFO_R_OK)
3377 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3378 if (ret != PMINFO_R_OK){
3379 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3382 printf("app indicator disp : %d\n", indicator_disp);
3383 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3388 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3391 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3392 * @brief This API gets the application 'taskmanage' value from the app ID
3394 * @par This API is for package-manager client application
3395 * @par Sync (or) Async : Synchronous API
3397 * @param[in] handle pointer to application info handle
3398 * @param[out] taskmanage pointer to hold package taskmanage value
3399 * @return 0 if success, error code(<0) if fail
3400 * @retval PMINFO_R_OK success
3401 * @retval PMINFO_R_EINVAL invalid argument
3402 * @retval PMINFO_R_ERROR internal error
3403 * @pre pkgmgrinfo_appinfo_get_appinfo()
3404 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3405 * @see pkgmgrinfo_appinfo_get_appid()
3406 * @see pkgmgrinfo_appinfo_is_multiple()
3408 static int get_app_taskmanage(const char *appid)
3412 pkgmgrinfo_appinfo_h handle;
3413 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3414 if (ret != PMINFO_R_OK)
3416 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3417 if (ret != PMINFO_R_OK) {
3418 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3421 printf("app taskmanage: %d\n", taskmanage);
3422 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3427 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3430 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3431 * @brief This API gets the application 'taskmanage' value from the app ID
3433 * @par This API is for package-manager client application
3434 * @par Sync (or) Async : Synchronous API
3436 * @param[in] handle pointer to application info handle
3437 * @param[out] enabled pointer to hold package enabled value
3438 * @return 0 if success, error code(<0) if fail
3439 * @retval PMINFO_R_OK success
3440 * @retval PMINFO_R_EINVAL invalid argument
3441 * @retval PMINFO_R_ERROR internal error
3442 * @pre pkgmgrinfo_appinfo_get_appinfo()
3443 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3444 * @see pkgmgrinfo_appinfo_get_appid()
3445 * @see pkgmgrinfo_appinfo_is_multiple()
3447 static int get_app_enabled(const char *appid)
3451 pkgmgrinfo_appinfo_h handle;
3452 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3453 if (ret != PMINFO_R_OK)
3455 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3456 if (ret != PMINFO_R_OK) {
3457 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3460 printf("app enabled: %d\n", enabled);
3461 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3466 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3469 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3470 * @brief This API gets the application 'onboot' value from the app ID
3472 * @par This API is for package-manager client application
3473 * @par Sync (or) Async : Synchronous API
3475 * @param[in] handle pointer to application info handle
3476 * @param[out] onboot pointer to hold package onboot value
3477 * @return 0 if success, error code(<0) if fail
3478 * @retval PMINFO_R_OK success
3479 * @retval PMINFO_R_EINVAL invalid argument
3480 * @retval PMINFO_R_ERROR internal error
3481 * @pre pkgmgrinfo_appinfo_get_appinfo()
3482 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3483 * @see pkgmgrinfo_appinfo_get_appid()
3484 * @see pkgmgrinfo_appinfo_is_multiple()
3486 static int get_app_onboot(const char *appid)
3490 pkgmgrinfo_appinfo_h handle;
3491 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3492 if (ret != PMINFO_R_OK)
3494 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3495 if (ret != PMINFO_R_OK) {
3496 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3499 printf("app onboot: %d\n", onboot);
3500 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3505 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3508 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3509 * @brief This API gets the application 'autorestart' value from the app ID
3511 * @par This API is for package-manager client application
3512 * @par Sync (or) Async : Synchronous API
3514 * @param[in] handle pointer to application info handle
3515 * @param[out] autorestart pointer to hold package autorestart value
3516 * @return 0 if success, error code(<0) if fail
3517 * @retval PMINFO_R_OK success
3518 * @retval PMINFO_R_EINVAL invalid argument
3519 * @retval PMINFO_R_ERROR internal error
3520 * @pre pkgmgrinfo_appinfo_get_appinfo()
3521 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3522 * @see pkgmgrinfo_appinfo_get_appid()
3523 * @see pkgmgrinfo_appinfo_is_multiple()
3525 static int get_app_autorestart(const char *appid)
3529 pkgmgrinfo_appinfo_h handle;
3530 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3531 if (ret != PMINFO_R_OK)
3533 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3534 if (ret != PMINFO_R_OK) {
3535 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3538 printf("app autorestart: %d\n", autorestart);
3539 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3544 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3547 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3548 * @brief This API gets the value for given application is main app or not from handle
3550 * @par This API is for package-manager client application
3551 * @par Sync (or) Async : Synchronous API
3553 * @param[in] handle pointer to application info handle
3554 * @param[out] mainapp pointer to hold package mainapp is or not
3555 * @return 0 if success, error code(<0) if fail
3556 * @retval PMINFO_R_OK success
3557 * @retval PMINFO_R_EINVAL invalid argument
3558 * @retval PMINFO_R_ERROR internal error
3559 * @pre pkgmgrinfo_appinfo_get_appinfo()
3560 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3561 * @see pkgmgrinfo_appinfo_get_appid()
3562 * @see pkgmgrinfo_appinfo_is_multiple()
3564 static int get_app_mainapp(const char *appid)
3568 pkgmgrinfo_appinfo_h handle;
3569 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3570 if (ret != PMINFO_R_OK)
3572 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3573 if (ret != PMINFO_R_OK) {
3574 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3577 printf("mainapp: %d\n", mainapp);
3578 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3583 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3587 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3588 * @brief This API gets the value for given application is preload or not from handle
3590 * @par This API is for package-manager client application
3591 * @par Sync (or) Async : Synchronous API
3593 * @param[in] handle pointer to application info handle
3594 * @param[out] preload pointer to hold preload is or not
3595 * @return 0 if success, error code(<0) if fail
3596 * @retval PMINFO_R_OK success
3597 * @retval PMINFO_R_EINVAL invalid argument
3598 * @retval PMINFO_R_ERROR internal error
3599 * @pre pkgmgrinfo_appinfo_get_appinfo()
3600 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3601 * @see pkgmgrinfo_appinfo_get_appid()
3602 * @see pkgmgrinfo_appinfo_is_multiple()
3604 static int get_app_preload(const char *appid)
3608 pkgmgrinfo_appinfo_h handle = NULL;
3609 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3610 if (ret != PMINFO_R_OK)
3612 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3613 if (ret != PMINFO_R_OK) {
3614 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3617 printf("preload: %d\n", preload);
3618 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3623 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3626 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3627 * @brief This API gets the value for given application is submode or not from handle
3629 * @par This API is for package-manager client application
3630 * @par Sync (or) Async : Synchronous API
3632 * @param[in] handle pointer to application info handle
3633 * @param[out] submode pointer to hold submode is or not
3634 * @return 0 if success, error code(<0) if fail
3635 * @retval PMINFO_R_OK success
3636 * @retval PMINFO_R_EINVAL invalid argument
3637 * @retval PMINFO_R_ERROR internal error
3638 * @pre pkgmgrinfo_appinfo_get_appinfo()
3639 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3640 * @see pkgmgrinfo_appinfo_get_appid()
3641 * @see pkgmgrinfo_appinfo_is_multiple()
3643 static int get_app_submode(const char *appid)
3647 pkgmgrinfo_appinfo_h handle = NULL;
3648 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3649 if (ret != PMINFO_R_OK)
3651 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3652 if (ret != PMINFO_R_OK) {
3653 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3656 printf("submode: %d\n", submode);
3657 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3662 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3665 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3666 * @brief This API checks if the application has the given category
3668 * @par This API is for package-manager client application
3669 * @par Sync (or) Async : Synchronous API
3671 * @param[in] handle pointer to the application info handle
3672 * @param[in] category category
3673 * @param[out] exist value Gets whether the application has the given category
3674 * @return 0 if success, error code(<0) if fail
3675 * @retval PMINFO_R_OK success
3676 * @retval PMINFO_R_EINVAL invalid argument
3677 * @retval PMINFO_R_ERROR internal error
3679 static int is_category_exist(const char *appid, const char *category)
3682 pkgmgrinfo_appinfo_h handle;
3685 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3686 if (ret != PMINFO_R_OK)
3689 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3690 if (ret != PMINFO_R_OK) {
3691 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3695 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3700 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3703 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3704 * @brief This API gets the application 'ui_gadget' value from the app ID
3706 * @par This API is for package-manager client application
3707 * @par Sync (or) Async : Synchronous API
3709 * @param[in] handle pointer to application info handle
3710 * @param[out] ui_gadget pointer to hold package ui_gadget value
3711 * @return 0 if success, error code(<0) if fail
3712 * @retval PMINFO_R_OK success
3713 * @retval PMINFO_R_EINVAL invalid argument
3714 * @pre pkgmgrinfo_appinfo_get_appinfo()
3715 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3717 static int get_app_ui_gadget(const char *appid)
3721 pkgmgrinfo_appinfo_h handle = NULL;
3722 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3723 if (ret != PMINFO_R_OK)
3725 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
3726 if (ret != PMINFO_R_OK) {
3727 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3730 printf("app ui_gadget: %d\n", ui_gadget);
3731 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3736 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
3739 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
3740 * @brief This API gets the application 'support_disable' value from the app ID
3742 * @par This API is for package-manager client application
3743 * @par Sync (or) Async : Synchronous API
3745 * @param[in] handle pointer to application info handle
3746 * @param[out] support_disable pointer to hold package support_disable value
3747 * @return 0 if success, error code(<0) if fail
3748 * @retval PMINFO_R_OK success
3749 * @retval PMINFO_R_EINVAL invalid argument
3750 * @pre pkgmgrinfo_appinfo_get_appinfo()
3751 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3753 static int get_app_support_disable(const char *appid)
3756 bool support_disable;
3757 pkgmgrinfo_appinfo_h handle = NULL;
3758 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3759 if (ret != PMINFO_R_OK)
3761 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
3762 if (ret != PMINFO_R_OK) {
3763 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3766 printf("app support_disable: %d\n", support_disable);
3767 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3772 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
3775 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
3776 * @brief This API destroys the application information handle freeing up all the resources
3778 * @par This API is for package-manager client application
3779 * @par Sync (or) Async : Synchronous API
3781 * @param[in] handle pointer to the application info handle.
3782 * @return 0 if success, error code(<0) if fail
3783 * @retval PMINFO_R_OK success
3784 * @retval PMINFO_R_EINVAL invalid argument
3785 * @retval PMINFO_R_ERROR internal error
3786 * @pre pkgmgrinfo_appinfo_get_appinfo()
3788 * @see pkgmgrinfo_appinfo_get_pkgid()
3789 * @see pkgmgrinfo_appinfo_is_multiple()
3791 static int get_app_type(const char *appid)
3795 pkgmgrinfo_appinfo_h handle;
3796 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3797 if (ret != PMINFO_R_OK)
3799 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3800 if (ret != PMINFO_R_OK) {
3801 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3804 printf("apptype: %s\n", type);
3805 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3810 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
3813 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
3814 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
3815 The query will search the entire application information collected from the manifest file of all the installed packages
3817 * @par This API is for package-manager client application
3818 * @par Sync (or) Async : Synchronous API
3820 * @param[out] handle pointer to the application info filter handle.
3821 * @return 0 if success, error code(<0) if fail
3822 * @retval PMINFO_R_OK success
3823 * @retval PMINFO_R_EINVAL invalid argument
3824 * @retval PMINFO_R_ERROR internal error
3826 * @post pkgmgrinfo_appinfo_filter_destroy()
3827 * @see pkgmgrinfo_appinfo_filter_count()
3828 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3830 static int get_capp_count()
3834 pkgmgrinfo_appinfo_filter_h handle;
3835 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3836 if (ret != PMINFO_R_OK)
3838 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3839 if (ret != PMINFO_R_OK) {
3840 pkgmgrinfo_appinfo_filter_destroy(handle);
3843 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3844 if (ret != PMINFO_R_OK) {
3845 pkgmgrinfo_appinfo_filter_destroy(handle);
3848 printf("No of capp: %d\n", count);
3849 pkgmgrinfo_appinfo_filter_destroy(handle);
3854 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
3857 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
3858 * @brief This API destroys the application information filter handle freeing up all the resources
3860 * @par This API is for package-manager client application
3861 * @par Sync (or) Async : Synchronous API
3863 * @param[in] handle pointer to the application info filter handle.
3864 * @return 0 if success, error code(<0) if fail
3865 * @retval PMINFO_R_OK success
3866 * @retval PMINFO_R_EINVAL invalid argument
3867 * @retval PMINFO_R_ERROR internal error
3868 * @pre pkgmgrinfo_appinfo_filter_create()
3870 * @see pkgmgrinfo_appinfo_filter_count()
3871 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3873 static int get_capp_count()
3877 pkgmgrinfo_appinfo_filter_h handle;
3878 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3879 if (ret != PMINFO_R_OK)
3881 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
3882 if (ret != PMINFO_R_OK) {
3883 pkgmgrinfo_appinfo_filter_destroy(handle);
3886 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3887 if (ret != PMINFO_R_OK) {
3888 pkgmgrinfo_appinfo_filter_destroy(handle);
3891 printf("No of capp: %d\n", count);
3892 pkgmgrinfo_appinfo_filter_destroy(handle);
3897 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
3900 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
3901 * @brief This API adds a boolean filter property to the filter handle
3903 * @par This API is for package-manager client application
3904 * @par Sync (or) Async : Synchronous API
3906 * @param[in] handle pointer to the application info filter handle.
3907 * @param[in] property boolean property name.
3908 * @param[in] value value corresponding to the property.
3909 * @return 0 if success, error code(<0) if fail
3910 * @retval PMINFO_R_OK success
3911 * @retval PMINFO_R_EINVAL invalid argument
3912 * @retval PMINFO_R_ERROR internal error
3913 * @pre pkgmgrinfo_appinfo_filter_create()
3914 * @post pkgmgrinfo_appinfo_filter_destroy()
3915 * @see pkgmgrinfo_appinfo_filter_count()
3916 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3918 static int get_taskmanageable_app_count()
3922 pkgmgrinfo_appinfo_filter_h handle;
3923 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3924 if (ret != PMINFO_R_OK)
3926 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
3927 if (ret != PMINFO_R_OK) {
3928 pkgmgrinfo_appinfo_filter_destroy(handle);
3931 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3932 if (ret != PMINFO_R_OK) {
3933 pkgmgrinfo_appinfo_filter_destroy(handle);
3936 printf("No of taskmanageable apps: %d\n", count);
3937 pkgmgrinfo_appinfo_filter_destroy(handle);
3942 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
3943 const char *property, const bool value);
3946 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
3947 * @brief This API adds an integer filter property to the filter handle
3949 * @par This API is for package-manager client application
3950 * @par Sync (or) Async : Synchronous API
3952 * @param[in] handle pointer to the application info filter handle.
3953 * @param[in] property integer property name.
3954 * @param[in] value value corresponding to the property.
3955 * @return 0 if success, error code(<0) if fail
3956 * @retval PMINFO_R_OK success
3957 * @retval PMINFO_R_EINVAL invalid argument
3958 * @retval PMINFO_R_ERROR internal error
3959 * @pre pkgmgrinfo_appinfo_filter_create()
3960 * @post pkgmgrinfo_appinfo_filter_destroy()
3961 * @see pkgmgrinfo_appinfo_filter_count()
3962 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
3964 static int get_taskmanageable_app_count()
3968 pkgmgrinfo_appinfo_filter_h handle;
3969 ret = pkgmgrinfo_appinfo_filter_create(&handle);
3970 if (ret != PMINFO_R_OK)
3972 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
3973 if (ret != PMINFO_R_OK) {
3974 pkgmgrinfo_appinfo_filter_destroy(handle);
3977 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
3978 if (ret != PMINFO_R_OK) {
3979 pkgmgrinfo_appinfo_filter_destroy(handle);
3982 printf("No of apps: %d\n", count);
3983 pkgmgrinfo_appinfo_filter_destroy(handle);
3988 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
3989 const char *property, const int value);
3992 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
3993 * @brief This API adds a string filter property to the filter handle
3995 * @par This API is for package-manager client application
3996 * @par Sync (or) Async : Synchronous API
3998 * @param[in] handle pointer to the application info filter handle.
3999 * @param[in] property string property name.
4000 * @param[in] value value corresponding to the property.
4001 * @return 0 if success, error code(<0) if fail
4002 * @retval PMINFO_R_OK success
4003 * @retval PMINFO_R_EINVAL invalid argument
4004 * @retval PMINFO_R_ERROR internal error
4005 * @pre pkgmgrinfo_appinfo_filter_create()
4006 * @post pkgmgrinfo_appinfo_filter_destroy()
4007 * @see pkgmgrinfo_appinfo_filter_count()
4008 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4010 static int get_capp_count()
4014 pkgmgrinfo_appinfo_filter_h handle;
4015 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4016 if (ret != PMINFO_R_OK)
4018 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4019 if (ret != PMINFO_R_OK) {
4020 pkgmgrinfo_appinfo_filter_destroy(handle);
4023 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4024 if (ret != PMINFO_R_OK) {
4025 pkgmgrinfo_appinfo_filter_destroy(handle);
4028 printf("No of capp: %d\n", count);
4029 pkgmgrinfo_appinfo_filter_destroy(handle);
4034 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4035 const char *property, const char *value);
4038 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4039 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4041 * @par This API is for package-manager client application
4042 * @par Sync (or) Async : Synchronous API
4044 * @param[in] handle pointer to the application info filter handle.
4045 * @param[in] app_cb callback function.
4046 * @param[in] user_data user data to be passed to the callback function
4047 * @return 0 if success, error code(<0) if fail
4048 * @retval PMINFO_R_OK success
4049 * @retval PMINFO_R_EINVAL invalid argument
4050 * @retval PMINFO_R_ERROR internal error
4051 * @pre pkgmgrinfo_appinfo_filter_create()
4052 * @post pkgmgrinfo_appinfo_filter_destroy()
4053 * @see pkgmgrinfo_appinfo_filter_count()
4055 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4058 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4059 printf("appid : %s\n", appid);
4063 static int get_capp_list()
4066 pkgmgrinfo_appinfo_filter_h handle;
4067 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4068 if (ret != PMINFO_R_OK)
4070 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4071 if (ret != PMINFO_R_OK) {
4072 pkgmgrinfo_appinfo_filter_destroy(handle);
4075 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4076 if (ret != PMINFO_R_OK) {
4077 pkgmgrinfo_appinfo_filter_destroy(handle);
4080 pkgmgrinfo_appinfo_filter_destroy(handle);
4085 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4086 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4087 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4088 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4091 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4092 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4093 * @brief This API counts the application that satisfy the filter conditions
4095 * @par This API is for package-manager client application
4096 * @par Sync (or) Async : Synchronous API
4098 * @param[in] handle pointer to the application info filter handle.
4099 * @param[in] count pointer to store count value
4100 * @param[in] uid the addressee user id of the instruction
4101 * @return 0 if success, error code(<0) if fail
4102 * @retval PMINFO_R_OK success
4103 * @retval PMINFO_R_EINVAL invalid argument
4104 * @retval PMINFO_R_ERROR internal error
4105 * @pre pkgmgrinfo_appinfo_filter_create()
4106 * @post pkgmgrinfo_appinfo_filter_destroy()
4107 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4109 static int get_capp_count()
4113 pkgmgrinfo_appinfo_filter_h handle;
4114 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4115 if (ret != PMINFO_R_OK)
4117 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4118 if (ret != PMINFO_R_OK) {
4119 pkgmgrinfo_appinfo_filter_destroy(handle);
4122 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4123 if (ret != PMINFO_R_OK) {
4124 pkgmgrinfo_appinfo_filter_destroy(handle);
4127 printf("No of capp: %d\n", count);
4128 pkgmgrinfo_appinfo_filter_destroy(handle);
4133 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4134 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4136 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4137 * @brief This API creates the application's metadata information filter handle from db.
4139 * @par This API is for package-manager client application
4140 * @par Sync (or) Async : Synchronous API
4142 * @param[out] handle pointer to the application metadata info filter handle.
4143 * @return 0 if success, error code(<0) if fail
4144 * @retval PMINFO_R_OK success
4145 * @retval PMINFO_R_EINVAL invalid argument
4146 * @retval PMINFO_R_ERROR internal error
4148 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4149 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4151 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4154 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4155 printf("appid : %s\n", appid);
4159 static int get_app_list(const char *mkey, const char *mvalue)
4162 pkgmgrinfo_appinfo_metadata_filter_h handle;
4163 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4164 if (ret != PMINFO_R_OK)
4166 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4167 if (ret != PMINFO_R_OK) {
4168 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4171 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4172 if (ret != PMINFO_R_OK) {
4173 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4176 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4181 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4184 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4185 * @brief This API destroys the application's metadata information filter handle.
4187 * @par This API is for package-manager client application
4188 * @par Sync (or) Async : Synchronous API
4190 * @param[in] handle pointer to the application metadata info filter handle.
4191 * @return 0 if success, error code(<0) if fail
4192 * @retval PMINFO_R_OK success
4193 * @retval PMINFO_R_EINVAL invalid argument
4194 * @retval PMINFO_R_ERROR internal error
4195 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4197 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4199 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4202 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4203 printf("appid : %s\n", appid);
4207 static int get_app_list(const char *mkey, const char *mvalue)
4210 pkgmgrinfo_appinfo_metadata_filter_h handle;
4211 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4212 if (ret != PMINFO_R_OK)
4214 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4215 if (ret != PMINFO_R_OK) {
4216 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4219 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4220 if (ret != PMINFO_R_OK) {
4221 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4224 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4229 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4232 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4233 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4234 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4236 * @par This API is for package-manager client application
4237 * @par Sync (or) Async : Synchronous API
4239 * @param[in] handle pointer to the application metadata info filter handle.
4240 * @param[in] key pointer to metadata key
4241 * @param[in] value pointer to metadata value
4242 * @return 0 if success, error code(<0) if fail
4243 * @retval PMINFO_R_OK success
4244 * @retval PMINFO_R_EINVAL invalid argument
4245 * @retval PMINFO_R_ERROR internal error
4246 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4247 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4248 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4250 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4253 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4254 printf("appid : %s\n", appid);
4258 static int get_app_list(const char *mkey, const char *mvalue)
4261 pkgmgrinfo_appinfo_metadata_filter_h handle;
4262 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4263 if (ret != PMINFO_R_OK)
4265 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4266 if (ret != PMINFO_R_OK) {
4267 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4270 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4271 if (ret != PMINFO_R_OK) {
4272 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4275 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4280 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4281 const char *key, const char *value);
4284 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4285 * @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)
4286 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4287 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4288 * negative value, no more callbacks will be called and API will return.
4290 * @par This API is for package-manager client application
4291 * @par Sync (or) Async : Synchronous API
4293 * @param[in] handle pointer to the application metadata info filter handle.
4294 * @param[in] app_cb function pointer to callback
4295 * @param[in] user_data pointer to user data
4296 * @param[in] uid the addressee user id of the instruction
4297 * @return 0 if success, error code(<0) if fail
4298 * @retval PMINFO_R_OK success
4299 * @retval PMINFO_R_EINVAL invalid argument
4300 * @retval PMINFO_R_ERROR internal error
4301 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4302 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4304 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4307 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4308 printf("appid : %s\n", appid);
4312 static int get_app_list(const char *mkey, const char *mvalue)
4315 pkgmgrinfo_appinfo_metadata_filter_h handle;
4316 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4317 if (ret != PMINFO_R_OK)
4319 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4320 if (ret != PMINFO_R_OK) {
4321 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4324 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4325 if (ret != PMINFO_R_OK) {
4326 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4329 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4334 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4335 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4336 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4337 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4339 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4340 * @brief This API creates the package cert information handle to get data from db.
4342 * @par This API is for package-manager client application
4343 * @par Sync (or) Async : Synchronous API
4345 * @param[out] handle pointer to the package cert handle.
4346 * @return 0 if success, error code(<0) if fail
4347 * @retval PMINFO_R_OK success
4348 * @retval PMINFO_R_EINVAL invalid argument
4349 * @retval PMINFO_R_ERROR internal error
4351 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4352 * @see pkgmgrinfo_pkginfo_get_cert_value()
4353 * @see pkgmgrinfo_pkginfo_load_certinfo()
4355 static int get_cert_info(const char *pkgid)
4358 pkgmgrinfo_certinfo_h handle;
4359 char *auth_cert = NULL;
4360 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4361 if (ret != PMINFO_R_OK)
4363 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4364 if (ret != PMINFO_R_OK) {
4365 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4368 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4369 if (ret != PMINFO_R_OK) {
4370 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4373 printf("Author root certificate: %s\n", auth_root);
4374 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4379 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4382 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4383 * @brief This API loads the package cert information handle with data from db.
4385 * @par This API is for package-manager client application
4386 * @par Sync (or) Async : Synchronous API
4388 * @param[in] pkgid pointer to the package ID.
4389 * @param[in] handle pointer to the package cert handle.
4390 * @return 0 if success, error code(<0) if fail
4391 * @retval PMINFO_R_OK success
4392 * @retval PMINFO_R_EINVAL invalid argument
4393 * @retval PMINFO_R_ERROR internal error
4394 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4395 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4396 * @see pkgmgrinfo_pkginfo_get_cert_value()
4398 static int get_cert_info(const char *pkgid)
4401 pkgmgrinfo_certinfo_h handle;
4402 char *auth_cert = NULL;
4403 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4404 if (ret != PMINFO_R_OK)
4406 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4407 if (ret != PMINFO_R_OK) {
4408 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4411 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4412 if (ret != PMINFO_R_OK) {
4413 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4416 printf("Author root certificate: %s\n", auth_root);
4417 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4422 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4425 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4426 * @brief This API gets the package cert information from the handle
4428 * @par This API is for package-manager client application
4429 * @par Sync (or) Async : Synchronous API
4431 * @param[in] handle pointer to the package cert handle.
4432 * @param[in] cert_type certificate type
4433 * @param[out] cert_value pointer to hold certificate value
4434 * @return 0 if success, error code(<0) if fail
4435 * @retval PMINFO_R_OK success
4436 * @retval PMINFO_R_EINVAL invalid argument
4437 * @retval PMINFO_R_ERROR internal error
4438 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4439 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4440 * @see pkgmgrinfo_pkginfo_load_certinfo()
4442 static int get_cert_info(const char *pkgid)
4445 pkgmgrinfo_certinfo_h handle;
4446 char *auth_cert = NULL;
4447 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4448 if (ret != PMINFO_R_OK)
4450 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4451 if (ret != PMINFO_R_OK) {
4452 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4455 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4456 if (ret != PMINFO_R_OK) {
4457 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4460 printf("Author root certificate: %s\n", auth_root);
4461 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4466 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4469 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4470 * @brief This API destroys the package cert information handle freeing up all the resources
4472 * @par This API is for package-manager client application
4473 * @par Sync (or) Async : Synchronous API
4475 * @param[in] handle pointer to the package cert handle.
4476 * @return 0 if success, error code(<0) if fail
4477 * @retval PMINFO_R_OK success
4478 * @retval PMINFO_R_EINVAL invalid argument
4479 * @retval PMINFO_R_ERROR internal error
4480 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4482 * @see pkgmgrinfo_pkginfo_load_certinfo()
4484 static int get_cert_info(const char *pkgid)
4487 pkgmgrinfo_certinfo_h handle;
4488 char *auth_cert = NULL;
4489 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4490 if (ret != PMINFO_R_OK)
4492 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4493 if (ret != PMINFO_R_OK) {
4494 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4497 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4498 if (ret != PMINFO_R_OK) {
4499 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4502 printf("Author root certificate: %s\n", auth_root);
4503 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4508 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4511 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4512 * @brief This API deletes the package cert information from DB
4514 * @par This API is for package-manager client application
4515 * @par Sync (or) Async : Synchronous API
4517 * @param[in] pkgid pointer to the package ID.
4518 * @return 0 if success, error code(<0) if fail
4519 * @retval PMINFO_R_OK success
4520 * @retval PMINFO_R_EINVAL invalid argument
4521 * @retval PMINFO_R_ERROR internal error
4525 static int delete_cert_info(const char *pkgid)
4528 ret = pkgmgrinfo_delete_certinfo(pkgid);
4529 if (ret != PMINFO_R_OK)
4535 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4536 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4538 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4539 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4540 * @brief This API creates the package db information handle to set data in db.
4542 * @par This API is for package-manager client application
4543 * @par Sync (or) Async : Synchronous API
4545 * @param[in] pkgid pointer to the package ID.
4546 * @param[in] uid the addressee user id of the instruction
4547 * @param[out] handle pointer to the package db info handle.
4548 * @return 0 if success, error code(<0) if fail
4549 * @retval PMINFO_R_OK success
4550 * @retval PMINFO_R_EINVAL invalid argument
4551 * @retval PMINFO_R_ERROR internal error
4553 * @post pkgmgrinfo_destroy_pkgdbinfo()
4554 * @see pkgmgrinfo_save_pkgdbinfo()
4555 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4557 static int set_pkg_in_db(const char *pkgid)
4560 pkgmgrinfo_pkgdbinfo_h handle;
4561 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4562 if (ret != PMINFO_R_OK)
4564 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4565 if (ret != PMINFO_R_OK) {
4566 pkgmgrinfo_destroy_pkgdbinfo(handle);
4569 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4570 if (ret != PMINFO_R_OK) {
4571 pkgmgrinfo_destroy_pkgdbinfo(handle);
4574 pkgmgrinfo_destroy_pkgdbinfo(handle);
4579 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4580 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4583 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4584 * @brief This API sets the package type in db handle
4586 * @par This API is for package-manager client application
4587 * @par Sync (or) Async : Synchronous API
4589 * @param[in] handle pointer to the pkgdbinfo handle.
4590 * @param[in] type pointer to the package type.
4591 * @return 0 if success, error code(<0) if fail
4592 * @retval PMINFO_R_OK success
4593 * @retval PMINFO_R_EINVAL invalid argument
4594 * @retval PMINFO_R_ERROR internal error
4595 * @pre pkgmgrinfo_create_pkgdbinfo()
4596 * @post pkgmgrinfo_destroy_pkgdbinfo()
4597 * @see pkgmgrinfo_save_pkgdbinfo()
4598 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4600 static int set_pkg_type_in_db(const char *pkgid)
4603 pkgmgrinfo_pkgdbinfo_h handle;
4604 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4605 if (ret != PMINFO_R_OK)
4607 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4608 if (ret != PMINFO_R_OK) {
4609 pkgmgrinfo_destroy_pkgdbinfo(handle);
4612 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4613 if (ret != PMINFO_R_OK) {
4614 pkgmgrinfo_destroy_pkgdbinfo(handle);
4617 pkgmgrinfo_destroy_pkgdbinfo(handle);
4622 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4625 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4626 * @brief This API sets the package version in db handle
4628 * @par This API is for package-manager client application
4629 * @par Sync (or) Async : Synchronous API
4631 * @param[in] handle pointer to the pkgdbinfo handle.
4632 * @param[in] version pointer to the package version
4633 * @return 0 if success, error code(<0) if fail
4634 * @retval PMINFO_R_OK success
4635 * @retval PMINFO_R_EINVAL invalid argument
4636 * @retval PMINFO_R_ERROR internal error
4637 * @pre pkgmgrinfo_create_pkgdbinfo()
4638 * @post pkgmgrinfo_destroy_pkgdbinfo()
4639 * @see pkgmgrinfo_save_pkgdbinfo()
4640 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4642 static int set_pkg_version_in_db(const char *pkgid)
4645 pkgmgrinfo_pkgdbinfo_h handle;
4646 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4647 if (ret != PMINFO_R_OK)
4649 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4650 if (ret != PMINFO_R_OK) {
4651 pkgmgrinfo_destroy_pkgdbinfo(handle);
4654 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4655 if (ret != PMINFO_R_OK) {
4656 pkgmgrinfo_destroy_pkgdbinfo(handle);
4659 pkgmgrinfo_destroy_pkgdbinfo(handle);
4664 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4667 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4668 * @brief This API sets the package install location in db handle
4670 * @par This API is for package-manager client application
4671 * @par Sync (or) Async : Synchronous API
4673 * @param[in] handle pointer to the pkgdbinfo handle.
4674 * @param[in] location package install location
4675 * @return 0 if success, error code(<0) if fail
4676 * @retval PMINFO_R_OK success
4677 * @retval PMINFO_R_EINVAL invalid argument
4678 * @retval PMINFO_R_ERROR internal error
4679 * @pre pkgmgrinfo_create_pkgdbinfo()
4680 * @post pkgmgrinfo_destroy_pkgdbinfo()
4681 * @see pkgmgrinfo_save_pkgdbinfo()
4682 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4684 static int set_pkg_install_location_in_db(const char *pkgid)
4687 pkgmgrinfo_pkgdbinfo_h handle;
4688 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4689 if (ret != PMINFO_R_OK)
4691 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4692 if (ret != PMINFO_R_OK) {
4693 pkgmgrinfo_destroy_pkgdbinfo(handle);
4696 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4697 if (ret != PMINFO_R_OK) {
4698 pkgmgrinfo_destroy_pkgdbinfo(handle);
4701 pkgmgrinfo_destroy_pkgdbinfo(handle);
4706 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4709 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4710 * @brief This API sets the package size in db handle
4712 * @par This API is for package-manager client application
4713 * @par Sync (or) Async : Synchronous API
4715 * @param[in] handle pointer to the pkgdbinfo handle.
4716 * @param[in] size pointer to the package size
4717 * @return 0 if success, error code(<0) if fail
4718 * @retval PMINFO_R_OK success
4719 * @retval PMINFO_R_EINVAL invalid argument
4720 * @retval PMINFO_R_ERROR internal error
4721 * @pre pkgmgrinfo_create_pkgdbinfo()
4722 * @post pkgmgrinfo_destroy_pkgdbinfo()
4723 * @see pkgmgrinfo_save_pkgdbinfo()
4724 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4726 static int set_pkg_size_in_db(const char *pkgid)
4729 pkgmgrinfo_pkgdbinfo_h handle;
4730 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4731 if (ret != PMINFO_R_OK)
4733 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_destroy_pkgdbinfo(handle);
4738 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4739 if (ret != PMINFO_R_OK) {
4740 pkgmgrinfo_destroy_pkgdbinfo(handle);
4743 pkgmgrinfo_destroy_pkgdbinfo(handle);
4748 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
4751 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
4752 * @brief This API sets the package label in db handle
4754 * @par This API is for package-manager client application
4755 * @par Sync (or) Async : Synchronous API
4757 * @param[in] handle pointer to the pkgdbinfo handle.
4758 * @param[in] label pointer to the package label
4759 * @param[in] locale pointer to the locale
4760 * @return 0 if success, error code(<0) if fail
4761 * @retval PMINFO_R_OK success
4762 * @retval PMINFO_R_EINVAL invalid argument
4763 * @retval PMINFO_R_ERROR internal error
4764 * @pre pkgmgrinfo_create_pkgdbinfo()
4765 * @post pkgmgrinfo_destroy_pkgdbinfo()
4766 * @see pkgmgrinfo_save_pkgdbinfo()
4767 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4769 static int set_pkg_label_in_db(const char *pkgid)
4772 pkgmgrinfo_pkgdbinfo_h handle;
4773 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4774 if (ret != PMINFO_R_OK)
4776 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
4777 if (ret != PMINFO_R_OK) {
4778 pkgmgrinfo_destroy_pkgdbinfo(handle);
4781 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4782 if (ret != PMINFO_R_OK) {
4783 pkgmgrinfo_destroy_pkgdbinfo(handle);
4786 pkgmgrinfo_destroy_pkgdbinfo(handle);
4791 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
4794 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
4795 * @brief This API sets the package icon in db handle
4797 * @par This API is for package-manager client application
4798 * @par Sync (or) Async : Synchronous API
4800 * @param[in] handle pointer to the pkgdbinfo handle.
4801 * @param[in] icon pointer to the package icon
4802 * @param[in] locale pointer to the locale
4803 * @return 0 if success, error code(<0) if fail
4804 * @retval PMINFO_R_OK success
4805 * @retval PMINFO_R_EINVAL invalid argument
4806 * @retval PMINFO_R_ERROR internal error
4807 * @pre pkgmgrinfo_create_pkgdbinfo()
4808 * @post pkgmgrinfo_destroy_pkgdbinfo()
4809 * @see pkgmgrinfo_save_pkgdbinfo()
4810 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4812 static int set_pkg_icon_in_db(const char *pkgid)
4815 pkgmgrinfo_pkgdbinfo_h handle;
4816 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4817 if (ret != PMINFO_R_OK)
4819 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
4820 if (ret != PMINFO_R_OK) {
4821 pkgmgrinfo_destroy_pkgdbinfo(handle);
4824 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4825 if (ret != PMINFO_R_OK) {
4826 pkgmgrinfo_destroy_pkgdbinfo(handle);
4829 pkgmgrinfo_destroy_pkgdbinfo(handle);
4834 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
4837 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
4838 * @brief This API sets the package description in db handle
4840 * @par This API is for package-manager client application
4841 * @par Sync (or) Async : Synchronous API
4843 * @param[in] handle pointer to the pkgdbinfo handle.
4844 * @param[in] description pointer to the package description
4845 * @param[in] locale pointer to the locale
4846 * @return 0 if success, error code(<0) if fail
4847 * @retval PMINFO_R_OK success
4848 * @retval PMINFO_R_EINVAL invalid argument
4849 * @retval PMINFO_R_ERROR internal error
4850 * @pre pkgmgrinfo_create_pkgdbinfo()
4851 * @post pkgmgrinfo_destroy_pkgdbinfo()
4852 * @see pkgmgrinfo_save_pkgdbinfo()
4853 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4855 static int set_pkg_description_in_db(const char *pkgid)
4858 pkgmgrinfo_pkgdbinfo_h handle;
4859 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4860 if (ret != PMINFO_R_OK)
4862 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
4863 if (ret != PMINFO_R_OK) {
4864 pkgmgrinfo_destroy_pkgdbinfo(handle);
4867 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4868 if (ret != PMINFO_R_OK) {
4869 pkgmgrinfo_destroy_pkgdbinfo(handle);
4872 pkgmgrinfo_destroy_pkgdbinfo(handle);
4877 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
4880 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4881 const char *author_email, const char *author_href, const char *locale)
4882 * @brief This API sets the package author info in db handle
4884 * @par This API is for package-manager client application
4885 * @par Sync (or) Async : Synchronous API
4887 * @param[in] handle pointer to the pkgdbinfo handle.
4888 * @param[in] author_name pointer to the package author name
4889 * @param[in] author_email pointer to the package author email
4890 * @param[in] author_href pointer to the package author href
4891 * @param[in] locale pointer to the locale
4892 * @return 0 if success, error code(<0) if fail
4893 * @retval PMINFO_R_OK success
4894 * @retval PMINFO_R_EINVAL invalid argument
4895 * @retval PMINFO_R_ERROR internal error
4896 * @pre pkgmgrinfo_create_pkgdbinfo()
4897 * @post pkgmgrinfo_destroy_pkgdbinfo()
4898 * @see pkgmgrinfo_save_pkgdbinfo()
4899 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4901 static int set_pkg_author_in_db(const char *pkgid)
4904 pkgmgrinfo_pkgdbinfo_h handle;
4905 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4906 if (ret != PMINFO_R_OK)
4908 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
4909 if (ret != PMINFO_R_OK) {
4910 pkgmgrinfo_destroy_pkgdbinfo(handle);
4913 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4914 if (ret != PMINFO_R_OK) {
4915 pkgmgrinfo_destroy_pkgdbinfo(handle);
4918 pkgmgrinfo_destroy_pkgdbinfo(handle);
4923 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
4924 const char *author_email, const char *author_href, const char *locale);
4927 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
4928 * @brief This API sets the package 'removable' value in db handle
4930 * @par This API is for package-manager client application
4931 * @par Sync (or) Async : Synchronous API
4933 * @param[in] handle pointer to the pkgdbinfo handle.
4934 * @param[in] removable package removable value
4935 * @return 0 if success, error code(<0) if fail
4936 * @retval PMINFO_R_OK success
4937 * @retval PMINFO_R_EINVAL invalid argument
4938 * @retval PMINFO_R_ERROR internal error
4939 * @pre pkgmgrinfo_create_pkgdbinfo()
4940 * @post pkgmgrinfo_destroy_pkgdbinfo()
4941 * @see pkgmgrinfo_save_pkgdbinfo()
4942 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4944 static int set_pkg_removable_in_db(const char *pkgid)
4947 pkgmgrinfo_pkgdbinfo_h handle;
4948 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4949 if (ret != PMINFO_R_OK)
4951 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
4952 if (ret != PMINFO_R_OK) {
4953 pkgmgrinfo_destroy_pkgdbinfo(handle);
4956 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4957 if (ret != PMINFO_R_OK) {
4958 pkgmgrinfo_destroy_pkgdbinfo(handle);
4961 pkgmgrinfo_destroy_pkgdbinfo(handle);
4966 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
4969 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
4970 * @brief This API sets the package 'preload' value in db handle
4972 * @par This API is for package-manager client application
4973 * @par Sync (or) Async : Synchronous API
4975 * @param[in] handle pointer to the pkgdbinfo handle.
4976 * @param[in] preload package preload value
4977 * @return 0 if success, error code(<0) if fail
4978 * @retval PMINFO_R_OK success
4979 * @retval PMINFO_R_EINVAL invalid argument
4980 * @retval PMINFO_R_ERROR internal error
4981 * @pre pkgmgrinfo_create_pkgdbinfo()
4982 * @post pkgmgrinfo_destroy_pkgdbinfo()
4983 * @see pkgmgrinfo_save_pkgdbinfo()
4984 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4986 static int set_pkg_preload_in_db(const char *pkgid)
4989 pkgmgrinfo_pkgdbinfo_h handle;
4990 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4991 if (ret != PMINFO_R_OK)
4993 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
4994 if (ret != PMINFO_R_OK) {
4995 pkgmgrinfo_destroy_pkgdbinfo(handle);
4998 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4999 if (ret != PMINFO_R_OK) {
5000 pkgmgrinfo_destroy_pkgdbinfo(handle);
5003 pkgmgrinfo_destroy_pkgdbinfo(handle);
5008 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5011 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5012 * @brief This API sets the package 'installed_storage' value in db handle
5014 * @par This API is for package-manager client application
5015 * @par Sync (or) Async : Synchronous API
5017 * @param[in] handle pointer to the pkgdbinfo handle.
5018 * @param[in] location installed_storage value
5019 * @return 0 if success, error code(<0) if fail
5020 * @retval PMINFO_R_OK success
5021 * @retval PMINFO_R_EINVAL invalid argument
5022 * @retval PMINFO_R_ERROR internal error
5023 * @pre pkgmgrinfo_create_pkgdbinfo()
5024 * @post pkgmgrinfo_destroy_pkgdbinfo()
5025 * @see pkgmgrinfo_save_pkgdbinfo()
5027 static int set_pkg_installed_storage_in_db(const char *pkgid)
5030 pkgmgrinfo_pkgdbinfo_h handle;
5031 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5032 if (ret != PMINFO_R_OK)
5034 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5035 if (ret != PMINFO_R_OK) {
5036 pkgmgrinfo_destroy_pkgdbinfo(handle);
5039 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5040 if (ret != PMINFO_R_OK) {
5041 pkgmgrinfo_destroy_pkgdbinfo(handle);
5044 pkgmgrinfo_destroy_pkgdbinfo(handle);
5049 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5052 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5053 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5054 * @brief This API saves all the information from the handle to the DB.
5056 * @par This API is for package-manager client application
5057 * @par Sync (or) Async : Synchronous API
5059 * @param[in] handle pointer to the package db info handle.
5060 * @param[in] uid the addressee user id of the instruction
5061 * @return 0 if success, error code(<0) if fail
5062 * @retval PMINFO_R_OK success
5063 * @retval PMINFO_R_EINVAL invalid argument
5064 * @retval PMINFO_R_ERROR internal error
5065 * @pre pkgmgrinfo_create_pkgdbinfo()
5066 * @post pkgmgrinfo_destroy_pkgdbinfo()
5067 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5069 static int set_pkg_in_db(const char *pkgid)
5072 pkgmgrinfo_pkgdbinfo_h handle;
5073 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5074 if (ret != PMINFO_R_OK)
5076 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5077 if (ret != PMINFO_R_OK) {
5078 pkgmgrinfo_destroy_pkgdbinfo(handle);
5081 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5082 if (ret != PMINFO_R_OK) {
5083 pkgmgrinfo_destroy_pkgdbinfo(handle);
5086 pkgmgrinfo_destroy_pkgdbinfo(handle);
5091 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5092 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5094 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5095 * @brief This API destroys the package db information handle freeing up all the resources
5097 * @par This API is for package-manager client application
5098 * @par Sync (or) Async : Synchronous API
5100 * @param[in] handle pointer to the package db info handle.
5101 * @return 0 if success, error code(<0) if fail
5102 * @retval PMINFO_R_OK success
5103 * @retval PMINFO_R_EINVAL invalid argument
5104 * @retval PMINFO_R_ERROR internal error
5105 * @pre pkgmgrinfo_create_pkgdbinfo()
5107 * @see pkgmgrinfo_save_pkgdbinfo()
5108 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5110 static int set_pkg_in_db(const char *pkgid)
5113 pkgmgrinfo_pkgdbinfo_h handle;
5114 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5115 if (ret != PMINFO_R_OK)
5117 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5118 if (ret != PMINFO_R_OK) {
5119 pkgmgrinfo_destroy_pkgdbinfo(handle);
5122 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5123 if (ret != PMINFO_R_OK) {
5124 pkgmgrinfo_destroy_pkgdbinfo(handle);
5127 pkgmgrinfo_destroy_pkgdbinfo(handle);
5132 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5136 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5137 * @brief This API creates the package cert information handle to set data in db.
5139 * @par This API is for package-manager client application
5140 * @par Sync (or) Async : Synchronous API
5142 * @param[out] handle pointer to the package cert handle.
5143 * @return 0 if success, error code(<0) if fail
5144 * @retval PMINFO_R_OK success
5145 * @retval PMINFO_R_EINVAL invalid argument
5146 * @retval PMINFO_R_ERROR internal error
5148 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5149 * @see pkgmgrinfo_set_cert_value()
5150 * @see pkgmgrinfo_save_certinfo()
5152 static int set_cert_in_db(const char *pkgid)
5155 pkgmgrinfo_instcertinfo_h handle;
5156 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5157 if (ret != PMINFO_R_OK)
5159 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5160 if (ret != PMINFO_R_OK) {
5161 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5164 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5165 if (ret != PMINFO_R_OK) {
5166 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5169 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5174 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5177 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5178 * @brief This API sets the package cert information in the handle.
5180 * @par This API is for package-manager client application
5181 * @par Sync (or) Async : Synchronous API
5183 * @param[in] handle pointer to the package cert handle.
5184 * @param[in] cert_type certificate type.
5185 * @param[in] cert_value certificate value.
5186 * @return 0 if success, error code(<0) if fail
5187 * @retval PMINFO_R_OK success
5188 * @retval PMINFO_R_EINVAL invalid argument
5189 * @retval PMINFO_R_ERROR internal error
5190 * @pre pkgmgrinfo_create_certinfo_set_handle()
5191 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5192 * @see pkgmgrinfo_save_certinfo()
5194 static int set_cert_in_db(const char *pkgid)
5197 pkgmgrinfo_instcertinfo_h handle;
5198 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5199 if (ret != PMINFO_R_OK)
5201 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5202 if (ret != PMINFO_R_OK) {
5203 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5206 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5207 if (ret != PMINFO_R_OK) {
5208 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5211 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5216 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5219 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5220 * @brief This API saves the package cert information in the DB.
5222 * @par This API is for package-manager client application
5223 * @par Sync (or) Async : Synchronous API
5225 * @param[in] pkgid pointer to the package ID.
5226 * @param[in] handle pointer to the package cert handle.
5227 * @return 0 if success, error code(<0) if fail
5228 * @retval PMINFO_R_OK success
5229 * @retval PMINFO_R_EINVAL invalid argument
5230 * @retval PMINFO_R_ERROR internal error
5231 * @pre pkgmgrinfo_create_certinfo_set_handle()
5232 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5233 * @see pkgmgrinfo_save_certinfo()
5235 static int set_cert_in_db(const char *pkgid)
5238 pkgmgrinfo_instcertinfo_h handle;
5239 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5240 if (ret != PMINFO_R_OK)
5242 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5243 if (ret != PMINFO_R_OK) {
5244 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5247 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5248 if (ret != PMINFO_R_OK) {
5249 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5252 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5257 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5260 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5261 * @brief This API destroys the package cert information handle freeing up all the resources.
5263 * @par This API is for package-manager client application
5264 * @par Sync (or) Async : Synchronous API
5266 * @param[in] handle pointer to the package cert handle.
5267 * @return 0 if success, error code(<0) if fail
5268 * @retval PMINFO_R_OK success
5269 * @retval PMINFO_R_EINVAL invalid argument
5270 * @retval PMINFO_R_ERROR internal error
5271 * @pre pkgmgrinfo_create_certinfo_set_handle()
5273 * @see pkgmgrinfo_save_certinfo()
5275 static int set_cert_in_db(const char *pkgid)
5278 pkgmgrinfo_instcertinfo_h handle;
5279 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5280 if (ret != PMINFO_R_OK)
5282 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5283 if (ret != PMINFO_R_OK) {
5284 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5287 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5288 if (ret != PMINFO_R_OK) {
5289 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5292 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5297 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5300 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5301 * @brief This API gets the datacontrol info
5303 * @par This API is for package-manager client application
5304 * @par Sync (or) Async : Synchronous API
5306 * @param[in] providerid pointer to the providerid of dataconltrol.
5307 * @param[in] type pointer to the type of dataconltrol.
5308 * @param[out] appid pointer to hold appid, need to free after using
5309 * @param[out] access pointer to hold access, need to free after using
5310 * @return 0 if success, error code(<0) if fail
5311 * @retval PMINFO_R_OK success
5312 * @retval PMINFO_R_EINVAL invalid argument
5313 * @retval PMINFO_R_ERROR internal error
5316 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5319 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5320 * @brief This API gets the application 'guest mode visibility' value from the DB
5322 * @par This API is for package-manager client application
5323 * @par Sync (or) Async : Synchronous API
5325 * @param[in] handle pointer to application info handle
5326 * @param[out] status pointer to hold app guest mode visibility value
5327 * @return 0 if success, error code(<0) if fail
5328 * @retval PMINFO_R_OK success
5329 * @retval PMINFO_R_EINVAL invalid argument
5330 * @retval PMINFO_R_ERROR internal error
5331 * @pre pkgmgrinfo_appinfo_get_appinfo()
5332 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5333 * @see pkgmgrinfo_appinfo_get_appid()
5334 * @see pkgmgrinfo_appinfo_is_multiple()
5336 static int get_app_guestmode_visibility(const char *appid)
5340 pkgmgrinfo_appinfo_h handle;
5341 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5342 if (ret != PMINFO_R_OK)
5344 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5345 if (ret != PMINFO_R_OK) {
5346 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5349 printf("app guest mode visibility: %d\n", status);
5350 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5355 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5358 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5359 * @brief This API sets the application 'guest mode visibility' value in the DB
5361 * @par This API is for package-manager client application
5362 * @par Sync (or) Async : Synchronous API
5364 * @param[in] handle pointer to application info handle
5365 * @param[out] status app guest mode visibility value
5366 * @return 0 if success, error code(<0) if fail
5367 * @retval PMINFO_R_OK success
5368 * @retval PMINFO_R_EINVAL invalid argument
5369 * @retval PMINFO_R_ERROR internal error
5370 * @pre pkgmgrinfo_appinfo_get_appinfo()
5371 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5372 * @see pkgmgrinfo_appinfo_get_appid()
5373 * @see pkgmgrinfo_appinfo_is_multiple()
5375 static int set_app_guestmode_visibility(const char *appid, bool value)
5378 pkgmgrinfo_appinfo_h handle;
5379 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5380 if (ret != PMINFO_R_OK)
5382 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5383 if (ret != PMINFO_R_OK) {
5384 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5392 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5393 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5395 * @pkgmgrinfo client API
5399 * @brief listening status type in pkgmgrinfo.
5401 #define PMINFO_CLIENT_STATUS_ALL 0x00
5402 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5403 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5404 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5405 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5406 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5407 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5410 * @brief This APIs provides pkgmgrinfo client listener
5412 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5413 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5414 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5415 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5416 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5420 * @pkgmgrinfo client API end
5428 #endif /* __PKG_INFO_H__ */