4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7 * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
25 * @author Sewook Park <sewook7.park@samsung.com>
26 * @author Shobhit Srivastava <shobhit.s@samsung.com>
28 * @brief This file declares API of pkgmgr-info library
30 * @addtogroup APPLICATION_FRAMEWORK
33 * @defgroup PackageManagerInfo
34 * @section Header Header file to include:
36 * #include <pkgmgr-info.h>
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
48 #include <sys/types.h>
50 #include "pkgmgrinfo_type.h"
60 * This is package information library
62 * Package Information Library is used to get package related information.\n
63 * It uses the package manifest information database to get any package related information\n
64 * It also provides API to set information in the package info database\n
70 * @brief Package Information Library Header File
72 * Generated by Sewook Park <sewook7.park@samsung.com>
77 /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79 /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81 /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83 /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85 /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87 /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89 /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91 /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93 /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
95 /** String property for filtering based on package info*/
96 #define PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE "PMINFO_PKGINFO_PROP_PACKAGE_RES_TYPE"
98 /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
100 /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
102 /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
104 /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
106 /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
108 /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
110 /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
112 /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
114 /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
116 /** Boolean property for filtering based on package info*/
117 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
119 /** Integer property for filtering based on package info*/
120 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
122 /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_ID "PMINFO_APPINFO_PROP_APP_ID"
124 /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_COMPONENT "PMINFO_APPINFO_PROP_APP_COMPONENT"
126 /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_EXEC "PMINFO_APPINFO_PROP_APP_EXEC"
128 /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_ICON "PMINFO_APPINFO_PROP_APP_ICON"
130 /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_TYPE "PMINFO_APPINFO_PROP_APP_TYPE"
132 /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_OPERATION "PMINFO_APPINFO_PROP_APP_OPERATION"
134 /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_URI "PMINFO_APPINFO_PROP_APP_URI"
136 /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_MIME "PMINFO_APPINFO_PROP_APP_MIME"
138 /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_CATEGORY "PMINFO_APPINFO_PROP_APP_CATEGORY"
140 /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
142 /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_SCREENREADER "PMINFO_APPINFO_PROP_APP_SCREENREADER"
144 /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_PACKAGE "PMINFO_APPINFO_PROP_APP_PACKAGE"
146 /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
148 /** String property for filtering based on app info*/
149 #define PMINFO_APPINFO_PROP_PRIVILEGE "PMINFO_APPINFO_PROP_PRIVILEGE"
151 /** Integer property for filtering app support mode */
152 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
154 /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_NODISPLAY "PMINFO_APPINFO_PROP_APP_NODISPLAY"
156 /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_MULTIPLE "PMINFO_APPINFO_PROP_APP_MULTIPLE"
158 /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_ONBOOT "PMINFO_APPINFO_PROP_APP_ONBOOT"
160 /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_AUTORESTART "PMINFO_APPINFO_PROP_APP_AUTORESTART"
162 /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
164 /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
166 /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_UI_GADGET "PMINFO_APPINFO_PROP_APP_UI_GADGET"
168 /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
170 /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
174 /** Boolean property for filtering based on app info*/
175 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
177 /** will be updated*/
178 /** string property for filtering based on pkg info*/
179 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
181 /* For multiuser support */
182 const char *getIconPath(uid_t uid, bool readonly);
183 char *getUserPkgParserDBPath(void);
184 char *getUserPkgParserDBPathUID(uid_t uid);
185 char *getUserPkgCertDBPath(void);
186 const char *getUserManifestPath(uid_t uid, bool readonly);
189 * @fn int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
190 * @fn int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
191 * @brief This API gets list of installed packages
193 * @par This API is for package-manager client application
194 * @par Sync (or) Async : Synchronous API
195 * @param[in] pkg_list_cb iteration function for list
196 * @param[in] user_data user data to be passed to callback function
197 * @param[in] uid the addressee user id of the instruction
198 * @return 0 if success, error code(<0) if fail
199 * @retval PMINFO_R_OK success
200 * @retval PMINFO_R_EINVAL invalid argument
201 * @retval PMINFO_R_ERROR internal error
205 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
209 pkgid1 = (char *)user_data;
210 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
211 if (strcmp(pkgid1, pkgid2) == 0) {
218 static int list_pkgs()
221 char *name = "helloworld";
222 ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
223 if (ret != PMINFO_R_OK) {
230 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
231 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
234 * @fn int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
235 * @fn int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
236 * @brief This API gets list of disabled packages
238 * @par This API is for package-manager client application
239 * @par Sync (or) Async : Synchronous API
240 * @param[in] pkg_list_cb iteration function for list
241 * @param[in] user_data user data to be passed to callback function
242 * @param[in] uid the addressee user id of the instruction
243 * @return 0 if success, error code(<0) if fail
244 * @retval PMINFO_R_OK success
245 * @retval PMINFO_R_EINVAL invalid argument
246 * @retval PMINFO_R_ERROR internal error
250 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
251 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
254 * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
255 * @brief This API creates the package information handle from db which is not disabled
257 * @par This API is for package-manager client application
258 * @par Sync (or) Async : Synchronous API
260 * @param[in] pkgid pointer to package ID
261 * @param[in] uid the addressee user id of the instruction
262 * @param[out] handle pointer to the package info handle.
263 * @return 0 if success, error code(<0) if fail
264 * @retval PMINFO_R_OK success
265 * @retval PMINFO_R_EINVAL invalid argument
266 * @retval PMINFO_R_ERROR internal error
268 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
269 * @see pkgmgrinfo_pkginfo_get_pkgid()
270 * @see pkgmgrinfo_pkginfo_is_removable()
272 static int get_pkg_type(const char *pkgid)
276 pkgmgrinfo_pkginfo_h handle;
277 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
278 if (ret != PMINFO_R_OK)
280 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
281 if (ret != PMINFO_R_OK) {
282 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285 printf("pkgtype: %s\n", type);
286 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
291 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
292 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
295 * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
296 * @brief This API creates the disabled package information handle from db
298 * @par This API is for package-manager client application
299 * @par Sync (or) Async : Synchronous API
301 * @param[in] pkgid pointer to package ID
302 * @param[in] uid the addressee user id of the instruction
303 * @param[out] handle pointer to the package info handle.
304 * @return 0 if success, error code(<0) if fail
305 * @retval PMINFO_R_OK success
306 * @retval PMINFO_R_EINVAL invalid argument
307 * @retval PMINFO_R_ERROR internal error
309 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
310 * @see pkgmgrinfo_pkginfo_get_pkginfo()
312 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
313 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
316 * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
317 * @brief This API creates the package information handle from db regardless of its disable or storage status
319 * @par This API is for package-manager client application
320 * @par Sync (or) Async : Synchronous API
322 * @param[in] pkgid pointer to package ID
323 * @param[in] uid the addressee user id of the instruction
324 * @param[out] handle pointer to the package info handle.
325 * @return 0 if success, error code(<0) if fail
326 * @retval PMINFO_R_OK success
327 * @retval PMINFO_R_EINVAL invalid argument
328 * @retval PMINFO_R_ERROR internal error
330 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
331 * @see pkgmgrinfo_pkginfo_get_pkgid()
332 * @see pkgmgrinfo_pkginfo_is_removable()
334 static int get_pkg_type(const char *pkgid)
338 pkgmgrinfo_pkginfo_h handle;
339 ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
340 if (ret != PMINFO_R_OK)
342 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
343 if (ret != PMINFO_R_OK) {
344 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347 printf("pkgtype: %s\n", type);
348 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
353 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
354 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
357 * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
358 * @brief This API gets the package name from the package ID
360 * @par This API is for package-manager client application
361 * @par Sync (or) Async : Synchronous API
363 * @param[in] handle pointer to package info handle
364 * @param[out] pkg_name pointer to hold package name
365 * @return 0 if success, error code(<0) if fail
366 * @retval PMINFO_R_OK success
367 * @retval PMINFO_R_EINVAL invalid argument
368 * @retval PMINFO_R_ERROR internal error
369 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
370 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
371 * @see pkgmgrinfo_pkginfo_get_type()
372 * @see pkgmgrinfo_pkginfo_is_removable()
374 static int get_pkg_name(const char *pkgid)
377 char *pkgname = NULL;
378 pkgmgrinfo_pkginfo_h handle;
379 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
380 if (ret != PMINFO_R_OK)
382 ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
383 if (ret != PMINFO_R_OK) {
384 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
387 printf("pkgname: %s\n", pkgname);
388 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
393 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
396 * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
397 * @brief This API gets the package id from the package ID
399 * @par This API is for package-manager client application
400 * @par Sync (or) Async : Synchronous API
402 * @param[in] handle pointer to package info handle
403 * @param[out] pkgid pointer to hold package id
404 * @return 0 if success, error code(<0) if fail
405 * @retval PMINFO_R_OK success
406 * @retval PMINFO_R_EINVAL invalid argument
407 * @retval PMINFO_R_ERROR internal error
408 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
409 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
410 * @see pkgmgrinfo_pkginfo_get_type()
411 * @see pkgmgrinfo_pkginfo_is_removable()
413 static int get_pkgid(const char *pkgid)
417 pkgmgrinfo_pkginfo_h handle;
418 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
419 if (ret != PMINFO_R_OK)
421 ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
422 if (ret != PMINFO_R_OK) {
423 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426 printf("pkg id: %s\n", pkg_id);
427 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
432 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
435 * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
436 * @brief This API gets the package type from the package ID
438 * @par This API is for package-manager client application
439 * @par Sync (or) Async : Synchronous API
441 * @param[in] handle pointer to package info handle
442 * @param[out] type pointer to hold package type
443 * @return 0 if success, error code(<0) if fail
444 * @retval PMINFO_R_OK success
445 * @retval PMINFO_R_EINVAL invalid argument
446 * @retval PMINFO_R_ERROR internal error
447 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
448 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
449 * @see pkgmgrinfo_pkginfo_get_pkgid()
450 * @see pkgmgrinfo_pkginfo_is_removable()
452 static int get_pkg_type(const char *pkgid)
456 pkgmgrinfo_pkginfo_h handle;
457 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
458 if (ret != PMINFO_R_OK)
460 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
461 if (ret != PMINFO_R_OK) {
462 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465 printf("pkgtype: %s\n", type);
466 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
471 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
474 * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
475 * @brief This API gets the package version from the package ID
477 * @par This API is for package-manager client application
478 * @par Sync (or) Async : Synchronous API
480 * @param[in] handle pointer to package info handle
481 * @param[out] version pointer to hold package version
482 * @return 0 if success, error code(<0) if fail
483 * @retval PMINFO_R_OK success
484 * @retval PMINFO_R_EINVAL invalid argument
485 * @retval PMINFO_R_ERROR internal error
486 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
487 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
488 * @see pkgmgrinfo_pkginfo_get_pkgid()
489 * @see pkgmgrinfo_pkginfo_is_removable()
491 static int get_pkg_version(const char *pkgid)
494 char *version = NULL;
495 pkgmgrinfo_pkginfo_h handle;
496 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
497 if (ret != PMINFO_R_OK)
499 ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
500 if (ret != PMINFO_R_OK) {
501 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504 printf("pkg version: %s\n", version);
505 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
510 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
513 * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
514 * @brief This API gets the package api_version from the package ID
516 * @par This API is for package-manager client application
517 * @par Sync (or) Async : Synchronous API
519 * @param[in] handle pointer to package info handle
520 * @param[out] api_version pointer to hold package api_version
521 * @return 0 if success, error code(<0) if fail
522 * @retval PMINFO_R_OK success
523 * @retval PMINFO_R_EINVAL invalid argument
524 * @retval PMINFO_R_ERROR internal error
525 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
526 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
527 * @see pkgmgrinfo_pkginfo_get_pkgid()
528 * @see pkgmgrinfo_pkginfo_is_removable()
530 static int get_pkg_api_version(const char *pkgid)
533 char *api_version = NULL;
534 pkgmgrinfo_pkginfo_h handle = NULL;
535 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
536 if (ret != PMINFO_R_OK)
538 ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
539 if (ret != PMINFO_R_OK) {
540 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543 printf("pkg api_version: %s\n", api_version);
544 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
549 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
552 * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
553 * @brief This API gets tep(tizen expansion package) file name associated with the package
555 * @par This API is for package-manager client application
556 * @par Sync (or) Async : Synchronous API
558 * @param[in] handle pointer to the pkginfo handle.
559 * @param[out] tep_name pointer to hold tep name
560 * @return 0 if success, error code(<0) if fail
561 * @retval PMINFO_R_OK success
562 * @retval PMINFO_R_EINVAL invalid argument
563 * @retval PMINFO_R_ERROR internal error
564 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
565 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
566 * @see pkgmgrinfo_pkginfo_get_pkgid()
568 static int get_tep_name(const char *pkgid)
571 char *tep_name = NULL;
572 pkgmgrinfo_pkginfo_h handle = NULL;
573 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
574 if (ret != PMINFO_R_OK)
576 ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
577 if (ret != PMINFO_R_OK) {
578 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581 printf("TEP name is: %s\n", tep_name);
582 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
587 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
590 * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
591 * @brief This API gets package mount point path associated with the package
592 * if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
594 * @par This API is for package-manager client application
595 * @par Sync (or) Async : Synchronous API
597 * @param[in] handle pointer to the pkginfo handle.
598 * @param[out] zip_mount_file pointer to hold zip mount file
599 * @return 0 if success, error code(<0) if fail
600 * @retval PMINFO_R_OK success
601 * @retval PMINFO_R_EINVAL invalid argument
602 * @retval PMINFO_R_ERROR internal error
603 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
604 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
605 * @see pkgmgrinfo_pkginfo_get_pkgid()
607 static int get_zip_mount_file(const char *pkgid)
610 char *zip_mount_file = NULL;
611 pkgmgrinfo_pkginfo_h handle = NULL;
612 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
613 if (ret != PMINFO_R_OK)
615 ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
616 if (ret != PMINFO_R_OK) {
617 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
620 if (zip_mount_file != NULL)
621 printf("Zip mount path is: %s\n", zip_mount_file);
622 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
627 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
630 * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
631 * @brief This API gets package external image path associated with the package
632 * if package is installed in external storage.
633 * Otherwise, the return value will be PMINFO_R_ENOENT.
635 * @par This API is for package-manager client application
636 * @par Sync (or) Async : Synchronous API
638 * @param[in] handle pointer to the pkginfo handle.
639 * @param[out] ext_image_path pointer to hold external image path
640 * @return 0 if success, error code(<0) if fail
641 * @retval PMINFO_R_OK success
642 * @retval PMINFO_R_EINVAL invalid argument
643 * @retval PMINFO_R_ERROR internal error
644 * @revall PMINFO_R_ENOENT no valid data
645 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
646 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
647 * @see pkgmgrinfo_pkginfo_get_pkgid()
649 static int get_external_image_path(const char *pkgid)
652 char *ext_image_path = NULL;
653 pkgmgrinfo_pkginfo_h handle = NULL;
654 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
655 if (ret != PMINFO_R_OK)
657 ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
658 if (ret != PMINFO_R_OK) {
659 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662 printf("external image path is: %s\n", ext_image_path);
663 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
668 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
671 * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
672 * @brief This API gets the package install location from the package ID
674 * @par This API is for package-manager client application
675 * @par Sync (or) Async : Synchronous API
677 * @param[in] handle pointer to package info handle
678 * @param[out] location pointer to hold package install location
679 * @return 0 if success, error code(<0) if fail
680 * @retval PMINFO_R_OK success
681 * @retval PMINFO_R_EINVAL invalid argument
682 * @retval PMINFO_R_ERROR internal error
683 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
684 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
685 * @see pkgmgrinfo_pkginfo_get_pkgid()
686 * @see pkgmgrinfo_pkginfo_is_removable()
688 static int get_pkg_install_location(const char *pkgid)
691 pkgmgrinfo_install_location location;
692 pkgmgrinfo_pkginfo_h handle;
693 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
694 if (ret != PMINFO_R_OK)
696 ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
697 if (ret != PMINFO_R_OK) {
698 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701 printf("pkg install location: %d\n", location);
702 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
707 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
710 * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
711 * @brief This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
712 size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
713 the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
715 * @par This API is for package-manager client application
716 * @par Sync (or) Async : Synchronous API
718 * @param[in] handle pointer to package info handle
719 * @param[out] size pointer to hold package size
720 * @return 0 if success, error code(<0) if fail
721 * @retval PMINFO_R_OK success
722 * @retval PMINFO_R_EINVAL invalid argument
723 * @retval PMINFO_R_ERROR internal error
724 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
725 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
726 * @see pkgmgrinfo_pkginfo_get_pkgid()
727 * @see pkgmgrinfo_pkginfo_is_removable()
729 static int get_pkg_size(const char *pkgid)
733 pkgmgrinfo_pkginfo_h handle;
734 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
735 if (ret != PMINFO_R_OK)
737 ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
738 if (ret != PMINFO_R_OK) {
739 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742 printf("pkgsize: %d\n", size);
743 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
748 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
751 * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
752 * @brief This API gets the package icon from the package ID
754 * @par This API is for package-manager client application
755 * @par Sync (or) Async : Synchronous API
757 * @param[in] handle pointer to package info handle
758 * @param[out] icon pointer to hold package icon
759 * @return 0 if success, error code(<0) if fail
760 * @retval PMINFO_R_OK success
761 * @retval PMINFO_R_EINVAL invalid argument
762 * @retval PMINFO_R_ERROR internal error
763 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
764 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
765 * @see pkgmgrinfo_pkginfo_get_pkgid()
766 * @see pkgmgrinfo_pkginfo_is_removable()
768 static int get_pkg_icon(const char *pkgid)
772 pkgmgrinfo_pkginfo_h handle;
773 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
774 if (ret != PMINFO_R_OK)
776 ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
777 if (ret != PMINFO_R_OK) {
778 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
781 printf("pkg icon: %s\n", icon);
782 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
787 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
790 * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
791 * @brief This API gets the package label from the package ID
793 * @par This API is for package-manager client application
794 * @par Sync (or) Async : Synchronous API
796 * @param[in] handle pointer to package info handle
797 * @param[out] label pointer to hold package label
798 * @return 0 if success, error code(<0) if fail
799 * @retval PMINFO_R_OK success
800 * @retval PMINFO_R_EINVAL invalid argument
801 * @retval PMINFO_R_ERROR internal error
802 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
803 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
804 * @see pkgmgrinfo_pkginfo_get_pkgid()
805 * @see pkgmgrinfo_pkginfo_is_removable()
807 static int get_pkg_label(const char *pkgid)
811 pkgmgrinfo_pkginfo_h handle;
812 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
813 if (ret != PMINFO_R_OK)
815 ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
816 if (ret != PMINFO_R_OK) {
817 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
820 printf("pkg label: %s\n", label);
821 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
826 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
829 * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
830 * @brief This API gets the package description from the package ID
832 * @par This API is for package-manager client application
833 * @par Sync (or) Async : Synchronous API
835 * @param[in] handle pointer to package info handle
836 * @param[out] description pointer to hold package description
837 * @return 0 if success, error code(<0) if fail
838 * @retval PMINFO_R_OK success
839 * @retval PMINFO_R_EINVAL invalid argument
840 * @retval PMINFO_R_ERROR internal error
841 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
842 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
843 * @see pkgmgrinfo_pkginfo_get_pkgid()
844 * @see pkgmgrinfo_pkginfo_is_removable()
846 static int get_pkg_description(const char *pkgid)
849 char *description = NULL;
850 pkgmgrinfo_pkginfo_h handle;
851 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
852 if (ret != PMINFO_R_OK)
854 ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
855 if (ret != PMINFO_R_OK) {
856 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
859 printf("pkg description: %s\n", description);
860 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
865 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
868 * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
869 * @brief This API gets the package's author name from the package ID
871 * @par This API is for package-manager client application
872 * @par Sync (or) Async : Synchronous API
874 * @param[in] handle pointer to package info handle
875 * @param[out] author_name pointer to hold package author name
876 * @return 0 if success, error code(<0) if fail
877 * @retval PMINFO_R_OK success
878 * @retval PMINFO_R_EINVAL invalid argument
879 * @retval PMINFO_R_ERROR internal error
880 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
881 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
882 * @see pkgmgrinfo_pkginfo_get_pkgid()
883 * @see pkgmgrinfo_pkginfo_is_removable()
885 static int get_pkg_author_name(const char *pkgid)
888 char *author_name = NULL;
889 pkgmgrinfo_pkginfo_h handle;
890 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
891 if (ret != PMINFO_R_OK)
893 ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
894 if (ret != PMINFO_R_OK) {
895 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
898 printf("pkg author name: %s\n", author_name);
899 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
904 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
907 * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
908 * @brief This API gets the package's author email from the package ID
910 * @par This API is for package-manager client application
911 * @par Sync (or) Async : Synchronous API
913 * @param[in] handle pointer to package info handle
914 * @param[out] author_email pointer to hold package author email
915 * @return 0 if success, error code(<0) if fail
916 * @retval PMINFO_R_OK success
917 * @retval PMINFO_R_EINVAL invalid argument
918 * @retval PMINFO_R_ERROR internal error
919 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
920 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
921 * @see pkgmgrinfo_pkginfo_get_pkgid()
922 * @see pkgmgrinfo_pkginfo_is_removable()
924 static int get_pkg_author_email(const char *pkgid)
927 char *author_email = NULL;
928 pkgmgrinfo_pkginfo_h handle;
929 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
930 if (ret != PMINFO_R_OK)
932 ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
933 if (ret != PMINFO_R_OK) {
934 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
937 printf("pkg author email: %s\n", author_email);
938 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
943 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
946 * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
947 * @brief This API gets the package's author href from the package ID
949 * @par This API is for package-manager client application
950 * @par Sync (or) Async : Synchronous API
952 * @param[in] handle pointer to package info handle
953 * @param[out] author_href pointer to hold package author href
954 * @return 0 if success, error code(<0) if fail
955 * @retval PMINFO_R_OK success
956 * @retval PMINFO_R_EINVAL invalid argument
957 * @retval PMINFO_R_ERROR internal error
958 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
959 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
960 * @see pkgmgrinfo_pkginfo_get_pkgid()
961 * @see pkgmgrinfo_pkginfo_is_removable()
963 static int get_pkg_author_href(const char *pkgid)
966 char *author_href = NULL;
967 pkgmgrinfo_pkginfo_h handle;
968 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
969 if (ret != PMINFO_R_OK)
971 ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
972 if (ret != PMINFO_R_OK) {
973 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
976 printf("pkg author href: %s\n", author_href);
977 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
982 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
985 * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
986 * @brief This API gets the package installed storagae value from the package ID
988 * @par This API is for package-manager client application
989 * @par Sync (or) Async : Synchronous API
991 * @param[in] handle pointer to package info handle
992 * @param[out] storage pointer to hold package installed storage
993 * @return 0 if success, error code(<0) if fail
994 * @retval PMINFO_R_OK success
995 * @retval PMINFO_R_EINVAL invalid argument
996 * @retval PMINFO_R_ERROR internal error
997 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
998 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
999 * @see pkgmgrinfo_pkginfo_get_pkgid()
1000 * @see pkgmgrinfo_pkginfo_is_removable()
1002 static int get_pkg_installed_storage(const char *pkgid)
1005 pkgmgrinfo_installed_storage storage;
1006 pkgmgrinfo_pkginfo_h handle;
1007 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1008 if (ret != PMINFO_R_OK)
1010 ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1011 if (ret != PMINFO_R_OK) {
1012 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1015 printf("pkg installed storage: %d\n", storage);
1016 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1021 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1024 * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1025 * @brief This API gets the installed time of package from the package ID
1027 * @par This API is for package-manager client application
1028 * @par Sync (or) Async : Synchronous API
1030 * @param[in] handle pointer to package info handle
1031 * @param[out] installed_time pointer to hold installed time of package
1032 * @return 0 if success, error code(<0) if fail
1033 * @retval PMINFO_R_OK success
1034 * @retval PMINFO_R_EINVAL invalid argument
1035 * @retval PMINFO_R_ERROR internal error
1036 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1037 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1038 * @see pkgmgrinfo_pkginfo_get_pkgid()
1039 * @see pkgmgrinfo_pkginfo_is_removable()
1041 static int get_pkg_installed_time(const char *pkgid)
1044 int installed_time = 0;
1045 pkgmgrinfo_pkginfo_h handle;
1046 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1047 if (ret != PMINFO_R_OK)
1049 ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1050 if (ret != PMINFO_R_OK) {
1051 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1054 printf("installed_time: %d\n", installed_time);
1055 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1060 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1063 * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1064 * @brief This API creates the update info handle
1066 * @par This API is for package-manager client application
1067 * @par Sync (or) Async : Synchronous API
1069 * @param[out] handle pointer to package update info handle
1070 * @return 0 if success, error code(<0) if fail
1071 * @retval PMINFO_R_OK success
1072 * @retval PMINFO_R_EINVAL invalid argument
1073 * @retval PMINFO_R_ERROR internal error
1074 * @post pkgmgrinfo_updateinfo_destroy()
1075 * @see pkgmgrinfo_updateinfo_set_pkgid()
1076 * @see pkgmgrinfo_updateinfo_set_version()
1077 * @see pkgmgrinfo_updateinfo_set_type()
1078 * @see pkgmgr_client_register_pkg_updateinfo()
1080 static int updateinfo_handle_create()
1084 pkgmgrinfo_updateinfo_h handle;
1085 ret = pkgmgrinfo_updateinfo_create(&handle);
1086 if (ret != PMINFO_R_OK)
1088 pkgmgrinfo_update_infodestroy(handle);
1093 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1096 * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1097 * @brief This API destroy the update info handle
1099 * @par This API is for package-manager client application
1100 * @par Sync (or) Async : Synchronous API
1102 * @param[in] handle pointer to package update info handle
1103 * @return 0 if success, error code(<0) if fail
1104 * @retval PMINFO_R_OK success
1105 * @retval PMINFO_R_EINVAL invalid argument
1106 * @pre pkgmgrinfo_updateinfo_create()
1107 * @see pkgmgr_client_register_pkg_updateinfo()
1109 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1113 ret = pkgmgrinfo_updateinfo_destroy(handle);
1114 if (ret != PMINFO_R_OK)
1120 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1123 * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1124 * @brief This API creates the package update information handle from db
1126 * @par This API is for package-manager client application
1127 * @par Sync (or) Async : Synchronous API
1129 * @param[in] pkgid pointer to package ID
1130 * @param[in] uid the addressee user id of the instruction
1131 * @param[out] update_handle pointer to the package update info handle.
1132 * @return 0 if success, error code(<0) if fail
1133 * @retval PMINFO_R_OK success
1134 * @retval PMINFO_R_EINVAL invalid argument
1135 * @retval PMINFO_R_ERROR internal error
1137 * @post pkgmgrinfo_updateinfo_destroy()
1138 * @see pkgmgrinfo_updateinfo_get_pkgid()
1139 * @see pkgmgrinfo_updateinfo_get_version()
1140 * @see pkgmgrinfo_updateinfo_get_update_type()
1142 static int get_pkg_update_info(const char *pkgid)
1146 pkgmgrinfo_updateinfo_h handle;
1147 ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1148 if (ret != PMINFO_R_OK)
1150 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1151 if (ret != PMINFO_R_OK) {
1152 pkgmgrinfo_updateinfo_destroy(handle);
1155 printf("pkg update version: %s\n", version
1156 pkgmgrinfo_updateinfo_destroy(handle);
1161 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1162 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1165 * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1166 * @brief This API sets given pkgid into handle
1168 * @par This API is for package-manager client application
1169 * @par Sync (or) Async : Synchronous API
1171 * @param[in] handle pointer to package update info handle
1172 * @param[in] pkgid package id
1173 * @return 0 if success, error code(<0) if fail
1174 * @retval PMINFO_R_OK success
1175 * @retval PMINFO_R_EINVAL invalid argument
1176 * @retval PMINFO_R_ERROR internal error
1178 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1182 ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1183 if (ret != PMINFO_R_OK)
1189 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1192 * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1193 * @brief This API sets given version into handle
1195 * @par This API is for package-manager client application
1196 * @par Sync (or) Async : Synchronous API
1198 * @param[in] handle pointer to package update info handle
1199 * @param[in] version update version
1200 * @return 0 if success, error code(<0) if fail
1201 * @retval PMINFO_R_OK success
1202 * @retval PMINFO_R_EINVAL invalid argument
1203 * @retval PMINFO_R_ERROR internal error
1205 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1209 ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1210 if (ret != PMINFO_R_OK)
1216 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1219 * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1220 * @brief This API sets given update type into handle
1222 * @par This API is for package-manager client application
1223 * @par Sync (or) Async : Synchronous API
1225 * @param[in] handle pointer to package update info handle
1226 * @param[in] type update type
1227 * @return 0 if success, error code(<0) if fail
1228 * @retval PMINFO_R_OK success
1229 * @retval PMINFO_R_EINVAL invalid argument
1230 * @retval PMINFO_R_ERROR internal error
1232 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1236 ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1237 if (ret != PMINFO_R_OK)
1243 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1246 * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1247 * @brief This API retrieves the pkgid from given update info
1249 * @par This API is for package-manager client application
1250 * @par Sync (or) Async : Synchronous API
1252 * @param[in] handle pointer to package update info handle
1253 * @param[out] pkgid package id
1254 * @return 0 if success, error code(<0) if fail
1255 * @retval PMINFO_R_OK success
1256 * @retval PMINFO_R_EINVAL invalid argument
1257 * @retval PMINFO_R_ERROR internal error
1259 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1264 ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1265 if (ret != PMINFO_R_OK)
1271 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1274 * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1275 * @brief This API retrieves the version from given update info
1277 * @par This API is for package-manager client application
1278 * @par Sync (or) Async : Synchronous API
1280 * @param[in] handle pointer to package update info handle
1281 * @param[out] version update version
1282 * @return 0 if success, error code(<0) if fail
1283 * @retval PMINFO_R_OK success
1284 * @retval PMINFO_R_EINVAL invalid argument
1285 * @retval PMINFO_R_ERROR internal error
1287 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1292 ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1293 if (ret != PMINFO_R_OK)
1299 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1302 * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1303 * @brief This API retrieves the update type from given update info
1305 * @par This API is for package-manager client application
1306 * @par Sync (or) Async : Synchronous API
1308 * @param[in] handle pointer to package update info handle
1309 * @param[out] type update type
1310 * @return 0 if success, error code(<0) if fail
1311 * @retval PMINFO_R_OK success
1312 * @retval PMINFO_R_EINVAL invalid argument
1313 * @retval PMINFO_R_ERROR internal error
1315 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1318 pkgmgrinfo_updateinfo_update_type *type;
1320 ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1321 if (ret != PMINFO_R_OK)
1327 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1331 * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1332 * @brief This API retrieve the update informations and invoke given callback for it.
1334 * @par This API is for package-manager client application
1335 * @par Sync (or) Async : Synchronous API
1337 * @param[in] callback callback to be invoked for each retrieved informations
1338 * @param[in] user_data user data to be passed to callback
1339 * @return 0 if success, error code(<0) if fail
1340 * @retval PMINFO_R_OK success
1341 * @retval PMINFO_R_EINVAL invalid argument
1342 * @retval PMINFO_R_ERROR internal error
1344 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1348 ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1349 if (ret != PMINFO_R_OK)
1355 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1356 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1359 * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1360 * @brief This API checkes whether given plugin had been executed with given package ID and application ID or not.
1362 * @par This API is for package-manager client application
1363 * @par Sync (or) Async : Synchronous API
1365 * @param[in] pkgid package ID
1366 * @param[in] appid application ID
1367 * @param[in] plugin_type plugin type to be checked
1368 * @param[in] plugin_name plugin name to be checked
1369 * @param[out] is_executed check result
1370 * @return 0 if success, error code(<0) if fail
1371 * @retval PMINFO_R_OK success
1372 * @retval PMINFO_R_EINVAL invalid argument
1373 * @retval PMINFO_R_ERROR internal error
1375 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1380 ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1381 if (ret != PMINFO_R_OK)
1383 printf("is checked is [%d]\n", is_executed);
1388 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1389 const char *plugin_type, const char *plugin_name, bool *is_executed);
1392 * @fn int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1393 * @brief This API retrieve the previous plugin execution info and invoke callbacks each of it.
1395 * @par This API is for package-manager client application
1396 * @par Sync (or) Async : Synchronous API
1398 * @param[in] pkgid package ID
1399 * @param[in] plugin_type type of plugin
1400 * @param[in] plugin_name name of plugin
1401 * @param[in] plugin_list_cb callback to be invoked for each plugin execution info
1402 * @param[out] user_data user data to be passed to callback
1403 * @return 0 if success, error code(<0) if fail
1404 * @retval PMINFO_R_OK success
1405 * @retval PMINFO_R_EINVAL invalid argument
1406 * @retval PMINFO_R_ERROR internal error
1408 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1412 ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1413 if (ret != PMINFO_R_OK)
1419 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1420 const char *plugin_type, const char *plugin_name,
1421 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1424 * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1425 * @brief This API gets the launch mode of package from the package ID
1427 * @par This API is for package-manager client application
1428 * @par Sync (or) Async : Synchronous API
1430 * @param[in] handle pointer to package info handle
1431 * @param[out] mode pointer to hold launch mode of package
1432 * @return 0 if success, error code(<0) if fail
1433 * @retval PMINFO_R_OK success
1434 * @retval PMINFO_R_EINVAL invalid argument
1435 * @retval PMINFO_R_ERROR internal error
1436 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1437 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1438 * @see pkgmgrinfo_pkginfo_get_pkgid()
1439 * @see pkgmgrinfo_pkginfo_is_removable()
1441 static int get_pkg_launch_mode(const char *pkgid)
1444 char *launch_mode = NULL;
1445 pkgmgrinfo_pkginfo_h handle;
1446 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1447 if (ret != PMINFO_R_OK)
1449 ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1450 if (ret != PMINFO_R_OK) {
1451 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454 printf("launch mode: %s\n", mode);
1455 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1460 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1463 * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1464 * @brief This API gets the store client id of package from the package ID
1466 * @par This API is for package-manager client application
1467 * @par Sync (or) Async : Synchronous API
1469 * @param[in] handle pointer to package info handle
1470 * @param[out] storeclientid pointer to hold store client id of package
1471 * @return 0 if success, error code(<0) if fail
1472 * @retval PMINFO_R_OK success
1473 * @retval PMINFO_R_EINVAL invalid argument
1474 * @retval PMINFO_R_ERROR internal error
1475 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1476 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1477 * @see pkgmgrinfo_pkginfo_get_pkgid()
1478 * @see pkgmgrinfo_pkginfo_is_removable()
1480 static int get_pkg_storeclientid(const char *pkgid)
1483 char *storeclientid = 0;
1484 pkgmgrinfo_pkginfo_h handle;
1485 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1486 if (ret != PMINFO_R_OK)
1488 ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1489 if (ret != PMINFO_R_OK) {
1490 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493 printf(store client id: %s\n", storeclientid);
1494 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1499 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1502 * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1503 * @brief This API gets the main app id of package from the package ID
1505 * @par This API is for package-manager client application
1506 * @par Sync (or) Async : Synchronous API
1508 * @param[in] handle pointer to package info handle
1509 * @param[out] mainappid pointer to hold main app id of package
1510 * @return 0 if success, error code(<0) if fail
1511 * @retval PMINFO_R_OK success
1512 * @retval PMINFO_R_EINVAL invalid argument
1513 * @retval PMINFO_R_ERROR internal error
1514 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1515 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1516 * @see pkgmgrinfo_pkginfo_get_pkgid()
1517 * @see pkgmgrinfo_pkginfo_is_removable()
1519 static int get_pkg_mainappid(const char *pkgid)
1522 char *mainappid = 0;
1523 pkgmgrinfo_pkginfo_h handle;
1524 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1525 if (ret != PMINFO_R_OK)
1527 ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1528 if (ret != PMINFO_R_OK) {
1529 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1532 printf(main app id: %s\n", mainappid);
1533 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1538 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1541 * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1542 * @brief This API gets the url of package from the package ID
1544 * @par This API is for package-manager client application
1545 * @par Sync (or) Async : Synchronous API
1547 * @param[in] handle pointer to package info handle
1548 * @param[out] url pointer to hold url of package
1549 * @return 0 if success, error code(<0) if fail
1550 * @retval PMINFO_R_OK success
1551 * @retval PMINFO_R_EINVAL invalid argument
1552 * @retval PMINFO_R_ERROR internal error
1553 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1554 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1555 * @see pkgmgrinfo_pkginfo_get_pkgid()
1556 * @see pkgmgrinfo_pkginfo_is_removable()
1558 static int get_pkg_url(const char *pkgid)
1562 pkgmgrinfo_pkginfo_h handle;
1563 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1564 if (ret != PMINFO_R_OK)
1566 ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1567 if (ret != PMINFO_R_OK) {
1568 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571 printf("url : %s\n", url);
1572 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1577 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1580 * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1581 * @brief This API gets the root path of package
1583 * @par Sync (or) Async : Synchronous API
1585 * @param[in] handle pointer to package info handle
1586 * @param[out] path pointer to hold root path of package
1587 * @return 0 if success, error code(<0) if fail
1588 * @retval PMINFO_R_OK success
1589 * @retval PMINFO_R_EINVAL invalid argument
1590 * @retval PMINFO_R_ERROR internal error
1592 static int get_root_path(const char *pkgid)
1596 pkgmgrinfo_pkginfo_h handle;
1597 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1598 if (ret != PMINFO_R_OK)
1601 ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1602 if (ret != PMINFO_R_OK) {
1603 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1606 printf("path : %s\n", path);
1607 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1613 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1617 * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1618 * @brief This API gets the csc path of package
1620 * @par Sync (or) Async : Synchronous API
1622 * @param[in] handle pointer to package info handle
1623 * @param[out] path pointer to hold csc path of package
1624 * @return 0 if success, error code(<0) if fail
1625 * @retval PMINFO_R_OK success
1626 * @retval PMINFO_R_EINVAL invalid argument
1627 * @retval PMINFO_R_ERROR internal error
1629 static int get_csc_path(const char *pkgid)
1633 pkgmgrinfo_pkginfo_h handle;
1634 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1635 if (ret != PMINFO_R_OK)
1638 ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1639 if (ret != PMINFO_R_OK) {
1640 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643 printf("path : %s\n", path);
1644 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1650 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1653 * @fn int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type)
1654 * @brief This API gets the resource type of package
1656 * @par Sync (or) Async : Synchronous API
1658 * @param[in] handle pointer to package info handle
1659 * @param[out] res_type pointer to hold resource type of package
1660 * @return 0 if success, error code(<0) if fail
1661 * @retval PMINFO_R_OK success
1662 * @retval PMINFO_R_EINVAL invalid argument
1663 * @retval PMINFO_R_ERROR internal error
1665 static int get_res_type(const char *pkgid)
1669 pkgmgrinfo_pkginfo_h handle;
1670 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1671 if (ret != PMINFO_R_OK)
1674 ret = pkgmgrinfo_pkginfo_get_res_type(handle, &res_type);
1675 if (ret != PMINFO_R_OK) {
1676 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679 printf("res_type : %s\n", res_type);
1680 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1686 int pkgmgrinfo_pkginfo_get_res_type(pkgmgrinfo_pkginfo_h handle, char **res_type);
1689 * @fn int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version)
1690 * @brief This API gets the resource version of package
1692 * @par Sync (or) Async : Synchronous API
1694 * @param[in] handle pointer to package info handle
1695 * @param[out] res_version pointer to hold resource version of package
1696 * @return 0 if success, error code(<0) if fail
1697 * @retval PMINFO_R_OK success
1698 * @retval PMINFO_R_EINVAL invalid argument
1699 * @retval PMINFO_R_ERROR internal error
1701 static int get_res_version(const char *pkgid)
1704 char *res_version = 0;
1705 pkgmgrinfo_pkginfo_h handle;
1706 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1707 if (ret != PMINFO_R_OK)
1710 ret = pkgmgrinfo_pkginfo_get_res_version(handle, &res_version);
1711 if (ret != PMINFO_R_OK) {
1712 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1715 printf("res_version : %s\n", res_version);
1716 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1722 int pkgmgrinfo_pkginfo_get_res_version(pkgmgrinfo_pkginfo_h handle, char **res_version);
1725 * @fn int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode)
1726 * @brief This API gets the light_user_switch_mode of package
1728 * @par Sync (or) Async : Synchronous API
1730 * @param[in] handle pointer to package info handle
1731 * @param[out] mode pointer to hold resource version of package
1732 * @return 0 if success, error code(<0) if fail
1733 * @retval PMINFO_R_OK success
1734 * @retval PMINFO_R_EINVAL invalid argument
1735 * @retval PMINFO_R_ERROR internal error
1737 static int get_light_user_switch_mode(const char *pkgid)
1741 pkgmgrinfo_pkginfo_h handle;
1742 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1743 if (ret != PMINFO_R_OK)
1746 ret = pkgmgrinfo_pkginfo_get_light_user_switch_mode(handle, &mode);
1747 if (ret != PMINFO_R_OK) {
1748 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1751 printf("light_user_switch_mode : %s\n", mode);
1752 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1758 int pkgmgrinfo_pkginfo_get_light_user_switch_mode(pkgmgrinfo_pkginfo_h handle, char **mode);
1761 * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1762 * @brief This API gets the support_mode of package
1764 * @par Sync (or) Async : Synchronous API
1766 * @param[in] handle pointer to package info handle
1767 * @param[out] support_mode pointer to hold support_mode of package
1768 * @return 0 if success, error code(<0) if fail
1769 * @retval PMINFO_R_OK success
1770 * @retval PMINFO_R_EINVAL invalid argument
1771 * @retval PMINFO_R_ERROR internal error
1773 static int get_support_mode(const char *pkgid)
1776 int support_mode = 0;
1777 pkgmgrinfo_pkginfo_h handle = NULL;
1778 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1779 if (ret != PMINFO_R_OK)
1782 ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1783 if (ret != PMINFO_R_OK) {
1784 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1787 printf("support_mode : %s\n", support_mode);
1788 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1794 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1797 * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1798 * @brief This API compare the cert information from given package id
1800 * @par This API is for package-manager client application
1801 * @par Sync (or) Async : Synchronous API
1803 * @param[in] lhs_package_id pointer to first package ID
1804 * @param[in] rhs_package_id pointer to second package ID
1805 * @param[out] compare_result pointer to the compare result.
1806 * @return 0 if success, error code(<0) if fail
1807 * @retval PMINFO_R_OK success
1808 * @retval PMINFO_R_EINVAL invalid argument
1809 * @retval PMINFO_R_ERROR internal error
1811 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1812 * @see pkgmgrinfo_pkginfo_get_pkgid()
1813 * @see pkgmgrinfo_pkginfo_is_removable()
1815 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1818 pkgmgrinfo_cert_compare_result_type_e result;
1820 ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1821 if (ret != PMINFO_R_OK) {
1824 printf("result: %d\n", result);
1829 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1830 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1832 * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1833 * @brief This API compare the cert information from given app id
1835 * @par This API is for package-manager client application
1836 * @par Sync (or) Async : Synchronous API
1838 * @param[in] lhs_app_id pointer to first app ID
1839 * @param[in] rhs_app_id pointer to second app ID
1840 * @param[out] compare_result pointer to the compare result.
1841 * @return 0 if success, error code(<0) if fail
1842 * @retval PMINFO_R_OK success
1843 * @retval PMINFO_R_EINVAL invalid argument
1844 * @retval PMINFO_R_ERROR internal error
1846 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1847 * @see pkgmgrinfo_pkginfo_get_pkgid()
1848 * @see pkgmgrinfo_pkginfo_is_removable()
1850 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1853 pkgmgrinfo_cert_compare_result_type_e result;
1855 ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1856 if (ret != PMINFO_R_OK) {
1859 printf("result: %d\n", result);
1864 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1865 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1867 * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1868 * @brief This API gets the package 'removable' value from the package ID
1870 * @par This API is for package-manager client application
1871 * @par Sync (or) Async : Synchronous API
1873 * @param[in] handle pointer to package info handle
1874 * @param[out] removable pointer to hold package removable value
1875 * @return 0 if success, error code(<0) if fail
1876 * @retval PMINFO_R_OK success
1877 * @retval PMINFO_R_EINVAL invalid argument
1878 * @retval PMINFO_R_ERROR internal error
1879 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1880 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1881 * @see pkgmgrinfo_pkginfo_get_pkgid()
1882 * @see pkgmgrinfo_pkginfo_is_readonly()
1884 static int get_pkg_removable(const char *pkgid)
1888 pkgmgrinfo_pkginfo_h handle;
1889 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1890 if (ret != PMINFO_R_OK)
1892 ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1893 if (ret != PMINFO_R_OK) {
1894 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1897 printf("pkg removable: %d\n", removable);
1898 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1903 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1906 * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1907 * @brief This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1909 * @par This API is for package-manager client application
1910 * @par Sync (or) Async : Synchronous API
1912 * @param[in] handle pointer to package info handle
1913 * @param[out] movable pointer to hold package movable state
1914 * @return 0 if success, error code(<0) if fail
1915 * @retval PMINFO_R_OK success
1916 * @retval PMINFO_R_EINVAL invalid argument
1917 * @retval PMINFO_R_ERROR internal error
1918 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1919 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1920 * @see pkgmgrinfo_pkginfo_get_pkgid()
1922 static int get_pkg_movable(const char *pkgid)
1926 pkgmgrinfo_pkginfo_h handle;
1927 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1928 if (ret != PMINFO_R_OK)
1930 ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1931 if (ret != PMINFO_R_OK) {
1932 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1935 printf("pkg movable: %d\n", movable);
1936 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1941 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1944 * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1945 * @brief This API gets the package 'preload' value from the package ID
1947 * @par This API is for package-manager client application
1948 * @par Sync (or) Async : Synchronous API
1950 * @param[in] handle pointer to package info handle
1951 * @param[out] preload pointer to hold package preload value
1952 * @return 0 if success, error code(<0) if fail
1953 * @retval PMINFO_R_OK success
1954 * @retval PMINFO_R_EINVAL invalid argument
1955 * @retval PMINFO_R_ERROR internal error
1956 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1957 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1958 * @see pkgmgrinfo_pkginfo_get_pkgid()
1959 * @see pkgmgrinfo_pkginfo_is_readonly()
1961 static int get_pkg_preload(const char *pkgid)
1965 pkgmgrinfo_pkginfo_h handle;
1966 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1967 if (ret != PMINFO_R_OK)
1969 ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1970 if (ret != PMINFO_R_OK) {
1971 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1974 printf("pkg preload: %d\n", preload);
1975 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1980 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1983 * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1984 * @brief This API gets the value for given handle is system or not
1986 * @par This API is for package-manager client application
1987 * @par Sync (or) Async : Synchronous API
1989 * @param[in] handle pointer to package info handle
1990 * @param[out] system pointer to hold system is or not
1991 * @return 0 if success, error code(<0) if fail
1992 * @retval PMINFO_R_OK success
1993 * @retval PMINFO_R_EINVAL invalid argument
1994 * @retval PMINFO_R_ERROR internal error
1995 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
1996 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
1997 * @see pkgmgrinfo_pkginfo_get_pkgid()
1998 * @see pkgmgrinfo_pkginfo_is_readonly()
2000 static int get_pkg_system(const char *pkgid)
2003 bool system = false;
2004 pkgmgrinfo_pkginfo_h handle = NULL;
2005 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2006 if (ret != PMINFO_R_OK)
2008 ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
2009 if (ret != PMINFO_R_OK) {
2010 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2013 printf("pkg system: %d\n", system);
2014 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2019 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
2022 * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
2023 * @brief This API gets the package 'readonly' value from the package ID
2025 * @par This API is for package-manager client application
2026 * @par Sync (or) Async : Synchronous API
2028 * @param[in] handle pointer to package info handle
2029 * @param[out] readonly pointer to hold package readonly value
2030 * @return 0 if success, error code(<0) if fail
2031 * @retval PMINFO_R_OK success
2032 * @retval PMINFO_R_EINVAL invalid argument
2033 * @retval PMINFO_R_ERROR internal error
2034 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2035 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2036 * @see pkgmgrinfo_pkginfo_get_pkgid()
2037 * @see pkgmgrinfo_pkginfo_is_removable()
2039 static int get_pkg_readonly(const char *pkgid)
2043 pkgmgrinfo_pkginfo_h handle;
2044 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2045 if (ret != PMINFO_R_OK)
2047 ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
2048 if (ret != PMINFO_R_OK) {
2049 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2052 printf("pkg readonly: %d\n", readonly);
2053 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2058 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
2062 * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
2063 * @brief This API gets the package 'update' value from the package ID
2065 * @par This API is for package-manager client application
2066 * @par Sync (or) Async : Synchronous API
2068 * @param[in] handle pointer to package info handle
2069 * @param[out] update pointer to hold package update value
2070 * @return 0 if success, error code(<0) if fail
2071 * @retval PMINFO_R_OK success
2072 * @retval PMINFO_R_EINVAL invalid argument
2073 * @retval PMINFO_R_ERROR internal error
2074 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2075 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2076 * @see pkgmgrinfo_pkginfo_get_pkgid()
2078 static int get_pkg_update(const char *pkgid)
2082 pkgmgrinfo_pkginfo_h handle;
2083 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2084 if (ret != PMINFO_R_OK)
2086 ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
2087 if (ret != PMINFO_R_OK) {
2088 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2091 printf("pkg update: %d\n", update);
2092 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2097 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
2100 * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
2101 * @brief This API gets the package 'support_disable' value from the package ID
2103 * @par This API is for package-manager client application
2104 * @par Sync (or) Async : Synchronous API
2106 * @param[in] handle pointer to package info handle
2107 * @param[out] support_disable pointer to hold package support_disable value
2108 * @return 0 if success, error code(<0) if fail
2109 * @retval PMINFO_R_OK success
2110 * @retval PMINFO_R_EINVAL invalid argument
2111 * @retval PMINFO_R_ERROR internal error
2112 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2113 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2114 * @see pkgmgrinfo_pkginfo_get_pkgid()
2116 static int get_pkg_support_disable(const char *pkgid)
2119 bool support_disable;
2120 pkgmgrinfo_pkginfo_h handle = NULL;
2121 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2122 if (ret != PMINFO_R_OK)
2124 ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2125 if (ret != PMINFO_R_OK) {
2126 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2129 printf("pkg support_disable: %d\n", support_disable);
2130 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2138 * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2139 * @brief This API gets whether the given package is global package or user package
2141 * @par This API is for package-manager client application
2142 * @par Sync (or) Async : Synchronous API
2144 * @param[in] handle pointer to package info handle
2145 * @param[in] global pointer to hold package global value
2146 * @return 0 if success, error code(<0) if fail
2147 * @retval PMINFO_R_OK success
2148 * @retval PMINFO_R_EINVAL invalid argument
2149 * @retval PMINFO_R_ERROR internal error
2150 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2151 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2152 * @see pkgmgrinfo_pkginfo_get_pkgid()
2153 static int get_pkg_support_disable(const char *pkgid)
2157 pkgmgrinfo_pkginfo_h handle = NULL;
2158 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2159 if (ret != PMINFO_R_OK)
2161 ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2162 if (ret != PMINFO_R_OK) {
2163 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2166 printf("pkg is_global: %d\n", global);
2167 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2172 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2175 * @fn int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib)
2176 * @brief This API gets whether the given package is lib resource package or not
2178 * @par This API is for package-manager client application
2179 * @par Sync (or) Async : Synchronous API
2181 * @param[in] handle pointer to package info handle
2182 * @param[in] global pointer to hold package global value
2183 * @return 0 if success, error code(<0) if fail
2184 * @retval PMINFO_R_OK success
2185 * @retval PMINFO_R_EINVAL invalid argument
2186 * @retval PMINFO_R_ERROR internal error
2187 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2188 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2189 * @see pkgmgrinfo_pkginfo_get_pkgid()
2190 static int get_pkg_is_lib(const char *pkgid)
2194 pkgmgrinfo_pkginfo_h handle = NULL;
2195 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2196 if (ret != PMINFO_R_OK)
2198 ret = pkgmgrinfo_pkginfo_is_lib(handle, &lib);
2199 if (ret != PMINFO_R_OK) {
2200 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2203 printf("pkg lib: %d\n", lib);
2204 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2209 int pkgmgrinfo_pkginfo_is_lib(pkgmgrinfo_pkginfo_h handle, bool *lib);
2212 * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2213 * @brief This API gets the package 'accessible' value from the package ID
2215 * @par This API is for package-manager client application
2216 * @par Sync (or) Async : Synchronous API
2218 * @param[in] handle pointer to package info handle
2219 * @param[out] accessible pointer to hold package accessible value
2220 * @return 0 if success, error code(<0) if fail
2221 * @retval PMINFO_R_OK success
2222 * @retval PMINFO_R_EINVAL invalid argument
2223 * @retval PMINFO_R_ERROR internal error
2224 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2225 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2226 * @see pkgmgrinfo_pkginfo_get_pkgid()
2227 * @see pkgmgrinfo_pkginfo_is_readonly()
2229 static int get_pkg_accessible(const char *pkgid)
2233 pkgmgrinfo_pkginfo_h handle;
2234 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2235 if (ret != PMINFO_R_OK)
2237 ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2238 if (ret != PMINFO_R_OK) {
2239 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2242 printf("pkg accessible: %d\n", accessible);
2243 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2248 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2251 * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2252 * @brief This API destroys the package information handle freeing up all the resources
2254 * @par This API is for package-manager client application
2255 * @par Sync (or) Async : Synchronous API
2257 * @param[in] handle pointer to the package info handle
2258 * @return 0 if success, error code(<0) if fail
2259 * @retval PMINFO_R_OK success
2260 * @retval PMINFO_R_EINVAL invalid argument
2261 * @retval PMINFO_R_ERROR internal error
2262 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2264 * @see pkgmgrinfo_pkginfo_get_pkgid()
2265 * @see pkgmgrinfo_pkginfo_is_removable()
2267 static int get_pkg_type(const char *pkgid)
2271 pkgmgrinfo_pkginfo_h handle;
2272 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2273 if (ret != PMINFO_R_OK)
2275 ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2276 if (ret != PMINFO_R_OK) {
2277 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2280 printf("pkgtype: %s\n", type);
2281 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2286 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2289 * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2290 * @brief This API creates the package information filter handle from db. All filter properties will be ANDed.
2291 The query will search the entire package information collected from the manifest file of all the installed packages
2293 * @par This API is for package-manager client application
2294 * @par Sync (or) Async : Synchronous API
2296 * @param[out] handle pointer to the package info filter handle.
2297 * @return 0 if success, error code(<0) if fail
2298 * @retval PMINFO_R_OK success
2299 * @retval PMINFO_R_EINVAL invalid argument
2300 * @retval PMINFO_R_ERROR internal error
2302 * @post pkgmgrinfo_pkginfo_filter_destroy()
2303 * @see pkgmgrinfo_pkginfo_filter_count()
2304 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2306 static int get_tpk_pkg_count()
2310 pkgmgrinfo_pkginfo_filter_h handle;
2311 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2312 if (ret != PMINFO_R_OK)
2314 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2315 if (ret != PMINFO_R_OK) {
2316 pkgmgrinfo_pkginfo_filter_destroy(handle);
2319 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2320 if (ret != PMINFO_R_OK) {
2321 pkgmgrinfo_pkginfo_filter_destroy(handle);
2324 printf("No of tpk pkgs: %d\n", count);
2325 pkgmgrinfo_pkginfo_filter_destroy(handle);
2330 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2333 * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2334 * @brief This API destroys the package information filter handle freeing up all the resources
2336 * @par This API is for package-manager client application
2337 * @par Sync (or) Async : Synchronous API
2339 * @param[in] handle pointer to the package info filter handle.
2340 * @return 0 if success, error code(<0) if fail
2341 * @retval PMINFO_R_OK success
2342 * @retval PMINFO_R_EINVAL invalid argument
2343 * @retval PMINFO_R_ERROR internal error
2344 * @pre pkgmgrinfo_pkginfo_filter_create()
2346 * @see pkgmgrinfo_pkginfo_filter_count()
2347 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2349 static int get_tpk_pkg_count()
2353 pkgmgrinfo_pkginfo_filter_h handle;
2354 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2355 if (ret != PMINFO_R_OK)
2357 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2358 if (ret != PMINFO_R_OK) {
2359 pkgmgrinfo_pkginfo_filter_destroy(handle);
2362 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2363 if (ret != PMINFO_R_OK) {
2364 pkgmgrinfo_pkginfo_filter_destroy(handle);
2367 printf("No of tpk pkgs: %d\n", count);
2368 pkgmgrinfo_pkginfo_filter_destroy(handle);
2373 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2376 * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2377 * @brief This API adds a boolean filter property to the filter handle
2379 * @par This API is for package-manager client application
2380 * @par Sync (or) Async : Synchronous API
2382 * @param[in] handle pointer to the package info filter handle.
2383 * @param[in] property boolean property name.
2384 * @param[in] value value corresponding to the property.
2385 * @return 0 if success, error code(<0) if fail
2386 * @retval PMINFO_R_OK success
2387 * @retval PMINFO_R_EINVAL invalid argument
2388 * @retval PMINFO_R_ERROR internal error
2389 * @pre pkgmgrinfo_pkginfo_filter_create()
2390 * @post pkgmgrinfo_pkginfo_filter_destroy()
2391 * @see pkgmgrinfo_pkginfo_filter_count()
2392 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2394 static int get_preload_pkg_count()
2398 pkgmgrinfo_pkginfo_filter_h handle;
2399 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2400 if (ret != PMINFO_R_OK)
2402 ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2403 if (ret != PMINFO_R_OK) {
2404 pkgmgrinfo_pkginfo_filter_destroy(handle);
2407 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2408 if (ret != PMINFO_R_OK) {
2409 pkgmgrinfo_pkginfo_filter_destroy(handle);
2412 printf("No of preload pkgs: %d\n", count);
2413 pkgmgrinfo_pkginfo_filter_destroy(handle);
2418 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2419 const char *property, const bool value);
2422 * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2423 * @brief This API adds an integer filter property to the filter handle
2425 * @par This API is for package-manager client application
2426 * @par Sync (or) Async : Synchronous API
2428 * @param[in] handle pointer to the package info filter handle.
2429 * @param[in] property integer property name.
2430 * @param[in] value value corresponding to the property.
2431 * @return 0 if success, error code(<0) if fail
2432 * @retval PMINFO_R_OK success
2433 * @retval PMINFO_R_EINVAL invalid argument
2434 * @retval PMINFO_R_ERROR internal error
2435 * @pre pkgmgrinfo_pkginfo_filter_create()
2436 * @post pkgmgrinfo_pkginfo_filter_destroy()
2437 * @see pkgmgrinfo_pkginfo_filter_count()
2438 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2440 static int get_pkg_count()
2444 pkgmgrinfo_pkginfo_filter_h handle;
2445 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2446 if (ret != PMINFO_R_OK)
2448 ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2449 if (ret != PMINFO_R_OK) {
2450 pkgmgrinfo_pkginfo_filter_destroy(handle);
2453 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2454 if (ret != PMINFO_R_OK) {
2455 pkgmgrinfo_pkginfo_filter_destroy(handle);
2458 printf("No of preload pkgs: %d\n", count);
2459 pkgmgrinfo_pkginfo_filter_destroy(handle);
2464 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2465 const char *property, const int value);
2468 * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2469 * @brief This API adds a string filter property to the filter handle
2471 * @par This API is for package-manager client application
2472 * @par Sync (or) Async : Synchronous API
2474 * @param[in] handle pointer to the package info filter handle.
2475 * @param[in] property string property name.
2476 * @param[in] value value corresponding to the property.
2477 * @return 0 if success, error code(<0) if fail
2478 * @retval PMINFO_R_OK success
2479 * @retval PMINFO_R_EINVAL invalid argument
2480 * @retval PMINFO_R_ERROR internal error
2481 * @pre pkgmgrinfo_pkginfo_filter_create()
2482 * @post pkgmgrinfo_pkginfo_filter_destroy()
2483 * @see pkgmgrinfo_pkginfo_filter_count()
2484 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2486 static int get_tpk_pkg_count()
2490 pkgmgrinfo_pkginfo_filter_h handle;
2491 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2492 if (ret != PMINFO_R_OK)
2494 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2495 if (ret != PMINFO_R_OK) {
2496 pkgmgrinfo_pkginfo_filter_destroy(handle);
2499 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2500 if (ret != PMINFO_R_OK) {
2501 pkgmgrinfo_pkginfo_filter_destroy(handle);
2504 printf("No of tpk pkgs: %d\n", count);
2505 pkgmgrinfo_pkginfo_filter_destroy(handle);
2510 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2511 const char *property, const char *value);
2514 * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2515 * @brief This API executes the user supplied callback function for each package that satisfy the filter conditions
2517 * @par This API is for package-manager client application
2518 * @par Sync (or) Async : Synchronous API
2520 * @param[in] handle pointer to the package info filter handle.
2521 * @param[in] pkg_cb callback function.
2522 * @param[in] user_data user data to be passed to the callback function
2523 * @return 0 if success, error code(<0) if fail
2524 * @retval PMINFO_R_OK success
2525 * @retval PMINFO_R_EINVAL invalid argument
2526 * @retval PMINFO_R_ERROR internal error
2527 * @pre pkgmgrinfo_pkginfo_filter_create()
2528 * @post pkgmgrinfo_pkginfo_filter_destroy()
2529 * @see pkgmgrinfo_pkginfo_filter_count()
2531 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2534 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2535 printf("pkg id : %s\n", pkgid);
2539 static int get_tpk_pkg_list()
2542 pkgmgrinfo_pkginfo_filter_h handle;
2543 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2544 if (ret != PMINFO_R_OK)
2546 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2547 if (ret != PMINFO_R_OK) {
2548 pkgmgrinfo_pkginfo_filter_destroy(handle);
2551 ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2552 if (ret != PMINFO_R_OK) {
2553 pkgmgrinfo_pkginfo_filter_destroy(handle);
2556 pkgmgrinfo_pkginfo_filter_destroy(handle);
2561 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2562 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2563 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2564 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2567 * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2568 * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2569 * @brief This API counts the package that satisfy the filter conditions
2571 * @par This API is for package-manager client application
2572 * @par Sync (or) Async : Synchronous API
2574 * @param[in] handle pointer to the package info filter handle.
2575 * @param[in] count pointer to store the count value.
2576 * @param[in] uid the addressee user id of the instruction
2577 * @return 0 if success, error code(<0) if fail
2578 * @retval PMINFO_R_OK success
2579 * @retval PMINFO_R_EINVAL invalid argument
2580 * @retval PMINFO_R_ERROR internal error
2581 * @pre pkgmgrinfo_pkginfo_filter_create()
2582 * @post pkgmgrinfo_pkginfo_filter_destroy()
2583 * @see pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2585 static int get_tpk_pkg_count()
2589 pkgmgrinfo_pkginfo_filter_h handle;
2590 ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2591 if (ret != PMINFO_R_OK)
2593 ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2594 if (ret != PMINFO_R_OK) {
2595 pkgmgrinfo_pkginfo_filter_destroy(handle);
2598 ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2599 if (ret != PMINFO_R_OK) {
2600 pkgmgrinfo_pkginfo_filter_destroy(handle);
2603 printf("No of tpk pkgs: %d\n", count);
2604 pkgmgrinfo_pkginfo_filter_destroy(handle);
2609 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2610 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2613 * @fn int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2614 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2615 * @brief This API gets the list of privilege for a particular package
2617 * @par This API is for package-manager client application
2618 * @par Sync (or) Async : Synchronous API
2619 * @param[in] handle pointer to the package info handle.
2620 * @param[in] privilege_func callback function for list
2621 * @param[in] user_data user data to be passed to callback function
2622 * @return 0 if success, error code(<0) if fail
2623 * @retval PMINFO_R_OK success
2624 * @retval PMINFO_R_EINVAL invalid argument
2625 * @retval PMINFO_R_ERROR internal error
2626 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2627 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2629 int privilege_func(const char *name, void *user_data)
2631 if (strcmp(name, (char *)user_data) == 0)
2637 static int list_privilege(const char *package, char *privilege)
2640 pkgmgrinfo_pkginfo_h handle;
2641 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2642 if (ret != PMINFO_R_OK)
2644 ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2645 if (ret != PMINFO_R_OK) {
2646 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2649 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2654 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2655 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2658 * @fn int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2659 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2660 * @brief This API gets the list of appdefined privilege for a particular package
2662 * @par This API is for package-manager client application
2663 * @par Sync (or) Async : Synchronous API
2664 * @param[in] handle pointer to the package info handle.
2665 * @param[in] privilege_func callback function for list
2666 * @param[in] user_data user data to be passed to callback function
2667 * @return 0 if success, error code(<0) if fail
2668 * @retval PMINFO_R_OK success
2669 * @retval PMINFO_R_EINVAL invalid argument
2670 * @retval PMINFO_R_ERROR internal error
2671 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2672 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2674 int privilege_func(const char *name, const char *license_path, void *user_data)
2676 printf("appdefined privilege : %s", name);
2678 printf("licensed privilege, lecense path : %s", license_path);
2682 static int list_appdefined_privilege(const char *package)
2685 pkgmgrinfo_pkginfo_h handle;
2686 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2687 if (ret != PMINFO_R_OK)
2689 ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2690 if (ret != PMINFO_R_OK) {
2691 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2694 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2699 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2700 pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2703 * @fn int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2704 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2705 * @brief This API gets the list of plugin execution info for a particular package
2707 * @par This API is for package-manager client application
2708 * @par Sync (or) Async : Synchronous API
2709 * @param[in] handle pointer to the package info handle.
2710 * @param[in] plugin_func callback function for list
2711 * @param[in] user_data user data to be passed to callback function
2712 * @return 0 if success, error code(<0) if fail
2713 * @retval PMINFO_R_OK success
2714 * @retval PMINFO_R_EINVAL invalid argument
2715 * @retval PMINFO_R_ERROR internal error
2716 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2717 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2719 int plugin_func(const char *pkgid, const char *appid,
2720 const char *plugin_type, const char *plugin_name,
2723 printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2728 static int list_plugin(const char *package)
2731 pkgmgrinfo_pkginfo_h handle;
2732 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2733 if (ret != PMINFO_R_OK)
2735 ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2736 if (ret != PMINFO_R_OK) {
2737 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2740 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2745 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2746 pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2749 * @fn int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2750 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2751 * @brief This API gets the list of metadata for a particular package
2753 * @par This API is for package-manager client application
2754 * @par Sync (or) Async : Synchronous API
2755 * @param[in] handle pointer to the package info handle.
2756 * @param[in] metadata_func callback function for list
2757 * @param[in] user_data user data to be passed to callback function
2758 * @return 0 if success, error code(<0) if fail
2759 * @retval PMINFO_R_OK success
2760 * @retval PMINFO_R_EINVAL invalid argument
2761 * @retval PMINFO_R_ERROR internal error
2762 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
2763 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
2765 int metadata_func(const char *key, const char *value, void *user_data)
2767 if (strcmp(key, (char *)user_data) == 0) {
2768 printf("Value is %s\n", value);
2775 static int list_metadata(const char *pkgid, char *key)
2778 pkgmgrinfo_pkginfo_h handle;
2779 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2780 if (ret != PMINFO_R_OK)
2782 ret = pkgmgrinfo_pkginfo_foreach_metadata(handle, metadata_func, (void *)key);
2783 if (ret != PMINFO_R_OK) {
2784 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2787 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2792 int pkgmgrinfo_pkginfo_foreach_metadata(pkgmgrinfo_pkginfo_h handle,
2793 pkgmgrinfo_pkg_metadata_list_cb metadata_func, void *user_data);
2796 * @fn int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle)
2797 * @brief This API creates the application's metadata information filter handle from db.
2799 * @par This API is for package-manager client application
2800 * @par Sync (or) Async : Synchronous API
2802 * @param[out] handle pointer to the package metadata info filter handle.
2803 * @return 0 if success, error code(<0) if fail
2804 * @retval PMINFO_R_OK success
2805 * @retval PMINFO_R_EINVAL invalid argument
2806 * @retval PMINFO_R_ERROR internal error
2808 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
2809 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2811 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2814 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2815 printf("pkgid : %s\n", pkgid);
2819 static int get_pkg_list(const char *mkey, const char *mvalue)
2822 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2823 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2824 if (ret != PMINFO_R_OK)
2826 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2827 if (ret != PMINFO_R_OK) {
2828 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2831 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2832 if (ret != PMINFO_R_OK) {
2833 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2836 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2841 int pkgmgrinfo_pkginfo_metadata_filter_create(pkgmgrinfo_pkginfo_metadata_filter_h *handle);
2844 * @fn int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle)
2845 * @brief This API destroys the package's metadata information filter handle.
2847 * @par This API is for package-manager client application
2848 * @par Sync (or) Async : Synchronous API
2850 * @param[in] handle pointer to the package metadata info filter handle.
2851 * @return 0 if success, error code(<0) if fail
2852 * @retval PMINFO_R_OK success
2853 * @retval PMINFO_R_EINVAL invalid argument
2854 * @retval PMINFO_R_ERROR internal error
2855 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2857 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2859 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2862 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2863 printf("pkgid : %s\n", pkgid);
2867 static int get_pkg_list(const char *mkey, const char *mvalue)
2870 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2871 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2872 if (ret != PMINFO_R_OK)
2874 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2875 if (ret != PMINFO_R_OK) {
2876 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2879 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2880 if (ret != PMINFO_R_OK) {
2881 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2884 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2889 int pkgmgrinfo_pkginfo_metadata_filter_destroy(pkgmgrinfo_pkginfo_metadata_filter_h handle);
2892 * @fn int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle, const char *key, const char *value)
2893 * @brief This API adds filter condition for the query API. The query will search the entire package metadata information collected from
2894 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
2896 * @par This API is for package-manager client application
2897 * @par Sync (or) Async : Synchronous API
2899 * @param[in] handle pointer to the package metadata info filter handle.
2900 * @param[in] key pointer to metadata key
2901 * @param[in] value pointer to metadata value
2902 * @return 0 if success, error code(<0) if fail
2903 * @retval PMINFO_R_OK success
2904 * @retval PMINFO_R_EINVAL invalid argument
2905 * @retval PMINFO_R_ERROR internal error
2906 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2907 * @post pkgmgrinfo_pkginfo_metadata_filter_foreach(), pkgmgrinfo_pkginfo_metadata_filter_destroy()
2908 * @see pkgmgrinfo_pkginfo_metadata_filter_foreach()
2910 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2913 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2914 printf("pkgid : %s\n", pkgid);
2918 static int get_pkg_list(const char *mkey, const char *mvalue)
2921 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2922 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2923 if (ret != PMINFO_R_OK)
2925 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2926 if (ret != PMINFO_R_OK) {
2927 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2930 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2931 if (ret != PMINFO_R_OK) {
2932 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2935 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2940 int pkgmgrinfo_pkginfo_metadata_filter_add(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2941 const char *key, const char *value);
2944 * @fn int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2945 * @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)
2946 * @brief This API executes the filter query. The query will search the entire package metadata information collected from
2947 * the manifest file of all the installed packages. For each package returned by the query, the callback will be called. If callback returns
2948 * negative value, no more callbacks will be called and API will return.
2950 * @par This API is for package-manager client application
2951 * @par Sync (or) Async : Synchronous API
2953 * @param[in] handle pointer to the package metadata info filter handle.
2954 * @param[in] app_cb function pointer to callback
2955 * @param[in] user_data pointer to user data
2956 * @param[in] uid the addressee user id of the instruction
2957 * @return 0 if success, error code(<0) if fail
2958 * @retval PMINFO_R_OK success
2959 * @retval PMINFO_R_EINVAL invalid argument
2960 * @retval PMINFO_R_ERROR internal error
2961 * @pre pkgmgrinfo_pkginfo_metadata_filter_create()
2962 * @post pkgmgrinfo_pkginfo_metadata_filter_destroy()
2964 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2967 pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2968 printf("pkgid : %s\n", pkgid);
2972 static int get_pkg_list(const char *mkey, const char *mvalue)
2975 pkgmgrinfo_pkginfo_metadata_filter_h handle;
2976 ret = pkgmgrinfo_pkginfo_metadata_filter_create(&handle);
2977 if (ret != PMINFO_R_OK)
2979 ret = pkgmgrinfo_pkginfo_metadata_filter_add(handle, mkey, mvalue);
2980 if (ret != PMINFO_R_OK) {
2981 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2984 ret = pkgmgrinfo_pkginfo_metadata_filter_foreach(handle, pkg_list_cb, NULL);
2985 if (ret != PMINFO_R_OK) {
2986 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2989 pkgmgrinfo_pkginfo_metadata_filter_destroy(handle);
2994 int pkgmgrinfo_pkginfo_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2995 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2996 int pkgmgrinfo_pkginfo_usr_metadata_filter_foreach(pkgmgrinfo_pkginfo_metadata_filter_h handle,
2997 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2999 /* TODO: add doxygen comment here */
3000 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
3003 * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
3004 * @brief This API copy the application information handle
3006 * @par This API is for package-manager client application
3007 * @par Sync (or) Async : Synchronous API
3009 * @param[in] handle pointer to the package info handle.
3010 * @param[out] handle pointer to the package info handle.
3011 * @return 0 if success, error code(<0) if fail
3012 * @retval PMINFO_R_OK success
3013 * @retval PMINFO_R_EINVAL invalid argument
3014 * @retval PMINFO_R_ERROR internal error
3016 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3018 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
3022 pkgmgrinfo_pkginfo_h clone;
3024 ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
3025 if (ret != PMINFO_R_OK)
3029 printf("package: %s\n", clone->package);
3030 pkgmgrinfo_appinfo_destroy_appinfo(clone);
3035 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
3039 * @fn int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3040 pkgmgrinfo_app_list_cb app_func, void *user_data)
3041 * @brief This API gets list of installed applications for a particular package
3043 * @par This API is for package-manager client application
3044 * @par Sync (or) Async : Synchronous API
3045 * @param[in] handle package info handle
3046 * @param[in] component application component
3047 * @param[in] app_func iteration function for list
3048 * @param[in] user_data user data to be passed to callback function
3049 * @return 0 if success, error code(<0) if fail
3050 * @retval PMINFO_R_OK success
3051 * @retval PMINFO_R_EINVAL invalid argument
3052 * @retval PMINFO_R_ERROR internal error
3053 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
3054 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
3056 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
3059 pkgmgrinfo_appinfo_get_appid(handle, &appid);
3060 printf("appid : %s\n", appid);
3064 static int list_apps(const char *pkgid)
3067 pkgmgrinfo_pkginfo_h handle;
3068 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
3069 if (ret != PMINFO_R_OK)
3071 ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
3072 if (ret != PMINFO_R_OK) {
3073 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3076 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
3081 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3082 pkgmgrinfo_app_list_cb app_func, void *user_data);
3083 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
3084 pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
3087 * @fn int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3088 * @brief This API gets list of installed applications from all packages.
3090 * @par This API is for package-manager client application
3091 * @par Sync (or) Async : Synchronous API
3092 * @param[in] app_func iteration function for list
3093 * @param[in] user_data user data to be passed to callback function
3094 * @return 0 if success, error code(<0) if fail
3095 * @retval PMINFO_R_OK success
3096 * @retval PMINFO_R_EINVAL invalid argument
3097 * @retval PMINFO_R_ERROR internal error
3101 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
3103 char *pkgid1 = NULL;
3104 char *pkgid2 = NULL;
3105 pkgid1 = (char *)user_data;
3106 pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
3107 if (strcmp(pkgid1, pkgid2) == 0) {
3114 static int list_apps()
3117 char *name = "helloworld";
3118 ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
3119 if (ret != PMINFO_R_OK) {
3126 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
3127 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
3130 * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3131 * @brief This API creates the disabled application information handle from db
3133 * @par This API is for package-manager client application
3134 * @par Sync (or) Async : Synchronous API
3136 * @param[in] appid pointer to appid
3137 * @param[out] handle pointer to the application info handle.
3138 * @return 0 if success, error code(<0) if fail
3139 * @retval PMINFO_R_OK success
3140 * @retval PMINFO_R_EINVAL invalid argument
3141 * @retval PMINFO_R_ERROR internal error
3143 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3144 * @see pkgmgrinfo_appinfo_get_pkgid()
3145 * @see pkgmgrinfo_appinfo_is_multiple()
3147 static int get_disabled_app_type(const char *appid)
3151 pkgmgrinfo_appinfo_h handle;
3152 ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
3153 if (ret != PMINFO_R_OK)
3155 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3156 if (ret != PMINFO_R_OK) {
3157 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3160 printf("apptype: %s\n", type);
3161 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3166 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3167 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3170 * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3171 * @brief This API creates the application information handle from db
3173 * @par This API is for package-manager client application
3174 * @par Sync (or) Async : Synchronous API
3176 * @param[in] appid pointer to appid
3177 * @param[out] handle pointer to the application info handle.
3178 * @return 0 if success, error code(<0) if fail
3179 * @retval PMINFO_R_OK success
3180 * @retval PMINFO_R_EINVAL invalid argument
3181 * @retval PMINFO_R_ERROR internal error
3183 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3184 * @see pkgmgrinfo_appinfo_get_pkgid()
3185 * @see pkgmgrinfo_appinfo_is_multiple()
3187 static int get_app_type(const char *appid)
3191 pkgmgrinfo_appinfo_h handle;
3192 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3193 if (ret != PMINFO_R_OK)
3195 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3196 if (ret != PMINFO_R_OK) {
3197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3200 printf("apptype: %s\n", type);
3201 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3206 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3207 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3210 * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
3211 * @brief This API creates the application information handle from db regardless of its disable or storage status
3213 * @par This API is for package-manager client application
3214 * @par Sync (or) Async : Synchronous API
3216 * @param[in] appid pointer to appid
3217 * @param[out] handle pointer to the application info handle.
3218 * @return 0 if success, error code(<0) if fail
3219 * @retval PMINFO_R_OK success
3220 * @retval PMINFO_R_EINVAL invalid argument
3221 * @retval PMINFO_R_ERROR internal error
3223 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3224 * @see pkgmgrinfo_appinfo_get_pkgid()
3225 * @see pkgmgrinfo_appinfo_is_multiple()
3227 static int get_app_type(const char *appid)
3231 pkgmgrinfo_appinfo_h handle;
3232 ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
3233 if (ret != PMINFO_R_OK)
3235 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
3236 if (ret != PMINFO_R_OK) {
3237 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3240 printf("apptype: %s\n", type);
3241 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3246 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
3247 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
3250 * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
3251 * @brief This API gets the application ID
3253 * @par This API is for package-manager client application
3254 * @par Sync (or) Async : Synchronous API
3256 * @param[in] handle pointer to the application info handle.
3257 * @param[out] appid pointer to hold appid
3258 * @return 0 if success, error code(<0) if fail
3259 * @retval PMINFO_R_OK success
3260 * @retval PMINFO_R_EINVAL invalid argument
3261 * @retval PMINFO_R_ERROR internal error
3262 * @pre pkgmgrinfo_appinfo_get_appinfo()
3263 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3264 * @see pkgmgrinfo_appinfo_get_pkgid()
3265 * @see pkgmgrinfo_appinfo_is_multiple()
3267 static int get_app_id(const char *appid)
3270 char *app_id = NULL;
3271 pkgmgrinfo_appinfo_h handle;
3272 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3273 if (ret != PMINFO_R_OK)
3275 ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
3276 if (ret != PMINFO_R_OK) {
3277 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3280 printf("app id: %s\n", app_id);
3281 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3286 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid);
3289 * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
3290 * @brief This API gets the package name of the application
3292 * @par This API is for package-manager client application
3293 * @par Sync (or) Async : Synchronous API
3295 * @param[in] handle pointer to the application info handle.
3296 * @param[out] pkg_name pointer to hold package name
3297 * @return 0 if success, error code(<0) if fail
3298 * @retval PMINFO_R_OK success
3299 * @retval PMINFO_R_EINVAL invalid argument
3300 * @retval PMINFO_R_ERROR internal error
3301 * @pre pkgmgrinfo_appinfo_get_appinfo()
3302 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3303 * @see pkgmgrinfo_appinfo_get_appid()
3304 * @see pkgmgrinfo_appinfo_is_multiple()
3306 static int get_app_pkgname(const char *appid)
3309 char *pkgname = NULL;
3310 pkgmgrinfo_appinfo_h handle;
3311 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3312 if (ret != PMINFO_R_OK)
3314 ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
3315 if (ret != PMINFO_R_OK) {
3316 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3319 printf("pkg name: %s\n", pkgname);
3320 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3325 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name);
3328 * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
3329 * @brief This API gets the package id of the application
3331 * @par This API is for package-manager client application
3332 * @par Sync (or) Async : Synchronous API
3334 * @param[in] handle pointer to the application info handle.
3335 * @param[out] pkgid pointer to hold package id
3336 * @return 0 if success, error code(<0) if fail
3337 * @retval PMINFO_R_OK success
3338 * @retval PMINFO_R_EINVAL invalid argument
3339 * @retval PMINFO_R_ERROR internal error
3340 * @pre pkgmgrinfo_appinfo_get_appinfo()
3341 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3342 * @see pkgmgrinfo_appinfo_get_appid()
3343 * @see pkgmgrinfo_appinfo_is_multiple()
3345 static int get_app_pkgid(const char *appid)
3349 pkgmgrinfo_appinfo_h handle;
3350 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3351 if (ret != PMINFO_R_OK)
3353 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
3354 if (ret != PMINFO_R_OK) {
3355 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3358 printf("pkg id: %s\n", pkgid);
3359 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3364 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid);
3367 * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
3368 * @brief This API gets the package type of the application
3370 * @par This API is for package-manager client application
3371 * @par Sync (or) Async : Synchronous API
3373 * @param[in] handle pointer to the application info handle.
3374 * @param[out] pkgtype pointer to hold package type
3375 * @return 0 if success, error code(<0) if fail
3376 * @retval PMINFO_R_OK success
3377 * @retval PMINFO_R_EINVAL invalid argument
3378 * @retval PMINFO_R_ERROR internal error
3379 * @pre pkgmgrinfo_appinfo_get_appinfo()
3380 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3381 * @see pkgmgrinfo_appinfo_get_appid()
3382 * @see pkgmgrinfo_appinfo_is_multiple()
3384 static int get_app_pkgtype(const char *appid)
3387 char *pkgtype = NULL;
3388 pkgmgrinfo_appinfo_h handle = NULL;
3389 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3390 if (ret != PMINFO_R_OK)
3392 ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
3393 if (ret != PMINFO_R_OK) {
3394 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3397 printf("pkgtype: %s\n", pkgtype);
3398 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3403 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype);
3406 * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3407 * @brief This API gets the executable name of the application
3409 * @par This API is for package-manager client application
3410 * @par Sync (or) Async : Synchronous API
3412 * @param[in] handle pointer to the application info handle.
3413 * @param[out] exec pointer to hold app exec name
3414 * @return 0 if success, error code(<0) if fail
3415 * @retval PMINFO_R_OK success
3416 * @retval PMINFO_R_EINVAL invalid argument
3417 * @retval PMINFO_R_ERROR internal error
3418 * @pre pkgmgrinfo_appinfo_get_appinfo()
3419 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3420 * @see pkgmgrinfo_appinfo_get_appid()
3421 * @see pkgmgrinfo_appinfo_is_multiple()
3423 static int get_app_exec(const char *appid)
3427 pkgmgrinfo_appinfo_h handle;
3428 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3429 if (ret != PMINFO_R_OK)
3431 ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3432 if (ret != PMINFO_R_OK) {
3433 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3436 printf("exec name: %s\n", exec);
3437 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3442 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec);
3445 * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3446 * @brief This API gets the icon name of the application
3448 * @par This API is for package-manager client application
3449 * @par Sync (or) Async : Synchronous API
3451 * @param[in] handle pointer to the application info handle.
3452 * @param[out] icon pointer to hold app icon name
3453 * @return 0 if success, error code(<0) if fail
3454 * @retval PMINFO_R_OK success
3455 * @retval PMINFO_R_EINVAL invalid argument
3456 * @retval PMINFO_R_ERROR internal error
3457 * @pre pkgmgrinfo_appinfo_get_appinfo()
3458 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3459 * @see pkgmgrinfo_appinfo_get_appid()
3460 * @see pkgmgrinfo_appinfo_is_multiple()
3462 static int get_app_icon(const char *appid)
3466 pkgmgrinfo_appinfo_h handle;
3467 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3468 if (ret != PMINFO_R_OK)
3470 ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3471 if (ret != PMINFO_R_OK) {
3472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3475 printf("icon name: %s\n", icon);
3476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3481 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3484 * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3485 * @brief This API gets the label of the application
3487 * @par This API is for package-manager client application
3488 * @par Sync (or) Async : Synchronous API
3490 * @param[in] handle pointer to the application info handle.
3491 * @param[out] label pointer to hold app label
3492 * @return 0 if success, error code(<0) if fail
3493 * @retval PMINFO_R_OK success
3494 * @retval PMINFO_R_EINVAL invalid argument
3495 * @retval PMINFO_R_ERROR internal error
3496 * @pre pkgmgrinfo_appinfo_get_appinfo()
3497 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3498 * @see pkgmgrinfo_appinfo_get_appid()
3499 * @see pkgmgrinfo_appinfo_is_multiple()
3501 static int get_app_label(const char *appid)
3505 pkgmgrinfo_appinfo_h handle;
3506 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3507 if (ret != PMINFO_R_OK)
3509 ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3510 if (ret != PMINFO_R_OK) {
3511 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3514 printf("label : %s\n", label);
3515 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3520 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label);
3523 * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3524 * @brief This API gets exactly matched label by given appid and locale
3526 * @par This API is for package-manager client application
3527 * @par Sync (or) Async : Synchronous API
3529 * @param[in] appid pointer to appid
3530 * @param[in] locale pointer to locale
3531 * @param[out] label pointer to hold app label
3532 * @return 0 if success, error code(<0) if fail
3533 * @retval PMINFO_R_OK success
3534 * @retval PMINFO_R_EINVAL invalid argument
3535 * @retval PMINFO_R_ERROR internal error
3537 static int get_localed_label(const char *appid, const char *locale)
3542 ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3543 if (ret != PMINFO_R_OK)
3546 printf("localed label: %s\n", label);
3554 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3555 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3558 * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3559 * @brief This API gets metadata value by given metadata key
3561 * @par This API is for package-manager client application
3562 * @par Sync (or) Async : Synchronous API
3564 * @param[in] handle pointer to the application info handle
3565 * @param[in] metadata_key metadata key
3566 * @param[out] metadata_value pointer to hold metadata value
3567 * @return 0 if success, error code(<0) if fail
3568 * @retval PMINFO_R_OK success
3569 * @retval PMINFO_R_EINVAL invalid argument
3571 static int get_metadata_value(const char *appid, const char *metadata_key)
3574 pkgmgrinfo_appinfo_h handle = NULL;
3575 char *metadata_value = NULL;
3577 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3578 if (ret != PMINFO_R_OK)
3581 ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3582 if (ret != PMINFO_R_OK) {
3583 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3587 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3592 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3595 * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3596 * @brief This API gets the component of the application
3598 * @par This API is for package-manager client application
3599 * @par Sync (or) Async : Synchronous API
3601 * @param[in] handle pointer to the application info handle.
3602 * @param[out] component pointer to hold app component
3603 * @return 0 if success, error code(<0) if fail
3604 * @retval PMINFO_R_OK success
3605 * @retval PMINFO_R_EINVAL invalid argument
3606 * @retval PMINFO_R_ERROR internal error
3607 * @pre pkgmgrinfo_appinfo_get_appinfo()
3608 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3609 * @see pkgmgrinfo_appinfo_get_appid()
3610 * @see pkgmgrinfo_appinfo_is_multiple()
3612 static int get_app_component(const char *appid)
3615 pkgmgrinfo_app_component component;
3616 pkgmgrinfo_appinfo_h handle;
3617 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3618 if (ret != PMINFO_R_OK)
3620 ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3621 if (ret != PMINFO_R_OK) {
3622 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3625 printf("component : %s\n", component);
3626 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3631 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component);
3634 * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3635 * @brief This API gets the apptype of the application
3637 * @par This API is for package-manager client application
3638 * @par Sync (or) Async : Synchronous API
3640 * @param[in] handle pointer to the application info handle.
3641 * @param[out] app_type pointer to hold apptype
3642 * @return 0 if success, error code(<0) if fail
3643 * @retval PMINFO_R_OK success
3644 * @retval PMINFO_R_EINVAL invalid argument
3645 * @retval PMINFO_R_ERROR internal error
3646 * @pre pkgmgrinfo_appinfo_get_appinfo()
3647 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3648 * @see pkgmgrinfo_appinfo_get_appid()
3649 * @see pkgmgrinfo_appinfo_is_multiple()
3651 static int get_app_type(const char *appid)
3654 char *apptype = NULL;
3655 pkgmgrinfo_appinfo_h handle;
3656 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3657 if (ret != PMINFO_R_OK)
3659 ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3660 if (ret != PMINFO_R_OK) {
3661 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3664 printf("apptype : %s\n", apptype);
3665 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3670 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type);
3673 * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3674 * @brief This API gets the notification icon of the application
3676 * @par This API is for package-manager client application
3677 * @par Sync (or) Async : Synchronous API
3679 * @param[in] handle pointer to the application info handle.
3680 * @param[out] path pointer to hold notification icon
3681 * @return 0 if success, error code(<0) if fail
3682 * @retval PMINFO_R_OK success
3683 * @retval PMINFO_R_EINVAL invalid argument
3684 * @retval PMINFO_R_ERROR internal error
3685 * @pre pkgmgrinfo_appinfo_get_appinfo()
3686 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3687 * @see pkgmgrinfo_appinfo_get_appid()
3688 * @see pkgmgrinfo_appinfo_is_multiple()
3690 static int get_app_notification_icon(const char *appid)
3693 char *notification_icon = NULL;
3694 pkgmgrinfo_appinfo_h handle;
3695 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3696 if (ret != PMINFO_R_OK)
3698 ret = pkgmgrinfo_appinfo_get_notification_icon(handle, ¬ification_icon);
3699 if (ret != PMINFO_R_OK) {
3700 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3703 printf("notification icon : %s\n", notification_icon);
3704 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3709 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon);
3712 * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3713 * @brief This API gets the type of recent image on app-tray
3715 * @par This API is for package-manager client application
3716 * @par Sync (or) Async : Synchronous API
3718 * @param[in] handle pointer to the application info handle.
3719 * @param[out] type pointer to hold image type
3720 * @return 0 if success, error code(<0) if fail
3721 * @retval PMINFO_R_OK success
3722 * @retval PMINFO_R_EINVAL invalid argument
3723 * @retval PMINFO_R_ERROR internal error
3724 * @pre pkgmgrinfo_appinfo_get_appinfo()
3725 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3726 * @see pkgmgrinfo_appinfo_get_appid()
3727 * @see pkgmgrinfo_appinfo_is_multiple()
3729 static int get_app_recent_image_type(const char *appid)
3732 pkgmgrinfo_app_recentimage type;
3733 pkgmgrinfo_appinfo_h handle;
3734 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3735 if (ret != PMINFO_R_OK)
3737 ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3738 if (ret != PMINFO_R_OK) {
3739 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3742 printf("recent image type: %d\n", type);
3743 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3748 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type);
3752 * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img)
3753 * @brief This API gets the preview image of application
3755 * @par Sync (or) Async : Synchronous API
3757 * @param[in] handle pointer to the application info handle.
3758 * @param[out] preview_img pointer to hold preview image path
3759 * @return 0 if success, error code(<0) if fail
3760 * @retval PMINFO_R_OK success
3761 * @retval PMINFO_R_EINVAL invalid argument
3762 * @retval PMINFO_R_ERROR internal error
3763 * @pre pkgmgrinfo_appinfo_get_appinfo()
3764 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3765 * @see pkgmgrinfo_appinfo_get_appid()
3767 static int get_app_previewimage(const char *appid)
3770 char *preview = NULL;
3771 pkgmgrinfo_appinfo_h handle = NULL;
3772 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3773 if (ret != PMINFO_R_OK)
3775 ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3776 if (ret != PMINFO_R_OK) {
3777 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3780 printf("preview image path : %s\n", preview);
3781 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3786 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h handle, char **preview_img);
3790 * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3791 * @brief This API gets the package permission type of the application
3793 * @par This API is for package-manager client application
3794 * @par Sync (or) Async : Synchronous API
3796 * @param[in] handle pointer to the application info handle.
3797 * @param[out] permission pointer to hold package permission
3798 * @return 0 if success, error code(<0) if fail
3799 * @retval PMINFO_R_OK success
3800 * @retval PMINFO_R_EINVAL invalid argument
3801 * @retval PMINFO_R_ERROR internal error
3802 * @pre pkgmgrinfo_appinfo_get_appinfo()
3803 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3804 * @see pkgmgrinfo_appinfo_get_appid()
3806 static int get_app_permission(const char *appid)
3809 pkgmgrinfo_permission_type permission = 0;
3810 pkgmgrinfo_appinfo_h handle;
3812 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3813 if (ret != PMINFO_R_OK)
3815 ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3816 if (ret != PMINFO_R_OK) {
3817 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3820 printf("permission type: %d\n", permission);
3821 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3826 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3829 * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3830 * @brief This API gets the component_type
3832 * @par This API is for package-manager client application
3833 * @par Sync (or) Async : Synchronous API
3835 * @param[in] handle pointer to the application info handle.
3836 * @param[out] component_type pointer to hold component_type
3837 * @return 0 if success, error code(<0) if fail
3838 * @retval PMINFO_R_OK success
3839 * @retval PMINFO_R_EINVAL invalid argument
3840 * @retval PMINFO_R_ERROR internal error
3841 * @pre pkgmgrinfo_appinfo_get_appinfo()
3842 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3843 * @see pkgmgrinfo_appinfo_get_pkgid()
3844 * @see pkgmgrinfo_appinfo_is_multiple()
3846 static int get_component_type(const char *appid)
3849 char *component_type = NULL;
3850 pkgmgrinfo_appinfo_h handle;
3851 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3852 if (ret != PMINFO_R_OK)
3854 ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3855 if (ret != PMINFO_R_OK) {
3856 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3859 printf("component_type: %s\n", component_type);
3860 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3865 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type);
3868 * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3869 * @brief This API gets the application 'hwacceleration' value from the app ID
3871 * @par This API is for package-manager client application
3872 * @par Sync (or) Async : Synchronous API
3874 * @param[in] handle pointer to application info handle
3875 * @param[out] hwacceleration pointer to hold package hwacceleration value
3876 * @return 0 if success, error code(<0) if fail
3877 * @retval PMINFO_R_OK success
3878 * @retval PMINFO_R_EINVAL invalid argument
3879 * @retval PMINFO_R_ERROR internal error
3880 * @pre pkgmgrinfo_appinfo_get_appinfo()
3881 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3882 * @see pkgmgrinfo_appinfo_get_appid()
3883 * @see pkgmgrinfo_appinfo_is_multiple()
3885 static int get_app_hwacceleration(const char *appid)
3888 pkgmgrinfo_app_hwacceleration hwacceleration;
3889 pkgmgrinfo_appinfo_h handle;
3890 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3891 if (ret != PMINFO_R_OK)
3893 ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3894 if (ret != PMINFO_R_OK) {
3895 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3898 printf("app hwacceleration: %d\n", hwacceleration);
3899 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3904 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3907 * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader)
3908 * @brief This API gets the application 'screenreader' value from the app ID
3910 * @par This API is for package-manager client application
3911 * @par Sync (or) Async : Synchronous API
3913 * @param[in] handle pointer to application info handle
3914 * @param[out] screenreader pointer to hold package accessibility value
3915 * @return 0 if success, error code(<0) if fail
3916 * @retval PMINFO_R_OK success
3917 * @retval PMINFO_R_EINVAL invalid argument
3918 * @retval PMINFO_R_ERROR internal error
3919 * @pre pkgmgrinfo_appinfo_get_appinfo()
3920 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3921 * @see pkgmgrinfo_appinfo_get_appid()
3922 * @see pkgmgrinfo_appinfo_is_multiple()
3924 static int get_app_screenreader(const char *appid)
3927 pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3928 pkgmgrinfo_appinfo_h handle = NULL;
3929 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3930 if (ret != PMINFO_R_OK)
3932 ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3933 if (ret != PMINFO_R_OK) {
3934 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3937 printf("app screenreader: %d\n", screenreader);
3938 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3943 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_screenreader *screenreader);
3946 * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img)
3947 * @brief This API gets the application's landscape & portrait effect images
3949 * @par This API is for package-manager client application
3950 * @par Sync (or) Async : Synchronous API
3952 * @param[in] handle pointer to application info handle
3953 * @param[out] portrait_img contains portrait mode effect image
3954 * @param[out] landscape_img contains landscape mode effect image
3955 * @return 0 if success, error code(<0) if fail
3956 * @retval PMINFO_R_OK success
3957 * @retval PMINFO_R_EINVAL invalid argument
3958 * @retval PMINFO_R_ERROR internal error
3959 * @pre pkgmgrinfo_appinfo_get_appinfo()
3960 * @post pkgmgrinfo_appinfo_destroy_appinfo()
3961 * @see pkgmgrinfo_appinfo_get_appid()
3962 * @see pkgmgrinfo_appinfo_is_nodisplay()
3964 static int get_app_effectimages(const char *appid)
3967 char *portraitimg = NULL;
3968 char *landscapeimg = NULL;
3969 pkgmgrinfo_appinfo_h handle;
3970 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3971 if (ret != PMINFO_R_OK)
3973 ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3974 if (ret != PMINFO_R_OK) {
3975 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3978 printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3979 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3984 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h handle, char **portrait_img, char **landscape_img);
3987 * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type)
3988 * @brief This API gets the application's effect image type
3990 * @par This API is for package-manager client application
3991 * @par Sync (or) Async : Synchronous API
3993 * @param[in] handle pointer to application info handle
3994 * @param[out] effectimg_type contains effect image type
3995 * @return 0 if success, error code(<0) if fail
3996 * @retval PMINFO_R_OK success
3997 * @retval PMINFO_R_EINVAL invalid argument
3998 * @retval PMINFO_R_ERROR internal error
3999 * @pre pkgmgrinfo_appinfo_get_appinfo()
4000 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4001 * @see pkgmgrinfo_appinfo_get_appid()
4002 * @see pkgmgrinfo_appinfo_is_nodisplay()
4004 static int get_app_effectimage_type(const char *appid)
4007 char *effectimg_type = NULL;
4008 pkgmgrinfo_appinfo_h handle = NULL;
4009 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4010 if (ret != PMINFO_R_OK)
4012 ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
4013 if (ret != PMINFO_R_OK) {
4014 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4017 printf("app effect image type: %s\n", effectimg_type);
4018 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4023 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
4026 * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
4027 * @brief This API gets the submode_mainid of the application
4029 * @par This API is for package-manager client application
4030 * @par Sync (or) Async : Synchronous API
4032 * @param[in] handle pointer to the application info handle.
4033 * @param[out] submode_mainid pointer to hold package name
4034 * @return 0 if success, error code(<0) if fail
4035 * @retval PMINFO_R_OK success
4036 * @retval PMINFO_R_EINVAL invalid argument
4037 * @retval PMINFO_R_ERROR internal error
4038 * @pre pkgmgrinfo_appinfo_get_appinfo()
4039 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4040 * @see pkgmgrinfo_appinfo_get_appid()
4041 * @see pkgmgrinfo_appinfo_is_multiple()
4043 static int get_app_submode_mainid(const char *appid)
4046 char *submode_mainid = NULL;
4047 pkgmgrinfo_appinfo_h handle = NULL;
4048 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4049 if (ret != PMINFO_R_OK)
4051 ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
4052 if (ret != PMINFO_R_OK) {
4053 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4056 printf("submode_mainid: %s\n", submode_mainid);
4057 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4062 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid);
4065 * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4066 * @brief This API gets the datacontrol info
4068 * @par This API is for package-manager client application
4069 * @par Sync (or) Async : Synchronous API
4071 * @param[in] providerid pointer to the providerid of dataconltrol.
4072 * @param[in] type pointer to the type of dataconltrol.
4073 * @param[out] appid pointer to hold appid, need to free after using
4074 * @param[out] access pointer to hold access, need to free after using
4075 * @return 0 if success, error code(<0) if fail
4076 * @retval PMINFO_R_OK success
4077 * @retval PMINFO_R_EINVAL invalid argument
4078 * @retval PMINFO_R_ERROR internal error
4081 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
4082 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
4085 * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4086 * @brief This API gets the appid of datacontrol
4088 * @par This API is for package-manager client application
4089 * @par Sync (or) Async : Synchronous API
4091 * @param[in] providerid pointer to the providerid of dataconltrol.
4092 * @param[out] appid pointer to hold appid, need to free after using
4093 * @return 0 if success, error code(<0) if fail
4094 * @retval PMINFO_R_OK success
4095 * @retval PMINFO_R_EINVAL invalid argument
4096 * @retval PMINFO_R_ERROR internal error
4099 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
4100 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
4103 * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
4104 * @brief This API gets the information about trusted datacontrol
4106 * @par This API is for package-manager client application
4107 * @par Sync (or) Async : Synchronous API
4109 * @param[in] providerid pointer to the providerid of datacontrol.
4110 * @param[out] appid pointer to hold appid, need to free after using
4111 * @param[out] is_trusted pointer to hold whether it provides trusted datacontrol
4112 * @return 0 if success, error code(<0) if fail
4113 * @retval PMINFO_R_OK success
4114 * @retval PMINFO_R_EINVAL invalid argument
4115 * @retval PMINFO_R_ERROR internal error
4118 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
4119 const char *type, char **appid, bool *is_trusted);
4120 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
4121 const char *type, uid_t uid, char **appid, bool *is_trusted);
4124 * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4125 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4126 * @brief This API retrieves the privileges and invokes given callback for each privilege.
4128 * @par This API is for package-manager client application
4129 * @par Sync (or) Async : Synchronous API
4131 * @param[in] providerid pointer to the providerid of datacontrol.
4132 * @param[in] type pointer to the type of dataconltrol.
4133 * @param[in] privilege_func callback function for list
4134 * @param[in] user_data user data to be passed to callback function
4135 * @return 0 if success, error code(<0) if fail
4136 * @retval PMINFO_R_OK success
4137 * @retval PMINFO_R_EINVAL invalid argument
4138 * @retval PMINFO_R_ERROR internal error
4140 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
4141 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
4142 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
4143 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
4146 * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid)
4147 * @brief This API gets the alias_appid of the application
4149 * @par This API is for package-manager client application
4150 * @par Sync (or) Async : Synchronous API
4152 * @param[in] handle pointer to the application info handle.
4153 * @param[out] alias_appid pointer to hold app alias_appid
4154 * @return 0 if success, error code(<0) if fail
4155 * @retval PMINFO_R_OK success
4156 * @retval PMINFO_R_EINVAL invalid argument
4157 * @retval PMINFO_R_ERROR internal error
4158 * @pre pkgmgrinfo_appinfo_get_appinfo()
4159 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4160 * @see pkgmgrinfo_appinfo_get_appid()
4162 static int get_alias_appid(const char *appid)
4165 char *alias_appid= 0;
4166 pkgmgrinfo_appinfo_h handle = NULL;
4167 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4168 if (ret != PMINFO_R_OK)
4170 ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
4171 if (ret != PMINFO_R_OK) {
4172 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4175 printf("alias_appid: %s\n", alias_appid);
4176 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4181 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
4184 * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid)
4185 * @brief This API gets the effective_appid of the application
4187 * @par This API is for package-manager client application
4188 * @par Sync (or) Async : Synchronous API
4190 * @param[in] handle pointer to the application info handle.
4191 * @param[out] effective_appid pointer to hold app effective_appid
4192 * @return 0 if success, error code(<0) if fail
4193 * @retval PMINFO_R_OK success
4194 * @retval PMINFO_R_EINVAL invalid argument
4195 * @retval PMINFO_R_ERROR internal error
4196 * @pre pkgmgrinfo_appinfo_get_appinfo()
4197 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4198 * @see pkgmgrinfo_appinfo_get_appid()
4200 static int get_effective_appid(const char *appid)
4203 char *effective_appid= 0;
4204 pkgmgrinfo_appinfo_h handle = NULL;
4205 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4206 if (ret != PMINFO_R_OK)
4208 ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
4209 if (ret != PMINFO_R_OK) {
4210 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4213 printf("effective_appid: %s\n", effective_appid);
4214 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4219 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
4222 * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
4223 * @brief This API gets tep(tizen expansion package) file name associated with the package which contain given application
4225 * @par This API is for package-manager client application
4226 * @par Sync (or) Async : Synchronous API
4228 * @param[in] handle pointer to the appinfo handle.
4229 * @param[out] tep_name pointer to hold tep name
4230 * @return 0 if success, error code(<0) if fail
4231 * @retval PMINFO_R_OK success
4232 * @retval PMINFO_R_EINVAL invalid argument
4233 * @retval PMINFO_R_ERROR internal error
4234 * @pre pkgmgrinfo_appinfo_get_appinfo()
4235 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4236 * @see pkgmgrinfo_appinfo_get_appid()
4238 static int get_tep_name(const char *appid)
4241 char *tep_name = NULL;
4242 pkgmgrinfo_appinfo_h handle = NULL;
4243 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4244 if (ret != PMINFO_R_OK)
4246 ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
4247 if (ret != PMINFO_R_OK) {
4248 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4251 printf("TEP name is: %s\n", tep_name);
4252 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4257 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
4260 * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
4261 * @brief This API gets zip mount file name associated with the package which contain given application
4262 * If package is not "mount-installed", zip_mount_file is left as NULL pointer.
4264 * @par This API is for package-manager client application
4265 * @par Sync (or) Async : Synchronous API
4267 * @param[in] handle pointer to the appinfo handle.
4268 * @param[out] zip_mount_file pointer to hold zip mount file name
4269 * @return 0 if success, error code(<0) if fail
4270 * @retval PMINFO_R_OK success
4271 * @retval PMINFO_R_EINVAL invalid argument
4272 * @retval PMINFO_R_ERROR internal error
4273 * @pre pkgmgrinfo_appinfo_get_appinfo()
4274 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4275 * @see pkgmgrinfo_appinfo_get_appid()
4277 static int get_zip_mount_file(const char *appid)
4280 char *zip_mount_file = NULL;
4281 pkgmgrinfo_appinfo_h handle = NULL;
4282 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4283 if (ret != PMINFO_R_OK)
4285 ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
4286 if (ret != PMINFO_R_OK) {
4287 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4290 printf("Mount file name is: %s\n", zip_mount_file);
4291 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4296 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
4299 * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
4300 * @brief This API gets the root path of application
4302 * @par Sync (or) Async : Synchronous API
4304 * @param[in] handle pointer to appinfo handle
4305 * @param[out] path pointer to hold root path of application
4306 * @return 0 if success, error code(<0) if fail
4307 * @retval PMINFO_R_OK success
4308 * @retval PMINFO_R_EINVAL invalid argument
4309 * @retval PMINFO_R_ERROR internal error
4311 static int get_root_path(const char *appid)
4315 pkgmgrinfo_appinfo_h handle;
4316 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4317 if (ret != PMINFO_R_OK)
4320 ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
4321 if (ret != PMINFO_R_OK) {
4322 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4325 printf("path : %s\n", path);
4326 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4332 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
4335 * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
4336 * @brief This API gets the application api_version from the application ID
4338 * @par This API is for package-manager client application
4339 * @par Sync (or) Async : Synchronous API
4341 * @param[in] handle pointer to appinfo handle
4342 * @param[out] api_version pointer to hold application api_version
4343 * @return 0 if success, error code(<0) if fail
4344 * @retval PMINFO_R_OK success
4345 * @retval PMINFO_R_EINVAL invalid argument
4346 * @retval PMINFO_R_ERROR internal error
4347 * @pre pkgmgrinfo_appinfo_get_appinfo()
4348 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4349 * @see pkgmgrinfo_appinfo_get_appid()
4351 static int get_app_api_version(const char *appid)
4354 char *api_version = NULL;
4355 pkgmgrinfo_appinfo_h handle = NULL;
4356 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4357 if (ret != PMINFO_R_OK)
4359 ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
4360 if (ret != PMINFO_R_OK) {
4361 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4364 printf("app api_version: %s\n", api_version);
4365 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4370 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
4373 * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
4374 * @brief This API gets the installed_time of the application
4376 * @par This API is for package-manager client application
4377 * @par Sync (or) Async : Synchronous API
4379 * @param[in] handle pointer to the application info handle.
4380 * @param[out] installed_time pointer to hold installed_time
4381 * @return 0 if success, error code(<0) if fail
4382 * @retval PMINFO_R_OK success
4383 * @retval PMINFO_R_EINVAL invalid argument
4384 * @retval PMINFO_R_ERROR internal error
4385 * @pre pkgmgrinfo_appinfo_get_appinfo()
4386 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4387 * @see pkgmgrinfo_appinfo_get_appid()
4388 * @see pkgmgrinfo_appinfo_is_multiple()
4390 static int get_app_installed_time(const char *appid)
4393 int installed_time = 0;
4394 pkgmgrinfo_appinfo_h handle = NULL;
4395 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4396 if (ret != PMINFO_R_OK)
4398 ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4399 if (ret != PMINFO_R_OK) {
4400 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4403 printf("installed_time: %d\n", installed_time);
4404 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4409 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4412 * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode)
4413 * @brief This API gets the support_mode of the application
4415 * @par This API is for package-manager client application
4416 * @par Sync (or) Async : Synchronous API
4418 * @param[in] handle pointer to the application info handle.
4419 * @param[out] support_mode pointer to hold app support_mode
4420 * @return 0 if success, error code(<0) if fail
4421 * @retval PMINFO_R_OK success
4422 * @retval PMINFO_R_EINVAL invalid argument
4423 * @retval PMINFO_R_ERROR internal error
4424 * @pre pkgmgrinfo_appinfo_get_appinfo()
4425 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4426 * @see pkgmgrinfo_appinfo_get_appid()
4428 static int get_app_support_mode(const char *appid)
4431 int support_mode = 0;
4432 pkgmgrinfo_appinfo_h handle = NULL;
4433 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4434 if (ret != PMINFO_R_OK)
4436 ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4437 if (ret != PMINFO_R_OK) {
4438 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4441 printf("support_mode: %s\n", support_mode);
4442 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4447 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4451 * @fn int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4452 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4453 * @brief This API gets the list of category for a particular application
4455 * @par This API is for package-manager client application
4456 * @par Sync (or) Async : Synchronous API
4457 * @param[in] handle pointer to the application info handle.
4458 * @param[in] category_func callback function for list
4459 * @param[in] user_data user data to be passed to callback function
4460 * @return 0 if success, error code(<0) if fail
4461 * @retval PMINFO_R_OK success
4462 * @retval PMINFO_R_EINVAL invalid argument
4463 * @retval PMINFO_R_ERROR internal error
4464 * @pre pkgmgrinfo_appinfo_get_appinfo()
4465 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4467 int category_func(const char *name, void *user_data)
4469 if (strcmp(name, (char *)user_data) == 0)
4475 static int list_category(const char *appid, char *category)
4478 pkgmgrinfo_appinfo_h handle;
4479 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4480 if (ret != PMINFO_R_OK)
4482 ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4483 if (ret != PMINFO_R_OK) {
4484 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4487 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4492 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4493 pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4496 * @fn int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4497 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4498 * @brief This API gets the list of metadata for a particular application
4500 * @par This API is for package-manager client application
4501 * @par Sync (or) Async : Synchronous API
4502 * @param[in] handle pointer to the application info handle.
4503 * @param[in] metadata_func callback function for list
4504 * @param[in] user_data user data to be passed to callback function
4505 * @return 0 if success, error code(<0) if fail
4506 * @retval PMINFO_R_OK success
4507 * @retval PMINFO_R_EINVAL invalid argument
4508 * @retval PMINFO_R_ERROR internal error
4509 * @pre pkgmgrinfo_appinfo_get_appinfo()
4510 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4512 int metadata_func(const char *key, const char *value, void *user_data)
4514 if (strcmp(key, (char *)user_data) == 0) {
4515 printf("Value is %s\n", value);
4522 static int list_metadata(const char *appid, char *key)
4525 pkgmgrinfo_appinfo_h handle;
4526 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4527 if (ret != PMINFO_R_OK)
4529 ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4530 if (ret != PMINFO_R_OK) {
4531 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4534 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4539 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4540 pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4543 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4544 * const char *operation,
4545 * pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4547 * @brief This API gets the list of privileges for a particular
4548 * appllication's app_control
4550 * @par This API is for package-manager client application
4551 * @par Sync (or) Async : Synchronous API
4552 * @param[in] appid application id
4553 * @param[in] operation operation of appcontrol
4554 * @param[in] privilege_func callback function for list
4555 * @param[in] user_data user data to be passed to callback function
4556 * @return 0 if success, error code(<0) if fail
4557 * @retval PMINFO_R_OK success
4558 * @retval PMINFO_R_EINVAL invalid argument
4559 * @retval PMINFO_R_ERROR internal error
4561 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4562 const char *operation,
4563 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4564 void *user_data, uid_t uid);
4565 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4566 const char *operation,
4567 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4571 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4572 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4573 * @fn int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4574 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4575 * @brief This API gets the list of app-control for a particular application
4577 * @par This API is for package-manager client application
4578 * @par Sync (or) Async : Synchronous API
4579 * @param[in] handle pointer to the application info handle.
4580 * @param[in] appcontrol_func callback function for list
4581 * @param[in] user_data user data to be passed to callback function
4582 * @param[in] uid the addressee user id of the instruction
4583 * @return 0 if success, error code(<0) if fail
4584 * @retval PMINFO_R_OK success
4585 * @retval PMINFO_R_EINVAL invalid argument
4586 * @retval PMINFO_R_ERROR internal error
4587 * @pre pkgmgrinfo_appinfo_get_appinfo()
4588 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4590 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4594 char *compare_data = (char *)user_data;
4595 if (strcmp(operation, compare_data) == 0)
4601 static int check_operation(const char *appid, char *operation)
4604 pkgmgrinfo_appinfo_h handle;
4605 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4606 if (ret != PMINFO_R_OK)
4608 ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4609 if (ret != PMINFO_R_OK) {
4610 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4613 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4618 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4619 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4621 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4622 pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4627 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4628 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4631 * @fn int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4632 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4633 * @brief This API gets the list of splashscreen for a particular application
4635 * @par This API is for package-manager client application
4636 * @par Sync (or) Async : Synchronous API
4637 * @param[in] handle pointer to the application info handle.
4638 * @param[in] splash_screen_func callback function for list
4639 * @param[in] user_data user data to be passed to callback function
4640 * @return 0 if success, error code(<0) if fail
4641 * @retval PMINFO_R_OK success
4642 * @retval PMINFO_R_EINVAL invalid argument
4643 * @retval PMINFO_R_ERROR internal error
4644 * @pre pkgmgrinfo_appinfo_get_appinfo()
4645 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4648 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4649 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4652 * @fn int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4653 pkgmgrinfo_app_res_control_list_cb res_control_func, void *user_data);
4654 * @brief This API gets the list of resource control for a particular application
4656 * @par This API is for package-manager client application
4657 * @par Sync (or) Async : Synchronous API
4658 * @param[in] handle pointer to the application info handle.
4659 * @param[in] res_control_func callback function for list
4660 * @param[in] user_data user data to be passed to callback function
4661 * @return 0 if success, error code(<0) if fail
4662 * @retval PMINFO_R_OK success
4663 * @retval PMINFO_R_EINVAL invalid argument
4664 * @retval PMINFO_R_ERROR internal error
4665 * @pre pkgmgrinfo_appinfo_get_appinfo()
4666 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4668 int res_control_func(const char *res_type,
4669 const char *min_res_version, const char *max_res_version,
4670 const char *auto_close, void *user_data)
4672 printf("res_type : %s\n", res_type);
4676 static int list_res_control(const char *appid, char *key)
4679 pkgmgrinfo_appinfo_h handle;
4680 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4681 if (ret != PMINFO_R_OK)
4683 ret = pkgmgrinfo_appinfo_foreach_res_control(handle, res_control_func, NULL);
4684 if (ret != PMINFO_R_OK) {
4685 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4688 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4693 int pkgmgrinfo_appinfo_foreach_res_control(pkgmgrinfo_appinfo_h handle,
4694 pkgmgrinfo_app_res_control_list_cb res_control_func,
4698 * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4699 * @brief This API gets the application 'nodisplay' value from the app ID
4701 * @par This API is for package-manager client application
4702 * @par Sync (or) Async : Synchronous API
4704 * @param[in] handle pointer to application info handle
4705 * @param[out] nodisplay pointer to hold package nodisplay value
4706 * @return 0 if success, error code(<0) if fail
4707 * @retval PMINFO_R_OK success
4708 * @retval PMINFO_R_EINVAL invalid argument
4709 * @retval PMINFO_R_ERROR internal error
4710 * @pre pkgmgrinfo_appinfo_get_appinfo()
4711 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4712 * @see pkgmgrinfo_appinfo_get_appid()
4713 * @see pkgmgrinfo_appinfo_is_multiple()
4715 static int get_app_nodisplay(const char *appid)
4719 pkgmgrinfo_appinfo_h handle;
4720 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4721 if (ret != PMINFO_R_OK)
4723 ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4724 if (ret != PMINFO_R_OK) {
4725 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4728 printf("app nodisplay: %d\n", nodisplay);
4729 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4734 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay);
4737 * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4738 * @brief This API gets the application 'multiple' value from the app ID
4740 * @par This API is for package-manager client application
4741 * @par Sync (or) Async : Synchronous API
4743 * @param[in] handle pointer to application info handle
4744 * @param[out] multiple pointer to hold package multiple value
4745 * @return 0 if success, error code(<0) if fail
4746 * @retval PMINFO_R_OK success
4747 * @retval PMINFO_R_EINVAL invalid argument
4748 * @retval PMINFO_R_ERROR internal error
4749 * @pre pkgmgrinfo_appinfo_get_appinfo()
4750 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4751 * @see pkgmgrinfo_appinfo_get_appid()
4752 * @see pkgmgrinfo_appinfo_is_nodisplay()
4754 static int get_app_multiple(const char *appid)
4758 pkgmgrinfo_appinfo_h handle;
4759 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4760 if (ret != PMINFO_R_OK)
4762 ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4763 if (ret != PMINFO_R_OK) {
4764 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4767 printf("app multiple: %d\n", multiple);
4768 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4773 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple);
4776 * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4777 * @brief This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4778 * application launching effect. If fales, indicator will be hidden during application launching effect
4780 * @par This API is for package-manager client application
4781 * @par Sync (or) Async : Synchronous API
4783 * @param[in] handle pointer to application info handle
4784 * @param[out] indicator_disp contains indicator display status for application launching effect
4785 * @return 0 if success, error code(<0) if fail
4786 * @retval PMINFO_R_OK success
4787 * @retval PMINFO_R_EINVAL invalid argument
4788 * @retval PMINFO_R_ERROR internal error
4789 * @pre pkgmgrinfo_appinfo_get_appinfo()
4790 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4791 * @see pkgmgrinfo_appinfo_get_appid()
4792 * @see pkgmgrinfo_appinfo_is_nodisplay()
4794 static int get_app_indicator_display(const char *appid)
4797 bool indicator_disp;
4798 pkgmgrinfo_appinfo_h handle;
4799 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4800 if (ret != PMINFO_R_OK)
4802 ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4803 if (ret != PMINFO_R_OK){
4804 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4807 printf("app indicator disp : %d\n", indicator_disp);
4808 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4813 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4816 * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4817 * @brief This API gets the application 'taskmanage' value from the app ID
4819 * @par This API is for package-manager client application
4820 * @par Sync (or) Async : Synchronous API
4822 * @param[in] handle pointer to application info handle
4823 * @param[out] taskmanage pointer to hold package taskmanage value
4824 * @return 0 if success, error code(<0) if fail
4825 * @retval PMINFO_R_OK success
4826 * @retval PMINFO_R_EINVAL invalid argument
4827 * @retval PMINFO_R_ERROR internal error
4828 * @pre pkgmgrinfo_appinfo_get_appinfo()
4829 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4830 * @see pkgmgrinfo_appinfo_get_appid()
4831 * @see pkgmgrinfo_appinfo_is_multiple()
4833 static int get_app_taskmanage(const char *appid)
4837 pkgmgrinfo_appinfo_h handle;
4838 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4839 if (ret != PMINFO_R_OK)
4841 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4842 if (ret != PMINFO_R_OK) {
4843 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4846 printf("app taskmanage: %d\n", taskmanage);
4847 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4852 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage);
4855 * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4856 * @brief This API gets the application 'taskmanage' value from the app ID
4858 * @par This API is for package-manager client application
4859 * @par Sync (or) Async : Synchronous API
4861 * @param[in] handle pointer to application info handle
4862 * @param[out] enabled pointer to hold package enabled value
4863 * @return 0 if success, error code(<0) if fail
4864 * @retval PMINFO_R_OK success
4865 * @retval PMINFO_R_EINVAL invalid argument
4866 * @retval PMINFO_R_ERROR internal error
4867 * @pre pkgmgrinfo_appinfo_get_appinfo()
4868 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4869 * @see pkgmgrinfo_appinfo_get_appid()
4870 * @see pkgmgrinfo_appinfo_is_multiple()
4872 static int get_app_enabled(const char *appid)
4876 pkgmgrinfo_appinfo_h handle;
4877 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4878 if (ret != PMINFO_R_OK)
4880 ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4881 if (ret != PMINFO_R_OK) {
4882 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4885 printf("app enabled: %d\n", enabled);
4886 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4891 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled);
4894 * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4895 * @brief This API gets the application 'onboot' value from the app ID
4897 * @par This API is for package-manager client application
4898 * @par Sync (or) Async : Synchronous API
4900 * @param[in] handle pointer to application info handle
4901 * @param[out] onboot pointer to hold package onboot value
4902 * @return 0 if success, error code(<0) if fail
4903 * @retval PMINFO_R_OK success
4904 * @retval PMINFO_R_EINVAL invalid argument
4905 * @retval PMINFO_R_ERROR internal error
4906 * @pre pkgmgrinfo_appinfo_get_appinfo()
4907 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4908 * @see pkgmgrinfo_appinfo_get_appid()
4909 * @see pkgmgrinfo_appinfo_is_multiple()
4911 static int get_app_onboot(const char *appid)
4915 pkgmgrinfo_appinfo_h handle;
4916 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4917 if (ret != PMINFO_R_OK)
4919 ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4920 if (ret != PMINFO_R_OK) {
4921 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4924 printf("app onboot: %d\n", onboot);
4925 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4930 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot);
4933 * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4934 * @brief This API gets the application 'autorestart' value from the app ID
4936 * @par This API is for package-manager client application
4937 * @par Sync (or) Async : Synchronous API
4939 * @param[in] handle pointer to application info handle
4940 * @param[out] autorestart pointer to hold package autorestart value
4941 * @return 0 if success, error code(<0) if fail
4942 * @retval PMINFO_R_OK success
4943 * @retval PMINFO_R_EINVAL invalid argument
4944 * @retval PMINFO_R_ERROR internal error
4945 * @pre pkgmgrinfo_appinfo_get_appinfo()
4946 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4947 * @see pkgmgrinfo_appinfo_get_appid()
4948 * @see pkgmgrinfo_appinfo_is_multiple()
4950 static int get_app_autorestart(const char *appid)
4954 pkgmgrinfo_appinfo_h handle;
4955 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4956 if (ret != PMINFO_R_OK)
4958 ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4959 if (ret != PMINFO_R_OK) {
4960 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4963 printf("app autorestart: %d\n", autorestart);
4964 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4969 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart);
4972 * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp)
4973 * @brief This API gets the value for given application is main app or not from handle
4975 * @par This API is for package-manager client application
4976 * @par Sync (or) Async : Synchronous API
4978 * @param[in] handle pointer to application info handle
4979 * @param[out] mainapp pointer to hold package mainapp is or not
4980 * @return 0 if success, error code(<0) if fail
4981 * @retval PMINFO_R_OK success
4982 * @retval PMINFO_R_EINVAL invalid argument
4983 * @retval PMINFO_R_ERROR internal error
4984 * @pre pkgmgrinfo_appinfo_get_appinfo()
4985 * @post pkgmgrinfo_appinfo_destroy_appinfo()
4986 * @see pkgmgrinfo_appinfo_get_appid()
4987 * @see pkgmgrinfo_appinfo_is_multiple()
4989 static int get_app_mainapp(const char *appid)
4993 pkgmgrinfo_appinfo_h handle;
4994 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4995 if (ret != PMINFO_R_OK)
4997 ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4998 if (ret != PMINFO_R_OK) {
4999 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5002 printf("mainapp: %d\n", mainapp);
5003 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5008 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h handle, bool *mainapp);
5012 * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
5013 * @brief This API gets the value for given application is preload or not from handle
5015 * @par This API is for package-manager client application
5016 * @par Sync (or) Async : Synchronous API
5018 * @param[in] handle pointer to application info handle
5019 * @param[out] preload pointer to hold preload is or not
5020 * @return 0 if success, error code(<0) if fail
5021 * @retval PMINFO_R_OK success
5022 * @retval PMINFO_R_EINVAL invalid argument
5023 * @retval PMINFO_R_ERROR internal error
5024 * @pre pkgmgrinfo_appinfo_get_appinfo()
5025 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5026 * @see pkgmgrinfo_appinfo_get_appid()
5027 * @see pkgmgrinfo_appinfo_is_multiple()
5029 static int get_app_preload(const char *appid)
5033 pkgmgrinfo_appinfo_h handle = NULL;
5034 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5035 if (ret != PMINFO_R_OK)
5037 ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
5038 if (ret != PMINFO_R_OK) {
5039 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5042 printf("preload: %d\n", preload);
5043 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5048 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
5051 * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
5052 * @brief This API gets the value for given application is submode or not from handle
5054 * @par This API is for package-manager client application
5055 * @par Sync (or) Async : Synchronous API
5057 * @param[in] handle pointer to application info handle
5058 * @param[out] submode pointer to hold submode is or not
5059 * @return 0 if success, error code(<0) if fail
5060 * @retval PMINFO_R_OK success
5061 * @retval PMINFO_R_EINVAL invalid argument
5062 * @retval PMINFO_R_ERROR internal error
5063 * @pre pkgmgrinfo_appinfo_get_appinfo()
5064 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5065 * @see pkgmgrinfo_appinfo_get_appid()
5066 * @see pkgmgrinfo_appinfo_is_multiple()
5068 static int get_app_submode(const char *appid)
5072 pkgmgrinfo_appinfo_h handle = NULL;
5073 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5074 if (ret != PMINFO_R_OK)
5076 ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
5077 if (ret != PMINFO_R_OK) {
5078 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5081 printf("submode: %d\n", submode);
5082 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5087 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
5090 * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
5091 * @brief This API gets the value for given application is process_pool or not from handle
5093 * @par This API is for package-manager client application
5094 * @par Sync (or) Async : Synchronous API
5096 * @param[in] handle pointer to application info handle
5097 * @param[out] process_pool pointer to hold process_pool is or not
5098 * @return 0 if success, error code(<0) if fail
5099 * @retval PMINFO_R_OK success
5100 * @retval PMINFO_R_EINVAL invalid argument
5101 * @retval PMINFO_R_ERROR internal error
5102 * @pre pkgmgrinfo_appinfo_get_appinfo()
5103 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5104 * @see pkgmgrinfo_appinfo_get_appid()
5106 static int get_app_process_pool(const char *appid)
5109 bool process_pool = 0;
5110 pkgmgrinfo_appinfo_h handle = NULL;
5111 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5112 if (ret != PMINFO_R_OK)
5114 ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
5115 if (ret != PMINFO_R_OK) {
5116 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5119 printf("process_pool: %d\n", process_pool);
5120 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5125 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
5128 * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
5129 * @brief This API gets the installed storage location of the application
5131 * @par This API is for package-manager client application
5132 * @par Sync (or) Async : Synchronous API
5134 * @param[in] handle pointer to the application info handle.
5135 * @param[out] app_type pointer to hold installed storage location
5136 * @return 0 if success, error code(<0) if fail
5137 * @retval PMINFO_R_OK success
5138 * @retval PMINFO_R_EINVAL invalid argument
5139 * @retval PMINFO_R_ERROR internal error
5140 * @pre pkgmgrinfo_appinfo_get_appinfo()
5141 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5142 * @see pkgmgrinfo_appinfo_get_appid()
5144 static int get_app_installed_location(const char *appid)
5147 pkgmgrinfo_installed_storage storage;
5148 pkgmgrinfo_appinfo_h handle = NULL;
5149 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5150 if (ret != PMINFO_R_OK)
5152 ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
5153 if (ret != PMINFO_R_OK) {
5154 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5157 printf("Installed storage location : %d\n", storage);
5158 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5163 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
5167 * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
5168 * @brief This API checks if the application has the given category
5170 * @par This API is for package-manager client application
5171 * @par Sync (or) Async : Synchronous API
5173 * @param[in] handle pointer to the application info handle
5174 * @param[in] category category
5175 * @param[out] exist value Gets whether the application has the given category
5176 * @return 0 if success, error code(<0) if fail
5177 * @retval PMINFO_R_OK success
5178 * @retval PMINFO_R_EINVAL invalid argument
5179 * @retval PMINFO_R_ERROR internal error
5181 static int is_category_exist(const char *appid, const char *category)
5184 pkgmgrinfo_appinfo_h handle;
5187 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5188 if (ret != PMINFO_R_OK)
5191 ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
5192 if (ret != PMINFO_R_OK) {
5193 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5197 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5202 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
5205 * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
5206 * @brief This API gets the application 'ui_gadget' value from the app ID
5208 * @par This API is for package-manager client application
5209 * @par Sync (or) Async : Synchronous API
5211 * @param[in] handle pointer to application info handle
5212 * @param[out] ui_gadget pointer to hold package ui_gadget value
5213 * @return 0 if success, error code(<0) if fail
5214 * @retval PMINFO_R_OK success
5215 * @retval PMINFO_R_EINVAL invalid argument
5216 * @pre pkgmgrinfo_appinfo_get_appinfo()
5217 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5219 static int get_app_ui_gadget(const char *appid)
5223 pkgmgrinfo_appinfo_h handle = NULL;
5224 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5225 if (ret != PMINFO_R_OK)
5227 ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
5228 if (ret != PMINFO_R_OK) {
5229 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5232 printf("app ui_gadget: %d\n", ui_gadget);
5233 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5238 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
5241 * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
5242 * @brief This API gets the application 'support_disable' 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] support_disable pointer to hold package support_disable 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_support_disable(const char *appid)
5258 bool support_disable;
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_support_disable(handle, &support_disable);
5264 if (ret != PMINFO_R_OK) {
5265 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5268 printf("app support_disable: %d\n", support_disable);
5269 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5274 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
5277 * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
5278 * @brief This API gets the application 'removable' 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] removable pointer to hold package removable 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 * @retval PMINFO_R_ERROR internal error
5289 * @pre pkgmgrinfo_appinfo_get_appinfo()
5290 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5291 * @see pkgmgrinfo_appinfo_get_appid()
5293 static int get_app_removable(const char *appid)
5297 pkgmgrinfo_appinfo_h handle = NULL;
5298 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5299 if (ret != PMINFO_R_OK)
5301 ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
5302 if (ret != PMINFO_R_OK) {
5303 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5306 printf("app removable: %d\n", removable);
5307 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5312 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
5315 * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
5316 * @brief This API gets the application 'system' value from the app ID
5318 * @par This API is for package-manager client application
5319 * @par Sync (or) Async : Synchronous API
5321 * @param[in] handle pointer to application info handle
5322 * @param[out] system pointer to hold package system value
5323 * @return 0 if success, error code(<0) if fail
5324 * @retval PMINFO_R_OK success
5325 * @retval PMINFO_R_EINVAL invalid argument
5326 * @retval PMINFO_R_ERROR internal error
5327 * @pre pkgmgrinfo_appinfo_get_appinfo()
5328 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5329 * @see pkgmgrinfo_appinfo_get_appid()
5331 static int get_app_system(const char *appid)
5334 bool system = false;
5335 pkgmgrinfo_appinfo_h handle = NULL;
5336 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5337 if (ret != PMINFO_R_OK)
5339 ret = pkgmgrinfo_appinfo_is_system(handle, &system);
5340 if (ret != PMINFO_R_OK) {
5341 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5344 printf("app system: %d\n", system);
5345 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5350 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
5354 * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
5355 * @brief This API gets the application 'is_disable' value from the app ID
5357 * @par This API is for package-manager client application
5358 * @par Sync (or) Async : Synchronous API
5360 * @param[in] handle pointer to application info handle
5361 * @param[out] disabled pointer to hold application is_disabled value
5362 * @return 0 if success, error code(<0) if fail
5363 * @retval PMINFO_R_OK success
5364 * @retval PMINFO_R_EINVAL invalid argument
5365 * @pre pkgmgrinfo_appinfo_get_appinfo()
5366 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5368 static int get_app_is_disable(const char *appid)
5372 pkgmgrinfo_appinfo_h handle = NULL;
5373 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5374 if (ret != PMINFO_R_OK)
5376 ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
5377 if (ret != PMINFO_R_OK) {
5378 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5381 printf("app is_disable: %d\n", is_disable);
5382 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5387 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
5390 * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
5391 * @brief This API gets whether the given application is global application or user application
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[in] global pointer to hold application global value
5398 * @return 0 if success, error code(<0) if fail
5399 * @retval PMINFO_R_OK success
5400 * @retval PMINFO_R_EINVAL invalid argument
5401 * @retval PMINFO_R_ERROR internal error
5402 * @pre pkgmgrinfo_appinfo_get_appinfo()
5403 * @post pkgmgrinfo_appinfo_destroy_appinfo()
5404 * @see pkgmgrinfo_appinfo_get_appid()
5405 static int get_app_is_global(const char *appid)
5409 pkgmgrinfo_appinfo_h handle = NULL;
5410 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5411 if (ret != PMINFO_R_OK)
5413 ret = pkgmgrinfo_appinfo_is_global(handle, &global);
5414 if (ret != PMINFO_R_OK) {
5415 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5418 printf("app is_global: %d\n", global);
5419 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5424 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
5427 * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
5428 * @brief This API gets the application 'splash_screen_display' value from the app ID
5430 * @par This API is for package-manager client application
5431 * @par Sync (or) Async : Synchronous API
5433 * @param[in] handle pointer to application info handle
5434 * @param[out] splash_screen_display pointer to hold package splash_screen_display value
5435 * @return 0 if success, error code(<0) if fail
5436 * @retval PMINFO_R_OK success
5437 * @retval PMINFO_R_EINVAL invalid argument
5438 * @retval PMINFO_R_ERROR internal error
5440 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
5443 * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5444 * @brief This API gets the application 'setup_appid' value from the app ID
5446 * @par This API is for package-manager client application
5447 * @par Sync (or) Async : Synchronous API
5449 * @param[in] handle pointer to application info handle
5450 * @param[out] setup_appid pointer to hold package setup_appid value
5451 * @return 0 if success, error code(<0) if fail
5452 * @retval PMINFO_R_OK success
5453 * @retval PMINFO_R_EINVAL invalid argument
5454 * @retval PMINFO_R_ERROR internal error
5456 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5459 * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5460 * @brief This API gets the application 'support_ambient' value from the app ID
5462 * @par This API is for package-manager client application
5463 * @par Sync (or) Async : Synchronous API
5465 * @param[in] handle pointer to application info handle
5466 * @param[out] support_ambient pointer to hold package support_ambient value
5467 * @return 0 if success, error code(<0) if fail
5468 * @retval PMINFO_R_OK success
5469 * @retval PMINFO_R_EINVAL invalid argument
5470 * @retval PMINFO_R_ERROR internal error
5472 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5475 * @fn int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char *mode)
5476 * @brief This API gets the application 'light_user_switch_mode' value from the app ID
5478 * @par This API is for package-manager client application
5479 * @par Sync (or) Async : Synchronous API
5481 * @param[in] handle pointer to application info handle
5482 * @param[out] mode pointer to hold package light_user_switch_mode value
5483 * @return 0 if success, error code(<0) if fail
5484 * @retval PMINFO_R_OK success
5485 * @retval PMINFO_R_EINVAL invalid argument
5486 * @retval PMINFO_R_ERROR internal error
5488 int pkgmgrinfo_appinfo_get_light_user_switch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
5491 * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5492 * @brief This API destroys the application information handle freeing up all the resources
5494 * @par This API is for package-manager client application
5495 * @par Sync (or) Async : Synchronous API
5497 * @param[in] handle pointer to the application info handle.
5498 * @return 0 if success, error code(<0) if fail
5499 * @retval PMINFO_R_OK success
5500 * @retval PMINFO_R_EINVAL invalid argument
5501 * @retval PMINFO_R_ERROR internal error
5502 * @pre pkgmgrinfo_appinfo_get_appinfo()
5504 * @see pkgmgrinfo_appinfo_get_pkgid()
5505 * @see pkgmgrinfo_appinfo_is_multiple()
5507 static int get_app_type(const char *appid)
5511 pkgmgrinfo_appinfo_h handle;
5512 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5513 if (ret != PMINFO_R_OK)
5515 ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5516 if (ret != PMINFO_R_OK) {
5517 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5520 printf("apptype: %s\n", type);
5521 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5526 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle);
5529 * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5530 * @brief This API creates the application information filter handle from db. All filter properties will be ANDed.
5531 The query will search the entire application information collected from the manifest file of all the installed packages
5533 * @par This API is for package-manager client application
5534 * @par Sync (or) Async : Synchronous API
5536 * @param[out] handle pointer to the application info filter handle.
5537 * @return 0 if success, error code(<0) if fail
5538 * @retval PMINFO_R_OK success
5539 * @retval PMINFO_R_EINVAL invalid argument
5540 * @retval PMINFO_R_ERROR internal error
5542 * @post pkgmgrinfo_appinfo_filter_destroy()
5543 * @see pkgmgrinfo_appinfo_filter_count()
5544 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5546 static int get_capp_count()
5550 pkgmgrinfo_appinfo_filter_h handle;
5551 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5552 if (ret != PMINFO_R_OK)
5554 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5555 if (ret != PMINFO_R_OK) {
5556 pkgmgrinfo_appinfo_filter_destroy(handle);
5559 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5560 if (ret != PMINFO_R_OK) {
5561 pkgmgrinfo_appinfo_filter_destroy(handle);
5564 printf("No of capp: %d\n", count);
5565 pkgmgrinfo_appinfo_filter_destroy(handle);
5570 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5573 * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5574 * @brief This API destroys the application information filter handle freeing up all the resources
5576 * @par This API is for package-manager client application
5577 * @par Sync (or) Async : Synchronous API
5579 * @param[in] handle pointer to the application info filter handle.
5580 * @return 0 if success, error code(<0) if fail
5581 * @retval PMINFO_R_OK success
5582 * @retval PMINFO_R_EINVAL invalid argument
5583 * @retval PMINFO_R_ERROR internal error
5584 * @pre pkgmgrinfo_appinfo_filter_create()
5586 * @see pkgmgrinfo_appinfo_filter_count()
5587 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5589 static int get_capp_count()
5593 pkgmgrinfo_appinfo_filter_h handle;
5594 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5595 if (ret != PMINFO_R_OK)
5597 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5598 if (ret != PMINFO_R_OK) {
5599 pkgmgrinfo_appinfo_filter_destroy(handle);
5602 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5603 if (ret != PMINFO_R_OK) {
5604 pkgmgrinfo_appinfo_filter_destroy(handle);
5607 printf("No of capp: %d\n", count);
5608 pkgmgrinfo_appinfo_filter_destroy(handle);
5613 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5616 * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5617 * @brief This API adds a boolean filter property to the filter handle
5619 * @par This API is for package-manager client application
5620 * @par Sync (or) Async : Synchronous API
5622 * @param[in] handle pointer to the application info filter handle.
5623 * @param[in] property boolean property name.
5624 * @param[in] value value corresponding to the property.
5625 * @return 0 if success, error code(<0) if fail
5626 * @retval PMINFO_R_OK success
5627 * @retval PMINFO_R_EINVAL invalid argument
5628 * @retval PMINFO_R_ERROR internal error
5629 * @pre pkgmgrinfo_appinfo_filter_create()
5630 * @post pkgmgrinfo_appinfo_filter_destroy()
5631 * @see pkgmgrinfo_appinfo_filter_count()
5632 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5634 static int get_taskmanageable_app_count()
5638 pkgmgrinfo_appinfo_filter_h handle;
5639 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5640 if (ret != PMINFO_R_OK)
5642 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5643 if (ret != PMINFO_R_OK) {
5644 pkgmgrinfo_appinfo_filter_destroy(handle);
5647 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5648 if (ret != PMINFO_R_OK) {
5649 pkgmgrinfo_appinfo_filter_destroy(handle);
5652 printf("No of taskmanageable apps: %d\n", count);
5653 pkgmgrinfo_appinfo_filter_destroy(handle);
5658 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5659 const char *property, const bool value);
5662 * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5663 * @brief This API adds an integer filter property to the filter handle
5665 * @par This API is for package-manager client application
5666 * @par Sync (or) Async : Synchronous API
5668 * @param[in] handle pointer to the application info filter handle.
5669 * @param[in] property integer property name.
5670 * @param[in] value value corresponding to the property.
5671 * @return 0 if success, error code(<0) if fail
5672 * @retval PMINFO_R_OK success
5673 * @retval PMINFO_R_EINVAL invalid argument
5674 * @retval PMINFO_R_ERROR internal error
5675 * @pre pkgmgrinfo_appinfo_filter_create()
5676 * @post pkgmgrinfo_appinfo_filter_destroy()
5677 * @see pkgmgrinfo_appinfo_filter_count()
5678 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5680 static int get_taskmanageable_app_count()
5684 pkgmgrinfo_appinfo_filter_h handle;
5685 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5686 if (ret != PMINFO_R_OK)
5688 ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5689 if (ret != PMINFO_R_OK) {
5690 pkgmgrinfo_appinfo_filter_destroy(handle);
5693 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5694 if (ret != PMINFO_R_OK) {
5695 pkgmgrinfo_appinfo_filter_destroy(handle);
5698 printf("No of apps: %d\n", count);
5699 pkgmgrinfo_appinfo_filter_destroy(handle);
5704 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5705 const char *property, const int value);
5708 * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5709 * @brief This API adds a string filter property to the filter handle
5711 * @par This API is for package-manager client application
5712 * @par Sync (or) Async : Synchronous API
5714 * @param[in] handle pointer to the application info filter handle.
5715 * @param[in] property string property name.
5716 * @param[in] value value corresponding to the property.
5717 * @return 0 if success, error code(<0) if fail
5718 * @retval PMINFO_R_OK success
5719 * @retval PMINFO_R_EINVAL invalid argument
5720 * @retval PMINFO_R_ERROR internal error
5721 * @pre pkgmgrinfo_appinfo_filter_create()
5722 * @post pkgmgrinfo_appinfo_filter_destroy()
5723 * @see pkgmgrinfo_appinfo_filter_count()
5724 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5726 static int get_capp_count()
5730 pkgmgrinfo_appinfo_filter_h handle;
5731 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5732 if (ret != PMINFO_R_OK)
5734 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5735 if (ret != PMINFO_R_OK) {
5736 pkgmgrinfo_appinfo_filter_destroy(handle);
5739 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5740 if (ret != PMINFO_R_OK) {
5741 pkgmgrinfo_appinfo_filter_destroy(handle);
5744 printf("No of capp: %d\n", count);
5745 pkgmgrinfo_appinfo_filter_destroy(handle);
5750 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5751 const char *property, const char *value);
5754 * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5755 * @brief This API executes the user supplied callback function for each application that satisfy the filter conditions
5757 * @par This API is for package-manager client application
5758 * @par Sync (or) Async : Synchronous API
5760 * @param[in] handle pointer to the application info filter handle.
5761 * @param[in] app_cb callback function.
5762 * @param[in] user_data user data to be passed to the callback function
5763 * @return 0 if success, error code(<0) if fail
5764 * @retval PMINFO_R_OK success
5765 * @retval PMINFO_R_EINVAL invalid argument
5766 * @retval PMINFO_R_ERROR internal error
5767 * @pre pkgmgrinfo_appinfo_filter_create()
5768 * @post pkgmgrinfo_appinfo_filter_destroy()
5769 * @see pkgmgrinfo_appinfo_filter_count()
5771 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5774 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5775 printf("appid : %s\n", appid);
5779 static int get_capp_list()
5782 pkgmgrinfo_appinfo_filter_h handle;
5783 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5784 if (ret != PMINFO_R_OK)
5786 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5787 if (ret != PMINFO_R_OK) {
5788 pkgmgrinfo_appinfo_filter_destroy(handle);
5791 ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5792 if (ret != PMINFO_R_OK) {
5793 pkgmgrinfo_appinfo_filter_destroy(handle);
5796 pkgmgrinfo_appinfo_filter_destroy(handle);
5801 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5802 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5803 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5804 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5807 * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5808 * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5809 * @brief This API counts the application that satisfy the filter conditions
5811 * @par This API is for package-manager client application
5812 * @par Sync (or) Async : Synchronous API
5814 * @param[in] handle pointer to the application info filter handle.
5815 * @param[in] count pointer to store count value
5816 * @param[in] uid the addressee user id of the instruction
5817 * @return 0 if success, error code(<0) if fail
5818 * @retval PMINFO_R_OK success
5819 * @retval PMINFO_R_EINVAL invalid argument
5820 * @retval PMINFO_R_ERROR internal error
5821 * @pre pkgmgrinfo_appinfo_filter_create()
5822 * @post pkgmgrinfo_appinfo_filter_destroy()
5823 * @see pkgmgrinfo_appinfo_filter_foreach_appinfo()
5825 static int get_capp_count()
5829 pkgmgrinfo_appinfo_filter_h handle;
5830 ret = pkgmgrinfo_appinfo_filter_create(&handle);
5831 if (ret != PMINFO_R_OK)
5833 ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5834 if (ret != PMINFO_R_OK) {
5835 pkgmgrinfo_appinfo_filter_destroy(handle);
5838 ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5839 if (ret != PMINFO_R_OK) {
5840 pkgmgrinfo_appinfo_filter_destroy(handle);
5843 printf("No of capp: %d\n", count);
5844 pkgmgrinfo_appinfo_filter_destroy(handle);
5849 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5850 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5852 * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5853 * @brief This API creates the application's metadata information filter handle from db.
5855 * @par This API is for package-manager client application
5856 * @par Sync (or) Async : Synchronous API
5858 * @param[out] handle pointer to the application metadata info filter handle.
5859 * @return 0 if success, error code(<0) if fail
5860 * @retval PMINFO_R_OK success
5861 * @retval PMINFO_R_EINVAL invalid argument
5862 * @retval PMINFO_R_ERROR internal error
5864 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
5865 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5867 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5870 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5871 printf("appid : %s\n", appid);
5875 static int get_app_list(const char *mkey, const char *mvalue)
5878 pkgmgrinfo_appinfo_metadata_filter_h handle;
5879 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5880 if (ret != PMINFO_R_OK)
5882 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5883 if (ret != PMINFO_R_OK) {
5884 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5887 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5888 if (ret != PMINFO_R_OK) {
5889 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5892 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5897 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5900 * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5901 * @brief This API destroys the application's metadata information filter handle.
5903 * @par This API is for package-manager client application
5904 * @par Sync (or) Async : Synchronous API
5906 * @param[in] handle pointer to the application metadata info filter handle.
5907 * @return 0 if success, error code(<0) if fail
5908 * @retval PMINFO_R_OK success
5909 * @retval PMINFO_R_EINVAL invalid argument
5910 * @retval PMINFO_R_ERROR internal error
5911 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5913 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5915 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5918 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5919 printf("appid : %s\n", appid);
5923 static int get_app_list(const char *mkey, const char *mvalue)
5926 pkgmgrinfo_appinfo_metadata_filter_h handle;
5927 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5928 if (ret != PMINFO_R_OK)
5930 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5931 if (ret != PMINFO_R_OK) {
5932 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5935 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5936 if (ret != PMINFO_R_OK) {
5937 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5940 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5945 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5948 * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5949 * @brief This API adds filter condition for the query API. The query will search the entire application metadata information collected from
5950 * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5952 * @par This API is for package-manager client application
5953 * @par Sync (or) Async : Synchronous API
5955 * @param[in] handle pointer to the application metadata info filter handle.
5956 * @param[in] key pointer to metadata key
5957 * @param[in] value pointer to metadata value
5958 * @return 0 if success, error code(<0) if fail
5959 * @retval PMINFO_R_OK success
5960 * @retval PMINFO_R_EINVAL invalid argument
5961 * @retval PMINFO_R_ERROR internal error
5962 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
5963 * @post pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5964 * @see pkgmgrinfo_appinfo_metadata_filter_foreach()
5966 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5969 pkgmgrinfo_appinfo_get_appid(handle, &appid);
5970 printf("appid : %s\n", appid);
5974 static int get_app_list(const char *mkey, const char *mvalue)
5977 pkgmgrinfo_appinfo_metadata_filter_h handle;
5978 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5979 if (ret != PMINFO_R_OK)
5981 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5982 if (ret != PMINFO_R_OK) {
5983 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5986 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5987 if (ret != PMINFO_R_OK) {
5988 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5991 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5996 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5997 const char *key, const char *value);
6000 * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
6001 * @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)
6002 * @brief This API executes the filter query. The query will search the entire application metadata information collected from
6003 * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
6004 * negative value, no more callbacks will be called and API will return.
6006 * @par This API is for package-manager client application
6007 * @par Sync (or) Async : Synchronous API
6009 * @param[in] handle pointer to the application metadata info filter handle.
6010 * @param[in] app_cb function pointer to callback
6011 * @param[in] user_data pointer to user data
6012 * @param[in] uid the addressee user id of the instruction
6013 * @return 0 if success, error code(<0) if fail
6014 * @retval PMINFO_R_OK success
6015 * @retval PMINFO_R_EINVAL invalid argument
6016 * @retval PMINFO_R_ERROR internal error
6017 * @pre pkgmgrinfo_appinfo_metadata_filter_create()
6018 * @post pkgmgrinfo_appinfo_metadata_filter_destroy()
6020 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6023 pkgmgrinfo_appinfo_get_appid(handle, &appid);
6024 printf("appid : %s\n", appid);
6028 static int get_app_list(const char *mkey, const char *mvalue)
6031 pkgmgrinfo_appinfo_metadata_filter_h handle;
6032 ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
6033 if (ret != PMINFO_R_OK)
6035 ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
6036 if (ret != PMINFO_R_OK) {
6037 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6040 ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
6041 if (ret != PMINFO_R_OK) {
6042 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6045 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
6050 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6051 pkgmgrinfo_app_list_cb app_cb, void *user_data);
6052 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
6053 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
6056 * @fn int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6057 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6058 * @fn int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6059 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
6060 * @brief This API gets the list of app-control for a particular application
6062 * @par This API is for package-manager client application
6063 * @par Sync (or) Async : Synchronous API
6064 * @param[in] handle pointer to the application info handle.
6065 * @param[in] appcontrol_func callback function for list
6066 * @param[in] user_data user data to be passed to callback function
6067 * @return 0 if success, error code(<0) if fail
6068 * @retval PMINFO_R_OK success
6069 * @retval PMINFO_R_EINVAL invalid argument
6070 * @retval PMINFO_R_ERROR internal error
6071 * @pre pkgmgrinfo_appinfo_get_appinfo()
6072 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6074 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6075 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6077 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
6078 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
6081 * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
6082 * @brief This API creates the package cert information handle to get data from db.
6084 * @par This API is for package-manager client application
6085 * @par Sync (or) Async : Synchronous API
6087 * @param[out] handle pointer to the package cert handle.
6088 * @return 0 if success, error code(<0) if fail
6089 * @retval PMINFO_R_OK success
6090 * @retval PMINFO_R_EINVAL invalid argument
6091 * @retval PMINFO_R_ERROR internal error
6093 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6094 * @see pkgmgrinfo_pkginfo_get_cert_value()
6095 * @see pkgmgrinfo_pkginfo_load_certinfo()
6097 static int get_cert_info(const char *pkgid)
6100 pkgmgrinfo_certinfo_h handle;
6101 char *auth_cert = NULL;
6102 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6103 if (ret != PMINFO_R_OK)
6105 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6106 if (ret != PMINFO_R_OK) {
6107 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6110 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6111 if (ret != PMINFO_R_OK) {
6112 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6115 printf("Author root certificate: %s\n", auth_root);
6116 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6121 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
6124 * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
6125 * @brief This API loads the package cert information handle with data from db.
6127 * @par This API is for package-manager client application
6128 * @par Sync (or) Async : Synchronous API
6130 * @param[in] pkgid pointer to the package ID.
6131 * @param[in] handle pointer to the package cert handle.
6132 * @return 0 if success, error code(<0) if fail
6133 * @retval PMINFO_R_OK success
6134 * @retval PMINFO_R_EINVAL invalid argument
6135 * @retval PMINFO_R_ERROR internal error
6136 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6137 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6138 * @see pkgmgrinfo_pkginfo_get_cert_value()
6140 static int get_cert_info(const char *pkgid)
6143 pkgmgrinfo_certinfo_h handle;
6144 char *auth_cert = NULL;
6145 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6146 if (ret != PMINFO_R_OK)
6148 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6149 if (ret != PMINFO_R_OK) {
6150 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6153 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6154 if (ret != PMINFO_R_OK) {
6155 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6158 printf("Author root certificate: %s\n", auth_root);
6159 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6164 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
6167 * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
6168 * @brief This API gets the package cert information from the handle
6170 * @par This API is for package-manager client application
6171 * @par Sync (or) Async : Synchronous API
6173 * @param[in] handle pointer to the package cert handle.
6174 * @param[in] cert_type certificate type
6175 * @param[out] cert_value pointer to hold certificate value
6176 * @return 0 if success, error code(<0) if fail
6177 * @retval PMINFO_R_OK success
6178 * @retval PMINFO_R_EINVAL invalid argument
6179 * @retval PMINFO_R_ERROR internal error
6180 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6181 * @post pkgmgrinfo_pkginfo_destroy_certinfo()
6182 * @see pkgmgrinfo_pkginfo_load_certinfo()
6184 static int get_cert_info(const char *pkgid)
6187 pkgmgrinfo_certinfo_h handle;
6188 char *auth_cert = NULL;
6189 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6190 if (ret != PMINFO_R_OK)
6192 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6193 if (ret != PMINFO_R_OK) {
6194 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6197 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6198 if (ret != PMINFO_R_OK) {
6199 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6202 printf("Author root certificate: %s\n", auth_root);
6203 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6208 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
6211 * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
6212 * @brief This API destroys the package cert information handle freeing up all the resources
6214 * @par This API is for package-manager client application
6215 * @par Sync (or) Async : Synchronous API
6217 * @param[in] handle pointer to the package cert handle.
6218 * @return 0 if success, error code(<0) if fail
6219 * @retval PMINFO_R_OK success
6220 * @retval PMINFO_R_EINVAL invalid argument
6221 * @retval PMINFO_R_ERROR internal error
6222 * @pre pkgmgrinfo_pkginfo_create_certinfo()
6224 * @see pkgmgrinfo_pkginfo_load_certinfo()
6226 static int get_cert_info(const char *pkgid)
6229 pkgmgrinfo_certinfo_h handle;
6230 char *auth_cert = NULL;
6231 ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
6232 if (ret != PMINFO_R_OK)
6234 ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
6235 if (ret != PMINFO_R_OK) {
6236 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6239 ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
6240 if (ret != PMINFO_R_OK) {
6241 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6244 printf("Author root certificate: %s\n", auth_root);
6245 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
6250 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
6253 * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
6254 * @brief This API deletes the package cert information from DB
6256 * @par This API is for package-manager client application
6257 * @par Sync (or) Async : Synchronous API
6259 * @param[in] pkgid pointer to the package ID.
6260 * @return 0 if success, error code(<0) if fail
6261 * @retval PMINFO_R_OK success
6262 * @retval PMINFO_R_EINVAL invalid argument
6263 * @retval PMINFO_R_ERROR internal error
6267 static int delete_cert_info(const char *pkgid)
6270 ret = pkgmgrinfo_delete_certinfo(pkgid);
6271 if (ret != PMINFO_R_OK)
6277 int pkgmgrinfo_delete_certinfo(const char *pkgid);
6278 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
6281 * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
6282 * @brief This API creates the package cert information handle to set data in db.
6284 * @par This API is for package-manager client application
6285 * @par Sync (or) Async : Synchronous API
6287 * @param[out] handle pointer to the package cert handle.
6288 * @return 0 if success, error code(<0) if fail
6289 * @retval PMINFO_R_OK success
6290 * @retval PMINFO_R_EINVAL invalid argument
6291 * @retval PMINFO_R_ERROR internal error
6293 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6294 * @see pkgmgrinfo_set_cert_value()
6295 * @see pkgmgrinfo_save_certinfo()
6297 static int set_cert_in_db(const char *pkgid)
6300 pkgmgrinfo_instcertinfo_h handle;
6301 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6302 if (ret != PMINFO_R_OK)
6304 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6305 if (ret != PMINFO_R_OK) {
6306 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6309 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6310 if (ret != PMINFO_R_OK) {
6311 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6314 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6319 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
6322 * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
6323 * @brief This API sets the package cert information in the handle.
6325 * @par This API is for package-manager client application
6326 * @par Sync (or) Async : Synchronous API
6328 * @param[in] handle pointer to the package cert handle.
6329 * @param[in] cert_type certificate type.
6330 * @param[in] cert_value certificate value.
6331 * @return 0 if success, error code(<0) if fail
6332 * @retval PMINFO_R_OK success
6333 * @retval PMINFO_R_EINVAL invalid argument
6334 * @retval PMINFO_R_ERROR internal error
6335 * @pre pkgmgrinfo_create_certinfo_set_handle()
6336 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6337 * @see pkgmgrinfo_save_certinfo()
6339 static int set_cert_in_db(const char *pkgid)
6342 pkgmgrinfo_instcertinfo_h handle;
6343 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6344 if (ret != PMINFO_R_OK)
6346 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6347 if (ret != PMINFO_R_OK) {
6348 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6351 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6352 if (ret != PMINFO_R_OK) {
6353 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6356 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6361 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
6364 * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
6365 * @brief This API saves the package cert information in the DB.
6367 * @par This API is for package-manager client application
6368 * @par Sync (or) Async : Synchronous API
6370 * @param[in] pkgid pointer to the package ID.
6371 * @param[in] handle pointer to the package cert handle.
6372 * @return 0 if success, error code(<0) if fail
6373 * @retval PMINFO_R_OK success
6374 * @retval PMINFO_R_EINVAL invalid argument
6375 * @retval PMINFO_R_ERROR internal error
6376 * @pre pkgmgrinfo_create_certinfo_set_handle()
6377 * @post pkgmgrinfo_destroy_certinfo_set_handle()
6378 * @see pkgmgrinfo_save_certinfo()
6380 static int set_cert_in_db(const char *pkgid)
6383 pkgmgrinfo_instcertinfo_h handle;
6384 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6385 if (ret != PMINFO_R_OK)
6387 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6388 if (ret != PMINFO_R_OK) {
6389 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6392 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6393 if (ret != PMINFO_R_OK) {
6394 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6397 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6402 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
6405 * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
6406 * @brief This API destroys the package cert information handle freeing up all the resources.
6408 * @par This API is for package-manager client application
6409 * @par Sync (or) Async : Synchronous API
6411 * @param[in] handle pointer to the package cert handle.
6412 * @return 0 if success, error code(<0) if fail
6413 * @retval PMINFO_R_OK success
6414 * @retval PMINFO_R_EINVAL invalid argument
6415 * @retval PMINFO_R_ERROR internal error
6416 * @pre pkgmgrinfo_create_certinfo_set_handle()
6418 * @see pkgmgrinfo_save_certinfo()
6420 static int set_cert_in_db(const char *pkgid)
6423 pkgmgrinfo_instcertinfo_h handle;
6424 ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
6425 if (ret != PMINFO_R_OK)
6427 ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
6428 if (ret != PMINFO_R_OK) {
6429 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6432 ret = pkgmgrinfo_save_certinfo(pkgid, handle);
6433 if (ret != PMINFO_R_OK) {
6434 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6437 pkgmgrinfo_destroy_certinfo_set_handle(handle);
6442 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
6445 * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
6446 * @brief This API gets the application 'guest mode visibility' value from the DB
6448 * @par This API is for package-manager client application
6449 * @par Sync (or) Async : Synchronous API
6451 * @param[in] handle pointer to application info handle
6452 * @param[out] status pointer to hold app guest mode visibility value
6453 * @return 0 if success, error code(<0) if fail
6454 * @retval PMINFO_R_OK success
6455 * @retval PMINFO_R_EINVAL invalid argument
6456 * @retval PMINFO_R_ERROR internal error
6457 * @pre pkgmgrinfo_appinfo_get_appinfo()
6458 * @post pkgmgrinfo_appinfo_destroy_appinfo()
6459 * @see pkgmgrinfo_appinfo_get_appid()
6460 * @see pkgmgrinfo_appinfo_is_multiple()
6462 static int get_app_guestmode_visibility(const char *appid)
6466 pkgmgrinfo_appinfo_h handle;
6467 ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6468 if (ret != PMINFO_R_OK)
6470 ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6471 if (ret != PMINFO_R_OK) {
6472 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6475 printf("app guest mode visibility: %d\n", status);
6476 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6481 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6484 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6485 * @brief This API sets the package 'installed_storage' value in db
6487 * @par This API is for package-manager client application
6488 * @par Sync (or) Async : Synchronous API
6490 * @param[in] pkgid pointer to the package ID.
6491 * @param[in] location package install location
6492 * @param[in] external_pkg_path image path if pkg has installed at external storage
6493 * @return 0 if success, error code(<0) if fail
6494 * @retval PMINFO_R_OK success
6495 * @retval PMINFO_R_EINVAL invalid argument
6496 * @retval PMINFO_R_ERROR internal error
6498 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6502 ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6503 if (ret != PMINFO_R_OK) {
6510 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6511 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6513 /* version compare */
6514 int pkgmgrinfo_compare_package_version(const char *current_version,
6515 const char *target_version, pkgmgrinfo_version_compare_type *res);
6518 * @fn int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6519 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6521 * @brief This API gets the list of dependency of a particular package
6523 * @par This API is for package-manager client application
6524 * @par Sync (or) Async : Synchronous API
6525 * @param[in] handle pointer to the package info handle.
6526 * @param[in] dependency_cb callback function for list
6527 * @param[in] user_data user data to be passed to callback function
6528 * @return 0 if success, error code(<0) if fail
6529 * @retval PMINFO_R_OK success
6530 * @retval PMINFO_R_EINVAL invalid argument
6531 * @retval PMINFO_R_ERROR internal error
6532 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6533 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6535 int dependency_cb(const char *from const char *to, const char *type,
6536 const char *required_version,void *user_data)
6538 printf("this package %s %s", type, to);
6539 if (required_version)
6540 printf("required version : %s", required_version);
6544 static int list_dependency(const char *package)
6547 pkgmgrinfo_pkginfo_h handle;
6548 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6549 if (ret != PMINFO_R_OK)
6551 ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6552 if (ret != PMINFO_R_OK) {
6553 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6556 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6561 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6562 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6566 * @fn int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6567 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6569 * @brief This API gets the list of packages which has dependency directly
6570 * and indirectly of a particular package
6572 * @par This API is for package-manager client application
6573 * @par Sync (or) Async : Synchronous API
6574 * @param[in] handle pointer to the package info handle.
6575 * @param[in] dependency_cb callback function for list
6576 * @param[in] user_data user data to be passed to callback function
6577 * @return 0 if success, error code(<0) if fail
6578 * @retval PMINFO_R_OK success
6579 * @retval PMINFO_R_EINVAL invalid argument
6580 * @retval PMINFO_R_ERROR internal error
6581 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6582 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6584 int dependency_cb(const char *from, const char *to, const char *type,
6585 const char *required_version,void *user_data)
6587 printf("%s %s %s package", from, to, type);
6588 if (required_version)
6589 printf("required version : %s", required_version);
6593 static int list_depends_on(const char *package)
6596 pkgmgrinfo_pkginfo_h handle;
6597 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6598 if (ret != PMINFO_R_OK)
6600 ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6601 if (ret != PMINFO_R_OK) {
6602 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6605 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6610 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6611 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6615 * @fn int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6616 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6618 * @brief This API gets the list of allowed package for a particular package
6620 * @par This API is for package-manager client application
6621 * @par Sync (or) Async : Synchronous API
6622 * @param[in] handle pointer to the package info handle.
6623 * @param[in] res_allowed_package_cb callback function for list
6624 * @param[in] user_data user data to be passed to callback function
6625 * @return 0 if success, error code(<0) if fail
6626 * @retval PMINFO_R_OK success
6627 * @retval PMINFO_R_EINVAL invalid argument
6628 * @retval PMINFO_R_ERROR internal error
6629 * @pre pkgmgrinfo_pkginfo_get_pkginfo()
6630 * @post pkgmgrinfo_pkginfo_destroy_pkginfo()
6632 int res_allowed_package_cb(const char *allowed_package,
6633 required_privilege_h handle, void *user_data)
6635 printf("allowed package : %s", allowed_package);
6640 static int list_res_allowed_package(const char *package)
6643 pkgmgrinfo_pkginfo_h handle;
6644 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6645 if (ret != PMINFO_R_OK)
6647 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6648 if (ret != PMINFO_R_OK) {
6649 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6652 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6657 int pkgmgrinfo_pkginfo_foreach_res_allowed_package(pkgmgrinfo_pkginfo_h handle,
6658 pkgmgrinfo_res_allowed_package_list_cb res_allowed_package_cb,
6662 * @fn int pkgmgrinfo_pkginfo_foreach_required_privilege(
6663 required_privilege_h handle,
6664 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6666 * @brief This API gets the list of allowed package's required privileges
6668 * @par This API is for package-manager client application
6669 * @par Sync (or) Async : Synchronous API
6670 * @param[in] handle pointer to the required privilege handle.
6671 * @param[in] privilege_func callback function for list
6672 * @param[in] user_data user data to be passed to callback function
6673 * @return 0 if success, error code(<0) if fail
6674 * @retval PMINFO_R_OK success
6675 * @retval PMINFO_R_EINVAL invalid argument
6676 * @pre pkgmgrinfo_pkginfo_foreach_res_allowed_package()
6679 int privilege_func(const char *privilege_name, void *user_data)
6681 printf("required privilege : %s", privilege_name);
6686 int res_allowed_package_cb(const char *allowed_package,
6687 required_privilege_h handle, void *user_data)
6690 printf("allowed package : %s", allowed_package);
6692 ret = pkgmgrinfo_pkginfo_foreach_required_privilege(handle, privilege_func, user_data);
6693 if (ret != PMINFO_R_OK)
6699 static int list_res_allowed_package(const char *package)
6702 pkgmgrinfo_pkginfo_h handle;
6703 ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6704 if (ret != PMINFO_R_OK)
6706 ret = pkgmgrinfo_pkginfo_foreach_res_allowed_package(handle, res_allowed_package_cb, NULL);
6707 if (ret != PMINFO_R_OK) {
6708 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6711 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6716 int pkgmgrinfo_pkginfo_foreach_required_privilege(
6717 required_privilege_h handle,
6718 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
6722 * @fn int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6723 * @brief This API gets list of installed packages using flag that used for masking package's information
6725 * @par This API is for package-manager client application
6726 * @par Sync (or) Async : Synchronous API
6727 * @param[in] pkg_list_cb iteration function for list
6728 * @param[in] flag enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6729 * @param[in] user_data user data to be passed to callback function
6730 * @return 0 if success, error code(<0) if fail
6731 * @retval PMINFO_R_OK success
6732 * @retval PMINFO_R_EINVAL invalid argument
6733 * @retval PMINFO_R_ERROR internal error
6736 * @see pkgmgrinfo_pkginfo_get_option
6738 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6740 char *label1 = NULL;
6741 char *label2 = NULL;
6742 label1 = (char *)user_data;
6743 pkgmgrinfo_pkginfo_get_label(handle, &label2);
6744 if (strcmp(label1, label2) == 0)
6750 static int list_pkgs()
6753 char *label = "helloworld";
6754 ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6755 if (ret != PMINFO_R_OK)
6761 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6762 int flag, void *user_data, uid_t uid);
6763 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6764 int flag, void *user_data);
6767 * @fn int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6768 * @brief This API gets list of installed applications from all packages using flag that used for masking application's information
6770 * @par This API is for package-manager client application
6771 * @par Sync (or) Async : Synchronous API
6772 * @param[in] app_func iteration function for list
6773 * @param[in] flag enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6774 * @param[in] user_data user data to be passed to callback function
6775 * @return 0 if success, error code(<0) if fail
6776 * @retval PMINFO_R_OK success
6777 * @retval PMINFO_R_EINVAL invalid argument
6778 * @retval PMINFO_R_ERROR internal error
6781 * @see pkgmgrinfo_appinfo_get_option
6783 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6786 char *label1 = NULL;
6787 char *label2 = NULL;
6788 label1 = (char *)user_data;
6789 ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6790 if (ret != PMINFO_R_OK) {
6791 printf("pkgmgrinfo_appinfo_get_label fail");
6794 if (strcmp(label1, label2) == 0)
6800 static int list_apps()
6803 char *label = "helloworld";
6804 ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6805 if (ret != PMINFO_R_OK)
6811 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6812 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6814 int pkgmgrinfo_appinfo_get_installed_list_full(
6815 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6818 * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6819 * @brief This API creates the package archive information handle from given path
6821 * @par This API is for package-manager client application
6822 * @par Sync (or) Async : Synchronous API
6824 * @param[in] path path of package archive
6825 * @param[out] handle pointer to the package archive info handle
6826 * @return 0 if success, error code(<0) if fail
6827 * @retval PMINFO_R_OK success
6828 * @retval PMINFO_R_EINVAL invalid argument
6829 * @retval PMINFO_R_ERROR internal error
6831 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6833 static int get_pkg_archive_type(const char *path)
6837 pkgmgrinfo_archiveinfo_h handle;
6838 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6839 if (ret != PMINFO_R_OK)
6841 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6842 if (ret != PMINFO_R_OK) {
6843 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6846 printf("pkg archive type: %s\n", type);
6847 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6852 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6853 pkgmgrinfo_archiveinfo_h *handle);
6856 * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6857 * @brief This API destroys the package archive information handle freeing up all the resources
6859 * @par This API is for package-manager client application
6860 * @par Sync (or) Async : Synchronous API
6862 * @param[in] handle pointer to the package archive info handle
6863 * @return 0 if success, error code(<0) if fail
6864 * @retval PMINFO_R_OK success
6865 * @retval PMINFO_R_EINVAL invalid argument
6866 * @pre pkgmgrinfo_archiveinfo_get_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_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6891 * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6892 * @brief This API gets the package id from the package archive info handle
6894 * @par This API is for package-manager client application
6895 * @par Sync (or) Async : Synchronous API
6897 * @param[in] handle pointer to package archive info handle
6898 * @param[out] pkgid pointer to hold package id
6899 * @return 0 if success, error code(<0) if fail
6900 * @retval PMINFO_R_OK success
6901 * @retval PMINFO_R_EINVAL invalid argument
6902 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6903 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6905 static int get_pkg_archive_id(const char *path)
6908 char *pkg_id = NULL;
6909 pkgmgrinfo_archiveinfo_h handle;
6910 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6911 if (ret != PMINFO_R_OK)
6913 ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6914 if (ret != PMINFO_R_OK) {
6915 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6918 printf("pkg archive id: %s\n", pkg_id);
6919 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6924 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6925 const char **pkgid);
6928 * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6929 * @brief This API gets the package type from the package archive info handle
6931 * @par This API is for package-manager client application
6932 * @par Sync (or) Async : Synchronous API
6934 * @param[in] handle pointer to package archive info handle
6935 * @param[out] type pointer to hold package type
6936 * @return 0 if success, error code(<0) if fail
6937 * @retval PMINFO_R_OK success
6938 * @retval PMINFO_R_EINVAL invalid argument
6939 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6940 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6942 static int get_pkg_archive_type(const char *path)
6946 pkgmgrinfo_archiveinfo_h handle;
6947 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6948 if (ret != PMINFO_R_OK)
6950 ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6951 if (ret != PMINFO_R_OK) {
6952 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6955 printf("pkg archive type: %s\n", type);
6956 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6961 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6965 * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6966 * @brief This API gets the package version from the package archive info handle
6968 * @par This API is for package-manager client application
6969 * @par Sync (or) Async : Synchronous API
6971 * @param[in] handle pointer to package archive info handle
6972 * @param[out] version pointer to hold package version
6973 * @return 0 if success, error code(<0) if fail
6974 * @retval PMINFO_R_OK success
6975 * @retval PMINFO_R_EINVAL invalid argument
6976 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
6977 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6979 static int get_pkg_archive_version(const char *path)
6982 char *version = NULL;
6983 pkgmgrinfo_archiveinfo_h handle;
6984 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6985 if (ret != PMINFO_R_OK)
6987 ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6988 if (ret != PMINFO_R_OK) {
6989 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6992 printf("pkg archive version: %s\n", version);
6993 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6998 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6999 const char **version);
7002 * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
7003 * @brief This API gets the package api version from the package archive info handle
7005 * @par This API is for package-manager client application
7006 * @par Sync (or) Async : Synchronous API
7008 * @param[in] handle pointer to package archive info handle
7009 * @param[out] api_version pointer to hold package api_version
7010 * @return 0 if success, error code(<0) if fail
7011 * @retval PMINFO_R_OK success
7012 * @retval PMINFO_R_EINVAL invalid argument
7013 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7014 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7016 static int get_pkg_archive_api_version(const char *path)
7019 char *api_version = NULL;
7020 pkgmgrinfo_archiveinfo_h handle;
7021 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7022 if (ret != PMINFO_R_OK)
7024 ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
7025 if (ret != PMINFO_R_OK) {
7026 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7029 printf("pkg archive api_version: %s\n", api_version);
7030 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7035 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
7036 const char **api_version);
7039 * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
7040 * @brief This API gets the package description from the package archive info handle
7042 * @par This API is for package-manager client application
7043 * @par Sync (or) Async : Synchronous API
7045 * @param[in] handle pointer to package archive info handle
7046 * @param[out] description pointer to hold package description
7047 * @return 0 if success, error code(<0) if fail
7048 * @retval PMINFO_R_OK success
7049 * @retval PMINFO_R_EINVAL invalid argument
7050 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7051 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7053 static int get_pkg_archive_description(const char *path)
7056 char *description = NULL;
7057 pkgmgrinfo_archiveinfo_h handle;
7058 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7059 if (ret != PMINFO_R_OK)
7061 ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
7062 if (ret != PMINFO_R_OK) {
7063 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7066 printf("pkg archive description: %s\n", description);
7067 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7072 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
7073 const char **description);
7076 * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
7077 * @brief This API gets the package label from the package archive info handle
7079 * @par This API is for package-manager client application
7080 * @par Sync (or) Async : Synchronous API
7082 * @param[in] handle pointer to package archive info handle
7083 * @param[out] label pointer to hold package label
7084 * @return 0 if success, error code(<0) if fail
7085 * @retval PMINFO_R_OK success
7086 * @retval PMINFO_R_EINVAL invalid argument
7087 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7088 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7090 static int get_pkg_archive_label(const char *path)
7094 pkgmgrinfo_archiveinfo_h handle;
7095 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7096 if (ret != PMINFO_R_OK)
7098 ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
7099 if (ret != PMINFO_R_OK) {
7100 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7103 printf("pkg archive label: %s\n", label);
7104 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7109 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
7110 const char **label);
7113 * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
7114 * @brief This API gets the package author from the package archive info handle
7116 * @par This API is for package-manager client application
7117 * @par Sync (or) Async : Synchronous API
7119 * @param[in] handle pointer to package archive info handle
7120 * @param[out] author pointer to hold package author
7121 * @return 0 if success, error code(<0) if fail
7122 * @retval PMINFO_R_OK success
7123 * @retval PMINFO_R_EINVAL invalid argument
7124 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7125 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7127 static int get_pkg_archive_author(const char *path)
7130 char *author = NULL;
7131 pkgmgrinfo_archiveinfo_h handle;
7132 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7133 if (ret != PMINFO_R_OK)
7135 ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
7136 if (ret != PMINFO_R_OK) {
7137 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7140 printf("pkg archive author: %s\n", author);
7141 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7146 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
7147 const char **author);
7150 * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
7151 * @brief This API gets the package icon and size from the package archive info handle
7153 * @par This API is for package-manager client application
7154 * @par Sync (or) Async : Synchronous API
7156 * @param[in] handle pointer to package archive info handle
7157 * @param[out] icon pointer to hold package icon
7158 * @param[out] size pointer to hold size of package icon
7159 * @return 0 if success, error code(<0) if fail
7160 * @retval PMINFO_R_OK success
7161 * @retval PMINFO_R_EINVAL invalid argument
7162 * @retval PMINFO_R_ENOENT no result
7163 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7164 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7166 static int get_pkg_archive_icon(const char *path)
7169 unsigned char *icon = NULL;
7170 size_t icon_size = 0;
7171 pkgmgrinfo_archiveinfo_h handle;
7172 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7173 if (ret != PMINFO_R_OK)
7175 ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
7176 if (ret != PMINFO_R_OK) {
7177 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7180 printf("pkg archive icon size : %zu\n", icon_size);
7181 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7186 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
7187 const unsigned char **icon, size_t *size);
7190 * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
7191 * @brief This API retrieve the dependency information and invoke given callback for it.
7193 * @par This API is for package-manager client application
7194 * @par Sync (or) Async : Synchronous API
7196 * @param[in] handle pointer to package archive info handle
7197 * @param[in] callback callback to be invoked for each retrieved dependency information
7198 * @param[in] user_data user data to be passed to callback
7199 * @return 0 if success, error code(<0) if fail
7200 * @retval PMINFO_R_OK success
7201 * @retval PMINFO_R_EINVAL invalid argument
7202 * @retval PMINFO_R_ERROR internal error
7203 * @pre pkgmgrinfo_archiveinfo_get_archiveinfo()
7204 * @post pkgmgrinfo_archiveinfo_destroy_archiveinfo()
7206 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
7209 size_t icon_size = 0;
7210 pkgmgrinfo_archiveinfo_h handle;
7211 ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
7212 if (ret != PMINFO_R_OK)
7214 ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
7215 if (ret != PMINFO_R_OK) {
7216 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7219 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
7224 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
7225 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
7228 * @pkgmgrinfo client API end
7236 #endif /* __PKG_INFO_H__ */