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_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
416 * @brief This API gets the package api_version 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] api_version pointer to hold package api_version
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_api_version(const char *pkgid)
435 char *api_version = NULL;
436 pkgmgrinfo_pkginfo_h handle = NULL;
437 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
438 if (ret != PMINFO_R_OK)
440 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
441 if (ret != PMINFO_R_OK) {
442 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
445 printf("pkg api_version: %s\n", api_version);
446 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
451 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
454 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
455 * @brief This API gets tep(tizen expansion package) file name associated with the package
457 * @par This API is for package-manager client application
458 * @par Sync (or) Async : Synchronous API
460 * @param[in] handle pointer to the pkginfo handle.
461 * @param[out] tep_name pointer to hold tep name
462 * @return 0 if success, error code(<0) if fail
463 * @retval PMINFO_R_OK success
464 * @retval PMINFO_R_EINVAL invalid argument
465 * @retval PMINFO_R_ERROR internal error
466 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
467 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
468 * @see pkgmgrinfo_pkginfo_get_pkgid()
470 static int get_tep_name(const char *pkgid)
473 char *tep_name = NULL;
474 pkgmgrinfo_pkginfo_h handle = NULL;
475 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
476 if (ret != PMINFO_R_OK)
478 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
479 if (ret != PMINFO_R_OK) {
480 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
483 printf("TEP name is: %s\n", tep_name);
484 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
489 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
492 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
493 * @brief This API gets the package install location from the package ID
495 * @par This API is for package-manager client application
496 * @par Sync (or) Async : Synchronous API
498 * @param[in] handle pointer to package info handle
499 * @param[out] location pointer to hold package install location
500 * @return 0 if success, error code(<0) if fail
501 * @retval PMINFO_R_OK success
502 * @retval PMINFO_R_EINVAL invalid argument
503 * @retval PMINFO_R_ERROR internal error
504 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
505 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
506 * @see pkgmgrinfo_pkginfo_get_pkgid()
507 * @see pkgmgrinfo_pkginfo_is_removable()
509 static int get_pkg_install_location(const char *pkgid)
512 pkgmgrinfo_install_location location;
513 pkgmgrinfo_pkginfo_h handle;
514 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
515 if (ret != PMINFO_R_OK)
517 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
518 if (ret != PMINFO_R_OK) {
519 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
522 printf("pkg install location: %d\n", location);
523 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
528 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
531 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
532 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
533 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
534 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
536 * @par This API is for package-manager client application
537 * @par Sync (or) Async : Synchronous API
539 * @param[in] handle pointer to package info handle
540 * @param[out] size pointer to hold package size
541 * @return 0 if success, error code(<0) if fail
542 * @retval PMINFO_R_OK success
543 * @retval PMINFO_R_EINVAL invalid argument
544 * @retval PMINFO_R_ERROR internal error
545 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
546 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
547 * @see pkgmgrinfo_pkginfo_get_pkgid()
548 * @see pkgmgrinfo_pkginfo_is_removable()
550 static int get_pkg_size(const char *pkgid)
554 pkgmgrinfo_pkginfo_h handle;
555 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
556 if (ret != PMINFO_R_OK)
558 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
559 if (ret != PMINFO_R_OK) {
560 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
563 printf("pkgsize: %d\n", size);
564 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
569 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
572 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
573 * @brief This API gets the installed package total size on the target.
575 * @par This API is for package-manager client application
576 * @par Sync (or) Async : Synchronous API
578 * @param[in] handle pointer to package info handle
579 * @param[out] size pointer to hold package total size
580 * @return 0 if success, error code(<0) if fail
581 * @retval PMINFO_R_OK success
582 * @retval PMINFO_R_EINVAL invalid argument
583 * @retval PMINFO_R_ERROR internal error
585 static int get_pkg_total_size(const char *pkgid)
589 pkgmgrinfo_pkginfo_h handle;
590 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
591 if (ret != PMINFO_R_OK)
593 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
594 if (ret != PMINFO_R_OK) {
595 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
598 printf("pkg total size: %d\n", size);
599 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
604 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
607 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
608 * @brief This API gets the installed package data size on the target.
610 * @par This API is for package-manager client application
611 * @par Sync (or) Async : Synchronous API
613 * @param[in] handle pointer to package info handle
614 * @param[out] size pointer to hold package data size
615 * @return 0 if success, error code(<0) if fail
616 * @retval PMINFO_R_OK success
617 * @retval PMINFO_R_EINVAL invalid argument
618 * @retval PMINFO_R_ERROR internal error
620 static int get_pkg_data_size(const char *pkgid)
624 pkgmgrinfo_pkginfo_h handle;
625 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
626 if (ret != PMINFO_R_OK)
628 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
629 if (ret != PMINFO_R_OK) {
630 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
633 printf("pkg data size: %d\n", size);
634 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
639 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
642 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
643 * @brief This API gets the package icon from the package ID
645 * @par This API is for package-manager client application
646 * @par Sync (or) Async : Synchronous API
648 * @param[in] handle pointer to package info handle
649 * @param[out] icon pointer to hold package icon
650 * @return 0 if success, error code(<0) if fail
651 * @retval PMINFO_R_OK success
652 * @retval PMINFO_R_EINVAL invalid argument
653 * @retval PMINFO_R_ERROR internal error
654 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
655 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
656 * @see pkgmgrinfo_pkginfo_get_pkgid()
657 * @see pkgmgrinfo_pkginfo_is_removable()
659 static int get_pkg_icon(const char *pkgid)
663 pkgmgrinfo_pkginfo_h handle;
664 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
665 if (ret != PMINFO_R_OK)
667 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
668 if (ret != PMINFO_R_OK) {
669 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
672 printf("pkg icon: %s\n", icon);
673 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
678 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
681 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
682 * @brief This API gets the package label from the package ID
684 * @par This API is for package-manager client application
685 * @par Sync (or) Async : Synchronous API
687 * @param[in] handle pointer to package info handle
688 * @param[out] label pointer to hold package label
689 * @return 0 if success, error code(<0) if fail
690 * @retval PMINFO_R_OK success
691 * @retval PMINFO_R_EINVAL invalid argument
692 * @retval PMINFO_R_ERROR internal error
693 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
694 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
695 * @see pkgmgrinfo_pkginfo_get_pkgid()
696 * @see pkgmgrinfo_pkginfo_is_removable()
698 static int get_pkg_label(const char *pkgid)
702 pkgmgrinfo_pkginfo_h handle;
703 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
704 if (ret != PMINFO_R_OK)
706 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
707 if (ret != PMINFO_R_OK) {
708 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
711 printf("pkg label: %s\n", label);
712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
717 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
720 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
721 * @brief This API gets the package description from the package ID
723 * @par This API is for package-manager client application
724 * @par Sync (or) Async : Synchronous API
726 * @param[in] handle pointer to package info handle
727 * @param[out] description pointer to hold package description
728 * @return 0 if success, error code(<0) if fail
729 * @retval PMINFO_R_OK success
730 * @retval PMINFO_R_EINVAL invalid argument
731 * @retval PMINFO_R_ERROR internal error
732 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
733 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
734 * @see pkgmgrinfo_pkginfo_get_pkgid()
735 * @see pkgmgrinfo_pkginfo_is_removable()
737 static int get_pkg_description(const char *pkgid)
740 char *description = NULL;
741 pkgmgrinfo_pkginfo_h handle;
742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
743 if (ret != PMINFO_R_OK)
745 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
746 if (ret != PMINFO_R_OK) {
747 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
750 printf("pkg description: %s\n", description);
751 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
756 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
759 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
760 * @brief This API gets the package's author name from the package ID
762 * @par This API is for package-manager client application
763 * @par Sync (or) Async : Synchronous API
765 * @param[in] handle pointer to package info handle
766 * @param[out] author_name pointer to hold package author name
767 * @return 0 if success, error code(<0) if fail
768 * @retval PMINFO_R_OK success
769 * @retval PMINFO_R_EINVAL invalid argument
770 * @retval PMINFO_R_ERROR internal error
771 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
772 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
773 * @see pkgmgrinfo_pkginfo_get_pkgid()
774 * @see pkgmgrinfo_pkginfo_is_removable()
776 static int get_pkg_author_name(const char *pkgid)
779 char *author_name = NULL;
780 pkgmgrinfo_pkginfo_h handle;
781 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
782 if (ret != PMINFO_R_OK)
784 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
785 if (ret != PMINFO_R_OK) {
786 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
789 printf("pkg author name: %s\n", author_name);
790 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
795 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
798 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
799 * @brief This API gets the package's author email from the package ID
801 * @par This API is for package-manager client application
802 * @par Sync (or) Async : Synchronous API
804 * @param[in] handle pointer to package info handle
805 * @param[out] author_email pointer to hold package author email
806 * @return 0 if success, error code(<0) if fail
807 * @retval PMINFO_R_OK success
808 * @retval PMINFO_R_EINVAL invalid argument
809 * @retval PMINFO_R_ERROR internal error
810 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
811 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
812 * @see pkgmgrinfo_pkginfo_get_pkgid()
813 * @see pkgmgrinfo_pkginfo_is_removable()
815 static int get_pkg_author_email(const char *pkgid)
818 char *author_email = NULL;
819 pkgmgrinfo_pkginfo_h handle;
820 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
821 if (ret != PMINFO_R_OK)
823 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
824 if (ret != PMINFO_R_OK) {
825 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
828 printf("pkg author email: %s\n", author_email);
829 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
834 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
837 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
838 * @brief This API gets the package's author href from the package ID
840 * @par This API is for package-manager client application
841 * @par Sync (or) Async : Synchronous API
843 * @param[in] handle pointer to package info handle
844 * @param[out] author_href pointer to hold package author href
845 * @return 0 if success, error code(<0) if fail
846 * @retval PMINFO_R_OK success
847 * @retval PMINFO_R_EINVAL invalid argument
848 * @retval PMINFO_R_ERROR internal error
849 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
850 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
851 * @see pkgmgrinfo_pkginfo_get_pkgid()
852 * @see pkgmgrinfo_pkginfo_is_removable()
854 static int get_pkg_author_href(const char *pkgid)
857 char *author_href = NULL;
858 pkgmgrinfo_pkginfo_h handle;
859 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
860 if (ret != PMINFO_R_OK)
862 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
863 if (ret != PMINFO_R_OK) {
864 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
867 printf("pkg author href: %s\n", author_href);
868 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
873 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
876 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
877 * @brief This API gets the package installed storagae value from the package ID
879 * @par This API is for package-manager client application
880 * @par Sync (or) Async : Synchronous API
882 * @param[in] handle pointer to package info handle
883 * @param[out] storage pointer to hold package installed storage
884 * @return 0 if success, error code(<0) if fail
885 * @retval PMINFO_R_OK success
886 * @retval PMINFO_R_EINVAL invalid argument
887 * @retval PMINFO_R_ERROR internal error
888 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
889 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
890 * @see pkgmgrinfo_pkginfo_get_pkgid()
891 * @see pkgmgrinfo_pkginfo_is_removable()
893 static int get_pkg_installed_storage(const char *pkgid)
896 pkgmgrinfo_installed_storage storage;
897 pkgmgrinfo_pkginfo_h handle;
898 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
899 if (ret != PMINFO_R_OK)
901 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
902 if (ret != PMINFO_R_OK) {
903 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
906 printf("pkg installed storage: %d\n", storage);
907 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
912 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
915 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
916 * @brief This API gets the installed time of package from the package ID
918 * @par This API is for package-manager client application
919 * @par Sync (or) Async : Synchronous API
921 * @param[in] handle pointer to package info handle
922 * @param[out] installed_time pointer to hold installed time of package
923 * @return 0 if success, error code(<0) if fail
924 * @retval PMINFO_R_OK success
925 * @retval PMINFO_R_EINVAL invalid argument
926 * @retval PMINFO_R_ERROR internal error
927 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
928 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
929 * @see pkgmgrinfo_pkginfo_get_pkgid()
930 * @see pkgmgrinfo_pkginfo_is_removable()
932 static int get_pkg_installed_time(const char *pkgid)
935 int installed_time = 0;
936 pkgmgrinfo_pkginfo_h handle;
937 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
938 if (ret != PMINFO_R_OK)
940 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
941 if (ret != PMINFO_R_OK) {
942 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
945 printf("installed_time: %d\n", installed_time);
946 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
951 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
954 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
955 * @brief This API gets the launch mode of package from the package ID
957 * @par This API is for package-manager client application
958 * @par Sync (or) Async : Synchronous API
960 * @param[in] handle pointer to package info handle
961 * @param[out] mode pointer to hold launch mode of package
962 * @return 0 if success, error code(<0) if fail
963 * @retval PMINFO_R_OK success
964 * @retval PMINFO_R_EINVAL invalid argument
965 * @retval PMINFO_R_ERROR internal error
966 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
967 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
968 * @see pkgmgrinfo_pkginfo_get_pkgid()
969 * @see pkgmgrinfo_pkginfo_is_removable()
971 static int get_pkg_launch_mode(const char *pkgid)
974 char *launch_mode = NULL;
975 pkgmgrinfo_pkginfo_h handle;
976 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
977 if (ret != PMINFO_R_OK)
979 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
980 if (ret != PMINFO_R_OK) {
981 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
984 printf("launch mode: %s\n", mode);
985 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
990 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
993 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
994 * @brief This API gets the store client id of package from the package ID
996 * @par This API is for package-manager client application
997 * @par Sync (or) Async : Synchronous API
999 * @param[in] handle pointer to package info handle
1000 * @param[out] storeclientid pointer to hold store client id of package
1001 * @return 0 if success, error code(<0) if fail
1002 * @retval PMINFO_R_OK success
1003 * @retval PMINFO_R_EINVAL invalid argument
1004 * @retval PMINFO_R_ERROR internal error
1005 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1006 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1007 * @see pkgmgrinfo_pkginfo_get_pkgid()
1008 * @see pkgmgrinfo_pkginfo_is_removable()
1010 static int get_pkg_storeclientid(const char *pkgid)
1013 char *storeclientid = 0;
1014 pkgmgrinfo_pkginfo_h handle;
1015 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1016 if (ret != PMINFO_R_OK)
1018 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1019 if (ret != PMINFO_R_OK) {
1020 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1023 printf(store client id: %s\n", storeclientid);
1024 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1029 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1032 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1033 * @brief This API gets the main app id of package from the package ID
1035 * @par This API is for package-manager client application
1036 * @par Sync (or) Async : Synchronous API
1038 * @param[in] handle pointer to package info handle
1039 * @param[out] mainappid pointer to hold main app id of package
1040 * @return 0 if success, error code(<0) if fail
1041 * @retval PMINFO_R_OK success
1042 * @retval PMINFO_R_EINVAL invalid argument
1043 * @retval PMINFO_R_ERROR internal error
1044 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1045 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1046 * @see pkgmgrinfo_pkginfo_get_pkgid()
1047 * @see pkgmgrinfo_pkginfo_is_removable()
1049 static int get_pkg_mainappid(const char *pkgid)
1052 char *mainappid = 0;
1053 pkgmgrinfo_pkginfo_h handle;
1054 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1055 if (ret != PMINFO_R_OK)
1057 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1058 if (ret != PMINFO_R_OK) {
1059 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1062 printf(main app id: %s\n", mainappid);
1063 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1068 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1071 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1072 * @brief This API gets the url of package from the package ID
1074 * @par This API is for package-manager client application
1075 * @par Sync (or) Async : Synchronous API
1077 * @param[in] handle pointer to package info handle
1078 * @param[out] url pointer to hold url of package
1079 * @return 0 if success, error code(<0) if fail
1080 * @retval PMINFO_R_OK success
1081 * @retval PMINFO_R_EINVAL invalid argument
1082 * @retval PMINFO_R_ERROR internal error
1083 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1084 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1085 * @see pkgmgrinfo_pkginfo_get_pkgid()
1086 * @see pkgmgrinfo_pkginfo_is_removable()
1088 static int get_pkg_url(const char *pkgid)
1092 pkgmgrinfo_pkginfo_h handle;
1093 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1094 if (ret != PMINFO_R_OK)
1096 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1097 if (ret != PMINFO_R_OK) {
1098 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1101 printf("url : %s\n", url);
1102 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1107 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1111 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1112 * @brief This API gets the root path of package
1114 * @par Sync (or) Async : Synchronous API
1116 * @param[in] handle pointer to package info handle
1117 * @param[out] path pointer to hold root path of package
1118 * @return 0 if success, error code(<0) if fail
1119 * @retval PMINFO_R_OK success
1120 * @retval PMINFO_R_EINVAL invalid argument
1121 * @retval PMINFO_R_ERROR internal error
1123 static int get_root_path(const char *pkgid)
1127 pkgmgrinfo_pkginfo_h handle;
1128 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1129 if (ret != PMINFO_R_OK)
1132 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1133 if (ret != PMINFO_R_OK) {
1134 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1137 printf("path : %s\n", path);
1138 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1144 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1148 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1149 * @brief This API gets the csc path of package
1151 * @par Sync (or) Async : Synchronous API
1153 * @param[in] handle pointer to package info handle
1154 * @param[out] path pointer to hold csc path of package
1155 * @return 0 if success, error code(<0) if fail
1156 * @retval PMINFO_R_OK success
1157 * @retval PMINFO_R_EINVAL invalid argument
1158 * @retval PMINFO_R_ERROR internal error
1160 static int get_csc_path(const char *pkgid)
1164 pkgmgrinfo_pkginfo_h handle;
1165 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1166 if (ret != PMINFO_R_OK)
1169 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1170 if (ret != PMINFO_R_OK) {
1171 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1174 printf("path : %s\n", path);
1175 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1181 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1184 * @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)
1185 * @brief This API compare the cert information from given package id
1187 * @par This API is for package-manager client application
1188 * @par Sync (or) Async : Synchronous API
1190 * @param[in] lhs_package_id pointer to first package ID
1191 * @param[in] rhs_package_id pointer to second package ID
1192 * @param[out] compare_result pointer to the compare result.
1193 * @return 0 if success, error code(<0) if fail
1194 * @retval PMINFO_R_OK success
1195 * @retval PMINFO_R_EINVAL invalid argument
1196 * @retval PMINFO_R_ERROR internal error
1198 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1199 * @see pkgmgrinfo_pkginfo_get_pkgid()
1200 * @see pkgmgrinfo_pkginfo_is_removable()
1202 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1205 pkgmgrinfo_cert_compare_result_type_e result;
1207 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1208 if (ret != PMINFO_R_OK) {
1211 printf("result: %d\n", result);
1216 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);
1217 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);
1219 * @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)
1220 * @brief This API compare the cert information from given app id
1222 * @par This API is for package-manager client application
1223 * @par Sync (or) Async : Synchronous API
1225 * @param[in] lhs_app_id pointer to first app ID
1226 * @param[in] rhs_app_id pointer to second app ID
1227 * @param[out] compare_result pointer to the compare result.
1228 * @return 0 if success, error code(<0) if fail
1229 * @retval PMINFO_R_OK success
1230 * @retval PMINFO_R_EINVAL invalid argument
1231 * @retval PMINFO_R_ERROR internal error
1233 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1234 * @see pkgmgrinfo_pkginfo_get_pkgid()
1235 * @see pkgmgrinfo_pkginfo_is_removable()
1237 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1240 pkgmgrinfo_cert_compare_result_type_e result;
1242 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1243 if (ret != PMINFO_R_OK) {
1246 printf("result: %d\n", result);
1251 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);
1252 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);
1254 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1255 * @brief This API gets the package 'removable' 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] removable pointer to hold package removable 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_removable(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_removable(handle, &removable);
1280 if (ret != PMINFO_R_OK) {
1281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1284 printf("pkg removable: %d\n", removable);
1285 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1290 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1293 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1294 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
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] movable pointer to hold package movable state
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()
1309 static int get_pkg_movable(const char *pkgid)
1313 pkgmgrinfo_pkginfo_h handle;
1314 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1315 if (ret != PMINFO_R_OK)
1317 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1318 if (ret != PMINFO_R_OK) {
1319 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1322 printf("pkg movable: %d\n", movable);
1323 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1328 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1331 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1332 * @brief This API gets the package 'preload' value from the package ID
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] handle pointer to package info handle
1338 * @param[out] preload pointer to hold package preload value
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1343 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1344 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1345 * @see pkgmgrinfo_pkginfo_get_pkgid()
1346 * @see pkgmgrinfo_pkginfo_is_readonly()
1348 static int get_pkg_preload(const char *pkgid)
1352 pkgmgrinfo_pkginfo_h handle;
1353 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1354 if (ret != PMINFO_R_OK)
1356 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1357 if (ret != PMINFO_R_OK) {
1358 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1361 printf("pkg preload: %d\n", preload);
1362 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1367 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1370 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1371 * @brief This API gets the value for given handle is system or not
1373 * @par This API is for package-manager client application
1374 * @par Sync (or) Async : Synchronous API
1376 * @param[in] handle pointer to package info handle
1377 * @param[out] system pointer to hold system is or not
1378 * @return 0 if success, error code(<0) if fail
1379 * @retval PMINFO_R_OK success
1380 * @retval PMINFO_R_EINVAL invalid argument
1381 * @retval PMINFO_R_ERROR internal error
1382 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1383 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1384 * @see pkgmgrinfo_pkginfo_get_pkgid()
1385 * @see pkgmgrinfo_pkginfo_is_readonly()
1387 static int get_pkg_system(const char *pkgid)
1390 bool system = false;
1391 pkgmgrinfo_pkginfo_h handle = NULL;
1392 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1393 if (ret != PMINFO_R_OK)
1395 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1396 if (ret != PMINFO_R_OK) {
1397 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1400 printf("pkg system: %d\n", system);
1401 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1406 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1409 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1410 * @brief This API gets the package 'readonly' value from the package ID
1412 * @par This API is for package-manager client application
1413 * @par Sync (or) Async : Synchronous API
1415 * @param[in] handle pointer to package info handle
1416 * @param[out] readonly pointer to hold package readonly value
1417 * @return 0 if success, error code(<0) if fail
1418 * @retval PMINFO_R_OK success
1419 * @retval PMINFO_R_EINVAL invalid argument
1420 * @retval PMINFO_R_ERROR internal error
1421 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1422 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1423 * @see pkgmgrinfo_pkginfo_get_pkgid()
1424 * @see pkgmgrinfo_pkginfo_is_removable()
1426 static int get_pkg_readonly(const char *pkgid)
1430 pkgmgrinfo_pkginfo_h handle;
1431 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1432 if (ret != PMINFO_R_OK)
1434 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1435 if (ret != PMINFO_R_OK) {
1436 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1439 printf("pkg readonly: %d\n", readonly);
1440 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1445 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1449 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1450 * @brief This API gets the package 'upate' value from the package ID
1452 * @par This API is for package-manager client application
1453 * @par Sync (or) Async : Synchronous API
1455 * @param[in] handle pointer to package info handle
1456 * @param[out] update pointer to hold package update value
1457 * @return 0 if success, error code(<0) if fail
1458 * @retval PMINFO_R_OK success
1459 * @retval PMINFO_R_EINVAL invalid argument
1460 * @retval PMINFO_R_ERROR internal error
1461 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1462 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1463 * @see pkgmgrinfo_pkginfo_get_pkgid()
1465 static int get_pkg_update(const char *pkgid)
1469 pkgmgrinfo_pkginfo_h handle;
1470 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1471 if (ret != PMINFO_R_OK)
1473 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1474 if (ret != PMINFO_R_OK) {
1475 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1478 printf("pkg update: %d\n", update);
1479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1484 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1487 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1488 * @brief This API gets the package 'support_disable' value from the package ID
1490 * @par This API is for package-manager client application
1491 * @par Sync (or) Async : Synchronous API
1493 * @param[in] handle pointer to package info handle
1494 * @param[out] support_disable pointer to hold package support_disable value
1495 * @return 0 if success, error code(<0) if fail
1496 * @retval PMINFO_R_OK success
1497 * @retval PMINFO_R_EINVAL invalid argument
1498 * @retval PMINFO_R_ERROR internal error
1499 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1500 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1501 * @see pkgmgrinfo_pkginfo_get_pkgid()
1503 static int get_pkg_support_disable(const char *pkgid)
1506 bool support_disable;
1507 pkgmgrinfo_pkginfo_h handle = NULL;
1508 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1509 if (ret != PMINFO_R_OK)
1511 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1512 if (ret != PMINFO_R_OK) {
1513 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1516 printf("pkg support_disable: %d\n", support_disable);
1517 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1522 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1525 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1526 * @brief This API gets whethere the given package is global package or user package
1528 * @par This API is for package-manager client application
1529 * @par Sync (or) Async : Synchronous API
1531 * @param[in] uid uid of the user to determine the database
1532 * @param[in] pkgid id of the current package
1533 * @return 1 if it a global package, 0 else
1536 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1540 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1541 * @brief This API gets the package 'accessible' value from the package ID
1543 * @par This API is for package-manager client application
1544 * @par Sync (or) Async : Synchronous API
1546 * @param[in] handle pointer to package info handle
1547 * @param[out] accessible pointer to hold package accessible value
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
1552 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1553 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1554 * @see pkgmgrinfo_pkginfo_get_pkgid()
1555 * @see pkgmgrinfo_pkginfo_is_readonly()
1557 static int get_pkg_accessible(const char *pkgid)
1561 pkgmgrinfo_pkginfo_h handle;
1562 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1563 if (ret != PMINFO_R_OK)
1565 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1566 if (ret != PMINFO_R_OK) {
1567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1570 printf("pkg accessible: %d\n", accessible);
1571 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1576 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1579 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1580 * @brief This API destroys the package information handle freeing up all the resources
1582 * @par This API is for package-manager client application
1583 * @par Sync (or) Async : Synchronous API
1585 * @param[in] handle pointer to the package info handle
1586 * @return 0 if success, error code(<0) if fail
1587 * @retval PMINFO_R_OK success
1588 * @retval PMINFO_R_EINVAL invalid argument
1589 * @retval PMINFO_R_ERROR internal error
1590 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1592 * @see pkgmgrinfo_pkginfo_get_pkgid()
1593 * @see pkgmgrinfo_pkginfo_is_removable()
1595 static int get_pkg_type(const char *pkgid)
1599 pkgmgrinfo_pkginfo_h handle;
1600 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1601 if (ret != PMINFO_R_OK)
1603 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1604 if (ret != PMINFO_R_OK) {
1605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1608 printf("pkgtype: %s\n", type);
1609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1614 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1617 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1618 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1619 The query will search the entire package information collected from the manifest file of all the installed packages
1621 * @par This API is for package-manager client application
1622 * @par Sync (or) Async : Synchronous API
1624 * @param[out] handle pointer to the package info filter handle.
1625 * @return 0 if success, error code(<0) if fail
1626 * @retval PMINFO_R_OK success
1627 * @retval PMINFO_R_EINVAL invalid argument
1628 * @retval PMINFO_R_ERROR internal error
1630 * @post pkgmgrinfo_pkginfo_filter_destroy()
1631 * @see pkgmgrinfo_pkginfo_filter_count()
1632 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1634 static int get_rpm_pkg_count()
1638 pkgmgrinfo_pkginfo_filter_h handle;
1639 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1640 if (ret != PMINFO_R_OK)
1642 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1643 if (ret != PMINFO_R_OK) {
1644 pkgmgrinfo_pkginfo_filter_destroy(handle);
1647 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1648 if (ret != PMINFO_R_OK) {
1649 pkgmgrinfo_pkginfo_filter_destroy(handle);
1652 printf("No of rpm pkgs: %d\n", count);
1653 pkgmgrinfo_pkginfo_filter_destroy(handle);
1658 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1661 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1662 * @brief This API destroys the package information filter handle freeing up all the resources
1664 * @par This API is for package-manager client application
1665 * @par Sync (or) Async : Synchronous API
1667 * @param[in] handle pointer to the package info filter handle.
1668 * @return 0 if success, error code(<0) if fail
1669 * @retval PMINFO_R_OK success
1670 * @retval PMINFO_R_EINVAL invalid argument
1671 * @retval PMINFO_R_ERROR internal error
1672 * @pre pkgmgrinfo_pkginfo_filter_create()
1674 * @see pkgmgrinfo_pkginfo_filter_count()
1675 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1677 static int get_rpm_pkg_count()
1681 pkgmgrinfo_pkginfo_filter_h handle;
1682 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1683 if (ret != PMINFO_R_OK)
1685 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1686 if (ret != PMINFO_R_OK) {
1687 pkgmgrinfo_pkginfo_filter_destroy(handle);
1690 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1691 if (ret != PMINFO_R_OK) {
1692 pkgmgrinfo_pkginfo_filter_destroy(handle);
1695 printf("No of rpm pkgs: %d\n", count);
1696 pkgmgrinfo_pkginfo_filter_destroy(handle);
1701 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1704 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1705 * @brief This API adds a boolean filter property to the filter handle
1707 * @par This API is for package-manager client application
1708 * @par Sync (or) Async : Synchronous API
1710 * @param[in] handle pointer to the package info filter handle.
1711 * @param[in] property boolean property name.
1712 * @param[in] value value corresponding to the property.
1713 * @return 0 if success, error code(<0) if fail
1714 * @retval PMINFO_R_OK success
1715 * @retval PMINFO_R_EINVAL invalid argument
1716 * @retval PMINFO_R_ERROR internal error
1717 * @pre pkgmgrinfo_pkginfo_filter_create()
1718 * @post pkgmgrinfo_pkginfo_filter_destroy()
1719 * @see pkgmgrinfo_pkginfo_filter_count()
1720 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1722 static int get_preload_pkg_count()
1726 pkgmgrinfo_pkginfo_filter_h handle;
1727 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1728 if (ret != PMINFO_R_OK)
1730 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1731 if (ret != PMINFO_R_OK) {
1732 pkgmgrinfo_pkginfo_filter_destroy(handle);
1735 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1736 if (ret != PMINFO_R_OK) {
1737 pkgmgrinfo_pkginfo_filter_destroy(handle);
1740 printf("No of preload pkgs: %d\n", count);
1741 pkgmgrinfo_pkginfo_filter_destroy(handle);
1746 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1747 const char *property, const bool value);
1750 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1751 * @brief This API adds an integer filter property to the filter handle
1753 * @par This API is for package-manager client application
1754 * @par Sync (or) Async : Synchronous API
1756 * @param[in] handle pointer to the package info filter handle.
1757 * @param[in] property integer property name.
1758 * @param[in] value value corresponding to the property.
1759 * @return 0 if success, error code(<0) if fail
1760 * @retval PMINFO_R_OK success
1761 * @retval PMINFO_R_EINVAL invalid argument
1762 * @retval PMINFO_R_ERROR internal error
1763 * @pre pkgmgrinfo_pkginfo_filter_create()
1764 * @post pkgmgrinfo_pkginfo_filter_destroy()
1765 * @see pkgmgrinfo_pkginfo_filter_count()
1766 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1768 static int get_pkg_count()
1772 pkgmgrinfo_pkginfo_filter_h handle;
1773 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1774 if (ret != PMINFO_R_OK)
1776 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1777 if (ret != PMINFO_R_OK) {
1778 pkgmgrinfo_pkginfo_filter_destroy(handle);
1781 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1782 if (ret != PMINFO_R_OK) {
1783 pkgmgrinfo_pkginfo_filter_destroy(handle);
1786 printf("No of preload pkgs: %d\n", count);
1787 pkgmgrinfo_pkginfo_filter_destroy(handle);
1792 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1793 const char *property, const int value);
1796 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1797 * @brief This API adds a string filter property to the filter handle
1799 * @par This API is for package-manager client application
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] handle pointer to the package info filter handle.
1803 * @param[in] property string property name.
1804 * @param[in] value value corresponding to the property.
1805 * @return 0 if success, error code(<0) if fail
1806 * @retval PMINFO_R_OK success
1807 * @retval PMINFO_R_EINVAL invalid argument
1808 * @retval PMINFO_R_ERROR internal error
1809 * @pre pkgmgrinfo_pkginfo_filter_create()
1810 * @post pkgmgrinfo_pkginfo_filter_destroy()
1811 * @see pkgmgrinfo_pkginfo_filter_count()
1812 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1814 static int get_rpm_pkg_count()
1818 pkgmgrinfo_pkginfo_filter_h handle;
1819 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1820 if (ret != PMINFO_R_OK)
1822 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1823 if (ret != PMINFO_R_OK) {
1824 pkgmgrinfo_pkginfo_filter_destroy(handle);
1827 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1828 if (ret != PMINFO_R_OK) {
1829 pkgmgrinfo_pkginfo_filter_destroy(handle);
1832 printf("No of rpm pkgs: %d\n", count);
1833 pkgmgrinfo_pkginfo_filter_destroy(handle);
1838 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1839 const char *property, const char *value);
1842 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1843 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1845 * @par This API is for package-manager client application
1846 * @par Sync (or) Async : Synchronous API
1848 * @param[in] handle pointer to the package info filter handle.
1849 * @param[in] pkg_cb callback function.
1850 * @param[in] user_data user data to be passed to the callback function
1851 * @return 0 if success, error code(<0) if fail
1852 * @retval PMINFO_R_OK success
1853 * @retval PMINFO_R_EINVAL invalid argument
1854 * @retval PMINFO_R_ERROR internal error
1855 * @pre pkgmgrinfo_pkginfo_filter_create()
1856 * @post pkgmgrinfo_pkginfo_filter_destroy()
1857 * @see pkgmgrinfo_pkginfo_filter_count()
1859 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1862 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1863 printf("pkg id : %s\n", pkgid);
1867 static int get_rpm_pkg_list()
1870 pkgmgrinfo_pkginfo_filter_h handle;
1871 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1872 if (ret != PMINFO_R_OK)
1874 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1875 if (ret != PMINFO_R_OK) {
1876 pkgmgrinfo_pkginfo_filter_destroy(handle);
1879 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1880 if (ret != PMINFO_R_OK) {
1881 pkgmgrinfo_pkginfo_filter_destroy(handle);
1884 pkgmgrinfo_pkginfo_filter_destroy(handle);
1889 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1890 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1891 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1892 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1895 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1896 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1897 * @brief This API counts the package that satisfy the filter conditions
1899 * @par This API is for package-manager client application
1900 * @par Sync (or) Async : Synchronous API
1902 * @param[in] handle pointer to the package info filter handle.
1903 * @param[in] count pointer to store the count value.
1904 * @param[in] uid the addressee user id of the instruction
1905 * @return 0 if success, error code(<0) if fail
1906 * @retval PMINFO_R_OK success
1907 * @retval PMINFO_R_EINVAL invalid argument
1908 * @retval PMINFO_R_ERROR internal error
1909 * @pre pkgmgrinfo_pkginfo_filter_create()
1910 * @post pkgmgrinfo_pkginfo_filter_destroy()
1911 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1913 static int get_rpm_pkg_count()
1917 pkgmgrinfo_pkginfo_filter_h handle;
1918 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1919 if (ret != PMINFO_R_OK)
1921 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "rpm");
1922 if (ret != PMINFO_R_OK) {
1923 pkgmgrinfo_pkginfo_filter_destroy(handle);
1926 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1927 if (ret != PMINFO_R_OK) {
1928 pkgmgrinfo_pkginfo_filter_destroy(handle);
1931 printf("No of rpm pkgs: %d\n", count);
1932 pkgmgrinfo_pkginfo_filter_destroy(handle);
1937 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
1938 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
1940 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1941 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1942 * @brief This API gets the list of privilege for a particular package
1944 * @par This API is for package-manager client application
1945 * @par Sync (or) Async : Synchronous API
1946 * @param[in] handle pointer to the package info handle.
1947 * @param[in] privilege_func callback function for list
1948 * @param[in] user_data user data to be passed to callback function
1949 * @return 0 if success, error code(<0) if fail
1950 * @retval PMINFO_R_OK success
1951 * @retval PMINFO_R_EINVAL invalid argument
1952 * @retval PMINFO_R_ERROR internal error
1953 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1954 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1956 int privilege_func(const char *name, void *user_data)
1958 if (strcmp(name, (char *)user_data) == 0)
1964 static int list_privilege(const char *package, char *privilege)
1967 pkgmgrinfo_pkginfo_h handle;
1968 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
1969 if (ret != PMINFO_R_OK)
1971 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
1972 if (ret != PMINFO_R_OK) {
1973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1976 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1981 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
1982 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
1984 /* TODO: add doxygen comment here */
1985 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
1986 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
1987 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
1988 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
1989 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
1990 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
1991 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
1994 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
1995 pkgmgrinfo_app_list_cb app_func, void *user_data)
1996 * @brief This API gets list of installed applications for a particular package
1998 * @par This API is for package-manager client application
1999 * @par Sync (or) Async : Synchronous API
2000 * @param[in] handle package info handle
2001 * @param[in] component application component
2002 * @param[in] app_func iteration function for list
2003 * @param[in] user_data user data to be passed to callback function
2004 * @return 0 if success, error code(<0) if fail
2005 * @retval PMINFO_R_OK success
2006 * @retval PMINFO_R_EINVAL invalid argument
2007 * @retval PMINFO_R_ERROR internal error
2008 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2009 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2011 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2014 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2015 printf("appid : %s\n", appid);
2019 static int list_apps(const char *pkgid)
2022 pkgmgrinfo_pkginfo_h handle;
2023 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2024 if (ret != PMINFO_R_OK)
2026 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2027 if (ret != PMINFO_R_OK) {
2028 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2031 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2036 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2037 pkgmgrinfo_app_list_cb app_func, void *user_data);
2038 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2039 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2041 * @fn int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2042 * @brief This API gets list of installed applications from all packages with minimum informaion.
2044 * @par This API is for package-manager client application
2045 * @par Sync (or) Async : Synchronous API
2046 * @param[in] app_func iteration function for list
2047 * @param[in] user_data user data to be passed to callback function
2048 * @return 0 if success, error code(<0) if fail
2049 * @retval PMINFO_R_OK success
2050 * @retval PMINFO_R_EINVAL invalid argument
2051 * @retval PMINFO_R_ERROR internal error
2055 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2057 char *pkgid1 = NULL;
2058 char *pkgid2 = NULL;
2059 pkgid1 = (char *)user_data;
2060 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2061 if (strcmp(pkgid1, pkgid2) == 0) {
2068 static int list_apps()
2071 char *name = "helloworld";
2072 ret = pkgmgrinfo_appinfo_get_install_list(app_list_cb, (void *)name);
2073 if (ret != PMINFO_R_OK) {
2080 int pkgmgrinfo_appinfo_get_install_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2081 int pkgmgrinfo_appinfo_get_usr_install_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2083 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2084 * @brief This API gets list of installed applications from all packages.
2086 * @par This API is for package-manager client application
2087 * @par Sync (or) Async : Synchronous API
2088 * @param[in] app_func iteration function for list
2089 * @param[in] user_data user data to be passed to callback function
2090 * @return 0 if success, error code(<0) if fail
2091 * @retval PMINFO_R_OK success
2092 * @retval PMINFO_R_EINVAL invalid argument
2093 * @retval PMINFO_R_ERROR internal error
2097 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2099 char *pkgid1 = NULL;
2100 char *pkgid2 = NULL;
2101 pkgid1 = (char *)user_data;
2102 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2103 if (strcmp(pkgid1, pkgid2) == 0) {
2110 static int list_apps()
2113 char *name = "helloworld";
2114 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2115 if (ret != PMINFO_R_OK) {
2122 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2123 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2126 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2127 * @brief This API creates the application information handle from db
2129 * @par This API is for package-manager client application
2130 * @par Sync (or) Async : Synchronous API
2132 * @param[in] appid pointer to appid
2133 * @param[out] handle pointer to the application info handle.
2134 * @return 0 if success, error code(<0) if fail
2135 * @retval PMINFO_R_OK success
2136 * @retval PMINFO_R_EINVAL invalid argument
2137 * @retval PMINFO_R_ERROR internal error
2139 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2140 * @see pkgmgrinfo_appinfo_get_pkgid()
2141 * @see pkgmgrinfo_appinfo_is_multiple()
2143 static int get_app_type(const char *appid)
2147 pkgmgrinfo_appinfo_h handle;
2148 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2149 if (ret != PMINFO_R_OK)
2151 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2152 if (ret != PMINFO_R_OK) {
2153 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2156 printf("apptype: %s\n", type);
2157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2162 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2163 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2165 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2166 * @brief This API gets the application ID
2168 * @par This API is for package-manager client application
2169 * @par Sync (or) Async : Synchronous API
2171 * @param[in] handle pointer to the application info handle.
2172 * @param[out] appid pointer to hold appid
2173 * @return 0 if success, error code(<0) if fail
2174 * @retval PMINFO_R_OK success
2175 * @retval PMINFO_R_EINVAL invalid argument
2176 * @retval PMINFO_R_ERROR internal error
2177 * @pre pkgmgrinfo_appinfo_get_appinfo()
2178 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2179 * @see pkgmgrinfo_appinfo_get_pkgid()
2180 * @see pkgmgrinfo_appinfo_is_multiple()
2182 static int get_app_id(const char *appid)
2185 char *app_id = NULL;
2186 pkgmgrinfo_appinfo_h handle;
2187 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2188 if (ret != PMINFO_R_OK)
2190 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2191 if (ret != PMINFO_R_OK) {
2192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2195 printf("app id: %s\n", app_id);
2196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2201 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2204 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2205 * @brief This API gets the package name of the application
2207 * @par This API is for package-manager client application
2208 * @par Sync (or) Async : Synchronous API
2210 * @param[in] handle pointer to the application info handle.
2211 * @param[out] pkg_name pointer to hold package name
2212 * @return 0 if success, error code(<0) if fail
2213 * @retval PMINFO_R_OK success
2214 * @retval PMINFO_R_EINVAL invalid argument
2215 * @retval PMINFO_R_ERROR internal error
2216 * @pre pkgmgrinfo_appinfo_get_appinfo()
2217 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2218 * @see pkgmgrinfo_appinfo_get_appid()
2219 * @see pkgmgrinfo_appinfo_is_multiple()
2221 static int get_app_pkgname(const char *appid)
2224 char *pkgname = NULL;
2225 pkgmgrinfo_appinfo_h handle;
2226 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2227 if (ret != PMINFO_R_OK)
2229 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2230 if (ret != PMINFO_R_OK) {
2231 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2234 printf("pkg name: %s\n", pkgname);
2235 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2240 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2243 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2244 * @brief This API gets the package id of the application
2246 * @par This API is for package-manager client application
2247 * @par Sync (or) Async : Synchronous API
2249 * @param[in] handle pointer to the application info handle.
2250 * @param[out] pkgid pointer to hold package id
2251 * @return 0 if success, error code(<0) if fail
2252 * @retval PMINFO_R_OK success
2253 * @retval PMINFO_R_EINVAL invalid argument
2254 * @retval PMINFO_R_ERROR internal error
2255 * @pre pkgmgrinfo_appinfo_get_appinfo()
2256 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2257 * @see pkgmgrinfo_appinfo_get_appid()
2258 * @see pkgmgrinfo_appinfo_is_multiple()
2260 static int get_app_pkgid(const char *appid)
2264 pkgmgrinfo_appinfo_h handle;
2265 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2266 if (ret != PMINFO_R_OK)
2268 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2269 if (ret != PMINFO_R_OK) {
2270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2273 printf("pkg id: %s\n", pkgid);
2274 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2279 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2282 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2283 * @brief This API gets the executable name of the application
2285 * @par This API is for package-manager client application
2286 * @par Sync (or) Async : Synchronous API
2288 * @param[in] handle pointer to the application info handle.
2289 * @param[out] exec pointer to hold app exec name
2290 * @return 0 if success, error code(<0) if fail
2291 * @retval PMINFO_R_OK success
2292 * @retval PMINFO_R_EINVAL invalid argument
2293 * @retval PMINFO_R_ERROR internal error
2294 * @pre pkgmgrinfo_appinfo_get_appinfo()
2295 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2296 * @see pkgmgrinfo_appinfo_get_appid()
2297 * @see pkgmgrinfo_appinfo_is_multiple()
2299 static int get_app_exec(const char *appid)
2303 pkgmgrinfo_appinfo_h handle;
2304 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2305 if (ret != PMINFO_R_OK)
2307 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2308 if (ret != PMINFO_R_OK) {
2309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2312 printf("exec name: %s\n", exec);
2313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2318 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2321 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2322 * @brief This API gets the icon name of the application
2324 * @par This API is for package-manager client application
2325 * @par Sync (or) Async : Synchronous API
2327 * @param[in] handle pointer to the application info handle.
2328 * @param[out] icon pointer to hold app icon name
2329 * @return 0 if success, error code(<0) if fail
2330 * @retval PMINFO_R_OK success
2331 * @retval PMINFO_R_EINVAL invalid argument
2332 * @retval PMINFO_R_ERROR internal error
2333 * @pre pkgmgrinfo_appinfo_get_appinfo()
2334 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2335 * @see pkgmgrinfo_appinfo_get_appid()
2336 * @see pkgmgrinfo_appinfo_is_multiple()
2338 static int get_app_icon(const char *appid)
2342 pkgmgrinfo_appinfo_h handle;
2343 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2344 if (ret != PMINFO_R_OK)
2346 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2347 if (ret != PMINFO_R_OK) {
2348 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2351 printf("icon name: %s\n", icon);
2352 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2357 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2360 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2361 * @brief This API gets the label of the application
2363 * @par This API is for package-manager client application
2364 * @par Sync (or) Async : Synchronous API
2366 * @param[in] handle pointer to the application info handle.
2367 * @param[out] label pointer to hold app label
2368 * @return 0 if success, error code(<0) if fail
2369 * @retval PMINFO_R_OK success
2370 * @retval PMINFO_R_EINVAL invalid argument
2371 * @retval PMINFO_R_ERROR internal error
2372 * @pre pkgmgrinfo_appinfo_get_appinfo()
2373 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2374 * @see pkgmgrinfo_appinfo_get_appid()
2375 * @see pkgmgrinfo_appinfo_is_multiple()
2377 static int get_app_label(const char *appid)
2381 pkgmgrinfo_appinfo_h handle;
2382 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2383 if (ret != PMINFO_R_OK)
2385 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2386 if (ret != PMINFO_R_OK) {
2387 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2390 printf("label : %s\n", label);
2391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2396 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2399 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2400 * @brief This API gets exactly matched label by given appid and locale
2402 * @par This API is for package-manager client application
2403 * @par Sync (or) Async : Synchronous API
2405 * @param[in] appid pointer to appid
2406 * @param[in] locale pointer to locale
2407 * @param[out] label pointer to hold app label
2408 * @return 0 if success, error code(<0) if fail
2409 * @retval PMINFO_R_OK success
2410 * @retval PMINFO_R_EINVAL invalid argument
2411 * @retval PMINFO_R_ERROR internal error
2413 static int get_localed_label(const char *appid, const char *locale)
2418 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2419 if (ret != PMINFO_R_OK)
2422 printf("localed label: %s\n", label);
2430 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2431 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2434 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2435 * @brief This API gets the component of the application
2437 * @par This API is for package-manager client application
2438 * @par Sync (or) Async : Synchronous API
2440 * @param[in] handle pointer to the application info handle.
2441 * @param[out] component pointer to hold app component
2442 * @return 0 if success, error code(<0) if fail
2443 * @retval PMINFO_R_OK success
2444 * @retval PMINFO_R_EINVAL invalid argument
2445 * @retval PMINFO_R_ERROR internal error
2446 * @pre pkgmgrinfo_appinfo_get_appinfo()
2447 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2448 * @see pkgmgrinfo_appinfo_get_appid()
2449 * @see pkgmgrinfo_appinfo_is_multiple()
2451 static int get_app_component(const char *appid)
2454 pkgmgrinfo_app_component component;
2455 pkgmgrinfo_appinfo_h handle;
2456 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2457 if (ret != PMINFO_R_OK)
2459 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2460 if (ret != PMINFO_R_OK) {
2461 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2464 printf("component : %s\n", component);
2465 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2470 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2473 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2474 * @brief This API gets the apptype of the application
2476 * @par This API is for package-manager client application
2477 * @par Sync (or) Async : Synchronous API
2479 * @param[in] handle pointer to the application info handle.
2480 * @param[out] app_type pointer to hold apptype
2481 * @return 0 if success, error code(<0) if fail
2482 * @retval PMINFO_R_OK success
2483 * @retval PMINFO_R_EINVAL invalid argument
2484 * @retval PMINFO_R_ERROR internal error
2485 * @pre pkgmgrinfo_appinfo_get_appinfo()
2486 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2487 * @see pkgmgrinfo_appinfo_get_appid()
2488 * @see pkgmgrinfo_appinfo_is_multiple()
2490 static int get_app_type(const char *appid)
2493 char *apptype = NULL;
2494 pkgmgrinfo_appinfo_h handle;
2495 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2496 if (ret != PMINFO_R_OK)
2498 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2499 if (ret != PMINFO_R_OK) {
2500 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2503 printf("apptype : %s\n", apptype);
2504 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2509 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2512 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2513 int *operation_count, char ***operation)
2514 * @brief This API gets the list of operation of the application
2516 * @par This API is for package-manager client application
2517 * @par Sync (or) Async : Synchronous API
2519 * @param[in] handle pointer to the appcontrol handle.
2520 * @param[out] operation_count pointer to hold number of operations
2521 * @param[out] operation pointer to hold list of operations
2522 * @return 0 if success, error code(<0) if fail
2523 * @retval PMINFO_R_OK success
2524 * @retval PMINFO_R_EINVAL invalid argument
2525 * @retval PMINFO_R_ERROR internal error
2526 * @pre pkgmgrinfo_appinfo_get_appinfo()
2527 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2528 * @see pkgmgrinfo_appinfo_get_uri()
2529 * @see pkgmgrinfo_appinfo_get_mime()
2531 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2536 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2537 for (i = 0; i < oc; i++) {
2538 if (strcmp(operation[i], (char *)user_data) == 0)
2545 static int check_operation(const char *appid, char *operation)
2548 pkgmgrinfo_appinfo_h handle;
2549 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2550 if (ret != PMINFO_R_OK)
2552 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2553 if (ret != PMINFO_R_OK) {
2554 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2562 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2563 int *operation_count, char ***operation);
2566 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2567 int *uri_count, char ***uri)
2568 * @brief This API gets the list of uri of the application
2570 * @par This API is for package-manager client application
2571 * @par Sync (or) Async : Synchronous API
2573 * @param[in] handle pointer to the appcontrol handle.
2574 * @param[out] uri_count pointer to hold number of uris
2575 * @param[out] uri pointer to hold list of uris
2576 * @return 0 if success, error code(<0) if fail
2577 * @retval PMINFO_R_OK success
2578 * @retval PMINFO_R_EINVAL invalid argument
2579 * @retval PMINFO_R_ERROR internal error
2580 * @pre pkgmgrinfo_appinfo_get_appinfo()
2581 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2582 * @see pkgmgrinfo_appinfo_get_operation()
2583 * @see pkgmgrinfo_appinfo_get_mime()
2585 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2590 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2591 for (i = 0; i < uc; i++) {
2592 if (strcmp(uri[i], (char *)user_data) == 0)
2599 static int check_uri(const char *appid, char *uri)
2602 pkgmgrinfo_appinfo_h handle;
2603 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2604 if (ret != PMINFO_R_OK)
2606 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2607 if (ret != PMINFO_R_OK) {
2608 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2611 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2616 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2617 int *uri_count, char ***uri);
2620 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2621 int *mime_count, char ***mime)
2622 * @brief This API gets the list of mime of the application
2624 * @par This API is for package-manager client application
2625 * @par Sync (or) Async : Synchronous API
2627 * @param[in] handle pointer to the appcontrol handle.
2628 * @param[out] mime_count pointer to hold number of mimes
2629 * @param[out] mime pointer to hold list of mimes
2630 * @return 0 if success, error code(<0) if fail
2631 * @retval PMINFO_R_OK success
2632 * @retval PMINFO_R_EINVAL invalid argument
2633 * @retval PMINFO_R_ERROR internal error
2634 * @pre pkgmgrinfo_appinfo_get_appinfo()
2635 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2636 * @see pkgmgrinfo_appinfo_get_uri()
2637 * @see pkgmgrinfo_appinfo_get_operation()
2639 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2644 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2645 for (i = 0; i < mc; i++) {
2646 if (strcmp(mime[i], (char *)user_data) == 0)
2653 static int check_mime(const char *appid, char *mime)
2656 pkgmgrinfo_appinfo_h handle;
2657 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2658 if (ret != PMINFO_R_OK)
2660 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2661 if (ret != PMINFO_R_OK) {
2662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2670 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2671 int *mime_count, char ***mime);
2674 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2675 int *subapp_count, char ***subapp)
2676 * @brief This API gets the list of subapp of the application
2678 * @par This API is for package-manager client application
2679 * @par Sync (or) Async : Synchronous API
2681 * @param[in] handle pointer to the appcontrol handle.
2682 * @param[out] subapp_count pointer to hold number of subapp
2683 * @param[out] subapp pointer to hold list of subapp
2684 * @return 0 if success, error code(<0) if fail
2685 * @retval PMINFO_R_OK success
2686 * @retval PMINFO_R_EINVAL invalid argument
2687 * @retval PMINFO_R_ERROR internal error
2688 * @pre pkgmgrinfo_appinfo_get_appinfo()
2689 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2690 * @see pkgmgrinfo_appinfo_get_uri()
2691 * @see pkgmgrinfo_appinfo_get_operation()
2693 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2697 char **subapp = NULL;
2698 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2699 for (i = 0; i < sc; i++) {
2700 if (strcmp(subapp[i], (char *)user_data) == 0)
2707 static int check_subapp(const char *appid, char *subapp)
2710 pkgmgrinfo_appinfo_h handle = NULL;
2711 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2712 if (ret != PMINFO_R_OK)
2714 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2715 if (ret != PMINFO_R_OK) {
2716 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2719 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2724 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2725 int *subapp_count, char ***subapp);
2728 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2729 * @brief This API gets the notification icon of the application
2731 * @par This API is for package-manager client application
2732 * @par Sync (or) Async : Synchronous API
2734 * @param[in] handle pointer to the application info handle.
2735 * @param[out] path pointer to hold notification icon
2736 * @return 0 if success, error code(<0) if fail
2737 * @retval PMINFO_R_OK success
2738 * @retval PMINFO_R_EINVAL invalid argument
2739 * @retval PMINFO_R_ERROR internal error
2740 * @pre pkgmgrinfo_appinfo_get_appinfo()
2741 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2742 * @see pkgmgrinfo_appinfo_get_appid()
2743 * @see pkgmgrinfo_appinfo_is_multiple()
2745 static int get_app_notification_icon(const char *appid)
2748 char *notification_icon = NULL;
2749 pkgmgrinfo_appinfo_h handle;
2750 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2751 if (ret != PMINFO_R_OK)
2753 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2754 if (ret != PMINFO_R_OK) {
2755 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2758 printf("notification icon : %s\n", notification_icon);
2759 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2764 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2767 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2768 * @brief This API gets the setting icon of the application
2770 * @par This API is for package-manager client application
2771 * @par Sync (or) Async : Synchronous API
2773 * @param[in] handle pointer to the application info handle.
2774 * @param[out] path pointer to hold setting icon
2775 * @return 0 if success, error code(<0) if fail
2776 * @retval PMINFO_R_OK success
2777 * @retval PMINFO_R_EINVAL invalid argument
2778 * @retval PMINFO_R_ERROR internal error
2779 * @pre pkgmgrinfo_appinfo_get_appinfo()
2780 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2781 * @see pkgmgrinfo_appinfo_get_appid()
2782 * @see pkgmgrinfo_appinfo_is_multiple()
2784 static int get_app_setting_icon(const char *appid)
2787 char *setting_icon = NULL;
2788 pkgmgrinfo_appinfo_h handle;
2789 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2790 if (ret != PMINFO_R_OK)
2792 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
2793 if (ret != PMINFO_R_OK) {
2794 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2797 printf("setting icon : %s\n", setting_icon);
2798 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2803 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2806 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
2807 * @brief This API gets the type of recent image on app-tray
2809 * @par This API is for package-manager client application
2810 * @par Sync (or) Async : Synchronous API
2812 * @param[in] handle pointer to the application info handle.
2813 * @param[out] type pointer to hold image type
2814 * @return 0 if success, error code(<0) if fail
2815 * @retval PMINFO_R_OK success
2816 * @retval PMINFO_R_EINVAL invalid argument
2817 * @retval PMINFO_R_ERROR internal error
2818 * @pre pkgmgrinfo_appinfo_get_appinfo()
2819 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2820 * @see pkgmgrinfo_appinfo_get_appid()
2821 * @see pkgmgrinfo_appinfo_is_multiple()
2823 static int get_app_recent_image_type(const char *appid)
2826 pkgmgrinfo_app_recentimage type;
2827 pkgmgrinfo_appinfo_h handle;
2828 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2829 if (ret != PMINFO_R_OK)
2831 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
2832 if (ret != PMINFO_R_OK) {
2833 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2836 printf("recent image type: %d\n", type);
2837 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2842 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
2846 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
2847 * @brief This API gets the preview image of application
2849 * @par Sync (or) Async : Synchronous API
2851 * @param[in] handle pointer to the application info handle.
2852 * @param[out] preview_img pointer to hold preview image path
2853 * @return 0 if success, error code(<0) if fail
2854 * @retval PMINFO_R_OK success
2855 * @retval PMINFO_R_EINVAL invalid argument
2856 * @retval PMINFO_R_ERROR internal error
2857 * @pre pkgmgrinfo_appinfo_get_appinfo()
2858 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2859 * @see pkgmgrinfo_appinfo_get_appid()
2861 static int get_app_previewimage(const char *appid)
2864 char *preview = NULL;
2865 pkgmgrinfo_appinfo_h handle = NULL;
2866 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2867 if (ret != PMINFO_R_OK)
2869 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
2870 if (ret != PMINFO_R_OK) {
2871 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2874 printf("preview image path : %s\n", preview);
2875 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2880 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
2884 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
2885 * @brief This API gets the package permission type of the application
2887 * @par This API is for package-manager client application
2888 * @par Sync (or) Async : Synchronous API
2890 * @param[in] handle pointer to the application info handle.
2891 * @param[out] permission pointer to hold package permission
2892 * @return 0 if success, error code(<0) if fail
2893 * @retval PMINFO_R_OK success
2894 * @retval PMINFO_R_EINVAL invalid argument
2895 * @retval PMINFO_R_ERROR internal error
2896 * @pre pkgmgrinfo_appinfo_get_appinfo()
2897 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2898 * @see pkgmgrinfo_appinfo_get_appid()
2900 static int get_app_permission(const char *appid)
2903 pkgmgrinfo_permission_type permission = 0;
2904 pkgmgrinfo_appinfo_h handle;
2906 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2907 if (ret != PMINFO_R_OK)
2909 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
2910 if (ret != PMINFO_R_OK) {
2911 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2914 printf("permission type: %d\n", permission);
2915 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2920 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
2923 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
2924 * @brief This API gets the component_type
2926 * @par This API is for package-manager client application
2927 * @par Sync (or) Async : Synchronous API
2929 * @param[in] handle pointer to the application info handle.
2930 * @param[out] component_type pointer to hold component_type
2931 * @return 0 if success, error code(<0) if fail
2932 * @retval PMINFO_R_OK success
2933 * @retval PMINFO_R_EINVAL invalid argument
2934 * @retval PMINFO_R_ERROR internal error
2935 * @pre pkgmgrinfo_appinfo_get_appinfo()
2936 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2937 * @see pkgmgrinfo_appinfo_get_pkgid()
2938 * @see pkgmgrinfo_appinfo_is_multiple()
2940 static int get_component_type(const char *appid)
2943 char *component_type = NULL;
2944 pkgmgrinfo_appinfo_h handle;
2945 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2946 if (ret != PMINFO_R_OK)
2948 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
2949 if (ret != PMINFO_R_OK) {
2950 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2953 printf("component_type: %s\n", component_type);
2954 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2959 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
2962 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
2963 * @brief This API gets the application 'hwacceleration' value from the app ID
2965 * @par This API is for package-manager client application
2966 * @par Sync (or) Async : Synchronous API
2968 * @param[in] handle pointer to application info handle
2969 * @param[out] hwacceleration pointer to hold package hwacceleration value
2970 * @return 0 if success, error code(<0) if fail
2971 * @retval PMINFO_R_OK success
2972 * @retval PMINFO_R_EINVAL invalid argument
2973 * @retval PMINFO_R_ERROR internal error
2974 * @pre pkgmgrinfo_appinfo_get_appinfo()
2975 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2976 * @see pkgmgrinfo_appinfo_get_appid()
2977 * @see pkgmgrinfo_appinfo_is_multiple()
2979 static int get_app_hwacceleration(const char *appid)
2982 pkgmgrinfo_app_hwacceleration hwacceleration;
2983 pkgmgrinfo_appinfo_h handle;
2984 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2985 if (ret != PMINFO_R_OK)
2987 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
2988 if (ret != PMINFO_R_OK) {
2989 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2992 printf("app hwacceleration: %d\n", hwacceleration);
2993 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2998 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3001 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3002 * @brief This API gets the application 'screenreader' value from the app ID
3004 * @par This API is for package-manager client application
3005 * @par Sync (or) Async : Synchronous API
3007 * @param[in] handle pointer to application info handle
3008 * @param[out] screenreader pointer to hold package accessibility value
3009 * @return 0 if success, error code(<0) if fail
3010 * @retval PMINFO_R_OK success
3011 * @retval PMINFO_R_EINVAL invalid argument
3012 * @retval PMINFO_R_ERROR internal error
3013 * @pre pkgmgrinfo_appinfo_get_appinfo()
3014 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3015 * @see pkgmgrinfo_appinfo_get_appid()
3016 * @see pkgmgrinfo_appinfo_is_multiple()
3018 static int get_app_screenreader(const char *appid)
3021 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3022 pkgmgrinfo_appinfo_h handle = NULL;
3023 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3024 if (ret != PMINFO_R_OK)
3026 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3027 if (ret != PMINFO_R_OK) {
3028 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3031 printf("app screenreader: %d\n", screenreader);
3032 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3037 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3040 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3041 * @brief This API gets the application's landscape & portrait effect images
3043 * @par This API is for package-manager client application
3044 * @par Sync (or) Async : Synchronous API
3046 * @param[in] handle pointer to application info handle
3047 * @param[out] portrait_img contains portrait mode effect image
3048 * @param[out] landscape_img contains landscape mode effect image
3049 * @return 0 if success, error code(<0) if fail
3050 * @retval PMINFO_R_OK success
3051 * @retval PMINFO_R_EINVAL invalid argument
3052 * @retval PMINFO_R_ERROR internal error
3053 * @pre pkgmgrinfo_appinfo_get_appinfo()
3054 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3055 * @see pkgmgrinfo_appinfo_get_appid()
3056 * @see pkgmgrinfo_appinfo_is_nodisplay()
3058 static int get_app_effectimages(const char *appid)
3061 char *portraitimg = NULL;
3062 char *landscapeimg = NULL;
3063 pkgmgrinfo_appinfo_h handle;
3064 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3065 if (ret != PMINFO_R_OK)
3067 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3068 if (ret != PMINFO_R_OK) {
3069 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3072 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3073 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3078 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3081 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3082 * @brief This API gets the application's effect image type
3084 * @par This API is for package-manager client application
3085 * @par Sync (or) Async : Synchronous API
3087 * @param[in] handle pointer to application info handle
3088 * @param[out] effectimg_type contains effect image type
3089 * @return 0 if success, error code(<0) if fail
3090 * @retval PMINFO_R_OK success
3091 * @retval PMINFO_R_EINVAL invalid argument
3092 * @retval PMINFO_R_ERROR internal error
3093 * @pre pkgmgrinfo_appinfo_get_appinfo()
3094 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3095 * @see pkgmgrinfo_appinfo_get_appid()
3096 * @see pkgmgrinfo_appinfo_is_nodisplay()
3098 static int get_app_effectimage_type(const char *appid)
3101 char *effectimg_type = NULL;
3102 pkgmgrinfo_appinfo_h handle = NULL;
3103 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3104 if (ret != PMINFO_R_OK)
3106 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3107 if (ret != PMINFO_R_OK) {
3108 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3111 printf("app effect image type: %s\n", effectimg_type);
3112 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3117 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3120 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3121 * @brief This API gets the submode_mainid of the application
3123 * @par This API is for package-manager client application
3124 * @par Sync (or) Async : Synchronous API
3126 * @param[in] handle pointer to the application info handle.
3127 * @param[out] submode_mainid pointer to hold package name
3128 * @return 0 if success, error code(<0) if fail
3129 * @retval PMINFO_R_OK success
3130 * @retval PMINFO_R_EINVAL invalid argument
3131 * @retval PMINFO_R_ERROR internal error
3132 * @pre pkgmgrinfo_appinfo_get_appinfo()
3133 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3134 * @see pkgmgrinfo_appinfo_get_appid()
3135 * @see pkgmgrinfo_appinfo_is_multiple()
3137 static int get_app_submode_mainid(const char *appid)
3140 char *submode_mainid = NULL;
3141 pkgmgrinfo_appinfo_h handle = NULL;
3142 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3143 if (ret != PMINFO_R_OK)
3145 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3146 if (ret != PMINFO_R_OK) {
3147 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3150 printf("submode_mainid: %s\n", submode_mainid);
3151 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3156 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3159 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3160 * @brief This API gets the datacontrol info
3162 * @par This API is for package-manager client application
3163 * @par Sync (or) Async : Synchronous API
3165 * @param[in] providerid pointer to the providerid of dataconltrol.
3166 * @param[in] type pointer to the type of dataconltrol.
3167 * @param[out] appid pointer to hold appid, need to free after using
3168 * @param[out] access pointer to hold access, need to free after using
3169 * @return 0 if success, error code(<0) if fail
3170 * @retval PMINFO_R_OK success
3171 * @retval PMINFO_R_EINVAL invalid argument
3172 * @retval PMINFO_R_ERROR internal error
3175 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3176 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3179 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3180 * @brief This API gets the appid of datacontrol
3182 * @par This API is for package-manager client application
3183 * @par Sync (or) Async : Synchronous API
3185 * @param[in] providerid pointer to the providerid of dataconltrol.
3186 * @param[out] appid pointer to hold appid, need to free after using
3187 * @return 0 if success, error code(<0) if fail
3188 * @retval PMINFO_R_OK success
3189 * @retval PMINFO_R_EINVAL invalid argument
3190 * @retval PMINFO_R_ERROR internal error
3193 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3194 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3197 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3198 * @brief This API gets the alias_appid of the application
3200 * @par This API is for package-manager client application
3201 * @par Sync (or) Async : Synchronous API
3203 * @param[in] handle pointer to the application info handle.
3204 * @param[out] alias_appid pointer to hold app alias_appid
3205 * @return 0 if success, error code(<0) if fail
3206 * @retval PMINFO_R_OK success
3207 * @retval PMINFO_R_EINVAL invalid argument
3208 * @retval PMINFO_R_ERROR internal error
3209 * @pre pkgmgrinfo_appinfo_get_appinfo()
3210 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3211 * @see pkgmgrinfo_appinfo_get_appid()
3213 static int get_alias_appid(const char *appid)
3216 char *alias_appid= 0;
3217 pkgmgrinfo_appinfo_h handle = NULL;
3218 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3219 if (ret != PMINFO_R_OK)
3221 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3222 if (ret != PMINFO_R_OK) {
3223 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3226 printf("alias_appid: %s\n", alias_appid);
3227 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3232 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3235 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3236 * @brief This API gets the effective_appid of the application
3238 * @par This API is for package-manager client application
3239 * @par Sync (or) Async : Synchronous API
3241 * @param[in] handle pointer to the application info handle.
3242 * @param[out] effective_appid pointer to hold app effective_appid
3243 * @return 0 if success, error code(<0) if fail
3244 * @retval PMINFO_R_OK success
3245 * @retval PMINFO_R_EINVAL invalid argument
3246 * @retval PMINFO_R_ERROR internal error
3247 * @pre pkgmgrinfo_appinfo_get_appinfo()
3248 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3249 * @see pkgmgrinfo_appinfo_get_appid()
3251 static int get_effective_appid(const char *appid)
3254 char *effective_appid= 0;
3255 pkgmgrinfo_appinfo_h handle = NULL;
3256 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3257 if (ret != PMINFO_R_OK)
3259 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3260 if (ret != PMINFO_R_OK) {
3261 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264 printf("effective_appid: %s\n", effective_appid);
3265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3270 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3273 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3274 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3275 * @brief This API gets the list of permission for a particular application
3277 * @par This API is for package-manager client application
3278 * @par Sync (or) Async : Synchronous API
3279 * @param[in] handle pointer to the application info handle.
3280 * @param[in] permission_func callback function for list
3281 * @param[in] user_data user data to be passed to callback function
3282 * @return 0 if success, error code(<0) if fail
3283 * @retval PMINFO_R_OK success
3284 * @retval PMINFO_R_EINVAL invalid argument
3285 * @retval PMINFO_R_ERROR internal error
3286 * @pre pkgmgrinfo_appinfo_get_appinfo()
3287 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3289 int permission_func(const char *name, void *user_data)
3291 if (strcmp(name, (char *)user_data) == 0)
3297 static int list_permission(const char *appid, char *permission)
3300 pkgmgrinfo_appinfo_h handle;
3301 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3302 if (ret != PMINFO_R_OK)
3304 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3305 if (ret != PMINFO_R_OK) {
3306 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3309 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3314 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3315 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3318 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3319 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3320 * @brief This API gets the list of category for a particular application
3322 * @par This API is for package-manager client application
3323 * @par Sync (or) Async : Synchronous API
3324 * @param[in] handle pointer to the application info handle.
3325 * @param[in] category_func callback function for list
3326 * @param[in] user_data user data to be passed to callback function
3327 * @return 0 if success, error code(<0) if fail
3328 * @retval PMINFO_R_OK success
3329 * @retval PMINFO_R_EINVAL invalid argument
3330 * @retval PMINFO_R_ERROR internal error
3331 * @pre pkgmgrinfo_appinfo_get_appinfo()
3332 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3334 int category_func(const char *name, void *user_data)
3336 if (strcmp(name, (char *)user_data) == 0)
3342 static int list_category(const char *appid, char *category)
3345 pkgmgrinfo_appinfo_h handle;
3346 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3347 if (ret != PMINFO_R_OK)
3349 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3350 if (ret != PMINFO_R_OK) {
3351 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3354 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3359 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3360 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3363 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3364 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3365 * @brief This API gets the list of metadata for a particular application
3367 * @par This API is for package-manager client application
3368 * @par Sync (or) Async : Synchronous API
3369 * @param[in] handle pointer to the application info handle.
3370 * @param[in] metadata_func callback function for list
3371 * @param[in] user_data user data to be passed to callback function
3372 * @return 0 if success, error code(<0) if fail
3373 * @retval PMINFO_R_OK success
3374 * @retval PMINFO_R_EINVAL invalid argument
3375 * @retval PMINFO_R_ERROR internal error
3376 * @pre pkgmgrinfo_appinfo_get_appinfo()
3377 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3379 int metadata_func(const char *key, const char *value, void *user_data)
3381 if (strcmp(key, (char *)user_data) == 0) {
3382 printf("Value is %s\n", value);
3389 static int list_metadata(const char *appid, char *key)
3392 pkgmgrinfo_appinfo_h handle;
3393 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3394 if (ret != PMINFO_R_OK)
3396 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3397 if (ret != PMINFO_R_OK) {
3398 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3406 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3407 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3411 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3412 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3413 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3414 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3415 * @brief This API gets the list of app-control for a particular application
3417 * @par This API is for package-manager client application
3418 * @par Sync (or) Async : Synchronous API
3419 * @param[in] handle pointer to the application info handle.
3420 * @param[in] appcontrol_func callback function for list
3421 * @param[in] user_data user data to be passed to callback function
3422 * @param[in] uid the addressee user id of the instruction
3423 * @return 0 if success, error code(<0) if fail
3424 * @retval PMINFO_R_OK success
3425 * @retval PMINFO_R_EINVAL invalid argument
3426 * @retval PMINFO_R_ERROR internal error
3427 * @pre pkgmgrinfo_appinfo_get_appinfo()
3428 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3430 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3435 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3436 for (i = 0; i < oc; i++) {
3437 if (strcmp(operation[i], (char *)user_data) == 0)
3444 static int check_operation(const char *appid, char *operation)
3447 pkgmgrinfo_appinfo_h handle;
3448 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3449 if (ret != PMINFO_R_OK)
3451 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3452 if (ret != PMINFO_R_OK) {
3453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3456 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3461 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3462 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3467 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3468 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3471 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3472 * @brief This API gets the application 'nodisplay' value from the app ID
3474 * @par This API is for package-manager client application
3475 * @par Sync (or) Async : Synchronous API
3477 * @param[in] handle pointer to application info handle
3478 * @param[out] nodisplay pointer to hold package nodisplay value
3479 * @return 0 if success, error code(<0) if fail
3480 * @retval PMINFO_R_OK success
3481 * @retval PMINFO_R_EINVAL invalid argument
3482 * @retval PMINFO_R_ERROR internal error
3483 * @pre pkgmgrinfo_appinfo_get_appinfo()
3484 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3485 * @see pkgmgrinfo_appinfo_get_appid()
3486 * @see pkgmgrinfo_appinfo_is_multiple()
3488 static int get_app_nodisplay(const char *appid)
3492 pkgmgrinfo_appinfo_h handle;
3493 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3494 if (ret != PMINFO_R_OK)
3496 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3497 if (ret != PMINFO_R_OK) {
3498 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3501 printf("app nodisplay: %d\n", nodisplay);
3502 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3507 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3510 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3511 * @brief This API gets the application 'multiple' value from the app ID
3513 * @par This API is for package-manager client application
3514 * @par Sync (or) Async : Synchronous API
3516 * @param[in] handle pointer to application info handle
3517 * @param[out] multiple pointer to hold package multiple value
3518 * @return 0 if success, error code(<0) if fail
3519 * @retval PMINFO_R_OK success
3520 * @retval PMINFO_R_EINVAL invalid argument
3521 * @retval PMINFO_R_ERROR internal error
3522 * @pre pkgmgrinfo_appinfo_get_appinfo()
3523 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3524 * @see pkgmgrinfo_appinfo_get_appid()
3525 * @see pkgmgrinfo_appinfo_is_nodisplay()
3527 static int get_app_multiple(const char *appid)
3531 pkgmgrinfo_appinfo_h handle;
3532 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3533 if (ret != PMINFO_R_OK)
3535 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3536 if (ret != PMINFO_R_OK) {
3537 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3540 printf("app multiple: %d\n", multiple);
3541 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3546 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3549 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3550 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3551 * application launching effect. If fales, indicator will be hidden during application launching effect
3553 * @par This API is for package-manager client application
3554 * @par Sync (or) Async : Synchronous API
3556 * @param[in] handle pointer to application info handle
3557 * @param[out] indicator_disp contains indicator display status for application launching effect
3558 * @return 0 if success, error code(<0) if fail
3559 * @retval PMINFO_R_OK success
3560 * @retval PMINFO_R_EINVAL invalid argument
3561 * @retval PMINFO_R_ERROR internal error
3562 * @pre pkgmgrinfo_appinfo_get_appinfo()
3563 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3564 * @see pkgmgrinfo_appinfo_get_appid()
3565 * @see pkgmgrinfo_appinfo_is_nodisplay()
3567 static int get_app_indicator_display(const char *appid)
3570 bool indicator_disp;
3571 pkgmgrinfo_appinfo_h handle;
3572 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3573 if (ret != PMINFO_R_OK)
3575 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3576 if (ret != PMINFO_R_OK){
3577 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3580 printf("app indicator disp : %d\n", indicator_disp);
3581 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3586 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3589 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3590 * @brief This API gets the application 'taskmanage' value from the app ID
3592 * @par This API is for package-manager client application
3593 * @par Sync (or) Async : Synchronous API
3595 * @param[in] handle pointer to application info handle
3596 * @param[out] taskmanage pointer to hold package taskmanage value
3597 * @return 0 if success, error code(<0) if fail
3598 * @retval PMINFO_R_OK success
3599 * @retval PMINFO_R_EINVAL invalid argument
3600 * @retval PMINFO_R_ERROR internal error
3601 * @pre pkgmgrinfo_appinfo_get_appinfo()
3602 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3603 * @see pkgmgrinfo_appinfo_get_appid()
3604 * @see pkgmgrinfo_appinfo_is_multiple()
3606 static int get_app_taskmanage(const char *appid)
3610 pkgmgrinfo_appinfo_h handle;
3611 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3612 if (ret != PMINFO_R_OK)
3614 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
3615 if (ret != PMINFO_R_OK) {
3616 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3619 printf("app taskmanage: %d\n", taskmanage);
3620 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3625 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
3628 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
3629 * @brief This API gets the application 'taskmanage' value from the app ID
3631 * @par This API is for package-manager client application
3632 * @par Sync (or) Async : Synchronous API
3634 * @param[in] handle pointer to application info handle
3635 * @param[out] enabled pointer to hold package enabled value
3636 * @return 0 if success, error code(<0) if fail
3637 * @retval PMINFO_R_OK success
3638 * @retval PMINFO_R_EINVAL invalid argument
3639 * @retval PMINFO_R_ERROR internal error
3640 * @pre pkgmgrinfo_appinfo_get_appinfo()
3641 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3642 * @see pkgmgrinfo_appinfo_get_appid()
3643 * @see pkgmgrinfo_appinfo_is_multiple()
3645 static int get_app_enabled(const char *appid)
3649 pkgmgrinfo_appinfo_h handle;
3650 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3651 if (ret != PMINFO_R_OK)
3653 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
3654 if (ret != PMINFO_R_OK) {
3655 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3658 printf("app enabled: %d\n", enabled);
3659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3664 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
3667 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
3668 * @brief This API gets the application 'onboot' value from the app ID
3670 * @par This API is for package-manager client application
3671 * @par Sync (or) Async : Synchronous API
3673 * @param[in] handle pointer to application info handle
3674 * @param[out] onboot pointer to hold package onboot value
3675 * @return 0 if success, error code(<0) if fail
3676 * @retval PMINFO_R_OK success
3677 * @retval PMINFO_R_EINVAL invalid argument
3678 * @retval PMINFO_R_ERROR internal error
3679 * @pre pkgmgrinfo_appinfo_get_appinfo()
3680 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3681 * @see pkgmgrinfo_appinfo_get_appid()
3682 * @see pkgmgrinfo_appinfo_is_multiple()
3684 static int get_app_onboot(const char *appid)
3688 pkgmgrinfo_appinfo_h handle;
3689 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3690 if (ret != PMINFO_R_OK)
3692 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
3693 if (ret != PMINFO_R_OK) {
3694 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3697 printf("app onboot: %d\n", onboot);
3698 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3703 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
3706 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
3707 * @brief This API gets the application 'autorestart' value from the app ID
3709 * @par This API is for package-manager client application
3710 * @par Sync (or) Async : Synchronous API
3712 * @param[in] handle pointer to application info handle
3713 * @param[out] autorestart pointer to hold package autorestart value
3714 * @return 0 if success, error code(<0) if fail
3715 * @retval PMINFO_R_OK success
3716 * @retval PMINFO_R_EINVAL invalid argument
3717 * @retval PMINFO_R_ERROR internal error
3718 * @pre pkgmgrinfo_appinfo_get_appinfo()
3719 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3720 * @see pkgmgrinfo_appinfo_get_appid()
3721 * @see pkgmgrinfo_appinfo_is_multiple()
3723 static int get_app_autorestart(const char *appid)
3727 pkgmgrinfo_appinfo_h handle;
3728 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3729 if (ret != PMINFO_R_OK)
3731 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
3732 if (ret != PMINFO_R_OK) {
3733 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3736 printf("app autorestart: %d\n", autorestart);
3737 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3742 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
3745 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
3746 * @brief This API gets the value for given application is main app or not from handle
3748 * @par This API is for package-manager client application
3749 * @par Sync (or) Async : Synchronous API
3751 * @param[in] handle pointer to application info handle
3752 * @param[out] mainapp pointer to hold package mainapp is or not
3753 * @return 0 if success, error code(<0) if fail
3754 * @retval PMINFO_R_OK success
3755 * @retval PMINFO_R_EINVAL invalid argument
3756 * @retval PMINFO_R_ERROR internal error
3757 * @pre pkgmgrinfo_appinfo_get_appinfo()
3758 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3759 * @see pkgmgrinfo_appinfo_get_appid()
3760 * @see pkgmgrinfo_appinfo_is_multiple()
3762 static int get_app_mainapp(const char *appid)
3766 pkgmgrinfo_appinfo_h handle;
3767 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3768 if (ret != PMINFO_R_OK)
3770 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
3771 if (ret != PMINFO_R_OK) {
3772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3775 printf("mainapp: %d\n", mainapp);
3776 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3781 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
3785 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
3786 * @brief This API gets the value for given application is preload or not from handle
3788 * @par This API is for package-manager client application
3789 * @par Sync (or) Async : Synchronous API
3791 * @param[in] handle pointer to application info handle
3792 * @param[out] preload pointer to hold preload is or not
3793 * @return 0 if success, error code(<0) if fail
3794 * @retval PMINFO_R_OK success
3795 * @retval PMINFO_R_EINVAL invalid argument
3796 * @retval PMINFO_R_ERROR internal error
3797 * @pre pkgmgrinfo_appinfo_get_appinfo()
3798 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3799 * @see pkgmgrinfo_appinfo_get_appid()
3800 * @see pkgmgrinfo_appinfo_is_multiple()
3802 static int get_app_preload(const char *appid)
3806 pkgmgrinfo_appinfo_h handle = NULL;
3807 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3808 if (ret != PMINFO_R_OK)
3810 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
3811 if (ret != PMINFO_R_OK) {
3812 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3815 printf("preload: %d\n", preload);
3816 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3821 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
3824 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
3825 * @brief This API gets the value for given application is submode or not from handle
3827 * @par This API is for package-manager client application
3828 * @par Sync (or) Async : Synchronous API
3830 * @param[in] handle pointer to application info handle
3831 * @param[out] submode pointer to hold submode is or not
3832 * @return 0 if success, error code(<0) if fail
3833 * @retval PMINFO_R_OK success
3834 * @retval PMINFO_R_EINVAL invalid argument
3835 * @retval PMINFO_R_ERROR internal error
3836 * @pre pkgmgrinfo_appinfo_get_appinfo()
3837 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3838 * @see pkgmgrinfo_appinfo_get_appid()
3839 * @see pkgmgrinfo_appinfo_is_multiple()
3841 static int get_app_submode(const char *appid)
3845 pkgmgrinfo_appinfo_h handle = NULL;
3846 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3847 if (ret != PMINFO_R_OK)
3849 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
3850 if (ret != PMINFO_R_OK) {
3851 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3854 printf("submode: %d\n", submode);
3855 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3860 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
3863 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
3864 * @brief This API gets the value for given application is process_pool or not from handle
3866 * @par This API is for package-manager client application
3867 * @par Sync (or) Async : Synchronous API
3869 * @param[in] handle pointer to application info handle
3870 * @param[out] process_pool pointer to hold process_pool is or not
3871 * @return 0 if success, error code(<0) if fail
3872 * @retval PMINFO_R_OK success
3873 * @retval PMINFO_R_EINVAL invalid argument
3874 * @retval PMINFO_R_ERROR internal error
3875 * @pre pkgmgrinfo_appinfo_get_appinfo()
3876 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3877 * @see pkgmgrinfo_appinfo_get_appid()
3879 static int get_app_process_pool(const char *appid)
3882 bool process_pool = 0;
3883 pkgmgrinfo_appinfo_h handle = NULL;
3884 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3885 if (ret != PMINFO_R_OK)
3887 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
3888 if (ret != PMINFO_R_OK) {
3889 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3892 printf("process_pool: %d\n", process_pool);
3893 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3898 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
3901 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
3902 * @brief This API gets the installed storage location of the application
3904 * @par This API is for package-manager client application
3905 * @par Sync (or) Async : Synchronous API
3907 * @param[in] handle pointer to the application info handle.
3908 * @param[out] app_type pointer to hold installed storage location
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_get_appinfo()
3914 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3915 * @see pkgmgrinfo_appinfo_get_appid()
3917 static int get_app_installed_location(const char *appid)
3920 pkgmgrinfo_installed_storage storage;
3921 pkgmgrinfo_appinfo_h handle = NULL;
3922 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3923 if (ret != PMINFO_R_OK)
3925 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
3926 if (ret != PMINFO_R_OK) {
3927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3930 printf("Installed storage location : %d\n", storage);
3931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3936 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
3940 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
3941 * @brief This API checks if the application has the given category
3943 * @par This API is for package-manager client application
3944 * @par Sync (or) Async : Synchronous API
3946 * @param[in] handle pointer to the application info handle
3947 * @param[in] category category
3948 * @param[out] exist value Gets whether the application has the given category
3949 * @return 0 if success, error code(<0) if fail
3950 * @retval PMINFO_R_OK success
3951 * @retval PMINFO_R_EINVAL invalid argument
3952 * @retval PMINFO_R_ERROR internal error
3954 static int is_category_exist(const char *appid, const char *category)
3957 pkgmgrinfo_appinfo_h handle;
3960 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3961 if (ret != PMINFO_R_OK)
3964 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
3965 if (ret != PMINFO_R_OK) {
3966 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3975 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
3978 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
3979 * @brief This API gets the application 'ui_gadget' value from the app ID
3981 * @par This API is for package-manager client application
3982 * @par Sync (or) Async : Synchronous API
3984 * @param[in] handle pointer to application info handle
3985 * @param[out] ui_gadget pointer to hold package ui_gadget value
3986 * @return 0 if success, error code(<0) if fail
3987 * @retval PMINFO_R_OK success
3988 * @retval PMINFO_R_EINVAL invalid argument
3989 * @pre pkgmgrinfo_appinfo_get_appinfo()
3990 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3992 static int get_app_ui_gadget(const char *appid)
3996 pkgmgrinfo_appinfo_h handle = NULL;
3997 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3998 if (ret != PMINFO_R_OK)
4000 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4001 if (ret != PMINFO_R_OK) {
4002 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4005 printf("app ui_gadget: %d\n", ui_gadget);
4006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4011 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4014 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4015 * @brief This API gets the application 'support_disable' value from the app ID
4017 * @par This API is for package-manager client application
4018 * @par Sync (or) Async : Synchronous API
4020 * @param[in] handle pointer to application info handle
4021 * @param[out] support_disable pointer to hold package support_disable value
4022 * @return 0 if success, error code(<0) if fail
4023 * @retval PMINFO_R_OK success
4024 * @retval PMINFO_R_EINVAL invalid argument
4025 * @pre pkgmgrinfo_appinfo_get_appinfo()
4026 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4028 static int get_app_support_disable(const char *appid)
4031 bool support_disable;
4032 pkgmgrinfo_appinfo_h handle = NULL;
4033 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4034 if (ret != PMINFO_R_OK)
4036 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4037 if (ret != PMINFO_R_OK) {
4038 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4041 printf("app support_disable: %d\n", support_disable);
4042 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4047 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4050 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4051 * @brief This API destroys the application information handle freeing up all the resources
4053 * @par This API is for package-manager client application
4054 * @par Sync (or) Async : Synchronous API
4056 * @param[in] handle pointer to the application info handle.
4057 * @return 0 if success, error code(<0) if fail
4058 * @retval PMINFO_R_OK success
4059 * @retval PMINFO_R_EINVAL invalid argument
4060 * @retval PMINFO_R_ERROR internal error
4061 * @pre pkgmgrinfo_appinfo_get_appinfo()
4063 * @see pkgmgrinfo_appinfo_get_pkgid()
4064 * @see pkgmgrinfo_appinfo_is_multiple()
4066 static int get_app_type(const char *appid)
4070 pkgmgrinfo_appinfo_h handle;
4071 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4072 if (ret != PMINFO_R_OK)
4074 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4075 if (ret != PMINFO_R_OK) {
4076 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4079 printf("apptype: %s\n", type);
4080 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4085 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4088 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4089 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4090 The query will search the entire application information collected from the manifest file of all the installed packages
4092 * @par This API is for package-manager client application
4093 * @par Sync (or) Async : Synchronous API
4095 * @param[out] handle pointer to the application info filter handle.
4096 * @return 0 if success, error code(<0) if fail
4097 * @retval PMINFO_R_OK success
4098 * @retval PMINFO_R_EINVAL invalid argument
4099 * @retval PMINFO_R_ERROR internal error
4101 * @post pkgmgrinfo_appinfo_filter_destroy()
4102 * @see pkgmgrinfo_appinfo_filter_count()
4103 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4105 static int get_capp_count()
4109 pkgmgrinfo_appinfo_filter_h handle;
4110 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4111 if (ret != PMINFO_R_OK)
4113 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4114 if (ret != PMINFO_R_OK) {
4115 pkgmgrinfo_appinfo_filter_destroy(handle);
4118 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4119 if (ret != PMINFO_R_OK) {
4120 pkgmgrinfo_appinfo_filter_destroy(handle);
4123 printf("No of capp: %d\n", count);
4124 pkgmgrinfo_appinfo_filter_destroy(handle);
4129 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4132 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4133 * @brief This API destroys the application information filter handle freeing up all the resources
4135 * @par This API is for package-manager client application
4136 * @par Sync (or) Async : Synchronous API
4138 * @param[in] handle pointer to the application info filter handle.
4139 * @return 0 if success, error code(<0) if fail
4140 * @retval PMINFO_R_OK success
4141 * @retval PMINFO_R_EINVAL invalid argument
4142 * @retval PMINFO_R_ERROR internal error
4143 * @pre pkgmgrinfo_appinfo_filter_create()
4145 * @see pkgmgrinfo_appinfo_filter_count()
4146 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4148 static int get_capp_count()
4152 pkgmgrinfo_appinfo_filter_h handle;
4153 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4154 if (ret != PMINFO_R_OK)
4156 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4157 if (ret != PMINFO_R_OK) {
4158 pkgmgrinfo_appinfo_filter_destroy(handle);
4161 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4162 if (ret != PMINFO_R_OK) {
4163 pkgmgrinfo_appinfo_filter_destroy(handle);
4166 printf("No of capp: %d\n", count);
4167 pkgmgrinfo_appinfo_filter_destroy(handle);
4172 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4175 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4176 * @brief This API adds a boolean filter property to the filter handle
4178 * @par This API is for package-manager client application
4179 * @par Sync (or) Async : Synchronous API
4181 * @param[in] handle pointer to the application info filter handle.
4182 * @param[in] property boolean property name.
4183 * @param[in] value value corresponding to the property.
4184 * @return 0 if success, error code(<0) if fail
4185 * @retval PMINFO_R_OK success
4186 * @retval PMINFO_R_EINVAL invalid argument
4187 * @retval PMINFO_R_ERROR internal error
4188 * @pre pkgmgrinfo_appinfo_filter_create()
4189 * @post pkgmgrinfo_appinfo_filter_destroy()
4190 * @see pkgmgrinfo_appinfo_filter_count()
4191 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4193 static int get_taskmanageable_app_count()
4197 pkgmgrinfo_appinfo_filter_h handle;
4198 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4199 if (ret != PMINFO_R_OK)
4201 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4202 if (ret != PMINFO_R_OK) {
4203 pkgmgrinfo_appinfo_filter_destroy(handle);
4206 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4207 if (ret != PMINFO_R_OK) {
4208 pkgmgrinfo_appinfo_filter_destroy(handle);
4211 printf("No of taskmanageable apps: %d\n", count);
4212 pkgmgrinfo_appinfo_filter_destroy(handle);
4217 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4218 const char *property, const bool value);
4221 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4222 * @brief This API adds an integer filter property to the filter handle
4224 * @par This API is for package-manager client application
4225 * @par Sync (or) Async : Synchronous API
4227 * @param[in] handle pointer to the application info filter handle.
4228 * @param[in] property integer property name.
4229 * @param[in] value value corresponding to the property.
4230 * @return 0 if success, error code(<0) if fail
4231 * @retval PMINFO_R_OK success
4232 * @retval PMINFO_R_EINVAL invalid argument
4233 * @retval PMINFO_R_ERROR internal error
4234 * @pre pkgmgrinfo_appinfo_filter_create()
4235 * @post pkgmgrinfo_appinfo_filter_destroy()
4236 * @see pkgmgrinfo_appinfo_filter_count()
4237 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4239 static int get_taskmanageable_app_count()
4243 pkgmgrinfo_appinfo_filter_h handle;
4244 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4245 if (ret != PMINFO_R_OK)
4247 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4248 if (ret != PMINFO_R_OK) {
4249 pkgmgrinfo_appinfo_filter_destroy(handle);
4252 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4253 if (ret != PMINFO_R_OK) {
4254 pkgmgrinfo_appinfo_filter_destroy(handle);
4257 printf("No of apps: %d\n", count);
4258 pkgmgrinfo_appinfo_filter_destroy(handle);
4263 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4264 const char *property, const int value);
4267 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4268 * @brief This API adds a string filter property to the filter handle
4270 * @par This API is for package-manager client application
4271 * @par Sync (or) Async : Synchronous API
4273 * @param[in] handle pointer to the application info filter handle.
4274 * @param[in] property string property name.
4275 * @param[in] value value corresponding to the property.
4276 * @return 0 if success, error code(<0) if fail
4277 * @retval PMINFO_R_OK success
4278 * @retval PMINFO_R_EINVAL invalid argument
4279 * @retval PMINFO_R_ERROR internal error
4280 * @pre pkgmgrinfo_appinfo_filter_create()
4281 * @post pkgmgrinfo_appinfo_filter_destroy()
4282 * @see pkgmgrinfo_appinfo_filter_count()
4283 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4285 static int get_capp_count()
4289 pkgmgrinfo_appinfo_filter_h handle;
4290 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4291 if (ret != PMINFO_R_OK)
4293 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4294 if (ret != PMINFO_R_OK) {
4295 pkgmgrinfo_appinfo_filter_destroy(handle);
4298 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4299 if (ret != PMINFO_R_OK) {
4300 pkgmgrinfo_appinfo_filter_destroy(handle);
4303 printf("No of capp: %d\n", count);
4304 pkgmgrinfo_appinfo_filter_destroy(handle);
4309 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4310 const char *property, const char *value);
4313 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4314 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4316 * @par This API is for package-manager client application
4317 * @par Sync (or) Async : Synchronous API
4319 * @param[in] handle pointer to the application info filter handle.
4320 * @param[in] app_cb callback function.
4321 * @param[in] user_data user data to be passed to the callback function
4322 * @return 0 if success, error code(<0) if fail
4323 * @retval PMINFO_R_OK success
4324 * @retval PMINFO_R_EINVAL invalid argument
4325 * @retval PMINFO_R_ERROR internal error
4326 * @pre pkgmgrinfo_appinfo_filter_create()
4327 * @post pkgmgrinfo_appinfo_filter_destroy()
4328 * @see pkgmgrinfo_appinfo_filter_count()
4330 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4333 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4334 printf("appid : %s\n", appid);
4338 static int get_capp_list()
4341 pkgmgrinfo_appinfo_filter_h handle;
4342 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4343 if (ret != PMINFO_R_OK)
4345 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4346 if (ret != PMINFO_R_OK) {
4347 pkgmgrinfo_appinfo_filter_destroy(handle);
4350 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4351 if (ret != PMINFO_R_OK) {
4352 pkgmgrinfo_appinfo_filter_destroy(handle);
4355 pkgmgrinfo_appinfo_filter_destroy(handle);
4360 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4361 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4362 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4363 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4366 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4367 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4368 * @brief This API counts the application that satisfy the filter conditions
4370 * @par This API is for package-manager client application
4371 * @par Sync (or) Async : Synchronous API
4373 * @param[in] handle pointer to the application info filter handle.
4374 * @param[in] count pointer to store count value
4375 * @param[in] uid the addressee user id of the instruction
4376 * @return 0 if success, error code(<0) if fail
4377 * @retval PMINFO_R_OK success
4378 * @retval PMINFO_R_EINVAL invalid argument
4379 * @retval PMINFO_R_ERROR internal error
4380 * @pre pkgmgrinfo_appinfo_filter_create()
4381 * @post pkgmgrinfo_appinfo_filter_destroy()
4382 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4384 static int get_capp_count()
4388 pkgmgrinfo_appinfo_filter_h handle;
4389 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4390 if (ret != PMINFO_R_OK)
4392 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4393 if (ret != PMINFO_R_OK) {
4394 pkgmgrinfo_appinfo_filter_destroy(handle);
4397 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4398 if (ret != PMINFO_R_OK) {
4399 pkgmgrinfo_appinfo_filter_destroy(handle);
4402 printf("No of capp: %d\n", count);
4403 pkgmgrinfo_appinfo_filter_destroy(handle);
4408 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4409 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4411 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4412 * @brief This API creates the application's metadata information filter handle from db.
4414 * @par This API is for package-manager client application
4415 * @par Sync (or) Async : Synchronous API
4417 * @param[out] handle pointer to the application metadata info filter handle.
4418 * @return 0 if success, error code(<0) if fail
4419 * @retval PMINFO_R_OK success
4420 * @retval PMINFO_R_EINVAL invalid argument
4421 * @retval PMINFO_R_ERROR internal error
4423 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4424 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4426 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4429 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4430 printf("appid : %s\n", appid);
4434 static int get_app_list(const char *mkey, const char *mvalue)
4437 pkgmgrinfo_appinfo_metadata_filter_h handle;
4438 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4439 if (ret != PMINFO_R_OK)
4441 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4442 if (ret != PMINFO_R_OK) {
4443 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4446 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4447 if (ret != PMINFO_R_OK) {
4448 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4451 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4456 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4459 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4460 * @brief This API destroys the application's metadata information filter handle.
4462 * @par This API is for package-manager client application
4463 * @par Sync (or) Async : Synchronous API
4465 * @param[in] handle pointer to the application metadata info filter handle.
4466 * @return 0 if success, error code(<0) if fail
4467 * @retval PMINFO_R_OK success
4468 * @retval PMINFO_R_EINVAL invalid argument
4469 * @retval PMINFO_R_ERROR internal error
4470 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4472 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4474 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4477 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4478 printf("appid : %s\n", appid);
4482 static int get_app_list(const char *mkey, const char *mvalue)
4485 pkgmgrinfo_appinfo_metadata_filter_h handle;
4486 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4487 if (ret != PMINFO_R_OK)
4489 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4490 if (ret != PMINFO_R_OK) {
4491 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4494 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4495 if (ret != PMINFO_R_OK) {
4496 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4499 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4504 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4507 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4508 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4509 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4511 * @par This API is for package-manager client application
4512 * @par Sync (or) Async : Synchronous API
4514 * @param[in] handle pointer to the application metadata info filter handle.
4515 * @param[in] key pointer to metadata key
4516 * @param[in] value pointer to metadata value
4517 * @return 0 if success, error code(<0) if fail
4518 * @retval PMINFO_R_OK success
4519 * @retval PMINFO_R_EINVAL invalid argument
4520 * @retval PMINFO_R_ERROR internal error
4521 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4522 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
4523 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4525 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4528 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4529 printf("appid : %s\n", appid);
4533 static int get_app_list(const char *mkey, const char *mvalue)
4536 pkgmgrinfo_appinfo_metadata_filter_h handle;
4537 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4538 if (ret != PMINFO_R_OK)
4540 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4541 if (ret != PMINFO_R_OK) {
4542 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4545 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4546 if (ret != PMINFO_R_OK) {
4547 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4550 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4555 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
4556 const char *key, const char *value);
4559 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4560 * @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)
4561 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
4562 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
4563 * negative value, no more callbacks will be called and API will return.
4565 * @par This API is for package-manager client application
4566 * @par Sync (or) Async : Synchronous API
4568 * @param[in] handle pointer to the application metadata info filter handle.
4569 * @param[in] app_cb function pointer to callback
4570 * @param[in] user_data pointer to user data
4571 * @param[in] uid the addressee user id of the instruction
4572 * @return 0 if success, error code(<0) if fail
4573 * @retval PMINFO_R_OK success
4574 * @retval PMINFO_R_EINVAL invalid argument
4575 * @retval PMINFO_R_ERROR internal error
4576 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4577 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4579 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4582 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4583 printf("appid : %s\n", appid);
4587 static int get_app_list(const char *mkey, const char *mvalue)
4590 pkgmgrinfo_appinfo_metadata_filter_h handle;
4591 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4592 if (ret != PMINFO_R_OK)
4594 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4595 if (ret != PMINFO_R_OK) {
4596 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4599 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4600 if (ret != PMINFO_R_OK) {
4601 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4604 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4609 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4610 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4611 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
4612 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4614 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
4615 * @brief This API creates the package cert information handle to get data from db.
4617 * @par This API is for package-manager client application
4618 * @par Sync (or) Async : Synchronous API
4620 * @param[out] handle pointer to the package cert handle.
4621 * @return 0 if success, error code(<0) if fail
4622 * @retval PMINFO_R_OK success
4623 * @retval PMINFO_R_EINVAL invalid argument
4624 * @retval PMINFO_R_ERROR internal error
4626 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4627 * @see pkgmgrinfo_pkginfo_get_cert_value()
4628 * @see pkgmgrinfo_pkginfo_load_certinfo()
4630 static int get_cert_info(const char *pkgid)
4633 pkgmgrinfo_certinfo_h handle;
4634 char *auth_cert = NULL;
4635 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4636 if (ret != PMINFO_R_OK)
4638 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4639 if (ret != PMINFO_R_OK) {
4640 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4643 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4644 if (ret != PMINFO_R_OK) {
4645 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4648 printf("Author root certificate: %s\n", auth_root);
4649 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4654 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
4657 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
4658 * @brief This API loads the package cert information handle with data from db.
4660 * @par This API is for package-manager client application
4661 * @par Sync (or) Async : Synchronous API
4663 * @param[in] pkgid pointer to the package ID.
4664 * @param[in] handle pointer to the package cert handle.
4665 * @return 0 if success, error code(<0) if fail
4666 * @retval PMINFO_R_OK success
4667 * @retval PMINFO_R_EINVAL invalid argument
4668 * @retval PMINFO_R_ERROR internal error
4669 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4670 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4671 * @see pkgmgrinfo_pkginfo_get_cert_value()
4673 static int get_cert_info(const char *pkgid)
4676 pkgmgrinfo_certinfo_h handle;
4677 char *auth_cert = NULL;
4678 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4679 if (ret != PMINFO_R_OK)
4681 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4682 if (ret != PMINFO_R_OK) {
4683 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4686 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4687 if (ret != PMINFO_R_OK) {
4688 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4691 printf("Author root certificate: %s\n", auth_root);
4692 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4697 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
4700 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
4701 * @brief This API gets the package cert information from the handle
4703 * @par This API is for package-manager client application
4704 * @par Sync (or) Async : Synchronous API
4706 * @param[in] handle pointer to the package cert handle.
4707 * @param[in] cert_type certificate type
4708 * @param[out] cert_value pointer to hold certificate value
4709 * @return 0 if success, error code(<0) if fail
4710 * @retval PMINFO_R_OK success
4711 * @retval PMINFO_R_EINVAL invalid argument
4712 * @retval PMINFO_R_ERROR internal error
4713 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4714 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
4715 * @see pkgmgrinfo_pkginfo_load_certinfo()
4717 static int get_cert_info(const char *pkgid)
4720 pkgmgrinfo_certinfo_h handle;
4721 char *auth_cert = NULL;
4722 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4723 if (ret != PMINFO_R_OK)
4725 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4726 if (ret != PMINFO_R_OK) {
4727 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4730 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4731 if (ret != PMINFO_R_OK) {
4732 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4735 printf("Author root certificate: %s\n", auth_root);
4736 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4741 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
4744 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
4745 * @brief This API destroys the package cert information handle freeing up all the resources
4747 * @par This API is for package-manager client application
4748 * @par Sync (or) Async : Synchronous API
4750 * @param[in] handle pointer to the package cert handle.
4751 * @return 0 if success, error code(<0) if fail
4752 * @retval PMINFO_R_OK success
4753 * @retval PMINFO_R_EINVAL invalid argument
4754 * @retval PMINFO_R_ERROR internal error
4755 * @pre pkgmgrinfo_pkginfo_create_certinfo()
4757 * @see pkgmgrinfo_pkginfo_load_certinfo()
4759 static int get_cert_info(const char *pkgid)
4762 pkgmgrinfo_certinfo_h handle;
4763 char *auth_cert = NULL;
4764 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
4765 if (ret != PMINFO_R_OK)
4767 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
4768 if (ret != PMINFO_R_OK) {
4769 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4772 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
4773 if (ret != PMINFO_R_OK) {
4774 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4777 printf("Author root certificate: %s\n", auth_root);
4778 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
4783 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
4786 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
4787 * @brief This API deletes the package cert information from DB
4789 * @par This API is for package-manager client application
4790 * @par Sync (or) Async : Synchronous API
4792 * @param[in] pkgid pointer to the package ID.
4793 * @return 0 if success, error code(<0) if fail
4794 * @retval PMINFO_R_OK success
4795 * @retval PMINFO_R_EINVAL invalid argument
4796 * @retval PMINFO_R_ERROR internal error
4800 static int delete_cert_info(const char *pkgid)
4803 ret = pkgmgrinfo_delete_certinfo(pkgid);
4804 if (ret != PMINFO_R_OK)
4810 int pkgmgrinfo_delete_certinfo(const char *pkgid);
4811 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
4813 * @fn int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4814 * @fn int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle)
4815 * @brief This API creates the package db information handle to set data in db.
4817 * @par This API is for package-manager client application
4818 * @par Sync (or) Async : Synchronous API
4820 * @param[in] pkgid pointer to the package ID.
4821 * @param[in] uid the addressee user id of the instruction
4822 * @param[out] handle pointer to the package db info handle.
4823 * @return 0 if success, error code(<0) if fail
4824 * @retval PMINFO_R_OK success
4825 * @retval PMINFO_R_EINVAL invalid argument
4826 * @retval PMINFO_R_ERROR internal error
4828 * @post pkgmgrinfo_destroy_pkgdbinfo()
4829 * @see pkgmgrinfo_save_pkgdbinfo()
4830 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4832 static int set_pkg_in_db(const char *pkgid)
4835 pkgmgrinfo_pkgdbinfo_h handle;
4836 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4837 if (ret != PMINFO_R_OK)
4839 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4840 if (ret != PMINFO_R_OK) {
4841 pkgmgrinfo_destroy_pkgdbinfo(handle);
4844 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4845 if (ret != PMINFO_R_OK) {
4846 pkgmgrinfo_destroy_pkgdbinfo(handle);
4849 pkgmgrinfo_destroy_pkgdbinfo(handle);
4854 int pkgmgrinfo_create_pkgdbinfo(const char *pkgid, pkgmgrinfo_pkgdbinfo_h *handle);
4855 int pkgmgrinfo_create_pkgusrdbinfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkgdbinfo_h *handle);
4858 * @fn int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type)
4859 * @brief This API sets the package type in db handle
4861 * @par This API is for package-manager client application
4862 * @par Sync (or) Async : Synchronous API
4864 * @param[in] handle pointer to the pkgdbinfo handle.
4865 * @param[in] type pointer to the package type.
4866 * @return 0 if success, error code(<0) if fail
4867 * @retval PMINFO_R_OK success
4868 * @retval PMINFO_R_EINVAL invalid argument
4869 * @retval PMINFO_R_ERROR internal error
4870 * @pre pkgmgrinfo_create_pkgdbinfo()
4871 * @post pkgmgrinfo_destroy_pkgdbinfo()
4872 * @see pkgmgrinfo_save_pkgdbinfo()
4873 * @see pkgmgrinfo_set_version_to_pkgdbinfo()
4875 static int set_pkg_type_in_db(const char *pkgid)
4878 pkgmgrinfo_pkgdbinfo_h handle;
4879 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4880 if (ret != PMINFO_R_OK)
4882 ret = pkgmgrinfo_set_type_to_pkgdbinfo(handle, "wgt");
4883 if (ret != PMINFO_R_OK) {
4884 pkgmgrinfo_destroy_pkgdbinfo(handle);
4887 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4888 if (ret != PMINFO_R_OK) {
4889 pkgmgrinfo_destroy_pkgdbinfo(handle);
4892 pkgmgrinfo_destroy_pkgdbinfo(handle);
4897 int pkgmgrinfo_set_type_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *type);
4900 * @fn int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version)
4901 * @brief This API sets the package version in db handle
4903 * @par This API is for package-manager client application
4904 * @par Sync (or) Async : Synchronous API
4906 * @param[in] handle pointer to the pkgdbinfo handle.
4907 * @param[in] version pointer to the package version
4908 * @return 0 if success, error code(<0) if fail
4909 * @retval PMINFO_R_OK success
4910 * @retval PMINFO_R_EINVAL invalid argument
4911 * @retval PMINFO_R_ERROR internal error
4912 * @pre pkgmgrinfo_create_pkgdbinfo()
4913 * @post pkgmgrinfo_destroy_pkgdbinfo()
4914 * @see pkgmgrinfo_save_pkgdbinfo()
4915 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4917 static int set_pkg_version_in_db(const char *pkgid)
4920 pkgmgrinfo_pkgdbinfo_h handle;
4921 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4922 if (ret != PMINFO_R_OK)
4924 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
4925 if (ret != PMINFO_R_OK) {
4926 pkgmgrinfo_destroy_pkgdbinfo(handle);
4929 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4930 if (ret != PMINFO_R_OK) {
4931 pkgmgrinfo_destroy_pkgdbinfo(handle);
4934 pkgmgrinfo_destroy_pkgdbinfo(handle);
4939 int pkgmgrinfo_set_version_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *version);
4942 * @fn int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
4943 * @brief This API sets the package install location in db handle
4945 * @par This API is for package-manager client application
4946 * @par Sync (or) Async : Synchronous API
4948 * @param[in] handle pointer to the pkgdbinfo handle.
4949 * @param[in] location package install location
4950 * @return 0 if success, error code(<0) if fail
4951 * @retval PMINFO_R_OK success
4952 * @retval PMINFO_R_EINVAL invalid argument
4953 * @retval PMINFO_R_ERROR internal error
4954 * @pre pkgmgrinfo_create_pkgdbinfo()
4955 * @post pkgmgrinfo_destroy_pkgdbinfo()
4956 * @see pkgmgrinfo_save_pkgdbinfo()
4957 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
4959 static int set_pkg_install_location_in_db(const char *pkgid)
4962 pkgmgrinfo_pkgdbinfo_h handle;
4963 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
4964 if (ret != PMINFO_R_OK)
4966 ret = pkgmgrinfo_set_install_location_to_pkgdbinfo(handle, INSTALL_INTERNAL);
4967 if (ret != PMINFO_R_OK) {
4968 pkgmgrinfo_destroy_pkgdbinfo(handle);
4971 ret = pkgmgrinfo_save_pkgdbinfo(handle);
4972 if (ret != PMINFO_R_OK) {
4973 pkgmgrinfo_destroy_pkgdbinfo(handle);
4976 pkgmgrinfo_destroy_pkgdbinfo(handle);
4981 int pkgmgrinfo_set_install_location_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
4984 * @fn int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size)
4985 * @brief This API sets the package size in db handle
4987 * @par This API is for package-manager client application
4988 * @par Sync (or) Async : Synchronous API
4990 * @param[in] handle pointer to the pkgdbinfo handle.
4991 * @param[in] size pointer to the package size
4992 * @return 0 if success, error code(<0) if fail
4993 * @retval PMINFO_R_OK success
4994 * @retval PMINFO_R_EINVAL invalid argument
4995 * @retval PMINFO_R_ERROR internal error
4996 * @pre pkgmgrinfo_create_pkgdbinfo()
4997 * @post pkgmgrinfo_destroy_pkgdbinfo()
4998 * @see pkgmgrinfo_save_pkgdbinfo()
4999 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5001 static int set_pkg_size_in_db(const char *pkgid)
5004 pkgmgrinfo_pkgdbinfo_h handle;
5005 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5006 if (ret != PMINFO_R_OK)
5008 ret = pkgmgrinfo_set_size_to_pkgdbinfo(handle, "15");
5009 if (ret != PMINFO_R_OK) {
5010 pkgmgrinfo_destroy_pkgdbinfo(handle);
5013 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5014 if (ret != PMINFO_R_OK) {
5015 pkgmgrinfo_destroy_pkgdbinfo(handle);
5018 pkgmgrinfo_destroy_pkgdbinfo(handle);
5023 int pkgmgrinfo_set_size_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *size);
5026 * @fn int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale)
5027 * @brief This API sets the package label in db handle
5029 * @par This API is for package-manager client application
5030 * @par Sync (or) Async : Synchronous API
5032 * @param[in] handle pointer to the pkgdbinfo handle.
5033 * @param[in] label pointer to the package label
5034 * @param[in] locale pointer to the locale
5035 * @return 0 if success, error code(<0) if fail
5036 * @retval PMINFO_R_OK success
5037 * @retval PMINFO_R_EINVAL invalid argument
5038 * @retval PMINFO_R_ERROR internal error
5039 * @pre pkgmgrinfo_create_pkgdbinfo()
5040 * @post pkgmgrinfo_destroy_pkgdbinfo()
5041 * @see pkgmgrinfo_save_pkgdbinfo()
5042 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5044 static int set_pkg_label_in_db(const char *pkgid)
5047 pkgmgrinfo_pkgdbinfo_h handle;
5048 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5049 if (ret != PMINFO_R_OK)
5051 ret = pkgmgrinfo_set_label_to_pkgdbinfo(handle, "helloworld", "en-us");
5052 if (ret != PMINFO_R_OK) {
5053 pkgmgrinfo_destroy_pkgdbinfo(handle);
5056 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5057 if (ret != PMINFO_R_OK) {
5058 pkgmgrinfo_destroy_pkgdbinfo(handle);
5061 pkgmgrinfo_destroy_pkgdbinfo(handle);
5066 int pkgmgrinfo_set_label_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *label, const char *locale);
5069 * @fn int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale)
5070 * @brief This API sets the package icon in db handle
5072 * @par This API is for package-manager client application
5073 * @par Sync (or) Async : Synchronous API
5075 * @param[in] handle pointer to the pkgdbinfo handle.
5076 * @param[in] icon pointer to the package icon
5077 * @param[in] locale pointer to the locale
5078 * @return 0 if success, error code(<0) if fail
5079 * @retval PMINFO_R_OK success
5080 * @retval PMINFO_R_EINVAL invalid argument
5081 * @retval PMINFO_R_ERROR internal error
5082 * @pre pkgmgrinfo_create_pkgdbinfo()
5083 * @post pkgmgrinfo_destroy_pkgdbinfo()
5084 * @see pkgmgrinfo_save_pkgdbinfo()
5085 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5087 static int set_pkg_icon_in_db(const char *pkgid)
5090 pkgmgrinfo_pkgdbinfo_h handle;
5091 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5092 if (ret != PMINFO_R_OK)
5094 ret = pkgmgrinfo_set_icon_to_pkgdbinfo(handle, "helloworld.png", "en-us");
5095 if (ret != PMINFO_R_OK) {
5096 pkgmgrinfo_destroy_pkgdbinfo(handle);
5099 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5100 if (ret != PMINFO_R_OK) {
5101 pkgmgrinfo_destroy_pkgdbinfo(handle);
5104 pkgmgrinfo_destroy_pkgdbinfo(handle);
5109 int pkgmgrinfo_set_icon_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *icon, const char *locale);
5112 * @fn int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale)
5113 * @brief This API sets the package description in db handle
5115 * @par This API is for package-manager client application
5116 * @par Sync (or) Async : Synchronous API
5118 * @param[in] handle pointer to the pkgdbinfo handle.
5119 * @param[in] description pointer to the package description
5120 * @param[in] locale pointer to the locale
5121 * @return 0 if success, error code(<0) if fail
5122 * @retval PMINFO_R_OK success
5123 * @retval PMINFO_R_EINVAL invalid argument
5124 * @retval PMINFO_R_ERROR internal error
5125 * @pre pkgmgrinfo_create_pkgdbinfo()
5126 * @post pkgmgrinfo_destroy_pkgdbinfo()
5127 * @see pkgmgrinfo_save_pkgdbinfo()
5128 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5130 static int set_pkg_description_in_db(const char *pkgid)
5133 pkgmgrinfo_pkgdbinfo_h handle;
5134 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5135 if (ret != PMINFO_R_OK)
5137 ret = pkgmgrinfo_set_description_to_pkgdbinfo(handle, "helloworld application", "en-us");
5138 if (ret != PMINFO_R_OK) {
5139 pkgmgrinfo_destroy_pkgdbinfo(handle);
5142 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5143 if (ret != PMINFO_R_OK) {
5144 pkgmgrinfo_destroy_pkgdbinfo(handle);
5147 pkgmgrinfo_destroy_pkgdbinfo(handle);
5152 int pkgmgrinfo_set_description_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *description, const char *locale);
5155 * @fn int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5156 const char *author_email, const char *author_href, const char *locale)
5157 * @brief This API sets the package author info in db handle
5159 * @par This API is for package-manager client application
5160 * @par Sync (or) Async : Synchronous API
5162 * @param[in] handle pointer to the pkgdbinfo handle.
5163 * @param[in] author_name pointer to the package author name
5164 * @param[in] author_email pointer to the package author email
5165 * @param[in] author_href pointer to the package author href
5166 * @param[in] locale pointer to the locale
5167 * @return 0 if success, error code(<0) if fail
5168 * @retval PMINFO_R_OK success
5169 * @retval PMINFO_R_EINVAL invalid argument
5170 * @retval PMINFO_R_ERROR internal error
5171 * @pre pkgmgrinfo_create_pkgdbinfo()
5172 * @post pkgmgrinfo_destroy_pkgdbinfo()
5173 * @see pkgmgrinfo_save_pkgdbinfo()
5174 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5176 static int set_pkg_author_in_db(const char *pkgid)
5179 pkgmgrinfo_pkgdbinfo_h handle;
5180 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5181 if (ret != PMINFO_R_OK)
5183 ret = pkgmgrinfo_set_author_to_pkgdbinfo(handle, "John", "john@samsung.com", "www.samsung.com", "en-us");
5184 if (ret != PMINFO_R_OK) {
5185 pkgmgrinfo_destroy_pkgdbinfo(handle);
5188 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5189 if (ret != PMINFO_R_OK) {
5190 pkgmgrinfo_destroy_pkgdbinfo(handle);
5193 pkgmgrinfo_destroy_pkgdbinfo(handle);
5198 int pkgmgrinfo_set_author_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, const char *author_name,
5199 const char *author_email, const char *author_href, const char *locale);
5202 * @fn int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable)
5203 * @brief This API sets the package 'removable' value in db handle
5205 * @par This API is for package-manager client application
5206 * @par Sync (or) Async : Synchronous API
5208 * @param[in] handle pointer to the pkgdbinfo handle.
5209 * @param[in] removable package removable value
5210 * @return 0 if success, error code(<0) if fail
5211 * @retval PMINFO_R_OK success
5212 * @retval PMINFO_R_EINVAL invalid argument
5213 * @retval PMINFO_R_ERROR internal error
5214 * @pre pkgmgrinfo_create_pkgdbinfo()
5215 * @post pkgmgrinfo_destroy_pkgdbinfo()
5216 * @see pkgmgrinfo_save_pkgdbinfo()
5217 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5219 static int set_pkg_removable_in_db(const char *pkgid)
5222 pkgmgrinfo_pkgdbinfo_h handle;
5223 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5224 if (ret != PMINFO_R_OK)
5226 ret = pkgmgrinfo_set_removable_to_pkgdbinfo(handle, 1);
5227 if (ret != PMINFO_R_OK) {
5228 pkgmgrinfo_destroy_pkgdbinfo(handle);
5231 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5232 if (ret != PMINFO_R_OK) {
5233 pkgmgrinfo_destroy_pkgdbinfo(handle);
5236 pkgmgrinfo_destroy_pkgdbinfo(handle);
5241 int pkgmgrinfo_set_removable_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int removable);
5244 * @fn int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload)
5245 * @brief This API sets the package 'preload' value in db handle
5247 * @par This API is for package-manager client application
5248 * @par Sync (or) Async : Synchronous API
5250 * @param[in] handle pointer to the pkgdbinfo handle.
5251 * @param[in] preload package preload value
5252 * @return 0 if success, error code(<0) if fail
5253 * @retval PMINFO_R_OK success
5254 * @retval PMINFO_R_EINVAL invalid argument
5255 * @retval PMINFO_R_ERROR internal error
5256 * @pre pkgmgrinfo_create_pkgdbinfo()
5257 * @post pkgmgrinfo_destroy_pkgdbinfo()
5258 * @see pkgmgrinfo_save_pkgdbinfo()
5259 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5261 static int set_pkg_preload_in_db(const char *pkgid)
5264 pkgmgrinfo_pkgdbinfo_h handle;
5265 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5266 if (ret != PMINFO_R_OK)
5268 ret = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
5269 if (ret != PMINFO_R_OK) {
5270 pkgmgrinfo_destroy_pkgdbinfo(handle);
5273 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5274 if (ret != PMINFO_R_OK) {
5275 pkgmgrinfo_destroy_pkgdbinfo(handle);
5278 pkgmgrinfo_destroy_pkgdbinfo(handle);
5283 int pkgmgrinfo_set_preload_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, int preload);
5286 * @fn int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location)
5287 * @brief This API sets the package 'installed_storage' value in db handle
5289 * @par This API is for package-manager client application
5290 * @par Sync (or) Async : Synchronous API
5292 * @param[in] handle pointer to the pkgdbinfo handle.
5293 * @param[in] location installed_storage value
5294 * @return 0 if success, error code(<0) if fail
5295 * @retval PMINFO_R_OK success
5296 * @retval PMINFO_R_EINVAL invalid argument
5297 * @retval PMINFO_R_ERROR internal error
5298 * @pre pkgmgrinfo_create_pkgdbinfo()
5299 * @post pkgmgrinfo_destroy_pkgdbinfo()
5300 * @see pkgmgrinfo_save_pkgdbinfo()
5302 static int set_pkg_installed_storage_in_db(const char *pkgid)
5305 pkgmgrinfo_pkgdbinfo_h handle;
5306 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5307 if (ret != PMINFO_R_OK)
5309 ret = pkgmgrinfo_set_installed_storage_to_pkgdbinfo(handle, INSTALL_INTERNAL);
5310 if (ret != PMINFO_R_OK) {
5311 pkgmgrinfo_destroy_pkgdbinfo(handle);
5314 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5315 if (ret != PMINFO_R_OK) {
5316 pkgmgrinfo_destroy_pkgdbinfo(handle);
5319 pkgmgrinfo_destroy_pkgdbinfo(handle);
5324 int pkgmgrinfo_set_installed_storage_to_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle, INSTALL_LOCATION location);
5327 * @fn int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5328 * @fn int pkgmgrinfo_save_pkgdbusrinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid)
5329 * @brief This API saves all the information from the handle to the DB.
5331 * @par This API is for package-manager client application
5332 * @par Sync (or) Async : Synchronous API
5334 * @param[in] handle pointer to the package db info handle.
5335 * @param[in] uid the addressee user id of the instruction
5336 * @return 0 if success, error code(<0) if fail
5337 * @retval PMINFO_R_OK success
5338 * @retval PMINFO_R_EINVAL invalid argument
5339 * @retval PMINFO_R_ERROR internal error
5340 * @pre pkgmgrinfo_create_pkgdbinfo()
5341 * @post pkgmgrinfo_destroy_pkgdbinfo()
5342 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5344 static int set_pkg_in_db(const char *pkgid)
5347 pkgmgrinfo_pkgdbinfo_h handle;
5348 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5349 if (ret != PMINFO_R_OK)
5351 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5352 if (ret != PMINFO_R_OK) {
5353 pkgmgrinfo_destroy_pkgdbinfo(handle);
5356 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5357 if (ret != PMINFO_R_OK) {
5358 pkgmgrinfo_destroy_pkgdbinfo(handle);
5361 pkgmgrinfo_destroy_pkgdbinfo(handle);
5366 int pkgmgrinfo_save_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5367 int pkgmgrinfo_save_pkgusrdbinfo(pkgmgrinfo_pkgdbinfo_h handle, uid_t uid);
5369 * @fn int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle)
5370 * @brief This API destroys the package db information handle freeing up all the resources
5372 * @par This API is for package-manager client application
5373 * @par Sync (or) Async : Synchronous API
5375 * @param[in] handle pointer to the package db info handle.
5376 * @return 0 if success, error code(<0) if fail
5377 * @retval PMINFO_R_OK success
5378 * @retval PMINFO_R_EINVAL invalid argument
5379 * @retval PMINFO_R_ERROR internal error
5380 * @pre pkgmgrinfo_create_pkgdbinfo()
5382 * @see pkgmgrinfo_save_pkgdbinfo()
5383 * @see pkgmgrinfo_set_type_to_pkgdbinfo()
5385 static int set_pkg_in_db(const char *pkgid)
5388 pkgmgrinfo_pkgdbinfo_h handle;
5389 ret = pkgmgrinfo_create_pkgdbinfo(pkgid, &handle);
5390 if (ret != PMINFO_R_OK)
5392 ret = pkgmgrinfo_set_version_to_pkgdbinfo(handle, "0.0.1");
5393 if (ret != PMINFO_R_OK) {
5394 pkgmgrinfo_destroy_pkgdbinfo(handle);
5397 ret = pkgmgrinfo_save_pkgdbinfo(handle);
5398 if (ret != PMINFO_R_OK) {
5399 pkgmgrinfo_destroy_pkgdbinfo(handle);
5402 pkgmgrinfo_destroy_pkgdbinfo(handle);
5407 int pkgmgrinfo_destroy_pkgdbinfo(pkgmgrinfo_pkgdbinfo_h handle);
5411 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5412 * @brief This API creates the package cert information handle to set data in db.
5414 * @par This API is for package-manager client application
5415 * @par Sync (or) Async : Synchronous API
5417 * @param[out] handle pointer to the package cert handle.
5418 * @return 0 if success, error code(<0) if fail
5419 * @retval PMINFO_R_OK success
5420 * @retval PMINFO_R_EINVAL invalid argument
5421 * @retval PMINFO_R_ERROR internal error
5423 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5424 * @see pkgmgrinfo_set_cert_value()
5425 * @see pkgmgrinfo_save_certinfo()
5427 static int set_cert_in_db(const char *pkgid)
5430 pkgmgrinfo_instcertinfo_h handle;
5431 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5432 if (ret != PMINFO_R_OK)
5434 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5435 if (ret != PMINFO_R_OK) {
5436 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5439 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5440 if (ret != PMINFO_R_OK) {
5441 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5444 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5449 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5452 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5453 * @brief This API sets the package cert information in the handle.
5455 * @par This API is for package-manager client application
5456 * @par Sync (or) Async : Synchronous API
5458 * @param[in] handle pointer to the package cert handle.
5459 * @param[in] cert_type certificate type.
5460 * @param[in] cert_value certificate value.
5461 * @return 0 if success, error code(<0) if fail
5462 * @retval PMINFO_R_OK success
5463 * @retval PMINFO_R_EINVAL invalid argument
5464 * @retval PMINFO_R_ERROR internal error
5465 * @pre pkgmgrinfo_create_certinfo_set_handle()
5466 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5467 * @see pkgmgrinfo_save_certinfo()
5469 static int set_cert_in_db(const char *pkgid)
5472 pkgmgrinfo_instcertinfo_h handle;
5473 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5474 if (ret != PMINFO_R_OK)
5476 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5477 if (ret != PMINFO_R_OK) {
5478 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5481 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5482 if (ret != PMINFO_R_OK) {
5483 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5486 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5491 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5494 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5495 * @brief This API saves the package cert information in the DB.
5497 * @par This API is for package-manager client application
5498 * @par Sync (or) Async : Synchronous API
5500 * @param[in] pkgid pointer to the package ID.
5501 * @param[in] handle pointer to the package cert handle.
5502 * @return 0 if success, error code(<0) if fail
5503 * @retval PMINFO_R_OK success
5504 * @retval PMINFO_R_EINVAL invalid argument
5505 * @retval PMINFO_R_ERROR internal error
5506 * @pre pkgmgrinfo_create_certinfo_set_handle()
5507 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5508 * @see pkgmgrinfo_save_certinfo()
5510 static int set_cert_in_db(const char *pkgid)
5513 pkgmgrinfo_instcertinfo_h handle;
5514 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5515 if (ret != PMINFO_R_OK)
5517 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5518 if (ret != PMINFO_R_OK) {
5519 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5522 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5523 if (ret != PMINFO_R_OK) {
5524 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5527 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5532 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5535 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5536 * @brief This API destroys the package cert information handle freeing up all the resources.
5538 * @par This API is for package-manager client application
5539 * @par Sync (or) Async : Synchronous API
5541 * @param[in] handle pointer to the package cert handle.
5542 * @return 0 if success, error code(<0) if fail
5543 * @retval PMINFO_R_OK success
5544 * @retval PMINFO_R_EINVAL invalid argument
5545 * @retval PMINFO_R_ERROR internal error
5546 * @pre pkgmgrinfo_create_certinfo_set_handle()
5548 * @see pkgmgrinfo_save_certinfo()
5550 static int set_cert_in_db(const char *pkgid)
5553 pkgmgrinfo_instcertinfo_h handle;
5554 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5555 if (ret != PMINFO_R_OK)
5557 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5558 if (ret != PMINFO_R_OK) {
5559 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5562 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5563 if (ret != PMINFO_R_OK) {
5564 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5567 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5572 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5575 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5576 * @brief This API gets the datacontrol info
5578 * @par This API is for package-manager client application
5579 * @par Sync (or) Async : Synchronous API
5581 * @param[in] providerid pointer to the providerid of dataconltrol.
5582 * @param[in] type pointer to the type of dataconltrol.
5583 * @param[out] appid pointer to hold appid, need to free after using
5584 * @param[out] access pointer to hold access, need to free after using
5585 * @return 0 if success, error code(<0) if fail
5586 * @retval PMINFO_R_OK success
5587 * @retval PMINFO_R_EINVAL invalid argument
5588 * @retval PMINFO_R_ERROR internal error
5591 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5594 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5595 * @brief This API gets the application 'guest mode visibility' value from the DB
5597 * @par This API is for package-manager client application
5598 * @par Sync (or) Async : Synchronous API
5600 * @param[in] handle pointer to application info handle
5601 * @param[out] status pointer to hold app guest mode visibility value
5602 * @return 0 if success, error code(<0) if fail
5603 * @retval PMINFO_R_OK success
5604 * @retval PMINFO_R_EINVAL invalid argument
5605 * @retval PMINFO_R_ERROR internal error
5606 * @pre pkgmgrinfo_appinfo_get_appinfo()
5607 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5608 * @see pkgmgrinfo_appinfo_get_appid()
5609 * @see pkgmgrinfo_appinfo_is_multiple()
5611 static int get_app_guestmode_visibility(const char *appid)
5615 pkgmgrinfo_appinfo_h handle;
5616 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5617 if (ret != PMINFO_R_OK)
5619 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5620 if (ret != PMINFO_R_OK) {
5621 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5624 printf("app guest mode visibility: %d\n", status);
5625 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5630 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5633 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5634 * @brief This API sets the application 'guest mode visibility' value in the DB
5636 * @par This API is for package-manager client application
5637 * @par Sync (or) Async : Synchronous API
5639 * @param[in] handle pointer to application info handle
5640 * @param[out] status app guest mode visibility value
5641 * @return 0 if success, error code(<0) if fail
5642 * @retval PMINFO_R_OK success
5643 * @retval PMINFO_R_EINVAL invalid argument
5644 * @retval PMINFO_R_ERROR internal error
5645 * @pre pkgmgrinfo_appinfo_get_appinfo()
5646 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5647 * @see pkgmgrinfo_appinfo_get_appid()
5648 * @see pkgmgrinfo_appinfo_is_multiple()
5650 static int set_app_guestmode_visibility(const char *appid, bool value)
5653 pkgmgrinfo_appinfo_h handle;
5654 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5655 if (ret != PMINFO_R_OK)
5657 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5658 if (ret != PMINFO_R_OK) {
5659 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5667 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5668 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5671 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5672 * @brief This API sets the package 'installed_storage' value in db
5674 * @par This API is for package-manager client application
5675 * @par Sync (or) Async : Synchronous API
5677 * @param[in] pkgid pointer to the package ID.
5678 * @param[in] location package install location
5679 * @return 0 if success, error code(<0) if fail
5680 * @retval PMINFO_R_OK success
5681 * @retval PMINFO_R_EINVAL invalid argument
5682 * @retval PMINFO_R_ERROR internal error
5684 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5688 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5689 if (ret != PMINFO_R_OK) {
5696 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5697 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5700 * @pkgmgrinfo client API
5704 * @brief listening status type in pkgmgrinfo.
5706 #define PMINFO_CLIENT_STATUS_ALL 0x00
5707 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5708 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5709 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5710 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5711 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5712 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5715 * @brief This APIs provides pkgmgrinfo client listener
5717 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5718 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5719 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5720 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5721 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5725 * @pkgmgrinfo client API end
5733 #endif /* __PKG_INFO_H__ */