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_get_metadata_value(pkgmgrinfo_pkginfo_h handle, const char *metadata_key, char **metadata_value)
1798 * @brief This API gets metadata value by given metadata key
1800 * @par Sync (or) Async : Synchronous API
1802 * @param[in] handle pointer to the package info handle
1803 * @param[in] metadata_key metadata key
1804 * @param[out] metadata_value pointer to hold metadata value
1805 * @return 0 if success, error code(<0) if fail
1806 * @retval PMINFO_R_OK success
1807 * @retval PMINFO_R_EINVAL invalid argument
1809 static int get_metadata_value(const char *pkgid, const char *metadata_key)
1812 pkgmgrinfo_pkginfo_h handle = NULL;
1813 char *metadata_value = NULL;
1815 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1816 if (ret != PMINFO_R_OK)
1819 ret = pkgmgrinfo_pkginfo_get_metadata_value(handle, metadata_key, &metadata_value);
1820 if (ret != PMINFO_R_OK) {
1821 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1825 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1830 int pkgmgrinfo_pkginfo_get_metadata_value(pkgmgrinfo_pkginfo_h handle, const char *metadata_key, char **metadata_value);
1833 * @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)
1834 * @brief This API compare the cert information from given package id
1836 * @par This API is for package-manager client application
1837 * @par Sync (or) Async : Synchronous API
1839 * @param[in] lhs_package_id pointer to first package ID
1840 * @param[in] rhs_package_id pointer to second package ID
1841 * @param[out] compare_result pointer to the compare result.
1842 * @return 0 if success, error code(<0) if fail
1843 * @retval PMINFO_R_OK success
1844 * @retval PMINFO_R_EINVAL invalid argument
1845 * @retval PMINFO_R_ERROR internal error
1847 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1848 * @see pkgmgrinfo_pkginfo_get_pkgid()
1849 * @see pkgmgrinfo_pkginfo_is_removable()
1851 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1854 pkgmgrinfo_cert_compare_result_type_e result;
1856 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1857 if (ret != PMINFO_R_OK) {
1860 printf("result: %d\n", result);
1865 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);
1866 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);
1868 * @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)
1869 * @brief This API compare the cert information from given app id
1871 * @par This API is for package-manager client application
1872 * @par Sync (or) Async : Synchronous API
1874 * @param[in] lhs_app_id pointer to first app ID
1875 * @param[in] rhs_app_id pointer to second app ID
1876 * @param[out] compare_result pointer to the compare result.
1877 * @return 0 if success, error code(<0) if fail
1878 * @retval PMINFO_R_OK success
1879 * @retval PMINFO_R_EINVAL invalid argument
1880 * @retval PMINFO_R_ERROR internal error
1882 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1883 * @see pkgmgrinfo_pkginfo_get_pkgid()
1884 * @see pkgmgrinfo_pkginfo_is_removable()
1886 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1889 pkgmgrinfo_cert_compare_result_type_e result;
1891 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1892 if (ret != PMINFO_R_OK) {
1895 printf("result: %d\n", result);
1900 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);
1901 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);
1903 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1904 * @brief This API gets the package 'removable' value from the package ID
1906 * @par This API is for package-manager client application
1907 * @par Sync (or) Async : Synchronous API
1909 * @param[in] handle pointer to package info handle
1910 * @param[out] removable pointer to hold package removable value
1911 * @return 0 if success, error code(<0) if fail
1912 * @retval PMINFO_R_OK success
1913 * @retval PMINFO_R_EINVAL invalid argument
1914 * @retval PMINFO_R_ERROR internal error
1915 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1916 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1917 * @see pkgmgrinfo_pkginfo_get_pkgid()
1918 * @see pkgmgrinfo_pkginfo_is_readonly()
1920 static int get_pkg_removable(const char *pkgid)
1924 pkgmgrinfo_pkginfo_h handle;
1925 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1926 if (ret != PMINFO_R_OK)
1928 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1929 if (ret != PMINFO_R_OK) {
1930 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1933 printf("pkg removable: %d\n", removable);
1934 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1939 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1942 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1943 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1945 * @par This API is for package-manager client application
1946 * @par Sync (or) Async : Synchronous API
1948 * @param[in] handle pointer to package info handle
1949 * @param[out] movable pointer to hold package movable state
1950 * @return 0 if success, error code(<0) if fail
1951 * @retval PMINFO_R_OK success
1952 * @retval PMINFO_R_EINVAL invalid argument
1953 * @retval PMINFO_R_ERROR internal error
1954 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1955 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1956 * @see pkgmgrinfo_pkginfo_get_pkgid()
1958 static int get_pkg_movable(const char *pkgid)
1962 pkgmgrinfo_pkginfo_h handle;
1963 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1964 if (ret != PMINFO_R_OK)
1966 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1967 if (ret != PMINFO_R_OK) {
1968 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1971 printf("pkg movable: %d\n", movable);
1972 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1977 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1980 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1981 * @brief This API gets the package 'preload' value from the package ID
1983 * @par This API is for package-manager client application
1984 * @par Sync (or) Async : Synchronous API
1986 * @param[in] handle pointer to package info handle
1987 * @param[out] preload pointer to hold package preload value
1988 * @return 0 if success, error code(<0) if fail
1989 * @retval PMINFO_R_OK success
1990 * @retval PMINFO_R_EINVAL invalid argument
1991 * @retval PMINFO_R_ERROR internal error
1992 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1993 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1994 * @see pkgmgrinfo_pkginfo_get_pkgid()
1995 * @see pkgmgrinfo_pkginfo_is_readonly()
1997 static int get_pkg_preload(const char *pkgid)
2001 pkgmgrinfo_pkginfo_h handle;
2002 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2003 if (ret != PMINFO_R_OK)
2005 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
2006 if (ret != PMINFO_R_OK) {
2007 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2010 printf("pkg preload: %d\n", preload);
2011 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2016 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
2019 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
2020 * @brief This API gets the value for given handle is system or not
2022 * @par This API is for package-manager client application
2023 * @par Sync (or) Async : Synchronous API
2025 * @param[in] handle pointer to package info handle
2026 * @param[out] system pointer to hold system is or not
2027 * @return 0 if success, error code(<0) if fail
2028 * @retval PMINFO_R_OK success
2029 * @retval PMINFO_R_EINVAL invalid argument
2030 * @retval PMINFO_R_ERROR internal error
2031 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2032 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2033 * @see pkgmgrinfo_pkginfo_get_pkgid()
2034 * @see pkgmgrinfo_pkginfo_is_readonly()
2036 static int get_pkg_system(const char *pkgid)
2039 bool system = false;
2040 pkgmgrinfo_pkginfo_h handle = NULL;
2041 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2042 if (ret != PMINFO_R_OK)
2044 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
2045 if (ret != PMINFO_R_OK) {
2046 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2049 printf("pkg system: %d\n", system);
2050 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2055 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
2058 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
2059 * @brief This API gets the package 'readonly' value from the package ID
2061 * @par This API is for package-manager client application
2062 * @par Sync (or) Async : Synchronous API
2064 * @param[in] handle pointer to package info handle
2065 * @param[out] readonly pointer to hold package readonly value
2066 * @return 0 if success, error code(<0) if fail
2067 * @retval PMINFO_R_OK success
2068 * @retval PMINFO_R_EINVAL invalid argument
2069 * @retval PMINFO_R_ERROR internal error
2070 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2071 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2072 * @see pkgmgrinfo_pkginfo_get_pkgid()
2073 * @see pkgmgrinfo_pkginfo_is_removable()
2075 static int get_pkg_readonly(const char *pkgid)
2079 pkgmgrinfo_pkginfo_h handle;
2080 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2081 if (ret != PMINFO_R_OK)
2083 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2084 if (ret != PMINFO_R_OK) {
2085 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2088 printf("pkg readonly: %d\n", readonly);
2089 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2094 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2098 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2099 * @brief This API gets the package 'update' value from the package ID
2101 * @par This API is for package-manager client application
2102 * @par Sync (or) Async : Synchronous API
2104 * @param[in] handle pointer to package info handle
2105 * @param[out] update pointer to hold package update value
2106 * @return 0 if success, error code(<0) if fail
2107 * @retval PMINFO_R_OK success
2108 * @retval PMINFO_R_EINVAL invalid argument
2109 * @retval PMINFO_R_ERROR internal error
2110 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2111 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2112 * @see pkgmgrinfo_pkginfo_get_pkgid()
2114 static int get_pkg_update(const char *pkgid)
2118 pkgmgrinfo_pkginfo_h handle;
2119 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2120 if (ret != PMINFO_R_OK)
2122 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2123 if (ret != PMINFO_R_OK) {
2124 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2127 printf("pkg update: %d\n", update);
2128 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2133 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2136 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2137 * @brief This API gets the package 'support_disable' value from the package ID
2139 * @par This API is for package-manager client application
2140 * @par Sync (or) Async : Synchronous API
2142 * @param[in] handle pointer to package info handle
2143 * @param[out] support_disable pointer to hold package support_disable value
2144 * @return 0 if success, error code(<0) if fail
2145 * @retval PMINFO_R_OK success
2146 * @retval PMINFO_R_EINVAL invalid argument
2147 * @retval PMINFO_R_ERROR internal error
2148 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2149 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2150 * @see pkgmgrinfo_pkginfo_get_pkgid()
2152 static int get_pkg_support_disable(const char *pkgid)
2155 bool support_disable;
2156 pkgmgrinfo_pkginfo_h handle = NULL;
2157 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2158 if (ret != PMINFO_R_OK)
2160 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2161 if (ret != PMINFO_R_OK) {
2162 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2165 printf("pkg support_disable: %d\n", support_disable);
2166 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2171 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2174 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2175 * @brief This API gets whether the given package is global package or user package
2177 * @par This API is for package-manager client application
2178 * @par Sync (or) Async : Synchronous API
2180 * @param[in] handle pointer to package info handle
2181 * @param[in] global pointer to hold package global value
2182 * @return 0 if success, error code(<0) if fail
2183 * @retval PMINFO_R_OK success
2184 * @retval PMINFO_R_EINVAL invalid argument
2185 * @retval PMINFO_R_ERROR internal error
2186 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2187 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2188 * @see pkgmgrinfo_pkginfo_get_pkgid()
2189 static int get_pkg_support_disable(const char *pkgid)
2193 pkgmgrinfo_pkginfo_h handle = NULL;
2194 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2195 if (ret != PMINFO_R_OK)
2197 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2198 if (ret != PMINFO_R_OK) {
2199 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2202 printf("pkg is_global: %d\n", global);
2203 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2208 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2211 * @fn int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib)
2212 * @brief This API gets whether the given package is lib resource package or not
2214 * @par This API is for package-manager client application
2215 * @par Sync (or) Async : Synchronous API
2217 * @param[in] handle pointer to package info handle
2218 * @param[in] global pointer to hold package global value
2219 * @return 0 if success, error code(<0) if fail
2220 * @retval PMINFO_R_OK success
2221 * @retval PMINFO_R_EINVAL invalid argument
2222 * @retval PMINFO_R_ERROR internal error
2223 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2224 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2225 * @see pkgmgrinfo_pkginfo_get_pkgid()
2226 static int get_pkg_is_lib(const char *pkgid)
2230 pkgmgrinfo_pkginfo_h handle = NULL;
2231 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2232 if (ret != PMINFO_R_OK)
2234 ret = pkgmgrinfo_pkginfo_is_lib(handle, &lib);
2235 if (ret != PMINFO_R_OK) {
2236 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2239 printf("pkg lib: %d\n", lib);
2240 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2245 int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib);
2248 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2249 * @brief This API gets the package 'accessible' value from the package ID
2251 * @par This API is for package-manager client application
2252 * @par Sync (or) Async : Synchronous API
2254 * @param[in] handle pointer to package info handle
2255 * @param[out] accessible pointer to hold package accessible value
2256 * @return 0 if success, error code(<0) if fail
2257 * @retval PMINFO_R_OK success
2258 * @retval PMINFO_R_EINVAL invalid argument
2259 * @retval PMINFO_R_ERROR internal error
2260 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2261 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2262 * @see pkgmgrinfo_pkginfo_get_pkgid()
2263 * @see pkgmgrinfo_pkginfo_is_readonly()
2265 static int get_pkg_accessible(const char *pkgid)
2269 pkgmgrinfo_pkginfo_h handle;
2270 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2271 if (ret != PMINFO_R_OK)
2273 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2274 if (ret != PMINFO_R_OK) {
2275 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2278 printf("pkg accessible: %d\n", accessible);
2279 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2284 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2287 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2288 * @brief This API destroys the package information handle freeing up all the resources
2290 * @par This API is for package-manager client application
2291 * @par Sync (or) Async : Synchronous API
2293 * @param[in] handle pointer to the package info handle
2294 * @return 0 if success, error code(<0) if fail
2295 * @retval PMINFO_R_OK success
2296 * @retval PMINFO_R_EINVAL invalid argument
2297 * @retval PMINFO_R_ERROR internal error
2298 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2300 * @see pkgmgrinfo_pkginfo_get_pkgid()
2301 * @see pkgmgrinfo_pkginfo_is_removable()
2303 static int get_pkg_type(const char *pkgid)
2307 pkgmgrinfo_pkginfo_h handle;
2308 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2309 if (ret != PMINFO_R_OK)
2311 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2312 if (ret != PMINFO_R_OK) {
2313 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2316 printf("pkgtype: %s\n", type);
2317 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2322 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2325 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2326 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2327 The query will search the entire package information collected from the manifest file of all the installed packages
2329 * @par This API is for package-manager client application
2330 * @par Sync (or) Async : Synchronous API
2332 * @param[out] handle pointer to the package info filter handle.
2333 * @return 0 if success, error code(<0) if fail
2334 * @retval PMINFO_R_OK success
2335 * @retval PMINFO_R_EINVAL invalid argument
2336 * @retval PMINFO_R_ERROR internal error
2338 * @post pkgmgrinfo_pkginfo_filter_destroy()
2339 * @see pkgmgrinfo_pkginfo_filter_count()
2340 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2342 static int get_tpk_pkg_count()
2346 pkgmgrinfo_pkginfo_filter_h handle;
2347 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2348 if (ret != PMINFO_R_OK)
2350 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2351 if (ret != PMINFO_R_OK) {
2352 pkgmgrinfo_pkginfo_filter_destroy(handle);
2355 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2356 if (ret != PMINFO_R_OK) {
2357 pkgmgrinfo_pkginfo_filter_destroy(handle);
2360 printf("No of tpk pkgs: %d\n", count);
2361 pkgmgrinfo_pkginfo_filter_destroy(handle);
2366 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2369 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2370 * @brief This API destroys the package information filter handle freeing up all the resources
2372 * @par This API is for package-manager client application
2373 * @par Sync (or) Async : Synchronous API
2375 * @param[in] handle pointer to the package info filter handle.
2376 * @return 0 if success, error code(<0) if fail
2377 * @retval PMINFO_R_OK success
2378 * @retval PMINFO_R_EINVAL invalid argument
2379 * @retval PMINFO_R_ERROR internal error
2380 * @pre pkgmgrinfo_pkginfo_filter_create()
2382 * @see pkgmgrinfo_pkginfo_filter_count()
2383 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2385 static int get_tpk_pkg_count()
2389 pkgmgrinfo_pkginfo_filter_h handle;
2390 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2391 if (ret != PMINFO_R_OK)
2393 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2394 if (ret != PMINFO_R_OK) {
2395 pkgmgrinfo_pkginfo_filter_destroy(handle);
2398 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2399 if (ret != PMINFO_R_OK) {
2400 pkgmgrinfo_pkginfo_filter_destroy(handle);
2403 printf("No of tpk pkgs: %d\n", count);
2404 pkgmgrinfo_pkginfo_filter_destroy(handle);
2409 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2412 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2413 * @brief This API adds a boolean filter property to the filter handle
2415 * @par This API is for package-manager client application
2416 * @par Sync (or) Async : Synchronous API
2418 * @param[in] handle pointer to the package info filter handle.
2419 * @param[in] property boolean property name.
2420 * @param[in] value value corresponding to the property.
2421 * @return 0 if success, error code(<0) if fail
2422 * @retval PMINFO_R_OK success
2423 * @retval PMINFO_R_EINVAL invalid argument
2424 * @retval PMINFO_R_ERROR internal error
2425 * @pre pkgmgrinfo_pkginfo_filter_create()
2426 * @post pkgmgrinfo_pkginfo_filter_destroy()
2427 * @see pkgmgrinfo_pkginfo_filter_count()
2428 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2430 static int get_preload_pkg_count()
2434 pkgmgrinfo_pkginfo_filter_h handle;
2435 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2436 if (ret != PMINFO_R_OK)
2438 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2439 if (ret != PMINFO_R_OK) {
2440 pkgmgrinfo_pkginfo_filter_destroy(handle);
2443 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2444 if (ret != PMINFO_R_OK) {
2445 pkgmgrinfo_pkginfo_filter_destroy(handle);
2448 printf("No of preload pkgs: %d\n", count);
2449 pkgmgrinfo_pkginfo_filter_destroy(handle);
2454 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2455 const char *property, const bool value);
2458 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2459 * @brief This API adds an integer filter property to the filter handle
2461 * @par This API is for package-manager client application
2462 * @par Sync (or) Async : Synchronous API
2464 * @param[in] handle pointer to the package info filter handle.
2465 * @param[in] property integer property name.
2466 * @param[in] value value corresponding to the property.
2467 * @return 0 if success, error code(<0) if fail
2468 * @retval PMINFO_R_OK success
2469 * @retval PMINFO_R_EINVAL invalid argument
2470 * @retval PMINFO_R_ERROR internal error
2471 * @pre pkgmgrinfo_pkginfo_filter_create()
2472 * @post pkgmgrinfo_pkginfo_filter_destroy()
2473 * @see pkgmgrinfo_pkginfo_filter_count()
2474 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2476 static int get_pkg_count()
2480 pkgmgrinfo_pkginfo_filter_h handle;
2481 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2482 if (ret != PMINFO_R_OK)
2484 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2485 if (ret != PMINFO_R_OK) {
2486 pkgmgrinfo_pkginfo_filter_destroy(handle);
2489 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2490 if (ret != PMINFO_R_OK) {
2491 pkgmgrinfo_pkginfo_filter_destroy(handle);
2494 printf("No of preload pkgs: %d\n", count);
2495 pkgmgrinfo_pkginfo_filter_destroy(handle);
2500 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2501 const char *property, const int value);
2504 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2505 * @brief This API adds a string filter property to the filter handle
2507 * @par This API is for package-manager client application
2508 * @par Sync (or) Async : Synchronous API
2510 * @param[in] handle pointer to the package info filter handle.
2511 * @param[in] property string property name.
2512 * @param[in] value value corresponding to the property.
2513 * @return 0 if success, error code(<0) if fail
2514 * @retval PMINFO_R_OK success
2515 * @retval PMINFO_R_EINVAL invalid argument
2516 * @retval PMINFO_R_ERROR internal error
2517 * @pre pkgmgrinfo_pkginfo_filter_create()
2518 * @post pkgmgrinfo_pkginfo_filter_destroy()
2519 * @see pkgmgrinfo_pkginfo_filter_count()
2520 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2522 static int get_tpk_pkg_count()
2526 pkgmgrinfo_pkginfo_filter_h handle;
2527 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2528 if (ret != PMINFO_R_OK)
2530 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2531 if (ret != PMINFO_R_OK) {
2532 pkgmgrinfo_pkginfo_filter_destroy(handle);
2535 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2536 if (ret != PMINFO_R_OK) {
2537 pkgmgrinfo_pkginfo_filter_destroy(handle);
2540 printf("No of tpk pkgs: %d\n", count);
2541 pkgmgrinfo_pkginfo_filter_destroy(handle);
2546 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2547 const char *property, const char *value);
2550 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2551 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2553 * @par This API is for package-manager client application
2554 * @par Sync (or) Async : Synchronous API
2556 * @param[in] handle pointer to the package info filter handle.
2557 * @param[in] pkg_cb callback function.
2558 * @param[in] user_data user data to be passed to the callback function
2559 * @return 0 if success, error code(<0) if fail
2560 * @retval PMINFO_R_OK success
2561 * @retval PMINFO_R_EINVAL invalid argument
2562 * @retval PMINFO_R_ERROR internal error
2563 * @pre pkgmgrinfo_pkginfo_filter_create()
2564 * @post pkgmgrinfo_pkginfo_filter_destroy()
2565 * @see pkgmgrinfo_pkginfo_filter_count()
2567 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2570 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2571 printf("pkg id : %s\n", pkgid);
2575 static int get_tpk_pkg_list()
2578 pkgmgrinfo_pkginfo_filter_h handle;
2579 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2580 if (ret != PMINFO_R_OK)
2582 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2583 if (ret != PMINFO_R_OK) {
2584 pkgmgrinfo_pkginfo_filter_destroy(handle);
2587 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2588 if (ret != PMINFO_R_OK) {
2589 pkgmgrinfo_pkginfo_filter_destroy(handle);
2592 pkgmgrinfo_pkginfo_filter_destroy(handle);
2597 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2598 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2599 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2600 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2603 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2604 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2605 * @brief This API counts the package that satisfy the filter conditions
2607 * @par This API is for package-manager client application
2608 * @par Sync (or) Async : Synchronous API
2610 * @param[in] handle pointer to the package info filter handle.
2611 * @param[in] count pointer to store the count value.
2612 * @param[in] uid the addressee user id of the instruction
2613 * @return 0 if success, error code(<0) if fail
2614 * @retval PMINFO_R_OK success
2615 * @retval PMINFO_R_EINVAL invalid argument
2616 * @retval PMINFO_R_ERROR internal error
2617 * @pre pkgmgrinfo_pkginfo_filter_create()
2618 * @post pkgmgrinfo_pkginfo_filter_destroy()
2619 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2621 static int get_tpk_pkg_count()
2625 pkgmgrinfo_pkginfo_filter_h handle;
2626 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2627 if (ret != PMINFO_R_OK)
2629 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2630 if (ret != PMINFO_R_OK) {
2631 pkgmgrinfo_pkginfo_filter_destroy(handle);
2634 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2635 if (ret != PMINFO_R_OK) {
2636 pkgmgrinfo_pkginfo_filter_destroy(handle);
2639 printf("No of tpk pkgs: %d\n", count);
2640 pkgmgrinfo_pkginfo_filter_destroy(handle);
2645 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2646 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2649 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2650 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2651 * @brief This API gets the list of privilege for a particular package
2653 * @par This API is for package-manager client application
2654 * @par Sync (or) Async : Synchronous API
2655 * @param[in] handle pointer to the package info handle.
2656 * @param[in] privilege_func callback function for list
2657 * @param[in] user_data user data to be passed to callback function
2658 * @return 0 if success, error code(<0) if fail
2659 * @retval PMINFO_R_OK success
2660 * @retval PMINFO_R_EINVAL invalid argument
2661 * @retval PMINFO_R_ERROR internal error
2662 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2663 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2665 int privilege_func(const char *name, void *user_data)
2667 if (strcmp(name, (char *)user_data) == 0)
2673 static int list_privilege(const char *package, char *privilege)
2676 pkgmgrinfo_pkginfo_h handle;
2677 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2678 if (ret != PMINFO_R_OK)
2680 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2681 if (ret != PMINFO_R_OK) {
2682 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2685 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2690 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2691 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2694 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2695 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2696 * @brief This API gets the list of appdefined privilege for a particular package
2698 * @par This API is for package-manager client application
2699 * @par Sync (or) Async : Synchronous API
2700 * @param[in] handle pointer to the package info handle.
2701 * @param[in] privilege_func callback function for list
2702 * @param[in] user_data user data to be passed to callback function
2703 * @return 0 if success, error code(<0) if fail
2704 * @retval PMINFO_R_OK success
2705 * @retval PMINFO_R_EINVAL invalid argument
2706 * @retval PMINFO_R_ERROR internal error
2707 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2708 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2710 int privilege_func(const char *name, const char *license_path, void *user_data)
2712 printf("appdefined privilege : %s", name);
2714 printf("licensed privilege, lecense path : %s", license_path);
2718 static int list_appdefined_privilege(const char *package)
2721 pkgmgrinfo_pkginfo_h handle;
2722 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2723 if (ret != PMINFO_R_OK)
2725 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2726 if (ret != PMINFO_R_OK) {
2727 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2730 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2735 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2736 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2739 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2740 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2741 * @brief This API gets the list of plugin execution info for a particular package
2743 * @par This API is for package-manager client application
2744 * @par Sync (or) Async : Synchronous API
2745 * @param[in] handle pointer to the package info handle.
2746 * @param[in] plugin_func callback function for list
2747 * @param[in] user_data user data to be passed to callback function
2748 * @return 0 if success, error code(<0) if fail
2749 * @retval PMINFO_R_OK success
2750 * @retval PMINFO_R_EINVAL invalid argument
2751 * @retval PMINFO_R_ERROR internal error
2752 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2753 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2755 int plugin_func(const char *pkgid, const char *appid,
2756 const char *plugin_type, const char *plugin_name,
2759 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2764 static int list_plugin(const char *package)
2767 pkgmgrinfo_pkginfo_h handle;
2768 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2769 if (ret != PMINFO_R_OK)
2771 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2772 if (ret != PMINFO_R_OK) {
2773 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2776 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2781 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2782 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2785 * @fn int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2786 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2787 * @brief This API gets the list of metadata for a particular package
2789 * @par This API is for package-manager client application
2790 * @par Sync (or) Async : Synchronous API
2791 * @param[in] handle pointer to the package info handle.
2792 * @param[in] metadata_func callback function for list
2793 * @param[in] user_data user data to be passed to callback function
2794 * @return 0 if success, error code(<0) if fail
2795 * @retval PMINFO_R_OK success
2796 * @retval PMINFO_R_EINVAL invalid argument
2797 * @retval PMINFO_R_ERROR internal error
2798 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2799 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2801 int metadata_func(const char *key, const char *value, void *user_data)
2803 if (strcmp(key, (char *)user_data) == 0) {
2804 printf("Value is %s\n", value);
2811 static int list_metadata(const char *pkgid, char *key)
2814 pkgmgrinfo_pkginfo_h handle;
2815 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2816 if (ret != PMINFO_R_OK)
2818 ret = pkgmgrinfo_pkginfo_foreach_metadata(handle, metadata_func, (void *)key);
2819 if (ret != PMINFO_R_OK) {
2820 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2823 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2828 int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2829 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2832 * @fn int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle)
2833 * @brief This API creates the application's metadata information filter handle from db.
2835 * @par This API is for package-manager client application
2836 * @par Sync (or) Async : Synchronous API
2838 * @param[out] handle pointer to the package metadata info filter handle.
2839 * @return 0 if success, error code(<0) if fail
2840 * @retval PMINFO_R_OK success
2841 * @retval PMINFO_R_EINVAL invalid argument
2842 * @retval PMINFO_R_ERROR internal error
2844 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
2845 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2847 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2850 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2851 printf("pkgid : %s\n", pkgid);
2855 static int get_pkg_list(const char *mkey, const char *mvalue)
2858 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2859 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2860 if (ret != PMINFO_R_OK)
2862 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2863 if (ret != PMINFO_R_OK) {
2864 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2867 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2868 if (ret != PMINFO_R_OK) {
2869 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2872 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2877 int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle);
2880 * @fn int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle)
2881 * @brief This API destroys the package's metadata information filter handle.
2883 * @par This API is for package-manager client application
2884 * @par Sync (or) Async : Synchronous API
2886 * @param[in] handle pointer to the package metadata info filter handle.
2887 * @return 0 if success, error code(<0) if fail
2888 * @retval PMINFO_R_OK success
2889 * @retval PMINFO_R_EINVAL invalid argument
2890 * @retval PMINFO_R_ERROR internal error
2891 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2893 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2895 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2898 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2899 printf("pkgid : %s\n", pkgid);
2903 static int get_pkg_list(const char *mkey, const char *mvalue)
2906 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2907 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2908 if (ret != PMINFO_R_OK)
2910 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2911 if (ret != PMINFO_R_OK) {
2912 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2915 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2916 if (ret != PMINFO_R_OK) {
2917 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2920 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2925 int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle);
2928 * @fn int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle, const char *key, const char *value)
2929 * @brief This API adds filter condition for the query API. The query will search the entire package metadata information collected from
2930 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
2932 * @par This API is for package-manager client application
2933 * @par Sync (or) Async : Synchronous API
2935 * @param[in] handle pointer to the package metadata info filter handle.
2936 * @param[in] key pointer to metadata key
2937 * @param[in] value pointer to metadata value
2938 * @return 0 if success, error code(<0) if fail
2939 * @retval PMINFO_R_OK success
2940 * @retval PMINFO_R_EINVAL invalid argument
2941 * @retval PMINFO_R_ERROR internal error
2942 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2943 * @post pkgmgrinfo_pkginfo_metadata_filter_foreach(), pkgmgrinfo_pkginfo_metadata_filter_destroy()
2944 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2946 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2949 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2950 printf("pkgid : %s\n", pkgid);
2954 static int get_pkg_list(const char *mkey, const char *mvalue)
2957 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2958 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2959 if (ret != PMINFO_R_OK)
2961 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2962 if (ret != PMINFO_R_OK) {
2963 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2966 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2967 if (ret != PMINFO_R_OK) {
2968 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2971 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2976 int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2977 const char *key, const char *value);
2980 * @fn int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2981 * @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)
2982 * @brief This API executes the filter query. The query will search the entire package metadata information collected from
2983 * the manifest file of all the installed packages. For each package returned by the query, the callback will be called. If callback returns
2984 * negative value, no more callbacks will be called and API will return.
2986 * @par This API is for package-manager client application
2987 * @par Sync (or) Async : Synchronous API
2989 * @param[in] handle pointer to the package metadata info filter handle.
2990 * @param[in] app_cb function pointer to callback
2991 * @param[in] user_data pointer to user data
2992 * @param[in] uid the addressee user id of the instruction
2993 * @return 0 if success, error code(<0) if fail
2994 * @retval PMINFO_R_OK success
2995 * @retval PMINFO_R_EINVAL invalid argument
2996 * @retval PMINFO_R_ERROR internal error
2997 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2998 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
3000 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
3003 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
3004 printf("pkgid : %s\n", pkgid);
3008 static int get_pkg_list(const char *mkey, const char *mvalue)
3011 pkgmgrinfo_pkginfo_metadata_filter_h handle;
3012 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
3013 if (ret != PMINFO_R_OK)
3015 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
3016 if (ret != PMINFO_R_OK) {
3017 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
3020 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
3021 if (ret != PMINFO_R_OK) {
3022 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
3025 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
3030 int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
3031 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
3032 int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
3033 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
3035 /* TODO: add doxygen comment here */
3036 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
3039 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
3040 * @brief This API copy the application information handle
3042 * @par This API is for package-manager client application
3043 * @par Sync (or) Async : Synchronous API
3045 * @param[in] handle pointer to the package info handle.
3046 * @param[out] handle pointer to the package info handle.
3047 * @return 0 if success, error code(<0) if fail
3048 * @retval PMINFO_R_OK success
3049 * @retval PMINFO_R_EINVAL invalid argument
3050 * @retval PMINFO_R_ERROR internal error
3052 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3054 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
3058 pkgmgrinfo_pkginfo_h clone;
3060 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
3061 if (ret != PMINFO_R_OK)
3065 printf("package: %s\n", clone->package);
3066 pkgmgrinfo_appinfo_destroy_appinfo(clone);
3071 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
3075 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3076 pkgmgrinfo_app_list_cb app_func, void *user_data)
3077 * @brief This API gets list of installed applications for a particular package
3079 * @par This API is for package-manager client application
3080 * @par Sync (or) Async : Synchronous API
3081 * @param[in] handle package info handle
3082 * @param[in] component application component
3083 * @param[in] app_func iteration function for list
3084 * @param[in] user_data user data to be passed to callback function
3085 * @return 0 if success, error code(<0) if fail
3086 * @retval PMINFO_R_OK success
3087 * @retval PMINFO_R_EINVAL invalid argument
3088 * @retval PMINFO_R_ERROR internal error
3089 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
3090 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
3092 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
3095 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3096 printf("appid : %s\n", appid);
3100 static int list_apps(const char *pkgid)
3103 pkgmgrinfo_pkginfo_h handle;
3104 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
3105 if (ret != PMINFO_R_OK)
3107 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
3108 if (ret != PMINFO_R_OK) {
3109 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3112 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3117 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3118 pkgmgrinfo_app_list_cb app_func, void *user_data);
3119 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3120 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
3123 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3124 * @brief This API gets list of installed applications from all packages.
3126 * @par This API is for package-manager client application
3127 * @par Sync (or) Async : Synchronous API
3128 * @param[in] app_func iteration function for list
3129 * @param[in] user_data user data to be passed to callback function
3130 * @return 0 if success, error code(<0) if fail
3131 * @retval PMINFO_R_OK success
3132 * @retval PMINFO_R_EINVAL invalid argument
3133 * @retval PMINFO_R_ERROR internal error
3137 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3139 char *pkgid1 = NULL;
3140 char *pkgid2 = NULL;
3141 pkgid1 = (char *)user_data;
3142 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
3143 if (strcmp(pkgid1, pkgid2) == 0) {
3150 static int list_apps()
3153 char *name = "helloworld";
3154 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
3155 if (ret != PMINFO_R_OK) {
3162 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3163 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
3166 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3167 * @brief This API creates the disabled application information handle from db
3169 * @par This API is for package-manager client application
3170 * @par Sync (or) Async : Synchronous API
3172 * @param[in] appid pointer to appid
3173 * @param[out] handle pointer to the application info handle.
3174 * @return 0 if success, error code(<0) if fail
3175 * @retval PMINFO_R_OK success
3176 * @retval PMINFO_R_EINVAL invalid argument
3177 * @retval PMINFO_R_ERROR internal error
3179 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3180 * @see pkgmgrinfo_appinfo_get_pkgid()
3181 * @see pkgmgrinfo_appinfo_is_multiple()
3183 static int get_disabled_app_type(const char *appid)
3187 pkgmgrinfo_appinfo_h handle;
3188 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
3189 if (ret != PMINFO_R_OK)
3191 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3192 if (ret != PMINFO_R_OK) {
3193 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3196 printf("apptype: %s\n", type);
3197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3202 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3203 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3206 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3207 * @brief This API creates the application information handle from db
3209 * @par This API is for package-manager client application
3210 * @par Sync (or) Async : Synchronous API
3212 * @param[in] appid pointer to appid
3213 * @param[out] handle pointer to the application info handle.
3214 * @return 0 if success, error code(<0) if fail
3215 * @retval PMINFO_R_OK success
3216 * @retval PMINFO_R_EINVAL invalid argument
3217 * @retval PMINFO_R_ERROR internal error
3219 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3220 * @see pkgmgrinfo_appinfo_get_pkgid()
3221 * @see pkgmgrinfo_appinfo_is_multiple()
3223 static int get_app_type(const char *appid)
3227 pkgmgrinfo_appinfo_h handle;
3228 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3229 if (ret != PMINFO_R_OK)
3231 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3232 if (ret != PMINFO_R_OK) {
3233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3236 printf("apptype: %s\n", type);
3237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3242 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3243 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3246 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3247 * @brief This API creates the application information handle from db regardless of its disable or storage status
3249 * @par This API is for package-manager client application
3250 * @par Sync (or) Async : Synchronous API
3252 * @param[in] appid pointer to appid
3253 * @param[out] handle pointer to the application info handle.
3254 * @return 0 if success, error code(<0) if fail
3255 * @retval PMINFO_R_OK success
3256 * @retval PMINFO_R_EINVAL invalid argument
3257 * @retval PMINFO_R_ERROR internal error
3259 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3260 * @see pkgmgrinfo_appinfo_get_pkgid()
3261 * @see pkgmgrinfo_appinfo_is_multiple()
3263 static int get_app_type(const char *appid)
3267 pkgmgrinfo_appinfo_h handle;
3268 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
3269 if (ret != PMINFO_R_OK)
3271 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3272 if (ret != PMINFO_R_OK) {
3273 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3276 printf("apptype: %s\n", type);
3277 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3282 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3283 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3286 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
3287 * @brief This API gets the application ID
3289 * @par This API is for package-manager client application
3290 * @par Sync (or) Async : Synchronous API
3292 * @param[in] handle pointer to the application info handle.
3293 * @param[out] appid pointer to hold appid
3294 * @return 0 if success, error code(<0) if fail
3295 * @retval PMINFO_R_OK success
3296 * @retval PMINFO_R_EINVAL invalid argument
3297 * @retval PMINFO_R_ERROR internal error
3298 * @pre pkgmgrinfo_appinfo_get_appinfo()
3299 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3300 * @see pkgmgrinfo_appinfo_get_pkgid()
3301 * @see pkgmgrinfo_appinfo_is_multiple()
3303 static int get_app_id(const char *appid)
3306 char *app_id = NULL;
3307 pkgmgrinfo_appinfo_h handle;
3308 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3309 if (ret != PMINFO_R_OK)
3311 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
3312 if (ret != PMINFO_R_OK) {
3313 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3316 printf("app id: %s\n", app_id);
3317 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3322 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
3325 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
3326 * @brief This API gets the package name of the application
3328 * @par This API is for package-manager client application
3329 * @par Sync (or) Async : Synchronous API
3331 * @param[in] handle pointer to the application info handle.
3332 * @param[out] pkg_name pointer to hold package name
3333 * @return 0 if success, error code(<0) if fail
3334 * @retval PMINFO_R_OK success
3335 * @retval PMINFO_R_EINVAL invalid argument
3336 * @retval PMINFO_R_ERROR internal error
3337 * @pre pkgmgrinfo_appinfo_get_appinfo()
3338 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3339 * @see pkgmgrinfo_appinfo_get_appid()
3340 * @see pkgmgrinfo_appinfo_is_multiple()
3342 static int get_app_pkgname(const char *appid)
3345 char *pkgname = NULL;
3346 pkgmgrinfo_appinfo_h handle;
3347 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3348 if (ret != PMINFO_R_OK)
3350 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
3351 if (ret != PMINFO_R_OK) {
3352 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3355 printf("pkg name: %s\n", pkgname);
3356 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3361 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
3364 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3365 * @brief This API gets the package id of the application
3367 * @par This API is for package-manager client application
3368 * @par Sync (or) Async : Synchronous API
3370 * @param[in] handle pointer to the application info handle.
3371 * @param[out] pkgid pointer to hold package id
3372 * @return 0 if success, error code(<0) if fail
3373 * @retval PMINFO_R_OK success
3374 * @retval PMINFO_R_EINVAL invalid argument
3375 * @retval PMINFO_R_ERROR internal error
3376 * @pre pkgmgrinfo_appinfo_get_appinfo()
3377 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3378 * @see pkgmgrinfo_appinfo_get_appid()
3379 * @see pkgmgrinfo_appinfo_is_multiple()
3381 static int get_app_pkgid(const char *appid)
3385 pkgmgrinfo_appinfo_h handle;
3386 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3387 if (ret != PMINFO_R_OK)
3389 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3390 if (ret != PMINFO_R_OK) {
3391 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3394 printf("pkg id: %s\n", pkgid);
3395 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3400 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3403 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3404 * @brief This API gets the package type of the application
3406 * @par This API is for package-manager client application
3407 * @par Sync (or) Async : Synchronous API
3409 * @param[in] handle pointer to the application info handle.
3410 * @param[out] pkgtype pointer to hold package type
3411 * @return 0 if success, error code(<0) if fail
3412 * @retval PMINFO_R_OK success
3413 * @retval PMINFO_R_EINVAL invalid argument
3414 * @retval PMINFO_R_ERROR internal error
3415 * @pre pkgmgrinfo_appinfo_get_appinfo()
3416 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3417 * @see pkgmgrinfo_appinfo_get_appid()
3418 * @see pkgmgrinfo_appinfo_is_multiple()
3420 static int get_app_pkgtype(const char *appid)
3423 char *pkgtype = NULL;
3424 pkgmgrinfo_appinfo_h handle = NULL;
3425 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3426 if (ret != PMINFO_R_OK)
3428 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3429 if (ret != PMINFO_R_OK) {
3430 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3433 printf("pkgtype: %s\n", pkgtype);
3434 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3439 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3442 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3443 * @brief This API gets the executable name of the application
3445 * @par This API is for package-manager client application
3446 * @par Sync (or) Async : Synchronous API
3448 * @param[in] handle pointer to the application info handle.
3449 * @param[out] exec pointer to hold app exec name
3450 * @return 0 if success, error code(<0) if fail
3451 * @retval PMINFO_R_OK success
3452 * @retval PMINFO_R_EINVAL invalid argument
3453 * @retval PMINFO_R_ERROR internal error
3454 * @pre pkgmgrinfo_appinfo_get_appinfo()
3455 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3456 * @see pkgmgrinfo_appinfo_get_appid()
3457 * @see pkgmgrinfo_appinfo_is_multiple()
3459 static int get_app_exec(const char *appid)
3463 pkgmgrinfo_appinfo_h handle;
3464 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3465 if (ret != PMINFO_R_OK)
3467 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3468 if (ret != PMINFO_R_OK) {
3469 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3472 printf("exec name: %s\n", exec);
3473 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3478 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3481 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3482 * @brief This API gets the icon name of the application
3484 * @par This API is for package-manager client application
3485 * @par Sync (or) Async : Synchronous API
3487 * @param[in] handle pointer to the application info handle.
3488 * @param[out] icon pointer to hold app icon name
3489 * @return 0 if success, error code(<0) if fail
3490 * @retval PMINFO_R_OK success
3491 * @retval PMINFO_R_EINVAL invalid argument
3492 * @retval PMINFO_R_ERROR internal error
3493 * @pre pkgmgrinfo_appinfo_get_appinfo()
3494 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3495 * @see pkgmgrinfo_appinfo_get_appid()
3496 * @see pkgmgrinfo_appinfo_is_multiple()
3498 static int get_app_icon(const char *appid)
3502 pkgmgrinfo_appinfo_h handle;
3503 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3504 if (ret != PMINFO_R_OK)
3506 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3507 if (ret != PMINFO_R_OK) {
3508 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3511 printf("icon name: %s\n", icon);
3512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3517 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3520 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3521 * @brief This API gets the label of the application
3523 * @par This API is for package-manager client application
3524 * @par Sync (or) Async : Synchronous API
3526 * @param[in] handle pointer to the application info handle.
3527 * @param[out] label pointer to hold app label
3528 * @return 0 if success, error code(<0) if fail
3529 * @retval PMINFO_R_OK success
3530 * @retval PMINFO_R_EINVAL invalid argument
3531 * @retval PMINFO_R_ERROR internal error
3532 * @pre pkgmgrinfo_appinfo_get_appinfo()
3533 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3534 * @see pkgmgrinfo_appinfo_get_appid()
3535 * @see pkgmgrinfo_appinfo_is_multiple()
3537 static int get_app_label(const char *appid)
3541 pkgmgrinfo_appinfo_h handle;
3542 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3543 if (ret != PMINFO_R_OK)
3545 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3546 if (ret != PMINFO_R_OK) {
3547 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3550 printf("label : %s\n", label);
3551 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3556 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3559 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3560 * @brief This API gets exactly matched label by given appid and locale
3562 * @par This API is for package-manager client application
3563 * @par Sync (or) Async : Synchronous API
3565 * @param[in] appid pointer to appid
3566 * @param[in] locale pointer to locale
3567 * @param[out] label pointer to hold app label
3568 * @return 0 if success, error code(<0) if fail
3569 * @retval PMINFO_R_OK success
3570 * @retval PMINFO_R_EINVAL invalid argument
3571 * @retval PMINFO_R_ERROR internal error
3573 static int get_localed_label(const char *appid, const char *locale)
3578 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3579 if (ret != PMINFO_R_OK)
3582 printf("localed label: %s\n", label);
3590 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3591 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3594 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3595 * @brief This API gets metadata value by given metadata key
3597 * @par This API is for package-manager client application
3598 * @par Sync (or) Async : Synchronous API
3600 * @param[in] handle pointer to the application info handle
3601 * @param[in] metadata_key metadata key
3602 * @param[out] metadata_value pointer to hold metadata value
3603 * @return 0 if success, error code(<0) if fail
3604 * @retval PMINFO_R_OK success
3605 * @retval PMINFO_R_EINVAL invalid argument
3607 static int get_metadata_value(const char *appid, const char *metadata_key)
3610 pkgmgrinfo_appinfo_h handle = NULL;
3611 char *metadata_value = NULL;
3613 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3614 if (ret != PMINFO_R_OK)
3617 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3618 if (ret != PMINFO_R_OK) {
3619 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3623 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3628 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3631 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3632 * @brief This API gets the component of the application
3634 * @par This API is for package-manager client application
3635 * @par Sync (or) Async : Synchronous API
3637 * @param[in] handle pointer to the application info handle.
3638 * @param[out] component pointer to hold app component
3639 * @return 0 if success, error code(<0) if fail
3640 * @retval PMINFO_R_OK success
3641 * @retval PMINFO_R_EINVAL invalid argument
3642 * @retval PMINFO_R_ERROR internal error
3643 * @pre pkgmgrinfo_appinfo_get_appinfo()
3644 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3645 * @see pkgmgrinfo_appinfo_get_appid()
3646 * @see pkgmgrinfo_appinfo_is_multiple()
3648 static int get_app_component(const char *appid)
3651 pkgmgrinfo_app_component component;
3652 pkgmgrinfo_appinfo_h handle;
3653 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3654 if (ret != PMINFO_R_OK)
3656 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3657 if (ret != PMINFO_R_OK) {
3658 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3661 printf("component : %s\n", component);
3662 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3667 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3670 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3671 * @brief This API gets the apptype of the application
3673 * @par This API is for package-manager client application
3674 * @par Sync (or) Async : Synchronous API
3676 * @param[in] handle pointer to the application info handle.
3677 * @param[out] app_type pointer to hold apptype
3678 * @return 0 if success, error code(<0) if fail
3679 * @retval PMINFO_R_OK success
3680 * @retval PMINFO_R_EINVAL invalid argument
3681 * @retval PMINFO_R_ERROR internal error
3682 * @pre pkgmgrinfo_appinfo_get_appinfo()
3683 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3684 * @see pkgmgrinfo_appinfo_get_appid()
3685 * @see pkgmgrinfo_appinfo_is_multiple()
3687 static int get_app_type(const char *appid)
3690 char *apptype = NULL;
3691 pkgmgrinfo_appinfo_h handle;
3692 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3693 if (ret != PMINFO_R_OK)
3695 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3696 if (ret != PMINFO_R_OK) {
3697 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3700 printf("apptype : %s\n", apptype);
3701 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3706 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3709 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3710 * @brief This API gets the notification icon of the application
3712 * @par This API is for package-manager client application
3713 * @par Sync (or) Async : Synchronous API
3715 * @param[in] handle pointer to the application info handle.
3716 * @param[out] path pointer to hold notification icon
3717 * @return 0 if success, error code(<0) if fail
3718 * @retval PMINFO_R_OK success
3719 * @retval PMINFO_R_EINVAL invalid argument
3720 * @retval PMINFO_R_ERROR internal error
3721 * @pre pkgmgrinfo_appinfo_get_appinfo()
3722 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3723 * @see pkgmgrinfo_appinfo_get_appid()
3724 * @see pkgmgrinfo_appinfo_is_multiple()
3726 static int get_app_notification_icon(const char *appid)
3729 char *notification_icon = NULL;
3730 pkgmgrinfo_appinfo_h handle;
3731 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3732 if (ret != PMINFO_R_OK)
3734 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3735 if (ret != PMINFO_R_OK) {
3736 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3739 printf("notification icon : %s\n", notification_icon);
3740 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3745 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3748 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3749 * @brief This API gets the type of recent image on app-tray
3751 * @par This API is for package-manager client application
3752 * @par Sync (or) Async : Synchronous API
3754 * @param[in] handle pointer to the application info handle.
3755 * @param[out] type pointer to hold image type
3756 * @return 0 if success, error code(<0) if fail
3757 * @retval PMINFO_R_OK success
3758 * @retval PMINFO_R_EINVAL invalid argument
3759 * @retval PMINFO_R_ERROR internal error
3760 * @pre pkgmgrinfo_appinfo_get_appinfo()
3761 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3762 * @see pkgmgrinfo_appinfo_get_appid()
3763 * @see pkgmgrinfo_appinfo_is_multiple()
3765 static int get_app_recent_image_type(const char *appid)
3768 pkgmgrinfo_app_recentimage type;
3769 pkgmgrinfo_appinfo_h handle;
3770 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3771 if (ret != PMINFO_R_OK)
3773 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3774 if (ret != PMINFO_R_OK) {
3775 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3778 printf("recent image type: %d\n", type);
3779 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3784 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3788 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3789 * @brief This API gets the preview image of application
3791 * @par Sync (or) Async : Synchronous API
3793 * @param[in] handle pointer to the application info handle.
3794 * @param[out] preview_img pointer to hold preview image path
3795 * @return 0 if success, error code(<0) if fail
3796 * @retval PMINFO_R_OK success
3797 * @retval PMINFO_R_EINVAL invalid argument
3798 * @retval PMINFO_R_ERROR internal error
3799 * @pre pkgmgrinfo_appinfo_get_appinfo()
3800 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3801 * @see pkgmgrinfo_appinfo_get_appid()
3803 static int get_app_previewimage(const char *appid)
3806 char *preview = NULL;
3807 pkgmgrinfo_appinfo_h handle = NULL;
3808 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3809 if (ret != PMINFO_R_OK)
3811 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3812 if (ret != PMINFO_R_OK) {
3813 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3816 printf("preview image path : %s\n", preview);
3817 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3822 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3826 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3827 * @brief This API gets the package permission type of the application
3829 * @par This API is for package-manager client application
3830 * @par Sync (or) Async : Synchronous API
3832 * @param[in] handle pointer to the application info handle.
3833 * @param[out] permission pointer to hold package permission
3834 * @return 0 if success, error code(<0) if fail
3835 * @retval PMINFO_R_OK success
3836 * @retval PMINFO_R_EINVAL invalid argument
3837 * @retval PMINFO_R_ERROR internal error
3838 * @pre pkgmgrinfo_appinfo_get_appinfo()
3839 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3840 * @see pkgmgrinfo_appinfo_get_appid()
3842 static int get_app_permission(const char *appid)
3845 pkgmgrinfo_permission_type permission = 0;
3846 pkgmgrinfo_appinfo_h handle;
3848 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3849 if (ret != PMINFO_R_OK)
3851 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3852 if (ret != PMINFO_R_OK) {
3853 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3856 printf("permission type: %d\n", permission);
3857 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3862 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3865 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3866 * @brief This API gets the component_type
3868 * @par This API is for package-manager client application
3869 * @par Sync (or) Async : Synchronous API
3871 * @param[in] handle pointer to the application info handle.
3872 * @param[out] component_type pointer to hold component_type
3873 * @return 0 if success, error code(<0) if fail
3874 * @retval PMINFO_R_OK success
3875 * @retval PMINFO_R_EINVAL invalid argument
3876 * @retval PMINFO_R_ERROR internal error
3877 * @pre pkgmgrinfo_appinfo_get_appinfo()
3878 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3879 * @see pkgmgrinfo_appinfo_get_pkgid()
3880 * @see pkgmgrinfo_appinfo_is_multiple()
3882 static int get_component_type(const char *appid)
3885 char *component_type = NULL;
3886 pkgmgrinfo_appinfo_h handle;
3887 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3888 if (ret != PMINFO_R_OK)
3890 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3891 if (ret != PMINFO_R_OK) {
3892 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3895 printf("component_type: %s\n", component_type);
3896 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3901 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3904 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3905 * @brief This API gets the application 'hwacceleration' value from the app ID
3907 * @par This API is for package-manager client application
3908 * @par Sync (or) Async : Synchronous API
3910 * @param[in] handle pointer to application info handle
3911 * @param[out] hwacceleration pointer to hold package hwacceleration value
3912 * @return 0 if success, error code(<0) if fail
3913 * @retval PMINFO_R_OK success
3914 * @retval PMINFO_R_EINVAL invalid argument
3915 * @retval PMINFO_R_ERROR internal error
3916 * @pre pkgmgrinfo_appinfo_get_appinfo()
3917 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3918 * @see pkgmgrinfo_appinfo_get_appid()
3919 * @see pkgmgrinfo_appinfo_is_multiple()
3921 static int get_app_hwacceleration(const char *appid)
3924 pkgmgrinfo_app_hwacceleration hwacceleration;
3925 pkgmgrinfo_appinfo_h handle;
3926 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3927 if (ret != PMINFO_R_OK)
3929 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3930 if (ret != PMINFO_R_OK) {
3931 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3934 printf("app hwacceleration: %d\n", hwacceleration);
3935 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3940 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3943 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3944 * @brief This API gets the application 'screenreader' value from the app ID
3946 * @par This API is for package-manager client application
3947 * @par Sync (or) Async : Synchronous API
3949 * @param[in] handle pointer to application info handle
3950 * @param[out] screenreader pointer to hold package accessibility value
3951 * @return 0 if success, error code(<0) if fail
3952 * @retval PMINFO_R_OK success
3953 * @retval PMINFO_R_EINVAL invalid argument
3954 * @retval PMINFO_R_ERROR internal error
3955 * @pre pkgmgrinfo_appinfo_get_appinfo()
3956 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3957 * @see pkgmgrinfo_appinfo_get_appid()
3958 * @see pkgmgrinfo_appinfo_is_multiple()
3960 static int get_app_screenreader(const char *appid)
3963 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3964 pkgmgrinfo_appinfo_h handle = NULL;
3965 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3966 if (ret != PMINFO_R_OK)
3968 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3969 if (ret != PMINFO_R_OK) {
3970 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3973 printf("app screenreader: %d\n", screenreader);
3974 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3979 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3982 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3983 * @brief This API gets the application's landscape & portrait effect images
3985 * @par This API is for package-manager client application
3986 * @par Sync (or) Async : Synchronous API
3988 * @param[in] handle pointer to application info handle
3989 * @param[out] portrait_img contains portrait mode effect image
3990 * @param[out] landscape_img contains landscape mode effect image
3991 * @return 0 if success, error code(<0) if fail
3992 * @retval PMINFO_R_OK success
3993 * @retval PMINFO_R_EINVAL invalid argument
3994 * @retval PMINFO_R_ERROR internal error
3995 * @pre pkgmgrinfo_appinfo_get_appinfo()
3996 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3997 * @see pkgmgrinfo_appinfo_get_appid()
3998 * @see pkgmgrinfo_appinfo_is_nodisplay()
4000 static int get_app_effectimages(const char *appid)
4003 char *portraitimg = NULL;
4004 char *landscapeimg = NULL;
4005 pkgmgrinfo_appinfo_h handle;
4006 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4007 if (ret != PMINFO_R_OK)
4009 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
4010 if (ret != PMINFO_R_OK) {
4011 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4014 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
4015 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4020 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
4023 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
4024 * @brief This API gets the application's effect image type
4026 * @par This API is for package-manager client application
4027 * @par Sync (or) Async : Synchronous API
4029 * @param[in] handle pointer to application info handle
4030 * @param[out] effectimg_type contains effect image type
4031 * @return 0 if success, error code(<0) if fail
4032 * @retval PMINFO_R_OK success
4033 * @retval PMINFO_R_EINVAL invalid argument
4034 * @retval PMINFO_R_ERROR internal error
4035 * @pre pkgmgrinfo_appinfo_get_appinfo()
4036 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4037 * @see pkgmgrinfo_appinfo_get_appid()
4038 * @see pkgmgrinfo_appinfo_is_nodisplay()
4040 static int get_app_effectimage_type(const char *appid)
4043 char *effectimg_type = NULL;
4044 pkgmgrinfo_appinfo_h handle = NULL;
4045 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4046 if (ret != PMINFO_R_OK)
4048 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
4049 if (ret != PMINFO_R_OK) {
4050 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4053 printf("app effect image type: %s\n", effectimg_type);
4054 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4059 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
4062 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
4063 * @brief This API gets the submode_mainid of the application
4065 * @par This API is for package-manager client application
4066 * @par Sync (or) Async : Synchronous API
4068 * @param[in] handle pointer to the application info handle.
4069 * @param[out] submode_mainid pointer to hold package name
4070 * @return 0 if success, error code(<0) if fail
4071 * @retval PMINFO_R_OK success
4072 * @retval PMINFO_R_EINVAL invalid argument
4073 * @retval PMINFO_R_ERROR internal error
4074 * @pre pkgmgrinfo_appinfo_get_appinfo()
4075 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4076 * @see pkgmgrinfo_appinfo_get_appid()
4077 * @see pkgmgrinfo_appinfo_is_multiple()
4079 static int get_app_submode_mainid(const char *appid)
4082 char *submode_mainid = NULL;
4083 pkgmgrinfo_appinfo_h handle = NULL;
4084 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4085 if (ret != PMINFO_R_OK)
4087 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
4088 if (ret != PMINFO_R_OK) {
4089 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4092 printf("submode_mainid: %s\n", submode_mainid);
4093 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4098 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
4101 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4102 * @brief This API gets the datacontrol info
4104 * @par This API is for package-manager client application
4105 * @par Sync (or) Async : Synchronous API
4107 * @param[in] providerid pointer to the providerid of dataconltrol.
4108 * @param[in] type pointer to the type of dataconltrol.
4109 * @param[out] appid pointer to hold appid, need to free after using
4110 * @param[out] access pointer to hold access, need to free after using
4111 * @return 0 if success, error code(<0) if fail
4112 * @retval PMINFO_R_OK success
4113 * @retval PMINFO_R_EINVAL invalid argument
4114 * @retval PMINFO_R_ERROR internal error
4117 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4118 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
4121 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4122 * @brief This API gets the appid of datacontrol
4124 * @par This API is for package-manager client application
4125 * @par Sync (or) Async : Synchronous API
4127 * @param[in] providerid pointer to the providerid of dataconltrol.
4128 * @param[out] appid pointer to hold appid, need to free after using
4129 * @return 0 if success, error code(<0) if fail
4130 * @retval PMINFO_R_OK success
4131 * @retval PMINFO_R_EINVAL invalid argument
4132 * @retval PMINFO_R_ERROR internal error
4135 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4136 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
4139 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
4140 * @brief This API gets the information about trusted datacontrol
4142 * @par This API is for package-manager client application
4143 * @par Sync (or) Async : Synchronous API
4145 * @param[in] providerid pointer to the providerid of datacontrol.
4146 * @param[out] appid pointer to hold appid, need to free after using
4147 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
4148 * @return 0 if success, error code(<0) if fail
4149 * @retval PMINFO_R_OK success
4150 * @retval PMINFO_R_EINVAL invalid argument
4151 * @retval PMINFO_R_ERROR internal error
4154 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
4155 const char *type, char **appid, bool *is_trusted);
4156 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
4157 const char *type, uid_t uid, char **appid, bool *is_trusted);
4160 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4161 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4162 * @brief This API retrieves the privileges and invokes given callback for each privilege.
4164 * @par This API is for package-manager client application
4165 * @par Sync (or) Async : Synchronous API
4167 * @param[in] providerid pointer to the providerid of datacontrol.
4168 * @param[in] type pointer to the type of dataconltrol.
4169 * @param[in] privilege_func callback function for list
4170 * @param[in] user_data user data to be passed to callback function
4171 * @return 0 if success, error code(<0) if fail
4172 * @retval PMINFO_R_OK success
4173 * @retval PMINFO_R_EINVAL invalid argument
4174 * @retval PMINFO_R_ERROR internal error
4176 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4177 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4178 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
4179 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
4182 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
4183 * @brief This API gets the alias_appid of the application
4185 * @par This API is for package-manager client application
4186 * @par Sync (or) Async : Synchronous API
4188 * @param[in] handle pointer to the application info handle.
4189 * @param[out] alias_appid pointer to hold app alias_appid
4190 * @return 0 if success, error code(<0) if fail
4191 * @retval PMINFO_R_OK success
4192 * @retval PMINFO_R_EINVAL invalid argument
4193 * @retval PMINFO_R_ERROR internal error
4194 * @pre pkgmgrinfo_appinfo_get_appinfo()
4195 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4196 * @see pkgmgrinfo_appinfo_get_appid()
4198 static int get_alias_appid(const char *appid)
4201 char *alias_appid= 0;
4202 pkgmgrinfo_appinfo_h handle = NULL;
4203 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4204 if (ret != PMINFO_R_OK)
4206 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
4207 if (ret != PMINFO_R_OK) {
4208 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4211 printf("alias_appid: %s\n", alias_appid);
4212 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4217 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
4220 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
4221 * @brief This API gets the effective_appid of the application
4223 * @par This API is for package-manager client application
4224 * @par Sync (or) Async : Synchronous API
4226 * @param[in] handle pointer to the application info handle.
4227 * @param[out] effective_appid pointer to hold app effective_appid
4228 * @return 0 if success, error code(<0) if fail
4229 * @retval PMINFO_R_OK success
4230 * @retval PMINFO_R_EINVAL invalid argument
4231 * @retval PMINFO_R_ERROR internal error
4232 * @pre pkgmgrinfo_appinfo_get_appinfo()
4233 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4234 * @see pkgmgrinfo_appinfo_get_appid()
4236 static int get_effective_appid(const char *appid)
4239 char *effective_appid= 0;
4240 pkgmgrinfo_appinfo_h handle = NULL;
4241 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4242 if (ret != PMINFO_R_OK)
4244 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
4245 if (ret != PMINFO_R_OK) {
4246 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4249 printf("effective_appid: %s\n", effective_appid);
4250 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4255 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
4258 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
4259 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
4261 * @par This API is for package-manager client application
4262 * @par Sync (or) Async : Synchronous API
4264 * @param[in] handle pointer to the appinfo handle.
4265 * @param[out] tep_name pointer to hold tep name
4266 * @return 0 if success, error code(<0) if fail
4267 * @retval PMINFO_R_OK success
4268 * @retval PMINFO_R_EINVAL invalid argument
4269 * @retval PMINFO_R_ERROR internal error
4270 * @pre pkgmgrinfo_appinfo_get_appinfo()
4271 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4272 * @see pkgmgrinfo_appinfo_get_appid()
4274 static int get_tep_name(const char *appid)
4277 char *tep_name = NULL;
4278 pkgmgrinfo_appinfo_h handle = NULL;
4279 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4280 if (ret != PMINFO_R_OK)
4282 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
4283 if (ret != PMINFO_R_OK) {
4284 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4287 printf("TEP name is: %s\n", tep_name);
4288 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4293 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4296 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4297 * @brief This API gets zip mount file name associated with the package which contain given application
4298 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4300 * @par This API is for package-manager client application
4301 * @par Sync (or) Async : Synchronous API
4303 * @param[in] handle pointer to the appinfo handle.
4304 * @param[out] zip_mount_file pointer to hold zip mount file name
4305 * @return 0 if success, error code(<0) if fail
4306 * @retval PMINFO_R_OK success
4307 * @retval PMINFO_R_EINVAL invalid argument
4308 * @retval PMINFO_R_ERROR internal error
4309 * @pre pkgmgrinfo_appinfo_get_appinfo()
4310 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4311 * @see pkgmgrinfo_appinfo_get_appid()
4313 static int get_zip_mount_file(const char *appid)
4316 char *zip_mount_file = NULL;
4317 pkgmgrinfo_appinfo_h handle = NULL;
4318 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4319 if (ret != PMINFO_R_OK)
4321 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4322 if (ret != PMINFO_R_OK) {
4323 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4326 printf("Mount file name is: %s\n", zip_mount_file);
4327 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4332 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4335 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4336 * @brief This API gets the root path of application
4338 * @par Sync (or) Async : Synchronous API
4340 * @param[in] handle pointer to appinfo handle
4341 * @param[out] path pointer to hold root path of application
4342 * @return 0 if success, error code(<0) if fail
4343 * @retval PMINFO_R_OK success
4344 * @retval PMINFO_R_EINVAL invalid argument
4345 * @retval PMINFO_R_ERROR internal error
4347 static int get_root_path(const char *appid)
4351 pkgmgrinfo_appinfo_h handle;
4352 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4353 if (ret != PMINFO_R_OK)
4356 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4357 if (ret != PMINFO_R_OK) {
4358 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4361 printf("path : %s\n", path);
4362 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4368 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4371 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4372 * @brief This API gets the application api_version from the application ID
4374 * @par This API is for package-manager client application
4375 * @par Sync (or) Async : Synchronous API
4377 * @param[in] handle pointer to appinfo handle
4378 * @param[out] api_version pointer to hold application api_version
4379 * @return 0 if success, error code(<0) if fail
4380 * @retval PMINFO_R_OK success
4381 * @retval PMINFO_R_EINVAL invalid argument
4382 * @retval PMINFO_R_ERROR internal error
4383 * @pre pkgmgrinfo_appinfo_get_appinfo()
4384 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4385 * @see pkgmgrinfo_appinfo_get_appid()
4387 static int get_app_api_version(const char *appid)
4390 char *api_version = NULL;
4391 pkgmgrinfo_appinfo_h handle = NULL;
4392 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4393 if (ret != PMINFO_R_OK)
4395 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4396 if (ret != PMINFO_R_OK) {
4397 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4400 printf("app api_version: %s\n", api_version);
4401 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4406 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4409 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4410 * @brief This API gets the installed_time of the application
4412 * @par This API is for package-manager client application
4413 * @par Sync (or) Async : Synchronous API
4415 * @param[in] handle pointer to the application info handle.
4416 * @param[out] installed_time pointer to hold installed_time
4417 * @return 0 if success, error code(<0) if fail
4418 * @retval PMINFO_R_OK success
4419 * @retval PMINFO_R_EINVAL invalid argument
4420 * @retval PMINFO_R_ERROR internal error
4421 * @pre pkgmgrinfo_appinfo_get_appinfo()
4422 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4423 * @see pkgmgrinfo_appinfo_get_appid()
4424 * @see pkgmgrinfo_appinfo_is_multiple()
4426 static int get_app_installed_time(const char *appid)
4429 int installed_time = 0;
4430 pkgmgrinfo_appinfo_h handle = NULL;
4431 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4432 if (ret != PMINFO_R_OK)
4434 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4435 if (ret != PMINFO_R_OK) {
4436 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4439 printf("installed_time: %d\n", installed_time);
4440 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4445 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4448 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4449 * @brief This API gets the support_mode of the application
4451 * @par This API is for package-manager client application
4452 * @par Sync (or) Async : Synchronous API
4454 * @param[in] handle pointer to the application info handle.
4455 * @param[out] support_mode pointer to hold app support_mode
4456 * @return 0 if success, error code(<0) if fail
4457 * @retval PMINFO_R_OK success
4458 * @retval PMINFO_R_EINVAL invalid argument
4459 * @retval PMINFO_R_ERROR internal error
4460 * @pre pkgmgrinfo_appinfo_get_appinfo()
4461 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4462 * @see pkgmgrinfo_appinfo_get_appid()
4464 static int get_app_support_mode(const char *appid)
4467 int support_mode = 0;
4468 pkgmgrinfo_appinfo_h handle = NULL;
4469 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4470 if (ret != PMINFO_R_OK)
4472 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4473 if (ret != PMINFO_R_OK) {
4474 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4477 printf("support_mode: %s\n", support_mode);
4478 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4483 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4487 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4488 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4489 * @brief This API gets the list of category for a particular application
4491 * @par This API is for package-manager client application
4492 * @par Sync (or) Async : Synchronous API
4493 * @param[in] handle pointer to the application info handle.
4494 * @param[in] category_func callback function for list
4495 * @param[in] user_data user data to be passed to callback function
4496 * @return 0 if success, error code(<0) if fail
4497 * @retval PMINFO_R_OK success
4498 * @retval PMINFO_R_EINVAL invalid argument
4499 * @retval PMINFO_R_ERROR internal error
4500 * @pre pkgmgrinfo_appinfo_get_appinfo()
4501 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4503 int category_func(const char *name, void *user_data)
4505 if (strcmp(name, (char *)user_data) == 0)
4511 static int list_category(const char *appid, char *category)
4514 pkgmgrinfo_appinfo_h handle;
4515 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4516 if (ret != PMINFO_R_OK)
4518 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4519 if (ret != PMINFO_R_OK) {
4520 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4523 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4528 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4529 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4532 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4533 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4534 * @brief This API gets the list of metadata for a particular application
4536 * @par This API is for package-manager client application
4537 * @par Sync (or) Async : Synchronous API
4538 * @param[in] handle pointer to the application info handle.
4539 * @param[in] metadata_func callback function for list
4540 * @param[in] user_data user data to be passed to callback function
4541 * @return 0 if success, error code(<0) if fail
4542 * @retval PMINFO_R_OK success
4543 * @retval PMINFO_R_EINVAL invalid argument
4544 * @retval PMINFO_R_ERROR internal error
4545 * @pre pkgmgrinfo_appinfo_get_appinfo()
4546 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4548 int metadata_func(const char *key, const char *value, void *user_data)
4550 if (strcmp(key, (char *)user_data) == 0) {
4551 printf("Value is %s\n", value);
4558 static int list_metadata(const char *appid, char *key)
4561 pkgmgrinfo_appinfo_h handle;
4562 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4563 if (ret != PMINFO_R_OK)
4565 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4566 if (ret != PMINFO_R_OK) {
4567 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4570 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4575 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4576 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4579 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4580 * const char *operation,
4581 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4583 * @brief This API gets the list of privileges for a particular
4584 * appllication's app_control
4586 * @par This API is for package-manager client application
4587 * @par Sync (or) Async : Synchronous API
4588 * @param[in] appid application id
4589 * @param[in] operation operation of appcontrol
4590 * @param[in] privilege_func callback function for list
4591 * @param[in] user_data user data to be passed to callback function
4592 * @return 0 if success, error code(<0) if fail
4593 * @retval PMINFO_R_OK success
4594 * @retval PMINFO_R_EINVAL invalid argument
4595 * @retval PMINFO_R_ERROR internal error
4597 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4598 const char *operation,
4599 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4600 void *user_data, uid_t uid);
4601 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4602 const char *operation,
4603 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4607 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4608 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4609 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4610 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4611 * @brief This API gets the list of app-control for a particular application
4613 * @par This API is for package-manager client application
4614 * @par Sync (or) Async : Synchronous API
4615 * @param[in] handle pointer to the application info handle.
4616 * @param[in] appcontrol_func callback function for list
4617 * @param[in] user_data user data to be passed to callback function
4618 * @param[in] uid the addressee user id of the instruction
4619 * @return 0 if success, error code(<0) if fail
4620 * @retval PMINFO_R_OK success
4621 * @retval PMINFO_R_EINVAL invalid argument
4622 * @retval PMINFO_R_ERROR internal error
4623 * @pre pkgmgrinfo_appinfo_get_appinfo()
4624 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4626 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4630 char *compare_data = (char *)user_data;
4631 if (strcmp(operation, compare_data) == 0)
4637 static int check_operation(const char *appid, char *operation)
4640 pkgmgrinfo_appinfo_h handle;
4641 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4642 if (ret != PMINFO_R_OK)
4644 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4645 if (ret != PMINFO_R_OK) {
4646 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4649 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4654 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4655 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4657 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4658 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4663 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4664 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4667 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4668 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4669 * @brief This API gets the list of splashscreen for a particular application
4671 * @par This API is for package-manager client application
4672 * @par Sync (or) Async : Synchronous API
4673 * @param[in] handle pointer to the application info handle.
4674 * @param[in] splash_screen_func callback function for list
4675 * @param[in] user_data user data to be passed to callback function
4676 * @return 0 if success, error code(<0) if fail
4677 * @retval PMINFO_R_OK success
4678 * @retval PMINFO_R_EINVAL invalid argument
4679 * @retval PMINFO_R_ERROR internal error
4680 * @pre pkgmgrinfo_appinfo_get_appinfo()
4681 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4684 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4685 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4688 * @fn int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4689 pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4690 * @brief This API gets the list of resource control for a particular application
4692 * @par This API is for package-manager client application
4693 * @par Sync (or) Async : Synchronous API
4694 * @param[in] handle pointer to the application info handle.
4695 * @param[in] res_control_func callback function for list
4696 * @param[in] user_data user data to be passed to callback function
4697 * @return 0 if success, error code(<0) if fail
4698 * @retval PMINFO_R_OK success
4699 * @retval PMINFO_R_EINVAL invalid argument
4700 * @retval PMINFO_R_ERROR internal error
4701 * @pre pkgmgrinfo_appinfo_get_appinfo()
4702 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4704 int res_control_func(const char *res_type,
4705 const char *min_res_version, const char *max_res_version,
4706 const char *auto_close, void *user_data)
4708 printf("res_type : %s\n", res_type);
4712 static int list_res_control(const char *appid, char *key)
4715 pkgmgrinfo_appinfo_h handle;
4716 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4717 if (ret != PMINFO_R_OK)
4719 ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4720 if (ret != PMINFO_R_OK) {
4721 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4724 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4729 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4730 pkgmgrinfo_app_res_control_list_cb res_control_func,
4734 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4735 * @brief This API gets the application 'nodisplay' value from the app ID
4737 * @par This API is for package-manager client application
4738 * @par Sync (or) Async : Synchronous API
4740 * @param[in] handle pointer to application info handle
4741 * @param[out] nodisplay pointer to hold package nodisplay value
4742 * @return 0 if success, error code(<0) if fail
4743 * @retval PMINFO_R_OK success
4744 * @retval PMINFO_R_EINVAL invalid argument
4745 * @retval PMINFO_R_ERROR internal error
4746 * @pre pkgmgrinfo_appinfo_get_appinfo()
4747 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4748 * @see pkgmgrinfo_appinfo_get_appid()
4749 * @see pkgmgrinfo_appinfo_is_multiple()
4751 static int get_app_nodisplay(const char *appid)
4755 pkgmgrinfo_appinfo_h handle;
4756 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4757 if (ret != PMINFO_R_OK)
4759 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4760 if (ret != PMINFO_R_OK) {
4761 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4764 printf("app nodisplay: %d\n", nodisplay);
4765 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4770 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4773 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4774 * @brief This API gets the application 'multiple' value from the app ID
4776 * @par This API is for package-manager client application
4777 * @par Sync (or) Async : Synchronous API
4779 * @param[in] handle pointer to application info handle
4780 * @param[out] multiple pointer to hold package multiple value
4781 * @return 0 if success, error code(<0) if fail
4782 * @retval PMINFO_R_OK success
4783 * @retval PMINFO_R_EINVAL invalid argument
4784 * @retval PMINFO_R_ERROR internal error
4785 * @pre pkgmgrinfo_appinfo_get_appinfo()
4786 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4787 * @see pkgmgrinfo_appinfo_get_appid()
4788 * @see pkgmgrinfo_appinfo_is_nodisplay()
4790 static int get_app_multiple(const char *appid)
4794 pkgmgrinfo_appinfo_h handle;
4795 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4796 if (ret != PMINFO_R_OK)
4798 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4799 if (ret != PMINFO_R_OK) {
4800 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4803 printf("app multiple: %d\n", multiple);
4804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4809 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4812 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4813 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4814 * application launching effect. If fales, indicator will be hidden during application launching effect
4816 * @par This API is for package-manager client application
4817 * @par Sync (or) Async : Synchronous API
4819 * @param[in] handle pointer to application info handle
4820 * @param[out] indicator_disp contains indicator display status for application launching effect
4821 * @return 0 if success, error code(<0) if fail
4822 * @retval PMINFO_R_OK success
4823 * @retval PMINFO_R_EINVAL invalid argument
4824 * @retval PMINFO_R_ERROR internal error
4825 * @pre pkgmgrinfo_appinfo_get_appinfo()
4826 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4827 * @see pkgmgrinfo_appinfo_get_appid()
4828 * @see pkgmgrinfo_appinfo_is_nodisplay()
4830 static int get_app_indicator_display(const char *appid)
4833 bool indicator_disp;
4834 pkgmgrinfo_appinfo_h handle;
4835 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4836 if (ret != PMINFO_R_OK)
4838 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4839 if (ret != PMINFO_R_OK){
4840 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4843 printf("app indicator disp : %d\n", indicator_disp);
4844 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4849 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4852 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4853 * @brief This API gets the application 'taskmanage' value from the app ID
4855 * @par This API is for package-manager client application
4856 * @par Sync (or) Async : Synchronous API
4858 * @param[in] handle pointer to application info handle
4859 * @param[out] taskmanage pointer to hold package taskmanage value
4860 * @return 0 if success, error code(<0) if fail
4861 * @retval PMINFO_R_OK success
4862 * @retval PMINFO_R_EINVAL invalid argument
4863 * @retval PMINFO_R_ERROR internal error
4864 * @pre pkgmgrinfo_appinfo_get_appinfo()
4865 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4866 * @see pkgmgrinfo_appinfo_get_appid()
4867 * @see pkgmgrinfo_appinfo_is_multiple()
4869 static int get_app_taskmanage(const char *appid)
4873 pkgmgrinfo_appinfo_h handle;
4874 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4875 if (ret != PMINFO_R_OK)
4877 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4878 if (ret != PMINFO_R_OK) {
4879 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4882 printf("app taskmanage: %d\n", taskmanage);
4883 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4888 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4891 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4892 * @brief This API gets the application 'taskmanage' value from the app ID
4894 * @par This API is for package-manager client application
4895 * @par Sync (or) Async : Synchronous API
4897 * @param[in] handle pointer to application info handle
4898 * @param[out] enabled pointer to hold package enabled value
4899 * @return 0 if success, error code(<0) if fail
4900 * @retval PMINFO_R_OK success
4901 * @retval PMINFO_R_EINVAL invalid argument
4902 * @retval PMINFO_R_ERROR internal error
4903 * @pre pkgmgrinfo_appinfo_get_appinfo()
4904 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4905 * @see pkgmgrinfo_appinfo_get_appid()
4906 * @see pkgmgrinfo_appinfo_is_multiple()
4908 static int get_app_enabled(const char *appid)
4912 pkgmgrinfo_appinfo_h handle;
4913 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4914 if (ret != PMINFO_R_OK)
4916 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4917 if (ret != PMINFO_R_OK) {
4918 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4921 printf("app enabled: %d\n", enabled);
4922 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4927 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4930 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4931 * @brief This API gets the application 'onboot' value from the app ID
4933 * @par This API is for package-manager client application
4934 * @par Sync (or) Async : Synchronous API
4936 * @param[in] handle pointer to application info handle
4937 * @param[out] onboot pointer to hold package onboot value
4938 * @return 0 if success, error code(<0) if fail
4939 * @retval PMINFO_R_OK success
4940 * @retval PMINFO_R_EINVAL invalid argument
4941 * @retval PMINFO_R_ERROR internal error
4942 * @pre pkgmgrinfo_appinfo_get_appinfo()
4943 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4944 * @see pkgmgrinfo_appinfo_get_appid()
4945 * @see pkgmgrinfo_appinfo_is_multiple()
4947 static int get_app_onboot(const char *appid)
4951 pkgmgrinfo_appinfo_h handle;
4952 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4953 if (ret != PMINFO_R_OK)
4955 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4956 if (ret != PMINFO_R_OK) {
4957 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4960 printf("app onboot: %d\n", onboot);
4961 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4966 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4969 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4970 * @brief This API gets the application 'autorestart' value from the app ID
4972 * @par This API is for package-manager client application
4973 * @par Sync (or) Async : Synchronous API
4975 * @param[in] handle pointer to application info handle
4976 * @param[out] autorestart pointer to hold package autorestart value
4977 * @return 0 if success, error code(<0) if fail
4978 * @retval PMINFO_R_OK success
4979 * @retval PMINFO_R_EINVAL invalid argument
4980 * @retval PMINFO_R_ERROR internal error
4981 * @pre pkgmgrinfo_appinfo_get_appinfo()
4982 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4983 * @see pkgmgrinfo_appinfo_get_appid()
4984 * @see pkgmgrinfo_appinfo_is_multiple()
4986 static int get_app_autorestart(const char *appid)
4990 pkgmgrinfo_appinfo_h handle;
4991 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4992 if (ret != PMINFO_R_OK)
4994 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4995 if (ret != PMINFO_R_OK) {
4996 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4999 printf("app autorestart: %d\n", autorestart);
5000 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5005 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
5008 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
5009 * @brief This API gets the value for given application is main app or not from handle
5011 * @par This API is for package-manager client application
5012 * @par Sync (or) Async : Synchronous API
5014 * @param[in] handle pointer to application info handle
5015 * @param[out] mainapp pointer to hold package mainapp is or not
5016 * @return 0 if success, error code(<0) if fail
5017 * @retval PMINFO_R_OK success
5018 * @retval PMINFO_R_EINVAL invalid argument
5019 * @retval PMINFO_R_ERROR internal error
5020 * @pre pkgmgrinfo_appinfo_get_appinfo()
5021 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5022 * @see pkgmgrinfo_appinfo_get_appid()
5023 * @see pkgmgrinfo_appinfo_is_multiple()
5025 static int get_app_mainapp(const char *appid)
5029 pkgmgrinfo_appinfo_h handle;
5030 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5031 if (ret != PMINFO_R_OK)
5033 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
5034 if (ret != PMINFO_R_OK) {
5035 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5038 printf("mainapp: %d\n", mainapp);
5039 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5044 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
5048 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
5049 * @brief This API gets the value for given application is preload or not from handle
5051 * @par This API is for package-manager client application
5052 * @par Sync (or) Async : Synchronous API
5054 * @param[in] handle pointer to application info handle
5055 * @param[out] preload pointer to hold preload is or not
5056 * @return 0 if success, error code(<0) if fail
5057 * @retval PMINFO_R_OK success
5058 * @retval PMINFO_R_EINVAL invalid argument
5059 * @retval PMINFO_R_ERROR internal error
5060 * @pre pkgmgrinfo_appinfo_get_appinfo()
5061 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5062 * @see pkgmgrinfo_appinfo_get_appid()
5063 * @see pkgmgrinfo_appinfo_is_multiple()
5065 static int get_app_preload(const char *appid)
5069 pkgmgrinfo_appinfo_h handle = NULL;
5070 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5071 if (ret != PMINFO_R_OK)
5073 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
5074 if (ret != PMINFO_R_OK) {
5075 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5078 printf("preload: %d\n", preload);
5079 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5084 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
5087 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
5088 * @brief This API gets the value for given application is submode or not from handle
5090 * @par This API is for package-manager client application
5091 * @par Sync (or) Async : Synchronous API
5093 * @param[in] handle pointer to application info handle
5094 * @param[out] submode pointer to hold submode is or not
5095 * @return 0 if success, error code(<0) if fail
5096 * @retval PMINFO_R_OK success
5097 * @retval PMINFO_R_EINVAL invalid argument
5098 * @retval PMINFO_R_ERROR internal error
5099 * @pre pkgmgrinfo_appinfo_get_appinfo()
5100 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5101 * @see pkgmgrinfo_appinfo_get_appid()
5102 * @see pkgmgrinfo_appinfo_is_multiple()
5104 static int get_app_submode(const char *appid)
5108 pkgmgrinfo_appinfo_h handle = NULL;
5109 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5110 if (ret != PMINFO_R_OK)
5112 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
5113 if (ret != PMINFO_R_OK) {
5114 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5117 printf("submode: %d\n", submode);
5118 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5123 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
5126 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
5127 * @brief This API gets the value for given application is process_pool or not from handle
5129 * @par This API is for package-manager client application
5130 * @par Sync (or) Async : Synchronous API
5132 * @param[in] handle pointer to application info handle
5133 * @param[out] process_pool pointer to hold process_pool is or not
5134 * @return 0 if success, error code(<0) if fail
5135 * @retval PMINFO_R_OK success
5136 * @retval PMINFO_R_EINVAL invalid argument
5137 * @retval PMINFO_R_ERROR internal error
5138 * @pre pkgmgrinfo_appinfo_get_appinfo()
5139 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5140 * @see pkgmgrinfo_appinfo_get_appid()
5142 static int get_app_process_pool(const char *appid)
5145 bool process_pool = 0;
5146 pkgmgrinfo_appinfo_h handle = NULL;
5147 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5148 if (ret != PMINFO_R_OK)
5150 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
5151 if (ret != PMINFO_R_OK) {
5152 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5155 printf("process_pool: %d\n", process_pool);
5156 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5161 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
5164 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
5165 * @brief This API gets the installed storage location of the application
5167 * @par This API is for package-manager client application
5168 * @par Sync (or) Async : Synchronous API
5170 * @param[in] handle pointer to the application info handle.
5171 * @param[out] app_type pointer to hold installed storage location
5172 * @return 0 if success, error code(<0) if fail
5173 * @retval PMINFO_R_OK success
5174 * @retval PMINFO_R_EINVAL invalid argument
5175 * @retval PMINFO_R_ERROR internal error
5176 * @pre pkgmgrinfo_appinfo_get_appinfo()
5177 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5178 * @see pkgmgrinfo_appinfo_get_appid()
5180 static int get_app_installed_location(const char *appid)
5183 pkgmgrinfo_installed_storage storage;
5184 pkgmgrinfo_appinfo_h handle = NULL;
5185 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5186 if (ret != PMINFO_R_OK)
5188 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
5189 if (ret != PMINFO_R_OK) {
5190 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5193 printf("Installed storage location : %d\n", storage);
5194 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5199 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
5203 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
5204 * @brief This API checks if the application has the given category
5206 * @par This API is for package-manager client application
5207 * @par Sync (or) Async : Synchronous API
5209 * @param[in] handle pointer to the application info handle
5210 * @param[in] category category
5211 * @param[out] exist value Gets whether the application has the given category
5212 * @return 0 if success, error code(<0) if fail
5213 * @retval PMINFO_R_OK success
5214 * @retval PMINFO_R_EINVAL invalid argument
5215 * @retval PMINFO_R_ERROR internal error
5217 static int is_category_exist(const char *appid, const char *category)
5220 pkgmgrinfo_appinfo_h handle;
5223 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5224 if (ret != PMINFO_R_OK)
5227 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
5228 if (ret != PMINFO_R_OK) {
5229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5238 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
5241 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
5242 * @brief This API gets the application 'ui_gadget' value from the app ID
5244 * @par This API is for package-manager client application
5245 * @par Sync (or) Async : Synchronous API
5247 * @param[in] handle pointer to application info handle
5248 * @param[out] ui_gadget pointer to hold package ui_gadget value
5249 * @return 0 if success, error code(<0) if fail
5250 * @retval PMINFO_R_OK success
5251 * @retval PMINFO_R_EINVAL invalid argument
5252 * @pre pkgmgrinfo_appinfo_get_appinfo()
5253 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5255 static int get_app_ui_gadget(const char *appid)
5259 pkgmgrinfo_appinfo_h handle = NULL;
5260 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5261 if (ret != PMINFO_R_OK)
5263 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
5264 if (ret != PMINFO_R_OK) {
5265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5268 printf("app ui_gadget: %d\n", ui_gadget);
5269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5274 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
5277 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
5278 * @brief This API gets the application 'support_disable' value from the app ID
5280 * @par This API is for package-manager client application
5281 * @par Sync (or) Async : Synchronous API
5283 * @param[in] handle pointer to application info handle
5284 * @param[out] support_disable pointer to hold package support_disable value
5285 * @return 0 if success, error code(<0) if fail
5286 * @retval PMINFO_R_OK success
5287 * @retval PMINFO_R_EINVAL invalid argument
5288 * @pre pkgmgrinfo_appinfo_get_appinfo()
5289 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5291 static int get_app_support_disable(const char *appid)
5294 bool support_disable;
5295 pkgmgrinfo_appinfo_h handle = NULL;
5296 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5297 if (ret != PMINFO_R_OK)
5299 ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
5300 if (ret != PMINFO_R_OK) {
5301 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5304 printf("app support_disable: %d\n", support_disable);
5305 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5310 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
5313 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
5314 * @brief This API gets the application 'removable' value from the app ID
5316 * @par This API is for package-manager client application
5317 * @par Sync (or) Async : Synchronous API
5319 * @param[in] handle pointer to application info handle
5320 * @param[out] removable pointer to hold package removable value
5321 * @return 0 if success, error code(<0) if fail
5322 * @retval PMINFO_R_OK success
5323 * @retval PMINFO_R_EINVAL invalid argument
5324 * @retval PMINFO_R_ERROR internal error
5325 * @pre pkgmgrinfo_appinfo_get_appinfo()
5326 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5327 * @see pkgmgrinfo_appinfo_get_appid()
5329 static int get_app_removable(const char *appid)
5333 pkgmgrinfo_appinfo_h handle = NULL;
5334 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5335 if (ret != PMINFO_R_OK)
5337 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5338 if (ret != PMINFO_R_OK) {
5339 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5342 printf("app removable: %d\n", removable);
5343 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5348 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5351 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5352 * @brief This API gets the application 'system' value from the app ID
5354 * @par This API is for package-manager client application
5355 * @par Sync (or) Async : Synchronous API
5357 * @param[in] handle pointer to application info handle
5358 * @param[out] system pointer to hold package system value
5359 * @return 0 if success, error code(<0) if fail
5360 * @retval PMINFO_R_OK success
5361 * @retval PMINFO_R_EINVAL invalid argument
5362 * @retval PMINFO_R_ERROR internal error
5363 * @pre pkgmgrinfo_appinfo_get_appinfo()
5364 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5365 * @see pkgmgrinfo_appinfo_get_appid()
5367 static int get_app_system(const char *appid)
5370 bool system = false;
5371 pkgmgrinfo_appinfo_h handle = NULL;
5372 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5373 if (ret != PMINFO_R_OK)
5375 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5376 if (ret != PMINFO_R_OK) {
5377 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5380 printf("app system: %d\n", system);
5381 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5386 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5390 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5391 * @brief This API gets the application 'is_disable' 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] disabled pointer to hold application is_disabled 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 * @pre pkgmgrinfo_appinfo_get_appinfo()
5402 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5404 static int get_app_is_disable(const char *appid)
5408 pkgmgrinfo_appinfo_h handle = NULL;
5409 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5410 if (ret != PMINFO_R_OK)
5412 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5413 if (ret != PMINFO_R_OK) {
5414 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5417 printf("app is_disable: %d\n", is_disable);
5418 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5423 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5426 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5427 * @brief This API gets whether the given application is global application or user application
5429 * @par This API is for package-manager client application
5430 * @par Sync (or) Async : Synchronous API
5432 * @param[in] handle pointer to application info handle
5433 * @param[in] global pointer to hold application global value
5434 * @return 0 if success, error code(<0) if fail
5435 * @retval PMINFO_R_OK success
5436 * @retval PMINFO_R_EINVAL invalid argument
5437 * @retval PMINFO_R_ERROR internal error
5438 * @pre pkgmgrinfo_appinfo_get_appinfo()
5439 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5440 * @see pkgmgrinfo_appinfo_get_appid()
5441 static int get_app_is_global(const char *appid)
5445 pkgmgrinfo_appinfo_h handle = NULL;
5446 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5447 if (ret != PMINFO_R_OK)
5449 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5450 if (ret != PMINFO_R_OK) {
5451 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5454 printf("app is_global: %d\n", global);
5455 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5460 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5463 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5464 * @brief This API gets the application 'splash_screen_display' value from the app ID
5466 * @par This API is for package-manager client application
5467 * @par Sync (or) Async : Synchronous API
5469 * @param[in] handle pointer to application info handle
5470 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5471 * @return 0 if success, error code(<0) if fail
5472 * @retval PMINFO_R_OK success
5473 * @retval PMINFO_R_EINVAL invalid argument
5474 * @retval PMINFO_R_ERROR internal error
5476 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5479 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5480 * @brief This API gets the application 'setup_appid' value from the app ID
5482 * @par This API is for package-manager client application
5483 * @par Sync (or) Async : Synchronous API
5485 * @param[in] handle pointer to application info handle
5486 * @param[out] setup_appid pointer to hold package setup_appid value
5487 * @return 0 if success, error code(<0) if fail
5488 * @retval PMINFO_R_OK success
5489 * @retval PMINFO_R_EINVAL invalid argument
5490 * @retval PMINFO_R_ERROR internal error
5492 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5495 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5496 * @brief This API gets the application 'support_ambient' value from the app ID
5498 * @par This API is for package-manager client application
5499 * @par Sync (or) Async : Synchronous API
5501 * @param[in] handle pointer to application info handle
5502 * @param[out] support_ambient pointer to hold package support_ambient value
5503 * @return 0 if success, error code(<0) if fail
5504 * @retval PMINFO_R_OK success
5505 * @retval PMINFO_R_EINVAL invalid argument
5506 * @retval PMINFO_R_ERROR internal error
5508 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5511 * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
5512 * @brief This API gets the application 'light_user_switch_mode' value from the app ID
5514 * @par This API is for package-manager client application
5515 * @par Sync (or) Async : Synchronous API
5517 * @param[in] handle pointer to application info handle
5518 * @param[out] mode pointer to hold package light_user_switch_mode value
5519 * @return 0 if success, error code(<0) if fail
5520 * @retval PMINFO_R_OK success
5521 * @retval PMINFO_R_EINVAL invalid argument
5522 * @retval PMINFO_R_ERROR internal error
5524 int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
5527 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5528 * @brief This API destroys the application information handle freeing up all the resources
5530 * @par This API is for package-manager client application
5531 * @par Sync (or) Async : Synchronous API
5533 * @param[in] handle pointer to the application info handle.
5534 * @return 0 if success, error code(<0) if fail
5535 * @retval PMINFO_R_OK success
5536 * @retval PMINFO_R_EINVAL invalid argument
5537 * @retval PMINFO_R_ERROR internal error
5538 * @pre pkgmgrinfo_appinfo_get_appinfo()
5540 * @see pkgmgrinfo_appinfo_get_pkgid()
5541 * @see pkgmgrinfo_appinfo_is_multiple()
5543 static int get_app_type(const char *appid)
5547 pkgmgrinfo_appinfo_h handle;
5548 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5549 if (ret != PMINFO_R_OK)
5551 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5552 if (ret != PMINFO_R_OK) {
5553 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5556 printf("apptype: %s\n", type);
5557 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5562 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5565 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5566 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5567 The query will search the entire application information collected from the manifest file of all the installed packages
5569 * @par This API is for package-manager client application
5570 * @par Sync (or) Async : Synchronous API
5572 * @param[out] handle pointer to the application info filter handle.
5573 * @return 0 if success, error code(<0) if fail
5574 * @retval PMINFO_R_OK success
5575 * @retval PMINFO_R_EINVAL invalid argument
5576 * @retval PMINFO_R_ERROR internal error
5578 * @post pkgmgrinfo_appinfo_filter_destroy()
5579 * @see pkgmgrinfo_appinfo_filter_count()
5580 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5582 static int get_capp_count()
5586 pkgmgrinfo_appinfo_filter_h handle;
5587 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5588 if (ret != PMINFO_R_OK)
5590 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5591 if (ret != PMINFO_R_OK) {
5592 pkgmgrinfo_appinfo_filter_destroy(handle);
5595 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5596 if (ret != PMINFO_R_OK) {
5597 pkgmgrinfo_appinfo_filter_destroy(handle);
5600 printf("No of capp: %d\n", count);
5601 pkgmgrinfo_appinfo_filter_destroy(handle);
5606 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5609 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5610 * @brief This API destroys the application information filter handle freeing up all the resources
5612 * @par This API is for package-manager client application
5613 * @par Sync (or) Async : Synchronous API
5615 * @param[in] handle pointer to the application info filter handle.
5616 * @return 0 if success, error code(<0) if fail
5617 * @retval PMINFO_R_OK success
5618 * @retval PMINFO_R_EINVAL invalid argument
5619 * @retval PMINFO_R_ERROR internal error
5620 * @pre pkgmgrinfo_appinfo_filter_create()
5622 * @see pkgmgrinfo_appinfo_filter_count()
5623 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5625 static int get_capp_count()
5629 pkgmgrinfo_appinfo_filter_h handle;
5630 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5631 if (ret != PMINFO_R_OK)
5633 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5634 if (ret != PMINFO_R_OK) {
5635 pkgmgrinfo_appinfo_filter_destroy(handle);
5638 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5639 if (ret != PMINFO_R_OK) {
5640 pkgmgrinfo_appinfo_filter_destroy(handle);
5643 printf("No of capp: %d\n", count);
5644 pkgmgrinfo_appinfo_filter_destroy(handle);
5649 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5652 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5653 * @brief This API adds a boolean filter property to the filter handle
5655 * @par This API is for package-manager client application
5656 * @par Sync (or) Async : Synchronous API
5658 * @param[in] handle pointer to the application info filter handle.
5659 * @param[in] property boolean property name.
5660 * @param[in] value value corresponding to the property.
5661 * @return 0 if success, error code(<0) if fail
5662 * @retval PMINFO_R_OK success
5663 * @retval PMINFO_R_EINVAL invalid argument
5664 * @retval PMINFO_R_ERROR internal error
5665 * @pre pkgmgrinfo_appinfo_filter_create()
5666 * @post pkgmgrinfo_appinfo_filter_destroy()
5667 * @see pkgmgrinfo_appinfo_filter_count()
5668 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5670 static int get_taskmanageable_app_count()
5674 pkgmgrinfo_appinfo_filter_h handle;
5675 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5676 if (ret != PMINFO_R_OK)
5678 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5679 if (ret != PMINFO_R_OK) {
5680 pkgmgrinfo_appinfo_filter_destroy(handle);
5683 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5684 if (ret != PMINFO_R_OK) {
5685 pkgmgrinfo_appinfo_filter_destroy(handle);
5688 printf("No of taskmanageable apps: %d\n", count);
5689 pkgmgrinfo_appinfo_filter_destroy(handle);
5694 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5695 const char *property, const bool value);
5698 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5699 * @brief This API adds an integer filter property to the filter handle
5701 * @par This API is for package-manager client application
5702 * @par Sync (or) Async : Synchronous API
5704 * @param[in] handle pointer to the application info filter handle.
5705 * @param[in] property integer property name.
5706 * @param[in] value value corresponding to the property.
5707 * @return 0 if success, error code(<0) if fail
5708 * @retval PMINFO_R_OK success
5709 * @retval PMINFO_R_EINVAL invalid argument
5710 * @retval PMINFO_R_ERROR internal error
5711 * @pre pkgmgrinfo_appinfo_filter_create()
5712 * @post pkgmgrinfo_appinfo_filter_destroy()
5713 * @see pkgmgrinfo_appinfo_filter_count()
5714 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5716 static int get_taskmanageable_app_count()
5720 pkgmgrinfo_appinfo_filter_h handle;
5721 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5722 if (ret != PMINFO_R_OK)
5724 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5725 if (ret != PMINFO_R_OK) {
5726 pkgmgrinfo_appinfo_filter_destroy(handle);
5729 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5730 if (ret != PMINFO_R_OK) {
5731 pkgmgrinfo_appinfo_filter_destroy(handle);
5734 printf("No of apps: %d\n", count);
5735 pkgmgrinfo_appinfo_filter_destroy(handle);
5740 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5741 const char *property, const int value);
5744 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5745 * @brief This API adds a string filter property to the filter handle
5747 * @par This API is for package-manager client application
5748 * @par Sync (or) Async : Synchronous API
5750 * @param[in] handle pointer to the application info filter handle.
5751 * @param[in] property string property name.
5752 * @param[in] value value corresponding to the property.
5753 * @return 0 if success, error code(<0) if fail
5754 * @retval PMINFO_R_OK success
5755 * @retval PMINFO_R_EINVAL invalid argument
5756 * @retval PMINFO_R_ERROR internal error
5757 * @pre pkgmgrinfo_appinfo_filter_create()
5758 * @post pkgmgrinfo_appinfo_filter_destroy()
5759 * @see pkgmgrinfo_appinfo_filter_count()
5760 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5762 static int get_capp_count()
5766 pkgmgrinfo_appinfo_filter_h handle;
5767 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5768 if (ret != PMINFO_R_OK)
5770 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5771 if (ret != PMINFO_R_OK) {
5772 pkgmgrinfo_appinfo_filter_destroy(handle);
5775 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5776 if (ret != PMINFO_R_OK) {
5777 pkgmgrinfo_appinfo_filter_destroy(handle);
5780 printf("No of capp: %d\n", count);
5781 pkgmgrinfo_appinfo_filter_destroy(handle);
5786 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5787 const char *property, const char *value);
5790 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5791 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5793 * @par This API is for package-manager client application
5794 * @par Sync (or) Async : Synchronous API
5796 * @param[in] handle pointer to the application info filter handle.
5797 * @param[in] app_cb callback function.
5798 * @param[in] user_data user data to be passed to the callback function
5799 * @return 0 if success, error code(<0) if fail
5800 * @retval PMINFO_R_OK success
5801 * @retval PMINFO_R_EINVAL invalid argument
5802 * @retval PMINFO_R_ERROR internal error
5803 * @pre pkgmgrinfo_appinfo_filter_create()
5804 * @post pkgmgrinfo_appinfo_filter_destroy()
5805 * @see pkgmgrinfo_appinfo_filter_count()
5807 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5810 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5811 printf("appid : %s\n", appid);
5815 static int get_capp_list()
5818 pkgmgrinfo_appinfo_filter_h handle;
5819 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5820 if (ret != PMINFO_R_OK)
5822 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5823 if (ret != PMINFO_R_OK) {
5824 pkgmgrinfo_appinfo_filter_destroy(handle);
5827 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5828 if (ret != PMINFO_R_OK) {
5829 pkgmgrinfo_appinfo_filter_destroy(handle);
5832 pkgmgrinfo_appinfo_filter_destroy(handle);
5837 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5838 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5839 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5840 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5843 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5844 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5845 * @brief This API counts the application that satisfy the filter conditions
5847 * @par This API is for package-manager client application
5848 * @par Sync (or) Async : Synchronous API
5850 * @param[in] handle pointer to the application info filter handle.
5851 * @param[in] count pointer to store count value
5852 * @param[in] uid the addressee user id of the instruction
5853 * @return 0 if success, error code(<0) if fail
5854 * @retval PMINFO_R_OK success
5855 * @retval PMINFO_R_EINVAL invalid argument
5856 * @retval PMINFO_R_ERROR internal error
5857 * @pre pkgmgrinfo_appinfo_filter_create()
5858 * @post pkgmgrinfo_appinfo_filter_destroy()
5859 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5861 static int get_capp_count()
5865 pkgmgrinfo_appinfo_filter_h handle;
5866 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5867 if (ret != PMINFO_R_OK)
5869 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5870 if (ret != PMINFO_R_OK) {
5871 pkgmgrinfo_appinfo_filter_destroy(handle);
5874 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5875 if (ret != PMINFO_R_OK) {
5876 pkgmgrinfo_appinfo_filter_destroy(handle);
5879 printf("No of capp: %d\n", count);
5880 pkgmgrinfo_appinfo_filter_destroy(handle);
5885 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5886 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5888 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5889 * @brief This API creates the application's metadata information filter handle from db.
5891 * @par This API is for package-manager client application
5892 * @par Sync (or) Async : Synchronous API
5894 * @param[out] handle pointer to the application metadata info filter handle.
5895 * @return 0 if success, error code(<0) if fail
5896 * @retval PMINFO_R_OK success
5897 * @retval PMINFO_R_EINVAL invalid argument
5898 * @retval PMINFO_R_ERROR internal error
5900 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5901 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5903 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5906 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5907 printf("appid : %s\n", appid);
5911 static int get_app_list(const char *mkey, const char *mvalue)
5914 pkgmgrinfo_appinfo_metadata_filter_h handle;
5915 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5916 if (ret != PMINFO_R_OK)
5918 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5919 if (ret != PMINFO_R_OK) {
5920 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5923 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5924 if (ret != PMINFO_R_OK) {
5925 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5928 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5933 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5936 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5937 * @brief This API destroys the application's metadata information filter handle.
5939 * @par This API is for package-manager client application
5940 * @par Sync (or) Async : Synchronous API
5942 * @param[in] handle pointer to the application metadata info filter handle.
5943 * @return 0 if success, error code(<0) if fail
5944 * @retval PMINFO_R_OK success
5945 * @retval PMINFO_R_EINVAL invalid argument
5946 * @retval PMINFO_R_ERROR internal error
5947 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5949 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5951 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5954 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5955 printf("appid : %s\n", appid);
5959 static int get_app_list(const char *mkey, const char *mvalue)
5962 pkgmgrinfo_appinfo_metadata_filter_h handle;
5963 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5964 if (ret != PMINFO_R_OK)
5966 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5967 if (ret != PMINFO_R_OK) {
5968 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5971 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5972 if (ret != PMINFO_R_OK) {
5973 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5976 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5981 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5984 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5985 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5986 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5988 * @par This API is for package-manager client application
5989 * @par Sync (or) Async : Synchronous API
5991 * @param[in] handle pointer to the application metadata info filter handle.
5992 * @param[in] key pointer to metadata key
5993 * @param[in] value pointer to metadata value
5994 * @return 0 if success, error code(<0) if fail
5995 * @retval PMINFO_R_OK success
5996 * @retval PMINFO_R_EINVAL invalid argument
5997 * @retval PMINFO_R_ERROR internal error
5998 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5999 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
6000 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
6002 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6005 pkgmgrinfo_appinfo_get_appid(handle, &appid);
6006 printf("appid : %s\n", appid);
6010 static int get_app_list(const char *mkey, const char *mvalue)
6013 pkgmgrinfo_appinfo_metadata_filter_h handle;
6014 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
6015 if (ret != PMINFO_R_OK)
6017 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
6018 if (ret != PMINFO_R_OK) {
6019 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6022 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
6023 if (ret != PMINFO_R_OK) {
6024 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6027 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6032 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
6033 const char *key, const char *value);
6036 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
6037 * @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)
6038 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
6039 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
6040 * negative value, no more callbacks will be called and API will return.
6042 * @par This API is for package-manager client application
6043 * @par Sync (or) Async : Synchronous API
6045 * @param[in] handle pointer to the application metadata info filter handle.
6046 * @param[in] app_cb function pointer to callback
6047 * @param[in] user_data pointer to user data
6048 * @param[in] uid the addressee user id of the instruction
6049 * @return 0 if success, error code(<0) if fail
6050 * @retval PMINFO_R_OK success
6051 * @retval PMINFO_R_EINVAL invalid argument
6052 * @retval PMINFO_R_ERROR internal error
6053 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
6054 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
6056 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6059 pkgmgrinfo_appinfo_get_appid(handle, &appid);
6060 printf("appid : %s\n", appid);
6064 static int get_app_list(const char *mkey, const char *mvalue)
6067 pkgmgrinfo_appinfo_metadata_filter_h handle;
6068 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
6069 if (ret != PMINFO_R_OK)
6071 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
6072 if (ret != PMINFO_R_OK) {
6073 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6076 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
6077 if (ret != PMINFO_R_OK) {
6078 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6081 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6086 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6087 pkgmgrinfo_app_list_cb app_cb, void *user_data);
6088 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6089 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
6092 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6093 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6094 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6095 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6096 * @brief This API gets the list of app-control for a particular application
6098 * @par This API is for package-manager client application
6099 * @par Sync (or) Async : Synchronous API
6100 * @param[in] handle pointer to the application info handle.
6101 * @param[in] appcontrol_func callback function for list
6102 * @param[in] user_data user data to be passed to callback function
6103 * @return 0 if success, error code(<0) if fail
6104 * @retval PMINFO_R_OK success
6105 * @retval PMINFO_R_EINVAL invalid argument
6106 * @retval PMINFO_R_ERROR internal error
6107 * @pre pkgmgrinfo_appinfo_get_appinfo()
6108 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6110 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6111 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6113 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6114 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6117 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
6118 * @brief This API creates the package cert information handle to get data from db.
6120 * @par This API is for package-manager client application
6121 * @par Sync (or) Async : Synchronous API
6123 * @param[out] handle pointer to the package cert handle.
6124 * @return 0 if success, error code(<0) if fail
6125 * @retval PMINFO_R_OK success
6126 * @retval PMINFO_R_EINVAL invalid argument
6127 * @retval PMINFO_R_ERROR internal error
6129 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6130 * @see pkgmgrinfo_pkginfo_get_cert_value()
6131 * @see pkgmgrinfo_pkginfo_load_certinfo()
6133 static int get_cert_info(const char *pkgid)
6136 pkgmgrinfo_certinfo_h handle;
6137 char *auth_cert = NULL;
6138 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6139 if (ret != PMINFO_R_OK)
6141 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6142 if (ret != PMINFO_R_OK) {
6143 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6146 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6147 if (ret != PMINFO_R_OK) {
6148 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6151 printf("Author root certificate: %s\n", auth_root);
6152 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6157 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
6160 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
6161 * @brief This API loads the package cert information handle with data from db.
6163 * @par This API is for package-manager client application
6164 * @par Sync (or) Async : Synchronous API
6166 * @param[in] pkgid pointer to the package ID.
6167 * @param[in] handle pointer to the package cert handle.
6168 * @return 0 if success, error code(<0) if fail
6169 * @retval PMINFO_R_OK success
6170 * @retval PMINFO_R_EINVAL invalid argument
6171 * @retval PMINFO_R_ERROR internal error
6172 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6173 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6174 * @see pkgmgrinfo_pkginfo_get_cert_value()
6176 static int get_cert_info(const char *pkgid)
6179 pkgmgrinfo_certinfo_h handle;
6180 char *auth_cert = NULL;
6181 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6182 if (ret != PMINFO_R_OK)
6184 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6185 if (ret != PMINFO_R_OK) {
6186 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6189 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6190 if (ret != PMINFO_R_OK) {
6191 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6194 printf("Author root certificate: %s\n", auth_root);
6195 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6200 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
6203 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
6204 * @brief This API gets the package cert information from the handle
6206 * @par This API is for package-manager client application
6207 * @par Sync (or) Async : Synchronous API
6209 * @param[in] handle pointer to the package cert handle.
6210 * @param[in] cert_type certificate type
6211 * @param[out] cert_value pointer to hold certificate value
6212 * @return 0 if success, error code(<0) if fail
6213 * @retval PMINFO_R_OK success
6214 * @retval PMINFO_R_EINVAL invalid argument
6215 * @retval PMINFO_R_ERROR internal error
6216 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6217 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6218 * @see pkgmgrinfo_pkginfo_load_certinfo()
6220 static int get_cert_info(const char *pkgid)
6223 pkgmgrinfo_certinfo_h handle;
6224 char *auth_cert = NULL;
6225 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6226 if (ret != PMINFO_R_OK)
6228 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6229 if (ret != PMINFO_R_OK) {
6230 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6233 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6234 if (ret != PMINFO_R_OK) {
6235 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6238 printf("Author root certificate: %s\n", auth_root);
6239 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6244 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
6247 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
6248 * @brief This API destroys the package cert information handle freeing up all the resources
6250 * @par This API is for package-manager client application
6251 * @par Sync (or) Async : Synchronous API
6253 * @param[in] handle pointer to the package cert handle.
6254 * @return 0 if success, error code(<0) if fail
6255 * @retval PMINFO_R_OK success
6256 * @retval PMINFO_R_EINVAL invalid argument
6257 * @retval PMINFO_R_ERROR internal error
6258 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6260 * @see pkgmgrinfo_pkginfo_load_certinfo()
6262 static int get_cert_info(const char *pkgid)
6265 pkgmgrinfo_certinfo_h handle;
6266 char *auth_cert = NULL;
6267 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6268 if (ret != PMINFO_R_OK)
6270 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6271 if (ret != PMINFO_R_OK) {
6272 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6275 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6276 if (ret != PMINFO_R_OK) {
6277 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6280 printf("Author root certificate: %s\n", auth_root);
6281 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6286 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
6289 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
6290 * @brief This API deletes the package cert information from DB
6292 * @par This API is for package-manager client application
6293 * @par Sync (or) Async : Synchronous API
6295 * @param[in] pkgid pointer to the package ID.
6296 * @return 0 if success, error code(<0) if fail
6297 * @retval PMINFO_R_OK success
6298 * @retval PMINFO_R_EINVAL invalid argument
6299 * @retval PMINFO_R_ERROR internal error
6303 static int delete_cert_info(const char *pkgid)
6306 ret = pkgmgrinfo_delete_certinfo(pkgid);
6307 if (ret != PMINFO_R_OK)
6313 int pkgmgrinfo_delete_certinfo(const char *pkgid);
6314 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
6317 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
6318 * @brief This API creates the package cert information handle to set data in db.
6320 * @par This API is for package-manager client application
6321 * @par Sync (or) Async : Synchronous API
6323 * @param[out] handle pointer to the package cert handle.
6324 * @return 0 if success, error code(<0) if fail
6325 * @retval PMINFO_R_OK success
6326 * @retval PMINFO_R_EINVAL invalid argument
6327 * @retval PMINFO_R_ERROR internal error
6329 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6330 * @see pkgmgrinfo_set_cert_value()
6331 * @see pkgmgrinfo_save_certinfo()
6333 static int set_cert_in_db(const char *pkgid)
6336 pkgmgrinfo_instcertinfo_h handle;
6337 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6338 if (ret != PMINFO_R_OK)
6340 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6341 if (ret != PMINFO_R_OK) {
6342 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6345 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6346 if (ret != PMINFO_R_OK) {
6347 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6350 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6355 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6358 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6359 * @brief This API sets the package cert information in the handle.
6361 * @par This API is for package-manager client application
6362 * @par Sync (or) Async : Synchronous API
6364 * @param[in] handle pointer to the package cert handle.
6365 * @param[in] cert_type certificate type.
6366 * @param[in] cert_value certificate value.
6367 * @return 0 if success, error code(<0) if fail
6368 * @retval PMINFO_R_OK success
6369 * @retval PMINFO_R_EINVAL invalid argument
6370 * @retval PMINFO_R_ERROR internal error
6371 * @pre pkgmgrinfo_create_certinfo_set_handle()
6372 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6373 * @see pkgmgrinfo_save_certinfo()
6375 static int set_cert_in_db(const char *pkgid)
6378 pkgmgrinfo_instcertinfo_h handle;
6379 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6380 if (ret != PMINFO_R_OK)
6382 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6383 if (ret != PMINFO_R_OK) {
6384 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6387 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6388 if (ret != PMINFO_R_OK) {
6389 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6392 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6397 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6400 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6401 * @brief This API saves the package cert information in the DB.
6403 * @par This API is for package-manager client application
6404 * @par Sync (or) Async : Synchronous API
6406 * @param[in] pkgid pointer to the package ID.
6407 * @param[in] handle pointer to the package cert handle.
6408 * @return 0 if success, error code(<0) if fail
6409 * @retval PMINFO_R_OK success
6410 * @retval PMINFO_R_EINVAL invalid argument
6411 * @retval PMINFO_R_ERROR internal error
6412 * @pre pkgmgrinfo_create_certinfo_set_handle()
6413 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6414 * @see pkgmgrinfo_save_certinfo()
6416 static int set_cert_in_db(const char *pkgid)
6419 pkgmgrinfo_instcertinfo_h handle;
6420 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6421 if (ret != PMINFO_R_OK)
6423 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6424 if (ret != PMINFO_R_OK) {
6425 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6428 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6429 if (ret != PMINFO_R_OK) {
6430 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6433 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6438 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6441 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6442 * @brief This API destroys the package cert information handle freeing up all the resources.
6444 * @par This API is for package-manager client application
6445 * @par Sync (or) Async : Synchronous API
6447 * @param[in] handle pointer to the package cert handle.
6448 * @return 0 if success, error code(<0) if fail
6449 * @retval PMINFO_R_OK success
6450 * @retval PMINFO_R_EINVAL invalid argument
6451 * @retval PMINFO_R_ERROR internal error
6452 * @pre pkgmgrinfo_create_certinfo_set_handle()
6454 * @see pkgmgrinfo_save_certinfo()
6456 static int set_cert_in_db(const char *pkgid)
6459 pkgmgrinfo_instcertinfo_h handle;
6460 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6461 if (ret != PMINFO_R_OK)
6463 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6464 if (ret != PMINFO_R_OK) {
6465 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6468 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6469 if (ret != PMINFO_R_OK) {
6470 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6473 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6478 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6481 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6482 * @brief This API gets the application 'guest mode visibility' value from the DB
6484 * @par This API is for package-manager client application
6485 * @par Sync (or) Async : Synchronous API
6487 * @param[in] handle pointer to application info handle
6488 * @param[out] status pointer to hold app guest mode visibility value
6489 * @return 0 if success, error code(<0) if fail
6490 * @retval PMINFO_R_OK success
6491 * @retval PMINFO_R_EINVAL invalid argument
6492 * @retval PMINFO_R_ERROR internal error
6493 * @pre pkgmgrinfo_appinfo_get_appinfo()
6494 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6495 * @see pkgmgrinfo_appinfo_get_appid()
6496 * @see pkgmgrinfo_appinfo_is_multiple()
6498 static int get_app_guestmode_visibility(const char *appid)
6502 pkgmgrinfo_appinfo_h handle;
6503 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6504 if (ret != PMINFO_R_OK)
6506 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6507 if (ret != PMINFO_R_OK) {
6508 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6511 printf("app guest mode visibility: %d\n", status);
6512 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6517 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6520 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6521 * @brief This API sets the package 'installed_storage' value in db
6523 * @par This API is for package-manager client application
6524 * @par Sync (or) Async : Synchronous API
6526 * @param[in] pkgid pointer to the package ID.
6527 * @param[in] location package install location
6528 * @param[in] external_pkg_path image path if pkg has installed at external storage
6529 * @return 0 if success, error code(<0) if fail
6530 * @retval PMINFO_R_OK success
6531 * @retval PMINFO_R_EINVAL invalid argument
6532 * @retval PMINFO_R_ERROR internal error
6534 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6538 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6539 if (ret != PMINFO_R_OK) {
6546 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6547 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6549 /* version compare */
6550 int pkgmgrinfo_compare_package_version(const char *current_version,
6551 const char *target_version, pkgmgrinfo_version_compare_type *res);
6554 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6555 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6557 * @brief This API gets the list of dependency of a particular package
6559 * @par This API is for package-manager client application
6560 * @par Sync (or) Async : Synchronous API
6561 * @param[in] handle pointer to the package info handle.
6562 * @param[in] dependency_cb callback function for list
6563 * @param[in] user_data user data to be passed to callback function
6564 * @return 0 if success, error code(<0) if fail
6565 * @retval PMINFO_R_OK success
6566 * @retval PMINFO_R_EINVAL invalid argument
6567 * @retval PMINFO_R_ERROR internal error
6568 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6569 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6571 int dependency_cb(const char *from const char *to, const char *type,
6572 const char *required_version,void *user_data)
6574 printf("this package %s %s", type, to);
6575 if (required_version)
6576 printf("required version : %s", required_version);
6580 static int list_dependency(const char *package)
6583 pkgmgrinfo_pkginfo_h handle;
6584 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6585 if (ret != PMINFO_R_OK)
6587 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6588 if (ret != PMINFO_R_OK) {
6589 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6592 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6597 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6598 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6602 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6603 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6605 * @brief This API gets the list of packages which has dependency directly
6606 * and indirectly of a particular package
6608 * @par This API is for package-manager client application
6609 * @par Sync (or) Async : Synchronous API
6610 * @param[in] handle pointer to the package info handle.
6611 * @param[in] dependency_cb callback function for list
6612 * @param[in] user_data user data to be passed to callback function
6613 * @return 0 if success, error code(<0) if fail
6614 * @retval PMINFO_R_OK success
6615 * @retval PMINFO_R_EINVAL invalid argument
6616 * @retval PMINFO_R_ERROR internal error
6617 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6618 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6620 int dependency_cb(const char *from, const char *to, const char *type,
6621 const char *required_version,void *user_data)
6623 printf("%s %s %s package", from, to, type);
6624 if (required_version)
6625 printf("required version : %s", required_version);
6629 static int list_depends_on(const char *package)
6632 pkgmgrinfo_pkginfo_h handle;
6633 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6634 if (ret != PMINFO_R_OK)
6636 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6637 if (ret != PMINFO_R_OK) {
6638 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6641 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6646 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6647 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6651 * @fn int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6652 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6654 * @brief This API gets the list of allowed package for a particular package
6656 * @par This API is for package-manager client application
6657 * @par Sync (or) Async : Synchronous API
6658 * @param[in] handle pointer to the package info handle.
6659 * @param[in] res_allowed_package_cb callback function for list
6660 * @param[in] user_data user data to be passed to callback function
6661 * @return 0 if success, error code(<0) if fail
6662 * @retval PMINFO_R_OK success
6663 * @retval PMINFO_R_EINVAL invalid argument
6664 * @retval PMINFO_R_ERROR internal error
6665 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6666 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6668 int res_allowed_package_cb(const char *allowed_package,
6669 required_privilege_h handle, void *user_data)
6671 printf("allowed package : %s", allowed_package);
6676 static int list_res_allowed_package(const char *package)
6679 pkgmgrinfo_pkginfo_h handle;
6680 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6681 if (ret != PMINFO_R_OK)
6683 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6684 if (ret != PMINFO_R_OK) {
6685 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6688 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6693 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6694 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6698 * @fn int pkgmgrinfo_pkginfo_foreach_required_privilege(
6699 required_privilege_h handle,
6700 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6702 * @brief This API gets the list of allowed package's required privileges
6704 * @par This API is for package-manager client application
6705 * @par Sync (or) Async : Synchronous API
6706 * @param[in] handle pointer to the required privilege handle.
6707 * @param[in] privilege_func callback function for list
6708 * @param[in] user_data user data to be passed to callback function
6709 * @return 0 if success, error code(<0) if fail
6710 * @retval PMINFO_R_OK success
6711 * @retval PMINFO_R_EINVAL invalid argument
6712 * @pre pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6715 int privilege_func(const char *privilege_name, void *user_data)
6717 printf("required privilege : %s", privilege_name);
6722 int res_allowed_package_cb(const char *allowed_package,
6723 required_privilege_h handle, void *user_data)
6726 printf("allowed package : %s", allowed_package);
6728 ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6729 if (ret != PMINFO_R_OK)
6735 static int list_res_allowed_package(const char *package)
6738 pkgmgrinfo_pkginfo_h handle;
6739 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6740 if (ret != PMINFO_R_OK)
6742 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6743 if (ret != PMINFO_R_OK) {
6744 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6747 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6752 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6753 required_privilege_h handle,
6754 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6758 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6759 * @brief This API gets list of installed packages using flag that used for masking package's information
6761 * @par This API is for package-manager client application
6762 * @par Sync (or) Async : Synchronous API
6763 * @param[in] pkg_list_cb iteration function for list
6764 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6765 * @param[in] user_data user data to be passed to callback function
6766 * @return 0 if success, error code(<0) if fail
6767 * @retval PMINFO_R_OK success
6768 * @retval PMINFO_R_EINVAL invalid argument
6769 * @retval PMINFO_R_ERROR internal error
6772 * @see pkgmgrinfo_pkginfo_get_option
6774 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6776 char *label1 = NULL;
6777 char *label2 = NULL;
6778 label1 = (char *)user_data;
6779 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6780 if (strcmp(label1, label2) == 0)
6786 static int list_pkgs()
6789 char *label = "helloworld";
6790 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6791 if (ret != PMINFO_R_OK)
6797 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6798 int flag, void *user_data, uid_t uid);
6799 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6800 int flag, void *user_data);
6803 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6804 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6806 * @par This API is for package-manager client application
6807 * @par Sync (or) Async : Synchronous API
6808 * @param[in] app_func iteration function for list
6809 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6810 * @param[in] user_data user data to be passed to callback function
6811 * @return 0 if success, error code(<0) if fail
6812 * @retval PMINFO_R_OK success
6813 * @retval PMINFO_R_EINVAL invalid argument
6814 * @retval PMINFO_R_ERROR internal error
6817 * @see pkgmgrinfo_appinfo_get_option
6819 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6822 char *label1 = NULL;
6823 char *label2 = NULL;
6824 label1 = (char *)user_data;
6825 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6826 if (ret != PMINFO_R_OK) {
6827 printf("pkgmgrinfo_appinfo_get_label fail");
6830 if (strcmp(label1, label2) == 0)
6836 static int list_apps()
6839 char *label = "helloworld";
6840 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6841 if (ret != PMINFO_R_OK)
6847 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6848 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6850 int pkgmgrinfo_appinfo_get_installed_list_full(
6851 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6854 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6855 * @brief This API creates the package archive information handle from given path
6857 * @par This API is for package-manager client application
6858 * @par Sync (or) Async : Synchronous API
6860 * @param[in] path path of package archive
6861 * @param[out] handle pointer to the package archive info handle
6862 * @return 0 if success, error code(<0) if fail
6863 * @retval PMINFO_R_OK success
6864 * @retval PMINFO_R_EINVAL invalid argument
6865 * @retval PMINFO_R_ERROR internal error
6867 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6869 static int get_pkg_archive_type(const char *path)
6873 pkgmgrinfo_archiveinfo_h handle;
6874 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6875 if (ret != PMINFO_R_OK)
6877 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6878 if (ret != PMINFO_R_OK) {
6879 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6882 printf("pkg archive type: %s\n", type);
6883 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6888 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6889 pkgmgrinfo_archiveinfo_h *handle);
6892 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6893 * @brief This API destroys the package archive information handle freeing up all the resources
6895 * @par This API is for package-manager client application
6896 * @par Sync (or) Async : Synchronous API
6898 * @param[in] handle pointer to the package archive info handle
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()
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_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6927 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6928 * @brief This API gets the package id from the package archive info handle
6930 * @par This API is for package-manager client application
6931 * @par Sync (or) Async : Synchronous API
6933 * @param[in] handle pointer to package archive info handle
6934 * @param[out] pkgid pointer to hold package id
6935 * @return 0 if success, error code(<0) if fail
6936 * @retval PMINFO_R_OK success
6937 * @retval PMINFO_R_EINVAL invalid argument
6938 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6939 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6941 static int get_pkg_archive_id(const char *path)
6944 char *pkg_id = NULL;
6945 pkgmgrinfo_archiveinfo_h handle;
6946 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6947 if (ret != PMINFO_R_OK)
6949 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6950 if (ret != PMINFO_R_OK) {
6951 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6954 printf("pkg archive id: %s\n", pkg_id);
6955 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6960 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6961 const char **pkgid);
6964 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6965 * @brief This API gets the package type from the package archive info handle
6967 * @par This API is for package-manager client application
6968 * @par Sync (or) Async : Synchronous API
6970 * @param[in] handle pointer to package archive info handle
6971 * @param[out] type pointer to hold package type
6972 * @return 0 if success, error code(<0) if fail
6973 * @retval PMINFO_R_OK success
6974 * @retval PMINFO_R_EINVAL invalid argument
6975 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6976 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6978 static int get_pkg_archive_type(const char *path)
6982 pkgmgrinfo_archiveinfo_h handle;
6983 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6984 if (ret != PMINFO_R_OK)
6986 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6987 if (ret != PMINFO_R_OK) {
6988 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6991 printf("pkg archive type: %s\n", type);
6992 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6997 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
7001 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
7002 * @brief This API gets the package version from the package archive info handle
7004 * @par This API is for package-manager client application
7005 * @par Sync (or) Async : Synchronous API
7007 * @param[in] handle pointer to package archive info handle
7008 * @param[out] version pointer to hold package version
7009 * @return 0 if success, error code(<0) if fail
7010 * @retval PMINFO_R_OK success
7011 * @retval PMINFO_R_EINVAL invalid argument
7012 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7013 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7015 static int get_pkg_archive_version(const char *path)
7018 char *version = NULL;
7019 pkgmgrinfo_archiveinfo_h handle;
7020 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7021 if (ret != PMINFO_R_OK)
7023 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
7024 if (ret != PMINFO_R_OK) {
7025 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7028 printf("pkg archive version: %s\n", version);
7029 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7034 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
7035 const char **version);
7038 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
7039 * @brief This API gets the package api version from the package archive info handle
7041 * @par This API is for package-manager client application
7042 * @par Sync (or) Async : Synchronous API
7044 * @param[in] handle pointer to package archive info handle
7045 * @param[out] api_version pointer to hold package api_version
7046 * @return 0 if success, error code(<0) if fail
7047 * @retval PMINFO_R_OK success
7048 * @retval PMINFO_R_EINVAL invalid argument
7049 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7050 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7052 static int get_pkg_archive_api_version(const char *path)
7055 char *api_version = NULL;
7056 pkgmgrinfo_archiveinfo_h handle;
7057 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7058 if (ret != PMINFO_R_OK)
7060 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
7061 if (ret != PMINFO_R_OK) {
7062 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7065 printf("pkg archive api_version: %s\n", api_version);
7066 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7071 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
7072 const char **api_version);
7075 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
7076 * @brief This API gets the package description from the package archive info handle
7078 * @par This API is for package-manager client application
7079 * @par Sync (or) Async : Synchronous API
7081 * @param[in] handle pointer to package archive info handle
7082 * @param[out] description pointer to hold package description
7083 * @return 0 if success, error code(<0) if fail
7084 * @retval PMINFO_R_OK success
7085 * @retval PMINFO_R_EINVAL invalid argument
7086 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7087 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7089 static int get_pkg_archive_description(const char *path)
7092 char *description = NULL;
7093 pkgmgrinfo_archiveinfo_h handle;
7094 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7095 if (ret != PMINFO_R_OK)
7097 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
7098 if (ret != PMINFO_R_OK) {
7099 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7102 printf("pkg archive description: %s\n", description);
7103 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7108 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
7109 const char **description);
7112 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
7113 * @brief This API gets the package label from the package archive info handle
7115 * @par This API is for package-manager client application
7116 * @par Sync (or) Async : Synchronous API
7118 * @param[in] handle pointer to package archive info handle
7119 * @param[out] label pointer to hold package label
7120 * @return 0 if success, error code(<0) if fail
7121 * @retval PMINFO_R_OK success
7122 * @retval PMINFO_R_EINVAL invalid argument
7123 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7124 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7126 static int get_pkg_archive_label(const char *path)
7130 pkgmgrinfo_archiveinfo_h handle;
7131 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7132 if (ret != PMINFO_R_OK)
7134 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
7135 if (ret != PMINFO_R_OK) {
7136 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7139 printf("pkg archive label: %s\n", label);
7140 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7145 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
7146 const char **label);
7149 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
7150 * @brief This API gets the package author from the package archive info handle
7152 * @par This API is for package-manager client application
7153 * @par Sync (or) Async : Synchronous API
7155 * @param[in] handle pointer to package archive info handle
7156 * @param[out] author pointer to hold package author
7157 * @return 0 if success, error code(<0) if fail
7158 * @retval PMINFO_R_OK success
7159 * @retval PMINFO_R_EINVAL invalid argument
7160 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7161 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7163 static int get_pkg_archive_author(const char *path)
7166 char *author = NULL;
7167 pkgmgrinfo_archiveinfo_h handle;
7168 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7169 if (ret != PMINFO_R_OK)
7171 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
7172 if (ret != PMINFO_R_OK) {
7173 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7176 printf("pkg archive author: %s\n", author);
7177 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7182 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
7183 const char **author);
7186 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
7187 * @brief This API gets the package icon and size from the package archive info handle
7189 * @par This API is for package-manager client application
7190 * @par Sync (or) Async : Synchronous API
7192 * @param[in] handle pointer to package archive info handle
7193 * @param[out] icon pointer to hold package icon
7194 * @param[out] size pointer to hold size of package icon
7195 * @return 0 if success, error code(<0) if fail
7196 * @retval PMINFO_R_OK success
7197 * @retval PMINFO_R_EINVAL invalid argument
7198 * @retval PMINFO_R_ENOENT no result
7199 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7200 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7202 static int get_pkg_archive_icon(const char *path)
7205 unsigned char *icon = NULL;
7206 size_t icon_size = 0;
7207 pkgmgrinfo_archiveinfo_h handle;
7208 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7209 if (ret != PMINFO_R_OK)
7211 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
7212 if (ret != PMINFO_R_OK) {
7213 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7216 printf("pkg archive icon size : %zu\n", icon_size);
7217 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7222 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
7223 const unsigned char **icon, size_t *size);
7226 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
7227 * @brief This API retrieve the dependency information and invoke given callback for it.
7229 * @par This API is for package-manager client application
7230 * @par Sync (or) Async : Synchronous API
7232 * @param[in] handle pointer to package archive info handle
7233 * @param[in] callback callback to be invoked for each retrieved dependency information
7234 * @param[in] user_data user data to be passed to callback
7235 * @return 0 if success, error code(<0) if fail
7236 * @retval PMINFO_R_OK success
7237 * @retval PMINFO_R_EINVAL invalid argument
7238 * @retval PMINFO_R_ERROR internal error
7239 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7240 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7242 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
7245 size_t icon_size = 0;
7246 pkgmgrinfo_archiveinfo_h handle;
7247 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7248 if (ret != PMINFO_R_OK)
7250 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
7251 if (ret != PMINFO_R_OK) {
7252 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7255 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7260 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
7261 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
7264 * @pkgmgrinfo client API end
7272 #endif /* __PKG_INFO_H__ */