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"
95 /** String property for filtering based on package info*/
96 #define PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
116 /** Boolean property for filtering based on package info*/
117 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
119 /** Integer property for filtering based on package info*/
120 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
148 /** String property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
151 /** Integer property for filtering app support mode */
152 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
174 /** Boolean property for filtering based on app info*/
175 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
177 /** will be updated*/
178 /** string property for filtering based on pkg info*/
179 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
181 /* For multiuser support */
182 const char *getIconPath(uid_t uid, bool readonly);
183 char *getUserPkgParserDBPath(void);
184 char *getUserPkgParserDBPathUID(uid_t uid);
185 char *getUserPkgCertDBPath(void);
186 const char *getUserManifestPath(uid_t uid, bool readonly);
189 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
190 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
191 * @brief This API gets list of installed packages
193 * @par This API is for package-manager client application
194 * @par Sync (or) Async : Synchronous API
195 * @param[in] pkg_list_cb iteration function for list
196 * @param[in] user_data user data to be passed to callback function
197 * @param[in] uid the addressee user id of the instruction
198 * @return 0 if success, error code(<0) if fail
199 * @retval PMINFO_R_OK success
200 * @retval PMINFO_R_EINVAL invalid argument
201 * @retval PMINFO_R_ERROR internal error
205 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
209 pkgid1 = (char *)user_data;
210 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
211 if (strcmp(pkgid1, pkgid2) == 0) {
218 static int list_pkgs()
221 char *name = "helloworld";
222 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
223 if (ret != PMINFO_R_OK) {
230 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
231 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
234 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
235 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
236 * @brief This API gets list of disabled packages
238 * @par This API is for package-manager client application
239 * @par Sync (or) Async : Synchronous API
240 * @param[in] pkg_list_cb iteration function for list
241 * @param[in] user_data user data to be passed to callback function
242 * @param[in] uid the addressee user id of the instruction
243 * @return 0 if success, error code(<0) if fail
244 * @retval PMINFO_R_OK success
245 * @retval PMINFO_R_EINVAL invalid argument
246 * @retval PMINFO_R_ERROR internal error
250 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
251 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
254 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
255 * @brief This API creates the package information handle from db which is not disabled
257 * @par This API is for package-manager client application
258 * @par Sync (or) Async : Synchronous API
260 * @param[in] pkgid pointer to package ID
261 * @param[in] uid the addressee user id of the instruction
262 * @param[out] handle pointer to the package info handle.
263 * @return 0 if success, error code(<0) if fail
264 * @retval PMINFO_R_OK success
265 * @retval PMINFO_R_EINVAL invalid argument
266 * @retval PMINFO_R_ERROR internal error
268 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
269 * @see pkgmgrinfo_pkginfo_get_pkgid()
270 * @see pkgmgrinfo_pkginfo_is_removable()
272 static int get_pkg_type(const char *pkgid)
276 pkgmgrinfo_pkginfo_h handle;
277 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
278 if (ret != PMINFO_R_OK)
280 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
281 if (ret != PMINFO_R_OK) {
282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285 printf("pkgtype: %s\n", type);
286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
291 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
292 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
295 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
296 * @brief This API creates the disabled package information handle from db
298 * @par This API is for package-manager client application
299 * @par Sync (or) Async : Synchronous API
301 * @param[in] pkgid pointer to package ID
302 * @param[in] uid the addressee user id of the instruction
303 * @param[out] handle pointer to the package info handle.
304 * @return 0 if success, error code(<0) if fail
305 * @retval PMINFO_R_OK success
306 * @retval PMINFO_R_EINVAL invalid argument
307 * @retval PMINFO_R_ERROR internal error
309 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
310 * @see pkgmgrinfo_pkginfo_get_pkginfo()
312 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
313 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
316 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
317 * @brief This API creates the package information handle from db regardless of its disable or storage status
319 * @par This API is for package-manager client application
320 * @par Sync (or) Async : Synchronous API
322 * @param[in] pkgid pointer to package ID
323 * @param[in] uid the addressee user id of the instruction
324 * @param[out] handle pointer to the package info handle.
325 * @return 0 if success, error code(<0) if fail
326 * @retval PMINFO_R_OK success
327 * @retval PMINFO_R_EINVAL invalid argument
328 * @retval PMINFO_R_ERROR internal error
330 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
331 * @see pkgmgrinfo_pkginfo_get_pkgid()
332 * @see pkgmgrinfo_pkginfo_is_removable()
334 static int get_pkg_type(const char *pkgid)
338 pkgmgrinfo_pkginfo_h handle;
339 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
340 if (ret != PMINFO_R_OK)
342 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
343 if (ret != PMINFO_R_OK) {
344 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347 printf("pkgtype: %s\n", type);
348 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
353 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
354 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
357 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
358 * @brief This API gets the package name from the package ID
360 * @par This API is for package-manager client application
361 * @par Sync (or) Async : Synchronous API
363 * @param[in] handle pointer to package info handle
364 * @param[out] pkg_name pointer to hold package name
365 * @return 0 if success, error code(<0) if fail
366 * @retval PMINFO_R_OK success
367 * @retval PMINFO_R_EINVAL invalid argument
368 * @retval PMINFO_R_ERROR internal error
369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
371 * @see pkgmgrinfo_pkginfo_get_type()
372 * @see pkgmgrinfo_pkginfo_is_removable()
374 static int get_pkg_name(const char *pkgid)
377 char *pkgname = NULL;
378 pkgmgrinfo_pkginfo_h handle;
379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
380 if (ret != PMINFO_R_OK)
382 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
383 if (ret != PMINFO_R_OK) {
384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
387 printf("pkgname: %s\n", pkgname);
388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
393 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
396 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
397 * @brief This API gets the package id from the package ID
399 * @par This API is for package-manager client application
400 * @par Sync (or) Async : Synchronous API
402 * @param[in] handle pointer to package info handle
403 * @param[out] pkgid pointer to hold package id
404 * @return 0 if success, error code(<0) if fail
405 * @retval PMINFO_R_OK success
406 * @retval PMINFO_R_EINVAL invalid argument
407 * @retval PMINFO_R_ERROR internal error
408 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
410 * @see pkgmgrinfo_pkginfo_get_type()
411 * @see pkgmgrinfo_pkginfo_is_removable()
413 static int get_pkgid(const char *pkgid)
417 pkgmgrinfo_pkginfo_h handle;
418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419 if (ret != PMINFO_R_OK)
421 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
422 if (ret != PMINFO_R_OK) {
423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426 printf("pkg id: %s\n", pkg_id);
427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
432 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
435 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
436 * @brief This API gets the package type from the package ID
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] handle pointer to package info handle
442 * @param[out] type pointer to hold package type
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_pkgid()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_type(const char *pkgid)
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgtype: %s\n", type);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
474 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
475 * @brief This API gets the package version from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] version pointer to hold package version
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_pkgid()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkg_version(const char *pkgid)
494 char *version = NULL;
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkg version: %s\n", version);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
513 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
514 * @brief This API gets the package api_version from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] api_version pointer to hold package api_version
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_pkgid()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkg_api_version(const char *pkgid)
533 char *api_version = NULL;
534 pkgmgrinfo_pkginfo_h handle = NULL;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkg api_version: %s\n", api_version);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
552 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
553 * @brief This API gets tep(tizen expansion package) file name associated with the package
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to the pkginfo handle.
559 * @param[out] tep_name pointer to hold tep name
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
568 static int get_tep_name(const char *pkgid)
571 char *tep_name = NULL;
572 pkgmgrinfo_pkginfo_h handle = NULL;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("TEP name is: %s\n", tep_name);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
590 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
591 * @brief This API gets package mount point path associated with the package
592 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to the pkginfo handle.
598 * @param[out] zip_mount_file pointer to hold zip mount file
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
607 static int get_zip_mount_file(const char *pkgid)
610 char *zip_mount_file = NULL;
611 pkgmgrinfo_pkginfo_h handle = NULL;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 if (zip_mount_file != NULL)
621 printf("Zip mount path is: %s\n", zip_mount_file);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
630 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
631 * @brief This API gets package external image path associated with the package
632 * if package is installed in external storage.
633 * Otherwise, the return value will be PMINFO_R_ENOENT.
635 * @par This API is for package-manager client application
636 * @par Sync (or) Async : Synchronous API
638 * @param[in] handle pointer to the pkginfo handle.
639 * @param[out] ext_image_path pointer to hold external image path
640 * @return 0 if success, error code(<0) if fail
641 * @retval PMINFO_R_OK success
642 * @retval PMINFO_R_EINVAL invalid argument
643 * @retval PMINFO_R_ERROR internal error
644 * @revall PMINFO_R_ENOENT no valid data
645 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
646 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
647 * @see pkgmgrinfo_pkginfo_get_pkgid()
649 static int get_external_image_path(const char *pkgid)
652 char *ext_image_path = NULL;
653 pkgmgrinfo_pkginfo_h handle = NULL;
654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655 if (ret != PMINFO_R_OK)
657 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
658 if (ret != PMINFO_R_OK) {
659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662 printf("external image path is: %s\n", ext_image_path);
663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
668 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
671 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
672 * @brief This API gets the package install location from the package ID
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] location pointer to hold package install location
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
683 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
684 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
685 * @see pkgmgrinfo_pkginfo_get_pkgid()
686 * @see pkgmgrinfo_pkginfo_is_removable()
688 static int get_pkg_install_location(const char *pkgid)
691 pkgmgrinfo_install_location location;
692 pkgmgrinfo_pkginfo_h handle;
693 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
694 if (ret != PMINFO_R_OK)
696 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
697 if (ret != PMINFO_R_OK) {
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701 printf("pkg install location: %d\n", location);
702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
707 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
710 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
711 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
712 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
713 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
715 * @par This API is for package-manager client application
716 * @par Sync (or) Async : Synchronous API
718 * @param[in] handle pointer to package info handle
719 * @param[out] size pointer to hold package size
720 * @return 0 if success, error code(<0) if fail
721 * @retval PMINFO_R_OK success
722 * @retval PMINFO_R_EINVAL invalid argument
723 * @retval PMINFO_R_ERROR internal error
724 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
725 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
726 * @see pkgmgrinfo_pkginfo_get_pkgid()
727 * @see pkgmgrinfo_pkginfo_is_removable()
729 static int get_pkg_size(const char *pkgid)
733 pkgmgrinfo_pkginfo_h handle;
734 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
735 if (ret != PMINFO_R_OK)
737 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
738 if (ret != PMINFO_R_OK) {
739 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742 printf("pkgsize: %d\n", size);
743 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
748 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
751 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
752 * @brief This API gets the package icon from the package ID
754 * @par This API is for package-manager client application
755 * @par Sync (or) Async : Synchronous API
757 * @param[in] handle pointer to package info handle
758 * @param[out] icon pointer to hold package icon
759 * @return 0 if success, error code(<0) if fail
760 * @retval PMINFO_R_OK success
761 * @retval PMINFO_R_EINVAL invalid argument
762 * @retval PMINFO_R_ERROR internal error
763 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
764 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
765 * @see pkgmgrinfo_pkginfo_get_pkgid()
766 * @see pkgmgrinfo_pkginfo_is_removable()
768 static int get_pkg_icon(const char *pkgid)
772 pkgmgrinfo_pkginfo_h handle;
773 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
774 if (ret != PMINFO_R_OK)
776 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
777 if (ret != PMINFO_R_OK) {
778 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
781 printf("pkg icon: %s\n", icon);
782 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
787 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
790 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
791 * @brief This API gets the package label from the package ID
793 * @par This API is for package-manager client application
794 * @par Sync (or) Async : Synchronous API
796 * @param[in] handle pointer to package info handle
797 * @param[out] label pointer to hold package label
798 * @return 0 if success, error code(<0) if fail
799 * @retval PMINFO_R_OK success
800 * @retval PMINFO_R_EINVAL invalid argument
801 * @retval PMINFO_R_ERROR internal error
802 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
803 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
804 * @see pkgmgrinfo_pkginfo_get_pkgid()
805 * @see pkgmgrinfo_pkginfo_is_removable()
807 static int get_pkg_label(const char *pkgid)
811 pkgmgrinfo_pkginfo_h handle;
812 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
813 if (ret != PMINFO_R_OK)
815 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
816 if (ret != PMINFO_R_OK) {
817 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
820 printf("pkg label: %s\n", label);
821 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
826 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
829 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
830 * @brief This API gets the package description from the package ID
832 * @par This API is for package-manager client application
833 * @par Sync (or) Async : Synchronous API
835 * @param[in] handle pointer to package info handle
836 * @param[out] description pointer to hold package description
837 * @return 0 if success, error code(<0) if fail
838 * @retval PMINFO_R_OK success
839 * @retval PMINFO_R_EINVAL invalid argument
840 * @retval PMINFO_R_ERROR internal error
841 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
842 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
843 * @see pkgmgrinfo_pkginfo_get_pkgid()
844 * @see pkgmgrinfo_pkginfo_is_removable()
846 static int get_pkg_description(const char *pkgid)
849 char *description = NULL;
850 pkgmgrinfo_pkginfo_h handle;
851 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
852 if (ret != PMINFO_R_OK)
854 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
855 if (ret != PMINFO_R_OK) {
856 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
859 printf("pkg description: %s\n", description);
860 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
865 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
868 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
869 * @brief This API gets the package's author name from the package ID
871 * @par This API is for package-manager client application
872 * @par Sync (or) Async : Synchronous API
874 * @param[in] handle pointer to package info handle
875 * @param[out] author_name pointer to hold package author name
876 * @return 0 if success, error code(<0) if fail
877 * @retval PMINFO_R_OK success
878 * @retval PMINFO_R_EINVAL invalid argument
879 * @retval PMINFO_R_ERROR internal error
880 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
881 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
882 * @see pkgmgrinfo_pkginfo_get_pkgid()
883 * @see pkgmgrinfo_pkginfo_is_removable()
885 static int get_pkg_author_name(const char *pkgid)
888 char *author_name = NULL;
889 pkgmgrinfo_pkginfo_h handle;
890 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
891 if (ret != PMINFO_R_OK)
893 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
894 if (ret != PMINFO_R_OK) {
895 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
898 printf("pkg author name: %s\n", author_name);
899 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
904 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
907 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
908 * @brief This API gets the package's author email from the package ID
910 * @par This API is for package-manager client application
911 * @par Sync (or) Async : Synchronous API
913 * @param[in] handle pointer to package info handle
914 * @param[out] author_email pointer to hold package author email
915 * @return 0 if success, error code(<0) if fail
916 * @retval PMINFO_R_OK success
917 * @retval PMINFO_R_EINVAL invalid argument
918 * @retval PMINFO_R_ERROR internal error
919 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
920 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
921 * @see pkgmgrinfo_pkginfo_get_pkgid()
922 * @see pkgmgrinfo_pkginfo_is_removable()
924 static int get_pkg_author_email(const char *pkgid)
927 char *author_email = NULL;
928 pkgmgrinfo_pkginfo_h handle;
929 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
930 if (ret != PMINFO_R_OK)
932 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
933 if (ret != PMINFO_R_OK) {
934 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
937 printf("pkg author email: %s\n", author_email);
938 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
943 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
946 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
947 * @brief This API gets the package's author href from the package ID
949 * @par This API is for package-manager client application
950 * @par Sync (or) Async : Synchronous API
952 * @param[in] handle pointer to package info handle
953 * @param[out] author_href pointer to hold package author href
954 * @return 0 if success, error code(<0) if fail
955 * @retval PMINFO_R_OK success
956 * @retval PMINFO_R_EINVAL invalid argument
957 * @retval PMINFO_R_ERROR internal error
958 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
959 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
960 * @see pkgmgrinfo_pkginfo_get_pkgid()
961 * @see pkgmgrinfo_pkginfo_is_removable()
963 static int get_pkg_author_href(const char *pkgid)
966 char *author_href = NULL;
967 pkgmgrinfo_pkginfo_h handle;
968 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
969 if (ret != PMINFO_R_OK)
971 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
972 if (ret != PMINFO_R_OK) {
973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
976 printf("pkg author href: %s\n", author_href);
977 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
982 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
985 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
986 * @brief This API gets the package installed storagae value from the package ID
988 * @par This API is for package-manager client application
989 * @par Sync (or) Async : Synchronous API
991 * @param[in] handle pointer to package info handle
992 * @param[out] storage pointer to hold package installed storage
993 * @return 0 if success, error code(<0) if fail
994 * @retval PMINFO_R_OK success
995 * @retval PMINFO_R_EINVAL invalid argument
996 * @retval PMINFO_R_ERROR internal error
997 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
998 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
999 * @see pkgmgrinfo_pkginfo_get_pkgid()
1000 * @see pkgmgrinfo_pkginfo_is_removable()
1002 static int get_pkg_installed_storage(const char *pkgid)
1005 pkgmgrinfo_installed_storage storage;
1006 pkgmgrinfo_pkginfo_h handle;
1007 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1008 if (ret != PMINFO_R_OK)
1010 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1011 if (ret != PMINFO_R_OK) {
1012 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1015 printf("pkg installed storage: %d\n", storage);
1016 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1021 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1024 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1025 * @brief This API gets the installed time of package from the package ID
1027 * @par This API is for package-manager client application
1028 * @par Sync (or) Async : Synchronous API
1030 * @param[in] handle pointer to package info handle
1031 * @param[out] installed_time pointer to hold installed time of package
1032 * @return 0 if success, error code(<0) if fail
1033 * @retval PMINFO_R_OK success
1034 * @retval PMINFO_R_EINVAL invalid argument
1035 * @retval PMINFO_R_ERROR internal error
1036 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1037 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1038 * @see pkgmgrinfo_pkginfo_get_pkgid()
1039 * @see pkgmgrinfo_pkginfo_is_removable()
1041 static int get_pkg_installed_time(const char *pkgid)
1044 int installed_time = 0;
1045 pkgmgrinfo_pkginfo_h handle;
1046 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1047 if (ret != PMINFO_R_OK)
1049 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1050 if (ret != PMINFO_R_OK) {
1051 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1054 printf("installed_time: %d\n", installed_time);
1055 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1060 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1063 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1064 * @brief This API creates the update info handle
1066 * @par This API is for package-manager client application
1067 * @par Sync (or) Async : Synchronous API
1069 * @param[out] handle pointer to package update info handle
1070 * @return 0 if success, error code(<0) if fail
1071 * @retval PMINFO_R_OK success
1072 * @retval PMINFO_R_EINVAL invalid argument
1073 * @retval PMINFO_R_ERROR internal error
1074 * @post pkgmgrinfo_updateinfo_destroy()
1075 * @see pkgmgrinfo_updateinfo_set_pkgid()
1076 * @see pkgmgrinfo_updateinfo_set_version()
1077 * @see pkgmgrinfo_updateinfo_set_type()
1078 * @see pkgmgr_client_register_pkg_updateinfo()
1080 static int updateinfo_handle_create()
1084 pkgmgrinfo_updateinfo_h handle;
1085 ret = pkgmgrinfo_updateinfo_create(&handle);
1086 if (ret != PMINFO_R_OK)
1088 pkgmgrinfo_update_infodestroy(handle);
1093 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1096 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1097 * @brief This API destroy the update info handle
1099 * @par This API is for package-manager client application
1100 * @par Sync (or) Async : Synchronous API
1102 * @param[in] handle pointer to package update info handle
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @pre pkgmgrinfo_updateinfo_create()
1107 * @see pkgmgr_client_register_pkg_updateinfo()
1109 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1113 ret = pkgmgrinfo_updateinfo_destroy(handle);
1114 if (ret != PMINFO_R_OK)
1120 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1123 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1124 * @brief This API creates the package update information handle from db
1126 * @par This API is for package-manager client application
1127 * @par Sync (or) Async : Synchronous API
1129 * @param[in] pkgid pointer to package ID
1130 * @param[in] uid the addressee user id of the instruction
1131 * @param[out] update_handle pointer to the package update info handle.
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1137 * @post pkgmgrinfo_updateinfo_destroy()
1138 * @see pkgmgrinfo_updateinfo_get_pkgid()
1139 * @see pkgmgrinfo_updateinfo_get_version()
1140 * @see pkgmgrinfo_updateinfo_get_update_type()
1142 static int get_pkg_update_info(const char *pkgid)
1146 pkgmgrinfo_updateinfo_h handle;
1147 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1148 if (ret != PMINFO_R_OK)
1150 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1151 if (ret != PMINFO_R_OK) {
1152 pkgmgrinfo_updateinfo_destroy(handle);
1155 printf("pkg update version: %s\n", version
1156 pkgmgrinfo_updateinfo_destroy(handle);
1161 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1162 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1165 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1166 * @brief This API sets given pkgid into handle
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package update info handle
1172 * @param[in] pkgid package id
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1178 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1182 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1183 if (ret != PMINFO_R_OK)
1189 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1192 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1193 * @brief This API sets given version into handle
1195 * @par This API is for package-manager client application
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package update info handle
1199 * @param[in] version update version
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1205 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1209 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1210 if (ret != PMINFO_R_OK)
1216 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1219 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1220 * @brief This API sets given update type into handle
1222 * @par This API is for package-manager client application
1223 * @par Sync (or) Async : Synchronous API
1225 * @param[in] handle pointer to package update info handle
1226 * @param[in] type update type
1227 * @return 0 if success, error code(<0) if fail
1228 * @retval PMINFO_R_OK success
1229 * @retval PMINFO_R_EINVAL invalid argument
1230 * @retval PMINFO_R_ERROR internal error
1232 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1236 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1237 if (ret != PMINFO_R_OK)
1243 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1246 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1247 * @brief This API retrieves the pkgid from given update info
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] handle pointer to package update info handle
1253 * @param[out] pkgid package id
1254 * @return 0 if success, error code(<0) if fail
1255 * @retval PMINFO_R_OK success
1256 * @retval PMINFO_R_EINVAL invalid argument
1257 * @retval PMINFO_R_ERROR internal error
1259 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1264 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1265 if (ret != PMINFO_R_OK)
1271 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1274 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1275 * @brief This API retrieves the version from given update info
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] handle pointer to package update info handle
1281 * @param[out] version update version
1282 * @return 0 if success, error code(<0) if fail
1283 * @retval PMINFO_R_OK success
1284 * @retval PMINFO_R_EINVAL invalid argument
1285 * @retval PMINFO_R_ERROR internal error
1287 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1292 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1293 if (ret != PMINFO_R_OK)
1299 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1302 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1303 * @brief This API retrieves the update type from given update info
1305 * @par This API is for package-manager client application
1306 * @par Sync (or) Async : Synchronous API
1308 * @param[in] handle pointer to package update info handle
1309 * @param[out] type update type
1310 * @return 0 if success, error code(<0) if fail
1311 * @retval PMINFO_R_OK success
1312 * @retval PMINFO_R_EINVAL invalid argument
1313 * @retval PMINFO_R_ERROR internal error
1315 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1318 pkgmgrinfo_updateinfo_update_type *type;
1320 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1321 if (ret != PMINFO_R_OK)
1327 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1331 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1332 * @brief This API retrieve the update informations and invoke given callback for it.
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] callback callback to be invoked for each retrieved informations
1338 * @param[in] user_data user data to be passed to callback
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1344 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1348 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1349 if (ret != PMINFO_R_OK)
1355 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1359 * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1360 * @brief This API checkes whether given plugin had been executed with given package ID and application ID or not.
1362 * @par This API is for package-manager client application
1363 * @par Sync (or) Async : Synchronous API
1365 * @param[in] pkgid package ID
1366 * @param[in] appid application ID
1367 * @param[in] plugin_type plugin type to be checked
1368 * @param[in] plugin_name plugin name to be checked
1369 * @param[out] is_executed check result
1370 * @return 0 if success, error code(<0) if fail
1371 * @retval PMINFO_R_OK success
1372 * @retval PMINFO_R_EINVAL invalid argument
1373 * @retval PMINFO_R_ERROR internal error
1375 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1380 ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1381 if (ret != PMINFO_R_OK)
1383 printf("is checked is [%d]\n", is_executed);
1388 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1389 const char *plugin_type, const char *plugin_name, bool *is_executed);
1392 * @fn int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1393 * @brief This API retrieve the previous plugin execution info and invoke callbacks each of it.
1395 * @par This API is for package-manager client application
1396 * @par Sync (or) Async : Synchronous API
1398 * @param[in] pkgid package ID
1399 * @param[in] plugin_type type of plugin
1400 * @param[in] plugin_name name of plugin
1401 * @param[in] plugin_list_cb callback to be invoked for each plugin execution info
1402 * @param[out] user_data user data to be passed to callback
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1408 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1412 ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1413 if (ret != PMINFO_R_OK)
1419 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1420 const char *plugin_type, const char *plugin_name,
1421 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1424 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1425 * @brief This API gets the launch mode of package from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] mode pointer to hold launch mode of package
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1439 * @see pkgmgrinfo_pkginfo_is_removable()
1441 static int get_pkg_launch_mode(const char *pkgid)
1444 char *launch_mode = NULL;
1445 pkgmgrinfo_pkginfo_h handle;
1446 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1447 if (ret != PMINFO_R_OK)
1449 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1450 if (ret != PMINFO_R_OK) {
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 printf("launch mode: %s\n", mode);
1455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1460 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1463 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1464 * @brief This API gets the store client id of package from the package ID
1466 * @par This API is for package-manager client application
1467 * @par Sync (or) Async : Synchronous API
1469 * @param[in] handle pointer to package info handle
1470 * @param[out] storeclientid pointer to hold store client id of package
1471 * @return 0 if success, error code(<0) if fail
1472 * @retval PMINFO_R_OK success
1473 * @retval PMINFO_R_EINVAL invalid argument
1474 * @retval PMINFO_R_ERROR internal error
1475 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1476 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1477 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 * @see pkgmgrinfo_pkginfo_is_removable()
1480 static int get_pkg_storeclientid(const char *pkgid)
1483 char *storeclientid = 0;
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf(store client id: %s\n", storeclientid);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1502 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1503 * @brief This API gets the main app id of package from the package ID
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[out] mainappid pointer to hold main app id of package
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1517 * @see pkgmgrinfo_pkginfo_is_removable()
1519 static int get_pkg_mainappid(const char *pkgid)
1522 char *mainappid = 0;
1523 pkgmgrinfo_pkginfo_h handle;
1524 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1525 if (ret != PMINFO_R_OK)
1527 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1528 if (ret != PMINFO_R_OK) {
1529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1532 printf(main app id: %s\n", mainappid);
1533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1541 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1542 * @brief This API gets the url of package from the package ID
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[in] handle pointer to package info handle
1548 * @param[out] url pointer to hold url of package
1549 * @return 0 if success, error code(<0) if fail
1550 * @retval PMINFO_R_OK success
1551 * @retval PMINFO_R_EINVAL invalid argument
1552 * @retval PMINFO_R_ERROR internal error
1553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1555 * @see pkgmgrinfo_pkginfo_get_pkgid()
1556 * @see pkgmgrinfo_pkginfo_is_removable()
1558 static int get_pkg_url(const char *pkgid)
1562 pkgmgrinfo_pkginfo_h handle;
1563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1564 if (ret != PMINFO_R_OK)
1566 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571 printf("url : %s\n", url);
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1580 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1581 * @brief This API gets the root path of package
1583 * @par Sync (or) Async : Synchronous API
1585 * @param[in] handle pointer to package info handle
1586 * @param[out] path pointer to hold root path of package
1587 * @return 0 if success, error code(<0) if fail
1588 * @retval PMINFO_R_OK success
1589 * @retval PMINFO_R_EINVAL invalid argument
1590 * @retval PMINFO_R_ERROR internal error
1592 static int get_root_path(const char *pkgid)
1596 pkgmgrinfo_pkginfo_h handle;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1601 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1602 if (ret != PMINFO_R_OK) {
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1606 printf("path : %s\n", path);
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1617 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1618 * @brief This API gets the csc path of package
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to package info handle
1623 * @param[out] path pointer to hold csc path of package
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1629 static int get_csc_path(const char *pkgid)
1633 pkgmgrinfo_pkginfo_h handle;
1634 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1635 if (ret != PMINFO_R_OK)
1638 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1639 if (ret != PMINFO_R_OK) {
1640 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643 printf("path : %s\n", path);
1644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1653 * @fn int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type)
1654 * @brief This API gets the resource type of package
1656 * @par Sync (or) Async : Synchronous API
1658 * @param[in] handle pointer to package info handle
1659 * @param[out] res_type pointer to hold resource type of package
1660 * @return 0 if success, error code(<0) if fail
1661 * @retval PMINFO_R_OK success
1662 * @retval PMINFO_R_EINVAL invalid argument
1663 * @retval PMINFO_R_ERROR internal error
1665 static int get_res_type(const char *pkgid)
1669 pkgmgrinfo_pkginfo_h handle;
1670 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1671 if (ret != PMINFO_R_OK)
1674 ret = pkgmgrinfo_pkginfo_get_res_type(handle, &res_type);
1675 if (ret != PMINFO_R_OK) {
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 printf("res_type : %s\n", res_type);
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1686 int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type);
1689 * @fn int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version)
1690 * @brief This API gets the resource version of package
1692 * @par Sync (or) Async : Synchronous API
1694 * @param[in] handle pointer to package info handle
1695 * @param[out] res_version pointer to hold resource version of package
1696 * @return 0 if success, error code(<0) if fail
1697 * @retval PMINFO_R_OK success
1698 * @retval PMINFO_R_EINVAL invalid argument
1699 * @retval PMINFO_R_ERROR internal error
1701 static int get_res_version(const char *pkgid)
1704 char *res_version = 0;
1705 pkgmgrinfo_pkginfo_h handle;
1706 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1707 if (ret != PMINFO_R_OK)
1710 ret = pkgmgrinfo_pkginfo_get_res_version(handle, &res_version);
1711 if (ret != PMINFO_R_OK) {
1712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1715 printf("res_version : %s\n", res_version);
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1722 int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version);
1725 * @fn int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode)
1726 * @brief This API gets the light_user_switch_mode of package
1728 * @par Sync (or) Async : Synchronous API
1730 * @param[in] handle pointer to package info handle
1731 * @param[out] mode pointer to hold resource version of package
1732 * @return 0 if success, error code(<0) if fail
1733 * @retval PMINFO_R_OK success
1734 * @retval PMINFO_R_EINVAL invalid argument
1735 * @retval PMINFO_R_ERROR internal error
1737 static int get_light_user_switch_mode(const char *pkgid)
1741 pkgmgrinfo_pkginfo_h handle;
1742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1743 if (ret != PMINFO_R_OK)
1746 ret = pkgmgrinfo_pkginfo_get_light_user_switch_mode(handle, &mode);
1747 if (ret != PMINFO_R_OK) {
1748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1751 printf("light_user_switch_mode : %s\n", mode);
1752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1758 int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode);
1761 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1762 * @brief This API gets the support_mode of package
1764 * @par Sync (or) Async : Synchronous API
1766 * @param[in] handle pointer to package info handle
1767 * @param[out] support_mode pointer to hold support_mode of package
1768 * @return 0 if success, error code(<0) if fail
1769 * @retval PMINFO_R_OK success
1770 * @retval PMINFO_R_EINVAL invalid argument
1771 * @retval PMINFO_R_ERROR internal error
1773 static int get_support_mode(const char *pkgid)
1776 int support_mode = 0;
1777 pkgmgrinfo_pkginfo_h handle = NULL;
1778 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1779 if (ret != PMINFO_R_OK)
1782 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1787 printf("support_mode : %s\n", support_mode);
1788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1794 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1797 * @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)
1798 * @brief This API compare the cert information from given package id
1800 * @par This API is for package-manager client application
1801 * @par Sync (or) Async : Synchronous API
1803 * @param[in] lhs_package_id pointer to first package ID
1804 * @param[in] rhs_package_id pointer to second package ID
1805 * @param[out] compare_result pointer to the compare result.
1806 * @return 0 if success, error code(<0) if fail
1807 * @retval PMINFO_R_OK success
1808 * @retval PMINFO_R_EINVAL invalid argument
1809 * @retval PMINFO_R_ERROR internal error
1811 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1812 * @see pkgmgrinfo_pkginfo_get_pkgid()
1813 * @see pkgmgrinfo_pkginfo_is_removable()
1815 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1818 pkgmgrinfo_cert_compare_result_type_e result;
1820 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1821 if (ret != PMINFO_R_OK) {
1824 printf("result: %d\n", result);
1829 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);
1830 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);
1832 * @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)
1833 * @brief This API compare the cert information from given app id
1835 * @par This API is for package-manager client application
1836 * @par Sync (or) Async : Synchronous API
1838 * @param[in] lhs_app_id pointer to first app ID
1839 * @param[in] rhs_app_id pointer to second app ID
1840 * @param[out] compare_result pointer to the compare result.
1841 * @return 0 if success, error code(<0) if fail
1842 * @retval PMINFO_R_OK success
1843 * @retval PMINFO_R_EINVAL invalid argument
1844 * @retval PMINFO_R_ERROR internal error
1846 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1847 * @see pkgmgrinfo_pkginfo_get_pkgid()
1848 * @see pkgmgrinfo_pkginfo_is_removable()
1850 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1853 pkgmgrinfo_cert_compare_result_type_e result;
1855 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1856 if (ret != PMINFO_R_OK) {
1859 printf("result: %d\n", result);
1864 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);
1865 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);
1867 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1868 * @brief This API gets the package 'removable' value from the package ID
1870 * @par This API is for package-manager client application
1871 * @par Sync (or) Async : Synchronous API
1873 * @param[in] handle pointer to package info handle
1874 * @param[out] removable pointer to hold package removable value
1875 * @return 0 if success, error code(<0) if fail
1876 * @retval PMINFO_R_OK success
1877 * @retval PMINFO_R_EINVAL invalid argument
1878 * @retval PMINFO_R_ERROR internal error
1879 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1880 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1881 * @see pkgmgrinfo_pkginfo_get_pkgid()
1882 * @see pkgmgrinfo_pkginfo_is_readonly()
1884 static int get_pkg_removable(const char *pkgid)
1888 pkgmgrinfo_pkginfo_h handle;
1889 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1890 if (ret != PMINFO_R_OK)
1892 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1897 printf("pkg removable: %d\n", removable);
1898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1903 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1906 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1907 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1909 * @par This API is for package-manager client application
1910 * @par Sync (or) Async : Synchronous API
1912 * @param[in] handle pointer to package info handle
1913 * @param[out] movable pointer to hold package movable state
1914 * @return 0 if success, error code(<0) if fail
1915 * @retval PMINFO_R_OK success
1916 * @retval PMINFO_R_EINVAL invalid argument
1917 * @retval PMINFO_R_ERROR internal error
1918 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1919 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1920 * @see pkgmgrinfo_pkginfo_get_pkgid()
1922 static int get_pkg_movable(const char *pkgid)
1926 pkgmgrinfo_pkginfo_h handle;
1927 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1928 if (ret != PMINFO_R_OK)
1930 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1931 if (ret != PMINFO_R_OK) {
1932 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1935 printf("pkg movable: %d\n", movable);
1936 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1941 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1944 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1945 * @brief This API gets the package 'preload' value from the package ID
1947 * @par This API is for package-manager client application
1948 * @par Sync (or) Async : Synchronous API
1950 * @param[in] handle pointer to package info handle
1951 * @param[out] preload pointer to hold package preload value
1952 * @return 0 if success, error code(<0) if fail
1953 * @retval PMINFO_R_OK success
1954 * @retval PMINFO_R_EINVAL invalid argument
1955 * @retval PMINFO_R_ERROR internal error
1956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1958 * @see pkgmgrinfo_pkginfo_get_pkgid()
1959 * @see pkgmgrinfo_pkginfo_is_readonly()
1961 static int get_pkg_preload(const char *pkgid)
1965 pkgmgrinfo_pkginfo_h handle;
1966 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1967 if (ret != PMINFO_R_OK)
1969 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1970 if (ret != PMINFO_R_OK) {
1971 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1974 printf("pkg preload: %d\n", preload);
1975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1980 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1983 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1984 * @brief This API gets the value for given handle is system or not
1986 * @par This API is for package-manager client application
1987 * @par Sync (or) Async : Synchronous API
1989 * @param[in] handle pointer to package info handle
1990 * @param[out] system pointer to hold system is or not
1991 * @return 0 if success, error code(<0) if fail
1992 * @retval PMINFO_R_OK success
1993 * @retval PMINFO_R_EINVAL invalid argument
1994 * @retval PMINFO_R_ERROR internal error
1995 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1996 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1997 * @see pkgmgrinfo_pkginfo_get_pkgid()
1998 * @see pkgmgrinfo_pkginfo_is_readonly()
2000 static int get_pkg_system(const char *pkgid)
2003 bool system = false;
2004 pkgmgrinfo_pkginfo_h handle = NULL;
2005 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2006 if (ret != PMINFO_R_OK)
2008 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
2009 if (ret != PMINFO_R_OK) {
2010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2013 printf("pkg system: %d\n", system);
2014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2019 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
2022 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
2023 * @brief This API gets the package 'readonly' value from the package ID
2025 * @par This API is for package-manager client application
2026 * @par Sync (or) Async : Synchronous API
2028 * @param[in] handle pointer to package info handle
2029 * @param[out] readonly pointer to hold package readonly value
2030 * @return 0 if success, error code(<0) if fail
2031 * @retval PMINFO_R_OK success
2032 * @retval PMINFO_R_EINVAL invalid argument
2033 * @retval PMINFO_R_ERROR internal error
2034 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2035 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2036 * @see pkgmgrinfo_pkginfo_get_pkgid()
2037 * @see pkgmgrinfo_pkginfo_is_removable()
2039 static int get_pkg_readonly(const char *pkgid)
2043 pkgmgrinfo_pkginfo_h handle;
2044 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2045 if (ret != PMINFO_R_OK)
2047 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2048 if (ret != PMINFO_R_OK) {
2049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2052 printf("pkg readonly: %d\n", readonly);
2053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2058 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2062 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2063 * @brief This API gets the package 'update' value from the package ID
2065 * @par This API is for package-manager client application
2066 * @par Sync (or) Async : Synchronous API
2068 * @param[in] handle pointer to package info handle
2069 * @param[out] update pointer to hold package update value
2070 * @return 0 if success, error code(<0) if fail
2071 * @retval PMINFO_R_OK success
2072 * @retval PMINFO_R_EINVAL invalid argument
2073 * @retval PMINFO_R_ERROR internal error
2074 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2075 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2076 * @see pkgmgrinfo_pkginfo_get_pkgid()
2078 static int get_pkg_update(const char *pkgid)
2082 pkgmgrinfo_pkginfo_h handle;
2083 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2084 if (ret != PMINFO_R_OK)
2086 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2087 if (ret != PMINFO_R_OK) {
2088 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2091 printf("pkg update: %d\n", update);
2092 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2097 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2100 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2101 * @brief This API gets the package 'support_disable' value from the package ID
2103 * @par This API is for package-manager client application
2104 * @par Sync (or) Async : Synchronous API
2106 * @param[in] handle pointer to package info handle
2107 * @param[out] support_disable pointer to hold package support_disable value
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2112 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2114 * @see pkgmgrinfo_pkginfo_get_pkgid()
2116 static int get_pkg_support_disable(const char *pkgid)
2119 bool support_disable;
2120 pkgmgrinfo_pkginfo_h handle = NULL;
2121 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2122 if (ret != PMINFO_R_OK)
2124 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2125 if (ret != PMINFO_R_OK) {
2126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2129 printf("pkg support_disable: %d\n", support_disable);
2130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2138 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2139 * @brief This API gets whether the given package is global package or user package
2141 * @par This API is for package-manager client application
2142 * @par Sync (or) Async : Synchronous API
2144 * @param[in] handle pointer to package info handle
2145 * @param[in] global pointer to hold package global value
2146 * @return 0 if success, error code(<0) if fail
2147 * @retval PMINFO_R_OK success
2148 * @retval PMINFO_R_EINVAL invalid argument
2149 * @retval PMINFO_R_ERROR internal error
2150 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2151 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2152 * @see pkgmgrinfo_pkginfo_get_pkgid()
2153 static int get_pkg_support_disable(const char *pkgid)
2157 pkgmgrinfo_pkginfo_h handle = NULL;
2158 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2159 if (ret != PMINFO_R_OK)
2161 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2162 if (ret != PMINFO_R_OK) {
2163 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2166 printf("pkg is_global: %d\n", global);
2167 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2172 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2175 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2176 * @brief This API gets the package 'accessible' value from the package ID
2178 * @par This API is for package-manager client application
2179 * @par Sync (or) Async : Synchronous API
2181 * @param[in] handle pointer to package info handle
2182 * @param[out] accessible pointer to hold package accessible value
2183 * @return 0 if success, error code(<0) if fail
2184 * @retval PMINFO_R_OK success
2185 * @retval PMINFO_R_EINVAL invalid argument
2186 * @retval PMINFO_R_ERROR internal error
2187 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2188 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2189 * @see pkgmgrinfo_pkginfo_get_pkgid()
2190 * @see pkgmgrinfo_pkginfo_is_readonly()
2192 static int get_pkg_accessible(const char *pkgid)
2196 pkgmgrinfo_pkginfo_h handle;
2197 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2198 if (ret != PMINFO_R_OK)
2200 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2201 if (ret != PMINFO_R_OK) {
2202 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2205 printf("pkg accessible: %d\n", accessible);
2206 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2211 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2214 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2215 * @brief This API destroys the package information handle freeing up all the resources
2217 * @par This API is for package-manager client application
2218 * @par Sync (or) Async : Synchronous API
2220 * @param[in] handle pointer to the package info handle
2221 * @return 0 if success, error code(<0) if fail
2222 * @retval PMINFO_R_OK success
2223 * @retval PMINFO_R_EINVAL invalid argument
2224 * @retval PMINFO_R_ERROR internal error
2225 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2227 * @see pkgmgrinfo_pkginfo_get_pkgid()
2228 * @see pkgmgrinfo_pkginfo_is_removable()
2230 static int get_pkg_type(const char *pkgid)
2234 pkgmgrinfo_pkginfo_h handle;
2235 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2236 if (ret != PMINFO_R_OK)
2238 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2239 if (ret != PMINFO_R_OK) {
2240 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2243 printf("pkgtype: %s\n", type);
2244 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2249 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2252 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2253 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2254 The query will search the entire package information collected from the manifest file of all the installed packages
2256 * @par This API is for package-manager client application
2257 * @par Sync (or) Async : Synchronous API
2259 * @param[out] handle pointer to the package info filter handle.
2260 * @return 0 if success, error code(<0) if fail
2261 * @retval PMINFO_R_OK success
2262 * @retval PMINFO_R_EINVAL invalid argument
2263 * @retval PMINFO_R_ERROR internal error
2265 * @post pkgmgrinfo_pkginfo_filter_destroy()
2266 * @see pkgmgrinfo_pkginfo_filter_count()
2267 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2269 static int get_tpk_pkg_count()
2273 pkgmgrinfo_pkginfo_filter_h handle;
2274 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2275 if (ret != PMINFO_R_OK)
2277 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2278 if (ret != PMINFO_R_OK) {
2279 pkgmgrinfo_pkginfo_filter_destroy(handle);
2282 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2283 if (ret != PMINFO_R_OK) {
2284 pkgmgrinfo_pkginfo_filter_destroy(handle);
2287 printf("No of tpk pkgs: %d\n", count);
2288 pkgmgrinfo_pkginfo_filter_destroy(handle);
2293 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2296 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2297 * @brief This API destroys the package information filter handle freeing up all the resources
2299 * @par This API is for package-manager client application
2300 * @par Sync (or) Async : Synchronous API
2302 * @param[in] handle pointer to the package info filter handle.
2303 * @return 0 if success, error code(<0) if fail
2304 * @retval PMINFO_R_OK success
2305 * @retval PMINFO_R_EINVAL invalid argument
2306 * @retval PMINFO_R_ERROR internal error
2307 * @pre pkgmgrinfo_pkginfo_filter_create()
2309 * @see pkgmgrinfo_pkginfo_filter_count()
2310 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2312 static int get_tpk_pkg_count()
2316 pkgmgrinfo_pkginfo_filter_h handle;
2317 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2318 if (ret != PMINFO_R_OK)
2320 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2321 if (ret != PMINFO_R_OK) {
2322 pkgmgrinfo_pkginfo_filter_destroy(handle);
2325 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2326 if (ret != PMINFO_R_OK) {
2327 pkgmgrinfo_pkginfo_filter_destroy(handle);
2330 printf("No of tpk pkgs: %d\n", count);
2331 pkgmgrinfo_pkginfo_filter_destroy(handle);
2336 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2339 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2340 * @brief This API adds a boolean filter property to the filter handle
2342 * @par This API is for package-manager client application
2343 * @par Sync (or) Async : Synchronous API
2345 * @param[in] handle pointer to the package info filter handle.
2346 * @param[in] property boolean property name.
2347 * @param[in] value value corresponding to the property.
2348 * @return 0 if success, error code(<0) if fail
2349 * @retval PMINFO_R_OK success
2350 * @retval PMINFO_R_EINVAL invalid argument
2351 * @retval PMINFO_R_ERROR internal error
2352 * @pre pkgmgrinfo_pkginfo_filter_create()
2353 * @post pkgmgrinfo_pkginfo_filter_destroy()
2354 * @see pkgmgrinfo_pkginfo_filter_count()
2355 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2357 static int get_preload_pkg_count()
2361 pkgmgrinfo_pkginfo_filter_h handle;
2362 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2363 if (ret != PMINFO_R_OK)
2365 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2366 if (ret != PMINFO_R_OK) {
2367 pkgmgrinfo_pkginfo_filter_destroy(handle);
2370 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2371 if (ret != PMINFO_R_OK) {
2372 pkgmgrinfo_pkginfo_filter_destroy(handle);
2375 printf("No of preload pkgs: %d\n", count);
2376 pkgmgrinfo_pkginfo_filter_destroy(handle);
2381 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2382 const char *property, const bool value);
2385 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2386 * @brief This API adds an integer filter property to the filter handle
2388 * @par This API is for package-manager client application
2389 * @par Sync (or) Async : Synchronous API
2391 * @param[in] handle pointer to the package info filter handle.
2392 * @param[in] property integer property name.
2393 * @param[in] value value corresponding to the property.
2394 * @return 0 if success, error code(<0) if fail
2395 * @retval PMINFO_R_OK success
2396 * @retval PMINFO_R_EINVAL invalid argument
2397 * @retval PMINFO_R_ERROR internal error
2398 * @pre pkgmgrinfo_pkginfo_filter_create()
2399 * @post pkgmgrinfo_pkginfo_filter_destroy()
2400 * @see pkgmgrinfo_pkginfo_filter_count()
2401 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2403 static int get_pkg_count()
2407 pkgmgrinfo_pkginfo_filter_h handle;
2408 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2409 if (ret != PMINFO_R_OK)
2411 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2412 if (ret != PMINFO_R_OK) {
2413 pkgmgrinfo_pkginfo_filter_destroy(handle);
2416 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2417 if (ret != PMINFO_R_OK) {
2418 pkgmgrinfo_pkginfo_filter_destroy(handle);
2421 printf("No of preload pkgs: %d\n", count);
2422 pkgmgrinfo_pkginfo_filter_destroy(handle);
2427 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2428 const char *property, const int value);
2431 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2432 * @brief This API adds a string filter property to the filter handle
2434 * @par This API is for package-manager client application
2435 * @par Sync (or) Async : Synchronous API
2437 * @param[in] handle pointer to the package info filter handle.
2438 * @param[in] property string property name.
2439 * @param[in] value value corresponding to the property.
2440 * @return 0 if success, error code(<0) if fail
2441 * @retval PMINFO_R_OK success
2442 * @retval PMINFO_R_EINVAL invalid argument
2443 * @retval PMINFO_R_ERROR internal error
2444 * @pre pkgmgrinfo_pkginfo_filter_create()
2445 * @post pkgmgrinfo_pkginfo_filter_destroy()
2446 * @see pkgmgrinfo_pkginfo_filter_count()
2447 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2449 static int get_tpk_pkg_count()
2453 pkgmgrinfo_pkginfo_filter_h handle;
2454 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2455 if (ret != PMINFO_R_OK)
2457 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2458 if (ret != PMINFO_R_OK) {
2459 pkgmgrinfo_pkginfo_filter_destroy(handle);
2462 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2463 if (ret != PMINFO_R_OK) {
2464 pkgmgrinfo_pkginfo_filter_destroy(handle);
2467 printf("No of tpk pkgs: %d\n", count);
2468 pkgmgrinfo_pkginfo_filter_destroy(handle);
2473 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2474 const char *property, const char *value);
2477 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2478 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2480 * @par This API is for package-manager client application
2481 * @par Sync (or) Async : Synchronous API
2483 * @param[in] handle pointer to the package info filter handle.
2484 * @param[in] pkg_cb callback function.
2485 * @param[in] user_data user data to be passed to the callback function
2486 * @return 0 if success, error code(<0) if fail
2487 * @retval PMINFO_R_OK success
2488 * @retval PMINFO_R_EINVAL invalid argument
2489 * @retval PMINFO_R_ERROR internal error
2490 * @pre pkgmgrinfo_pkginfo_filter_create()
2491 * @post pkgmgrinfo_pkginfo_filter_destroy()
2492 * @see pkgmgrinfo_pkginfo_filter_count()
2494 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2497 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2498 printf("pkg id : %s\n", pkgid);
2502 static int get_tpk_pkg_list()
2505 pkgmgrinfo_pkginfo_filter_h handle;
2506 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2507 if (ret != PMINFO_R_OK)
2509 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2510 if (ret != PMINFO_R_OK) {
2511 pkgmgrinfo_pkginfo_filter_destroy(handle);
2514 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2515 if (ret != PMINFO_R_OK) {
2516 pkgmgrinfo_pkginfo_filter_destroy(handle);
2519 pkgmgrinfo_pkginfo_filter_destroy(handle);
2524 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2525 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2526 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2527 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2530 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2531 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2532 * @brief This API counts the package that satisfy the filter conditions
2534 * @par This API is for package-manager client application
2535 * @par Sync (or) Async : Synchronous API
2537 * @param[in] handle pointer to the package info filter handle.
2538 * @param[in] count pointer to store the count value.
2539 * @param[in] uid the addressee user id of the instruction
2540 * @return 0 if success, error code(<0) if fail
2541 * @retval PMINFO_R_OK success
2542 * @retval PMINFO_R_EINVAL invalid argument
2543 * @retval PMINFO_R_ERROR internal error
2544 * @pre pkgmgrinfo_pkginfo_filter_create()
2545 * @post pkgmgrinfo_pkginfo_filter_destroy()
2546 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2548 static int get_tpk_pkg_count()
2552 pkgmgrinfo_pkginfo_filter_h handle;
2553 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2554 if (ret != PMINFO_R_OK)
2556 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2557 if (ret != PMINFO_R_OK) {
2558 pkgmgrinfo_pkginfo_filter_destroy(handle);
2561 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2562 if (ret != PMINFO_R_OK) {
2563 pkgmgrinfo_pkginfo_filter_destroy(handle);
2566 printf("No of tpk pkgs: %d\n", count);
2567 pkgmgrinfo_pkginfo_filter_destroy(handle);
2572 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2573 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2576 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2577 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2578 * @brief This API gets the list of privilege for a particular package
2580 * @par This API is for package-manager client application
2581 * @par Sync (or) Async : Synchronous API
2582 * @param[in] handle pointer to the package info handle.
2583 * @param[in] privilege_func callback function for list
2584 * @param[in] user_data user data to be passed to callback function
2585 * @return 0 if success, error code(<0) if fail
2586 * @retval PMINFO_R_OK success
2587 * @retval PMINFO_R_EINVAL invalid argument
2588 * @retval PMINFO_R_ERROR internal error
2589 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2590 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2592 int privilege_func(const char *name, void *user_data)
2594 if (strcmp(name, (char *)user_data) == 0)
2600 static int list_privilege(const char *package, char *privilege)
2603 pkgmgrinfo_pkginfo_h handle;
2604 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2605 if (ret != PMINFO_R_OK)
2607 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2608 if (ret != PMINFO_R_OK) {
2609 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2617 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2618 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2621 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2622 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2623 * @brief This API gets the list of appdefined privilege for a particular package
2625 * @par This API is for package-manager client application
2626 * @par Sync (or) Async : Synchronous API
2627 * @param[in] handle pointer to the package info handle.
2628 * @param[in] privilege_func callback function for list
2629 * @param[in] user_data user data to be passed to callback function
2630 * @return 0 if success, error code(<0) if fail
2631 * @retval PMINFO_R_OK success
2632 * @retval PMINFO_R_EINVAL invalid argument
2633 * @retval PMINFO_R_ERROR internal error
2634 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2635 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2637 int privilege_func(const char *name, const char *license_path, void *user_data)
2639 printf("appdefined privilege : %s", name);
2641 printf("licensed privilege, lecense path : %s", license_path);
2645 static int list_appdefined_privilege(const char *package)
2648 pkgmgrinfo_pkginfo_h handle;
2649 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2650 if (ret != PMINFO_R_OK)
2652 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2653 if (ret != PMINFO_R_OK) {
2654 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2657 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2662 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2663 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2666 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2667 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2668 * @brief This API gets the list of plugin execution info for a particular package
2670 * @par This API is for package-manager client application
2671 * @par Sync (or) Async : Synchronous API
2672 * @param[in] handle pointer to the package info handle.
2673 * @param[in] plugin_func callback function for list
2674 * @param[in] user_data user data to be passed to callback function
2675 * @return 0 if success, error code(<0) if fail
2676 * @retval PMINFO_R_OK success
2677 * @retval PMINFO_R_EINVAL invalid argument
2678 * @retval PMINFO_R_ERROR internal error
2679 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2680 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2682 int plugin_func(const char *pkgid, const char *appid,
2683 const char *plugin_type, const char *plugin_name,
2686 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2691 static int list_plugin(const char *package)
2694 pkgmgrinfo_pkginfo_h handle;
2695 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2696 if (ret != PMINFO_R_OK)
2698 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2699 if (ret != PMINFO_R_OK) {
2700 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2703 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2708 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2709 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2712 * @fn int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2713 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2714 * @brief This API gets the list of metadata for a particular package
2716 * @par This API is for package-manager client application
2717 * @par Sync (or) Async : Synchronous API
2718 * @param[in] handle pointer to the package info handle.
2719 * @param[in] metadata_func callback function for list
2720 * @param[in] user_data user data to be passed to callback function
2721 * @return 0 if success, error code(<0) if fail
2722 * @retval PMINFO_R_OK success
2723 * @retval PMINFO_R_EINVAL invalid argument
2724 * @retval PMINFO_R_ERROR internal error
2725 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2726 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2728 int metadata_func(const char *key, const char *value, void *user_data)
2730 if (strcmp(key, (char *)user_data) == 0) {
2731 printf("Value is %s\n", value);
2738 static int list_metadata(const char *pkgid, char *key)
2741 pkgmgrinfo_pkginfo_h handle;
2742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2743 if (ret != PMINFO_R_OK)
2745 ret = pkgmgrinfo_pkginfo_foreach_metadata(handle, metadata_func, (void *)key);
2746 if (ret != PMINFO_R_OK) {
2747 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2750 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2755 int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2756 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2759 * @fn int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle)
2760 * @brief This API creates the application's metadata information filter handle from db.
2762 * @par This API is for package-manager client application
2763 * @par Sync (or) Async : Synchronous API
2765 * @param[out] handle pointer to the package metadata info filter handle.
2766 * @return 0 if success, error code(<0) if fail
2767 * @retval PMINFO_R_OK success
2768 * @retval PMINFO_R_EINVAL invalid argument
2769 * @retval PMINFO_R_ERROR internal error
2771 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
2772 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2774 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2777 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2778 printf("pkgid : %s\n", pkgid);
2782 static int get_pkg_list(const char *mkey, const char *mvalue)
2785 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2786 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2787 if (ret != PMINFO_R_OK)
2789 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2790 if (ret != PMINFO_R_OK) {
2791 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2794 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2795 if (ret != PMINFO_R_OK) {
2796 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2799 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2804 int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle);
2807 * @fn int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle)
2808 * @brief This API destroys the package's metadata information filter handle.
2810 * @par This API is for package-manager client application
2811 * @par Sync (or) Async : Synchronous API
2813 * @param[in] handle pointer to the package metadata info filter handle.
2814 * @return 0 if success, error code(<0) if fail
2815 * @retval PMINFO_R_OK success
2816 * @retval PMINFO_R_EINVAL invalid argument
2817 * @retval PMINFO_R_ERROR internal error
2818 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2820 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2822 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2825 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2826 printf("pkgid : %s\n", pkgid);
2830 static int get_pkg_list(const char *mkey, const char *mvalue)
2833 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2834 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2835 if (ret != PMINFO_R_OK)
2837 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2838 if (ret != PMINFO_R_OK) {
2839 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2842 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2843 if (ret != PMINFO_R_OK) {
2844 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2847 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2852 int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle);
2855 * @fn int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle, const char *key, const char *value)
2856 * @brief This API adds filter condition for the query API. The query will search the entire package metadata information collected from
2857 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
2859 * @par This API is for package-manager client application
2860 * @par Sync (or) Async : Synchronous API
2862 * @param[in] handle pointer to the package metadata info filter handle.
2863 * @param[in] key pointer to metadata key
2864 * @param[in] value pointer to metadata value
2865 * @return 0 if success, error code(<0) if fail
2866 * @retval PMINFO_R_OK success
2867 * @retval PMINFO_R_EINVAL invalid argument
2868 * @retval PMINFO_R_ERROR internal error
2869 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2870 * @post pkgmgrinfo_pkginfo_metadata_filter_foreach(), pkgmgrinfo_pkginfo_metadata_filter_destroy()
2871 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2873 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2876 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2877 printf("pkgid : %s\n", pkgid);
2881 static int get_pkg_list(const char *mkey, const char *mvalue)
2884 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2885 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2886 if (ret != PMINFO_R_OK)
2888 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2889 if (ret != PMINFO_R_OK) {
2890 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2893 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2894 if (ret != PMINFO_R_OK) {
2895 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2898 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2903 int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2904 const char *key, const char *value);
2907 * @fn int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2908 * @fn int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid)
2909 * @brief This API executes the filter query. The query will search the entire package metadata information collected from
2910 * the manifest file of all the installed packages. For each package returned by the query, the callback will be called. If callback returns
2911 * negative value, no more callbacks will be called and API will return.
2913 * @par This API is for package-manager client application
2914 * @par Sync (or) Async : Synchronous API
2916 * @param[in] handle pointer to the package metadata info filter handle.
2917 * @param[in] app_cb function pointer to callback
2918 * @param[in] user_data pointer to user data
2919 * @param[in] uid the addressee user id of the instruction
2920 * @return 0 if success, error code(<0) if fail
2921 * @retval PMINFO_R_OK success
2922 * @retval PMINFO_R_EINVAL invalid argument
2923 * @retval PMINFO_R_ERROR internal error
2924 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2925 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
2927 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2930 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2931 printf("pkgid : %s\n", pkgid);
2935 static int get_pkg_list(const char *mkey, const char *mvalue)
2938 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2939 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2940 if (ret != PMINFO_R_OK)
2942 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2943 if (ret != PMINFO_R_OK) {
2944 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2947 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2948 if (ret != PMINFO_R_OK) {
2949 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2952 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2957 int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2958 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2959 int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2960 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2962 /* TODO: add doxygen comment here */
2963 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2966 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2967 * @brief This API copy the application information handle
2969 * @par This API is for package-manager client application
2970 * @par Sync (or) Async : Synchronous API
2972 * @param[in] handle pointer to the package info handle.
2973 * @param[out] handle pointer to the package info handle.
2974 * @return 0 if success, error code(<0) if fail
2975 * @retval PMINFO_R_OK success
2976 * @retval PMINFO_R_EINVAL invalid argument
2977 * @retval PMINFO_R_ERROR internal error
2979 * @post pkgmgrinfo_appinfo_destroy_appinfo()
2981 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2985 pkgmgrinfo_pkginfo_h clone;
2987 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2988 if (ret != PMINFO_R_OK)
2992 printf("package: %s\n", clone->package);
2993 pkgmgrinfo_appinfo_destroy_appinfo(clone);
2998 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
3002 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3003 pkgmgrinfo_app_list_cb app_func, void *user_data)
3004 * @brief This API gets list of installed applications for a particular package
3006 * @par This API is for package-manager client application
3007 * @par Sync (or) Async : Synchronous API
3008 * @param[in] handle package info handle
3009 * @param[in] component application component
3010 * @param[in] app_func iteration function for list
3011 * @param[in] user_data user data to be passed to callback function
3012 * @return 0 if success, error code(<0) if fail
3013 * @retval PMINFO_R_OK success
3014 * @retval PMINFO_R_EINVAL invalid argument
3015 * @retval PMINFO_R_ERROR internal error
3016 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
3017 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
3019 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
3022 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3023 printf("appid : %s\n", appid);
3027 static int list_apps(const char *pkgid)
3030 pkgmgrinfo_pkginfo_h handle;
3031 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
3032 if (ret != PMINFO_R_OK)
3034 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
3035 if (ret != PMINFO_R_OK) {
3036 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3039 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3044 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3045 pkgmgrinfo_app_list_cb app_func, void *user_data);
3046 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3047 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
3050 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3051 * @brief This API gets list of installed applications from all packages.
3053 * @par This API is for package-manager client application
3054 * @par Sync (or) Async : Synchronous API
3055 * @param[in] app_func iteration function for list
3056 * @param[in] user_data user data to be passed to callback function
3057 * @return 0 if success, error code(<0) if fail
3058 * @retval PMINFO_R_OK success
3059 * @retval PMINFO_R_EINVAL invalid argument
3060 * @retval PMINFO_R_ERROR internal error
3064 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3066 char *pkgid1 = NULL;
3067 char *pkgid2 = NULL;
3068 pkgid1 = (char *)user_data;
3069 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
3070 if (strcmp(pkgid1, pkgid2) == 0) {
3077 static int list_apps()
3080 char *name = "helloworld";
3081 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
3082 if (ret != PMINFO_R_OK) {
3089 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3090 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
3093 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3094 * @brief This API creates the disabled application information handle from db
3096 * @par This API is for package-manager client application
3097 * @par Sync (or) Async : Synchronous API
3099 * @param[in] appid pointer to appid
3100 * @param[out] handle pointer to the application info handle.
3101 * @return 0 if success, error code(<0) if fail
3102 * @retval PMINFO_R_OK success
3103 * @retval PMINFO_R_EINVAL invalid argument
3104 * @retval PMINFO_R_ERROR internal error
3106 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3107 * @see pkgmgrinfo_appinfo_get_pkgid()
3108 * @see pkgmgrinfo_appinfo_is_multiple()
3110 static int get_disabled_app_type(const char *appid)
3114 pkgmgrinfo_appinfo_h handle;
3115 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
3116 if (ret != PMINFO_R_OK)
3118 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3119 if (ret != PMINFO_R_OK) {
3120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3123 printf("apptype: %s\n", type);
3124 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3129 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3130 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3133 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3134 * @brief This API creates the application information handle from db
3136 * @par This API is for package-manager client application
3137 * @par Sync (or) Async : Synchronous API
3139 * @param[in] appid pointer to appid
3140 * @param[out] handle pointer to the application info handle.
3141 * @return 0 if success, error code(<0) if fail
3142 * @retval PMINFO_R_OK success
3143 * @retval PMINFO_R_EINVAL invalid argument
3144 * @retval PMINFO_R_ERROR internal error
3146 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3147 * @see pkgmgrinfo_appinfo_get_pkgid()
3148 * @see pkgmgrinfo_appinfo_is_multiple()
3150 static int get_app_type(const char *appid)
3154 pkgmgrinfo_appinfo_h handle;
3155 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3156 if (ret != PMINFO_R_OK)
3158 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3159 if (ret != PMINFO_R_OK) {
3160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3163 printf("apptype: %s\n", type);
3164 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3169 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3170 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3173 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3174 * @brief This API creates the application information handle from db regardless of its disable or storage status
3176 * @par This API is for package-manager client application
3177 * @par Sync (or) Async : Synchronous API
3179 * @param[in] appid pointer to appid
3180 * @param[out] handle pointer to the application info handle.
3181 * @return 0 if success, error code(<0) if fail
3182 * @retval PMINFO_R_OK success
3183 * @retval PMINFO_R_EINVAL invalid argument
3184 * @retval PMINFO_R_ERROR internal error
3186 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3187 * @see pkgmgrinfo_appinfo_get_pkgid()
3188 * @see pkgmgrinfo_appinfo_is_multiple()
3190 static int get_app_type(const char *appid)
3194 pkgmgrinfo_appinfo_h handle;
3195 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
3196 if (ret != PMINFO_R_OK)
3198 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3199 if (ret != PMINFO_R_OK) {
3200 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3203 printf("apptype: %s\n", type);
3204 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3209 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3210 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3213 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
3214 * @brief This API gets the application ID
3216 * @par This API is for package-manager client application
3217 * @par Sync (or) Async : Synchronous API
3219 * @param[in] handle pointer to the application info handle.
3220 * @param[out] appid pointer to hold appid
3221 * @return 0 if success, error code(<0) if fail
3222 * @retval PMINFO_R_OK success
3223 * @retval PMINFO_R_EINVAL invalid argument
3224 * @retval PMINFO_R_ERROR internal error
3225 * @pre pkgmgrinfo_appinfo_get_appinfo()
3226 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3227 * @see pkgmgrinfo_appinfo_get_pkgid()
3228 * @see pkgmgrinfo_appinfo_is_multiple()
3230 static int get_app_id(const char *appid)
3233 char *app_id = NULL;
3234 pkgmgrinfo_appinfo_h handle;
3235 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3236 if (ret != PMINFO_R_OK)
3238 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
3239 if (ret != PMINFO_R_OK) {
3240 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3243 printf("app id: %s\n", app_id);
3244 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3249 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
3252 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
3253 * @brief This API gets the package name of the application
3255 * @par This API is for package-manager client application
3256 * @par Sync (or) Async : Synchronous API
3258 * @param[in] handle pointer to the application info handle.
3259 * @param[out] pkg_name pointer to hold package name
3260 * @return 0 if success, error code(<0) if fail
3261 * @retval PMINFO_R_OK success
3262 * @retval PMINFO_R_EINVAL invalid argument
3263 * @retval PMINFO_R_ERROR internal error
3264 * @pre pkgmgrinfo_appinfo_get_appinfo()
3265 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3266 * @see pkgmgrinfo_appinfo_get_appid()
3267 * @see pkgmgrinfo_appinfo_is_multiple()
3269 static int get_app_pkgname(const char *appid)
3272 char *pkgname = NULL;
3273 pkgmgrinfo_appinfo_h handle;
3274 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3275 if (ret != PMINFO_R_OK)
3277 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
3278 if (ret != PMINFO_R_OK) {
3279 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3282 printf("pkg name: %s\n", pkgname);
3283 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3288 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
3291 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3292 * @brief This API gets the package id of the application
3294 * @par This API is for package-manager client application
3295 * @par Sync (or) Async : Synchronous API
3297 * @param[in] handle pointer to the application info handle.
3298 * @param[out] pkgid pointer to hold package id
3299 * @return 0 if success, error code(<0) if fail
3300 * @retval PMINFO_R_OK success
3301 * @retval PMINFO_R_EINVAL invalid argument
3302 * @retval PMINFO_R_ERROR internal error
3303 * @pre pkgmgrinfo_appinfo_get_appinfo()
3304 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3305 * @see pkgmgrinfo_appinfo_get_appid()
3306 * @see pkgmgrinfo_appinfo_is_multiple()
3308 static int get_app_pkgid(const char *appid)
3312 pkgmgrinfo_appinfo_h handle;
3313 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3314 if (ret != PMINFO_R_OK)
3316 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3317 if (ret != PMINFO_R_OK) {
3318 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3321 printf("pkg id: %s\n", pkgid);
3322 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3327 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3330 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3331 * @brief This API gets the package type of the application
3333 * @par This API is for package-manager client application
3334 * @par Sync (or) Async : Synchronous API
3336 * @param[in] handle pointer to the application info handle.
3337 * @param[out] pkgtype pointer to hold package type
3338 * @return 0 if success, error code(<0) if fail
3339 * @retval PMINFO_R_OK success
3340 * @retval PMINFO_R_EINVAL invalid argument
3341 * @retval PMINFO_R_ERROR internal error
3342 * @pre pkgmgrinfo_appinfo_get_appinfo()
3343 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3344 * @see pkgmgrinfo_appinfo_get_appid()
3345 * @see pkgmgrinfo_appinfo_is_multiple()
3347 static int get_app_pkgtype(const char *appid)
3350 char *pkgtype = NULL;
3351 pkgmgrinfo_appinfo_h handle = NULL;
3352 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3353 if (ret != PMINFO_R_OK)
3355 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3356 if (ret != PMINFO_R_OK) {
3357 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3360 printf("pkgtype: %s\n", pkgtype);
3361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3366 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3369 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3370 * @brief This API gets the executable name of the application
3372 * @par This API is for package-manager client application
3373 * @par Sync (or) Async : Synchronous API
3375 * @param[in] handle pointer to the application info handle.
3376 * @param[out] exec pointer to hold app exec name
3377 * @return 0 if success, error code(<0) if fail
3378 * @retval PMINFO_R_OK success
3379 * @retval PMINFO_R_EINVAL invalid argument
3380 * @retval PMINFO_R_ERROR internal error
3381 * @pre pkgmgrinfo_appinfo_get_appinfo()
3382 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3383 * @see pkgmgrinfo_appinfo_get_appid()
3384 * @see pkgmgrinfo_appinfo_is_multiple()
3386 static int get_app_exec(const char *appid)
3390 pkgmgrinfo_appinfo_h handle;
3391 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3392 if (ret != PMINFO_R_OK)
3394 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3395 if (ret != PMINFO_R_OK) {
3396 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3399 printf("exec name: %s\n", exec);
3400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3405 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3408 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3409 * @brief This API gets the icon name of the application
3411 * @par This API is for package-manager client application
3412 * @par Sync (or) Async : Synchronous API
3414 * @param[in] handle pointer to the application info handle.
3415 * @param[out] icon pointer to hold app icon name
3416 * @return 0 if success, error code(<0) if fail
3417 * @retval PMINFO_R_OK success
3418 * @retval PMINFO_R_EINVAL invalid argument
3419 * @retval PMINFO_R_ERROR internal error
3420 * @pre pkgmgrinfo_appinfo_get_appinfo()
3421 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3422 * @see pkgmgrinfo_appinfo_get_appid()
3423 * @see pkgmgrinfo_appinfo_is_multiple()
3425 static int get_app_icon(const char *appid)
3429 pkgmgrinfo_appinfo_h handle;
3430 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3431 if (ret != PMINFO_R_OK)
3433 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3434 if (ret != PMINFO_R_OK) {
3435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3438 printf("icon name: %s\n", icon);
3439 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3444 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3447 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3448 * @brief This API gets the label of the application
3450 * @par This API is for package-manager client application
3451 * @par Sync (or) Async : Synchronous API
3453 * @param[in] handle pointer to the application info handle.
3454 * @param[out] label pointer to hold app label
3455 * @return 0 if success, error code(<0) if fail
3456 * @retval PMINFO_R_OK success
3457 * @retval PMINFO_R_EINVAL invalid argument
3458 * @retval PMINFO_R_ERROR internal error
3459 * @pre pkgmgrinfo_appinfo_get_appinfo()
3460 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3461 * @see pkgmgrinfo_appinfo_get_appid()
3462 * @see pkgmgrinfo_appinfo_is_multiple()
3464 static int get_app_label(const char *appid)
3468 pkgmgrinfo_appinfo_h handle;
3469 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3470 if (ret != PMINFO_R_OK)
3472 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3473 if (ret != PMINFO_R_OK) {
3474 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3477 printf("label : %s\n", label);
3478 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3483 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3486 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3487 * @brief This API gets exactly matched label by given appid and locale
3489 * @par This API is for package-manager client application
3490 * @par Sync (or) Async : Synchronous API
3492 * @param[in] appid pointer to appid
3493 * @param[in] locale pointer to locale
3494 * @param[out] label pointer to hold app label
3495 * @return 0 if success, error code(<0) if fail
3496 * @retval PMINFO_R_OK success
3497 * @retval PMINFO_R_EINVAL invalid argument
3498 * @retval PMINFO_R_ERROR internal error
3500 static int get_localed_label(const char *appid, const char *locale)
3505 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3506 if (ret != PMINFO_R_OK)
3509 printf("localed label: %s\n", label);
3517 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3518 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3521 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3522 * @brief This API gets metadata value by given metadata key
3524 * @par This API is for package-manager client application
3525 * @par Sync (or) Async : Synchronous API
3527 * @param[in] handle pointer to the application info handle
3528 * @param[in] metadata_key metadata key
3529 * @param[out] metadata_value pointer to hold metadata value
3530 * @return 0 if success, error code(<0) if fail
3531 * @retval PMINFO_R_OK success
3532 * @retval PMINFO_R_EINVAL invalid argument
3534 static int get_metadata_value(const char *appid, const char *metadata_key)
3537 pkgmgrinfo_appinfo_h handle = NULL;
3538 char *metadata_value = NULL;
3540 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3541 if (ret != PMINFO_R_OK)
3544 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3545 if (ret != PMINFO_R_OK) {
3546 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3550 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3555 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3558 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3559 * @brief This API gets the component of the application
3561 * @par This API is for package-manager client application
3562 * @par Sync (or) Async : Synchronous API
3564 * @param[in] handle pointer to the application info handle.
3565 * @param[out] component pointer to hold app component
3566 * @return 0 if success, error code(<0) if fail
3567 * @retval PMINFO_R_OK success
3568 * @retval PMINFO_R_EINVAL invalid argument
3569 * @retval PMINFO_R_ERROR internal error
3570 * @pre pkgmgrinfo_appinfo_get_appinfo()
3571 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3572 * @see pkgmgrinfo_appinfo_get_appid()
3573 * @see pkgmgrinfo_appinfo_is_multiple()
3575 static int get_app_component(const char *appid)
3578 pkgmgrinfo_app_component component;
3579 pkgmgrinfo_appinfo_h handle;
3580 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3581 if (ret != PMINFO_R_OK)
3583 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3584 if (ret != PMINFO_R_OK) {
3585 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3588 printf("component : %s\n", component);
3589 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3594 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3597 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3598 * @brief This API gets the apptype of the application
3600 * @par This API is for package-manager client application
3601 * @par Sync (or) Async : Synchronous API
3603 * @param[in] handle pointer to the application info handle.
3604 * @param[out] app_type pointer to hold apptype
3605 * @return 0 if success, error code(<0) if fail
3606 * @retval PMINFO_R_OK success
3607 * @retval PMINFO_R_EINVAL invalid argument
3608 * @retval PMINFO_R_ERROR internal error
3609 * @pre pkgmgrinfo_appinfo_get_appinfo()
3610 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3611 * @see pkgmgrinfo_appinfo_get_appid()
3612 * @see pkgmgrinfo_appinfo_is_multiple()
3614 static int get_app_type(const char *appid)
3617 char *apptype = NULL;
3618 pkgmgrinfo_appinfo_h handle;
3619 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3620 if (ret != PMINFO_R_OK)
3622 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3623 if (ret != PMINFO_R_OK) {
3624 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3627 printf("apptype : %s\n", apptype);
3628 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3633 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3636 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3637 * @brief This API gets the notification icon of the application
3639 * @par This API is for package-manager client application
3640 * @par Sync (or) Async : Synchronous API
3642 * @param[in] handle pointer to the application info handle.
3643 * @param[out] path pointer to hold notification icon
3644 * @return 0 if success, error code(<0) if fail
3645 * @retval PMINFO_R_OK success
3646 * @retval PMINFO_R_EINVAL invalid argument
3647 * @retval PMINFO_R_ERROR internal error
3648 * @pre pkgmgrinfo_appinfo_get_appinfo()
3649 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3650 * @see pkgmgrinfo_appinfo_get_appid()
3651 * @see pkgmgrinfo_appinfo_is_multiple()
3653 static int get_app_notification_icon(const char *appid)
3656 char *notification_icon = NULL;
3657 pkgmgrinfo_appinfo_h handle;
3658 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3659 if (ret != PMINFO_R_OK)
3661 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3662 if (ret != PMINFO_R_OK) {
3663 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3666 printf("notification icon : %s\n", notification_icon);
3667 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3672 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3675 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3676 * @brief This API gets the type of recent image on app-tray
3678 * @par This API is for package-manager client application
3679 * @par Sync (or) Async : Synchronous API
3681 * @param[in] handle pointer to the application info handle.
3682 * @param[out] type pointer to hold image type
3683 * @return 0 if success, error code(<0) if fail
3684 * @retval PMINFO_R_OK success
3685 * @retval PMINFO_R_EINVAL invalid argument
3686 * @retval PMINFO_R_ERROR internal error
3687 * @pre pkgmgrinfo_appinfo_get_appinfo()
3688 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3689 * @see pkgmgrinfo_appinfo_get_appid()
3690 * @see pkgmgrinfo_appinfo_is_multiple()
3692 static int get_app_recent_image_type(const char *appid)
3695 pkgmgrinfo_app_recentimage type;
3696 pkgmgrinfo_appinfo_h handle;
3697 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3698 if (ret != PMINFO_R_OK)
3700 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3701 if (ret != PMINFO_R_OK) {
3702 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3705 printf("recent image type: %d\n", type);
3706 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3711 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3715 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3716 * @brief This API gets the preview image of application
3718 * @par Sync (or) Async : Synchronous API
3720 * @param[in] handle pointer to the application info handle.
3721 * @param[out] preview_img pointer to hold preview image path
3722 * @return 0 if success, error code(<0) if fail
3723 * @retval PMINFO_R_OK success
3724 * @retval PMINFO_R_EINVAL invalid argument
3725 * @retval PMINFO_R_ERROR internal error
3726 * @pre pkgmgrinfo_appinfo_get_appinfo()
3727 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3728 * @see pkgmgrinfo_appinfo_get_appid()
3730 static int get_app_previewimage(const char *appid)
3733 char *preview = NULL;
3734 pkgmgrinfo_appinfo_h handle = NULL;
3735 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3736 if (ret != PMINFO_R_OK)
3738 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3739 if (ret != PMINFO_R_OK) {
3740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3743 printf("preview image path : %s\n", preview);
3744 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3749 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3753 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3754 * @brief This API gets the package permission type of the application
3756 * @par This API is for package-manager client application
3757 * @par Sync (or) Async : Synchronous API
3759 * @param[in] handle pointer to the application info handle.
3760 * @param[out] permission pointer to hold package permission
3761 * @return 0 if success, error code(<0) if fail
3762 * @retval PMINFO_R_OK success
3763 * @retval PMINFO_R_EINVAL invalid argument
3764 * @retval PMINFO_R_ERROR internal error
3765 * @pre pkgmgrinfo_appinfo_get_appinfo()
3766 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3767 * @see pkgmgrinfo_appinfo_get_appid()
3769 static int get_app_permission(const char *appid)
3772 pkgmgrinfo_permission_type permission = 0;
3773 pkgmgrinfo_appinfo_h handle;
3775 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3776 if (ret != PMINFO_R_OK)
3778 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3779 if (ret != PMINFO_R_OK) {
3780 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3783 printf("permission type: %d\n", permission);
3784 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3789 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3792 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3793 * @brief This API gets the component_type
3795 * @par This API is for package-manager client application
3796 * @par Sync (or) Async : Synchronous API
3798 * @param[in] handle pointer to the application info handle.
3799 * @param[out] component_type pointer to hold component_type
3800 * @return 0 if success, error code(<0) if fail
3801 * @retval PMINFO_R_OK success
3802 * @retval PMINFO_R_EINVAL invalid argument
3803 * @retval PMINFO_R_ERROR internal error
3804 * @pre pkgmgrinfo_appinfo_get_appinfo()
3805 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3806 * @see pkgmgrinfo_appinfo_get_pkgid()
3807 * @see pkgmgrinfo_appinfo_is_multiple()
3809 static int get_component_type(const char *appid)
3812 char *component_type = NULL;
3813 pkgmgrinfo_appinfo_h handle;
3814 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3815 if (ret != PMINFO_R_OK)
3817 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3818 if (ret != PMINFO_R_OK) {
3819 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3822 printf("component_type: %s\n", component_type);
3823 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3828 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3831 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3832 * @brief This API gets the application 'hwacceleration' value from the app ID
3834 * @par This API is for package-manager client application
3835 * @par Sync (or) Async : Synchronous API
3837 * @param[in] handle pointer to application info handle
3838 * @param[out] hwacceleration pointer to hold package hwacceleration value
3839 * @return 0 if success, error code(<0) if fail
3840 * @retval PMINFO_R_OK success
3841 * @retval PMINFO_R_EINVAL invalid argument
3842 * @retval PMINFO_R_ERROR internal error
3843 * @pre pkgmgrinfo_appinfo_get_appinfo()
3844 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3845 * @see pkgmgrinfo_appinfo_get_appid()
3846 * @see pkgmgrinfo_appinfo_is_multiple()
3848 static int get_app_hwacceleration(const char *appid)
3851 pkgmgrinfo_app_hwacceleration hwacceleration;
3852 pkgmgrinfo_appinfo_h handle;
3853 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3854 if (ret != PMINFO_R_OK)
3856 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3857 if (ret != PMINFO_R_OK) {
3858 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3861 printf("app hwacceleration: %d\n", hwacceleration);
3862 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3867 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3870 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3871 * @brief This API gets the application 'screenreader' value from the app ID
3873 * @par This API is for package-manager client application
3874 * @par Sync (or) Async : Synchronous API
3876 * @param[in] handle pointer to application info handle
3877 * @param[out] screenreader pointer to hold package accessibility value
3878 * @return 0 if success, error code(<0) if fail
3879 * @retval PMINFO_R_OK success
3880 * @retval PMINFO_R_EINVAL invalid argument
3881 * @retval PMINFO_R_ERROR internal error
3882 * @pre pkgmgrinfo_appinfo_get_appinfo()
3883 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3884 * @see pkgmgrinfo_appinfo_get_appid()
3885 * @see pkgmgrinfo_appinfo_is_multiple()
3887 static int get_app_screenreader(const char *appid)
3890 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3891 pkgmgrinfo_appinfo_h handle = NULL;
3892 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3893 if (ret != PMINFO_R_OK)
3895 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3896 if (ret != PMINFO_R_OK) {
3897 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3900 printf("app screenreader: %d\n", screenreader);
3901 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3906 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3909 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3910 * @brief This API gets the application's landscape & portrait effect images
3912 * @par This API is for package-manager client application
3913 * @par Sync (or) Async : Synchronous API
3915 * @param[in] handle pointer to application info handle
3916 * @param[out] portrait_img contains portrait mode effect image
3917 * @param[out] landscape_img contains landscape mode effect image
3918 * @return 0 if success, error code(<0) if fail
3919 * @retval PMINFO_R_OK success
3920 * @retval PMINFO_R_EINVAL invalid argument
3921 * @retval PMINFO_R_ERROR internal error
3922 * @pre pkgmgrinfo_appinfo_get_appinfo()
3923 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3924 * @see pkgmgrinfo_appinfo_get_appid()
3925 * @see pkgmgrinfo_appinfo_is_nodisplay()
3927 static int get_app_effectimages(const char *appid)
3930 char *portraitimg = NULL;
3931 char *landscapeimg = NULL;
3932 pkgmgrinfo_appinfo_h handle;
3933 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3934 if (ret != PMINFO_R_OK)
3936 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3937 if (ret != PMINFO_R_OK) {
3938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3941 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3942 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3947 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3950 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3951 * @brief This API gets the application's effect image type
3953 * @par This API is for package-manager client application
3954 * @par Sync (or) Async : Synchronous API
3956 * @param[in] handle pointer to application info handle
3957 * @param[out] effectimg_type contains effect image type
3958 * @return 0 if success, error code(<0) if fail
3959 * @retval PMINFO_R_OK success
3960 * @retval PMINFO_R_EINVAL invalid argument
3961 * @retval PMINFO_R_ERROR internal error
3962 * @pre pkgmgrinfo_appinfo_get_appinfo()
3963 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3964 * @see pkgmgrinfo_appinfo_get_appid()
3965 * @see pkgmgrinfo_appinfo_is_nodisplay()
3967 static int get_app_effectimage_type(const char *appid)
3970 char *effectimg_type = NULL;
3971 pkgmgrinfo_appinfo_h handle = NULL;
3972 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3973 if (ret != PMINFO_R_OK)
3975 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3976 if (ret != PMINFO_R_OK) {
3977 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3980 printf("app effect image type: %s\n", effectimg_type);
3981 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3986 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3989 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3990 * @brief This API gets the submode_mainid of the application
3992 * @par This API is for package-manager client application
3993 * @par Sync (or) Async : Synchronous API
3995 * @param[in] handle pointer to the application info handle.
3996 * @param[out] submode_mainid pointer to hold package name
3997 * @return 0 if success, error code(<0) if fail
3998 * @retval PMINFO_R_OK success
3999 * @retval PMINFO_R_EINVAL invalid argument
4000 * @retval PMINFO_R_ERROR internal error
4001 * @pre pkgmgrinfo_appinfo_get_appinfo()
4002 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4003 * @see pkgmgrinfo_appinfo_get_appid()
4004 * @see pkgmgrinfo_appinfo_is_multiple()
4006 static int get_app_submode_mainid(const char *appid)
4009 char *submode_mainid = NULL;
4010 pkgmgrinfo_appinfo_h handle = NULL;
4011 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4012 if (ret != PMINFO_R_OK)
4014 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
4015 if (ret != PMINFO_R_OK) {
4016 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4019 printf("submode_mainid: %s\n", submode_mainid);
4020 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4025 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
4028 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4029 * @brief This API gets the datacontrol info
4031 * @par This API is for package-manager client application
4032 * @par Sync (or) Async : Synchronous API
4034 * @param[in] providerid pointer to the providerid of dataconltrol.
4035 * @param[in] type pointer to the type of dataconltrol.
4036 * @param[out] appid pointer to hold appid, need to free after using
4037 * @param[out] access pointer to hold access, need to free after using
4038 * @return 0 if success, error code(<0) if fail
4039 * @retval PMINFO_R_OK success
4040 * @retval PMINFO_R_EINVAL invalid argument
4041 * @retval PMINFO_R_ERROR internal error
4044 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4045 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
4048 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4049 * @brief This API gets the appid of datacontrol
4051 * @par This API is for package-manager client application
4052 * @par Sync (or) Async : Synchronous API
4054 * @param[in] providerid pointer to the providerid of dataconltrol.
4055 * @param[out] appid pointer to hold appid, need to free after using
4056 * @return 0 if success, error code(<0) if fail
4057 * @retval PMINFO_R_OK success
4058 * @retval PMINFO_R_EINVAL invalid argument
4059 * @retval PMINFO_R_ERROR internal error
4062 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4063 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
4066 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
4067 * @brief This API gets the information about trusted datacontrol
4069 * @par This API is for package-manager client application
4070 * @par Sync (or) Async : Synchronous API
4072 * @param[in] providerid pointer to the providerid of datacontrol.
4073 * @param[out] appid pointer to hold appid, need to free after using
4074 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
4075 * @return 0 if success, error code(<0) if fail
4076 * @retval PMINFO_R_OK success
4077 * @retval PMINFO_R_EINVAL invalid argument
4078 * @retval PMINFO_R_ERROR internal error
4081 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
4082 const char *type, char **appid, bool *is_trusted);
4083 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
4084 const char *type, uid_t uid, char **appid, bool *is_trusted);
4087 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4088 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4089 * @brief This API retrieves the privileges and invokes given callback for each privilege.
4091 * @par This API is for package-manager client application
4092 * @par Sync (or) Async : Synchronous API
4094 * @param[in] providerid pointer to the providerid of datacontrol.
4095 * @param[in] type pointer to the type of dataconltrol.
4096 * @param[in] privilege_func callback function for list
4097 * @param[in] user_data user data to be passed to callback function
4098 * @return 0 if success, error code(<0) if fail
4099 * @retval PMINFO_R_OK success
4100 * @retval PMINFO_R_EINVAL invalid argument
4101 * @retval PMINFO_R_ERROR internal error
4103 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4104 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4105 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
4106 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
4109 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
4110 * @brief This API gets the alias_appid of the application
4112 * @par This API is for package-manager client application
4113 * @par Sync (or) Async : Synchronous API
4115 * @param[in] handle pointer to the application info handle.
4116 * @param[out] alias_appid pointer to hold app alias_appid
4117 * @return 0 if success, error code(<0) if fail
4118 * @retval PMINFO_R_OK success
4119 * @retval PMINFO_R_EINVAL invalid argument
4120 * @retval PMINFO_R_ERROR internal error
4121 * @pre pkgmgrinfo_appinfo_get_appinfo()
4122 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4123 * @see pkgmgrinfo_appinfo_get_appid()
4125 static int get_alias_appid(const char *appid)
4128 char *alias_appid= 0;
4129 pkgmgrinfo_appinfo_h handle = NULL;
4130 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4131 if (ret != PMINFO_R_OK)
4133 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
4134 if (ret != PMINFO_R_OK) {
4135 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4138 printf("alias_appid: %s\n", alias_appid);
4139 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4144 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
4147 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
4148 * @brief This API gets the effective_appid of the application
4150 * @par This API is for package-manager client application
4151 * @par Sync (or) Async : Synchronous API
4153 * @param[in] handle pointer to the application info handle.
4154 * @param[out] effective_appid pointer to hold app effective_appid
4155 * @return 0 if success, error code(<0) if fail
4156 * @retval PMINFO_R_OK success
4157 * @retval PMINFO_R_EINVAL invalid argument
4158 * @retval PMINFO_R_ERROR internal error
4159 * @pre pkgmgrinfo_appinfo_get_appinfo()
4160 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4161 * @see pkgmgrinfo_appinfo_get_appid()
4163 static int get_effective_appid(const char *appid)
4166 char *effective_appid= 0;
4167 pkgmgrinfo_appinfo_h handle = NULL;
4168 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4169 if (ret != PMINFO_R_OK)
4171 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
4172 if (ret != PMINFO_R_OK) {
4173 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4176 printf("effective_appid: %s\n", effective_appid);
4177 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4182 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
4185 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
4186 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
4188 * @par This API is for package-manager client application
4189 * @par Sync (or) Async : Synchronous API
4191 * @param[in] handle pointer to the appinfo handle.
4192 * @param[out] tep_name pointer to hold tep name
4193 * @return 0 if success, error code(<0) if fail
4194 * @retval PMINFO_R_OK success
4195 * @retval PMINFO_R_EINVAL invalid argument
4196 * @retval PMINFO_R_ERROR internal error
4197 * @pre pkgmgrinfo_appinfo_get_appinfo()
4198 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4199 * @see pkgmgrinfo_appinfo_get_appid()
4201 static int get_tep_name(const char *appid)
4204 char *tep_name = NULL;
4205 pkgmgrinfo_appinfo_h handle = NULL;
4206 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4207 if (ret != PMINFO_R_OK)
4209 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
4210 if (ret != PMINFO_R_OK) {
4211 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4214 printf("TEP name is: %s\n", tep_name);
4215 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4220 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4223 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4224 * @brief This API gets zip mount file name associated with the package which contain given application
4225 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4227 * @par This API is for package-manager client application
4228 * @par Sync (or) Async : Synchronous API
4230 * @param[in] handle pointer to the appinfo handle.
4231 * @param[out] zip_mount_file pointer to hold zip mount file name
4232 * @return 0 if success, error code(<0) if fail
4233 * @retval PMINFO_R_OK success
4234 * @retval PMINFO_R_EINVAL invalid argument
4235 * @retval PMINFO_R_ERROR internal error
4236 * @pre pkgmgrinfo_appinfo_get_appinfo()
4237 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4238 * @see pkgmgrinfo_appinfo_get_appid()
4240 static int get_zip_mount_file(const char *appid)
4243 char *zip_mount_file = NULL;
4244 pkgmgrinfo_appinfo_h handle = NULL;
4245 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4246 if (ret != PMINFO_R_OK)
4248 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4249 if (ret != PMINFO_R_OK) {
4250 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4253 printf("Mount file name is: %s\n", zip_mount_file);
4254 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4259 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4262 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4263 * @brief This API gets the root path of application
4265 * @par Sync (or) Async : Synchronous API
4267 * @param[in] handle pointer to appinfo handle
4268 * @param[out] path pointer to hold root path of application
4269 * @return 0 if success, error code(<0) if fail
4270 * @retval PMINFO_R_OK success
4271 * @retval PMINFO_R_EINVAL invalid argument
4272 * @retval PMINFO_R_ERROR internal error
4274 static int get_root_path(const char *appid)
4278 pkgmgrinfo_appinfo_h handle;
4279 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4280 if (ret != PMINFO_R_OK)
4283 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4284 if (ret != PMINFO_R_OK) {
4285 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4288 printf("path : %s\n", path);
4289 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4295 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4298 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4299 * @brief This API gets the application api_version from the application ID
4301 * @par This API is for package-manager client application
4302 * @par Sync (or) Async : Synchronous API
4304 * @param[in] handle pointer to appinfo handle
4305 * @param[out] api_version pointer to hold application api_version
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4310 * @pre pkgmgrinfo_appinfo_get_appinfo()
4311 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4312 * @see pkgmgrinfo_appinfo_get_appid()
4314 static int get_app_api_version(const char *appid)
4317 char *api_version = NULL;
4318 pkgmgrinfo_appinfo_h handle = NULL;
4319 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4320 if (ret != PMINFO_R_OK)
4322 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4323 if (ret != PMINFO_R_OK) {
4324 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4327 printf("app api_version: %s\n", api_version);
4328 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4333 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4336 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4337 * @brief This API gets the installed_time of the application
4339 * @par This API is for package-manager client application
4340 * @par Sync (or) Async : Synchronous API
4342 * @param[in] handle pointer to the application info handle.
4343 * @param[out] installed_time pointer to hold installed_time
4344 * @return 0 if success, error code(<0) if fail
4345 * @retval PMINFO_R_OK success
4346 * @retval PMINFO_R_EINVAL invalid argument
4347 * @retval PMINFO_R_ERROR internal error
4348 * @pre pkgmgrinfo_appinfo_get_appinfo()
4349 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4350 * @see pkgmgrinfo_appinfo_get_appid()
4351 * @see pkgmgrinfo_appinfo_is_multiple()
4353 static int get_app_installed_time(const char *appid)
4356 int installed_time = 0;
4357 pkgmgrinfo_appinfo_h handle = NULL;
4358 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4359 if (ret != PMINFO_R_OK)
4361 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4362 if (ret != PMINFO_R_OK) {
4363 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4366 printf("installed_time: %d\n", installed_time);
4367 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4372 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4375 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4376 * @brief This API gets the support_mode of the application
4378 * @par This API is for package-manager client application
4379 * @par Sync (or) Async : Synchronous API
4381 * @param[in] handle pointer to the application info handle.
4382 * @param[out] support_mode pointer to hold app support_mode
4383 * @return 0 if success, error code(<0) if fail
4384 * @retval PMINFO_R_OK success
4385 * @retval PMINFO_R_EINVAL invalid argument
4386 * @retval PMINFO_R_ERROR internal error
4387 * @pre pkgmgrinfo_appinfo_get_appinfo()
4388 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4389 * @see pkgmgrinfo_appinfo_get_appid()
4391 static int get_app_support_mode(const char *appid)
4394 int support_mode = 0;
4395 pkgmgrinfo_appinfo_h handle = NULL;
4396 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4397 if (ret != PMINFO_R_OK)
4399 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4400 if (ret != PMINFO_R_OK) {
4401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4404 printf("support_mode: %s\n", support_mode);
4405 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4410 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4414 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4415 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4416 * @brief This API gets the list of category for a particular application
4418 * @par This API is for package-manager client application
4419 * @par Sync (or) Async : Synchronous API
4420 * @param[in] handle pointer to the application info handle.
4421 * @param[in] category_func callback function for list
4422 * @param[in] user_data user data to be passed to callback function
4423 * @return 0 if success, error code(<0) if fail
4424 * @retval PMINFO_R_OK success
4425 * @retval PMINFO_R_EINVAL invalid argument
4426 * @retval PMINFO_R_ERROR internal error
4427 * @pre pkgmgrinfo_appinfo_get_appinfo()
4428 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4430 int category_func(const char *name, void *user_data)
4432 if (strcmp(name, (char *)user_data) == 0)
4438 static int list_category(const char *appid, char *category)
4441 pkgmgrinfo_appinfo_h handle;
4442 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4443 if (ret != PMINFO_R_OK)
4445 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4446 if (ret != PMINFO_R_OK) {
4447 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4450 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4455 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4456 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4459 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4460 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4461 * @brief This API gets the list of metadata for a particular application
4463 * @par This API is for package-manager client application
4464 * @par Sync (or) Async : Synchronous API
4465 * @param[in] handle pointer to the application info handle.
4466 * @param[in] metadata_func callback function for list
4467 * @param[in] user_data user data to be passed to callback function
4468 * @return 0 if success, error code(<0) if fail
4469 * @retval PMINFO_R_OK success
4470 * @retval PMINFO_R_EINVAL invalid argument
4471 * @retval PMINFO_R_ERROR internal error
4472 * @pre pkgmgrinfo_appinfo_get_appinfo()
4473 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4475 int metadata_func(const char *key, const char *value, void *user_data)
4477 if (strcmp(key, (char *)user_data) == 0) {
4478 printf("Value is %s\n", value);
4485 static int list_metadata(const char *appid, char *key)
4488 pkgmgrinfo_appinfo_h handle;
4489 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4490 if (ret != PMINFO_R_OK)
4492 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4493 if (ret != PMINFO_R_OK) {
4494 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4497 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4502 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4503 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4506 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4507 * const char *operation,
4508 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4510 * @brief This API gets the list of privileges for a particular
4511 * appllication's app_control
4513 * @par This API is for package-manager client application
4514 * @par Sync (or) Async : Synchronous API
4515 * @param[in] appid application id
4516 * @param[in] operation operation of appcontrol
4517 * @param[in] privilege_func callback function for list
4518 * @param[in] user_data user data to be passed to callback function
4519 * @return 0 if success, error code(<0) if fail
4520 * @retval PMINFO_R_OK success
4521 * @retval PMINFO_R_EINVAL invalid argument
4522 * @retval PMINFO_R_ERROR internal error
4524 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4525 const char *operation,
4526 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4527 void *user_data, uid_t uid);
4528 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4529 const char *operation,
4530 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4534 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4535 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4536 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4537 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4538 * @brief This API gets the list of app-control for a particular application
4540 * @par This API is for package-manager client application
4541 * @par Sync (or) Async : Synchronous API
4542 * @param[in] handle pointer to the application info handle.
4543 * @param[in] appcontrol_func callback function for list
4544 * @param[in] user_data user data to be passed to callback function
4545 * @param[in] uid the addressee user id of the instruction
4546 * @return 0 if success, error code(<0) if fail
4547 * @retval PMINFO_R_OK success
4548 * @retval PMINFO_R_EINVAL invalid argument
4549 * @retval PMINFO_R_ERROR internal error
4550 * @pre pkgmgrinfo_appinfo_get_appinfo()
4551 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4553 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4557 char *compare_data = (char *)user_data;
4558 if (strcmp(operation, compare_data) == 0)
4564 static int check_operation(const char *appid, char *operation)
4567 pkgmgrinfo_appinfo_h handle;
4568 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4569 if (ret != PMINFO_R_OK)
4571 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4572 if (ret != PMINFO_R_OK) {
4573 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4576 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4581 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4582 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4584 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4585 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4590 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4591 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4594 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4595 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4596 * @brief This API gets the list of splashscreen for a particular application
4598 * @par This API is for package-manager client application
4599 * @par Sync (or) Async : Synchronous API
4600 * @param[in] handle pointer to the application info handle.
4601 * @param[in] splash_screen_func callback function for list
4602 * @param[in] user_data user data to be passed to callback function
4603 * @return 0 if success, error code(<0) if fail
4604 * @retval PMINFO_R_OK success
4605 * @retval PMINFO_R_EINVAL invalid argument
4606 * @retval PMINFO_R_ERROR internal error
4607 * @pre pkgmgrinfo_appinfo_get_appinfo()
4608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4611 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4612 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4615 * @fn int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4616 pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4617 * @brief This API gets the list of resource control for a particular application
4619 * @par This API is for package-manager client application
4620 * @par Sync (or) Async : Synchronous API
4621 * @param[in] handle pointer to the application info handle.
4622 * @param[in] res_control_func callback function for list
4623 * @param[in] user_data user data to be passed to callback function
4624 * @return 0 if success, error code(<0) if fail
4625 * @retval PMINFO_R_OK success
4626 * @retval PMINFO_R_EINVAL invalid argument
4627 * @retval PMINFO_R_ERROR internal error
4628 * @pre pkgmgrinfo_appinfo_get_appinfo()
4629 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4631 int res_control_func(const char *res_type,
4632 const char *min_res_version, const char *max_res_version,
4633 const char *auto_close, void *user_data)
4635 printf("res_type : %s\n", res_type);
4639 static int list_res_control(const char *appid, char *key)
4642 pkgmgrinfo_appinfo_h handle;
4643 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4644 if (ret != PMINFO_R_OK)
4646 ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4647 if (ret != PMINFO_R_OK) {
4648 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4651 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4656 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4657 pkgmgrinfo_app_res_control_list_cb res_control_func,
4661 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4662 * @brief This API gets the application 'nodisplay' value from the app ID
4664 * @par This API is for package-manager client application
4665 * @par Sync (or) Async : Synchronous API
4667 * @param[in] handle pointer to application info handle
4668 * @param[out] nodisplay pointer to hold package nodisplay value
4669 * @return 0 if success, error code(<0) if fail
4670 * @retval PMINFO_R_OK success
4671 * @retval PMINFO_R_EINVAL invalid argument
4672 * @retval PMINFO_R_ERROR internal error
4673 * @pre pkgmgrinfo_appinfo_get_appinfo()
4674 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4675 * @see pkgmgrinfo_appinfo_get_appid()
4676 * @see pkgmgrinfo_appinfo_is_multiple()
4678 static int get_app_nodisplay(const char *appid)
4682 pkgmgrinfo_appinfo_h handle;
4683 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4684 if (ret != PMINFO_R_OK)
4686 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4687 if (ret != PMINFO_R_OK) {
4688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4691 printf("app nodisplay: %d\n", nodisplay);
4692 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4697 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4700 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4701 * @brief This API gets the application 'multiple' value from the app ID
4703 * @par This API is for package-manager client application
4704 * @par Sync (or) Async : Synchronous API
4706 * @param[in] handle pointer to application info handle
4707 * @param[out] multiple pointer to hold package multiple value
4708 * @return 0 if success, error code(<0) if fail
4709 * @retval PMINFO_R_OK success
4710 * @retval PMINFO_R_EINVAL invalid argument
4711 * @retval PMINFO_R_ERROR internal error
4712 * @pre pkgmgrinfo_appinfo_get_appinfo()
4713 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4714 * @see pkgmgrinfo_appinfo_get_appid()
4715 * @see pkgmgrinfo_appinfo_is_nodisplay()
4717 static int get_app_multiple(const char *appid)
4721 pkgmgrinfo_appinfo_h handle;
4722 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4723 if (ret != PMINFO_R_OK)
4725 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4726 if (ret != PMINFO_R_OK) {
4727 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4730 printf("app multiple: %d\n", multiple);
4731 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4736 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4739 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4740 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4741 * application launching effect. If fales, indicator will be hidden during application launching effect
4743 * @par This API is for package-manager client application
4744 * @par Sync (or) Async : Synchronous API
4746 * @param[in] handle pointer to application info handle
4747 * @param[out] indicator_disp contains indicator display status for application launching effect
4748 * @return 0 if success, error code(<0) if fail
4749 * @retval PMINFO_R_OK success
4750 * @retval PMINFO_R_EINVAL invalid argument
4751 * @retval PMINFO_R_ERROR internal error
4752 * @pre pkgmgrinfo_appinfo_get_appinfo()
4753 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4754 * @see pkgmgrinfo_appinfo_get_appid()
4755 * @see pkgmgrinfo_appinfo_is_nodisplay()
4757 static int get_app_indicator_display(const char *appid)
4760 bool indicator_disp;
4761 pkgmgrinfo_appinfo_h handle;
4762 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4763 if (ret != PMINFO_R_OK)
4765 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4766 if (ret != PMINFO_R_OK){
4767 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4770 printf("app indicator disp : %d\n", indicator_disp);
4771 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4776 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4779 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4780 * @brief This API gets the application 'taskmanage' value from the app ID
4782 * @par This API is for package-manager client application
4783 * @par Sync (or) Async : Synchronous API
4785 * @param[in] handle pointer to application info handle
4786 * @param[out] taskmanage pointer to hold package taskmanage value
4787 * @return 0 if success, error code(<0) if fail
4788 * @retval PMINFO_R_OK success
4789 * @retval PMINFO_R_EINVAL invalid argument
4790 * @retval PMINFO_R_ERROR internal error
4791 * @pre pkgmgrinfo_appinfo_get_appinfo()
4792 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4793 * @see pkgmgrinfo_appinfo_get_appid()
4794 * @see pkgmgrinfo_appinfo_is_multiple()
4796 static int get_app_taskmanage(const char *appid)
4800 pkgmgrinfo_appinfo_h handle;
4801 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4802 if (ret != PMINFO_R_OK)
4804 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4805 if (ret != PMINFO_R_OK) {
4806 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4809 printf("app taskmanage: %d\n", taskmanage);
4810 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4815 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4818 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4819 * @brief This API gets the application 'taskmanage' value from the app ID
4821 * @par This API is for package-manager client application
4822 * @par Sync (or) Async : Synchronous API
4824 * @param[in] handle pointer to application info handle
4825 * @param[out] enabled pointer to hold package enabled value
4826 * @return 0 if success, error code(<0) if fail
4827 * @retval PMINFO_R_OK success
4828 * @retval PMINFO_R_EINVAL invalid argument
4829 * @retval PMINFO_R_ERROR internal error
4830 * @pre pkgmgrinfo_appinfo_get_appinfo()
4831 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4832 * @see pkgmgrinfo_appinfo_get_appid()
4833 * @see pkgmgrinfo_appinfo_is_multiple()
4835 static int get_app_enabled(const char *appid)
4839 pkgmgrinfo_appinfo_h handle;
4840 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4841 if (ret != PMINFO_R_OK)
4843 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4844 if (ret != PMINFO_R_OK) {
4845 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4848 printf("app enabled: %d\n", enabled);
4849 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4854 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4857 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4858 * @brief This API gets the application 'onboot' value from the app ID
4860 * @par This API is for package-manager client application
4861 * @par Sync (or) Async : Synchronous API
4863 * @param[in] handle pointer to application info handle
4864 * @param[out] onboot pointer to hold package onboot value
4865 * @return 0 if success, error code(<0) if fail
4866 * @retval PMINFO_R_OK success
4867 * @retval PMINFO_R_EINVAL invalid argument
4868 * @retval PMINFO_R_ERROR internal error
4869 * @pre pkgmgrinfo_appinfo_get_appinfo()
4870 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4871 * @see pkgmgrinfo_appinfo_get_appid()
4872 * @see pkgmgrinfo_appinfo_is_multiple()
4874 static int get_app_onboot(const char *appid)
4878 pkgmgrinfo_appinfo_h handle;
4879 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4880 if (ret != PMINFO_R_OK)
4882 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4883 if (ret != PMINFO_R_OK) {
4884 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4887 printf("app onboot: %d\n", onboot);
4888 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4893 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4896 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4897 * @brief This API gets the application 'autorestart' value from the app ID
4899 * @par This API is for package-manager client application
4900 * @par Sync (or) Async : Synchronous API
4902 * @param[in] handle pointer to application info handle
4903 * @param[out] autorestart pointer to hold package autorestart value
4904 * @return 0 if success, error code(<0) if fail
4905 * @retval PMINFO_R_OK success
4906 * @retval PMINFO_R_EINVAL invalid argument
4907 * @retval PMINFO_R_ERROR internal error
4908 * @pre pkgmgrinfo_appinfo_get_appinfo()
4909 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4910 * @see pkgmgrinfo_appinfo_get_appid()
4911 * @see pkgmgrinfo_appinfo_is_multiple()
4913 static int get_app_autorestart(const char *appid)
4917 pkgmgrinfo_appinfo_h handle;
4918 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4919 if (ret != PMINFO_R_OK)
4921 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4922 if (ret != PMINFO_R_OK) {
4923 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4926 printf("app autorestart: %d\n", autorestart);
4927 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4932 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4935 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4936 * @brief This API gets the value for given application is main app or not from handle
4938 * @par This API is for package-manager client application
4939 * @par Sync (or) Async : Synchronous API
4941 * @param[in] handle pointer to application info handle
4942 * @param[out] mainapp pointer to hold package mainapp is or not
4943 * @return 0 if success, error code(<0) if fail
4944 * @retval PMINFO_R_OK success
4945 * @retval PMINFO_R_EINVAL invalid argument
4946 * @retval PMINFO_R_ERROR internal error
4947 * @pre pkgmgrinfo_appinfo_get_appinfo()
4948 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4949 * @see pkgmgrinfo_appinfo_get_appid()
4950 * @see pkgmgrinfo_appinfo_is_multiple()
4952 static int get_app_mainapp(const char *appid)
4956 pkgmgrinfo_appinfo_h handle;
4957 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4958 if (ret != PMINFO_R_OK)
4960 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4961 if (ret != PMINFO_R_OK) {
4962 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4965 printf("mainapp: %d\n", mainapp);
4966 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4971 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
4975 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4976 * @brief This API gets the value for given application is preload or not from handle
4978 * @par This API is for package-manager client application
4979 * @par Sync (or) Async : Synchronous API
4981 * @param[in] handle pointer to application info handle
4982 * @param[out] preload pointer to hold preload is or not
4983 * @return 0 if success, error code(<0) if fail
4984 * @retval PMINFO_R_OK success
4985 * @retval PMINFO_R_EINVAL invalid argument
4986 * @retval PMINFO_R_ERROR internal error
4987 * @pre pkgmgrinfo_appinfo_get_appinfo()
4988 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4989 * @see pkgmgrinfo_appinfo_get_appid()
4990 * @see pkgmgrinfo_appinfo_is_multiple()
4992 static int get_app_preload(const char *appid)
4996 pkgmgrinfo_appinfo_h handle = NULL;
4997 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4998 if (ret != PMINFO_R_OK)
5000 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
5001 if (ret != PMINFO_R_OK) {
5002 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5005 printf("preload: %d\n", preload);
5006 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5011 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
5014 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
5015 * @brief This API gets the value for given application is submode or not from handle
5017 * @par This API is for package-manager client application
5018 * @par Sync (or) Async : Synchronous API
5020 * @param[in] handle pointer to application info handle
5021 * @param[out] submode pointer to hold submode is or not
5022 * @return 0 if success, error code(<0) if fail
5023 * @retval PMINFO_R_OK success
5024 * @retval PMINFO_R_EINVAL invalid argument
5025 * @retval PMINFO_R_ERROR internal error
5026 * @pre pkgmgrinfo_appinfo_get_appinfo()
5027 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5028 * @see pkgmgrinfo_appinfo_get_appid()
5029 * @see pkgmgrinfo_appinfo_is_multiple()
5031 static int get_app_submode(const char *appid)
5035 pkgmgrinfo_appinfo_h handle = NULL;
5036 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5037 if (ret != PMINFO_R_OK)
5039 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
5040 if (ret != PMINFO_R_OK) {
5041 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5044 printf("submode: %d\n", submode);
5045 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5050 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
5053 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
5054 * @brief This API gets the value for given application is process_pool or not from handle
5056 * @par This API is for package-manager client application
5057 * @par Sync (or) Async : Synchronous API
5059 * @param[in] handle pointer to application info handle
5060 * @param[out] process_pool pointer to hold process_pool is or not
5061 * @return 0 if success, error code(<0) if fail
5062 * @retval PMINFO_R_OK success
5063 * @retval PMINFO_R_EINVAL invalid argument
5064 * @retval PMINFO_R_ERROR internal error
5065 * @pre pkgmgrinfo_appinfo_get_appinfo()
5066 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5067 * @see pkgmgrinfo_appinfo_get_appid()
5069 static int get_app_process_pool(const char *appid)
5072 bool process_pool = 0;
5073 pkgmgrinfo_appinfo_h handle = NULL;
5074 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5075 if (ret != PMINFO_R_OK)
5077 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
5078 if (ret != PMINFO_R_OK) {
5079 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5082 printf("process_pool: %d\n", process_pool);
5083 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5088 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
5091 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
5092 * @brief This API gets the installed storage location of the application
5094 * @par This API is for package-manager client application
5095 * @par Sync (or) Async : Synchronous API
5097 * @param[in] handle pointer to the application info handle.
5098 * @param[out] app_type pointer to hold installed storage location
5099 * @return 0 if success, error code(<0) if fail
5100 * @retval PMINFO_R_OK success
5101 * @retval PMINFO_R_EINVAL invalid argument
5102 * @retval PMINFO_R_ERROR internal error
5103 * @pre pkgmgrinfo_appinfo_get_appinfo()
5104 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5105 * @see pkgmgrinfo_appinfo_get_appid()
5107 static int get_app_installed_location(const char *appid)
5110 pkgmgrinfo_installed_storage storage;
5111 pkgmgrinfo_appinfo_h handle = NULL;
5112 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5113 if (ret != PMINFO_R_OK)
5115 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
5116 if (ret != PMINFO_R_OK) {
5117 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5120 printf("Installed storage location : %d\n", storage);
5121 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5126 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
5130 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
5131 * @brief This API checks if the application has the given category
5133 * @par This API is for package-manager client application
5134 * @par Sync (or) Async : Synchronous API
5136 * @param[in] handle pointer to the application info handle
5137 * @param[in] category category
5138 * @param[out] exist value Gets whether the application has the given category
5139 * @return 0 if success, error code(<0) if fail
5140 * @retval PMINFO_R_OK success
5141 * @retval PMINFO_R_EINVAL invalid argument
5142 * @retval PMINFO_R_ERROR internal error
5144 static int is_category_exist(const char *appid, const char *category)
5147 pkgmgrinfo_appinfo_h handle;
5150 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5151 if (ret != PMINFO_R_OK)
5154 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
5155 if (ret != PMINFO_R_OK) {
5156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5160 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5165 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
5168 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
5169 * @brief This API gets the application 'ui_gadget' value from the app ID
5171 * @par This API is for package-manager client application
5172 * @par Sync (or) Async : Synchronous API
5174 * @param[in] handle pointer to application info handle
5175 * @param[out] ui_gadget pointer to hold package ui_gadget value
5176 * @return 0 if success, error code(<0) if fail
5177 * @retval PMINFO_R_OK success
5178 * @retval PMINFO_R_EINVAL invalid argument
5179 * @pre pkgmgrinfo_appinfo_get_appinfo()
5180 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5182 static int get_app_ui_gadget(const char *appid)
5186 pkgmgrinfo_appinfo_h handle = NULL;
5187 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5188 if (ret != PMINFO_R_OK)
5190 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
5191 if (ret != PMINFO_R_OK) {
5192 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5195 printf("app ui_gadget: %d\n", ui_gadget);
5196 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5201 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
5204 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
5205 * @brief This API gets the application 'support_disable' value from the app ID
5207 * @par This API is for package-manager client application
5208 * @par Sync (or) Async : Synchronous API
5210 * @param[in] handle pointer to application info handle
5211 * @param[out] support_disable pointer to hold package support_disable value
5212 * @return 0 if success, error code(<0) if fail
5213 * @retval PMINFO_R_OK success
5214 * @retval PMINFO_R_EINVAL invalid argument
5215 * @pre pkgmgrinfo_appinfo_get_appinfo()
5216 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5218 static int get_app_support_disable(const char *appid)
5221 bool support_disable;
5222 pkgmgrinfo_appinfo_h handle = NULL;
5223 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5224 if (ret != PMINFO_R_OK)
5226 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
5227 if (ret != PMINFO_R_OK) {
5228 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5231 printf("app support_disable: %d\n", support_disable);
5232 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5237 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
5240 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
5241 * @brief This API gets the application 'removable' value from the app ID
5243 * @par This API is for package-manager client application
5244 * @par Sync (or) Async : Synchronous API
5246 * @param[in] handle pointer to application info handle
5247 * @param[out] removable pointer to hold package removable value
5248 * @return 0 if success, error code(<0) if fail
5249 * @retval PMINFO_R_OK success
5250 * @retval PMINFO_R_EINVAL invalid argument
5251 * @retval PMINFO_R_ERROR internal error
5252 * @pre pkgmgrinfo_appinfo_get_appinfo()
5253 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5254 * @see pkgmgrinfo_appinfo_get_appid()
5256 static int get_app_removable(const char *appid)
5260 pkgmgrinfo_appinfo_h handle = NULL;
5261 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5262 if (ret != PMINFO_R_OK)
5264 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5265 if (ret != PMINFO_R_OK) {
5266 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5269 printf("app removable: %d\n", removable);
5270 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5275 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5278 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5279 * @brief This API gets the application 'system' value from the app ID
5281 * @par This API is for package-manager client application
5282 * @par Sync (or) Async : Synchronous API
5284 * @param[in] handle pointer to application info handle
5285 * @param[out] system pointer to hold package system value
5286 * @return 0 if success, error code(<0) if fail
5287 * @retval PMINFO_R_OK success
5288 * @retval PMINFO_R_EINVAL invalid argument
5289 * @retval PMINFO_R_ERROR internal error
5290 * @pre pkgmgrinfo_appinfo_get_appinfo()
5291 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5292 * @see pkgmgrinfo_appinfo_get_appid()
5294 static int get_app_system(const char *appid)
5297 bool system = false;
5298 pkgmgrinfo_appinfo_h handle = NULL;
5299 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5300 if (ret != PMINFO_R_OK)
5302 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5303 if (ret != PMINFO_R_OK) {
5304 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5307 printf("app system: %d\n", system);
5308 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5313 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5317 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5318 * @brief This API gets the application 'is_disable' value from the app ID
5320 * @par This API is for package-manager client application
5321 * @par Sync (or) Async : Synchronous API
5323 * @param[in] handle pointer to application info handle
5324 * @param[out] disabled pointer to hold application is_disabled value
5325 * @return 0 if success, error code(<0) if fail
5326 * @retval PMINFO_R_OK success
5327 * @retval PMINFO_R_EINVAL invalid argument
5328 * @pre pkgmgrinfo_appinfo_get_appinfo()
5329 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5331 static int get_app_is_disable(const char *appid)
5335 pkgmgrinfo_appinfo_h handle = NULL;
5336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5337 if (ret != PMINFO_R_OK)
5339 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5340 if (ret != PMINFO_R_OK) {
5341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5344 printf("app is_disable: %d\n", is_disable);
5345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5350 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5353 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5354 * @brief This API gets whether the given application is global application or user application
5356 * @par This API is for package-manager client application
5357 * @par Sync (or) Async : Synchronous API
5359 * @param[in] handle pointer to application info handle
5360 * @param[in] global pointer to hold application global value
5361 * @return 0 if success, error code(<0) if fail
5362 * @retval PMINFO_R_OK success
5363 * @retval PMINFO_R_EINVAL invalid argument
5364 * @retval PMINFO_R_ERROR internal error
5365 * @pre pkgmgrinfo_appinfo_get_appinfo()
5366 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5367 * @see pkgmgrinfo_appinfo_get_appid()
5368 static int get_app_is_global(const char *appid)
5372 pkgmgrinfo_appinfo_h handle = NULL;
5373 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5374 if (ret != PMINFO_R_OK)
5376 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5377 if (ret != PMINFO_R_OK) {
5378 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5381 printf("app is_global: %d\n", global);
5382 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5387 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5390 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5391 * @brief This API gets the application 'splash_screen_display' value from the app ID
5393 * @par This API is for package-manager client application
5394 * @par Sync (or) Async : Synchronous API
5396 * @param[in] handle pointer to application info handle
5397 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5398 * @return 0 if success, error code(<0) if fail
5399 * @retval PMINFO_R_OK success
5400 * @retval PMINFO_R_EINVAL invalid argument
5401 * @retval PMINFO_R_ERROR internal error
5403 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5406 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5407 * @brief This API gets the application 'setup_appid' value from the app ID
5409 * @par This API is for package-manager client application
5410 * @par Sync (or) Async : Synchronous API
5412 * @param[in] handle pointer to application info handle
5413 * @param[out] setup_appid pointer to hold package setup_appid value
5414 * @return 0 if success, error code(<0) if fail
5415 * @retval PMINFO_R_OK success
5416 * @retval PMINFO_R_EINVAL invalid argument
5417 * @retval PMINFO_R_ERROR internal error
5419 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5422 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5423 * @brief This API gets the application 'support_ambient' value from the app ID
5425 * @par This API is for package-manager client application
5426 * @par Sync (or) Async : Synchronous API
5428 * @param[in] handle pointer to application info handle
5429 * @param[out] support_ambient pointer to hold package support_ambient value
5430 * @return 0 if success, error code(<0) if fail
5431 * @retval PMINFO_R_OK success
5432 * @retval PMINFO_R_EINVAL invalid argument
5433 * @retval PMINFO_R_ERROR internal error
5435 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5438 * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
5439 * @brief This API gets the application 'light_user_switch_mode' value from the app ID
5441 * @par This API is for package-manager client application
5442 * @par Sync (or) Async : Synchronous API
5444 * @param[in] handle pointer to application info handle
5445 * @param[out] mode pointer to hold package light_user_switch_mode value
5446 * @return 0 if success, error code(<0) if fail
5447 * @retval PMINFO_R_OK success
5448 * @retval PMINFO_R_EINVAL invalid argument
5449 * @retval PMINFO_R_ERROR internal error
5451 int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
5454 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5455 * @brief This API destroys the application information handle freeing up all the resources
5457 * @par This API is for package-manager client application
5458 * @par Sync (or) Async : Synchronous API
5460 * @param[in] handle pointer to the application info handle.
5461 * @return 0 if success, error code(<0) if fail
5462 * @retval PMINFO_R_OK success
5463 * @retval PMINFO_R_EINVAL invalid argument
5464 * @retval PMINFO_R_ERROR internal error
5465 * @pre pkgmgrinfo_appinfo_get_appinfo()
5467 * @see pkgmgrinfo_appinfo_get_pkgid()
5468 * @see pkgmgrinfo_appinfo_is_multiple()
5470 static int get_app_type(const char *appid)
5474 pkgmgrinfo_appinfo_h handle;
5475 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5476 if (ret != PMINFO_R_OK)
5478 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5479 if (ret != PMINFO_R_OK) {
5480 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5483 printf("apptype: %s\n", type);
5484 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5489 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5492 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5493 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5494 The query will search the entire application information collected from the manifest file of all the installed packages
5496 * @par This API is for package-manager client application
5497 * @par Sync (or) Async : Synchronous API
5499 * @param[out] handle pointer to the application info filter handle.
5500 * @return 0 if success, error code(<0) if fail
5501 * @retval PMINFO_R_OK success
5502 * @retval PMINFO_R_EINVAL invalid argument
5503 * @retval PMINFO_R_ERROR internal error
5505 * @post pkgmgrinfo_appinfo_filter_destroy()
5506 * @see pkgmgrinfo_appinfo_filter_count()
5507 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5509 static int get_capp_count()
5513 pkgmgrinfo_appinfo_filter_h handle;
5514 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5515 if (ret != PMINFO_R_OK)
5517 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5518 if (ret != PMINFO_R_OK) {
5519 pkgmgrinfo_appinfo_filter_destroy(handle);
5522 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5523 if (ret != PMINFO_R_OK) {
5524 pkgmgrinfo_appinfo_filter_destroy(handle);
5527 printf("No of capp: %d\n", count);
5528 pkgmgrinfo_appinfo_filter_destroy(handle);
5533 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5536 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5537 * @brief This API destroys the application information filter handle freeing up all the resources
5539 * @par This API is for package-manager client application
5540 * @par Sync (or) Async : Synchronous API
5542 * @param[in] handle pointer to the application info filter handle.
5543 * @return 0 if success, error code(<0) if fail
5544 * @retval PMINFO_R_OK success
5545 * @retval PMINFO_R_EINVAL invalid argument
5546 * @retval PMINFO_R_ERROR internal error
5547 * @pre pkgmgrinfo_appinfo_filter_create()
5549 * @see pkgmgrinfo_appinfo_filter_count()
5550 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5552 static int get_capp_count()
5556 pkgmgrinfo_appinfo_filter_h handle;
5557 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5558 if (ret != PMINFO_R_OK)
5560 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5561 if (ret != PMINFO_R_OK) {
5562 pkgmgrinfo_appinfo_filter_destroy(handle);
5565 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5566 if (ret != PMINFO_R_OK) {
5567 pkgmgrinfo_appinfo_filter_destroy(handle);
5570 printf("No of capp: %d\n", count);
5571 pkgmgrinfo_appinfo_filter_destroy(handle);
5576 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5579 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5580 * @brief This API adds a boolean filter property to the filter handle
5582 * @par This API is for package-manager client application
5583 * @par Sync (or) Async : Synchronous API
5585 * @param[in] handle pointer to the application info filter handle.
5586 * @param[in] property boolean property name.
5587 * @param[in] value value corresponding to the property.
5588 * @return 0 if success, error code(<0) if fail
5589 * @retval PMINFO_R_OK success
5590 * @retval PMINFO_R_EINVAL invalid argument
5591 * @retval PMINFO_R_ERROR internal error
5592 * @pre pkgmgrinfo_appinfo_filter_create()
5593 * @post pkgmgrinfo_appinfo_filter_destroy()
5594 * @see pkgmgrinfo_appinfo_filter_count()
5595 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5597 static int get_taskmanageable_app_count()
5601 pkgmgrinfo_appinfo_filter_h handle;
5602 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5603 if (ret != PMINFO_R_OK)
5605 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5606 if (ret != PMINFO_R_OK) {
5607 pkgmgrinfo_appinfo_filter_destroy(handle);
5610 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5611 if (ret != PMINFO_R_OK) {
5612 pkgmgrinfo_appinfo_filter_destroy(handle);
5615 printf("No of taskmanageable apps: %d\n", count);
5616 pkgmgrinfo_appinfo_filter_destroy(handle);
5621 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5622 const char *property, const bool value);
5625 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5626 * @brief This API adds an integer filter property to the filter handle
5628 * @par This API is for package-manager client application
5629 * @par Sync (or) Async : Synchronous API
5631 * @param[in] handle pointer to the application info filter handle.
5632 * @param[in] property integer property name.
5633 * @param[in] value value corresponding to the property.
5634 * @return 0 if success, error code(<0) if fail
5635 * @retval PMINFO_R_OK success
5636 * @retval PMINFO_R_EINVAL invalid argument
5637 * @retval PMINFO_R_ERROR internal error
5638 * @pre pkgmgrinfo_appinfo_filter_create()
5639 * @post pkgmgrinfo_appinfo_filter_destroy()
5640 * @see pkgmgrinfo_appinfo_filter_count()
5641 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5643 static int get_taskmanageable_app_count()
5647 pkgmgrinfo_appinfo_filter_h handle;
5648 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5649 if (ret != PMINFO_R_OK)
5651 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5652 if (ret != PMINFO_R_OK) {
5653 pkgmgrinfo_appinfo_filter_destroy(handle);
5656 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5657 if (ret != PMINFO_R_OK) {
5658 pkgmgrinfo_appinfo_filter_destroy(handle);
5661 printf("No of apps: %d\n", count);
5662 pkgmgrinfo_appinfo_filter_destroy(handle);
5667 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5668 const char *property, const int value);
5671 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5672 * @brief This API adds a string filter property to the filter handle
5674 * @par This API is for package-manager client application
5675 * @par Sync (or) Async : Synchronous API
5677 * @param[in] handle pointer to the application info filter handle.
5678 * @param[in] property string property name.
5679 * @param[in] value value corresponding to the property.
5680 * @return 0 if success, error code(<0) if fail
5681 * @retval PMINFO_R_OK success
5682 * @retval PMINFO_R_EINVAL invalid argument
5683 * @retval PMINFO_R_ERROR internal error
5684 * @pre pkgmgrinfo_appinfo_filter_create()
5685 * @post pkgmgrinfo_appinfo_filter_destroy()
5686 * @see pkgmgrinfo_appinfo_filter_count()
5687 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5689 static int get_capp_count()
5693 pkgmgrinfo_appinfo_filter_h handle;
5694 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5695 if (ret != PMINFO_R_OK)
5697 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5698 if (ret != PMINFO_R_OK) {
5699 pkgmgrinfo_appinfo_filter_destroy(handle);
5702 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5703 if (ret != PMINFO_R_OK) {
5704 pkgmgrinfo_appinfo_filter_destroy(handle);
5707 printf("No of capp: %d\n", count);
5708 pkgmgrinfo_appinfo_filter_destroy(handle);
5713 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5714 const char *property, const char *value);
5717 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5718 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5720 * @par This API is for package-manager client application
5721 * @par Sync (or) Async : Synchronous API
5723 * @param[in] handle pointer to the application info filter handle.
5724 * @param[in] app_cb callback function.
5725 * @param[in] user_data user data to be passed to the callback function
5726 * @return 0 if success, error code(<0) if fail
5727 * @retval PMINFO_R_OK success
5728 * @retval PMINFO_R_EINVAL invalid argument
5729 * @retval PMINFO_R_ERROR internal error
5730 * @pre pkgmgrinfo_appinfo_filter_create()
5731 * @post pkgmgrinfo_appinfo_filter_destroy()
5732 * @see pkgmgrinfo_appinfo_filter_count()
5734 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5737 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5738 printf("appid : %s\n", appid);
5742 static int get_capp_list()
5745 pkgmgrinfo_appinfo_filter_h handle;
5746 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5747 if (ret != PMINFO_R_OK)
5749 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5750 if (ret != PMINFO_R_OK) {
5751 pkgmgrinfo_appinfo_filter_destroy(handle);
5754 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5755 if (ret != PMINFO_R_OK) {
5756 pkgmgrinfo_appinfo_filter_destroy(handle);
5759 pkgmgrinfo_appinfo_filter_destroy(handle);
5764 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5765 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5766 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5767 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5770 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5771 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5772 * @brief This API counts the application that satisfy the filter conditions
5774 * @par This API is for package-manager client application
5775 * @par Sync (or) Async : Synchronous API
5777 * @param[in] handle pointer to the application info filter handle.
5778 * @param[in] count pointer to store count value
5779 * @param[in] uid the addressee user id of the instruction
5780 * @return 0 if success, error code(<0) if fail
5781 * @retval PMINFO_R_OK success
5782 * @retval PMINFO_R_EINVAL invalid argument
5783 * @retval PMINFO_R_ERROR internal error
5784 * @pre pkgmgrinfo_appinfo_filter_create()
5785 * @post pkgmgrinfo_appinfo_filter_destroy()
5786 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5788 static int get_capp_count()
5792 pkgmgrinfo_appinfo_filter_h handle;
5793 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5794 if (ret != PMINFO_R_OK)
5796 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5797 if (ret != PMINFO_R_OK) {
5798 pkgmgrinfo_appinfo_filter_destroy(handle);
5801 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5802 if (ret != PMINFO_R_OK) {
5803 pkgmgrinfo_appinfo_filter_destroy(handle);
5806 printf("No of capp: %d\n", count);
5807 pkgmgrinfo_appinfo_filter_destroy(handle);
5812 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5813 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5815 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5816 * @brief This API creates the application's metadata information filter handle from db.
5818 * @par This API is for package-manager client application
5819 * @par Sync (or) Async : Synchronous API
5821 * @param[out] handle pointer to the application metadata info filter handle.
5822 * @return 0 if success, error code(<0) if fail
5823 * @retval PMINFO_R_OK success
5824 * @retval PMINFO_R_EINVAL invalid argument
5825 * @retval PMINFO_R_ERROR internal error
5827 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5828 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5830 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5833 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5834 printf("appid : %s\n", appid);
5838 static int get_app_list(const char *mkey, const char *mvalue)
5841 pkgmgrinfo_appinfo_metadata_filter_h handle;
5842 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5843 if (ret != PMINFO_R_OK)
5845 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5846 if (ret != PMINFO_R_OK) {
5847 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5850 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5851 if (ret != PMINFO_R_OK) {
5852 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5855 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5860 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5863 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5864 * @brief This API destroys the application's metadata information filter handle.
5866 * @par This API is for package-manager client application
5867 * @par Sync (or) Async : Synchronous API
5869 * @param[in] handle pointer to the application metadata info filter handle.
5870 * @return 0 if success, error code(<0) if fail
5871 * @retval PMINFO_R_OK success
5872 * @retval PMINFO_R_EINVAL invalid argument
5873 * @retval PMINFO_R_ERROR internal error
5874 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5876 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5878 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5881 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5882 printf("appid : %s\n", appid);
5886 static int get_app_list(const char *mkey, const char *mvalue)
5889 pkgmgrinfo_appinfo_metadata_filter_h handle;
5890 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5891 if (ret != PMINFO_R_OK)
5893 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5894 if (ret != PMINFO_R_OK) {
5895 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5898 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5899 if (ret != PMINFO_R_OK) {
5900 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5903 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5908 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5911 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5912 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5913 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5915 * @par This API is for package-manager client application
5916 * @par Sync (or) Async : Synchronous API
5918 * @param[in] handle pointer to the application metadata info filter handle.
5919 * @param[in] key pointer to metadata key
5920 * @param[in] value pointer to metadata value
5921 * @return 0 if success, error code(<0) if fail
5922 * @retval PMINFO_R_OK success
5923 * @retval PMINFO_R_EINVAL invalid argument
5924 * @retval PMINFO_R_ERROR internal error
5925 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5926 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5927 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5929 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5932 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5933 printf("appid : %s\n", appid);
5937 static int get_app_list(const char *mkey, const char *mvalue)
5940 pkgmgrinfo_appinfo_metadata_filter_h handle;
5941 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5942 if (ret != PMINFO_R_OK)
5944 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5945 if (ret != PMINFO_R_OK) {
5946 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5949 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5950 if (ret != PMINFO_R_OK) {
5951 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5954 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5959 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5960 const char *key, const char *value);
5963 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5964 * @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)
5965 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
5966 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5967 * negative value, no more callbacks will be called and API will return.
5969 * @par This API is for package-manager client application
5970 * @par Sync (or) Async : Synchronous API
5972 * @param[in] handle pointer to the application metadata info filter handle.
5973 * @param[in] app_cb function pointer to callback
5974 * @param[in] user_data pointer to user data
5975 * @param[in] uid the addressee user id of the instruction
5976 * @return 0 if success, error code(<0) if fail
5977 * @retval PMINFO_R_OK success
5978 * @retval PMINFO_R_EINVAL invalid argument
5979 * @retval PMINFO_R_ERROR internal error
5980 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5981 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5983 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5986 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5987 printf("appid : %s\n", appid);
5991 static int get_app_list(const char *mkey, const char *mvalue)
5994 pkgmgrinfo_appinfo_metadata_filter_h handle;
5995 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5996 if (ret != PMINFO_R_OK)
5998 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5999 if (ret != PMINFO_R_OK) {
6000 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6003 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
6004 if (ret != PMINFO_R_OK) {
6005 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6008 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6013 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6014 pkgmgrinfo_app_list_cb app_cb, void *user_data);
6015 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6016 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
6019 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6020 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6021 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6022 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6023 * @brief This API gets the list of app-control for a particular application
6025 * @par This API is for package-manager client application
6026 * @par Sync (or) Async : Synchronous API
6027 * @param[in] handle pointer to the application info handle.
6028 * @param[in] appcontrol_func callback function for list
6029 * @param[in] user_data user data to be passed to callback function
6030 * @return 0 if success, error code(<0) if fail
6031 * @retval PMINFO_R_OK success
6032 * @retval PMINFO_R_EINVAL invalid argument
6033 * @retval PMINFO_R_ERROR internal error
6034 * @pre pkgmgrinfo_appinfo_get_appinfo()
6035 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6037 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6038 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6040 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6041 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6044 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
6045 * @brief This API creates the package cert information handle to get data from db.
6047 * @par This API is for package-manager client application
6048 * @par Sync (or) Async : Synchronous API
6050 * @param[out] handle pointer to the package cert handle.
6051 * @return 0 if success, error code(<0) if fail
6052 * @retval PMINFO_R_OK success
6053 * @retval PMINFO_R_EINVAL invalid argument
6054 * @retval PMINFO_R_ERROR internal error
6056 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6057 * @see pkgmgrinfo_pkginfo_get_cert_value()
6058 * @see pkgmgrinfo_pkginfo_load_certinfo()
6060 static int get_cert_info(const char *pkgid)
6063 pkgmgrinfo_certinfo_h handle;
6064 char *auth_cert = NULL;
6065 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6066 if (ret != PMINFO_R_OK)
6068 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6069 if (ret != PMINFO_R_OK) {
6070 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6073 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6074 if (ret != PMINFO_R_OK) {
6075 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6078 printf("Author root certificate: %s\n", auth_root);
6079 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6084 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
6087 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
6088 * @brief This API loads the package cert information handle with data from db.
6090 * @par This API is for package-manager client application
6091 * @par Sync (or) Async : Synchronous API
6093 * @param[in] pkgid pointer to the package ID.
6094 * @param[in] handle pointer to the package cert handle.
6095 * @return 0 if success, error code(<0) if fail
6096 * @retval PMINFO_R_OK success
6097 * @retval PMINFO_R_EINVAL invalid argument
6098 * @retval PMINFO_R_ERROR internal error
6099 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6100 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6101 * @see pkgmgrinfo_pkginfo_get_cert_value()
6103 static int get_cert_info(const char *pkgid)
6106 pkgmgrinfo_certinfo_h handle;
6107 char *auth_cert = NULL;
6108 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6109 if (ret != PMINFO_R_OK)
6111 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6112 if (ret != PMINFO_R_OK) {
6113 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6116 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6117 if (ret != PMINFO_R_OK) {
6118 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6121 printf("Author root certificate: %s\n", auth_root);
6122 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6127 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
6130 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
6131 * @brief This API gets the package cert information from the handle
6133 * @par This API is for package-manager client application
6134 * @par Sync (or) Async : Synchronous API
6136 * @param[in] handle pointer to the package cert handle.
6137 * @param[in] cert_type certificate type
6138 * @param[out] cert_value pointer to hold certificate value
6139 * @return 0 if success, error code(<0) if fail
6140 * @retval PMINFO_R_OK success
6141 * @retval PMINFO_R_EINVAL invalid argument
6142 * @retval PMINFO_R_ERROR internal error
6143 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6144 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6145 * @see pkgmgrinfo_pkginfo_load_certinfo()
6147 static int get_cert_info(const char *pkgid)
6150 pkgmgrinfo_certinfo_h handle;
6151 char *auth_cert = NULL;
6152 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6153 if (ret != PMINFO_R_OK)
6155 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6156 if (ret != PMINFO_R_OK) {
6157 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6160 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6161 if (ret != PMINFO_R_OK) {
6162 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6165 printf("Author root certificate: %s\n", auth_root);
6166 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6171 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
6174 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
6175 * @brief This API destroys the package cert information handle freeing up all the resources
6177 * @par This API is for package-manager client application
6178 * @par Sync (or) Async : Synchronous API
6180 * @param[in] handle pointer to the package cert handle.
6181 * @return 0 if success, error code(<0) if fail
6182 * @retval PMINFO_R_OK success
6183 * @retval PMINFO_R_EINVAL invalid argument
6184 * @retval PMINFO_R_ERROR internal error
6185 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6187 * @see pkgmgrinfo_pkginfo_load_certinfo()
6189 static int get_cert_info(const char *pkgid)
6192 pkgmgrinfo_certinfo_h handle;
6193 char *auth_cert = NULL;
6194 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6195 if (ret != PMINFO_R_OK)
6197 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6198 if (ret != PMINFO_R_OK) {
6199 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6202 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6203 if (ret != PMINFO_R_OK) {
6204 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6207 printf("Author root certificate: %s\n", auth_root);
6208 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6213 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
6216 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
6217 * @brief This API deletes the package cert information from DB
6219 * @par This API is for package-manager client application
6220 * @par Sync (or) Async : Synchronous API
6222 * @param[in] pkgid pointer to the package ID.
6223 * @return 0 if success, error code(<0) if fail
6224 * @retval PMINFO_R_OK success
6225 * @retval PMINFO_R_EINVAL invalid argument
6226 * @retval PMINFO_R_ERROR internal error
6230 static int delete_cert_info(const char *pkgid)
6233 ret = pkgmgrinfo_delete_certinfo(pkgid);
6234 if (ret != PMINFO_R_OK)
6240 int pkgmgrinfo_delete_certinfo(const char *pkgid);
6241 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
6244 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
6245 * @brief This API creates the package cert information handle to set data in db.
6247 * @par This API is for package-manager client application
6248 * @par Sync (or) Async : Synchronous API
6250 * @param[out] handle pointer to the package cert handle.
6251 * @return 0 if success, error code(<0) if fail
6252 * @retval PMINFO_R_OK success
6253 * @retval PMINFO_R_EINVAL invalid argument
6254 * @retval PMINFO_R_ERROR internal error
6256 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6257 * @see pkgmgrinfo_set_cert_value()
6258 * @see pkgmgrinfo_save_certinfo()
6260 static int set_cert_in_db(const char *pkgid)
6263 pkgmgrinfo_instcertinfo_h handle;
6264 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6265 if (ret != PMINFO_R_OK)
6267 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6268 if (ret != PMINFO_R_OK) {
6269 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6272 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6273 if (ret != PMINFO_R_OK) {
6274 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6277 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6282 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6285 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6286 * @brief This API sets the package cert information in the handle.
6288 * @par This API is for package-manager client application
6289 * @par Sync (or) Async : Synchronous API
6291 * @param[in] handle pointer to the package cert handle.
6292 * @param[in] cert_type certificate type.
6293 * @param[in] cert_value certificate value.
6294 * @return 0 if success, error code(<0) if fail
6295 * @retval PMINFO_R_OK success
6296 * @retval PMINFO_R_EINVAL invalid argument
6297 * @retval PMINFO_R_ERROR internal error
6298 * @pre pkgmgrinfo_create_certinfo_set_handle()
6299 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6300 * @see pkgmgrinfo_save_certinfo()
6302 static int set_cert_in_db(const char *pkgid)
6305 pkgmgrinfo_instcertinfo_h handle;
6306 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6307 if (ret != PMINFO_R_OK)
6309 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6310 if (ret != PMINFO_R_OK) {
6311 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6314 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6315 if (ret != PMINFO_R_OK) {
6316 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6319 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6324 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6327 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6328 * @brief This API saves the package cert information in the DB.
6330 * @par This API is for package-manager client application
6331 * @par Sync (or) Async : Synchronous API
6333 * @param[in] pkgid pointer to the package ID.
6334 * @param[in] handle pointer to the package cert handle.
6335 * @return 0 if success, error code(<0) if fail
6336 * @retval PMINFO_R_OK success
6337 * @retval PMINFO_R_EINVAL invalid argument
6338 * @retval PMINFO_R_ERROR internal error
6339 * @pre pkgmgrinfo_create_certinfo_set_handle()
6340 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6341 * @see pkgmgrinfo_save_certinfo()
6343 static int set_cert_in_db(const char *pkgid)
6346 pkgmgrinfo_instcertinfo_h handle;
6347 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6348 if (ret != PMINFO_R_OK)
6350 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6351 if (ret != PMINFO_R_OK) {
6352 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6355 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6356 if (ret != PMINFO_R_OK) {
6357 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6360 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6365 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6368 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6369 * @brief This API destroys the package cert information handle freeing up all the resources.
6371 * @par This API is for package-manager client application
6372 * @par Sync (or) Async : Synchronous API
6374 * @param[in] handle pointer to the package cert handle.
6375 * @return 0 if success, error code(<0) if fail
6376 * @retval PMINFO_R_OK success
6377 * @retval PMINFO_R_EINVAL invalid argument
6378 * @retval PMINFO_R_ERROR internal error
6379 * @pre pkgmgrinfo_create_certinfo_set_handle()
6381 * @see pkgmgrinfo_save_certinfo()
6383 static int set_cert_in_db(const char *pkgid)
6386 pkgmgrinfo_instcertinfo_h handle;
6387 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6388 if (ret != PMINFO_R_OK)
6390 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6391 if (ret != PMINFO_R_OK) {
6392 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6395 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6396 if (ret != PMINFO_R_OK) {
6397 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6400 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6405 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6408 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6409 * @brief This API gets the application 'guest mode visibility' value from the DB
6411 * @par This API is for package-manager client application
6412 * @par Sync (or) Async : Synchronous API
6414 * @param[in] handle pointer to application info handle
6415 * @param[out] status pointer to hold app guest mode visibility value
6416 * @return 0 if success, error code(<0) if fail
6417 * @retval PMINFO_R_OK success
6418 * @retval PMINFO_R_EINVAL invalid argument
6419 * @retval PMINFO_R_ERROR internal error
6420 * @pre pkgmgrinfo_appinfo_get_appinfo()
6421 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6422 * @see pkgmgrinfo_appinfo_get_appid()
6423 * @see pkgmgrinfo_appinfo_is_multiple()
6425 static int get_app_guestmode_visibility(const char *appid)
6429 pkgmgrinfo_appinfo_h handle;
6430 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6431 if (ret != PMINFO_R_OK)
6433 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6434 if (ret != PMINFO_R_OK) {
6435 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6438 printf("app guest mode visibility: %d\n", status);
6439 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6444 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6447 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6448 * @brief This API sets the package 'installed_storage' value in db
6450 * @par This API is for package-manager client application
6451 * @par Sync (or) Async : Synchronous API
6453 * @param[in] pkgid pointer to the package ID.
6454 * @param[in] location package install location
6455 * @param[in] external_pkg_path image path if pkg has installed at external storage
6456 * @return 0 if success, error code(<0) if fail
6457 * @retval PMINFO_R_OK success
6458 * @retval PMINFO_R_EINVAL invalid argument
6459 * @retval PMINFO_R_ERROR internal error
6461 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6465 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6466 if (ret != PMINFO_R_OK) {
6473 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6474 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6476 /* version compare */
6477 int pkgmgrinfo_compare_package_version(const char *current_version,
6478 const char *target_version, pkgmgrinfo_version_compare_type *res);
6481 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6482 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6484 * @brief This API gets the list of dependency of a particular package
6486 * @par This API is for package-manager client application
6487 * @par Sync (or) Async : Synchronous API
6488 * @param[in] handle pointer to the package info handle.
6489 * @param[in] dependency_cb callback function for list
6490 * @param[in] user_data user data to be passed to callback function
6491 * @return 0 if success, error code(<0) if fail
6492 * @retval PMINFO_R_OK success
6493 * @retval PMINFO_R_EINVAL invalid argument
6494 * @retval PMINFO_R_ERROR internal error
6495 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6496 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6498 int dependency_cb(const char *from const char *to, const char *type,
6499 const char *required_version,void *user_data)
6501 printf("this package %s %s", type, to);
6502 if (required_version)
6503 printf("required version : %s", required_version);
6507 static int list_dependency(const char *package)
6510 pkgmgrinfo_pkginfo_h handle;
6511 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6512 if (ret != PMINFO_R_OK)
6514 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6515 if (ret != PMINFO_R_OK) {
6516 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6519 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6524 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6525 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6529 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6530 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6532 * @brief This API gets the list of packages which has dependency directly
6533 * and indirectly of a particular package
6535 * @par This API is for package-manager client application
6536 * @par Sync (or) Async : Synchronous API
6537 * @param[in] handle pointer to the package info handle.
6538 * @param[in] dependency_cb callback function for list
6539 * @param[in] user_data user data to be passed to callback function
6540 * @return 0 if success, error code(<0) if fail
6541 * @retval PMINFO_R_OK success
6542 * @retval PMINFO_R_EINVAL invalid argument
6543 * @retval PMINFO_R_ERROR internal error
6544 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6545 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6547 int dependency_cb(const char *from, const char *to, const char *type,
6548 const char *required_version,void *user_data)
6550 printf("%s %s %s package", from, to, type);
6551 if (required_version)
6552 printf("required version : %s", required_version);
6556 static int list_depends_on(const char *package)
6559 pkgmgrinfo_pkginfo_h handle;
6560 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6561 if (ret != PMINFO_R_OK)
6563 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6564 if (ret != PMINFO_R_OK) {
6565 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6573 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6574 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6578 * @fn int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6579 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6581 * @brief This API gets the list of allowed package for a particular package
6583 * @par This API is for package-manager client application
6584 * @par Sync (or) Async : Synchronous API
6585 * @param[in] handle pointer to the package info handle.
6586 * @param[in] res_allowed_package_cb callback function for list
6587 * @param[in] user_data user data to be passed to callback function
6588 * @return 0 if success, error code(<0) if fail
6589 * @retval PMINFO_R_OK success
6590 * @retval PMINFO_R_EINVAL invalid argument
6591 * @retval PMINFO_R_ERROR internal error
6592 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6593 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6595 int res_allowed_package_cb(const char *allowed_package,
6596 required_privilege_h handle, void *user_data)
6598 printf("allowed package : %s", allowed_package);
6603 static int list_res_allowed_package(const char *package)
6606 pkgmgrinfo_pkginfo_h handle;
6607 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6608 if (ret != PMINFO_R_OK)
6610 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6611 if (ret != PMINFO_R_OK) {
6612 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6615 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6620 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6621 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6625 * @fn int pkgmgrinfo_pkginfo_foreach_required_privilege(
6626 required_privilege_h handle,
6627 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6629 * @brief This API gets the list of allowed package's required privileges
6631 * @par This API is for package-manager client application
6632 * @par Sync (or) Async : Synchronous API
6633 * @param[in] handle pointer to the required privilege handle.
6634 * @param[in] privilege_func callback function for list
6635 * @param[in] user_data user data to be passed to callback function
6636 * @return 0 if success, error code(<0) if fail
6637 * @retval PMINFO_R_OK success
6638 * @retval PMINFO_R_EINVAL invalid argument
6639 * @pre pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6642 int privilege_func(const char *privilege_name, void *user_data)
6644 printf("required privilege : %s", privilege_name);
6649 int res_allowed_package_cb(const char *allowed_package,
6650 required_privilege_h handle, void *user_data)
6653 printf("allowed package : %s", allowed_package);
6655 ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6656 if (ret != PMINFO_R_OK)
6662 static int list_res_allowed_package(const char *package)
6665 pkgmgrinfo_pkginfo_h handle;
6666 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6667 if (ret != PMINFO_R_OK)
6669 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6670 if (ret != PMINFO_R_OK) {
6671 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6674 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6679 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6680 required_privilege_h handle,
6681 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6685 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6686 * @brief This API gets list of installed packages using flag that used for masking package's information
6688 * @par This API is for package-manager client application
6689 * @par Sync (or) Async : Synchronous API
6690 * @param[in] pkg_list_cb iteration function for list
6691 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6692 * @param[in] user_data user data to be passed to callback function
6693 * @return 0 if success, error code(<0) if fail
6694 * @retval PMINFO_R_OK success
6695 * @retval PMINFO_R_EINVAL invalid argument
6696 * @retval PMINFO_R_ERROR internal error
6699 * @see pkgmgrinfo_pkginfo_get_option
6701 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6703 char *label1 = NULL;
6704 char *label2 = NULL;
6705 label1 = (char *)user_data;
6706 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6707 if (strcmp(label1, label2) == 0)
6713 static int list_pkgs()
6716 char *label = "helloworld";
6717 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6718 if (ret != PMINFO_R_OK)
6724 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6725 int flag, void *user_data, uid_t uid);
6726 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6727 int flag, void *user_data);
6730 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6731 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6733 * @par This API is for package-manager client application
6734 * @par Sync (or) Async : Synchronous API
6735 * @param[in] app_func iteration function for list
6736 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6737 * @param[in] user_data user data to be passed to callback function
6738 * @return 0 if success, error code(<0) if fail
6739 * @retval PMINFO_R_OK success
6740 * @retval PMINFO_R_EINVAL invalid argument
6741 * @retval PMINFO_R_ERROR internal error
6744 * @see pkgmgrinfo_appinfo_get_option
6746 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6749 char *label1 = NULL;
6750 char *label2 = NULL;
6751 label1 = (char *)user_data;
6752 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6753 if (ret != PMINFO_R_OK) {
6754 printf("pkgmgrinfo_appinfo_get_label fail");
6757 if (strcmp(label1, label2) == 0)
6763 static int list_apps()
6766 char *label = "helloworld";
6767 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6768 if (ret != PMINFO_R_OK)
6774 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6775 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6777 int pkgmgrinfo_appinfo_get_installed_list_full(
6778 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6781 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6782 * @brief This API creates the package archive information handle from given path
6784 * @par This API is for package-manager client application
6785 * @par Sync (or) Async : Synchronous API
6787 * @param[in] path path of package archive
6788 * @param[out] handle pointer to the package archive info handle
6789 * @return 0 if success, error code(<0) if fail
6790 * @retval PMINFO_R_OK success
6791 * @retval PMINFO_R_EINVAL invalid argument
6792 * @retval PMINFO_R_ERROR internal error
6794 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6796 static int get_pkg_archive_type(const char *path)
6800 pkgmgrinfo_archiveinfo_h handle;
6801 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6802 if (ret != PMINFO_R_OK)
6804 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6805 if (ret != PMINFO_R_OK) {
6806 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6809 printf("pkg archive type: %s\n", type);
6810 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6815 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6816 pkgmgrinfo_archiveinfo_h *handle);
6819 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6820 * @brief This API destroys the package archive information handle freeing up all the resources
6822 * @par This API is for package-manager client application
6823 * @par Sync (or) Async : Synchronous API
6825 * @param[in] handle pointer to the package archive info handle
6826 * @return 0 if success, error code(<0) if fail
6827 * @retval PMINFO_R_OK success
6828 * @retval PMINFO_R_EINVAL invalid argument
6829 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6832 static int get_pkg_archive_type(const char *path)
6836 pkgmgrinfo_archiveinfo_h handle;
6837 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6838 if (ret != PMINFO_R_OK)
6840 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6841 if (ret != PMINFO_R_OK) {
6842 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6845 printf("pkg archive type: %s\n", type);
6846 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6851 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6854 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6855 * @brief This API gets the package id from the package archive info handle
6857 * @par This API is for package-manager client application
6858 * @par Sync (or) Async : Synchronous API
6860 * @param[in] handle pointer to package archive info handle
6861 * @param[out] pkgid pointer to hold package id
6862 * @return 0 if success, error code(<0) if fail
6863 * @retval PMINFO_R_OK success
6864 * @retval PMINFO_R_EINVAL invalid argument
6865 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6866 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6868 static int get_pkg_archive_id(const char *path)
6871 char *pkg_id = NULL;
6872 pkgmgrinfo_archiveinfo_h handle;
6873 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6874 if (ret != PMINFO_R_OK)
6876 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6877 if (ret != PMINFO_R_OK) {
6878 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6881 printf("pkg archive id: %s\n", pkg_id);
6882 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6887 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6888 const char **pkgid);
6891 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6892 * @brief This API gets the package type from the package archive info handle
6894 * @par This API is for package-manager client application
6895 * @par Sync (or) Async : Synchronous API
6897 * @param[in] handle pointer to package archive info handle
6898 * @param[out] type pointer to hold package type
6899 * @return 0 if success, error code(<0) if fail
6900 * @retval PMINFO_R_OK success
6901 * @retval PMINFO_R_EINVAL invalid argument
6902 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6903 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6905 static int get_pkg_archive_type(const char *path)
6909 pkgmgrinfo_archiveinfo_h handle;
6910 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6911 if (ret != PMINFO_R_OK)
6913 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6914 if (ret != PMINFO_R_OK) {
6915 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6918 printf("pkg archive type: %s\n", type);
6919 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6924 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6928 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6929 * @brief This API gets the package version from the package archive info handle
6931 * @par This API is for package-manager client application
6932 * @par Sync (or) Async : Synchronous API
6934 * @param[in] handle pointer to package archive info handle
6935 * @param[out] version pointer to hold package version
6936 * @return 0 if success, error code(<0) if fail
6937 * @retval PMINFO_R_OK success
6938 * @retval PMINFO_R_EINVAL invalid argument
6939 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6940 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6942 static int get_pkg_archive_version(const char *path)
6945 char *version = NULL;
6946 pkgmgrinfo_archiveinfo_h handle;
6947 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6948 if (ret != PMINFO_R_OK)
6950 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6951 if (ret != PMINFO_R_OK) {
6952 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6955 printf("pkg archive version: %s\n", version);
6956 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6961 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6962 const char **version);
6965 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6966 * @brief This API gets the package api version from the package archive info handle
6968 * @par This API is for package-manager client application
6969 * @par Sync (or) Async : Synchronous API
6971 * @param[in] handle pointer to package archive info handle
6972 * @param[out] api_version pointer to hold package api_version
6973 * @return 0 if success, error code(<0) if fail
6974 * @retval PMINFO_R_OK success
6975 * @retval PMINFO_R_EINVAL invalid argument
6976 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6977 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6979 static int get_pkg_archive_api_version(const char *path)
6982 char *api_version = NULL;
6983 pkgmgrinfo_archiveinfo_h handle;
6984 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6985 if (ret != PMINFO_R_OK)
6987 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6988 if (ret != PMINFO_R_OK) {
6989 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6992 printf("pkg archive api_version: %s\n", api_version);
6993 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6998 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6999 const char **api_version);
7002 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
7003 * @brief This API gets the package description from the package archive info handle
7005 * @par This API is for package-manager client application
7006 * @par Sync (or) Async : Synchronous API
7008 * @param[in] handle pointer to package archive info handle
7009 * @param[out] description pointer to hold package description
7010 * @return 0 if success, error code(<0) if fail
7011 * @retval PMINFO_R_OK success
7012 * @retval PMINFO_R_EINVAL invalid argument
7013 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7014 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7016 static int get_pkg_archive_description(const char *path)
7019 char *description = NULL;
7020 pkgmgrinfo_archiveinfo_h handle;
7021 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7022 if (ret != PMINFO_R_OK)
7024 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
7025 if (ret != PMINFO_R_OK) {
7026 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7029 printf("pkg archive description: %s\n", description);
7030 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7035 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
7036 const char **description);
7039 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
7040 * @brief This API gets the package label from the package archive info handle
7042 * @par This API is for package-manager client application
7043 * @par Sync (or) Async : Synchronous API
7045 * @param[in] handle pointer to package archive info handle
7046 * @param[out] label pointer to hold package label
7047 * @return 0 if success, error code(<0) if fail
7048 * @retval PMINFO_R_OK success
7049 * @retval PMINFO_R_EINVAL invalid argument
7050 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7051 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7053 static int get_pkg_archive_label(const char *path)
7057 pkgmgrinfo_archiveinfo_h handle;
7058 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7059 if (ret != PMINFO_R_OK)
7061 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
7062 if (ret != PMINFO_R_OK) {
7063 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7066 printf("pkg archive label: %s\n", label);
7067 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7072 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
7073 const char **label);
7076 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
7077 * @brief This API gets the package author from the package archive info handle
7079 * @par This API is for package-manager client application
7080 * @par Sync (or) Async : Synchronous API
7082 * @param[in] handle pointer to package archive info handle
7083 * @param[out] author pointer to hold package author
7084 * @return 0 if success, error code(<0) if fail
7085 * @retval PMINFO_R_OK success
7086 * @retval PMINFO_R_EINVAL invalid argument
7087 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7088 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7090 static int get_pkg_archive_author(const char *path)
7093 char *author = NULL;
7094 pkgmgrinfo_archiveinfo_h handle;
7095 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7096 if (ret != PMINFO_R_OK)
7098 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
7099 if (ret != PMINFO_R_OK) {
7100 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7103 printf("pkg archive author: %s\n", author);
7104 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7109 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
7110 const char **author);
7113 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
7114 * @brief This API gets the package icon and size from the package archive info handle
7116 * @par This API is for package-manager client application
7117 * @par Sync (or) Async : Synchronous API
7119 * @param[in] handle pointer to package archive info handle
7120 * @param[out] icon pointer to hold package icon
7121 * @param[out] size pointer to hold size of package icon
7122 * @return 0 if success, error code(<0) if fail
7123 * @retval PMINFO_R_OK success
7124 * @retval PMINFO_R_EINVAL invalid argument
7125 * @retval PMINFO_R_ENOENT no result
7126 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7127 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7129 static int get_pkg_archive_icon(const char *path)
7132 unsigned char *icon = NULL;
7133 size_t icon_size = 0;
7134 pkgmgrinfo_archiveinfo_h handle;
7135 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7136 if (ret != PMINFO_R_OK)
7138 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
7139 if (ret != PMINFO_R_OK) {
7140 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7143 printf("pkg archive icon size : %zu\n", icon_size);
7144 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7149 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
7150 const unsigned char **icon, size_t *size);
7153 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
7154 * @brief This API retrieve the dependency information and invoke given callback for it.
7156 * @par This API is for package-manager client application
7157 * @par Sync (or) Async : Synchronous API
7159 * @param[in] handle pointer to package archive info handle
7160 * @param[in] callback callback to be invoked for each retrieved dependency information
7161 * @param[in] user_data user data to be passed to callback
7162 * @return 0 if success, error code(<0) if fail
7163 * @retval PMINFO_R_OK success
7164 * @retval PMINFO_R_EINVAL invalid argument
7165 * @retval PMINFO_R_ERROR internal error
7166 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7167 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7169 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
7172 size_t icon_size = 0;
7173 pkgmgrinfo_archiveinfo_h handle;
7174 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7175 if (ret != PMINFO_R_OK)
7177 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
7178 if (ret != PMINFO_R_OK) {
7179 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7182 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7187 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
7188 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
7191 * @pkgmgrinfo client API end
7199 #endif /* __PKG_INFO_H__ */