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 /** Integer property for filtering app disabled by user*/
144 #define PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER "PMINFO_APPINFO_PROP_APP_DISABLE_FOR_USER_VALUE"
146 /** Boolean property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
148 /** Boolean property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
150 /** Boolean property for filtering based on app info*/
151 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
152 /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
165 /** will be updated*/
166 /** string property for filtering based on pkg info*/
167 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
169 /* For multiuser support */
170 const char *getIconPath(uid_t uid, bool readonly);
171 const char *getUserPkgParserDBPath(void);
172 const char *getUserPkgParserDBPathUID(uid_t uid);
173 const char *getUserPkgCertDBPath(void);
174 const char *getUserPkgCertDBPathUID(uid_t uid);
175 const char *getUserManifestPath(uid_t uid, bool readonly);
178 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
179 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
180 * @brief This API gets list of installed packages
182 * @par This API is for package-manager client application
183 * @par Sync (or) Async : Synchronous API
184 * @param[in] pkg_list_cb iteration function for list
185 * @param[in] user_data user data to be passed to callback function
186 * @param[in] uid the addressee user id of the instruction
187 * @return 0 if success, error code(<0) if fail
188 * @retval PMINFO_R_OK success
189 * @retval PMINFO_R_EINVAL invalid argument
190 * @retval PMINFO_R_ERROR internal error
194 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
198 pkgid1 = (char *)user_data;
199 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
200 if (strcmp(pkgid1, pkgid2) == 0) {
207 static int list_pkgs()
210 char *name = "helloworld";
211 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
212 if (ret != PMINFO_R_OK) {
219 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
220 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
222 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
223 * @brief This API creates the package information handle from db
225 * @par This API is for package-manager client application
226 * @par Sync (or) Async : Synchronous API
228 * @param[in] pkgid pointer to package ID
229 * @param[in] uid the addressee user id of the instruction
230 * @param[out] handle pointer to the package info handle.
231 * @return 0 if success, error code(<0) if fail
232 * @retval PMINFO_R_OK success
233 * @retval PMINFO_R_EINVAL invalid argument
234 * @retval PMINFO_R_ERROR internal error
236 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
237 * @see pkgmgrinfo_pkginfo_get_pkgid()
238 * @see pkgmgrinfo_pkginfo_is_removable()
240 static int get_pkg_type(const char *pkgid)
244 pkgmgrinfo_pkginfo_h handle;
245 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
246 if (ret != PMINFO_R_OK)
248 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
249 if (ret != PMINFO_R_OK) {
250 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
253 printf("pkgtype: %s\n", type);
254 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
259 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
260 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
263 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
264 * @brief This API gets the package name from the package ID
266 * @par This API is for package-manager client application
267 * @par Sync (or) Async : Synchronous API
269 * @param[in] handle pointer to package info handle
270 * @param[out] pkg_name pointer to hold package name
271 * @return 0 if success, error code(<0) if fail
272 * @retval PMINFO_R_OK success
273 * @retval PMINFO_R_EINVAL invalid argument
274 * @retval PMINFO_R_ERROR internal error
275 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
276 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
277 * @see pkgmgrinfo_pkginfo_get_type()
278 * @see pkgmgrinfo_pkginfo_is_removable()
280 static int get_pkg_name(const char *pkgid)
283 char *pkgname = NULL;
284 pkgmgrinfo_pkginfo_h handle;
285 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
286 if (ret != PMINFO_R_OK)
288 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
289 if (ret != PMINFO_R_OK) {
290 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
293 printf("pkgname: %s\n", pkgname);
294 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
299 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
302 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
303 * @brief This API gets the package id from the package ID
305 * @par This API is for package-manager client application
306 * @par Sync (or) Async : Synchronous API
308 * @param[in] handle pointer to package info handle
309 * @param[out] pkgid pointer to hold package id
310 * @return 0 if success, error code(<0) if fail
311 * @retval PMINFO_R_OK success
312 * @retval PMINFO_R_EINVAL invalid argument
313 * @retval PMINFO_R_ERROR internal error
314 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
315 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
316 * @see pkgmgrinfo_pkginfo_get_type()
317 * @see pkgmgrinfo_pkginfo_is_removable()
319 static int get_pkgid(const char *pkgid)
323 pkgmgrinfo_pkginfo_h handle;
324 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
325 if (ret != PMINFO_R_OK)
327 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
328 if (ret != PMINFO_R_OK) {
329 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
332 printf("pkg id: %s\n", pkg_id);
333 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
338 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
341 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
342 * @brief This API gets the package type from the package ID
344 * @par This API is for package-manager client application
345 * @par Sync (or) Async : Synchronous API
347 * @param[in] handle pointer to package info handle
348 * @param[out] type pointer to hold package type
349 * @return 0 if success, error code(<0) if fail
350 * @retval PMINFO_R_OK success
351 * @retval PMINFO_R_EINVAL invalid argument
352 * @retval PMINFO_R_ERROR internal error
353 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
354 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
355 * @see pkgmgrinfo_pkginfo_get_pkgid()
356 * @see pkgmgrinfo_pkginfo_is_removable()
358 static int get_pkg_type(const char *pkgid)
362 pkgmgrinfo_pkginfo_h handle;
363 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
364 if (ret != PMINFO_R_OK)
366 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
367 if (ret != PMINFO_R_OK) {
368 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
371 printf("pkgtype: %s\n", type);
372 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
377 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
380 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
381 * @brief This API gets the package version from the package ID
383 * @par This API is for package-manager client application
384 * @par Sync (or) Async : Synchronous API
386 * @param[in] handle pointer to package info handle
387 * @param[out] version pointer to hold package version
388 * @return 0 if success, error code(<0) if fail
389 * @retval PMINFO_R_OK success
390 * @retval PMINFO_R_EINVAL invalid argument
391 * @retval PMINFO_R_ERROR internal error
392 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
393 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
394 * @see pkgmgrinfo_pkginfo_get_pkgid()
395 * @see pkgmgrinfo_pkginfo_is_removable()
397 static int get_pkg_version(const char *pkgid)
400 char *version = NULL;
401 pkgmgrinfo_pkginfo_h handle;
402 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
403 if (ret != PMINFO_R_OK)
405 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
406 if (ret != PMINFO_R_OK) {
407 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
410 printf("pkg version: %s\n", version);
411 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
416 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
419 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
420 * @brief This API gets the package api_version from the package ID
422 * @par This API is for package-manager client application
423 * @par Sync (or) Async : Synchronous API
425 * @param[in] handle pointer to package info handle
426 * @param[out] api_version pointer to hold package api_version
427 * @return 0 if success, error code(<0) if fail
428 * @retval PMINFO_R_OK success
429 * @retval PMINFO_R_EINVAL invalid argument
430 * @retval PMINFO_R_ERROR internal error
431 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
432 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
433 * @see pkgmgrinfo_pkginfo_get_pkgid()
434 * @see pkgmgrinfo_pkginfo_is_removable()
436 static int get_pkg_api_version(const char *pkgid)
439 char *api_version = NULL;
440 pkgmgrinfo_pkginfo_h handle = NULL;
441 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
442 if (ret != PMINFO_R_OK)
444 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
445 if (ret != PMINFO_R_OK) {
446 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
449 printf("pkg api_version: %s\n", api_version);
450 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
455 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
458 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
459 * @brief This API gets tep(tizen expansion package) file name associated with the package
461 * @par This API is for package-manager client application
462 * @par Sync (or) Async : Synchronous API
464 * @param[in] handle pointer to the pkginfo handle.
465 * @param[out] tep_name pointer to hold tep name
466 * @return 0 if success, error code(<0) if fail
467 * @retval PMINFO_R_OK success
468 * @retval PMINFO_R_EINVAL invalid argument
469 * @retval PMINFO_R_ERROR internal error
470 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
471 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
472 * @see pkgmgrinfo_pkginfo_get_pkgid()
474 static int get_tep_name(const char *pkgid)
477 char *tep_name = NULL;
478 pkgmgrinfo_pkginfo_h handle = NULL;
479 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
480 if (ret != PMINFO_R_OK)
482 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
483 if (ret != PMINFO_R_OK) {
484 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
487 printf("TEP name is: %s\n", tep_name);
488 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
493 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
496 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
497 * @brief This API gets package mount point path associated with the package
498 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
500 * @par This API is for package-manager client application
501 * @par Sync (or) Async : Synchronous API
503 * @param[in] handle pointer to the pkginfo handle.
504 * @param[out] zip_mount_file pointer to hold zip mount file
505 * @return 0 if success, error code(<0) if fail
506 * @retval PMINFO_R_OK success
507 * @retval PMINFO_R_EINVAL invalid argument
508 * @retval PMINFO_R_ERROR internal error
509 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
510 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
511 * @see pkgmgrinfo_pkginfo_get_pkgid()
513 static int get_zip_mount_file(const char *pkgid)
516 char *zip_mount_file = NULL;
517 pkgmgrinfo_pkginfo_h handle = NULL;
518 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
519 if (ret != PMINFO_R_OK)
521 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
522 if (ret != PMINFO_R_OK) {
523 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
526 if (zip_mount_file != NULL)
527 printf("Zip mount path is: %s\n", zip_mount_file);
528 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
533 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
536 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
537 * @brief This API gets the package install location from the package ID
539 * @par This API is for package-manager client application
540 * @par Sync (or) Async : Synchronous API
542 * @param[in] handle pointer to package info handle
543 * @param[out] location pointer to hold package install location
544 * @return 0 if success, error code(<0) if fail
545 * @retval PMINFO_R_OK success
546 * @retval PMINFO_R_EINVAL invalid argument
547 * @retval PMINFO_R_ERROR internal error
548 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
549 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
550 * @see pkgmgrinfo_pkginfo_get_pkgid()
551 * @see pkgmgrinfo_pkginfo_is_removable()
553 static int get_pkg_install_location(const char *pkgid)
556 pkgmgrinfo_install_location location;
557 pkgmgrinfo_pkginfo_h handle;
558 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
559 if (ret != PMINFO_R_OK)
561 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
562 if (ret != PMINFO_R_OK) {
563 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
566 printf("pkg install location: %d\n", location);
567 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
572 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
575 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
576 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
577 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
578 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
580 * @par This API is for package-manager client application
581 * @par Sync (or) Async : Synchronous API
583 * @param[in] handle pointer to package info handle
584 * @param[out] size pointer to hold package size
585 * @return 0 if success, error code(<0) if fail
586 * @retval PMINFO_R_OK success
587 * @retval PMINFO_R_EINVAL invalid argument
588 * @retval PMINFO_R_ERROR internal error
589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
591 * @see pkgmgrinfo_pkginfo_get_pkgid()
592 * @see pkgmgrinfo_pkginfo_is_removable()
594 static int get_pkg_size(const char *pkgid)
598 pkgmgrinfo_pkginfo_h handle;
599 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
600 if (ret != PMINFO_R_OK)
602 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
603 if (ret != PMINFO_R_OK) {
604 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
607 printf("pkgsize: %d\n", size);
608 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
613 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
616 * @fn int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size)
617 * @brief This API gets the installed package total size on the target.
619 * @par This API is for package-manager client application
620 * @par Sync (or) Async : Synchronous API
622 * @param[in] handle pointer to package info handle
623 * @param[out] size pointer to hold package total size
624 * @return 0 if success, error code(<0) if fail
625 * @retval PMINFO_R_OK success
626 * @retval PMINFO_R_EINVAL invalid argument
627 * @retval PMINFO_R_ERROR internal error
629 static int get_pkg_total_size(const char *pkgid)
633 pkgmgrinfo_pkginfo_h handle;
634 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
635 if (ret != PMINFO_R_OK)
637 ret = pkgmgrinfo_pkginfo_get_total_size(handle, &size);
638 if (ret != PMINFO_R_OK) {
639 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
642 printf("pkg total size: %d\n", size);
643 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
648 int pkgmgrinfo_pkginfo_get_total_size(pkgmgrinfo_pkginfo_h handle, int *size);
651 * @fn int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size)
652 * @brief This API gets the installed package data size on the target.
654 * @par This API is for package-manager client application
655 * @par Sync (or) Async : Synchronous API
657 * @param[in] handle pointer to package info handle
658 * @param[out] size pointer to hold package data size
659 * @return 0 if success, error code(<0) if fail
660 * @retval PMINFO_R_OK success
661 * @retval PMINFO_R_EINVAL invalid argument
662 * @retval PMINFO_R_ERROR internal error
664 static int get_pkg_data_size(const char *pkgid)
668 pkgmgrinfo_pkginfo_h handle;
669 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
670 if (ret != PMINFO_R_OK)
672 ret = pkgmgrinfo_pkginfo_get_data_size(handle, &size);
673 if (ret != PMINFO_R_OK) {
674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
677 printf("pkg data size: %d\n", size);
678 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
683 int pkgmgrinfo_pkginfo_get_data_size(pkgmgrinfo_pkginfo_h handle, int *size);
686 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
687 * @brief This API gets the package icon from the package ID
689 * @par This API is for package-manager client application
690 * @par Sync (or) Async : Synchronous API
692 * @param[in] handle pointer to package info handle
693 * @param[out] icon pointer to hold package icon
694 * @return 0 if success, error code(<0) if fail
695 * @retval PMINFO_R_OK success
696 * @retval PMINFO_R_EINVAL invalid argument
697 * @retval PMINFO_R_ERROR internal error
698 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
699 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
700 * @see pkgmgrinfo_pkginfo_get_pkgid()
701 * @see pkgmgrinfo_pkginfo_is_removable()
703 static int get_pkg_icon(const char *pkgid)
707 pkgmgrinfo_pkginfo_h handle;
708 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
709 if (ret != PMINFO_R_OK)
711 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
712 if (ret != PMINFO_R_OK) {
713 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
716 printf("pkg icon: %s\n", icon);
717 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
722 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
725 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
726 * @brief This API gets the package label from the package ID
728 * @par This API is for package-manager client application
729 * @par Sync (or) Async : Synchronous API
731 * @param[in] handle pointer to package info handle
732 * @param[out] label pointer to hold package label
733 * @return 0 if success, error code(<0) if fail
734 * @retval PMINFO_R_OK success
735 * @retval PMINFO_R_EINVAL invalid argument
736 * @retval PMINFO_R_ERROR internal error
737 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
738 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
739 * @see pkgmgrinfo_pkginfo_get_pkgid()
740 * @see pkgmgrinfo_pkginfo_is_removable()
742 static int get_pkg_label(const char *pkgid)
746 pkgmgrinfo_pkginfo_h handle;
747 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
748 if (ret != PMINFO_R_OK)
750 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
751 if (ret != PMINFO_R_OK) {
752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
755 printf("pkg label: %s\n", label);
756 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
761 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
764 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
765 * @brief This API gets the package description from the package ID
767 * @par This API is for package-manager client application
768 * @par Sync (or) Async : Synchronous API
770 * @param[in] handle pointer to package info handle
771 * @param[out] description pointer to hold package description
772 * @return 0 if success, error code(<0) if fail
773 * @retval PMINFO_R_OK success
774 * @retval PMINFO_R_EINVAL invalid argument
775 * @retval PMINFO_R_ERROR internal error
776 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
777 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
778 * @see pkgmgrinfo_pkginfo_get_pkgid()
779 * @see pkgmgrinfo_pkginfo_is_removable()
781 static int get_pkg_description(const char *pkgid)
784 char *description = NULL;
785 pkgmgrinfo_pkginfo_h handle;
786 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
787 if (ret != PMINFO_R_OK)
789 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
790 if (ret != PMINFO_R_OK) {
791 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
794 printf("pkg description: %s\n", description);
795 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
800 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
803 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
804 * @brief This API gets the package's author name from the package ID
806 * @par This API is for package-manager client application
807 * @par Sync (or) Async : Synchronous API
809 * @param[in] handle pointer to package info handle
810 * @param[out] author_name pointer to hold package author name
811 * @return 0 if success, error code(<0) if fail
812 * @retval PMINFO_R_OK success
813 * @retval PMINFO_R_EINVAL invalid argument
814 * @retval PMINFO_R_ERROR internal error
815 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
816 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
817 * @see pkgmgrinfo_pkginfo_get_pkgid()
818 * @see pkgmgrinfo_pkginfo_is_removable()
820 static int get_pkg_author_name(const char *pkgid)
823 char *author_name = NULL;
824 pkgmgrinfo_pkginfo_h handle;
825 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
826 if (ret != PMINFO_R_OK)
828 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
829 if (ret != PMINFO_R_OK) {
830 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
833 printf("pkg author name: %s\n", author_name);
834 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
839 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
842 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
843 * @brief This API gets the package's author email from the package ID
845 * @par This API is for package-manager client application
846 * @par Sync (or) Async : Synchronous API
848 * @param[in] handle pointer to package info handle
849 * @param[out] author_email pointer to hold package author email
850 * @return 0 if success, error code(<0) if fail
851 * @retval PMINFO_R_OK success
852 * @retval PMINFO_R_EINVAL invalid argument
853 * @retval PMINFO_R_ERROR internal error
854 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
855 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
856 * @see pkgmgrinfo_pkginfo_get_pkgid()
857 * @see pkgmgrinfo_pkginfo_is_removable()
859 static int get_pkg_author_email(const char *pkgid)
862 char *author_email = NULL;
863 pkgmgrinfo_pkginfo_h handle;
864 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
865 if (ret != PMINFO_R_OK)
867 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
868 if (ret != PMINFO_R_OK) {
869 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
872 printf("pkg author email: %s\n", author_email);
873 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
878 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
881 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
882 * @brief This API gets the package's author href from the package ID
884 * @par This API is for package-manager client application
885 * @par Sync (or) Async : Synchronous API
887 * @param[in] handle pointer to package info handle
888 * @param[out] author_href pointer to hold package author href
889 * @return 0 if success, error code(<0) if fail
890 * @retval PMINFO_R_OK success
891 * @retval PMINFO_R_EINVAL invalid argument
892 * @retval PMINFO_R_ERROR internal error
893 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
894 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
895 * @see pkgmgrinfo_pkginfo_get_pkgid()
896 * @see pkgmgrinfo_pkginfo_is_removable()
898 static int get_pkg_author_href(const char *pkgid)
901 char *author_href = NULL;
902 pkgmgrinfo_pkginfo_h handle;
903 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
904 if (ret != PMINFO_R_OK)
906 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
907 if (ret != PMINFO_R_OK) {
908 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
911 printf("pkg author href: %s\n", author_href);
912 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
917 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
920 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
921 * @brief This API gets the package installed storagae value from the package ID
923 * @par This API is for package-manager client application
924 * @par Sync (or) Async : Synchronous API
926 * @param[in] handle pointer to package info handle
927 * @param[out] storage pointer to hold package installed storage
928 * @return 0 if success, error code(<0) if fail
929 * @retval PMINFO_R_OK success
930 * @retval PMINFO_R_EINVAL invalid argument
931 * @retval PMINFO_R_ERROR internal error
932 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
933 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
934 * @see pkgmgrinfo_pkginfo_get_pkgid()
935 * @see pkgmgrinfo_pkginfo_is_removable()
937 static int get_pkg_installed_storage(const char *pkgid)
940 pkgmgrinfo_installed_storage storage;
941 pkgmgrinfo_pkginfo_h handle;
942 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
943 if (ret != PMINFO_R_OK)
945 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
946 if (ret != PMINFO_R_OK) {
947 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
950 printf("pkg installed storage: %d\n", storage);
951 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
956 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
959 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
960 * @brief This API gets the installed time of package from the package ID
962 * @par This API is for package-manager client application
963 * @par Sync (or) Async : Synchronous API
965 * @param[in] handle pointer to package info handle
966 * @param[out] installed_time pointer to hold installed time of package
967 * @return 0 if success, error code(<0) if fail
968 * @retval PMINFO_R_OK success
969 * @retval PMINFO_R_EINVAL invalid argument
970 * @retval PMINFO_R_ERROR internal error
971 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
972 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
973 * @see pkgmgrinfo_pkginfo_get_pkgid()
974 * @see pkgmgrinfo_pkginfo_is_removable()
976 static int get_pkg_installed_time(const char *pkgid)
979 int installed_time = 0;
980 pkgmgrinfo_pkginfo_h handle;
981 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
982 if (ret != PMINFO_R_OK)
984 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
985 if (ret != PMINFO_R_OK) {
986 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
989 printf("installed_time: %d\n", installed_time);
990 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
995 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
998 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
999 * @brief This API gets the launch mode of package from the package ID
1001 * @par This API is for package-manager client application
1002 * @par Sync (or) Async : Synchronous API
1004 * @param[in] handle pointer to package info handle
1005 * @param[out] mode pointer to hold launch mode of package
1006 * @return 0 if success, error code(<0) if fail
1007 * @retval PMINFO_R_OK success
1008 * @retval PMINFO_R_EINVAL invalid argument
1009 * @retval PMINFO_R_ERROR internal error
1010 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1011 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1012 * @see pkgmgrinfo_pkginfo_get_pkgid()
1013 * @see pkgmgrinfo_pkginfo_is_removable()
1015 static int get_pkg_launch_mode(const char *pkgid)
1018 char *launch_mode = NULL;
1019 pkgmgrinfo_pkginfo_h handle;
1020 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1021 if (ret != PMINFO_R_OK)
1023 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1024 if (ret != PMINFO_R_OK) {
1025 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1028 printf("launch mode: %s\n", mode);
1029 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1034 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1037 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1038 * @brief This API gets the store client id of package from the package ID
1040 * @par This API is for package-manager client application
1041 * @par Sync (or) Async : Synchronous API
1043 * @param[in] handle pointer to package info handle
1044 * @param[out] storeclientid pointer to hold store client id of package
1045 * @return 0 if success, error code(<0) if fail
1046 * @retval PMINFO_R_OK success
1047 * @retval PMINFO_R_EINVAL invalid argument
1048 * @retval PMINFO_R_ERROR internal error
1049 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1050 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1051 * @see pkgmgrinfo_pkginfo_get_pkgid()
1052 * @see pkgmgrinfo_pkginfo_is_removable()
1054 static int get_pkg_storeclientid(const char *pkgid)
1057 char *storeclientid = 0;
1058 pkgmgrinfo_pkginfo_h handle;
1059 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1060 if (ret != PMINFO_R_OK)
1062 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1063 if (ret != PMINFO_R_OK) {
1064 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1067 printf(store client id: %s\n", storeclientid);
1068 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1073 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1076 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1077 * @brief This API gets the main app id of package from the package ID
1079 * @par This API is for package-manager client application
1080 * @par Sync (or) Async : Synchronous API
1082 * @param[in] handle pointer to package info handle
1083 * @param[out] mainappid pointer to hold main app id of package
1084 * @return 0 if success, error code(<0) if fail
1085 * @retval PMINFO_R_OK success
1086 * @retval PMINFO_R_EINVAL invalid argument
1087 * @retval PMINFO_R_ERROR internal error
1088 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1089 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1090 * @see pkgmgrinfo_pkginfo_get_pkgid()
1091 * @see pkgmgrinfo_pkginfo_is_removable()
1093 static int get_pkg_mainappid(const char *pkgid)
1096 char *mainappid = 0;
1097 pkgmgrinfo_pkginfo_h handle;
1098 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1099 if (ret != PMINFO_R_OK)
1101 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1102 if (ret != PMINFO_R_OK) {
1103 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1106 printf(main app id: %s\n", mainappid);
1107 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1112 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1115 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1116 * @brief This API gets the url of package from the package ID
1118 * @par This API is for package-manager client application
1119 * @par Sync (or) Async : Synchronous API
1121 * @param[in] handle pointer to package info handle
1122 * @param[out] url pointer to hold url of package
1123 * @return 0 if success, error code(<0) if fail
1124 * @retval PMINFO_R_OK success
1125 * @retval PMINFO_R_EINVAL invalid argument
1126 * @retval PMINFO_R_ERROR internal error
1127 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1128 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1129 * @see pkgmgrinfo_pkginfo_get_pkgid()
1130 * @see pkgmgrinfo_pkginfo_is_removable()
1132 static int get_pkg_url(const char *pkgid)
1136 pkgmgrinfo_pkginfo_h handle;
1137 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1138 if (ret != PMINFO_R_OK)
1140 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1141 if (ret != PMINFO_R_OK) {
1142 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1145 printf("url : %s\n", url);
1146 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1151 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1154 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1155 * @brief This API gets the root path of package
1157 * @par Sync (or) Async : Synchronous API
1159 * @param[in] handle pointer to package info handle
1160 * @param[out] path pointer to hold root path of package
1161 * @return 0 if success, error code(<0) if fail
1162 * @retval PMINFO_R_OK success
1163 * @retval PMINFO_R_EINVAL invalid argument
1164 * @retval PMINFO_R_ERROR internal error
1166 static int get_root_path(const char *pkgid)
1170 pkgmgrinfo_pkginfo_h handle;
1171 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1172 if (ret != PMINFO_R_OK)
1175 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1176 if (ret != PMINFO_R_OK) {
1177 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1180 printf("path : %s\n", path);
1181 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1187 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1191 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1192 * @brief This API gets the csc path of package
1194 * @par Sync (or) Async : Synchronous API
1196 * @param[in] handle pointer to package info handle
1197 * @param[out] path pointer to hold csc path of package
1198 * @return 0 if success, error code(<0) if fail
1199 * @retval PMINFO_R_OK success
1200 * @retval PMINFO_R_EINVAL invalid argument
1201 * @retval PMINFO_R_ERROR internal error
1203 static int get_csc_path(const char *pkgid)
1207 pkgmgrinfo_pkginfo_h handle;
1208 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1209 if (ret != PMINFO_R_OK)
1212 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1213 if (ret != PMINFO_R_OK) {
1214 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1217 printf("path : %s\n", path);
1218 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1224 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1227 * @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)
1228 * @brief This API compare the cert information from given package id
1230 * @par This API is for package-manager client application
1231 * @par Sync (or) Async : Synchronous API
1233 * @param[in] lhs_package_id pointer to first package ID
1234 * @param[in] rhs_package_id pointer to second package ID
1235 * @param[out] compare_result pointer to the compare result.
1236 * @return 0 if success, error code(<0) if fail
1237 * @retval PMINFO_R_OK success
1238 * @retval PMINFO_R_EINVAL invalid argument
1239 * @retval PMINFO_R_ERROR internal error
1241 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1242 * @see pkgmgrinfo_pkginfo_get_pkgid()
1243 * @see pkgmgrinfo_pkginfo_is_removable()
1245 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1248 pkgmgrinfo_cert_compare_result_type_e result;
1250 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1251 if (ret != PMINFO_R_OK) {
1254 printf("result: %d\n", result);
1259 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);
1260 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);
1262 * @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)
1263 * @brief This API compare the cert information from given app id
1265 * @par This API is for package-manager client application
1266 * @par Sync (or) Async : Synchronous API
1268 * @param[in] lhs_app_id pointer to first app ID
1269 * @param[in] rhs_app_id pointer to second app ID
1270 * @param[out] compare_result pointer to the compare result.
1271 * @return 0 if success, error code(<0) if fail
1272 * @retval PMINFO_R_OK success
1273 * @retval PMINFO_R_EINVAL invalid argument
1274 * @retval PMINFO_R_ERROR internal error
1276 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1277 * @see pkgmgrinfo_pkginfo_get_pkgid()
1278 * @see pkgmgrinfo_pkginfo_is_removable()
1280 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1283 pkgmgrinfo_cert_compare_result_type_e result;
1285 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1286 if (ret != PMINFO_R_OK) {
1289 printf("result: %d\n", result);
1294 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);
1295 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);
1297 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1298 * @brief This API gets the package 'removable' value from the package ID
1300 * @par This API is for package-manager client application
1301 * @par Sync (or) Async : Synchronous API
1303 * @param[in] handle pointer to package info handle
1304 * @param[out] removable pointer to hold package removable value
1305 * @return 0 if success, error code(<0) if fail
1306 * @retval PMINFO_R_OK success
1307 * @retval PMINFO_R_EINVAL invalid argument
1308 * @retval PMINFO_R_ERROR internal error
1309 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1310 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1311 * @see pkgmgrinfo_pkginfo_get_pkgid()
1312 * @see pkgmgrinfo_pkginfo_is_readonly()
1314 static int get_pkg_removable(const char *pkgid)
1318 pkgmgrinfo_pkginfo_h handle;
1319 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1320 if (ret != PMINFO_R_OK)
1322 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1323 if (ret != PMINFO_R_OK) {
1324 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1327 printf("pkg removable: %d\n", removable);
1328 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1333 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1336 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1337 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1339 * @par This API is for package-manager client application
1340 * @par Sync (or) Async : Synchronous API
1342 * @param[in] handle pointer to package info handle
1343 * @param[out] movable pointer to hold package movable state
1344 * @return 0 if success, error code(<0) if fail
1345 * @retval PMINFO_R_OK success
1346 * @retval PMINFO_R_EINVAL invalid argument
1347 * @retval PMINFO_R_ERROR internal error
1348 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1349 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1350 * @see pkgmgrinfo_pkginfo_get_pkgid()
1352 static int get_pkg_movable(const char *pkgid)
1356 pkgmgrinfo_pkginfo_h handle;
1357 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1358 if (ret != PMINFO_R_OK)
1360 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1361 if (ret != PMINFO_R_OK) {
1362 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1365 printf("pkg movable: %d\n", movable);
1366 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1371 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1374 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1375 * @brief This API gets the package 'preload' value from the package ID
1377 * @par This API is for package-manager client application
1378 * @par Sync (or) Async : Synchronous API
1380 * @param[in] handle pointer to package info handle
1381 * @param[out] preload pointer to hold package preload value
1382 * @return 0 if success, error code(<0) if fail
1383 * @retval PMINFO_R_OK success
1384 * @retval PMINFO_R_EINVAL invalid argument
1385 * @retval PMINFO_R_ERROR internal error
1386 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1387 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1388 * @see pkgmgrinfo_pkginfo_get_pkgid()
1389 * @see pkgmgrinfo_pkginfo_is_readonly()
1391 static int get_pkg_preload(const char *pkgid)
1395 pkgmgrinfo_pkginfo_h handle;
1396 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1397 if (ret != PMINFO_R_OK)
1399 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1400 if (ret != PMINFO_R_OK) {
1401 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1404 printf("pkg preload: %d\n", preload);
1405 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1410 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1413 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1414 * @brief This API gets the value for given handle is system or not
1416 * @par This API is for package-manager client application
1417 * @par Sync (or) Async : Synchronous API
1419 * @param[in] handle pointer to package info handle
1420 * @param[out] system pointer to hold system is or not
1421 * @return 0 if success, error code(<0) if fail
1422 * @retval PMINFO_R_OK success
1423 * @retval PMINFO_R_EINVAL invalid argument
1424 * @retval PMINFO_R_ERROR internal error
1425 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1426 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1427 * @see pkgmgrinfo_pkginfo_get_pkgid()
1428 * @see pkgmgrinfo_pkginfo_is_readonly()
1430 static int get_pkg_system(const char *pkgid)
1433 bool system = false;
1434 pkgmgrinfo_pkginfo_h handle = NULL;
1435 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1436 if (ret != PMINFO_R_OK)
1438 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1439 if (ret != PMINFO_R_OK) {
1440 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1443 printf("pkg system: %d\n", system);
1444 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1449 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1452 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1453 * @brief This API gets the package 'readonly' value from the package ID
1455 * @par This API is for package-manager client application
1456 * @par Sync (or) Async : Synchronous API
1458 * @param[in] handle pointer to package info handle
1459 * @param[out] readonly pointer to hold package readonly value
1460 * @return 0 if success, error code(<0) if fail
1461 * @retval PMINFO_R_OK success
1462 * @retval PMINFO_R_EINVAL invalid argument
1463 * @retval PMINFO_R_ERROR internal error
1464 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1465 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1466 * @see pkgmgrinfo_pkginfo_get_pkgid()
1467 * @see pkgmgrinfo_pkginfo_is_removable()
1469 static int get_pkg_readonly(const char *pkgid)
1473 pkgmgrinfo_pkginfo_h handle;
1474 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1475 if (ret != PMINFO_R_OK)
1477 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1478 if (ret != PMINFO_R_OK) {
1479 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1482 printf("pkg readonly: %d\n", readonly);
1483 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1488 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1492 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1493 * @brief This API gets the package 'upate' value from the package ID
1495 * @par This API is for package-manager client application
1496 * @par Sync (or) Async : Synchronous API
1498 * @param[in] handle pointer to package info handle
1499 * @param[out] update pointer to hold package update value
1500 * @return 0 if success, error code(<0) if fail
1501 * @retval PMINFO_R_OK success
1502 * @retval PMINFO_R_EINVAL invalid argument
1503 * @retval PMINFO_R_ERROR internal error
1504 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1505 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1506 * @see pkgmgrinfo_pkginfo_get_pkgid()
1508 static int get_pkg_update(const char *pkgid)
1512 pkgmgrinfo_pkginfo_h handle;
1513 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1514 if (ret != PMINFO_R_OK)
1516 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1517 if (ret != PMINFO_R_OK) {
1518 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1521 printf("pkg update: %d\n", update);
1522 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1527 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1530 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1531 * @brief This API gets the package 'support_disable' value from the package ID
1533 * @par This API is for package-manager client application
1534 * @par Sync (or) Async : Synchronous API
1536 * @param[in] handle pointer to package info handle
1537 * @param[out] support_disable pointer to hold package support_disable value
1538 * @return 0 if success, error code(<0) if fail
1539 * @retval PMINFO_R_OK success
1540 * @retval PMINFO_R_EINVAL invalid argument
1541 * @retval PMINFO_R_ERROR internal error
1542 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1543 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1544 * @see pkgmgrinfo_pkginfo_get_pkgid()
1546 static int get_pkg_support_disable(const char *pkgid)
1549 bool support_disable;
1550 pkgmgrinfo_pkginfo_h handle = NULL;
1551 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1552 if (ret != PMINFO_R_OK)
1554 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
1555 if (ret != PMINFO_R_OK) {
1556 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1559 printf("pkg support_disable: %d\n", support_disable);
1560 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1565 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
1568 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
1569 * @brief This API gets whethere the given package is global package or user package
1571 * @par This API is for package-manager client application
1572 * @par Sync (or) Async : Synchronous API
1574 * @param[in] handle pointer to package info handle
1575 * @param[in] global pointer to hold package global value
1576 * @return 0 if success, error code(<0) if fail
1577 * @retval PMINFO_R_OK success
1578 * @retval PMINFO_R_EINVAL invalid argument
1579 * @retval PMINFO_R_ERROR internal error
1580 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1581 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1582 * @see pkgmgrinfo_pkginfo_get_pkgid()
1583 static int get_pkg_support_disable(const char *pkgid)
1587 pkgmgrinfo_pkginfo_h handle = NULL;
1588 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1589 if (ret != PMINFO_R_OK)
1591 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
1592 if (ret != PMINFO_R_OK) {
1593 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1596 printf("pkg is_global: %d\n", global);
1597 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1602 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
1605 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
1606 * @brief This API gets the package 'accessible' value from the package ID
1608 * @par This API is for package-manager client application
1609 * @par Sync (or) Async : Synchronous API
1611 * @param[in] handle pointer to package info handle
1612 * @param[out] accessible pointer to hold package accessible value
1613 * @return 0 if success, error code(<0) if fail
1614 * @retval PMINFO_R_OK success
1615 * @retval PMINFO_R_EINVAL invalid argument
1616 * @retval PMINFO_R_ERROR internal error
1617 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1618 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1619 * @see pkgmgrinfo_pkginfo_get_pkgid()
1620 * @see pkgmgrinfo_pkginfo_is_readonly()
1622 static int get_pkg_accessible(const char *pkgid)
1626 pkgmgrinfo_pkginfo_h handle;
1627 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1628 if (ret != PMINFO_R_OK)
1630 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
1631 if (ret != PMINFO_R_OK) {
1632 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1635 printf("pkg accessible: %d\n", accessible);
1636 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1641 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
1644 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
1645 * @brief This API destroys the package information handle freeing up all the resources
1647 * @par This API is for package-manager client application
1648 * @par Sync (or) Async : Synchronous API
1650 * @param[in] handle pointer to the package info handle
1651 * @return 0 if success, error code(<0) if fail
1652 * @retval PMINFO_R_OK success
1653 * @retval PMINFO_R_EINVAL invalid argument
1654 * @retval PMINFO_R_ERROR internal error
1655 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1657 * @see pkgmgrinfo_pkginfo_get_pkgid()
1658 * @see pkgmgrinfo_pkginfo_is_removable()
1660 static int get_pkg_type(const char *pkgid)
1664 pkgmgrinfo_pkginfo_h handle;
1665 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1666 if (ret != PMINFO_R_OK)
1668 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
1669 if (ret != PMINFO_R_OK) {
1670 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1673 printf("pkgtype: %s\n", type);
1674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
1682 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
1683 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
1684 The query will search the entire package information collected from the manifest file of all the installed packages
1686 * @par This API is for package-manager client application
1687 * @par Sync (or) Async : Synchronous API
1689 * @param[out] handle pointer to the package info filter handle.
1690 * @return 0 if success, error code(<0) if fail
1691 * @retval PMINFO_R_OK success
1692 * @retval PMINFO_R_EINVAL invalid argument
1693 * @retval PMINFO_R_ERROR internal error
1695 * @post pkgmgrinfo_pkginfo_filter_destroy()
1696 * @see pkgmgrinfo_pkginfo_filter_count()
1697 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1699 static int get_tpk_pkg_count()
1703 pkgmgrinfo_pkginfo_filter_h handle;
1704 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1705 if (ret != PMINFO_R_OK)
1707 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1708 if (ret != PMINFO_R_OK) {
1709 pkgmgrinfo_pkginfo_filter_destroy(handle);
1712 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1713 if (ret != PMINFO_R_OK) {
1714 pkgmgrinfo_pkginfo_filter_destroy(handle);
1717 printf("No of tpk pkgs: %d\n", count);
1718 pkgmgrinfo_pkginfo_filter_destroy(handle);
1723 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
1726 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
1727 * @brief This API destroys the package information filter handle freeing up all the resources
1729 * @par This API is for package-manager client application
1730 * @par Sync (or) Async : Synchronous API
1732 * @param[in] handle pointer to the package info filter handle.
1733 * @return 0 if success, error code(<0) if fail
1734 * @retval PMINFO_R_OK success
1735 * @retval PMINFO_R_EINVAL invalid argument
1736 * @retval PMINFO_R_ERROR internal error
1737 * @pre pkgmgrinfo_pkginfo_filter_create()
1739 * @see pkgmgrinfo_pkginfo_filter_count()
1740 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1742 static int get_tpk_pkg_count()
1746 pkgmgrinfo_pkginfo_filter_h handle;
1747 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1748 if (ret != PMINFO_R_OK)
1750 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1751 if (ret != PMINFO_R_OK) {
1752 pkgmgrinfo_pkginfo_filter_destroy(handle);
1755 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1756 if (ret != PMINFO_R_OK) {
1757 pkgmgrinfo_pkginfo_filter_destroy(handle);
1760 printf("No of tpk pkgs: %d\n", count);
1761 pkgmgrinfo_pkginfo_filter_destroy(handle);
1766 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
1769 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
1770 * @brief This API adds a boolean filter property to the filter handle
1772 * @par This API is for package-manager client application
1773 * @par Sync (or) Async : Synchronous API
1775 * @param[in] handle pointer to the package info filter handle.
1776 * @param[in] property boolean property name.
1777 * @param[in] value value corresponding to the property.
1778 * @return 0 if success, error code(<0) if fail
1779 * @retval PMINFO_R_OK success
1780 * @retval PMINFO_R_EINVAL invalid argument
1781 * @retval PMINFO_R_ERROR internal error
1782 * @pre pkgmgrinfo_pkginfo_filter_create()
1783 * @post pkgmgrinfo_pkginfo_filter_destroy()
1784 * @see pkgmgrinfo_pkginfo_filter_count()
1785 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1787 static int get_preload_pkg_count()
1791 pkgmgrinfo_pkginfo_filter_h handle;
1792 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1793 if (ret != PMINFO_R_OK)
1795 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
1796 if (ret != PMINFO_R_OK) {
1797 pkgmgrinfo_pkginfo_filter_destroy(handle);
1800 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1801 if (ret != PMINFO_R_OK) {
1802 pkgmgrinfo_pkginfo_filter_destroy(handle);
1805 printf("No of preload pkgs: %d\n", count);
1806 pkgmgrinfo_pkginfo_filter_destroy(handle);
1811 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
1812 const char *property, const bool value);
1815 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
1816 * @brief This API adds an integer filter property to the filter handle
1818 * @par This API is for package-manager client application
1819 * @par Sync (or) Async : Synchronous API
1821 * @param[in] handle pointer to the package info filter handle.
1822 * @param[in] property integer property name.
1823 * @param[in] value value corresponding to the property.
1824 * @return 0 if success, error code(<0) if fail
1825 * @retval PMINFO_R_OK success
1826 * @retval PMINFO_R_EINVAL invalid argument
1827 * @retval PMINFO_R_ERROR internal error
1828 * @pre pkgmgrinfo_pkginfo_filter_create()
1829 * @post pkgmgrinfo_pkginfo_filter_destroy()
1830 * @see pkgmgrinfo_pkginfo_filter_count()
1831 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1833 static int get_pkg_count()
1837 pkgmgrinfo_pkginfo_filter_h handle;
1838 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1839 if (ret != PMINFO_R_OK)
1841 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
1842 if (ret != PMINFO_R_OK) {
1843 pkgmgrinfo_pkginfo_filter_destroy(handle);
1846 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1847 if (ret != PMINFO_R_OK) {
1848 pkgmgrinfo_pkginfo_filter_destroy(handle);
1851 printf("No of preload pkgs: %d\n", count);
1852 pkgmgrinfo_pkginfo_filter_destroy(handle);
1857 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
1858 const char *property, const int value);
1861 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
1862 * @brief This API adds a string filter property to the filter handle
1864 * @par This API is for package-manager client application
1865 * @par Sync (or) Async : Synchronous API
1867 * @param[in] handle pointer to the package info filter handle.
1868 * @param[in] property string property name.
1869 * @param[in] value value corresponding to the property.
1870 * @return 0 if success, error code(<0) if fail
1871 * @retval PMINFO_R_OK success
1872 * @retval PMINFO_R_EINVAL invalid argument
1873 * @retval PMINFO_R_ERROR internal error
1874 * @pre pkgmgrinfo_pkginfo_filter_create()
1875 * @post pkgmgrinfo_pkginfo_filter_destroy()
1876 * @see pkgmgrinfo_pkginfo_filter_count()
1877 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1879 static int get_tpk_pkg_count()
1883 pkgmgrinfo_pkginfo_filter_h handle;
1884 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1885 if (ret != PMINFO_R_OK)
1887 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1888 if (ret != PMINFO_R_OK) {
1889 pkgmgrinfo_pkginfo_filter_destroy(handle);
1892 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_filter_destroy(handle);
1897 printf("No of tpk pkgs: %d\n", count);
1898 pkgmgrinfo_pkginfo_filter_destroy(handle);
1903 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
1904 const char *property, const char *value);
1907 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
1908 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
1910 * @par This API is for package-manager client application
1911 * @par Sync (or) Async : Synchronous API
1913 * @param[in] handle pointer to the package info filter handle.
1914 * @param[in] pkg_cb callback function.
1915 * @param[in] user_data user data to be passed to the callback function
1916 * @return 0 if success, error code(<0) if fail
1917 * @retval PMINFO_R_OK success
1918 * @retval PMINFO_R_EINVAL invalid argument
1919 * @retval PMINFO_R_ERROR internal error
1920 * @pre pkgmgrinfo_pkginfo_filter_create()
1921 * @post pkgmgrinfo_pkginfo_filter_destroy()
1922 * @see pkgmgrinfo_pkginfo_filter_count()
1924 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
1927 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
1928 printf("pkg id : %s\n", pkgid);
1932 static int get_tpk_pkg_list()
1935 pkgmgrinfo_pkginfo_filter_h handle;
1936 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1937 if (ret != PMINFO_R_OK)
1939 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1940 if (ret != PMINFO_R_OK) {
1941 pkgmgrinfo_pkginfo_filter_destroy(handle);
1944 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
1945 if (ret != PMINFO_R_OK) {
1946 pkgmgrinfo_pkginfo_filter_destroy(handle);
1949 pkgmgrinfo_pkginfo_filter_destroy(handle);
1954 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1955 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
1956 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
1957 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
1960 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
1961 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
1962 * @brief This API counts the package that satisfy the filter conditions
1964 * @par This API is for package-manager client application
1965 * @par Sync (or) Async : Synchronous API
1967 * @param[in] handle pointer to the package info filter handle.
1968 * @param[in] count pointer to store the count value.
1969 * @param[in] uid the addressee user id of the instruction
1970 * @return 0 if success, error code(<0) if fail
1971 * @retval PMINFO_R_OK success
1972 * @retval PMINFO_R_EINVAL invalid argument
1973 * @retval PMINFO_R_ERROR internal error
1974 * @pre pkgmgrinfo_pkginfo_filter_create()
1975 * @post pkgmgrinfo_pkginfo_filter_destroy()
1976 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
1978 static int get_tpk_pkg_count()
1982 pkgmgrinfo_pkginfo_filter_h handle;
1983 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
1984 if (ret != PMINFO_R_OK)
1986 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
1987 if (ret != PMINFO_R_OK) {
1988 pkgmgrinfo_pkginfo_filter_destroy(handle);
1991 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
1992 if (ret != PMINFO_R_OK) {
1993 pkgmgrinfo_pkginfo_filter_destroy(handle);
1996 printf("No of tpk pkgs: %d\n", count);
1997 pkgmgrinfo_pkginfo_filter_destroy(handle);
2002 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2003 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2005 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2006 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2007 * @brief This API gets the list of privilege for a particular package
2009 * @par This API is for package-manager client application
2010 * @par Sync (or) Async : Synchronous API
2011 * @param[in] handle pointer to the package info handle.
2012 * @param[in] privilege_func callback function for list
2013 * @param[in] user_data user data to be passed to callback function
2014 * @return 0 if success, error code(<0) if fail
2015 * @retval PMINFO_R_OK success
2016 * @retval PMINFO_R_EINVAL invalid argument
2017 * @retval PMINFO_R_ERROR internal error
2018 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2019 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2021 int privilege_func(const char *name, void *user_data)
2023 if (strcmp(name, (char *)user_data) == 0)
2029 static int list_privilege(const char *package, char *privilege)
2032 pkgmgrinfo_pkginfo_h handle;
2033 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2034 if (ret != PMINFO_R_OK)
2036 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2037 if (ret != PMINFO_R_OK) {
2038 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2041 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2046 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2047 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2049 /* TODO: add doxygen comment here */
2050 int pkgmgrinfo_pkginfo_get_size_from_xml(const char *manifest, int *size);
2051 int pkgmgrinfo_pkginfo_get_location_from_xml(const char *manifest, pkgmgrinfo_install_location *location);
2052 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2053 int pkgmgrinfo_appinfo_set_state_enabled(const char *appid, bool enabled);
2054 int pkgmgrinfo_appinfo_set_usr_state_enabled(const char *appid, bool enabled, uid_t uid);
2055 int pkgmgrinfo_appinfo_set_default_label(const char *appid, const char *label);
2056 int pkgmgrinfo_appinfo_set_usr_default_label(const char *appid, const char *label, uid_t uid);
2059 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2060 * @brief This API copy the application information handle
2062 * @par This API is for package-manager client application
2063 * @par Sync (or) Async : Synchronous API
2065 * @param[in] handle pointer to the package info handle.
2066 * @param[out] handle pointer to the package info handle.
2067 * @return 0 if success, error code(<0) if fail
2068 * @retval PMINFO_R_OK success
2069 * @retval PMINFO_R_EINVAL invalid argument
2070 * @retval PMINFO_R_ERROR internal error
2072 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2074 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2078 pkgmgrinfo_pkginfo_h clone;
2080 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2081 if (ret != PMINFO_R_OK)
2085 printf("package: %s\n", clone->package);
2086 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2091 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2095 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2096 pkgmgrinfo_app_list_cb app_func, void *user_data)
2097 * @brief This API gets list of installed applications for a particular package
2099 * @par This API is for package-manager client application
2100 * @par Sync (or) Async : Synchronous API
2101 * @param[in] handle package info handle
2102 * @param[in] component application component
2103 * @param[in] app_func iteration function for list
2104 * @param[in] user_data user data to be passed to callback function
2105 * @return 0 if success, error code(<0) if fail
2106 * @retval PMINFO_R_OK success
2107 * @retval PMINFO_R_EINVAL invalid argument
2108 * @retval PMINFO_R_ERROR internal error
2109 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2110 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2112 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2115 pkgmgrinfo_appinfo_get_appid(handle, &appid);
2116 printf("appid : %s\n", appid);
2120 static int list_apps(const char *pkgid)
2123 pkgmgrinfo_pkginfo_h handle;
2124 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2125 if (ret != PMINFO_R_OK)
2127 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2128 if (ret != PMINFO_R_OK) {
2129 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2132 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2137 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2138 pkgmgrinfo_app_list_cb app_func, void *user_data);
2139 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2140 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2143 * @fn int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2144 * @brief This API gets list of installed applications from all packages with minimum informaion.
2146 * @par This API is for package-manager client application
2147 * @par Sync (or) Async : Synchronous API
2148 * @param[in] app_func iteration function for list
2149 * @param[in] user_data user data to be passed to callback function
2150 * @return 0 if success, error code(<0) if fail
2151 * @retval PMINFO_R_OK success
2152 * @retval PMINFO_R_EINVAL invalid argument
2153 * @retval PMINFO_R_ERROR internal error
2157 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2159 char *pkgid1 = NULL;
2160 char *pkgid2 = NULL;
2161 pkgid1 = (char *)user_data;
2162 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2163 if (strcmp(pkgid1, pkgid2) == 0) {
2170 static int list_apps()
2173 char *name = "helloworld";
2174 ret = pkgmgrinfo_appinfo_get_applist_for_amd(app_list_cb, (void *)name);
2175 if (ret != PMINFO_R_OK) {
2182 int pkgmgrinfo_appinfo_get_usr_applist_for_amd(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2183 int pkgmgrinfo_appinfo_get_applist_for_amd(pkgmgrinfo_app_list_cb app_func, void *user_data);
2186 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2187 * @brief This API gets list of installed applications from all packages.
2189 * @par This API is for package-manager client application
2190 * @par Sync (or) Async : Synchronous API
2191 * @param[in] app_func iteration function for list
2192 * @param[in] user_data user data to be passed to callback function
2193 * @return 0 if success, error code(<0) if fail
2194 * @retval PMINFO_R_OK success
2195 * @retval PMINFO_R_EINVAL invalid argument
2196 * @retval PMINFO_R_ERROR internal error
2200 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2202 char *pkgid1 = NULL;
2203 char *pkgid2 = NULL;
2204 pkgid1 = (char *)user_data;
2205 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2206 if (strcmp(pkgid1, pkgid2) == 0) {
2213 static int list_apps()
2216 char *name = "helloworld";
2217 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2218 if (ret != PMINFO_R_OK) {
2225 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2226 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2229 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2230 * @brief This API creates the disabled application information handle from db
2232 * @par This API is for package-manager client application
2233 * @par Sync (or) Async : Synchronous API
2235 * @param[in] appid pointer to appid
2236 * @param[out] handle pointer to the application info handle.
2237 * @return 0 if success, error code(<0) if fail
2238 * @retval PMINFO_R_OK success
2239 * @retval PMINFO_R_EINVAL invalid argument
2240 * @retval PMINFO_R_ERROR internal error
2242 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2243 * @see pkgmgrinfo_appinfo_get_pkgid()
2244 * @see pkgmgrinfo_appinfo_is_multiple()
2246 static int get_disabled_app_type(const char *appid)
2250 pkgmgrinfo_appinfo_h handle;
2251 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2252 if (ret != PMINFO_R_OK)
2254 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2255 if (ret != PMINFO_R_OK) {
2256 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2259 printf("apptype: %s\n", type);
2260 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2265 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2266 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2269 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2270 * @brief This API creates the application information handle from db
2272 * @par This API is for package-manager client application
2273 * @par Sync (or) Async : Synchronous API
2275 * @param[in] appid pointer to appid
2276 * @param[out] handle pointer to the application info handle.
2277 * @return 0 if success, error code(<0) if fail
2278 * @retval PMINFO_R_OK success
2279 * @retval PMINFO_R_EINVAL invalid argument
2280 * @retval PMINFO_R_ERROR internal error
2282 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2283 * @see pkgmgrinfo_appinfo_get_pkgid()
2284 * @see pkgmgrinfo_appinfo_is_multiple()
2286 static int get_app_type(const char *appid)
2290 pkgmgrinfo_appinfo_h handle;
2291 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2292 if (ret != PMINFO_R_OK)
2294 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2295 if (ret != PMINFO_R_OK) {
2296 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2299 printf("apptype: %s\n", type);
2300 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2305 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2306 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2309 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2310 * @brief This API gets the application ID
2312 * @par This API is for package-manager client application
2313 * @par Sync (or) Async : Synchronous API
2315 * @param[in] handle pointer to the application info handle.
2316 * @param[out] appid pointer to hold appid
2317 * @return 0 if success, error code(<0) if fail
2318 * @retval PMINFO_R_OK success
2319 * @retval PMINFO_R_EINVAL invalid argument
2320 * @retval PMINFO_R_ERROR internal error
2321 * @pre pkgmgrinfo_appinfo_get_appinfo()
2322 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2323 * @see pkgmgrinfo_appinfo_get_pkgid()
2324 * @see pkgmgrinfo_appinfo_is_multiple()
2326 static int get_app_id(const char *appid)
2329 char *app_id = NULL;
2330 pkgmgrinfo_appinfo_h handle;
2331 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2332 if (ret != PMINFO_R_OK)
2334 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2335 if (ret != PMINFO_R_OK) {
2336 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2339 printf("app id: %s\n", app_id);
2340 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2345 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
2348 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2349 * @brief This API gets the package name of the application
2351 * @par This API is for package-manager client application
2352 * @par Sync (or) Async : Synchronous API
2354 * @param[in] handle pointer to the application info handle.
2355 * @param[out] pkg_name pointer to hold package name
2356 * @return 0 if success, error code(<0) if fail
2357 * @retval PMINFO_R_OK success
2358 * @retval PMINFO_R_EINVAL invalid argument
2359 * @retval PMINFO_R_ERROR internal error
2360 * @pre pkgmgrinfo_appinfo_get_appinfo()
2361 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2362 * @see pkgmgrinfo_appinfo_get_appid()
2363 * @see pkgmgrinfo_appinfo_is_multiple()
2365 static int get_app_pkgname(const char *appid)
2368 char *pkgname = NULL;
2369 pkgmgrinfo_appinfo_h handle;
2370 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2371 if (ret != PMINFO_R_OK)
2373 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2374 if (ret != PMINFO_R_OK) {
2375 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2378 printf("pkg name: %s\n", pkgname);
2379 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2384 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
2387 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2388 * @brief This API gets the package id of the application
2390 * @par This API is for package-manager client application
2391 * @par Sync (or) Async : Synchronous API
2393 * @param[in] handle pointer to the application info handle.
2394 * @param[out] pkgid pointer to hold package id
2395 * @return 0 if success, error code(<0) if fail
2396 * @retval PMINFO_R_OK success
2397 * @retval PMINFO_R_EINVAL invalid argument
2398 * @retval PMINFO_R_ERROR internal error
2399 * @pre pkgmgrinfo_appinfo_get_appinfo()
2400 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2401 * @see pkgmgrinfo_appinfo_get_appid()
2402 * @see pkgmgrinfo_appinfo_is_multiple()
2404 static int get_app_pkgid(const char *appid)
2408 pkgmgrinfo_appinfo_h handle;
2409 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2410 if (ret != PMINFO_R_OK)
2412 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2413 if (ret != PMINFO_R_OK) {
2414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2417 printf("pkg id: %s\n", pkgid);
2418 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2423 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
2426 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2427 * @brief This API gets the package type of the application
2429 * @par This API is for package-manager client application
2430 * @par Sync (or) Async : Synchronous API
2432 * @param[in] handle pointer to the application info handle.
2433 * @param[out] pkgtype pointer to hold package type
2434 * @return 0 if success, error code(<0) if fail
2435 * @retval PMINFO_R_OK success
2436 * @retval PMINFO_R_EINVAL invalid argument
2437 * @retval PMINFO_R_ERROR internal error
2438 * @pre pkgmgrinfo_appinfo_get_appinfo()
2439 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2440 * @see pkgmgrinfo_appinfo_get_appid()
2441 * @see pkgmgrinfo_appinfo_is_multiple()
2443 static int get_app_pkgtype(const char *appid)
2446 char *pkgtype = NULL;
2447 pkgmgrinfo_appinfo_h handle = NULL;
2448 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2449 if (ret != PMINFO_R_OK)
2451 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2452 if (ret != PMINFO_R_OK) {
2453 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2456 printf("pkgtype: %s\n", pkgtype);
2457 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2462 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
2465 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
2466 * @brief This API gets the executable name of the application
2468 * @par This API is for package-manager client application
2469 * @par Sync (or) Async : Synchronous API
2471 * @param[in] handle pointer to the application info handle.
2472 * @param[out] exec pointer to hold app exec name
2473 * @return 0 if success, error code(<0) if fail
2474 * @retval PMINFO_R_OK success
2475 * @retval PMINFO_R_EINVAL invalid argument
2476 * @retval PMINFO_R_ERROR internal error
2477 * @pre pkgmgrinfo_appinfo_get_appinfo()
2478 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2479 * @see pkgmgrinfo_appinfo_get_appid()
2480 * @see pkgmgrinfo_appinfo_is_multiple()
2482 static int get_app_exec(const char *appid)
2486 pkgmgrinfo_appinfo_h handle;
2487 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2488 if (ret != PMINFO_R_OK)
2490 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
2491 if (ret != PMINFO_R_OK) {
2492 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2495 printf("exec name: %s\n", exec);
2496 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2501 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
2504 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2505 * @brief This API gets the icon name of the application
2507 * @par This API is for package-manager client application
2508 * @par Sync (or) Async : Synchronous API
2510 * @param[in] handle pointer to the application info handle.
2511 * @param[out] icon pointer to hold app icon name
2512 * @return 0 if success, error code(<0) if fail
2513 * @retval PMINFO_R_OK success
2514 * @retval PMINFO_R_EINVAL invalid argument
2515 * @retval PMINFO_R_ERROR internal error
2516 * @pre pkgmgrinfo_appinfo_get_appinfo()
2517 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2518 * @see pkgmgrinfo_appinfo_get_appid()
2519 * @see pkgmgrinfo_appinfo_is_multiple()
2521 static int get_app_icon(const char *appid)
2525 pkgmgrinfo_appinfo_h handle;
2526 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2527 if (ret != PMINFO_R_OK)
2529 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
2530 if (ret != PMINFO_R_OK) {
2531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2534 printf("icon name: %s\n", icon);
2535 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2540 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2543 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
2544 * @brief This API gets the label of the application
2546 * @par This API is for package-manager client application
2547 * @par Sync (or) Async : Synchronous API
2549 * @param[in] handle pointer to the application info handle.
2550 * @param[out] label pointer to hold app label
2551 * @return 0 if success, error code(<0) if fail
2552 * @retval PMINFO_R_OK success
2553 * @retval PMINFO_R_EINVAL invalid argument
2554 * @retval PMINFO_R_ERROR internal error
2555 * @pre pkgmgrinfo_appinfo_get_appinfo()
2556 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2557 * @see pkgmgrinfo_appinfo_get_appid()
2558 * @see pkgmgrinfo_appinfo_is_multiple()
2560 static int get_app_label(const char *appid)
2564 pkgmgrinfo_appinfo_h handle;
2565 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2566 if (ret != PMINFO_R_OK)
2568 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
2569 if (ret != PMINFO_R_OK) {
2570 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2573 printf("label : %s\n", label);
2574 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2579 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
2582 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
2583 * @brief This API gets exactly matched label by given appid and locale
2585 * @par This API is for package-manager client application
2586 * @par Sync (or) Async : Synchronous API
2588 * @param[in] appid pointer to appid
2589 * @param[in] locale pointer to locale
2590 * @param[out] label pointer to hold app label
2591 * @return 0 if success, error code(<0) if fail
2592 * @retval PMINFO_R_OK success
2593 * @retval PMINFO_R_EINVAL invalid argument
2594 * @retval PMINFO_R_ERROR internal error
2596 static int get_localed_label(const char *appid, const char *locale)
2601 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
2602 if (ret != PMINFO_R_OK)
2605 printf("localed label: %s\n", label);
2613 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
2614 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
2617 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
2618 * @brief This API gets metadata value by given metadata key
2620 * @par This API is for package-manager client application
2621 * @par Sync (or) Async : Synchronous API
2623 * @param[in] handle pointer to the application info handle
2624 * @param[in] metadata_key metadata key
2625 * @param[out] metadata_value pointer to hold metadata value
2626 * @return 0 if success, error code(<0) if fail
2627 * @retval PMINFO_R_OK success
2628 * @retval PMINFO_R_EINVAL invalid argument
2630 static int get_metadata_value(const char *appid, const char *metadata_key)
2633 pkgmgrinfo_appinfo_h handle = NULL;
2634 char *metadata_value = NULL;
2636 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2637 if (ret != PMINFO_R_OK)
2640 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
2641 if (ret != PMINFO_R_OK) {
2642 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2651 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
2654 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
2655 * @brief This API gets the component of the application
2657 * @par This API is for package-manager client application
2658 * @par Sync (or) Async : Synchronous API
2660 * @param[in] handle pointer to the application info handle.
2661 * @param[out] component pointer to hold app component
2662 * @return 0 if success, error code(<0) if fail
2663 * @retval PMINFO_R_OK success
2664 * @retval PMINFO_R_EINVAL invalid argument
2665 * @retval PMINFO_R_ERROR internal error
2666 * @pre pkgmgrinfo_appinfo_get_appinfo()
2667 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2668 * @see pkgmgrinfo_appinfo_get_appid()
2669 * @see pkgmgrinfo_appinfo_is_multiple()
2671 static int get_app_component(const char *appid)
2674 pkgmgrinfo_app_component component;
2675 pkgmgrinfo_appinfo_h handle;
2676 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2677 if (ret != PMINFO_R_OK)
2679 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
2680 if (ret != PMINFO_R_OK) {
2681 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2684 printf("component : %s\n", component);
2685 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2690 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
2693 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
2694 * @brief This API gets the apptype of the application
2696 * @par This API is for package-manager client application
2697 * @par Sync (or) Async : Synchronous API
2699 * @param[in] handle pointer to the application info handle.
2700 * @param[out] app_type pointer to hold apptype
2701 * @return 0 if success, error code(<0) if fail
2702 * @retval PMINFO_R_OK success
2703 * @retval PMINFO_R_EINVAL invalid argument
2704 * @retval PMINFO_R_ERROR internal error
2705 * @pre pkgmgrinfo_appinfo_get_appinfo()
2706 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2707 * @see pkgmgrinfo_appinfo_get_appid()
2708 * @see pkgmgrinfo_appinfo_is_multiple()
2710 static int get_app_type(const char *appid)
2713 char *apptype = NULL;
2714 pkgmgrinfo_appinfo_h handle;
2715 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2716 if (ret != PMINFO_R_OK)
2718 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
2719 if (ret != PMINFO_R_OK) {
2720 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2723 printf("apptype : %s\n", apptype);
2724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2729 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
2732 * @fn int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2733 int *operation_count, char ***operation)
2734 * @brief This API gets the list of operation of the application
2736 * @par This API is for package-manager client application
2737 * @par Sync (or) Async : Synchronous API
2739 * @param[in] handle pointer to the appcontrol handle.
2740 * @param[out] operation_count pointer to hold number of operations
2741 * @param[out] operation pointer to hold list of operations
2742 * @return 0 if success, error code(<0) if fail
2743 * @retval PMINFO_R_OK success
2744 * @retval PMINFO_R_EINVAL invalid argument
2745 * @retval PMINFO_R_ERROR internal error
2746 * @pre pkgmgrinfo_appinfo_get_appinfo()
2747 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2748 * @see pkgmgrinfo_appinfo_get_uri()
2749 * @see pkgmgrinfo_appinfo_get_mime()
2751 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2756 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
2757 for (i = 0; i < oc; i++) {
2758 if (strcmp(operation[i], (char *)user_data) == 0)
2765 static int check_operation(const char *appid, char *operation)
2768 pkgmgrinfo_appinfo_h handle;
2769 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2770 if (ret != PMINFO_R_OK)
2772 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
2773 if (ret != PMINFO_R_OK) {
2774 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2777 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2782 int pkgmgrinfo_appinfo_get_operation(pkgmgrinfo_appcontrol_h handle,
2783 int *operation_count, char ***operation);
2786 * @fn int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2787 int *uri_count, char ***uri)
2788 * @brief This API gets the list of uri of the application
2790 * @par This API is for package-manager client application
2791 * @par Sync (or) Async : Synchronous API
2793 * @param[in] handle pointer to the appcontrol handle.
2794 * @param[out] uri_count pointer to hold number of uris
2795 * @param[out] uri pointer to hold list of uris
2796 * @return 0 if success, error code(<0) if fail
2797 * @retval PMINFO_R_OK success
2798 * @retval PMINFO_R_EINVAL invalid argument
2799 * @retval PMINFO_R_ERROR internal error
2800 * @pre pkgmgrinfo_appinfo_get_appinfo()
2801 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2802 * @see pkgmgrinfo_appinfo_get_operation()
2803 * @see pkgmgrinfo_appinfo_get_mime()
2805 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2810 pkgmgrinfo_appinfo_get_uri(handle, &uc, &uri);
2811 for (i = 0; i < uc; i++) {
2812 if (strcmp(uri[i], (char *)user_data) == 0)
2819 static int check_uri(const char *appid, char *uri)
2822 pkgmgrinfo_appinfo_h handle;
2823 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2824 if (ret != PMINFO_R_OK)
2826 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)uri);
2827 if (ret != PMINFO_R_OK) {
2828 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2831 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2836 int pkgmgrinfo_appinfo_get_uri(pkgmgrinfo_appcontrol_h handle,
2837 int *uri_count, char ***uri);
2840 * @fn int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2841 int *mime_count, char ***mime)
2842 * @brief This API gets the list of mime of the application
2844 * @par This API is for package-manager client application
2845 * @par Sync (or) Async : Synchronous API
2847 * @param[in] handle pointer to the appcontrol handle.
2848 * @param[out] mime_count pointer to hold number of mimes
2849 * @param[out] mime pointer to hold list of mimes
2850 * @return 0 if success, error code(<0) if fail
2851 * @retval PMINFO_R_OK success
2852 * @retval PMINFO_R_EINVAL invalid argument
2853 * @retval PMINFO_R_ERROR internal error
2854 * @pre pkgmgrinfo_appinfo_get_appinfo()
2855 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2856 * @see pkgmgrinfo_appinfo_get_uri()
2857 * @see pkgmgrinfo_appinfo_get_operation()
2859 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2864 pkgmgrinfo_appinfo_get_operation(handle, &mc, &mime);
2865 for (i = 0; i < mc; i++) {
2866 if (strcmp(mime[i], (char *)user_data) == 0)
2873 static int check_mime(const char *appid, char *mime)
2876 pkgmgrinfo_appinfo_h handle;
2877 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2878 if (ret != PMINFO_R_OK)
2880 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)mime);
2881 if (ret != PMINFO_R_OK) {
2882 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2885 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2890 int pkgmgrinfo_appinfo_get_mime(pkgmgrinfo_appcontrol_h handle,
2891 int *mime_count, char ***mime);
2894 * @fn int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2895 int *subapp_count, char ***subapp)
2896 * @brief This API gets the list of subapp of the application
2898 * @par This API is for package-manager client application
2899 * @par Sync (or) Async : Synchronous API
2901 * @param[in] handle pointer to the appcontrol handle.
2902 * @param[out] subapp_count pointer to hold number of subapp
2903 * @param[out] subapp pointer to hold list of subapp
2904 * @return 0 if success, error code(<0) if fail
2905 * @retval PMINFO_R_OK success
2906 * @retval PMINFO_R_EINVAL invalid argument
2907 * @retval PMINFO_R_ERROR internal error
2908 * @pre pkgmgrinfo_appinfo_get_appinfo()
2909 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2910 * @see pkgmgrinfo_appinfo_get_uri()
2911 * @see pkgmgrinfo_appinfo_get_operation()
2913 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
2917 char **subapp = NULL;
2918 pkgmgrinfo_appinfo_get_subapp(handle, &sc, &subapp);
2919 for (i = 0; i < sc; i++) {
2920 if (strcmp(subapp[i], (char *)user_data) == 0)
2927 static int check_subapp(const char *appid, char *subapp)
2930 pkgmgrinfo_appinfo_h handle = NULL;
2931 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2932 if (ret != PMINFO_R_OK)
2934 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)subapp);
2935 if (ret != PMINFO_R_OK) {
2936 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2939 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2944 int pkgmgrinfo_appinfo_get_subapp(pkgmgrinfo_appcontrol_h handle,
2945 int *subapp_count, char ***subapp);
2948 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2949 * @brief This API gets the notification icon of the application
2951 * @par This API is for package-manager client application
2952 * @par Sync (or) Async : Synchronous API
2954 * @param[in] handle pointer to the application info handle.
2955 * @param[out] path pointer to hold notification icon
2956 * @return 0 if success, error code(<0) if fail
2957 * @retval PMINFO_R_OK success
2958 * @retval PMINFO_R_EINVAL invalid argument
2959 * @retval PMINFO_R_ERROR internal error
2960 * @pre pkgmgrinfo_appinfo_get_appinfo()
2961 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2962 * @see pkgmgrinfo_appinfo_get_appid()
2963 * @see pkgmgrinfo_appinfo_is_multiple()
2965 static int get_app_notification_icon(const char *appid)
2968 char *notification_icon = NULL;
2969 pkgmgrinfo_appinfo_h handle;
2970 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2971 if (ret != PMINFO_R_OK)
2973 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
2974 if (ret != PMINFO_R_OK) {
2975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2978 printf("notification icon : %s\n", notification_icon);
2979 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2984 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
2987 * @fn int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon)
2988 * @brief This API gets the setting icon of the application
2990 * @par This API is for package-manager client application
2991 * @par Sync (or) Async : Synchronous API
2993 * @param[in] handle pointer to the application info handle.
2994 * @param[out] path pointer to hold setting icon
2995 * @return 0 if success, error code(<0) if fail
2996 * @retval PMINFO_R_OK success
2997 * @retval PMINFO_R_EINVAL invalid argument
2998 * @retval PMINFO_R_ERROR internal error
2999 * @pre pkgmgrinfo_appinfo_get_appinfo()
3000 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3001 * @see pkgmgrinfo_appinfo_get_appid()
3002 * @see pkgmgrinfo_appinfo_is_multiple()
3004 static int get_app_setting_icon(const char *appid)
3007 char *setting_icon = NULL;
3008 pkgmgrinfo_appinfo_h handle;
3009 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3010 if (ret != PMINFO_R_OK)
3012 ret = pkgmgrinfo_appinfo_get_setting_icon(handle, &setting_icon);
3013 if (ret != PMINFO_R_OK) {
3014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3017 printf("setting icon : %s\n", setting_icon);
3018 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3023 int pkgmgrinfo_appinfo_get_setting_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3026 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3027 * @brief This API gets the type of recent image on app-tray
3029 * @par This API is for package-manager client application
3030 * @par Sync (or) Async : Synchronous API
3032 * @param[in] handle pointer to the application info handle.
3033 * @param[out] type pointer to hold image type
3034 * @return 0 if success, error code(<0) if fail
3035 * @retval PMINFO_R_OK success
3036 * @retval PMINFO_R_EINVAL invalid argument
3037 * @retval PMINFO_R_ERROR internal error
3038 * @pre pkgmgrinfo_appinfo_get_appinfo()
3039 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3040 * @see pkgmgrinfo_appinfo_get_appid()
3041 * @see pkgmgrinfo_appinfo_is_multiple()
3043 static int get_app_recent_image_type(const char *appid)
3046 pkgmgrinfo_app_recentimage type;
3047 pkgmgrinfo_appinfo_h handle;
3048 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3049 if (ret != PMINFO_R_OK)
3051 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3052 if (ret != PMINFO_R_OK) {
3053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3056 printf("recent image type: %d\n", type);
3057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3062 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3066 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3067 * @brief This API gets the preview image of application
3069 * @par Sync (or) Async : Synchronous API
3071 * @param[in] handle pointer to the application info handle.
3072 * @param[out] preview_img pointer to hold preview image path
3073 * @return 0 if success, error code(<0) if fail
3074 * @retval PMINFO_R_OK success
3075 * @retval PMINFO_R_EINVAL invalid argument
3076 * @retval PMINFO_R_ERROR internal error
3077 * @pre pkgmgrinfo_appinfo_get_appinfo()
3078 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3079 * @see pkgmgrinfo_appinfo_get_appid()
3081 static int get_app_previewimage(const char *appid)
3084 char *preview = NULL;
3085 pkgmgrinfo_appinfo_h handle = NULL;
3086 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3087 if (ret != PMINFO_R_OK)
3089 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3090 if (ret != PMINFO_R_OK) {
3091 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3094 printf("preview image path : %s\n", preview);
3095 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3100 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3104 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3105 * @brief This API gets the package permission type of the application
3107 * @par This API is for package-manager client application
3108 * @par Sync (or) Async : Synchronous API
3110 * @param[in] handle pointer to the application info handle.
3111 * @param[out] permission pointer to hold package permission
3112 * @return 0 if success, error code(<0) if fail
3113 * @retval PMINFO_R_OK success
3114 * @retval PMINFO_R_EINVAL invalid argument
3115 * @retval PMINFO_R_ERROR internal error
3116 * @pre pkgmgrinfo_appinfo_get_appinfo()
3117 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3118 * @see pkgmgrinfo_appinfo_get_appid()
3120 static int get_app_permission(const char *appid)
3123 pkgmgrinfo_permission_type permission = 0;
3124 pkgmgrinfo_appinfo_h handle;
3126 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3127 if (ret != PMINFO_R_OK)
3129 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3130 if (ret != PMINFO_R_OK) {
3131 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3134 printf("permission type: %d\n", permission);
3135 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3140 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3143 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3144 * @brief This API gets the component_type
3146 * @par This API is for package-manager client application
3147 * @par Sync (or) Async : Synchronous API
3149 * @param[in] handle pointer to the application info handle.
3150 * @param[out] component_type pointer to hold component_type
3151 * @return 0 if success, error code(<0) if fail
3152 * @retval PMINFO_R_OK success
3153 * @retval PMINFO_R_EINVAL invalid argument
3154 * @retval PMINFO_R_ERROR internal error
3155 * @pre pkgmgrinfo_appinfo_get_appinfo()
3156 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3157 * @see pkgmgrinfo_appinfo_get_pkgid()
3158 * @see pkgmgrinfo_appinfo_is_multiple()
3160 static int get_component_type(const char *appid)
3163 char *component_type = NULL;
3164 pkgmgrinfo_appinfo_h handle;
3165 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3166 if (ret != PMINFO_R_OK)
3168 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3169 if (ret != PMINFO_R_OK) {
3170 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3173 printf("component_type: %s\n", component_type);
3174 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3179 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3182 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3183 * @brief This API gets the application 'hwacceleration' value from the app ID
3185 * @par This API is for package-manager client application
3186 * @par Sync (or) Async : Synchronous API
3188 * @param[in] handle pointer to application info handle
3189 * @param[out] hwacceleration pointer to hold package hwacceleration value
3190 * @return 0 if success, error code(<0) if fail
3191 * @retval PMINFO_R_OK success
3192 * @retval PMINFO_R_EINVAL invalid argument
3193 * @retval PMINFO_R_ERROR internal error
3194 * @pre pkgmgrinfo_appinfo_get_appinfo()
3195 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3196 * @see pkgmgrinfo_appinfo_get_appid()
3197 * @see pkgmgrinfo_appinfo_is_multiple()
3199 static int get_app_hwacceleration(const char *appid)
3202 pkgmgrinfo_app_hwacceleration hwacceleration;
3203 pkgmgrinfo_appinfo_h handle;
3204 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3205 if (ret != PMINFO_R_OK)
3207 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3208 if (ret != PMINFO_R_OK) {
3209 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3212 printf("app hwacceleration: %d\n", hwacceleration);
3213 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3218 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3221 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3222 * @brief This API gets the application 'screenreader' value from the app ID
3224 * @par This API is for package-manager client application
3225 * @par Sync (or) Async : Synchronous API
3227 * @param[in] handle pointer to application info handle
3228 * @param[out] screenreader pointer to hold package accessibility value
3229 * @return 0 if success, error code(<0) if fail
3230 * @retval PMINFO_R_OK success
3231 * @retval PMINFO_R_EINVAL invalid argument
3232 * @retval PMINFO_R_ERROR internal error
3233 * @pre pkgmgrinfo_appinfo_get_appinfo()
3234 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3235 * @see pkgmgrinfo_appinfo_get_appid()
3236 * @see pkgmgrinfo_appinfo_is_multiple()
3238 static int get_app_screenreader(const char *appid)
3241 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3242 pkgmgrinfo_appinfo_h handle = NULL;
3243 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3244 if (ret != PMINFO_R_OK)
3246 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3247 if (ret != PMINFO_R_OK) {
3248 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3251 printf("app screenreader: %d\n", screenreader);
3252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3257 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3260 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3261 * @brief This API gets the application's landscape & portrait effect images
3263 * @par This API is for package-manager client application
3264 * @par Sync (or) Async : Synchronous API
3266 * @param[in] handle pointer to application info handle
3267 * @param[out] portrait_img contains portrait mode effect image
3268 * @param[out] landscape_img contains landscape mode effect image
3269 * @return 0 if success, error code(<0) if fail
3270 * @retval PMINFO_R_OK success
3271 * @retval PMINFO_R_EINVAL invalid argument
3272 * @retval PMINFO_R_ERROR internal error
3273 * @pre pkgmgrinfo_appinfo_get_appinfo()
3274 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3275 * @see pkgmgrinfo_appinfo_get_appid()
3276 * @see pkgmgrinfo_appinfo_is_nodisplay()
3278 static int get_app_effectimages(const char *appid)
3281 char *portraitimg = NULL;
3282 char *landscapeimg = NULL;
3283 pkgmgrinfo_appinfo_h handle;
3284 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3285 if (ret != PMINFO_R_OK)
3287 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3288 if (ret != PMINFO_R_OK) {
3289 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3292 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3293 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3298 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3301 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3302 * @brief This API gets the application's effect image type
3304 * @par This API is for package-manager client application
3305 * @par Sync (or) Async : Synchronous API
3307 * @param[in] handle pointer to application info handle
3308 * @param[out] effectimg_type contains effect image type
3309 * @return 0 if success, error code(<0) if fail
3310 * @retval PMINFO_R_OK success
3311 * @retval PMINFO_R_EINVAL invalid argument
3312 * @retval PMINFO_R_ERROR internal error
3313 * @pre pkgmgrinfo_appinfo_get_appinfo()
3314 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3315 * @see pkgmgrinfo_appinfo_get_appid()
3316 * @see pkgmgrinfo_appinfo_is_nodisplay()
3318 static int get_app_effectimage_type(const char *appid)
3321 char *effectimg_type = NULL;
3322 pkgmgrinfo_appinfo_h handle = NULL;
3323 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3324 if (ret != PMINFO_R_OK)
3326 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3327 if (ret != PMINFO_R_OK) {
3328 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3331 printf("app effect image type: %s\n", effectimg_type);
3332 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3337 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3340 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3341 * @brief This API gets the submode_mainid of the application
3343 * @par This API is for package-manager client application
3344 * @par Sync (or) Async : Synchronous API
3346 * @param[in] handle pointer to the application info handle.
3347 * @param[out] submode_mainid pointer to hold package name
3348 * @return 0 if success, error code(<0) if fail
3349 * @retval PMINFO_R_OK success
3350 * @retval PMINFO_R_EINVAL invalid argument
3351 * @retval PMINFO_R_ERROR internal error
3352 * @pre pkgmgrinfo_appinfo_get_appinfo()
3353 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3354 * @see pkgmgrinfo_appinfo_get_appid()
3355 * @see pkgmgrinfo_appinfo_is_multiple()
3357 static int get_app_submode_mainid(const char *appid)
3360 char *submode_mainid = NULL;
3361 pkgmgrinfo_appinfo_h handle = NULL;
3362 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3363 if (ret != PMINFO_R_OK)
3365 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3366 if (ret != PMINFO_R_OK) {
3367 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3370 printf("submode_mainid: %s\n", submode_mainid);
3371 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3376 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
3379 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3380 * @brief This API gets the datacontrol info
3382 * @par This API is for package-manager client application
3383 * @par Sync (or) Async : Synchronous API
3385 * @param[in] providerid pointer to the providerid of dataconltrol.
3386 * @param[in] type pointer to the type of dataconltrol.
3387 * @param[out] appid pointer to hold appid, need to free after using
3388 * @param[out] access pointer to hold access, need to free after using
3389 * @return 0 if success, error code(<0) if fail
3390 * @retval PMINFO_R_OK success
3391 * @retval PMINFO_R_EINVAL invalid argument
3392 * @retval PMINFO_R_ERROR internal error
3395 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3396 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3399 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3400 * @brief This API gets the appid of datacontrol
3402 * @par This API is for package-manager client application
3403 * @par Sync (or) Async : Synchronous API
3405 * @param[in] providerid pointer to the providerid of dataconltrol.
3406 * @param[out] appid pointer to hold appid, need to free after using
3407 * @return 0 if success, error code(<0) if fail
3408 * @retval PMINFO_R_OK success
3409 * @retval PMINFO_R_EINVAL invalid argument
3410 * @retval PMINFO_R_ERROR internal error
3413 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3414 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3417 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
3418 * @brief This API gets the alias_appid of the application
3420 * @par This API is for package-manager client application
3421 * @par Sync (or) Async : Synchronous API
3423 * @param[in] handle pointer to the application info handle.
3424 * @param[out] alias_appid pointer to hold app alias_appid
3425 * @return 0 if success, error code(<0) if fail
3426 * @retval PMINFO_R_OK success
3427 * @retval PMINFO_R_EINVAL invalid argument
3428 * @retval PMINFO_R_ERROR internal error
3429 * @pre pkgmgrinfo_appinfo_get_appinfo()
3430 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3431 * @see pkgmgrinfo_appinfo_get_appid()
3433 static int get_alias_appid(const char *appid)
3436 char *alias_appid= 0;
3437 pkgmgrinfo_appinfo_h handle = NULL;
3438 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3439 if (ret != PMINFO_R_OK)
3441 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3442 if (ret != PMINFO_R_OK) {
3443 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3446 printf("alias_appid: %s\n", alias_appid);
3447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3452 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3455 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
3456 * @brief This API gets the effective_appid of the application
3458 * @par This API is for package-manager client application
3459 * @par Sync (or) Async : Synchronous API
3461 * @param[in] handle pointer to the application info handle.
3462 * @param[out] effective_appid pointer to hold app effective_appid
3463 * @return 0 if success, error code(<0) if fail
3464 * @retval PMINFO_R_OK success
3465 * @retval PMINFO_R_EINVAL invalid argument
3466 * @retval PMINFO_R_ERROR internal error
3467 * @pre pkgmgrinfo_appinfo_get_appinfo()
3468 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3469 * @see pkgmgrinfo_appinfo_get_appid()
3471 static int get_effective_appid(const char *appid)
3474 char *effective_appid= 0;
3475 pkgmgrinfo_appinfo_h handle = NULL;
3476 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3477 if (ret != PMINFO_R_OK)
3479 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3480 if (ret != PMINFO_R_OK) {
3481 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3484 printf("effective_appid: %s\n", effective_appid);
3485 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3490 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3493 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3494 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
3496 * @par This API is for package-manager client application
3497 * @par Sync (or) Async : Synchronous API
3499 * @param[in] handle pointer to the appinfo handle.
3500 * @param[out] tep_name pointer to hold tep name
3501 * @return 0 if success, error code(<0) if fail
3502 * @retval PMINFO_R_OK success
3503 * @retval PMINFO_R_EINVAL invalid argument
3504 * @retval PMINFO_R_ERROR internal error
3505 * @pre pkgmgrinfo_appinfo_get_appinfo()
3506 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3507 * @see pkgmgrinfo_appinfo_get_appid()
3509 static int get_tep_name(const char *appid)
3512 char *tep_name = NULL;
3513 pkgmgrinfo_appinfo_h handle = NULL;
3514 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3515 if (ret != PMINFO_R_OK)
3517 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3518 if (ret != PMINFO_R_OK) {
3519 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3522 printf("TEP name is: %s\n", tep_name);
3523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3528 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3531 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3532 * @brief This API gets zip mount file name associated with the package which contain given application
3533 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3535 * @par This API is for package-manager client application
3536 * @par Sync (or) Async : Synchronous API
3538 * @param[in] handle pointer to the appinfo handle.
3539 * @param[out] zip_mount_file pointer to hold zip mount file name
3540 * @return 0 if success, error code(<0) if fail
3541 * @retval PMINFO_R_OK success
3542 * @retval PMINFO_R_EINVAL invalid argument
3543 * @retval PMINFO_R_ERROR internal error
3544 * @pre pkgmgrinfo_appinfo_get_appinfo()
3545 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3546 * @see pkgmgrinfo_appinfo_get_appid()
3548 static int get_zip_mount_file(const char *appid)
3551 char *zip_mount_file = NULL;
3552 pkgmgrinfo_appinfo_h handle = NULL;
3553 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3554 if (ret != PMINFO_R_OK)
3556 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3557 if (ret != PMINFO_R_OK) {
3558 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3561 printf("Mount file name is: %s\n", zip_mount_file);
3562 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3567 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3570 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3571 * @brief This API gets the root path of application
3573 * @par Sync (or) Async : Synchronous API
3575 * @param[in] handle pointer to appinfo handle
3576 * @param[out] path pointer to hold root path of application
3577 * @return 0 if success, error code(<0) if fail
3578 * @retval PMINFO_R_OK success
3579 * @retval PMINFO_R_EINVAL invalid argument
3580 * @retval PMINFO_R_ERROR internal error
3582 static int get_root_path(const char *appid)
3586 pkgmgrinfo_appinfo_h handle;
3587 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3588 if (ret != PMINFO_R_OK)
3591 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3592 if (ret != PMINFO_R_OK) {
3593 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3596 printf("path : %s\n", path);
3597 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3603 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3606 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3607 * @brief This API gets the application api_version from the application ID
3609 * @par This API is for package-manager client application
3610 * @par Sync (or) Async : Synchronous API
3612 * @param[in] handle pointer to appinfo handle
3613 * @param[out] api_version pointer to hold application api_version
3614 * @return 0 if success, error code(<0) if fail
3615 * @retval PMINFO_R_OK success
3616 * @retval PMINFO_R_EINVAL invalid argument
3617 * @retval PMINFO_R_ERROR internal error
3618 * @pre pkgmgrinfo_appinfo_get_appinfo()
3619 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3620 * @see pkgmgrinfo_appinfo_get_appid()
3622 static int get_app_api_version(const char *appid)
3625 char *api_version = NULL;
3626 pkgmgrinfo_appinfo_h handle = NULL;
3627 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3628 if (ret != PMINFO_R_OK)
3630 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3631 if (ret != PMINFO_R_OK) {
3632 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3635 printf("app api_version: %s\n", api_version);
3636 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3641 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3644 * @fn int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3645 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3646 * @brief This API gets the list of permission for a particular application
3648 * @par This API is for package-manager client application
3649 * @par Sync (or) Async : Synchronous API
3650 * @param[in] handle pointer to the application info handle.
3651 * @param[in] permission_func callback function for list
3652 * @param[in] user_data user data to be passed to callback function
3653 * @return 0 if success, error code(<0) if fail
3654 * @retval PMINFO_R_OK success
3655 * @retval PMINFO_R_EINVAL invalid argument
3656 * @retval PMINFO_R_ERROR internal error
3657 * @pre pkgmgrinfo_appinfo_get_appinfo()
3658 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3660 int permission_func(const char *name, void *user_data)
3662 if (strcmp(name, (char *)user_data) == 0)
3668 static int list_permission(const char *appid, char *permission)
3671 pkgmgrinfo_appinfo_h handle;
3672 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3673 if (ret != PMINFO_R_OK)
3675 ret = pkgmgrinfo_appinfo_foreach_permission(handle, permission_func, (void *)permission);
3676 if (ret != PMINFO_R_OK) {
3677 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3680 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3685 int pkgmgrinfo_appinfo_foreach_permission(pkgmgrinfo_appinfo_h handle,
3686 pkgmgrinfo_app_permission_list_cb permission_func, void *user_data);
3689 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3690 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3691 * @brief This API gets the list of category for a particular application
3693 * @par This API is for package-manager client application
3694 * @par Sync (or) Async : Synchronous API
3695 * @param[in] handle pointer to the application info handle.
3696 * @param[in] category_func callback function for list
3697 * @param[in] user_data user data to be passed to callback function
3698 * @return 0 if success, error code(<0) if fail
3699 * @retval PMINFO_R_OK success
3700 * @retval PMINFO_R_EINVAL invalid argument
3701 * @retval PMINFO_R_ERROR internal error
3702 * @pre pkgmgrinfo_appinfo_get_appinfo()
3703 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3705 int category_func(const char *name, void *user_data)
3707 if (strcmp(name, (char *)user_data) == 0)
3713 static int list_category(const char *appid, char *category)
3716 pkgmgrinfo_appinfo_h handle;
3717 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3718 if (ret != PMINFO_R_OK)
3720 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
3721 if (ret != PMINFO_R_OK) {
3722 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3730 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
3731 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
3734 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3735 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3736 * @brief This API gets the list of metadata for a particular application
3738 * @par This API is for package-manager client application
3739 * @par Sync (or) Async : Synchronous API
3740 * @param[in] handle pointer to the application info handle.
3741 * @param[in] metadata_func callback function for list
3742 * @param[in] user_data user data to be passed to callback function
3743 * @return 0 if success, error code(<0) if fail
3744 * @retval PMINFO_R_OK success
3745 * @retval PMINFO_R_EINVAL invalid argument
3746 * @retval PMINFO_R_ERROR internal error
3747 * @pre pkgmgrinfo_appinfo_get_appinfo()
3748 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3750 int metadata_func(const char *key, const char *value, void *user_data)
3752 if (strcmp(key, (char *)user_data) == 0) {
3753 printf("Value is %s\n", value);
3760 static int list_metadata(const char *appid, char *key)
3763 pkgmgrinfo_appinfo_h handle;
3764 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3765 if (ret != PMINFO_R_OK)
3767 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
3768 if (ret != PMINFO_R_OK) {
3769 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3772 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3777 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
3778 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
3782 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3783 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3784 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3785 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
3786 * @brief This API gets the list of app-control for a particular application
3788 * @par This API is for package-manager client application
3789 * @par Sync (or) Async : Synchronous API
3790 * @param[in] handle pointer to the application info handle.
3791 * @param[in] appcontrol_func callback function for list
3792 * @param[in] user_data user data to be passed to callback function
3793 * @param[in] uid the addressee user id of the instruction
3794 * @return 0 if success, error code(<0) if fail
3795 * @retval PMINFO_R_OK success
3796 * @retval PMINFO_R_EINVAL invalid argument
3797 * @retval PMINFO_R_ERROR internal error
3798 * @pre pkgmgrinfo_appinfo_get_appinfo()
3799 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3801 int appcontrol_func(pkgmgrinfo_appcontrol_h handle, void *user_data)
3806 pkgmgrinfo_appinfo_get_operation(handle, &oc, &operation);
3807 for (i = 0; i < oc; i++) {
3808 if (strcmp(operation[i], (char *)user_data) == 0)
3815 static int check_operation(const char *appid, char *operation)
3818 pkgmgrinfo_appinfo_h handle;
3819 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3820 if (ret != PMINFO_R_OK)
3822 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
3823 if (ret != PMINFO_R_OK) {
3824 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3827 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3832 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
3833 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
3838 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
3839 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
3842 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3843 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3844 * @brief This API gets the list of splashscreen for a particular application
3846 * @par This API is for package-manager client application
3847 * @par Sync (or) Async : Synchronous API
3848 * @param[in] handle pointer to the application info handle.
3849 * @param[in] splash_screen_func callback function for list
3850 * @param[in] user_data user data to be passed to callback function
3851 * @return 0 if success, error code(<0) if fail
3852 * @retval PMINFO_R_OK success
3853 * @retval PMINFO_R_EINVAL invalid argument
3854 * @retval PMINFO_R_ERROR internal error
3855 * @pre pkgmgrinfo_appinfo_get_appinfo()
3856 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3859 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
3860 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
3863 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
3864 * @brief This API gets the application 'nodisplay' value from the app ID
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] nodisplay pointer to hold package nodisplay value
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()
3878 * @see pkgmgrinfo_appinfo_is_multiple()
3880 static int get_app_nodisplay(const char *appid)
3884 pkgmgrinfo_appinfo_h handle;
3885 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3886 if (ret != PMINFO_R_OK)
3888 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
3889 if (ret != PMINFO_R_OK) {
3890 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3893 printf("app nodisplay: %d\n", nodisplay);
3894 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3899 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
3902 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
3903 * @brief This API gets the application 'multiple' value from the app ID
3905 * @par This API is for package-manager client application
3906 * @par Sync (or) Async : Synchronous API
3908 * @param[in] handle pointer to application info handle
3909 * @param[out] multiple pointer to hold package multiple value
3910 * @return 0 if success, error code(<0) if fail
3911 * @retval PMINFO_R_OK success
3912 * @retval PMINFO_R_EINVAL invalid argument
3913 * @retval PMINFO_R_ERROR internal error
3914 * @pre pkgmgrinfo_appinfo_get_appinfo()
3915 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3916 * @see pkgmgrinfo_appinfo_get_appid()
3917 * @see pkgmgrinfo_appinfo_is_nodisplay()
3919 static int get_app_multiple(const char *appid)
3923 pkgmgrinfo_appinfo_h handle;
3924 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3925 if (ret != PMINFO_R_OK)
3927 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
3928 if (ret != PMINFO_R_OK) {
3929 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3932 printf("app multiple: %d\n", multiple);
3933 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3938 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
3941 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
3942 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
3943 * application launching effect. If fales, indicator will be hidden during application launching effect
3945 * @par This API is for package-manager client application
3946 * @par Sync (or) Async : Synchronous API
3948 * @param[in] handle pointer to application info handle
3949 * @param[out] indicator_disp contains indicator display status for application launching effect
3950 * @return 0 if success, error code(<0) if fail
3951 * @retval PMINFO_R_OK success
3952 * @retval PMINFO_R_EINVAL invalid argument
3953 * @retval PMINFO_R_ERROR internal error
3954 * @pre pkgmgrinfo_appinfo_get_appinfo()
3955 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3956 * @see pkgmgrinfo_appinfo_get_appid()
3957 * @see pkgmgrinfo_appinfo_is_nodisplay()
3959 static int get_app_indicator_display(const char *appid)
3962 bool indicator_disp;
3963 pkgmgrinfo_appinfo_h handle;
3964 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3965 if (ret != PMINFO_R_OK)
3967 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
3968 if (ret != PMINFO_R_OK){
3969 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3972 printf("app indicator disp : %d\n", indicator_disp);
3973 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3978 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
3981 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
3982 * @brief This API gets the application 'taskmanage' value from the app ID
3984 * @par This API is for package-manager client application
3985 * @par Sync (or) Async : Synchronous API
3987 * @param[in] handle pointer to application info handle
3988 * @param[out] taskmanage pointer to hold package taskmanage value
3989 * @return 0 if success, error code(<0) if fail
3990 * @retval PMINFO_R_OK success
3991 * @retval PMINFO_R_EINVAL invalid argument
3992 * @retval PMINFO_R_ERROR internal error
3993 * @pre pkgmgrinfo_appinfo_get_appinfo()
3994 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3995 * @see pkgmgrinfo_appinfo_get_appid()
3996 * @see pkgmgrinfo_appinfo_is_multiple()
3998 static int get_app_taskmanage(const char *appid)
4002 pkgmgrinfo_appinfo_h handle;
4003 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4004 if (ret != PMINFO_R_OK)
4006 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4007 if (ret != PMINFO_R_OK) {
4008 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4011 printf("app taskmanage: %d\n", taskmanage);
4012 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4017 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4020 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4021 * @brief This API gets the application 'taskmanage' value from the app ID
4023 * @par This API is for package-manager client application
4024 * @par Sync (or) Async : Synchronous API
4026 * @param[in] handle pointer to application info handle
4027 * @param[out] enabled pointer to hold package enabled value
4028 * @return 0 if success, error code(<0) if fail
4029 * @retval PMINFO_R_OK success
4030 * @retval PMINFO_R_EINVAL invalid argument
4031 * @retval PMINFO_R_ERROR internal error
4032 * @pre pkgmgrinfo_appinfo_get_appinfo()
4033 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4034 * @see pkgmgrinfo_appinfo_get_appid()
4035 * @see pkgmgrinfo_appinfo_is_multiple()
4037 static int get_app_enabled(const char *appid)
4041 pkgmgrinfo_appinfo_h handle;
4042 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4043 if (ret != PMINFO_R_OK)
4045 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4046 if (ret != PMINFO_R_OK) {
4047 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4050 printf("app enabled: %d\n", enabled);
4051 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4056 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4059 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4060 * @brief This API gets the application 'onboot' value from the app ID
4062 * @par This API is for package-manager client application
4063 * @par Sync (or) Async : Synchronous API
4065 * @param[in] handle pointer to application info handle
4066 * @param[out] onboot pointer to hold package onboot value
4067 * @return 0 if success, error code(<0) if fail
4068 * @retval PMINFO_R_OK success
4069 * @retval PMINFO_R_EINVAL invalid argument
4070 * @retval PMINFO_R_ERROR internal error
4071 * @pre pkgmgrinfo_appinfo_get_appinfo()
4072 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4073 * @see pkgmgrinfo_appinfo_get_appid()
4074 * @see pkgmgrinfo_appinfo_is_multiple()
4076 static int get_app_onboot(const char *appid)
4080 pkgmgrinfo_appinfo_h handle;
4081 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4082 if (ret != PMINFO_R_OK)
4084 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4085 if (ret != PMINFO_R_OK) {
4086 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4089 printf("app onboot: %d\n", onboot);
4090 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4095 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4098 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4099 * @brief This API gets the application 'autorestart' value from the app ID
4101 * @par This API is for package-manager client application
4102 * @par Sync (or) Async : Synchronous API
4104 * @param[in] handle pointer to application info handle
4105 * @param[out] autorestart pointer to hold package autorestart value
4106 * @return 0 if success, error code(<0) if fail
4107 * @retval PMINFO_R_OK success
4108 * @retval PMINFO_R_EINVAL invalid argument
4109 * @retval PMINFO_R_ERROR internal error
4110 * @pre pkgmgrinfo_appinfo_get_appinfo()
4111 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4112 * @see pkgmgrinfo_appinfo_get_appid()
4113 * @see pkgmgrinfo_appinfo_is_multiple()
4115 static int get_app_autorestart(const char *appid)
4119 pkgmgrinfo_appinfo_h handle;
4120 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4121 if (ret != PMINFO_R_OK)
4123 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4124 if (ret != PMINFO_R_OK) {
4125 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4128 printf("app autorestart: %d\n", autorestart);
4129 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4134 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4137 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4138 * @brief This API gets the value for given application is main app or not from handle
4140 * @par This API is for package-manager client application
4141 * @par Sync (or) Async : Synchronous API
4143 * @param[in] handle pointer to application info handle
4144 * @param[out] mainapp pointer to hold package mainapp is or not
4145 * @return 0 if success, error code(<0) if fail
4146 * @retval PMINFO_R_OK success
4147 * @retval PMINFO_R_EINVAL invalid argument
4148 * @retval PMINFO_R_ERROR internal error
4149 * @pre pkgmgrinfo_appinfo_get_appinfo()
4150 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4151 * @see pkgmgrinfo_appinfo_get_appid()
4152 * @see pkgmgrinfo_appinfo_is_multiple()
4154 static int get_app_mainapp(const char *appid)
4158 pkgmgrinfo_appinfo_h handle;
4159 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4160 if (ret != PMINFO_R_OK)
4162 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4163 if (ret != PMINFO_R_OK) {
4164 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4167 printf("mainapp: %d\n", mainapp);
4168 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4173 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4177 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4178 * @brief This API gets the value for given application is preload or not from handle
4180 * @par This API is for package-manager client application
4181 * @par Sync (or) Async : Synchronous API
4183 * @param[in] handle pointer to application info handle
4184 * @param[out] preload pointer to hold preload is or not
4185 * @return 0 if success, error code(<0) if fail
4186 * @retval PMINFO_R_OK success
4187 * @retval PMINFO_R_EINVAL invalid argument
4188 * @retval PMINFO_R_ERROR internal error
4189 * @pre pkgmgrinfo_appinfo_get_appinfo()
4190 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4191 * @see pkgmgrinfo_appinfo_get_appid()
4192 * @see pkgmgrinfo_appinfo_is_multiple()
4194 static int get_app_preload(const char *appid)
4198 pkgmgrinfo_appinfo_h handle = NULL;
4199 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4200 if (ret != PMINFO_R_OK)
4202 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4203 if (ret != PMINFO_R_OK) {
4204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4207 printf("preload: %d\n", preload);
4208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4213 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4216 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4217 * @brief This API gets the value for given application is submode or not from handle
4219 * @par This API is for package-manager client application
4220 * @par Sync (or) Async : Synchronous API
4222 * @param[in] handle pointer to application info handle
4223 * @param[out] submode pointer to hold submode is or not
4224 * @return 0 if success, error code(<0) if fail
4225 * @retval PMINFO_R_OK success
4226 * @retval PMINFO_R_EINVAL invalid argument
4227 * @retval PMINFO_R_ERROR internal error
4228 * @pre pkgmgrinfo_appinfo_get_appinfo()
4229 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4230 * @see pkgmgrinfo_appinfo_get_appid()
4231 * @see pkgmgrinfo_appinfo_is_multiple()
4233 static int get_app_submode(const char *appid)
4237 pkgmgrinfo_appinfo_h handle = NULL;
4238 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4239 if (ret != PMINFO_R_OK)
4241 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4242 if (ret != PMINFO_R_OK) {
4243 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4246 printf("submode: %d\n", submode);
4247 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4252 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4255 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4256 * @brief This API gets the value for given application is process_pool or not from handle
4258 * @par This API is for package-manager client application
4259 * @par Sync (or) Async : Synchronous API
4261 * @param[in] handle pointer to application info handle
4262 * @param[out] process_pool pointer to hold process_pool is or not
4263 * @return 0 if success, error code(<0) if fail
4264 * @retval PMINFO_R_OK success
4265 * @retval PMINFO_R_EINVAL invalid argument
4266 * @retval PMINFO_R_ERROR internal error
4267 * @pre pkgmgrinfo_appinfo_get_appinfo()
4268 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4269 * @see pkgmgrinfo_appinfo_get_appid()
4271 static int get_app_process_pool(const char *appid)
4274 bool process_pool = 0;
4275 pkgmgrinfo_appinfo_h handle = NULL;
4276 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4277 if (ret != PMINFO_R_OK)
4279 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4280 if (ret != PMINFO_R_OK) {
4281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4284 printf("process_pool: %d\n", process_pool);
4285 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4290 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4293 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4294 * @brief This API gets the installed storage location of the application
4296 * @par This API is for package-manager client application
4297 * @par Sync (or) Async : Synchronous API
4299 * @param[in] handle pointer to the application info handle.
4300 * @param[out] app_type pointer to hold installed storage location
4301 * @return 0 if success, error code(<0) if fail
4302 * @retval PMINFO_R_OK success
4303 * @retval PMINFO_R_EINVAL invalid argument
4304 * @retval PMINFO_R_ERROR internal error
4305 * @pre pkgmgrinfo_appinfo_get_appinfo()
4306 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4307 * @see pkgmgrinfo_appinfo_get_appid()
4309 static int get_app_installed_location(const char *appid)
4312 pkgmgrinfo_installed_storage storage;
4313 pkgmgrinfo_appinfo_h handle = NULL;
4314 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4315 if (ret != PMINFO_R_OK)
4317 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4318 if (ret != PMINFO_R_OK) {
4319 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4322 printf("Installed storage location : %d\n", storage);
4323 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4328 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4332 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4333 * @brief This API checks if the application has the given category
4335 * @par This API is for package-manager client application
4336 * @par Sync (or) Async : Synchronous API
4338 * @param[in] handle pointer to the application info handle
4339 * @param[in] category category
4340 * @param[out] exist value Gets whether the application has the given category
4341 * @return 0 if success, error code(<0) if fail
4342 * @retval PMINFO_R_OK success
4343 * @retval PMINFO_R_EINVAL invalid argument
4344 * @retval PMINFO_R_ERROR internal error
4346 static int is_category_exist(const char *appid, const char *category)
4349 pkgmgrinfo_appinfo_h handle;
4352 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4353 if (ret != PMINFO_R_OK)
4356 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4357 if (ret != PMINFO_R_OK) {
4358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4367 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4370 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4371 * @brief This API gets the application 'ui_gadget' value from the app ID
4373 * @par This API is for package-manager client application
4374 * @par Sync (or) Async : Synchronous API
4376 * @param[in] handle pointer to application info handle
4377 * @param[out] ui_gadget pointer to hold package ui_gadget value
4378 * @return 0 if success, error code(<0) if fail
4379 * @retval PMINFO_R_OK success
4380 * @retval PMINFO_R_EINVAL invalid argument
4381 * @pre pkgmgrinfo_appinfo_get_appinfo()
4382 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4384 static int get_app_ui_gadget(const char *appid)
4388 pkgmgrinfo_appinfo_h handle = NULL;
4389 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4390 if (ret != PMINFO_R_OK)
4392 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4393 if (ret != PMINFO_R_OK) {
4394 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4397 printf("app ui_gadget: %d\n", ui_gadget);
4398 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4403 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4406 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4407 * @brief This API gets the application 'support_disable' value from the app ID
4409 * @par This API is for package-manager client application
4410 * @par Sync (or) Async : Synchronous API
4412 * @param[in] handle pointer to application info handle
4413 * @param[out] support_disable pointer to hold package support_disable value
4414 * @return 0 if success, error code(<0) if fail
4415 * @retval PMINFO_R_OK success
4416 * @retval PMINFO_R_EINVAL invalid argument
4417 * @pre pkgmgrinfo_appinfo_get_appinfo()
4418 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4420 static int get_app_support_disable(const char *appid)
4423 bool support_disable;
4424 pkgmgrinfo_appinfo_h handle = NULL;
4425 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4426 if (ret != PMINFO_R_OK)
4428 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4429 if (ret != PMINFO_R_OK) {
4430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4433 printf("app support_disable: %d\n", support_disable);
4434 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4439 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4442 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4443 * @brief This API gets the application 'is_disable' value from the app ID
4445 * @par This API is for package-manager client application
4446 * @par Sync (or) Async : Synchronous API
4448 * @param[in] handle pointer to application info handle
4449 * @param[out] disabled pointer to hold application is_disabled value
4450 * @return 0 if success, error code(<0) if fail
4451 * @retval PMINFO_R_OK success
4452 * @retval PMINFO_R_EINVAL invalid argument
4453 * @pre pkgmgrinfo_appinfo_get_appinfo()
4454 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4456 static int get_app_is_disable(const char *appid)
4460 pkgmgrinfo_appinfo_h handle = NULL;
4461 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4462 if (ret != PMINFO_R_OK)
4464 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4465 if (ret != PMINFO_R_OK) {
4466 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4469 printf("app is_disable: %d\n", is_disable);
4470 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4475 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4478 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4479 * @brief This API gets whethere the given application is global application or user application
4481 * @par This API is for package-manager client application
4482 * @par Sync (or) Async : Synchronous API
4484 * @param[in] handle pointer to application info handle
4485 * @param[in] global pointer to hold application global value
4486 * @return 0 if success, error code(<0) if fail
4487 * @retval PMINFO_R_OK success
4488 * @retval PMINFO_R_EINVAL invalid argument
4489 * @retval PMINFO_R_ERROR internal error
4490 * @pre pkgmgrinfo_appinfo_get_appinfo()
4491 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4492 * @see pkgmgrinfo_appinfo_get_appid()
4493 static int get_app_is_global(const char *appid)
4497 pkgmgrinfo_appinfo_h handle = NULL;
4498 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4499 if (ret != PMINFO_R_OK)
4501 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4502 if (ret != PMINFO_R_OK) {
4503 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4506 printf("app is_global: %d\n", global);
4507 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4512 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4515 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4516 * @brief This API gets the application 'splash_screen_display' value from the app ID
4518 * @par This API is for package-manager client application
4519 * @par Sync (or) Async : Synchronous API
4521 * @param[in] handle pointer to application info handle
4522 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
4523 * @return 0 if success, error code(<0) if fail
4524 * @retval PMINFO_R_OK success
4525 * @retval PMINFO_R_EINVAL invalid argument
4526 * @retval PMINFO_R_ERROR internal error
4528 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4531 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
4532 * @brief This API destroys the application information handle freeing up all the resources
4534 * @par This API is for package-manager client application
4535 * @par Sync (or) Async : Synchronous API
4537 * @param[in] handle pointer to the application info handle.
4538 * @return 0 if success, error code(<0) if fail
4539 * @retval PMINFO_R_OK success
4540 * @retval PMINFO_R_EINVAL invalid argument
4541 * @retval PMINFO_R_ERROR internal error
4542 * @pre pkgmgrinfo_appinfo_get_appinfo()
4544 * @see pkgmgrinfo_appinfo_get_pkgid()
4545 * @see pkgmgrinfo_appinfo_is_multiple()
4547 static int get_app_type(const char *appid)
4551 pkgmgrinfo_appinfo_h handle;
4552 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4553 if (ret != PMINFO_R_OK)
4555 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
4556 if (ret != PMINFO_R_OK) {
4557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4560 printf("apptype: %s\n", type);
4561 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4566 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
4569 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
4570 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
4571 The query will search the entire application information collected from the manifest file of all the installed packages
4573 * @par This API is for package-manager client application
4574 * @par Sync (or) Async : Synchronous API
4576 * @param[out] handle pointer to the application info filter handle.
4577 * @return 0 if success, error code(<0) if fail
4578 * @retval PMINFO_R_OK success
4579 * @retval PMINFO_R_EINVAL invalid argument
4580 * @retval PMINFO_R_ERROR internal error
4582 * @post pkgmgrinfo_appinfo_filter_destroy()
4583 * @see pkgmgrinfo_appinfo_filter_count()
4584 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4586 static int get_capp_count()
4590 pkgmgrinfo_appinfo_filter_h handle;
4591 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4592 if (ret != PMINFO_R_OK)
4594 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4595 if (ret != PMINFO_R_OK) {
4596 pkgmgrinfo_appinfo_filter_destroy(handle);
4599 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4600 if (ret != PMINFO_R_OK) {
4601 pkgmgrinfo_appinfo_filter_destroy(handle);
4604 printf("No of capp: %d\n", count);
4605 pkgmgrinfo_appinfo_filter_destroy(handle);
4610 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
4613 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
4614 * @brief This API destroys the application information filter handle freeing up all the resources
4616 * @par This API is for package-manager client application
4617 * @par Sync (or) Async : Synchronous API
4619 * @param[in] handle pointer to the application info filter handle.
4620 * @return 0 if success, error code(<0) if fail
4621 * @retval PMINFO_R_OK success
4622 * @retval PMINFO_R_EINVAL invalid argument
4623 * @retval PMINFO_R_ERROR internal error
4624 * @pre pkgmgrinfo_appinfo_filter_create()
4626 * @see pkgmgrinfo_appinfo_filter_count()
4627 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4629 static int get_capp_count()
4633 pkgmgrinfo_appinfo_filter_h handle;
4634 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4635 if (ret != PMINFO_R_OK)
4637 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4638 if (ret != PMINFO_R_OK) {
4639 pkgmgrinfo_appinfo_filter_destroy(handle);
4642 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4643 if (ret != PMINFO_R_OK) {
4644 pkgmgrinfo_appinfo_filter_destroy(handle);
4647 printf("No of capp: %d\n", count);
4648 pkgmgrinfo_appinfo_filter_destroy(handle);
4653 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
4656 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
4657 * @brief This API adds a boolean filter property to the filter handle
4659 * @par This API is for package-manager client application
4660 * @par Sync (or) Async : Synchronous API
4662 * @param[in] handle pointer to the application info filter handle.
4663 * @param[in] property boolean property name.
4664 * @param[in] value value corresponding to the property.
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_appinfo_filter_create()
4670 * @post pkgmgrinfo_appinfo_filter_destroy()
4671 * @see pkgmgrinfo_appinfo_filter_count()
4672 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4674 static int get_taskmanageable_app_count()
4678 pkgmgrinfo_appinfo_filter_h handle;
4679 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4680 if (ret != PMINFO_R_OK)
4682 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
4683 if (ret != PMINFO_R_OK) {
4684 pkgmgrinfo_appinfo_filter_destroy(handle);
4687 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4688 if (ret != PMINFO_R_OK) {
4689 pkgmgrinfo_appinfo_filter_destroy(handle);
4692 printf("No of taskmanageable apps: %d\n", count);
4693 pkgmgrinfo_appinfo_filter_destroy(handle);
4698 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
4699 const char *property, const bool value);
4702 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
4703 * @brief This API adds an integer filter property to the filter handle
4705 * @par This API is for package-manager client application
4706 * @par Sync (or) Async : Synchronous API
4708 * @param[in] handle pointer to the application info filter handle.
4709 * @param[in] property integer property name.
4710 * @param[in] value value corresponding to the property.
4711 * @return 0 if success, error code(<0) if fail
4712 * @retval PMINFO_R_OK success
4713 * @retval PMINFO_R_EINVAL invalid argument
4714 * @retval PMINFO_R_ERROR internal error
4715 * @pre pkgmgrinfo_appinfo_filter_create()
4716 * @post pkgmgrinfo_appinfo_filter_destroy()
4717 * @see pkgmgrinfo_appinfo_filter_count()
4718 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4720 static int get_taskmanageable_app_count()
4724 pkgmgrinfo_appinfo_filter_h handle;
4725 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4726 if (ret != PMINFO_R_OK)
4728 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
4729 if (ret != PMINFO_R_OK) {
4730 pkgmgrinfo_appinfo_filter_destroy(handle);
4733 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4734 if (ret != PMINFO_R_OK) {
4735 pkgmgrinfo_appinfo_filter_destroy(handle);
4738 printf("No of apps: %d\n", count);
4739 pkgmgrinfo_appinfo_filter_destroy(handle);
4744 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
4745 const char *property, const int value);
4748 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
4749 * @brief This API adds a string filter property to the filter handle
4751 * @par This API is for package-manager client application
4752 * @par Sync (or) Async : Synchronous API
4754 * @param[in] handle pointer to the application info filter handle.
4755 * @param[in] property string property name.
4756 * @param[in] value value corresponding to the property.
4757 * @return 0 if success, error code(<0) if fail
4758 * @retval PMINFO_R_OK success
4759 * @retval PMINFO_R_EINVAL invalid argument
4760 * @retval PMINFO_R_ERROR internal error
4761 * @pre pkgmgrinfo_appinfo_filter_create()
4762 * @post pkgmgrinfo_appinfo_filter_destroy()
4763 * @see pkgmgrinfo_appinfo_filter_count()
4764 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4766 static int get_capp_count()
4770 pkgmgrinfo_appinfo_filter_h handle;
4771 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4772 if (ret != PMINFO_R_OK)
4774 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4775 if (ret != PMINFO_R_OK) {
4776 pkgmgrinfo_appinfo_filter_destroy(handle);
4779 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4780 if (ret != PMINFO_R_OK) {
4781 pkgmgrinfo_appinfo_filter_destroy(handle);
4784 printf("No of capp: %d\n", count);
4785 pkgmgrinfo_appinfo_filter_destroy(handle);
4790 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
4791 const char *property, const char *value);
4794 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
4795 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
4797 * @par This API is for package-manager client application
4798 * @par Sync (or) Async : Synchronous API
4800 * @param[in] handle pointer to the application info filter handle.
4801 * @param[in] app_cb callback function.
4802 * @param[in] user_data user data to be passed to the callback function
4803 * @return 0 if success, error code(<0) if fail
4804 * @retval PMINFO_R_OK success
4805 * @retval PMINFO_R_EINVAL invalid argument
4806 * @retval PMINFO_R_ERROR internal error
4807 * @pre pkgmgrinfo_appinfo_filter_create()
4808 * @post pkgmgrinfo_appinfo_filter_destroy()
4809 * @see pkgmgrinfo_appinfo_filter_count()
4811 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4814 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4815 printf("appid : %s\n", appid);
4819 static int get_capp_list()
4822 pkgmgrinfo_appinfo_filter_h handle;
4823 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4824 if (ret != PMINFO_R_OK)
4826 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4827 if (ret != PMINFO_R_OK) {
4828 pkgmgrinfo_appinfo_filter_destroy(handle);
4831 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
4832 if (ret != PMINFO_R_OK) {
4833 pkgmgrinfo_appinfo_filter_destroy(handle);
4836 pkgmgrinfo_appinfo_filter_destroy(handle);
4841 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4842 pkgmgrinfo_app_list_cb app_cb, void *user_data);
4843 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
4844 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
4847 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
4848 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
4849 * @brief This API counts the application that satisfy the filter conditions
4851 * @par This API is for package-manager client application
4852 * @par Sync (or) Async : Synchronous API
4854 * @param[in] handle pointer to the application info filter handle.
4855 * @param[in] count pointer to store count value
4856 * @param[in] uid the addressee user id of the instruction
4857 * @return 0 if success, error code(<0) if fail
4858 * @retval PMINFO_R_OK success
4859 * @retval PMINFO_R_EINVAL invalid argument
4860 * @retval PMINFO_R_ERROR internal error
4861 * @pre pkgmgrinfo_appinfo_filter_create()
4862 * @post pkgmgrinfo_appinfo_filter_destroy()
4863 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
4865 static int get_capp_count()
4869 pkgmgrinfo_appinfo_filter_h handle;
4870 ret = pkgmgrinfo_appinfo_filter_create(&handle);
4871 if (ret != PMINFO_R_OK)
4873 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
4874 if (ret != PMINFO_R_OK) {
4875 pkgmgrinfo_appinfo_filter_destroy(handle);
4878 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
4879 if (ret != PMINFO_R_OK) {
4880 pkgmgrinfo_appinfo_filter_destroy(handle);
4883 printf("No of capp: %d\n", count);
4884 pkgmgrinfo_appinfo_filter_destroy(handle);
4889 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
4890 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
4892 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
4893 * @brief This API creates the application's metadata information filter handle from db.
4895 * @par This API is for package-manager client application
4896 * @par Sync (or) Async : Synchronous API
4898 * @param[out] handle pointer to the application metadata info filter handle.
4899 * @return 0 if success, error code(<0) if fail
4900 * @retval PMINFO_R_OK success
4901 * @retval PMINFO_R_EINVAL invalid argument
4902 * @retval PMINFO_R_ERROR internal error
4904 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
4905 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4907 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4910 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4911 printf("appid : %s\n", appid);
4915 static int get_app_list(const char *mkey, const char *mvalue)
4918 pkgmgrinfo_appinfo_metadata_filter_h handle;
4919 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4920 if (ret != PMINFO_R_OK)
4922 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4923 if (ret != PMINFO_R_OK) {
4924 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4927 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4928 if (ret != PMINFO_R_OK) {
4929 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4932 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4937 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
4940 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
4941 * @brief This API destroys the application's metadata information filter handle.
4943 * @par This API is for package-manager client application
4944 * @par Sync (or) Async : Synchronous API
4946 * @param[in] handle pointer to the application metadata info filter handle.
4947 * @return 0 if success, error code(<0) if fail
4948 * @retval PMINFO_R_OK success
4949 * @retval PMINFO_R_EINVAL invalid argument
4950 * @retval PMINFO_R_ERROR internal error
4951 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
4953 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
4955 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
4958 pkgmgrinfo_appinfo_get_appid(handle, &appid);
4959 printf("appid : %s\n", appid);
4963 static int get_app_list(const char *mkey, const char *mvalue)
4966 pkgmgrinfo_appinfo_metadata_filter_h handle;
4967 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
4968 if (ret != PMINFO_R_OK)
4970 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
4971 if (ret != PMINFO_R_OK) {
4972 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4975 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
4976 if (ret != PMINFO_R_OK) {
4977 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4980 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
4985 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
4988 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
4989 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
4990 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
4992 * @par This API is for package-manager client application
4993 * @par Sync (or) Async : Synchronous API
4995 * @param[in] handle pointer to the application metadata info filter handle.
4996 * @param[in] key pointer to metadata key
4997 * @param[in] value pointer to metadata value
4998 * @return 0 if success, error code(<0) if fail
4999 * @retval PMINFO_R_OK success
5000 * @retval PMINFO_R_EINVAL invalid argument
5001 * @retval PMINFO_R_ERROR internal error
5002 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5003 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5004 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5006 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5009 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5010 printf("appid : %s\n", appid);
5014 static int get_app_list(const char *mkey, const char *mvalue)
5017 pkgmgrinfo_appinfo_metadata_filter_h handle;
5018 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5019 if (ret != PMINFO_R_OK)
5021 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5022 if (ret != PMINFO_R_OK) {
5023 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5026 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5027 if (ret != PMINFO_R_OK) {
5028 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5031 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5036 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5037 const char *key, const char *value);
5040 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5041 * @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)
5042 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5043 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5044 * negative value, no more callbacks will be called and API will return.
5046 * @par This API is for package-manager client application
5047 * @par Sync (or) Async : Synchronous API
5049 * @param[in] handle pointer to the application metadata info filter handle.
5050 * @param[in] app_cb function pointer to callback
5051 * @param[in] user_data pointer to user data
5052 * @param[in] uid the addressee user id of the instruction
5053 * @return 0 if success, error code(<0) if fail
5054 * @retval PMINFO_R_OK success
5055 * @retval PMINFO_R_EINVAL invalid argument
5056 * @retval PMINFO_R_ERROR internal error
5057 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5058 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5060 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5063 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5064 printf("appid : %s\n", appid);
5068 static int get_app_list(const char *mkey, const char *mvalue)
5071 pkgmgrinfo_appinfo_metadata_filter_h handle;
5072 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5073 if (ret != PMINFO_R_OK)
5075 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5076 if (ret != PMINFO_R_OK) {
5077 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5080 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5081 if (ret != PMINFO_R_OK) {
5082 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5085 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5090 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5091 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5092 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5093 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5095 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5096 * @brief This API creates the package cert information handle to get data from db.
5098 * @par This API is for package-manager client application
5099 * @par Sync (or) Async : Synchronous API
5101 * @param[out] handle pointer to the package cert handle.
5102 * @return 0 if success, error code(<0) if fail
5103 * @retval PMINFO_R_OK success
5104 * @retval PMINFO_R_EINVAL invalid argument
5105 * @retval PMINFO_R_ERROR internal error
5107 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5108 * @see pkgmgrinfo_pkginfo_get_cert_value()
5109 * @see pkgmgrinfo_pkginfo_load_certinfo()
5111 static int get_cert_info(const char *pkgid)
5114 pkgmgrinfo_certinfo_h handle;
5115 char *auth_cert = NULL;
5116 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5117 if (ret != PMINFO_R_OK)
5119 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5120 if (ret != PMINFO_R_OK) {
5121 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5124 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5125 if (ret != PMINFO_R_OK) {
5126 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5129 printf("Author root certificate: %s\n", auth_root);
5130 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5135 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5138 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5139 * @brief This API loads the package cert information handle with data from db.
5141 * @par This API is for package-manager client application
5142 * @par Sync (or) Async : Synchronous API
5144 * @param[in] pkgid pointer to the package ID.
5145 * @param[in] handle pointer to the package cert handle.
5146 * @return 0 if success, error code(<0) if fail
5147 * @retval PMINFO_R_OK success
5148 * @retval PMINFO_R_EINVAL invalid argument
5149 * @retval PMINFO_R_ERROR internal error
5150 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5151 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5152 * @see pkgmgrinfo_pkginfo_get_cert_value()
5154 static int get_cert_info(const char *pkgid)
5157 pkgmgrinfo_certinfo_h handle;
5158 char *auth_cert = NULL;
5159 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5160 if (ret != PMINFO_R_OK)
5162 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5163 if (ret != PMINFO_R_OK) {
5164 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5167 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5168 if (ret != PMINFO_R_OK) {
5169 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5172 printf("Author root certificate: %s\n", auth_root);
5173 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5178 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5181 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5182 * @brief This API gets the package cert information from the handle
5184 * @par This API is for package-manager client application
5185 * @par Sync (or) Async : Synchronous API
5187 * @param[in] handle pointer to the package cert handle.
5188 * @param[in] cert_type certificate type
5189 * @param[out] cert_value pointer to hold certificate value
5190 * @return 0 if success, error code(<0) if fail
5191 * @retval PMINFO_R_OK success
5192 * @retval PMINFO_R_EINVAL invalid argument
5193 * @retval PMINFO_R_ERROR internal error
5194 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5195 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
5196 * @see pkgmgrinfo_pkginfo_load_certinfo()
5198 static int get_cert_info(const char *pkgid)
5201 pkgmgrinfo_certinfo_h handle;
5202 char *auth_cert = NULL;
5203 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5204 if (ret != PMINFO_R_OK)
5206 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5207 if (ret != PMINFO_R_OK) {
5208 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5211 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5212 if (ret != PMINFO_R_OK) {
5213 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5216 printf("Author root certificate: %s\n", auth_root);
5217 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5222 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5225 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5226 * @brief This API destroys the package cert information handle freeing up all the resources
5228 * @par This API is for package-manager client application
5229 * @par Sync (or) Async : Synchronous API
5231 * @param[in] handle pointer to the package cert handle.
5232 * @return 0 if success, error code(<0) if fail
5233 * @retval PMINFO_R_OK success
5234 * @retval PMINFO_R_EINVAL invalid argument
5235 * @retval PMINFO_R_ERROR internal error
5236 * @pre pkgmgrinfo_pkginfo_create_certinfo()
5238 * @see pkgmgrinfo_pkginfo_load_certinfo()
5240 static int get_cert_info(const char *pkgid)
5243 pkgmgrinfo_certinfo_h handle;
5244 char *auth_cert = NULL;
5245 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5246 if (ret != PMINFO_R_OK)
5248 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5249 if (ret != PMINFO_R_OK) {
5250 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5253 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5254 if (ret != PMINFO_R_OK) {
5255 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5258 printf("Author root certificate: %s\n", auth_root);
5259 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5264 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5267 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5268 * @brief This API deletes the package cert information from DB
5270 * @par This API is for package-manager client application
5271 * @par Sync (or) Async : Synchronous API
5273 * @param[in] pkgid pointer to the package ID.
5274 * @return 0 if success, error code(<0) if fail
5275 * @retval PMINFO_R_OK success
5276 * @retval PMINFO_R_EINVAL invalid argument
5277 * @retval PMINFO_R_ERROR internal error
5281 static int delete_cert_info(const char *pkgid)
5284 ret = pkgmgrinfo_delete_certinfo(pkgid);
5285 if (ret != PMINFO_R_OK)
5291 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5292 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5295 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5296 * @brief This API creates the package cert information handle to set data in db.
5298 * @par This API is for package-manager client application
5299 * @par Sync (or) Async : Synchronous API
5301 * @param[out] handle pointer to the package cert handle.
5302 * @return 0 if success, error code(<0) if fail
5303 * @retval PMINFO_R_OK success
5304 * @retval PMINFO_R_EINVAL invalid argument
5305 * @retval PMINFO_R_ERROR internal error
5307 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5308 * @see pkgmgrinfo_set_cert_value()
5309 * @see pkgmgrinfo_save_certinfo()
5311 static int set_cert_in_db(const char *pkgid)
5314 pkgmgrinfo_instcertinfo_h handle;
5315 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5316 if (ret != PMINFO_R_OK)
5318 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5319 if (ret != PMINFO_R_OK) {
5320 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5323 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5324 if (ret != PMINFO_R_OK) {
5325 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5328 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5333 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5336 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5337 * @brief This API sets the package cert information in the handle.
5339 * @par This API is for package-manager client application
5340 * @par Sync (or) Async : Synchronous API
5342 * @param[in] handle pointer to the package cert handle.
5343 * @param[in] cert_type certificate type.
5344 * @param[in] cert_value certificate value.
5345 * @return 0 if success, error code(<0) if fail
5346 * @retval PMINFO_R_OK success
5347 * @retval PMINFO_R_EINVAL invalid argument
5348 * @retval PMINFO_R_ERROR internal error
5349 * @pre pkgmgrinfo_create_certinfo_set_handle()
5350 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5351 * @see pkgmgrinfo_save_certinfo()
5353 static int set_cert_in_db(const char *pkgid)
5356 pkgmgrinfo_instcertinfo_h handle;
5357 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5358 if (ret != PMINFO_R_OK)
5360 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5361 if (ret != PMINFO_R_OK) {
5362 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5365 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5366 if (ret != PMINFO_R_OK) {
5367 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5370 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5375 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5378 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5379 * @brief This API saves the package cert information in the DB.
5381 * @par This API is for package-manager client application
5382 * @par Sync (or) Async : Synchronous API
5384 * @param[in] pkgid pointer to the package ID.
5385 * @param[in] handle pointer to the package cert handle.
5386 * @return 0 if success, error code(<0) if fail
5387 * @retval PMINFO_R_OK success
5388 * @retval PMINFO_R_EINVAL invalid argument
5389 * @retval PMINFO_R_ERROR internal error
5390 * @pre pkgmgrinfo_create_certinfo_set_handle()
5391 * @post pkgmgrinfo_destroy_certinfo_set_handle()
5392 * @see pkgmgrinfo_save_certinfo()
5394 static int set_cert_in_db(const char *pkgid)
5397 pkgmgrinfo_instcertinfo_h handle;
5398 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5399 if (ret != PMINFO_R_OK)
5401 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5402 if (ret != PMINFO_R_OK) {
5403 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5406 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5407 if (ret != PMINFO_R_OK) {
5408 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5411 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5416 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5419 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5420 * @brief This API destroys the package cert information handle freeing up all the resources.
5422 * @par This API is for package-manager client application
5423 * @par Sync (or) Async : Synchronous API
5425 * @param[in] handle pointer to the package cert handle.
5426 * @return 0 if success, error code(<0) if fail
5427 * @retval PMINFO_R_OK success
5428 * @retval PMINFO_R_EINVAL invalid argument
5429 * @retval PMINFO_R_ERROR internal error
5430 * @pre pkgmgrinfo_create_certinfo_set_handle()
5432 * @see pkgmgrinfo_save_certinfo()
5434 static int set_cert_in_db(const char *pkgid)
5437 pkgmgrinfo_instcertinfo_h handle;
5438 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5439 if (ret != PMINFO_R_OK)
5441 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5442 if (ret != PMINFO_R_OK) {
5443 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5446 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5447 if (ret != PMINFO_R_OK) {
5448 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5451 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5456 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5459 * @fn int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access)
5460 * @brief This API gets the datacontrol info
5462 * @par This API is for package-manager client application
5463 * @par Sync (or) Async : Synchronous API
5465 * @param[in] providerid pointer to the providerid of dataconltrol.
5466 * @param[in] type pointer to the type of dataconltrol.
5467 * @param[out] appid pointer to hold appid, need to free after using
5468 * @param[out] access pointer to hold access, need to free after using
5469 * @return 0 if success, error code(<0) if fail
5470 * @retval PMINFO_R_OK success
5471 * @retval PMINFO_R_EINVAL invalid argument
5472 * @retval PMINFO_R_ERROR internal error
5475 int pkgmgrinfo_datacontrol_get_info(const char *providerid, const char * type, char **appid, char **access);
5478 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5479 * @brief This API gets the application 'guest mode visibility' value from the DB
5481 * @par This API is for package-manager client application
5482 * @par Sync (or) Async : Synchronous API
5484 * @param[in] handle pointer to application info handle
5485 * @param[out] status pointer to hold app guest mode visibility value
5486 * @return 0 if success, error code(<0) if fail
5487 * @retval PMINFO_R_OK success
5488 * @retval PMINFO_R_EINVAL invalid argument
5489 * @retval PMINFO_R_ERROR internal error
5490 * @pre pkgmgrinfo_appinfo_get_appinfo()
5491 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5492 * @see pkgmgrinfo_appinfo_get_appid()
5493 * @see pkgmgrinfo_appinfo_is_multiple()
5495 static int get_app_guestmode_visibility(const char *appid)
5499 pkgmgrinfo_appinfo_h handle;
5500 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5501 if (ret != PMINFO_R_OK)
5503 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
5504 if (ret != PMINFO_R_OK) {
5505 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5508 printf("app guest mode visibility: %d\n", status);
5509 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5514 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
5517 * @fn int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status)
5518 * @brief This API sets the application 'guest mode visibility' value in the DB
5520 * @par This API is for package-manager client application
5521 * @par Sync (or) Async : Synchronous API
5523 * @param[in] handle pointer to application info handle
5524 * @param[out] status app guest mode visibility value
5525 * @return 0 if success, error code(<0) if fail
5526 * @retval PMINFO_R_OK success
5527 * @retval PMINFO_R_EINVAL invalid argument
5528 * @retval PMINFO_R_ERROR internal error
5529 * @pre pkgmgrinfo_appinfo_get_appinfo()
5530 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5531 * @see pkgmgrinfo_appinfo_get_appid()
5532 * @see pkgmgrinfo_appinfo_is_multiple()
5534 static int set_app_guestmode_visibility(const char *appid, bool value)
5537 pkgmgrinfo_appinfo_h handle;
5538 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5539 if (ret != PMINFO_R_OK)
5541 ret = pkgmgrinfo_appinfo_set_guestmode_visibility(handle, value);
5542 if (ret != PMINFO_R_OK) {
5543 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5551 int pkgmgrinfo_appinfo_set_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool status);
5552 int pkgmgrinfo_appinfo_set_usr_guestmode_visibility(pkgmgrinfo_appinfo_h handle, uid_t uid, bool status);
5555 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
5556 * @brief This API sets the package 'installed_storage' value in db
5558 * @par This API is for package-manager client application
5559 * @par Sync (or) Async : Synchronous API
5561 * @param[in] pkgid pointer to the package ID.
5562 * @param[in] location package install location
5563 * @return 0 if success, error code(<0) if fail
5564 * @retval PMINFO_R_OK success
5565 * @retval PMINFO_R_EINVAL invalid argument
5566 * @retval PMINFO_R_ERROR internal error
5568 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
5572 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
5573 if (ret != PMINFO_R_OK) {
5580 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location);
5581 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char * pkgid, INSTALL_LOCATION location, uid_t uid);
5584 * @pkgmgrinfo client API
5588 * @brief listening status type in pkgmgrinfo.
5590 #define PMINFO_CLIENT_STATUS_ALL 0x00
5591 #define PMINFO_CLIENT_STATUS_INSTALL 0x01
5592 #define PMINFO_CLIENT_STATUS_UNINSTALL 0x02
5593 #define PMINFO_CLIENT_STATUS_UPGRADE 0x04
5594 #define PMINFO_CLIENT_STATUS_MOVE 0x08
5595 #define PMINFO_CLIENT_STATUS_CLEAR_DATA 0x10
5596 #define PMINFO_CLIENT_STATUS_INSTALL_PROGRESS 0x20
5599 * @brief This APIs provides pkgmgrinfo client listener
5601 pkgmgrinfo_client *pkgmgrinfo_client_new(pkgmgrinfo_client_type ctype);
5602 int pkgmgrinfo_client_set_status_type(pkgmgrinfo_client *pc, int status_type);
5603 int pkgmgrinfo_client_listen_status(pkgmgrinfo_client *pc, pkgmgrinfo_handler event_cb, void *data);
5604 int pkgmgrinfo_client_free(pkgmgrinfo_client *pc);
5605 int pkgmgrinfo_client_request_enable_external_pkg(char *pkgid);
5612 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5613 int flag, void *user_data, uid_t uid);
5614 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
5615 int flag, void *user_data);
5616 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
5617 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
5619 int pkgmgrinfo_appinfo_get_installed_list_full(
5620 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
5623 * @pkgmgrinfo client API end
5631 #endif /* __PKG_INFO_H__ */